html-crush 6.0.9 → 6.0.10

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.
@@ -1,32 +1,24 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minify email templates
4
- * @version 6.0.9
4
+ * @version 6.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- import{rApply as le}from"ranges-apply";import{Ranges as oe}from"ranges-push";import{matchLeft as te,matchRight as F,matchRightIncl as q}from"string-match-left-right";import{expander as B}from"string-range-expander";import{left as _,right as m}from"string-left-right";function O(n){return p(n)&&n.length===1&&n.toUpperCase()!==n.toLowerCase()}function Y(n){if(n==null||typeof n!="object")return!1;let b=Object.getPrototypeOf(n);return b!==null&&b!==Object.prototype&&Object.getPrototypeOf(b)!==null?!1:!(Symbol.iterator in n)&&!(Symbol.toStringTag in n)}function p(n){return typeof n=="string"}var K="6.0.9";var he=K,$=new oe({limitToBeAddedWhitespace:!0}),ie={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 fe(n,b){let x=Date.now();if(!p(n))throw n===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
11
- ${JSON.stringify(n,null,4)}`);if(b&&!Y(b))throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof b}, equal to ${JSON.stringify(b,null,4)}`);if(b&&Array.isArray(b.breakToTheLeftOf)&&b.breakToTheLeftOf.length){for(let e=0,w=b.breakToTheLeftOf.length;e<w;e++)if(!p(b.breakToTheLeftOf[e]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${e} is of a type "${typeof b.breakToTheLeftOf[e]}" and is equal to:
12
- ${JSON.stringify(b.breakToTheLeftOf[e],null,4)}`)}let l={...ie,...b};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let v="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(v=[...new Set(l.breakToTheLeftOf.map(e=>e[0]))].join(""));let C={removeHTMLComments:!1,removeCSSComments:!1},S=null,i=null,D=!1,r=0,H=0,c=!1,V=!1,g=null,E=null,A=null,R=null,u,t=null,s=null,a=null,d=null,L=null,M=null,P=">};",I="<",Q="!",X=">",z="<",G="{},:;<>~+",U=G,J=G,y=!0,f=n.length,Z=Math.floor(f/2),W=.01,j;l.reportProgressFunc&&(j=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*W-l.reportProgressFuncFrom));let T,k=0,h=`
10
+ import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";import{isStr as A,isLetter as y,isPlainObject as te}from"codsen-utils";var Y="6.0.10";var be=Y,$=new le({limitToBeAddedWhitespace:!0}),ie={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 he(n,E){let x=Date.now();if(!A(n))throw n===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof n}", equal to:
11
+ ${JSON.stringify(n,null,4)}`);if(E&&!te(E))throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof E}, equal to ${JSON.stringify(E,null,4)}`);if(E&&Array.isArray(E.breakToTheLeftOf)&&E.breakToTheLeftOf.length){for(let e=0,w=E.breakToTheLeftOf.length;e<w;e++)if(!A(E.breakToTheLeftOf[e]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${e} is of a type "${typeof E.breakToTheLeftOf[e]}" and is equal to:
12
+ ${JSON.stringify(E.breakToTheLeftOf[e],null,4)}`)}let l={...ie,...E};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let v="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(v=[...new Set(l.breakToTheLeftOf.map(e=>e[0]))].join(""));let L={removeHTMLComments:!1,removeCSSComments:!1},p=null,i=null,S=!1,m=0,H=0,g=!1,O=!1,c=null,f=null,V=null,U=null,u,t=null,s=null,r=null,T=null,D=null,M=null,P=">};",I="<",K="!",q=">",z="<",W="{},:;<>~+",k=W,J=W,C=!0,h=n.length,Q=Math.floor(h/2),B=.01,j;l.reportProgressFunc&&(j=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*B-l.reportProgressFuncFrom));let d,R=0,b=`
13
13
  `;if(n.includes(`\r
14
- `)?h=`\r
15
- `:n.includes("\r")&&(h="\r"),f){for(let e=0;e<f;e++){if(l.reportProgressFunc&&(f>1e3&&f<2e3?e===Z&&l.reportProgressFunc(Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)/2)):f>=2e3&&(T=l.reportProgressFuncFrom+Math.floor(e/f*(j||1)),T!==k&&(k=T,l.reportProgressFunc(T)))),H++,!u&&c&&n[e]==="}"&&n[e-1]==="}"&&(r+1>=l.lineLengthLimit?($.push(e,e,h),r=0):(t=e,s=e,a=" ")),u&&typeof u=="number"&&e>=u&&(u=void 0),R!==null&&n.startsWith("</script",e)&&!O(n[e+8])){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&!n[~-e].trim()){for(let o=e;o--;)if(n[o]===`
16
- `||n[o]==="\r"||n[o].trim()){o+1<e&&$.push(o+1,e);break}}R=null,u=!1,e+=8;continue}if(!u&&!c&&n.startsWith("<script",e)&&!O(n[e+7])){R=e,u=!0;let o="";(l.removeLineBreaks||l.removeIndentations)&&i!==null&&(i>0&&(o=h),$.push(i,e,o)),i=null,S=null}if(L!==null&&d===null&&!/\w/.test(n[e])){d=n.slice(L,e);let o=m(n,~-e);typeof o=="number"&&n[o]===">"&&!n[e].trim()&&m(n,e)?$.push(e,m(n,e)):o&&n[o]==="/"&&n[m(n,o)]===">"&&(!n[e].trim()&&m(n,e)&&$.push(e,m(n,e)),n[o+1]!==">"&&m(n,o+1)&&$.push(o+1,m(n,o+1)))}if(!u&&!c&&!g&&n[~-e]==="<"&&L===null&&(/\w/.test(n[e])?L=e:n[m(n,~-e)]==="/"&&/\w/.test(n[m(n,m(n,~-e))]||"")&&(L=m(n,m(n,~-e)))),!u&&(c||g)&&E!==null&&n[e]==="*"&&n[e+1]==="/"&&([t,s]=B({str:n,from:E,to:e+2,ifLeftSideIncludesThisThenCropTightly:U||"",ifRightSideIncludesThisThenCropTightly:J||""}),E=null,t!=null?$.push(t,s):(r+=1,e+=1),u=e+2),!u&&(c||g)&&E===null&&n[e]==="/"&&n[e+1]==="*"&&(C.removeCSSComments||(C.removeCSSComments=!0),l.removeCSSComments&&(E=e)),V&&n.startsWith("![endif",e+1)&&(V=!1),!u&&!c&&!g&&A!==null){let o;n.startsWith("-->",e)?o=3:n[e]===">"&&n[e-1]==="]"&&(o=1),o&&([t,s]=B({str:n,from:A,to:e+o}),A=null,t!=null?l.lineLengthLimit&&H-(s-t)>=l.lineLengthLimit?($.push(t,s,h),H=-o):($.push(t,s),H-=s-t):(r+=o-1,e+=o-1),u=e+o)}if(!u&&!c&&!g&&(n.startsWith("<!--",e)||l.removeHTMLComments===2&&n.startsWith("<![endif",e))&&A===null&&(n.startsWith("[if",e+4)?(V||(V=!0),l.removeHTMLComments===2&&(A=e)):l.removeHTMLComments&&(!V||l.removeHTMLComments===2)&&(A=e),C.removeHTMLComments||(C.removeHTMLComments=!0)),!u&&c&&E===null&&n.startsWith("</style",e)&&!O(n[e+7])?c=!1:!u&&!c&&E===null&&n.startsWith("<style",e)&&!O(n[e+6])&&(c=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&$.push(e+23,e+23,h)),!u&&!g&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(g=e),!u&&!n[e].trim())i===null&&(i=e);else if(!u&&!((c||g)&&E!==null)){if(i!==null){if(l.removeLineBreaks&&(r+=1),y)y=!1,(l.removeIndentations||l.removeLineBreaks)&&$.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!D&&S!==null&&e>S?$.push(S+1,e):i+1<e&&(n.endsWith("]>",i)||n.endsWith("-->",i)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?$.push(i,e):n[i]===" "?$.push(i+1,e):n[~-e]===" "?$.push(i,~-e):$.push(i,e," "))),l.removeLineBreaks||g){if(v.includes(n[e])&&q(n,e,l.breakToTheLeftOf)){!(`\r
14
+ `)?b=`\r
15
+ `:n.includes("\r")&&(b="\r"),h){for(let e=0;e<h;e++){if(l.reportProgressFunc&&(h>1e3&&h<2e3?e===Q&&l.reportProgressFunc(Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)/2)):h>=2e3&&(d=l.reportProgressFuncFrom+Math.floor(e/h*(j||1)),d!==R&&(R=d,l.reportProgressFunc(d)))),H++,!u&&g&&n[e]==="}"&&n[e-1]==="}"&&(m+1>=l.lineLengthLimit?($.push(e,e,b),m=0):(t=e,s=e,r=" ")),u&&typeof u=="number"&&e>=u&&(u=void 0),U!==null&&n.startsWith("</script",e)&&!y(n[e+8])){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&!n[~-e].trim()){for(let o=e;o--;)if(n[o]===`
16
+ `||n[o]==="\r"||n[o].trim()){o+1<e&&$.push(o+1,e);break}}U=null,u=!1,e+=8;continue}if(!u&&!g&&n.startsWith("<script",e)&&!y(n[e+7])){U=e,u=!0;let o="";(l.removeLineBreaks||l.removeIndentations)&&i!==null&&(i>0&&(o=b),$.push(i,e,o)),i=null,p=null}if(D!==null&&T===null&&!/\w/.test(n[e])){T=n.slice(D,e);let o=a(n,~-e);typeof o=="number"&&n[o]===">"&&!n[e].trim()&&a(n,e)?$.push(e,a(n,e)):o&&n[o]==="/"&&n[a(n,o)]===">"&&(!n[e].trim()&&a(n,e)&&$.push(e,a(n,e)),n[o+1]!==">"&&a(n,o+1)&&$.push(o+1,a(n,o+1)))}if(!u&&!g&&!c&&n[~-e]==="<"&&D===null&&(/\w/.test(n[e])?D=e:n[a(n,~-e)]==="/"&&/\w/.test(n[a(n,a(n,~-e))]||"")&&(D=a(n,a(n,~-e)))),!u&&(g||c)&&f!==null&&n[e]==="*"&&n[e+1]==="/"&&([t,s]=_({str:n,from:f,to:e+2,ifLeftSideIncludesThisThenCropTightly:k||"",ifRightSideIncludesThisThenCropTightly:J||""}),f=null,t!=null?$.push(t,s):(m+=1,e+=1),u=e+2),!u&&(g||c)&&f===null&&n[e]==="/"&&n[e+1]==="*"&&(L.removeCSSComments||(L.removeCSSComments=!0),l.removeCSSComments&&(f=e)),O&&n.startsWith("![endif",e+1)&&(O=!1),!u&&!g&&!c&&V!==null){let o;n.startsWith("-->",e)?o=3:n[e]===">"&&n[e-1]==="]"&&(o=1),o&&([t,s]=_({str:n,from:V,to:e+o}),V=null,t!=null?l.lineLengthLimit&&H-(s-t)>=l.lineLengthLimit?($.push(t,s,b),H=-o):($.push(t,s),H-=s-t):(m+=o-1,e+=o-1),u=e+o)}if(!u&&!g&&!c&&(n.startsWith("<!--",e)||l.removeHTMLComments===2&&n.startsWith("<![endif",e))&&V===null&&(n.startsWith("[if",e+4)?(O||(O=!0),l.removeHTMLComments===2&&(V=e)):l.removeHTMLComments&&(!O||l.removeHTMLComments===2)&&(V=e),L.removeHTMLComments||(L.removeHTMLComments=!0)),!u&&g&&f===null&&n.startsWith("</style",e)&&!y(n[e+7])?g=!1:!u&&!g&&f===null&&n.startsWith("<style",e)&&!y(n[e+6])&&(g=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&$.push(e+23,e+23,b)),!u&&!c&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(c=e),!u&&!n[e].trim())i===null&&(i=e);else if(!u&&!((g||c)&&f!==null)){if(i!==null){if(l.removeLineBreaks&&(m+=1),C)C=!1,(l.removeIndentations||l.removeLineBreaks)&&$.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!S&&p!==null&&e>p?$.push(p+1,e):i+1<e&&(n.endsWith("]>",i)||n.endsWith("-->",i)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?$.push(i,e):n[i]===" "?$.push(i+1,e):n[~-e]===" "?$.push(i,~-e):$.push(i,e," "))),l.removeLineBreaks||c){if(v.includes(n[e])&&X(n,e,l.breakToTheLeftOf)){!(`\r
17
17
  `.includes(n[~-e])&&i===~-e)&&!(n[~-e]===`
18
- `&&n[e-2]==="\r"&&i===e-2)&&$.push(i,e,h),t=null,s=null,a=null,i=null,r=1;continue}let o=" ";n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:N=>!N||!/\w/.test(N)})||(n[~-i]&&X.includes(n[~-i])&&z.includes(n[e])||(c||g)&&E===null&&(U.includes(n[~-i])||J.includes(n[e]))||n.startsWith("!important",e)&&!V||g&&(n[~-i]==="'"||n[~-i]==='"')||n[~-i]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[_(n,e)])||n[m(n,e)]==="<")||n[e]==="/"&&n[m(n,e)]===">")&&(o="",n[e]==="/"&&n[e+1]===">"&&m(n,e)&&m(n,e)>e+1&&($.push(e+1,m(n,e)),r-=m(n,e)-e+1)),c&&n[e]==="}"&&i&&n[i-1]==="}"&&(o=" "),o?.length&&(r+=1),l.lineLengthLimit?r>=l.lineLengthLimit||!n[e+1]||n[e]===">"||n[e]==="/"&&n[e+1]===">"?((r>l.lineLengthLimit||r===l.lineLengthLimit&&n[e+1]&&n[e+1].trim()&&!P.includes(n[e])&&!I.includes(n[e+1]))&&(o=h,r=1),(r>l.lineLengthLimit||!(o===" "&&e===i+1))&&($.push(i,e,o),S=null),t=null,s=null,a=null):(t===null||i<t)&&(t=i,s=e,a=o):e===i+1&&o===" "||$.push(i,e,o)}i=null,D||(D=!0)}else y&&(y=!1),l.removeLineBreaks&&(r+=1);D||(D=!0)}if(!u&&!y&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||v)&&!n.startsWith("</a",e)){if(v&&q(n,e,l.breakToTheLeftOf)&&n.slice(0,e).trim()&&(!n.startsWith("<![endif]",e)||!te(n,e,"<!--"))){$.push(e,e,h),t=null,s=null,a=null,r=1;continue}else if(l.lineLengthLimit&&r<=l.lineLengthLimit){if(!n[e+1]||I.includes(n[e])&&!Q.includes(n[e])||P.includes(n[e])||!n[e].trim()){if(t!==null&&s!==null&&(t!==s||a?.length)){let o=a;n[e].trim()&&n[e+1]&&n[e+1].trim()&&r+(a?a.length:0)>l.lineLengthLimit&&(o=h),(r+(o?o.length:0)>l.lineLengthLimit||!(o===" "&&s===t+1&&n[t]===" "))&&(n[~-t]==="}"&&n[s]==="{"||($.push(t,s,o),S=null))}n[e].trim()&&(I.includes(n[e])||n[~-e]&&P.includes(n[~-e]))&&p(M)&&(!d||!l.mindTheInlineTags.includes(d))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:o=>!o||!/\w/.test(o)}))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))?(t=e,s=e,a=null):E===null&&t!==null&&(g||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!p(d)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&p(d)&&!l.mindTheInlineTags.includes(d))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))&&(t=null,s=null,a=null)}}else if(l.lineLengthLimit)if(I.includes(n[e])&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)})))if(t!==null&&s!==null&&(t!==s||a?.length)){let o=a?.length?a.length:0;r-(s-t-o)-1>l.lineLengthLimit||($.push(t,s,a),r-(s-t-o)-1===l.lineLengthLimit&&($.push(e,e,h),r=0),t=null,s=null,a=null)}else $.push(e,e,h),r=0;else n[e+1]&&P.includes(n[e])&&p(d)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!l.mindTheInlineTags.includes(d)?t!==null&&s!==null&&(t!==s||a?.length)||($.push(e+1,e+1,h),r=0):n[e].trim()&&(n[e+1]||t!==null&&s!==null&&(t!==s||a?.length)&&$.push(t,s,h))}if(!u&&!y&&l.removeLineBreaks&&l.lineLengthLimit&&r>=l.lineLengthLimit&&t!==null&&s!==null&&!P.includes(n[e])&&!I.includes(n[e])&&!"/".includes(n[e])&&!(r===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let o=h;n[e+1]&&!n[e+1].trim()&&r===l.lineLengthLimit&&(o=a),o===h&&!n[~-t].trim()&&_(n,t)&&(t=_(n,t)+1),$.push(t,s,o),r=e-s,n[e].length&&(r+=1),t=null,s=null,a=null}if((!u&&n[e]===`
18
+ `&&n[e-2]==="\r"&&i===e-2)&&$.push(i,e,b),t=null,s=null,r=null,i=null,m=1;continue}let o=" ";n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:N=>!N||!/\w/.test(N)})||(n[~-i]&&q.includes(n[~-i])&&z.includes(n[e])||(g||c)&&f===null&&(k.includes(n[~-i])||J.includes(n[e]))||n.startsWith("!important",e)&&!O||c&&(n[~-i]==="'"||n[~-i]==='"')||n[~-i]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[G(n,e)])||n[a(n,e)]==="<")||n[e]==="/"&&n[a(n,e)]===">")&&(o="",n[e]==="/"&&n[e+1]===">"&&a(n,e)&&a(n,e)>e+1&&($.push(e+1,a(n,e)),m-=a(n,e)-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]&&n[e+1].trim()&&!P.includes(n[e])&&!I.includes(n[e+1]))&&(o=b,m=1),(m>l.lineLengthLimit||!(o===" "&&e===i+1))&&($.push(i,e,o),p=null),t=null,s=null,r=null):(t===null||i<t)&&(t=i,s=e,r=o):e===i+1&&o===" "||$.push(i,e,o)}i=null,S||(S=!0)}else C&&(C=!1),l.removeLineBreaks&&(m+=1);S||(S=!0)}if(!u&&!C&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||v)&&!n.startsWith("</a",e)){if(v&&X(n,e,l.breakToTheLeftOf)&&n.slice(0,e).trim()&&(!n.startsWith("<![endif]",e)||!oe(n,e,"<!--"))){$.push(e,e,b),t=null,s=null,r=null,m=1;continue}else if(l.lineLengthLimit&&m<=l.lineLengthLimit){if(!n[e+1]||I.includes(n[e])&&!K.includes(n[e])||P.includes(n[e])||!n[e].trim()){if(t!==null&&s!==null&&(t!==s||r?.length)){let o=r;n[e].trim()&&n[e+1]&&n[e+1].trim()&&m+(r?r.length:0)>l.lineLengthLimit&&(o=b),(m+(o?o.length:0)>l.lineLengthLimit||!(o===" "&&s===t+1&&n[t]===" "))&&(n[~-t]==="}"&&n[s]==="{"||($.push(t,s,o),p=null))}n[e].trim()&&(I.includes(n[e])||n[~-e]&&P.includes(n[~-e]))&&A(M)&&(!T||!l.mindTheInlineTags.includes(T))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:o=>!o||!/\w/.test(o)}))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))?(t=e,s=e,r=null):f===null&&t!==null&&(c||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!A(T)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&A(T)&&!l.mindTheInlineTags.includes(T))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))&&(t=null,s=null,r=null)}}else if(l.lineLengthLimit)if(I.includes(n[e])&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)})))if(t!==null&&s!==null&&(t!==s||r?.length)){let o=r?.length?r.length:0;m-(s-t-o)-1>l.lineLengthLimit||($.push(t,s,r),m-(s-t-o)-1===l.lineLengthLimit&&($.push(e,e,b),m=0),t=null,s=null,r=null)}else $.push(e,e,b),m=0;else n[e+1]&&P.includes(n[e])&&A(T)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!l.mindTheInlineTags.includes(T)?t!==null&&s!==null&&(t!==s||r?.length)||($.push(e+1,e+1,b),m=0):n[e].trim()&&(n[e+1]||t!==null&&s!==null&&(t!==s||r?.length)&&$.push(t,s,b))}if(!u&&!C&&l.removeLineBreaks&&l.lineLengthLimit&&m>=l.lineLengthLimit&&t!==null&&s!==null&&!P.includes(n[e])&&!I.includes(n[e])&&!"/".includes(n[e])&&!(m===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let o=b;n[e+1]&&!n[e+1].trim()&&m===l.lineLengthLimit&&(o=r),o===b&&!n[~-t].trim()&&G(n,t)&&(t=G(n,t)+1),$.push(t,s,o),m=e-s,n[e].length&&(m+=1),t=null,s=null,r=null}if((!u&&n[e]===`
19
19
  `||n[e]==="\r"&&(!n[e+1]||n[e+1]&&n[e+1]!==`
20
- `))&&(S=e,D&&(D=!1),!l.removeLineBreaks&&i!==null&&i<e&&n[e+1]&&n[e+1]!=="\r"&&n[e+1]!==`
21
- `&&$.push(i,e)),n[e+1]||(c&&E!==null?$.push(...B({str:n,from:E,to:e,ifLeftSideIncludesThisThenCropTightly:U||"",ifRightSideIncludesThisThenCropTightly:J||""})):i&&n[e]!==`
20
+ `))&&(p=e,S&&(S=!1),!l.removeLineBreaks&&i!==null&&i<e&&n[e+1]&&n[e+1]!=="\r"&&n[e+1]!==`
21
+ `&&$.push(i,e)),n[e+1]||(g&&f!==null?$.push(..._({str:n,from:f,to:e,ifLeftSideIncludesThisThenCropTightly:k||"",ifRightSideIncludesThisThenCropTightly:J||""})):i&&n[e]!==`
22
22
  `&&n[e]!=="\r"?$.push(i,e+1):i&&(n[e]==="\r"&&n[e+1]===`
23
23
  `||n[e]===`
24
- `&&n[e-1]!=="\r")&&$.push(i,e)),!u&&g&&g<e&&n[g]===n[e]&&(g=null),!u&&!c&&n.startsWith("<pre",e)&&!O(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(u=o)}if(!u&&!c&&n.startsWith("<code",e)&&!O(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(u=o)}if(!u&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(u=o)}!u&&!c&&!g&&L!==null&&n[e]===">"&&(n[m(n,e)]==="<"&&(M=d),L=null,d=null),n[e]==="<"&&M!==null&&(M=null),c&&n[e]==="{"&&n[e+1]==="{"&&n.indexOf("}}")!==-1&&(u=n.indexOf("}}")+2);let w=!0}if($.current()){let e=$.current();$.wipe();let w=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*W,o=le(n,e,ee=>{l.reportProgressFunc&&f>=2e3&&(T=Math.floor(w+(l.reportProgressFuncTo-w)*(ee/100)),T!==k&&(k=T,l.reportProgressFunc(T)))}),N=o.length;return{log:{timeTakenInMilliseconds:Date.now()-x,originalLength:f,cleanedLength:N,bytesSaved:Math.max(f-N,0),percentageReducedOfOriginal:f?Math.round(Math.max(f-N,0)*100/f):0},ranges:e,applicableOpts:C,result:o}}}return{log:{timeTakenInMilliseconds:Date.now()-x,originalLength:f,cleanedLength:f,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:C,ranges:null,result:n}}export{fe as crush,ie as defaults,he as version};
25
- /**
26
- * @name codsen-utils
27
- * @fileoverview Various utility functions
28
- * @version 1.3.0
29
- * @author Roy Revelt, Codsen Ltd
30
- * @license MIT
31
- * {@link https://codsen.com/os/codsen-utils/}
32
- */
24
+ `&&n[e-1]!=="\r")&&$.push(i,e)),!u&&c&&c<e&&n[c]===n[e]&&(c=null),!u&&!g&&n.startsWith("<pre",e)&&!y(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(u=o)}if(!u&&!g&&n.startsWith("<code",e)&&!y(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(u=o)}if(!u&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(u=o)}!u&&!g&&!c&&D!==null&&n[e]===">"&&(n[a(n,e)]==="<"&&(M=T),D=null,T=null),n[e]==="<"&&M!==null&&(M=null),g&&n[e]==="{"&&n[e+1]==="{"&&n.indexOf("}}")!==-1&&(u=n.indexOf("}}")+2);let w=!0}if($.current()){let e=$.current();$.wipe();let w=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*B,o=ne(n,e,Z=>{l.reportProgressFunc&&h>=2e3&&(d=Math.floor(w+(l.reportProgressFuncTo-w)*(Z/100)),d!==R&&(R=d,l.reportProgressFunc(d)))}),N=o.length;return{log:{timeTakenInMilliseconds:Date.now()-x,originalLength:h,cleanedLength:N,bytesSaved:Math.max(h-N,0),percentageReducedOfOriginal:h?Math.round(Math.max(h-N,0)*100/h):0},ranges:e,applicableOpts:L,result:o}}}return{log:{timeTakenInMilliseconds:Date.now()-x,originalLength:h,cleanedLength:h,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:L,ranges:null,result:n}}export{he as crush,ie as defaults,be as version};
@@ -1,48 +1,48 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minify email templates
4
- * @version 6.0.9
4
+ * @version 6.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- "use strict";var htmlCrush=(()=>{var Zt=Object.create;var ne=Object.defineProperty;var en=Object.getOwnPropertyDescriptor;var tn=Object.getOwnPropertyNames,je=Object.getOwnPropertySymbols,nn=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable;var ye=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))ke.call(t,r)&&ye(e,r,t[r]);if(je)for(var r of je(t))rn.call(t,r)&&ye(e,r,t[r]);return e};var on=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sn=(e,t)=>{for(var r in t)ne(e,r,{get:t[r],enumerable:!0})},Ue=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of tn(t))!ke.call(e,a)&&a!==r&&ne(e,a,{get:()=>t[a],enumerable:!(n=en(t,a))||n.enumerable});return e};var ln=(e,t,r)=>(r=e!=null?Zt(nn(e)):{},Ue(t||!e||!e.__esModule?ne(r,"default",{value:e,enumerable:!0}):r,e)),an=e=>Ue(ne({},"__esModule",{value:!0}),e);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var Ut=on((re,K)=>{var bn=200,$t="__lodash_hash_undefined__",pt=9007199254740991,Re="[object Arguments]",Tn="[object Array]",dt="[object Boolean]",bt="[object Date]",yn="[object Error]",Ve="[object Function]",Tt="[object GeneratorFunction]",ue="[object Map]",yt="[object Number]",Me="[object Object]",it="[object Promise]",Et="[object RegExp]",ge="[object Set]",St="[object String]",Ot="[object Symbol]",Ae="[object WeakMap]",wt="[object ArrayBuffer]",ce="[object DataView]",Lt="[object Float32Array]",Dt="[object Float64Array]",At="[object Int8Array]",Ct="[object Int16Array]",It="[object Int32Array]",vt="[object Uint8Array]",Nt="[object Uint8ClampedArray]",_t="[object Uint16Array]",Rt="[object Uint32Array]",En=/[\\^$.*+?()[\]{}|]/g,Sn=/\w*$/,On=/^\[object .+?Constructor\]$/,wn=/^(?:0|[1-9]\d*)$/,O={};O[Re]=O[Tn]=O[wt]=O[ce]=O[dt]=O[bt]=O[Lt]=O[Dt]=O[At]=O[Ct]=O[It]=O[ue]=O[yt]=O[Me]=O[Et]=O[ge]=O[St]=O[Ot]=O[vt]=O[Nt]=O[_t]=O[Rt]=!0;O[yn]=O[Ve]=O[Ae]=!1;var Ln=typeof global=="object"&&global&&global.Object===Object&&global,Dn=typeof self=="object"&&self&&self.Object===Object&&self,V=Ln||Dn||Function("return this")(),Vt=typeof re=="object"&&re&&!re.nodeType&&re,ot=Vt&&typeof K=="object"&&K&&!K.nodeType&&K,An=ot&&ot.exports===Vt;function Cn(e,t){return e.set(t[0],t[1]),e}function In(e,t){return e.add(t),e}function vn(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Nn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function Mt(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function _n(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Rn(e,t){return e==null?void 0:e[t]}function Pt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function st(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function Pe(e,t){return function(r){return e(t(r))}}function lt(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Vn=Array.prototype,Mn=Function.prototype,me=Object.prototype,De=V["__core-js_shared__"],at=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),xt=Mn.toString,F=me.hasOwnProperty,fe=me.toString,Pn=RegExp("^"+xt.call(F).replace(En,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=An?V.Buffer:void 0,gt=V.Symbol,ct=V.Uint8Array,xn=Pe(Object.getPrototypeOf,Object),Fn=Object.create,Hn=me.propertyIsEnumerable,Wn=Vn.splice,mt=Object.getOwnPropertySymbols,Bn=ut?ut.isBuffer:void 0,Jn=Pe(Object.keys,Object),Ce=X(V,"DataView"),ie=X(V,"Map"),Ie=X(V,"Promise"),ve=X(V,"Set"),Ne=X(V,"WeakMap"),oe=X(Object,"create"),jn=j(Ce),kn=j(ie),Un=j(Ie),Gn=j(ve),qn=j(Ne),ft=gt?gt.prototype:void 0,ht=ft?ft.valueOf:void 0;function J(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Kn(){this.__data__=oe?oe(null):{}}function Yn(e){return this.has(e)&&delete this.__data__[e]}function Qn(e){var t=this.__data__;if(oe){var r=t[e];return r===$t?void 0:r}return F.call(t,e)?t[e]:void 0}function Xn(e){var t=this.__data__;return oe?t[e]!==void 0:F.call(t,e)}function zn(e,t){var r=this.__data__;return r[e]=oe&&t===void 0?$t:t,this}J.prototype.clear=Kn;J.prototype.delete=Yn;J.prototype.get=Qn;J.prototype.has=Xn;J.prototype.set=zn;function M(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Zn(){this.__data__=[]}function er(e){var t=this.__data__,r=he(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Wn.call(t,r,1),!0}function tr(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]}function nr(e){return he(this.__data__,e)>-1}function rr(e,t){var r=this.__data__,n=he(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}M.prototype.clear=Zn;M.prototype.delete=er;M.prototype.get=tr;M.prototype.has=nr;M.prototype.set=rr;function Y(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ir(){this.__data__={hash:new J,map:new(ie||M),string:new J}}function or(e){return $e(this,e).delete(e)}function sr(e){return $e(this,e).get(e)}function lr(e){return $e(this,e).has(e)}function ar(e,t){return $e(this,e).set(e,t),this}Y.prototype.clear=ir;Y.prototype.delete=or;Y.prototype.get=sr;Y.prototype.has=lr;Y.prototype.set=ar;function Q(e){this.__data__=new M(e)}function ur(){this.__data__=new M}function gr(e){return this.__data__.delete(e)}function cr(e){return this.__data__.get(e)}function mr(e){return this.__data__.has(e)}function fr(e,t){var r=this.__data__;if(r instanceof M){var n=r.__data__;if(!ie||n.length<bn-1)return n.push([e,t]),this;r=this.__data__=new Y(n)}return r.set(e,t),this}Q.prototype.clear=ur;Q.prototype.delete=gr;Q.prototype.get=cr;Q.prototype.has=mr;Q.prototype.set=fr;function hr(e,t){var r=Fe(e)||Fr(e)?_n(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||F.call(e,o))&&!(a&&(o=="length"||Vr(o,n)))&&r.push(o);return r}function Ft(e,t,r){var n=e[t];(!(F.call(e,t)&&Jt(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function he(e,t){for(var r=e.length;r--;)if(Jt(e[r][0],t))return r;return-1}function $r(e,t){return e&&Ht(t,He(t),e)}function _e(e,t,r,n,a,o,u){var l;if(n&&(l=o?n(e,a,o,u):n(e)),l!==void 0)return l;if(!pe(e))return e;var g=Fe(e);if(g){if(l=Nr(e),!t)return Cr(e,l)}else{var s=B(e),d=s==Ve||s==Tt;if(Wr(e))return Er(e,t);if(s==Me||s==Re||d&&!o){if(Pt(e))return o?e:{};if(l=_r(d?{}:e),!t)return Ir(e,$r(l,e))}else{if(!O[s])return o?e:{};l=Rr(e,s,_e,t)}}u||(u=new Q);var p=u.get(e);if(p)return p;if(u.set(e,l),!g)var T=r?vr(e):He(e);return vn(T||e,function(m,f){T&&(f=m,m=e[f]),Ft(l,f,_e(m,t,r,n,f,e,u))}),l}function pr(e){return pe(e)?Fn(e):{}}function dr(e,t,r){var n=t(e);return Fe(e)?n:Nn(n,r(e))}function br(e){return fe.call(e)}function Tr(e){if(!pe(e)||Pr(e))return!1;var t=kt(e)||Pt(e)?Pn:On;return t.test(j(e))}function yr(e){if(!Bt(e))return Jn(e);var t=[];for(var r in Object(e))F.call(e,r)&&r!="constructor"&&t.push(r);return t}function Er(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function xe(e){var t=new e.constructor(e.byteLength);return new ct(t).set(new ct(e)),t}function Sr(e,t){var r=t?xe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Or(e,t,r){var n=t?r(st(e),!0):st(e);return Mt(n,Cn,new e.constructor)}function wr(e){var t=new e.constructor(e.source,Sn.exec(e));return t.lastIndex=e.lastIndex,t}function Lr(e,t,r){var n=t?r(lt(e),!0):lt(e);return Mt(n,In,new e.constructor)}function Dr(e){return ht?Object(ht.call(e)):{}}function Ar(e,t){var r=t?xe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Cr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Ht(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],l=n?n(r[u],e[u],u,r,e):void 0;Ft(r,u,l===void 0?e[u]:l)}return r}function Ir(e,t){return Ht(e,Wt(e),t)}function vr(e){return dr(e,He,Wt)}function $e(e,t){var r=e.__data__;return Mr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function X(e,t){var r=Rn(e,t);return Tr(r)?r:void 0}var Wt=mt?Pe(mt,Object):jr,B=br;(Ce&&B(new Ce(new ArrayBuffer(1)))!=ce||ie&&B(new ie)!=ue||Ie&&B(Ie.resolve())!=it||ve&&B(new ve)!=ge||Ne&&B(new Ne)!=Ae)&&(B=function(e){var t=fe.call(e),r=t==Me?e.constructor:void 0,n=r?j(r):void 0;if(n)switch(n){case jn:return ce;case kn:return ue;case Un:return it;case Gn:return ge;case qn:return Ae}return t});function Nr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&F.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function _r(e){return typeof e.constructor=="function"&&!Bt(e)?pr(xn(e)):{}}function Rr(e,t,r,n){var a=e.constructor;switch(t){case wt:return xe(e);case dt:case bt:return new a(+e);case ce:return Sr(e,n);case Lt:case Dt:case At:case Ct:case It:case vt:case Nt:case _t:case Rt:return Ar(e,n);case ue:return Or(e,n,r);case yt:case St:return new a(e);case Et:return wr(e);case ge:return Lr(e,n,r);case Ot:return Dr(e)}}function Vr(e,t){return t=t==null?pt:t,!!t&&(typeof e=="number"||wn.test(e))&&e>-1&&e%1==0&&e<t}function Mr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Pr(e){return!!at&&at in e}function Bt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||me;return e===r}function j(e){if(e!=null){try{return xt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function xr(e){return _e(e,!0,!0)}function Jt(e,t){return e===t||e!==e&&t!==t}function Fr(e){return Hr(e)&&F.call(e,"callee")&&(!Hn.call(e,"callee")||fe.call(e)==Re)}var Fe=Array.isArray;function jt(e){return e!=null&&Br(e.length)&&!kt(e)}function Hr(e){return Jr(e)&&jt(e)}var Wr=Bn||kr;function kt(e){var t=pe(e)?fe.call(e):"";return t==Ve||t==Tt}function Br(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pt}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Jr(e){return!!e&&typeof e=="object"}function He(e){return jt(e)?hr(e):yr(e)}function jr(){return[]}function kr(){return!1}K.exports=xr});var Xr={};sn(Xr,{crush:()=>Qr,defaults:()=>qt,version:()=>Yr});var un={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Se(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},un),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,g)=>!Array.isArray(l)||l.length!==2?(n=g,a=l.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,g)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,g)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===g[0]?l[1]<g[1]?-1:l[1]>g[1]?1:0:l[0]<g[0]?-1:1))}var Ge={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function qe(e,t){function r(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Ge),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
11
- ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},Ge);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Se(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Se(a);let g=o.length-1;for(let s=g;s>0;s--)n.progressFn&&(l=Math.floor((1-s/g)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var gn=!0,Oe="Invariant failed";function Ke(e,t){if(!e){if(gn)throw new Error(Oe);var r=typeof t=="function"?t():t,n=r?"".concat(Oe,": ").concat(r):Oe;throw new Error(n)}}function Ye(e,t,r){let n=0,a=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(t&&!Array.isArray(t))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(r&&typeof r!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(!t||!t.filter(d=>d).length)return e;let o;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?o=[Array.from(t)]:o=Array.from(t);let u=o.length,l=0;o.filter(d=>d).forEach((d,p)=>{if(r&&(n=Math.floor(l/u*10),n!==a&&(a=n,r(n))),!Array.isArray(d))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${p}th element not an array: ${JSON.stringify(d,null,4)}, which is ${typeof d}`);if(!Number.isInteger(d[0])){if(!Number.isInteger(+d[0])||+d[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${p}th element, array ${JSON.stringify(d,null,0)}. Its first element is not an integer, string index, but ${typeof d[0]}, equal to: ${JSON.stringify(d[0],null,4)}.`);o[p][0]=+o[p][0]}if(!Number.isInteger(d[1])){if(!Number.isInteger(+d[1])||+d[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${p}th element, array ${JSON.stringify(d,null,0)}. Its second element is not an integer, string index, but ${typeof d[1]}, equal to: ${JSON.stringify(d[1],null,4)}.`);o[p][1]=+o[p][1]}l+=1});let g=qe(o,{progressFn:d=>{r&&(n=10+Math.floor(d/10),n!==a&&(a=n,r(n)))}});Ke(g);let s=g.length;if(s>0){let d=e.slice(g[s-1][1]);e=g.reduce((p,T,m,f)=>{r&&(n=20+Math.floor(m/s*80),n!==a&&(a=n,r(n)));let w=m===0?0:f[m-1][1],L=f[m][0];return`${p}${e.slice(w,L)}${f[m][2]||""}`},""),e+=d}return e}function le(e,t=1){let r="\xA0";function n(o){return Array.from(o).reverse().join("")}function a(o,u,l){let g=l?`
10
+ "use strict";var htmlCrush=(()=>{var Qt=Object.create;var ne=Object.defineProperty;var Xt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames,Je=Object.getOwnPropertySymbols,Zt=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var ye=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))ke.call(t,r)&&ye(e,r,t[r]);if(Je)for(var r of Je(t))en.call(t,r)&&ye(e,r,t[r]);return e};var tn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nn=(e,t)=>{for(var r in t)ne(e,r,{get:t[r],enumerable:!0})},je=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of zt(t))!ke.call(e,a)&&a!==r&&ne(e,a,{get:()=>t[a],enumerable:!(n=Xt(t,a))||n.enumerable});return e};var rn=(e,t,r)=>(r=e!=null?Qt(Zt(e)):{},je(t||!e||!e.__esModule?ne(r,"default",{value:e,enumerable:!0}):r,e)),on=e=>je(ne({},"__esModule",{value:!0}),e);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var Jt=tn((re,K)=>{var hn=200,mt="__lodash_hash_undefined__",ht=9007199254740991,_e="[object Arguments]",fn="[object Array]",ft="[object Boolean]",$t="[object Date]",$n="[object Error]",Ve="[object Function]",pt="[object GeneratorFunction]",ue="[object Map]",dt="[object Number]",Re="[object Object]",tt="[object Promise]",bt="[object RegExp]",ge="[object Set]",Tt="[object String]",yt="[object Symbol]",De="[object WeakMap]",Et="[object ArrayBuffer]",ce="[object DataView]",St="[object Float32Array]",Ot="[object Float64Array]",wt="[object Int8Array]",Lt="[object Int16Array]",Dt="[object Int32Array]",Ct="[object Uint8Array]",At="[object Uint8ClampedArray]",It="[object Uint16Array]",vt="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,dn=/\w*$/,bn=/^\[object .+?Constructor\]$/,Tn=/^(?:0|[1-9]\d*)$/,O={};O[_e]=O[fn]=O[Et]=O[ce]=O[ft]=O[$t]=O[St]=O[Ot]=O[wt]=O[Lt]=O[Dt]=O[ue]=O[dt]=O[Re]=O[bt]=O[ge]=O[Tt]=O[yt]=O[Ct]=O[At]=O[It]=O[vt]=!0;O[$n]=O[Ve]=O[De]=!1;var yn=typeof global=="object"&&global&&global.Object===Object&&global,En=typeof self=="object"&&self&&self.Object===Object&&self,M=yn||En||Function("return this")(),Nt=typeof re=="object"&&re&&!re.nodeType&&re,nt=Nt&&typeof K=="object"&&K&&!K.nodeType&&K,Sn=nt&&nt.exports===Nt;function On(e,t){return e.set(t[0],t[1]),e}function wn(e,t){return e.add(t),e}function Ln(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Dn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function _t(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function Cn(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function An(e,t){return e==null?void 0:e[t]}function Vt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function rt(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function Me(e,t){return function(r){return e(t(r))}}function it(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var In=Array.prototype,vn=Function.prototype,me=Object.prototype,Le=M["__core-js_shared__"],ot=function(){var e=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Rt=vn.toString,H=me.hasOwnProperty,he=me.toString,Nn=RegExp("^"+Rt.call(H).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=Sn?M.Buffer:void 0,lt=M.Symbol,at=M.Uint8Array,_n=Me(Object.getPrototypeOf,Object),Vn=Object.create,Rn=me.propertyIsEnumerable,Mn=In.splice,ut=Object.getOwnPropertySymbols,Pn=st?st.isBuffer:void 0,xn=Me(Object.keys,Object),Ce=X(M,"DataView"),ie=X(M,"Map"),Ae=X(M,"Promise"),Ie=X(M,"Set"),ve=X(M,"WeakMap"),oe=X(Object,"create"),Fn=k(Ce),Hn=k(ie),Wn=k(Ae),Bn=k(Ie),Jn=k(ve),gt=lt?lt.prototype:void 0,ct=gt?gt.valueOf:void 0;function J(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function kn(){this.__data__=oe?oe(null):{}}function jn(e){return this.has(e)&&delete this.__data__[e]}function Un(e){var t=this.__data__;if(oe){var r=t[e];return r===mt?void 0:r}return H.call(t,e)?t[e]:void 0}function Gn(e){var t=this.__data__;return oe?t[e]!==void 0:H.call(t,e)}function qn(e,t){var r=this.__data__;return r[e]=oe&&t===void 0?mt:t,this}J.prototype.clear=kn;J.prototype.delete=jn;J.prototype.get=Un;J.prototype.has=Gn;J.prototype.set=qn;function P(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Kn(){this.__data__=[]}function Yn(e){var t=this.__data__,r=fe(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Mn.call(t,r,1),!0}function Qn(e){var t=this.__data__,r=fe(t,e);return r<0?void 0:t[r][1]}function Xn(e){return fe(this.__data__,e)>-1}function zn(e,t){var r=this.__data__,n=fe(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}P.prototype.clear=Kn;P.prototype.delete=Yn;P.prototype.get=Qn;P.prototype.has=Xn;P.prototype.set=zn;function Y(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Zn(){this.__data__={hash:new J,map:new(ie||P),string:new J}}function er(e){return $e(this,e).delete(e)}function tr(e){return $e(this,e).get(e)}function nr(e){return $e(this,e).has(e)}function rr(e,t){return $e(this,e).set(e,t),this}Y.prototype.clear=Zn;Y.prototype.delete=er;Y.prototype.get=tr;Y.prototype.has=nr;Y.prototype.set=rr;function Q(e){this.__data__=new P(e)}function ir(){this.__data__=new P}function or(e){return this.__data__.delete(e)}function sr(e){return this.__data__.get(e)}function lr(e){return this.__data__.has(e)}function ar(e,t){var r=this.__data__;if(r instanceof P){var n=r.__data__;if(!ie||n.length<hn-1)return n.push([e,t]),this;r=this.__data__=new Y(n)}return r.set(e,t),this}Q.prototype.clear=ir;Q.prototype.delete=or;Q.prototype.get=sr;Q.prototype.has=lr;Q.prototype.set=ar;function ur(e,t){var r=xe(e)||Vr(e)?Cn(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||H.call(e,o))&&!(a&&(o=="length"||Ir(o,n)))&&r.push(o);return r}function Mt(e,t,r){var n=e[t];(!(H.call(e,t)&&Ht(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function fe(e,t){for(var r=e.length;r--;)if(Ht(e[r][0],t))return r;return-1}function gr(e,t){return e&&Pt(t,Fe(t),e)}function Ne(e,t,r,n,a,o,u){var l;if(n&&(l=o?n(e,a,o,u):n(e)),l!==void 0)return l;if(!pe(e))return e;var g=xe(e);if(g){if(l=Dr(e),!t)return Or(e,l)}else{var s=B(e),d=s==Ve||s==pt;if(Mr(e))return pr(e,t);if(s==Re||s==_e||d&&!o){if(Vt(e))return o?e:{};if(l=Cr(d?{}:e),!t)return wr(e,gr(l,e))}else{if(!O[s])return o?e:{};l=Ar(e,s,Ne,t)}}u||(u=new Q);var p=u.get(e);if(p)return p;if(u.set(e,l),!g)var T=r?Lr(e):Fe(e);return Ln(T||e,function(m,h){T&&(h=m,m=e[h]),Mt(l,h,Ne(m,t,r,n,h,e,u))}),l}function cr(e){return pe(e)?Vn(e):{}}function mr(e,t,r){var n=t(e);return xe(e)?n:Dn(n,r(e))}function hr(e){return he.call(e)}function fr(e){if(!pe(e)||Nr(e))return!1;var t=Bt(e)||Vt(e)?Nn:bn;return t.test(k(e))}function $r(e){if(!Ft(e))return xn(e);var t=[];for(var r in Object(e))H.call(e,r)&&r!="constructor"&&t.push(r);return t}function pr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Pe(e){var t=new e.constructor(e.byteLength);return new at(t).set(new at(e)),t}function dr(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function br(e,t,r){var n=t?r(rt(e),!0):rt(e);return _t(n,On,new e.constructor)}function Tr(e){var t=new e.constructor(e.source,dn.exec(e));return t.lastIndex=e.lastIndex,t}function yr(e,t,r){var n=t?r(it(e),!0):it(e);return _t(n,wn,new e.constructor)}function Er(e){return ct?Object(ct.call(e)):{}}function Sr(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Or(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Pt(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],l=n?n(r[u],e[u],u,r,e):void 0;Mt(r,u,l===void 0?e[u]:l)}return r}function wr(e,t){return Pt(e,xt(e),t)}function Lr(e){return mr(e,Fe,xt)}function $e(e,t){var r=e.__data__;return vr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function X(e,t){var r=An(e,t);return fr(r)?r:void 0}var xt=ut?Me(ut,Object):Fr,B=hr;(Ce&&B(new Ce(new ArrayBuffer(1)))!=ce||ie&&B(new ie)!=ue||Ae&&B(Ae.resolve())!=tt||Ie&&B(new Ie)!=ge||ve&&B(new ve)!=De)&&(B=function(e){var t=he.call(e),r=t==Re?e.constructor:void 0,n=r?k(r):void 0;if(n)switch(n){case Fn:return ce;case Hn:return ue;case Wn:return tt;case Bn:return ge;case Jn:return De}return t});function Dr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&H.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Cr(e){return typeof e.constructor=="function"&&!Ft(e)?cr(_n(e)):{}}function Ar(e,t,r,n){var a=e.constructor;switch(t){case Et:return Pe(e);case ft:case $t:return new a(+e);case ce:return dr(e,n);case St:case Ot:case wt:case Lt:case Dt:case Ct:case At:case It:case vt:return Sr(e,n);case ue:return br(e,n,r);case dt:case Tt:return new a(e);case bt:return Tr(e);case ge:return yr(e,n,r);case yt:return Er(e)}}function Ir(e,t){return t=t==null?ht:t,!!t&&(typeof e=="number"||Tn.test(e))&&e>-1&&e%1==0&&e<t}function vr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Nr(e){return!!ot&&ot in e}function Ft(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||me;return e===r}function k(e){if(e!=null){try{return Rt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function _r(e){return Ne(e,!0,!0)}function Ht(e,t){return e===t||e!==e&&t!==t}function Vr(e){return Rr(e)&&H.call(e,"callee")&&(!Rn.call(e,"callee")||he.call(e)==_e)}var xe=Array.isArray;function Wt(e){return e!=null&&Pr(e.length)&&!Bt(e)}function Rr(e){return xr(e)&&Wt(e)}var Mr=Pn||Hr;function Bt(e){var t=pe(e)?he.call(e):"";return t==Ve||t==pt}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ht}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function xr(e){return!!e&&typeof e=="object"}function Fe(e){return Wt(e)?ur(e):$r(e)}function Fr(){return[]}function Hr(){return!1}K.exports=_r});var Gr={};nn(Gr,{crush:()=>Ur,defaults:()=>jt,version:()=>jr});var sn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function G(e,t){if(!Array.isArray(e)||!e.length)return e;let r=w(w({},sn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,g)=>!Array.isArray(l)||l.length!==2?(n=g,a=l.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,g)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,g)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===g[0]?l[1]<g[1]?-1:l[1]>g[1]?1:0:l[0]<g[0]?-1:1))}var Ue={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ge(e,t){function r(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=w(w({},Ue),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
11
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=w({},Ue);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=G(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=G(a);let g=o.length-1;for(let s=g;s>0;s--)n.progressFn&&(l=Math.floor((1-s/g)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var ln=!0,Se="Invariant failed";function qe(e,t){if(!e){if(ln)throw new Error(Se);var r=typeof t=="function"?t():t,n=r?"".concat(Se,": ").concat(r):Se;throw new Error(n)}}function Ke(e,t,r){let n=0,a=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(t&&!Array.isArray(t))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(r&&typeof r!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(!t||!t.filter(d=>d).length)return e;let o;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?o=[Array.from(t)]:o=Array.from(t);let u=o.length,l=0;o.filter(d=>d).forEach((d,p)=>{if(r&&(n=Math.floor(l/u*10),n!==a&&(a=n,r(n))),!Array.isArray(d))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${p}th element not an array: ${JSON.stringify(d,null,4)}, which is ${typeof d}`);if(!Number.isInteger(d[0])){if(!Number.isInteger(+d[0])||+d[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${p}th element, array ${JSON.stringify(d,null,0)}. Its first element is not an integer, string index, but ${typeof d[0]}, equal to: ${JSON.stringify(d[0],null,4)}.`);o[p][0]=+o[p][0]}if(!Number.isInteger(d[1])){if(!Number.isInteger(+d[1])||+d[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${p}th element, array ${JSON.stringify(d,null,0)}. Its second element is not an integer, string index, but ${typeof d[1]}, equal to: ${JSON.stringify(d[1],null,4)}.`);o[p][1]=+o[p][1]}l+=1});let g=Ge(o,{progressFn:d=>{r&&(n=10+Math.floor(d/10),n!==a&&(a=n,r(n)))}});qe(g);let s=g.length;if(s>0){let d=e.slice(g[s-1][1]);e=g.reduce((p,T,m,h)=>{r&&(n=20+Math.floor(m/s*80),n!==a&&(a=n,r(n)));let L=m===0?0:h[m-1][1],D=h[m][0];return`${p}${e.slice(L,D)}${h[m][2]||""}`},""),e+=d}return e}function le(e,t=1){let r="\xA0";function n(o){return Array.from(o).reverse().join("")}function a(o,u,l){let g=l?`
12
12
  `:"\r",s=l?"\r":`
13
- `;if(!o)return o;let d=0,p=0,T="";for(let m=0,f=o.length;m<f;m++)(o[m]===g||o[m]===s&&o[m-1]!==g)&&p++,`\r
14
- `.includes(o[m])||o[m]===r?(d=0,o[m]===r?T+=o[m]:o[m]===g?p<=u&&(T+=o[m],o[m+1]===s&&(T+=o[m+1],m++)):o[m]===s&&(o==null?void 0:o[m-1])!==g&&p<=u&&(T+=o[m])):(d++,!o[m+1]&&!p&&(T+=" "));return T}if(typeof e=="string"&&e.length){let o=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(o=+t);let u="",l="";if(!e.trim())u=e;else if(!e[0].trim()){for(let g=0,s=e.length;g<s;g++)if(e[g].trim()){u=e.slice(0,g);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let g=e.length;g--;)if(e[g].trim()){l=e.slice(g+1);break}}return`${a(u,o,!1)}${e.trim()}${n(a(n(l),o,!0))}`}return e}function H(e){return D(e)&&e.length===1&&e.toUpperCase()!==e.toLowerCase()}function W(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function D(e){return typeof e=="string"}function _(e){return Number.isSafeInteger(e)&&e>=0}function R(e){return e!=null}function Qe(e,t){return W(e)&&D(t)&&Object.prototype.hasOwnProperty.call(e,t)}var cn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Xe(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},cn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,g)=>!Array.isArray(l)||l.length!==2?(n=g,a=l.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((l,g)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(n=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((l,g)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===g[0]?l[1]<g[1]?-1:l[1]>g[1]?1:0:l[0]<g[0]?-1:1))}var ze={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function mn(e,t){function r(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},ze),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
15
- ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},ze);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Xe(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Xe(a);let g=o.length-1;for(let s=g;s>0;s--)n.progressFn&&(l=Math.floor((1-s/g)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var fn={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Ze=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=S(S({},fn),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(D(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(D(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){var o;if(e==null&&t==null)return;if(R(e)&&!R(t)){if(Array.isArray(e)){if(e.length){if(e.some(u=>Array.isArray(u))){e.forEach(u=>{Array.isArray(u)&&this.add(...u)});return}e.length&&_(+e[0])&&_(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!R(e)&&R(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let n=+e,a=+t;if(_(r)&&(r=String(r)),_(n)&&_(a)){if(R(r)&&!D(r)&&!_(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
16
- ${JSON.stringify(r,null,4)}`);if(R(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=a,this.last()[2],this.last()[2]!==null&&R(r)){let u=this.last()[2]&&this.last()[2].length&&(!((o=this.opts)!=null&&o.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(u=le(u,this.opts.limitLinebreaksCount)),D(u)&&!u.length||(this.last()[2]=u)}}else{this.ranges||(this.ranges=[]);let u=r!==void 0&&!(D(r)&&!r.length)?[n,a,r&&this.opts.limitToBeAddedWhitespace?le(r,this.opts.limitLinebreaksCount):r]:[n,a];this.ranges.push(u)}}else throw _(n)&&n>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof a}" equal to: ${JSON.stringify(a,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof n}" equal to: ${JSON.stringify(n,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=mn(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>R(e[2])?[e[0],e[1],le(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&_(e[0][0]))this.ranges=Array.from(e);else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0],null,4)} should be an array and its first element should be an integer, a string index.`);else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};function et(e){return typeof e!="string"?e:e.length?[e]:[]}var tt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},hn=e=>e+1;function $n(e,t,r,n,a=!1,o=hn){let u=typeof r=="function"?r():r;if(+t<0&&a&&u==="EOL")return u;let l=S(S({},tt),n);if(t>=e.length&&!a)return!1;let g=a?1:r.length,s=0,d=!1,p=!1,T=!1,m=l.maxMismatches,f=t,w=!1,L=!1,b=!1;function h(){return s===1&&m<l.maxMismatches-1}for(;e[f];){let $=o(f);if(l.trimBeforeMatching&&e[f].trim()===""){if(!e[$]&&a&&r==="EOL")return!0;f=o(f);continue}if(l&&!l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.includes(e[f])||l!=null&&l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.map(C=>C.toLowerCase()).includes(e[f].toLowerCase())){if(a&&r==="EOL"&&!e[$])return!0;f=o(f);continue}let y=$>f?r[r.length-g]:r[g-1];if(!l.i&&e[f]===y||l.i&&e[f].toLowerCase()===y.toLowerCase()){if(w||(w=!0),T||(T=!0),g===r.length){if(L=!0,m!==l.maxMismatches)return!1}else g===1&&(b=!0);if(g-=1,s++,h())return!1;if(!g)return s!==r.length||m===l.maxMismatches||!d?f:!1}else if(!d&&!s&&(d=!0),l.maxMismatches&&m&&f){m-=1;for(let C=0;C<=m;C++){let v=$>f?r[r.length-g+1+C]:r[g-2-C],P=e[o(f)];if(v&&(!l.i&&e[f]===v||l.i&&e[f].toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||g!==r.length)){if(s++,h())return!1;g-=2,w=!0;break}else if(P&&v&&(!l.i&&P===v||l.i&&P.toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||g!==r.length)){if(!s&&!l.hungry)return!1;g-=1,w=!0;break}else if(v===void 0&&m>=0&&w&&(!l.firstMustMatch||L)&&(!l.lastMustMatch||b))return f}w||(p=f)}else return f===0&&g===1&&!l.lastMustMatch&&T?0:!1;if(p!==!1&&p!==f&&(p=!1),g<1)return f;f=o(f)}if(g>0)return a&&u==="EOL"?!0:l&&l.maxMismatches>=g&&T?p||0:!1}function we(e,t,r,n,a){var d,p;if(W(a)&&Qe(a,"trimBeforeMatching")&&a&&typeof a.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let o=S(S({},tt),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=et(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map(T=>D(T)?T:String(T)),!D(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof r}, equal to:
17
- ${JSON.stringify(r,null,4)}`);let u,l;if(D(n))u=[n];else if(Array.isArray(n))u=n;else if(!n)u=n;else if(typeof n=="function")u=[],u.push(n);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof n}, equal to:
18
- ${JSON.stringify(n,null,4)}`);if(a&&!W(a))throw new Error(`string-match-left-right/${e}(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof a}", and equal to:
19
- ${JSON.stringify(a,null,4)}`);let g=0,s="";if(o!=null&&o.trimCharsBeforeMatching&&o.trimCharsBeforeMatching.some((T,m)=>T.length>1?(g=m,s=T,!0):!1))throw new Error(`string-match-left-right/${e}(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${g} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!u||!Array.isArray(u)||Array.isArray(u)&&!u.length||Array.isArray(u)&&u.length===1&&D(u[0])&&!u[0].trim()){if(typeof o.cb=="function"){let m,f=r;if((e==="matchLeftIncl"||e==="matchRight")&&(f+=1),e[5]==="L")for(let h=f;h--;){let $=t[h];if((!o.trimBeforeMatching||o.trimBeforeMatching&&$!==void 0&&$.trim())&&(!((d=o.trimCharsBeforeMatching)!=null&&d.length)||$!==void 0&&!o.trimCharsBeforeMatching.includes($))){m=h;break}}else if(e.startsWith("matchRight"))for(let h=f;h<t.length;h++){let $=t[h];if((!o.trimBeforeMatching||o.trimBeforeMatching&&$.trim())&&(!((p=o.trimCharsBeforeMatching)!=null&&p.length)||!o.trimCharsBeforeMatching.includes($))){m=h;break}}if(m===void 0)return!1;let w=t[m],L=m+1,b="";return L&&L>0&&(b=t.slice(0,L)),e[5]==="L"||m&&m>0&&(b=t.slice(m)),o.cb(w,b,m)}let T="";throw a||(T=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${e}(): [THROW_ID_08] 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!${T}`)}for(let T=0,m=u.length;T<m;T++){l=typeof u[T]=="function";let f=u[T],w,L,b="",h=r;e==="matchRight"?h+=1:e==="matchLeft"&&(h-=1);let $=$n(t,h,f,o,l,y=>e[5]==="L"?y-1:y+1);if($&&l&&typeof f=="function"&&f()==="EOL")return f()&&(!o.cb||o.cb(w,b,L))?f():!1;if(Number.isInteger($)&&(L=e.startsWith("matchLeft")?$-1:$+1,e[5]==="L"?b=t.slice(0,$):b=t.slice(L)),L<0&&(L=void 0),t[L]&&(w=t[L]),Number.isInteger($)&&(!o.cb||o.cb(w,b,L)))return f}return!1}function nt(e,t,r,n){return we("matchLeft",e,t,r,n)}function Le(e,t,r,n){return we("matchRightIncl",e,t,r,n)}function G(e,t,r,n){return we("matchRight",e,t,r,n)}function pn(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function q(e){return typeof e=="string"}function rt(e){return Number.isSafeInteger(e)&&e>=0}var dn={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var l;let t=/^[0-9a-zA-Z]+$/;function r(g){return q(g)&&!g.trim()}if(pn(e)){if(!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.")}else{let g;throw e===void 0?g="but it is missing completely.":e===null?g="but it was given as null.":g=`but it was given as ${typeof e}, equal to:
20
- ${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${g}`)}if(!rt(e.from))throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value resolvedOpts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(!rt(e.to))throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value resolvedOpts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if(e!=null&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string resolvedOpts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if(e!=null&&e.str&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, resolvedOpts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(e.extendToOneSide===null||q(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!q(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error(`string-range-expander: [THROW_ID_08] The resolvedOpts.extendToOneSide value is not recognisable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let n=S(S({},dn),e);if(Array.isArray(n.ifLeftSideIncludesThisThenCropTightly)){let g,s;if(n.ifLeftSideIncludesThisThenCropTightly.every((d,p)=>q(d)?!0:(g=p,s=d,!1)))n.ifLeftSideIncludesThisThenCropTightly=n.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The resolvedOpts.ifLeftSideIncludesThisThenCropTightly was set to an array:
21
- ${JSON.stringify(n.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${g} is of a type ${typeof s} (equal to ${JSON.stringify(s,null,0)}).`)}let a=n.str,o=n.from,u=n.to;if(n.extendToOneSide!=="right"&&(r(a[o-1])&&(r(a[o-2])||n.ifLeftSideIncludesThisCropItToo.includes(a[o-2]))||a[o-1]&&n.ifLeftSideIncludesThisCropItToo.includes(a[o-1])||n.wipeAllWhitespaceOnLeft&&r(a[o-1]))){for(let g=o;g--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(a[g])){if(a[g].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(a[g+1])?o=g+1:o=g+2;break}else if(g===0){n.wipeAllWhitespaceOnLeft?o=0:o=1;break}}}if(n.extendToOneSide!=="left"&&(r(a[u])&&(n.wipeAllWhitespaceOnRight||r(a[u+1]))||n.ifRightSideIncludesThisCropItToo.includes(a[u]))){for(let g=u,s=a.length;g<s;g++)if(!n.ifRightSideIncludesThisCropItToo.includes(a[g])&&((l=a[g])!=null&&l.trim())){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(a[g-1])?u=g:u=g-1;break}}return(n.extendToOneSide!=="right"&&q(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(a[o-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(a[o-2])||a[o-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(a[o-1]))||n.extendToOneSide!=="left"&&q(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(a[u+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(a[u+1])||a[u]&&n.ifRightSideIncludesThisThenCropTightly.includes(a[u])))&&(n.extendToOneSide!=="right"&&r(a[o-1])&&!n.wipeAllWhitespaceOnLeft&&(o-=1),n.extendToOneSide!=="left"&&r(a[u])&&!n.wipeAllWhitespaceOnRight&&(u+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&a[o-1]&&a[o-1].trim()&&a[u]&&a[u].trim()&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(a[o-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||a[u]&&n.ifRightSideIncludesThisThenCropTightly.includes(a[u]))))&&(t.test(a[o-1])||t.test(a[u]))?[o,u," "]:[o,u]}var Ur=ln(Ut(),1);var z="\xA0";function Gr({str:e,idx:t=0,stopAtNewlines:r=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||r&&`
13
+ `;if(!o)return o;let d=0,p=0,T="";for(let m=0,h=o.length;m<h;m++)(o[m]===g||o[m]===s&&o[m-1]!==g)&&p++,`\r
14
+ `.includes(o[m])||o[m]===r?(d=0,o[m]===r?T+=o[m]:o[m]===g?p<=u&&(T+=o[m],o[m+1]===s&&(T+=o[m+1],m++)):o[m]===s&&(o==null?void 0:o[m-1])!==g&&p<=u&&(T+=o[m])):(d++,!o[m+1]&&!p&&(T+=" "));return T}if(typeof e=="string"&&e.length){let o=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(o=+t);let u="",l="";if(!e.trim())u=e;else if(!e[0].trim()){for(let g=0,s=e.length;g<s;g++)if(e[g].trim()){u=e.slice(0,g);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let g=e.length;g--;)if(e[g].trim()){l=e.slice(g+1);break}}return`${a(u,o,!1)}${e.trim()}${n(a(n(l),o,!0))}`}return e}function W(e){return S(e)&&e.length===1&&e.toUpperCase()!==e.toLowerCase()}function V(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function S(e){return typeof e=="string"}function _(e){return Number.isSafeInteger(e)&&e>=0}function R(e){return e!=null}function Ye(e,t){return V(e)&&S(t)&&Object.prototype.hasOwnProperty.call(e,t)}var Qe={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function an(e,t){function r(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=w(w({},Qe),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
15
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=w({},Qe);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=G(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=G(a);let g=o.length-1;for(let s=g;s>0;s--)n.progressFn&&(l=Math.floor((1-s/g)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var un={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Xe=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=w(w({},un),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(S(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(S(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){var o;if(e==null&&t==null)return;if(R(e)&&!R(t)){if(Array.isArray(e)){if(e.length){if(e.some(u=>Array.isArray(u))){e.forEach(u=>{Array.isArray(u)&&this.add(...u)});return}e.length&&_(+e[0])&&_(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!R(e)&&R(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let n=+e,a=+t;if(_(r)&&(r=String(r)),_(n)&&_(a)){if(R(r)&&!S(r)&&!_(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
16
+ ${JSON.stringify(r,null,4)}`);if(R(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=a,this.last()[2],this.last()[2]!==null&&R(r)){let u=this.last()[2]&&this.last()[2].length&&(!((o=this.opts)!=null&&o.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(u=le(u,this.opts.limitLinebreaksCount)),S(u)&&!u.length||(this.last()[2]=u)}}else{this.ranges||(this.ranges=[]);let u=r!==void 0&&!(S(r)&&!r.length)?[n,a,r&&this.opts.limitToBeAddedWhitespace?le(r,this.opts.limitLinebreaksCount):r]:[n,a];this.ranges.push(u)}}else throw _(n)&&n>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof a}" equal to: ${JSON.stringify(a,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof n}" equal to: ${JSON.stringify(n,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=an(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>R(e[2])?[e[0],e[1],le(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&_(e[0][0]))this.ranges=Array.from(e);else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0],null,4)} should be an array and its first element should be an integer, a string index.`);else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};function ze(e){return typeof e!="string"?e:e.length?[e]:[]}var Ze={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},gn=e=>e+1;function cn(e,t,r,n,a=!1,o=gn){let u=typeof r=="function"?r():r;if(+t<0&&a&&u==="EOL")return u;let l=w(w({},Ze),n);if(t>=e.length&&!a)return!1;let g=a?1:r.length,s=0,d=!1,p=!1,T=!1,m=l.maxMismatches,h=t,L=!1,D=!1,b=!1;function f(){return s===1&&m<l.maxMismatches-1}for(;e[h];){let $=o(h);if(l.trimBeforeMatching&&e[h].trim()===""){if(!e[$]&&a&&r==="EOL")return!0;h=o(h);continue}if(l&&!l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.includes(e[h])||l!=null&&l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[h].toLowerCase())){if(a&&r==="EOL"&&!e[$])return!0;h=o(h);continue}let y=$>h?r[r.length-g]:r[g-1];if(!l.i&&e[h]===y||l.i&&e[h].toLowerCase()===y.toLowerCase()){if(L||(L=!0),T||(T=!0),g===r.length){if(D=!0,m!==l.maxMismatches)return!1}else g===1&&(b=!0);if(g-=1,s++,f())return!1;if(!g)return s!==r.length||m===l.maxMismatches||!d?h:!1}else if(!d&&!s&&(d=!0),l.maxMismatches&&m&&h){m-=1;for(let A=0;A<=m;A++){let v=$>h?r[r.length-g+1+A]:r[g-2-A],x=e[o(h)];if(v&&(!l.i&&e[h]===v||l.i&&e[h].toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||g!==r.length)){if(s++,f())return!1;g-=2,L=!0;break}else if(x&&v&&(!l.i&&x===v||l.i&&x.toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||g!==r.length)){if(!s&&!l.hungry)return!1;g-=1,L=!0;break}else if(v===void 0&&m>=0&&L&&(!l.firstMustMatch||D)&&(!l.lastMustMatch||b))return h}L||(p=h)}else return h===0&&g===1&&!l.lastMustMatch&&T?0:!1;if(p!==!1&&p!==h&&(p=!1),g<1)return h;h=o(h)}if(g>0)return a&&u==="EOL"?!0:l&&l.maxMismatches>=g&&T?p||0:!1}function Oe(e,t,r,n,a){var d,p;if(V(a)&&Ye(a,"trimBeforeMatching")&&a&&typeof a.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let o=w(w({},Ze),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=ze(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map(T=>S(T)?T:String(T)),!S(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof r}, equal to:
17
+ ${JSON.stringify(r,null,4)}`);let u,l;if(S(n))u=[n];else if(Array.isArray(n))u=n;else if(!n)u=n;else if(typeof n=="function")u=[],u.push(n);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof n}, equal to:
18
+ ${JSON.stringify(n,null,4)}`);if(a&&!V(a))throw new Error(`string-match-left-right/${e}(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof a}", and equal to:
19
+ ${JSON.stringify(a,null,4)}`);let g=0,s="";if(o!=null&&o.trimCharsBeforeMatching&&o.trimCharsBeforeMatching.some((T,m)=>T.length>1?(g=m,s=T,!0):!1))throw new Error(`string-match-left-right/${e}(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${g} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!u||!Array.isArray(u)||Array.isArray(u)&&!u.length||Array.isArray(u)&&u.length===1&&S(u[0])&&!u[0].trim()){if(typeof o.cb=="function"){let m,h=r;if((e==="matchLeftIncl"||e==="matchRight")&&(h+=1),e[5]==="L")for(let f=h;f--;){let $=t[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&$!==void 0&&$.trim())&&(!((d=o.trimCharsBeforeMatching)!=null&&d.length)||$!==void 0&&!o.trimCharsBeforeMatching.includes($))){m=f;break}}else if(e.startsWith("matchRight"))for(let f=h;f<t.length;f++){let $=t[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&$.trim())&&(!((p=o.trimCharsBeforeMatching)!=null&&p.length)||!o.trimCharsBeforeMatching.includes($))){m=f;break}}if(m===void 0)return!1;let L=t[m],D=m+1,b="";return D&&D>0&&(b=t.slice(0,D)),e[5]==="L"||m&&m>0&&(b=t.slice(m)),o.cb(L,b,m)}let T="";throw a||(T=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${e}(): [THROW_ID_08] 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!${T}`)}for(let T=0,m=u.length;T<m;T++){l=typeof u[T]=="function";let h=u[T],L,D,b="",f=r;e==="matchRight"?f+=1:e==="matchLeft"&&(f-=1);let $=cn(t,f,h,o,l,y=>e[5]==="L"?y-1:y+1);if($&&l&&typeof h=="function"&&h()==="EOL")return h()&&(!o.cb||o.cb(L,b,D))?h():!1;if(Number.isInteger($)&&(D=e.startsWith("matchLeft")?$-1:$+1,e[5]==="L"?b=t.slice(0,$):b=t.slice(D)),D<0&&(D=void 0),t[D]&&(L=t[D]),Number.isInteger($)&&(!o.cb||o.cb(L,b,D)))return h}return!1}function et(e,t,r,n){return Oe("matchLeft",e,t,r,n)}function we(e,t,r,n){return Oe("matchRightIncl",e,t,r,n)}function q(e,t,r,n){return Oe("matchRight",e,t,r,n)}var mn={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var l;let t=/^[0-9a-zA-Z]+$/;function r(g){return S(g)&&!g.trim()}if(V(e)){if(!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.")}else{let g;throw e===void 0?g="but it is missing completely.":e===null?g="but it was given as null.":g=`but it was given as ${typeof e}, equal to:
20
+ ${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${g}`)}if(!_(e.from))throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value resolvedOpts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(!_(e.to))throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value resolvedOpts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if(e!=null&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string resolvedOpts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if(e!=null&&e.str&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, resolvedOpts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(e.extendToOneSide===null||S(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!S(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error(`string-range-expander: [THROW_ID_08] The resolvedOpts.extendToOneSide value is not recognisable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let n=w(w({},mn),e);if(Array.isArray(n.ifLeftSideIncludesThisThenCropTightly)){let g,s;if(n.ifLeftSideIncludesThisThenCropTightly.every((d,p)=>S(d)?!0:(g=p,s=d,!1)))n.ifLeftSideIncludesThisThenCropTightly=n.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The resolvedOpts.ifLeftSideIncludesThisThenCropTightly was set to an array:
21
+ ${JSON.stringify(n.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${g} is of a type ${typeof s} (equal to ${JSON.stringify(s,null,0)}).`)}let a=n.str,o=n.from,u=n.to;if(n.extendToOneSide!=="right"&&(r(a[o-1])&&(r(a[o-2])||n.ifLeftSideIncludesThisCropItToo.includes(a[o-2]))||a[o-1]&&n.ifLeftSideIncludesThisCropItToo.includes(a[o-1])||n.wipeAllWhitespaceOnLeft&&r(a[o-1]))){for(let g=o;g--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(a[g])){if(a[g].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(a[g+1])?o=g+1:o=g+2;break}else if(g===0){n.wipeAllWhitespaceOnLeft?o=0:o=1;break}}}if(n.extendToOneSide!=="left"&&(r(a[u])&&(n.wipeAllWhitespaceOnRight||r(a[u+1]))||n.ifRightSideIncludesThisCropItToo.includes(a[u]))){for(let g=u,s=a.length;g<s;g++)if(!n.ifRightSideIncludesThisCropItToo.includes(a[g])&&((l=a[g])!=null&&l.trim())){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(a[g-1])?u=g:u=g-1;break}}return(n.extendToOneSide!=="right"&&S(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(a[o-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(a[o-2])||a[o-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(a[o-1]))||n.extendToOneSide!=="left"&&S(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(a[u+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(a[u+1])||a[u]&&n.ifRightSideIncludesThisThenCropTightly.includes(a[u])))&&(n.extendToOneSide!=="right"&&r(a[o-1])&&!n.wipeAllWhitespaceOnLeft&&(o-=1),n.extendToOneSide!=="left"&&r(a[u])&&!n.wipeAllWhitespaceOnRight&&(u+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&a[o-1]&&a[o-1].trim()&&a[u]&&a[u].trim()&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(a[o-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||a[u]&&n.ifRightSideIncludesThisThenCropTightly.includes(a[u]))))&&(t.test(a[o-1])||t.test(a[u]))?[o,u," "]:[o,u]}var Wr=rn(Jt(),1);var z="\xA0";function Br({str:e,idx:t=0,stopAtNewlines:r=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||r&&`
22
22
  \r`.includes(e[t+1])||n&&e[t+1]===z))return t+1;if(e[t+2]&&(e[t+2].trim()||r&&`
23
23
  \r`.includes(e[t+2])||n&&e[t+2]===z))return t+2;for(let a=t+1,o=e.length;a<o;a++)if(e[a].trim()||r&&`
24
- \r`.includes(e[a])||n&&e[a]===z)return a;return null}function A(e,t=0){return Gr({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function qr({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&`
24
+ \r`.includes(e[a])||n&&e[a]===z)return a;return null}function C(e,t=0){return Br({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function Jr({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&`
25
25
  \r`.includes(e[~-t])||n&&e[~-t]===z))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&`
26
26
  \r`.includes(e[t-2])||n&&e[t-2]===z))return t-2;for(let a=t;a--;)if(e[a]&&(e[a].trim()||r&&`
27
- \r`.includes(e[a])||n&&e[a]===z))return a;return null}function de(e,t=0){return qr({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var Gt="6.0.9";var Yr=Gt,E=new Ze({limitToBeAddedWhitespace:!0}),qt={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 Qr(e,t){let r=Date.now();if(!D(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
28
- ${JSON.stringify(e,null,4)}`);if(t&&!W(t))throw new Error(`html-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 ${JSON.stringify(t,null,4)}`);if(t&&Array.isArray(t.breakToTheLeftOf)&&t.breakToTheLeftOf.length){for(let i=0,te=t.breakToTheLeftOf.length;i<te;i++)if(!D(t.breakToTheLeftOf[i]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${i} is of a type "${typeof t.breakToTheLeftOf[i]}" and is equal to:
29
- ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.removeHTMLComments=="boolean"&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let a="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(a=[...new Set(n.breakToTheLeftOf.map(i=>i[0]))].join(""));let o={removeHTMLComments:!1,removeCSSComments:!1},u=null,l=null,g=!1,s=0,d=0,p=!1,T=!1,m=null,f=null,w=null,L=null,b,h=null,$=null,y=null,C=null,v=null,P=null,Z=">};",ee="<",Kt="!",Yt=">",Qt="<",We="{},:;<>~+",be=We,Te=We,k=!0,N=e.length,Xt=Math.floor(N/2),Be=.01,Je;n.reportProgressFunc&&(Je=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*Be-n.reportProgressFuncFrom));let x,se=0,I=`
27
+ \r`.includes(e[a])||n&&e[a]===z))return a;return null}function de(e,t=0){return Jr({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var kt="6.0.10";var jr=kt,E=new Xe({limitToBeAddedWhitespace:!0}),jt={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 Ur(e,t){let r=Date.now();if(!S(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
28
+ ${JSON.stringify(e,null,4)}`);if(t&&!V(t))throw new Error(`html-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 ${JSON.stringify(t,null,4)}`);if(t&&Array.isArray(t.breakToTheLeftOf)&&t.breakToTheLeftOf.length){for(let i=0,te=t.breakToTheLeftOf.length;i<te;i++)if(!S(t.breakToTheLeftOf[i]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${i} is of a type "${typeof t.breakToTheLeftOf[i]}" and is equal to:
29
+ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=w(w({},jt),t);typeof n.removeHTMLComments=="boolean"&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let a="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(a=[...new Set(n.breakToTheLeftOf.map(i=>i[0]))].join(""));let o={removeHTMLComments:!1,removeCSSComments:!1},u=null,l=null,g=!1,s=0,d=0,p=!1,T=!1,m=null,h=null,L=null,D=null,b,f=null,$=null,y=null,A=null,v=null,x=null,Z=">};",ee="<",Ut="!",Gt=">",qt="<",He="{},:;<>~+",be=He,Te=He,j=!0,N=e.length,Kt=Math.floor(N/2),We=.01,Be;n.reportProgressFunc&&(Be=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*We-n.reportProgressFuncFrom));let F,se=0,I=`
30
30
  `;if(e.includes(`\r
31
31
  `)?I=`\r
32
- `:e.includes("\r")&&(I="\r"),N){for(let i=0;i<N;i++){if(n.reportProgressFunc&&(N>1e3&&N<2e3?i===Xt&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):N>=2e3&&(x=n.reportProgressFuncFrom+Math.floor(i/N*(Je||1)),x!==se&&(se=x,n.reportProgressFunc(x)))),d++,!b&&p&&e[i]==="}"&&e[i-1]==="}"&&(s+1>=n.lineLengthLimit?(E.push(i,i,I),s=0):(h=i,$=i,y=" ")),b&&typeof b=="number"&&i>=b&&(b=void 0),L!==null&&e.startsWith("<\/script",i)&&!H(e[i+8])){if((n.removeIndentations||n.removeLineBreaks)&&i>0&&e[~-i]&&!e[~-i].trim()){for(let c=i;c--;)if(e[c]===`
33
- `||e[c]==="\r"||e[c].trim()){c+1<i&&E.push(c+1,i);break}}L=null,b=!1,i+=8;continue}if(!b&&!p&&e.startsWith("<script",i)&&!H(e[i+7])){L=i,b=!0;let c="";(n.removeLineBreaks||n.removeIndentations)&&l!==null&&(l>0&&(c=I),E.push(l,i,c)),l=null,u=null}if(v!==null&&C===null&&!/\w/.test(e[i])){C=e.slice(v,i);let c=A(e,~-i);typeof c=="number"&&e[c]===">"&&!e[i].trim()&&A(e,i)?E.push(i,A(e,i)):c&&e[c]==="/"&&e[A(e,c)]===">"&&(!e[i].trim()&&A(e,i)&&E.push(i,A(e,i)),e[c+1]!==">"&&A(e,c+1)&&E.push(c+1,A(e,c+1)))}if(!b&&!p&&!m&&e[~-i]==="<"&&v===null&&(/\w/.test(e[i])?v=i:e[A(e,~-i)]==="/"&&/\w/.test(e[A(e,A(e,~-i))]||"")&&(v=A(e,A(e,~-i)))),!b&&(p||m)&&f!==null&&e[i]==="*"&&e[i+1]==="/"&&([h,$]=ae({str:e,from:f,to:i+2,ifLeftSideIncludesThisThenCropTightly:be||"",ifRightSideIncludesThisThenCropTightly:Te||""}),f=null,h!=null?E.push(h,$):(s+=1,i+=1),b=i+2),!b&&(p||m)&&f===null&&e[i]==="/"&&e[i+1]==="*"&&(o.removeCSSComments||(o.removeCSSComments=!0),n.removeCSSComments&&(f=i)),T&&e.startsWith("![endif",i+1)&&(T=!1),!b&&!p&&!m&&w!==null){let c;e.startsWith("-->",i)?c=3:e[i]===">"&&e[i-1]==="]"&&(c=1),c&&([h,$]=ae({str:e,from:w,to:i+c}),w=null,h!=null?n.lineLengthLimit&&d-($-h)>=n.lineLengthLimit?(E.push(h,$,I),d=-c):(E.push(h,$),d-=$-h):(s+=c-1,i+=c-1),b=i+c)}if(!b&&!p&&!m&&(e.startsWith("<!--",i)||n.removeHTMLComments===2&&e.startsWith("<![endif",i))&&w===null&&(e.startsWith("[if",i+4)?(T||(T=!0),n.removeHTMLComments===2&&(w=i)):n.removeHTMLComments&&(!T||n.removeHTMLComments===2)&&(w=i),o.removeHTMLComments||(o.removeHTMLComments=!0)),!b&&p&&f===null&&e.startsWith("</style",i)&&!H(e[i+7])?p=!1:!b&&!p&&f===null&&e.startsWith("<style",i)&&!H(e[i+6])&&(p=!0,(n.removeLineBreaks||n.removeIndentations)&&n.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',i+6)&&e[i+24]&&E.push(i+23,i+23,I)),!b&&!m&&`"'`.includes(e[i])&&e.endsWith("style=",i)&&(m=i),!b&&!e[i].trim())l===null&&(l=i);else if(!b&&!((p||m)&&f!==null)){if(l!==null){if(n.removeLineBreaks&&(s+=1),k)k=!1,(n.removeIndentations||n.removeLineBreaks)&&E.push(0,i);else if(n.removeIndentations&&!n.removeLineBreaks&&(!g&&u!==null&&i>u?E.push(u+1,i):l+1<i&&(e.endsWith("]>",l)||e.endsWith("-->",l)||e.startsWith("<![",i)||e.startsWith("<!--<![",i)?E.push(l,i):e[l]===" "?E.push(l+1,i):e[~-i]===" "?E.push(l,~-i):E.push(l,i," "))),n.removeLineBreaks||m){if(a.includes(e[i])&&Le(e,i,n.breakToTheLeftOf)){!(`\r
32
+ `:e.includes("\r")&&(I="\r"),N){for(let i=0;i<N;i++){if(n.reportProgressFunc&&(N>1e3&&N<2e3?i===Kt&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):N>=2e3&&(F=n.reportProgressFuncFrom+Math.floor(i/N*(Be||1)),F!==se&&(se=F,n.reportProgressFunc(F)))),d++,!b&&p&&e[i]==="}"&&e[i-1]==="}"&&(s+1>=n.lineLengthLimit?(E.push(i,i,I),s=0):(f=i,$=i,y=" ")),b&&typeof b=="number"&&i>=b&&(b=void 0),D!==null&&e.startsWith("<\/script",i)&&!W(e[i+8])){if((n.removeIndentations||n.removeLineBreaks)&&i>0&&e[~-i]&&!e[~-i].trim()){for(let c=i;c--;)if(e[c]===`
33
+ `||e[c]==="\r"||e[c].trim()){c+1<i&&E.push(c+1,i);break}}D=null,b=!1,i+=8;continue}if(!b&&!p&&e.startsWith("<script",i)&&!W(e[i+7])){D=i,b=!0;let c="";(n.removeLineBreaks||n.removeIndentations)&&l!==null&&(l>0&&(c=I),E.push(l,i,c)),l=null,u=null}if(v!==null&&A===null&&!/\w/.test(e[i])){A=e.slice(v,i);let c=C(e,~-i);typeof c=="number"&&e[c]===">"&&!e[i].trim()&&C(e,i)?E.push(i,C(e,i)):c&&e[c]==="/"&&e[C(e,c)]===">"&&(!e[i].trim()&&C(e,i)&&E.push(i,C(e,i)),e[c+1]!==">"&&C(e,c+1)&&E.push(c+1,C(e,c+1)))}if(!b&&!p&&!m&&e[~-i]==="<"&&v===null&&(/\w/.test(e[i])?v=i:e[C(e,~-i)]==="/"&&/\w/.test(e[C(e,C(e,~-i))]||"")&&(v=C(e,C(e,~-i)))),!b&&(p||m)&&h!==null&&e[i]==="*"&&e[i+1]==="/"&&([f,$]=ae({str:e,from:h,to:i+2,ifLeftSideIncludesThisThenCropTightly:be||"",ifRightSideIncludesThisThenCropTightly:Te||""}),h=null,f!=null?E.push(f,$):(s+=1,i+=1),b=i+2),!b&&(p||m)&&h===null&&e[i]==="/"&&e[i+1]==="*"&&(o.removeCSSComments||(o.removeCSSComments=!0),n.removeCSSComments&&(h=i)),T&&e.startsWith("![endif",i+1)&&(T=!1),!b&&!p&&!m&&L!==null){let c;e.startsWith("-->",i)?c=3:e[i]===">"&&e[i-1]==="]"&&(c=1),c&&([f,$]=ae({str:e,from:L,to:i+c}),L=null,f!=null?n.lineLengthLimit&&d-($-f)>=n.lineLengthLimit?(E.push(f,$,I),d=-c):(E.push(f,$),d-=$-f):(s+=c-1,i+=c-1),b=i+c)}if(!b&&!p&&!m&&(e.startsWith("<!--",i)||n.removeHTMLComments===2&&e.startsWith("<![endif",i))&&L===null&&(e.startsWith("[if",i+4)?(T||(T=!0),n.removeHTMLComments===2&&(L=i)):n.removeHTMLComments&&(!T||n.removeHTMLComments===2)&&(L=i),o.removeHTMLComments||(o.removeHTMLComments=!0)),!b&&p&&h===null&&e.startsWith("</style",i)&&!W(e[i+7])?p=!1:!b&&!p&&h===null&&e.startsWith("<style",i)&&!W(e[i+6])&&(p=!0,(n.removeLineBreaks||n.removeIndentations)&&n.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',i+6)&&e[i+24]&&E.push(i+23,i+23,I)),!b&&!m&&`"'`.includes(e[i])&&e.endsWith("style=",i)&&(m=i),!b&&!e[i].trim())l===null&&(l=i);else if(!b&&!((p||m)&&h!==null)){if(l!==null){if(n.removeLineBreaks&&(s+=1),j)j=!1,(n.removeIndentations||n.removeLineBreaks)&&E.push(0,i);else if(n.removeIndentations&&!n.removeLineBreaks&&(!g&&u!==null&&i>u?E.push(u+1,i):l+1<i&&(e.endsWith("]>",l)||e.endsWith("-->",l)||e.startsWith("<![",i)||e.startsWith("<!--<![",i)?E.push(l,i):e[l]===" "?E.push(l+1,i):e[~-i]===" "?E.push(l,~-i):E.push(l,i," "))),n.removeLineBreaks||m){if(a.includes(e[i])&&we(e,i,n.breakToTheLeftOf)){!(`\r
34
34
  `.includes(e[~-i])&&l===~-i)&&!(e[~-i]===`
35
- `&&e[i-2]==="\r"&&l===i-2)&&E.push(l,i,I),h=null,$=null,y=null,l=null,s=1;continue}let c=" ";e[i]==="<"&&G(e,i,n.mindTheInlineTags,{cb:U=>!U||!/\w/.test(U)})||(e[~-l]&&Yt.includes(e[~-l])&&Qt.includes(e[i])||(p||m)&&f===null&&(be.includes(e[~-l])||Te.includes(e[i]))||e.startsWith("!important",i)&&!T||m&&(e[~-l]==="'"||e[~-l]==='"')||e[~-l]==="}"&&e.startsWith("</style",i)||e[i]===">"&&(`'"`.includes(e[de(e,i)])||e[A(e,i)]==="<")||e[i]==="/"&&e[A(e,i)]===">")&&(c="",e[i]==="/"&&e[i+1]===">"&&A(e,i)&&A(e,i)>i+1&&(E.push(i+1,A(e,i)),s-=A(e,i)-i+1)),p&&e[i]==="}"&&l&&e[l-1]==="}"&&(c=" "),c!=null&&c.length&&(s+=1),n.lineLengthLimit?s>=n.lineLengthLimit||!e[i+1]||e[i]===">"||e[i]==="/"&&e[i+1]===">"?((s>n.lineLengthLimit||s===n.lineLengthLimit&&e[i+1]&&e[i+1].trim()&&!Z.includes(e[i])&&!ee.includes(e[i+1]))&&(c=I,s=1),(s>n.lineLengthLimit||!(c===" "&&i===l+1))&&(E.push(l,i,c),u=null),h=null,$=null,y=null):(h===null||l<h)&&(h=l,$=i,y=c):i===l+1&&c===" "||E.push(l,i,c)}l=null,g||(g=!0)}else k&&(k=!1),n.removeLineBreaks&&(s+=1);g||(g=!0)}if(!b&&!k&&i!==0&&n.removeLineBreaks&&(n.lineLengthLimit||a)&&!e.startsWith("</a",i)){if(a&&Le(e,i,n.breakToTheLeftOf)&&e.slice(0,i).trim()&&(!e.startsWith("<![endif]",i)||!nt(e,i,"<!--"))){E.push(i,i,I),h=null,$=null,y=null,s=1;continue}else if(n.lineLengthLimit&&s<=n.lineLengthLimit){if(!e[i+1]||ee.includes(e[i])&&!Kt.includes(e[i])||Z.includes(e[i])||!e[i].trim()){if(h!==null&&$!==null&&(h!==$||y!=null&&y.length)){let c=y;e[i].trim()&&e[i+1]&&e[i+1].trim()&&s+(y?y.length:0)>n.lineLengthLimit&&(c=I),(s+(c?c.length:0)>n.lineLengthLimit||!(c===" "&&$===h+1&&e[h]===" "))&&(e[~-h]==="}"&&e[$]==="{"||(E.push(h,$,c),u=null))}e[i].trim()&&(ee.includes(e[i])||e[~-i]&&Z.includes(e[~-i]))&&D(P)&&(!C||!n.mindTheInlineTags.includes(C))&&!(e[i]==="<"&&G(e,i,n.mindTheInlineTags,{cb:c=>!c||!/\w/.test(c)}))&&!(e[i]==="<"&&G(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:c=>!c||!/\w/.test(c)}))?(h=i,$=i,y=null):f===null&&h!==null&&(m||!n.mindTheInlineTags||!Array.isArray(n.mindTheInlineTags)||Array.isArray(n.mindTheInlineTags.length)&&!n.mindTheInlineTags.length||!D(C)||Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&D(C)&&!n.mindTheInlineTags.includes(C))&&!(e[i]==="<"&&G(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:c=>!c||!/\w/.test(c)}))&&(h=null,$=null,y=null)}}else if(n.lineLengthLimit)if(ee.includes(e[i])&&!(e[i]==="<"&&G(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:c=>!c||!/\w/.test(c)})))if(h!==null&&$!==null&&(h!==$||y!=null&&y.length)){let c=y!=null&&y.length?y.length:0;s-($-h-c)-1>n.lineLengthLimit||(E.push(h,$,y),s-($-h-c)-1===n.lineLengthLimit&&(E.push(i,i,I),s=0),h=null,$=null,y=null)}else E.push(i,i,I),s=0;else e[i+1]&&Z.includes(e[i])&&D(C)&&Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&!n.mindTheInlineTags.includes(C)?h!==null&&$!==null&&(h!==$||y!=null&&y.length)||(E.push(i+1,i+1,I),s=0):e[i].trim()&&(e[i+1]||h!==null&&$!==null&&(h!==$||y!=null&&y.length)&&E.push(h,$,I))}if(!b&&!k&&n.removeLineBreaks&&n.lineLengthLimit&&s>=n.lineLengthLimit&&h!==null&&$!==null&&!Z.includes(e[i])&&!ee.includes(e[i])&&!"/".includes(e[i])&&!(s===n.lineLengthLimit&&e[i+1]&&!e[i+1].trim())){let c=I;e[i+1]&&!e[i+1].trim()&&s===n.lineLengthLimit&&(c=y),c===I&&!e[~-h].trim()&&de(e,h)&&(h=de(e,h)+1),E.push(h,$,c),s=i-$,e[i].length&&(s+=1),h=null,$=null,y=null}if((!b&&e[i]===`
35
+ `&&e[i-2]==="\r"&&l===i-2)&&E.push(l,i,I),f=null,$=null,y=null,l=null,s=1;continue}let c=" ";e[i]==="<"&&q(e,i,n.mindTheInlineTags,{cb:U=>!U||!/\w/.test(U)})||(e[~-l]&&Gt.includes(e[~-l])&&qt.includes(e[i])||(p||m)&&h===null&&(be.includes(e[~-l])||Te.includes(e[i]))||e.startsWith("!important",i)&&!T||m&&(e[~-l]==="'"||e[~-l]==='"')||e[~-l]==="}"&&e.startsWith("</style",i)||e[i]===">"&&(`'"`.includes(e[de(e,i)])||e[C(e,i)]==="<")||e[i]==="/"&&e[C(e,i)]===">")&&(c="",e[i]==="/"&&e[i+1]===">"&&C(e,i)&&C(e,i)>i+1&&(E.push(i+1,C(e,i)),s-=C(e,i)-i+1)),p&&e[i]==="}"&&l&&e[l-1]==="}"&&(c=" "),c!=null&&c.length&&(s+=1),n.lineLengthLimit?s>=n.lineLengthLimit||!e[i+1]||e[i]===">"||e[i]==="/"&&e[i+1]===">"?((s>n.lineLengthLimit||s===n.lineLengthLimit&&e[i+1]&&e[i+1].trim()&&!Z.includes(e[i])&&!ee.includes(e[i+1]))&&(c=I,s=1),(s>n.lineLengthLimit||!(c===" "&&i===l+1))&&(E.push(l,i,c),u=null),f=null,$=null,y=null):(f===null||l<f)&&(f=l,$=i,y=c):i===l+1&&c===" "||E.push(l,i,c)}l=null,g||(g=!0)}else j&&(j=!1),n.removeLineBreaks&&(s+=1);g||(g=!0)}if(!b&&!j&&i!==0&&n.removeLineBreaks&&(n.lineLengthLimit||a)&&!e.startsWith("</a",i)){if(a&&we(e,i,n.breakToTheLeftOf)&&e.slice(0,i).trim()&&(!e.startsWith("<![endif]",i)||!et(e,i,"<!--"))){E.push(i,i,I),f=null,$=null,y=null,s=1;continue}else if(n.lineLengthLimit&&s<=n.lineLengthLimit){if(!e[i+1]||ee.includes(e[i])&&!Ut.includes(e[i])||Z.includes(e[i])||!e[i].trim()){if(f!==null&&$!==null&&(f!==$||y!=null&&y.length)){let c=y;e[i].trim()&&e[i+1]&&e[i+1].trim()&&s+(y?y.length:0)>n.lineLengthLimit&&(c=I),(s+(c?c.length:0)>n.lineLengthLimit||!(c===" "&&$===f+1&&e[f]===" "))&&(e[~-f]==="}"&&e[$]==="{"||(E.push(f,$,c),u=null))}e[i].trim()&&(ee.includes(e[i])||e[~-i]&&Z.includes(e[~-i]))&&S(x)&&(!A||!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&q(e,i,n.mindTheInlineTags,{cb:c=>!c||!/\w/.test(c)}))&&!(e[i]==="<"&&q(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:c=>!c||!/\w/.test(c)}))?(f=i,$=i,y=null):h===null&&f!==null&&(m||!n.mindTheInlineTags||!Array.isArray(n.mindTheInlineTags)||Array.isArray(n.mindTheInlineTags.length)&&!n.mindTheInlineTags.length||!S(A)||Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&S(A)&&!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&q(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:c=>!c||!/\w/.test(c)}))&&(f=null,$=null,y=null)}}else if(n.lineLengthLimit)if(ee.includes(e[i])&&!(e[i]==="<"&&q(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:c=>!c||!/\w/.test(c)})))if(f!==null&&$!==null&&(f!==$||y!=null&&y.length)){let c=y!=null&&y.length?y.length:0;s-($-f-c)-1>n.lineLengthLimit||(E.push(f,$,y),s-($-f-c)-1===n.lineLengthLimit&&(E.push(i,i,I),s=0),f=null,$=null,y=null)}else E.push(i,i,I),s=0;else e[i+1]&&Z.includes(e[i])&&S(A)&&Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&!n.mindTheInlineTags.includes(A)?f!==null&&$!==null&&(f!==$||y!=null&&y.length)||(E.push(i+1,i+1,I),s=0):e[i].trim()&&(e[i+1]||f!==null&&$!==null&&(f!==$||y!=null&&y.length)&&E.push(f,$,I))}if(!b&&!j&&n.removeLineBreaks&&n.lineLengthLimit&&s>=n.lineLengthLimit&&f!==null&&$!==null&&!Z.includes(e[i])&&!ee.includes(e[i])&&!"/".includes(e[i])&&!(s===n.lineLengthLimit&&e[i+1]&&!e[i+1].trim())){let c=I;e[i+1]&&!e[i+1].trim()&&s===n.lineLengthLimit&&(c=y),c===I&&!e[~-f].trim()&&de(e,f)&&(f=de(e,f)+1),E.push(f,$,c),s=i-$,e[i].length&&(s+=1),f=null,$=null,y=null}if((!b&&e[i]===`
36
36
  `||e[i]==="\r"&&(!e[i+1]||e[i+1]&&e[i+1]!==`
37
37
  `))&&(u=i,g&&(g=!1),!n.removeLineBreaks&&l!==null&&l<i&&e[i+1]&&e[i+1]!=="\r"&&e[i+1]!==`
38
- `&&E.push(l,i)),e[i+1]||(p&&f!==null?E.push(...ae({str:e,from:f,to:i,ifLeftSideIncludesThisThenCropTightly:be||"",ifRightSideIncludesThisThenCropTightly:Te||""})):l&&e[i]!==`
38
+ `&&E.push(l,i)),e[i+1]||(p&&h!==null?E.push(...ae({str:e,from:h,to:i,ifLeftSideIncludesThisThenCropTightly:be||"",ifRightSideIncludesThisThenCropTightly:Te||""})):l&&e[i]!==`
39
39
  `&&e[i]!=="\r"?E.push(l,i+1):l&&(e[i]==="\r"&&e[i+1]===`
40
40
  `||e[i]===`
41
- `&&e[i-1]!=="\r")&&E.push(l,i)),!b&&m&&m<i&&e[m]===e[i]&&(m=null),!b&&!p&&e.startsWith("<pre",i)&&!H(e[i+4])){let c=e.indexOf("</pre",i+5);c>0&&(b=c)}if(!b&&!p&&e.startsWith("<code",i)&&!H(e[i+5])){let c=e.indexOf("</code",i+5);c>0&&(b=c)}if(!b&&e.startsWith("<![CDATA[",i)){let c=e.indexOf("]]>",i+9);c>0&&(b=c)}!b&&!p&&!m&&v!==null&&e[i]===">"&&(e[A(e,i)]==="<"&&(P=C),v=null,C=null),e[i]==="<"&&P!==null&&(P=null),p&&e[i]==="{"&&e[i+1]==="{"&&e.indexOf("}}")!==-1&&(b=e.indexOf("}}")+2);let te=!0}if(E.current()){let i=E.current();E.wipe();let te=n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*Be,c=Ye(e,i,zt=>{n.reportProgressFunc&&N>=2e3&&(x=Math.floor(te+(n.reportProgressFuncTo-te)*(zt/100)),x!==se&&(se=x,n.reportProgressFunc(x)))}),U=c.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:N,cleanedLength:U,bytesSaved:Math.max(N-U,0),percentageReducedOfOriginal:N?Math.round(Math.max(N-U,0)*100/N):0},ranges:i,applicableOpts:o,result:c}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:N,cleanedLength:N,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:o,ranges:null,result:e}}return an(Xr);})();
41
+ `&&e[i-1]!=="\r")&&E.push(l,i)),!b&&m&&m<i&&e[m]===e[i]&&(m=null),!b&&!p&&e.startsWith("<pre",i)&&!W(e[i+4])){let c=e.indexOf("</pre",i+5);c>0&&(b=c)}if(!b&&!p&&e.startsWith("<code",i)&&!W(e[i+5])){let c=e.indexOf("</code",i+5);c>0&&(b=c)}if(!b&&e.startsWith("<![CDATA[",i)){let c=e.indexOf("]]>",i+9);c>0&&(b=c)}!b&&!p&&!m&&v!==null&&e[i]===">"&&(e[C(e,i)]==="<"&&(x=A),v=null,A=null),e[i]==="<"&&x!==null&&(x=null),p&&e[i]==="{"&&e[i+1]==="{"&&e.indexOf("}}")!==-1&&(b=e.indexOf("}}")+2);let te=!0}if(E.current()){let i=E.current();E.wipe();let te=n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*We,c=Ke(e,i,Yt=>{n.reportProgressFunc&&N>=2e3&&(F=Math.floor(te+(n.reportProgressFuncTo-te)*(Yt/100)),F!==se&&(se=F,n.reportProgressFunc(F)))}),U=c.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:N,cleanedLength:U,bytesSaved:Math.max(N-U,0),percentageReducedOfOriginal:N?Math.round(Math.max(N-U,0)*100/N):0},ranges:i,applicableOpts:o,result:c}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:N,cleanedLength:N,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:o,ranges:null,result:e}}return on(Gr);})();
42
42
  /**
43
43
  * @name ranges-sort
44
44
  * @fileoverview Sort string index ranges
45
- * @version 6.0.6
45
+ * @version 6.0.7
46
46
  * @author Roy Revelt, Codsen Ltd
47
47
  * @license MIT
48
48
  * {@link https://codsen.com/os/ranges-sort/}
@@ -50,7 +50,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
50
50
  /**
51
51
  * @name ranges-merge
52
52
  * @fileoverview Merge and sort string index ranges
53
- * @version 9.0.6
53
+ * @version 9.0.7
54
54
  * @author Roy Revelt, Codsen Ltd
55
55
  * @license MIT
56
56
  * {@link https://codsen.com/os/ranges-merge/}
@@ -58,7 +58,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
58
58
  /**
59
59
  * @name ranges-apply
60
60
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
61
- * @version 7.0.6
61
+ * @version 7.0.7
62
62
  * @author Roy Revelt, Codsen Ltd
63
63
  * @license MIT
64
64
  * {@link https://codsen.com/os/ranges-apply/}
@@ -66,7 +66,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
66
66
  /**
67
67
  * @name string-collapse-leading-whitespace
68
68
  * @fileoverview Collapse the leading and trailing whitespace of a string
69
- * @version 7.0.4
69
+ * @version 7.0.5
70
70
  * @author Roy Revelt, Codsen Ltd
71
71
  * @license MIT
72
72
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
@@ -74,7 +74,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
74
74
  /**
75
75
  * @name codsen-utils
76
76
  * @fileoverview Various utility functions
77
- * @version 1.3.0
77
+ * @version 1.3.1
78
78
  * @author Roy Revelt, Codsen Ltd
79
79
  * @license MIT
80
80
  * {@link https://codsen.com/os/codsen-utils/}
@@ -82,7 +82,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
82
82
  /**
83
83
  * @name ranges-push
84
84
  * @fileoverview Gather string index ranges
85
- * @version 7.0.6
85
+ * @version 7.0.7
86
86
  * @author Roy Revelt, Codsen Ltd
87
87
  * @license MIT
88
88
  * {@link https://codsen.com/os/ranges-push/}
@@ -90,7 +90,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
90
90
  /**
91
91
  * @name arrayiffy-if-string
92
92
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
93
- * @version 5.0.4
93
+ * @version 5.0.5
94
94
  * @author Roy Revelt, Codsen Ltd
95
95
  * @license MIT
96
96
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -98,7 +98,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
98
98
  /**
99
99
  * @name string-match-left-right
100
100
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
101
- * @version 9.0.9
101
+ * @version 9.0.10
102
102
  * @author Roy Revelt, Codsen Ltd
103
103
  * @license MIT
104
104
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -106,7 +106,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
106
106
  /**
107
107
  * @name string-range-expander
108
108
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
109
- * @version 4.0.6
109
+ * @version 4.0.7
110
110
  * @author Roy Revelt, Codsen Ltd
111
111
  * @license MIT
112
112
  * {@link https://codsen.com/os/string-range-expander/}
@@ -114,7 +114,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},qt),t);typeof n.r
114
114
  /**
115
115
  * @name string-left-right
116
116
  * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
117
- * @version 6.0.9
117
+ * @version 6.0.10
118
118
  * @author Roy Revelt, Codsen Ltd
119
119
  * @license MIT
120
120
  * {@link https://codsen.com/os/string-left-right/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-crush",
3
- "version": "6.0.9",
3
+ "version": "6.0.10",
4
4
  "description": "Minify email templates",
5
5
  "keywords": [
6
6
  "breaks",
@@ -80,11 +80,12 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
- "ranges-apply": "^7.0.6",
84
- "ranges-push": "^7.0.6",
85
- "string-left-right": "^6.0.9",
86
- "string-match-left-right": "^9.0.9",
87
- "string-range-expander": "^4.0.6",
88
- "test-mixer": "^4.1.6"
83
+ "codsen-utils": "^1.3.1",
84
+ "ranges-apply": "^7.0.7",
85
+ "ranges-push": "^7.0.7",
86
+ "string-left-right": "^6.0.10",
87
+ "string-match-left-right": "^9.0.10",
88
+ "string-range-expander": "^4.0.7",
89
+ "test-mixer": "^4.1.7"
89
90
  }
90
91
  }