@appsurify-testmap/rrdom-nodejs 2.1.1-alpha.5 → 2.1.1-alpha.7

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.
@@ -33,7 +33,8 @@ var module = { exports };
33
33
  `;this.css.includes(`\r
34
34
  `)&&(t=`\r
35
35
  `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||te(e.file),s;this.mapOpts.sourcesContent===!1?(s=new Et(e.text),s.sourcesContent&&(s.sourcesContent=null)):s=e.consumer(),this.map.applySourceMap(s,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),os&&ns&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ee.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ee({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new ee({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,n;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(s.generated.line=e,s.generated.column=t-1,l.source&&l.source.start?(s.source=this.sourcePath(l),s.original.line=l.source.start.line,s.original.column=l.source.start.column-1,this.map.addMapping(s)):(s.source=r,s.original.line=1,s.original.column=0,this.map.addMapping(s))),o=a.match(/\n/g),o?(e+=o.length,n=a.lastIndexOf(`
36
- `),t=a.length-n):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(s.source=this.sourcePath(l),s.original.line=l.source.end.line,s.original.column=l.source.end.column-1,s.generated.line=e,s.generated.column=t-2,this.map.addMapping(s)):(s.source=r,s.original.line=1,s.original.column=0,s.generated.line=e,s.generated.column=t-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?te(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=te(vt(r,this.mapOpts.annotation)));let s=St(r,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new is(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ut){let r=ut(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Ot==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var At=ls;let as=le,Ne=class extends as{constructor(e){super(e),this.type="comment"}};var he=Ne;Ne.default=Ne;let{isClean:Nt,my:Dt}=F,Pt=ae,Tt=he,us=le,$t,ke,Be,_t;function Mt(i){return i.map(e=>(e.nodes&&(e.nodes=Mt(e.nodes)),delete e.source,e))}function It(i){if(i[Nt]=!1,i.proxyOf.nodes)for(let e of i.proxyOf.nodes)It(e)}let O=class Lt extends us{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let s of r)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,s;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],s=e(this.proxyOf.nodes[r],r),s!==!1);)this.indexes[t]+=1;return delete this.indexes[t],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(s=>typeof s=="function"?(o,n)=>s(o.toProxy(),n):s)):t==="every"||t==="some"?r=>e[t]((s,...o)=>r(s.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),s=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let n of s)this.proxyOf.nodes.splice(r+1,0,n);let o;for(let n in this.indexes)o=this.indexes[n],r<o&&(this.indexes[n]=o+s.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),s=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],s).reverse();r=this.index(e);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let n;for(let a in this.indexes)n=this.indexes[a],r<=n&&(this.indexes[a]=n+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Mt($t(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Pt(e)]}else if(e.selector)e=[new ke(e)];else if(e.name)e=[new Be(e)];else if(e.text)e=[new Tt(e)];else throw new Error("Unknown node type in node creation");return e.map(s=>(s[Dt]||Lt.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[Nt]&&It(s),typeof s.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(s.raws.before=t.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let s of r)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(o){throw t.addToError(o)}return s!==!1&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if(r.type==="atrule"&&r.name===e)return t(r,s)}):(t=e,this.walk((r,s)=>{if(r.type==="atrule")return t(r,s)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if(r.type==="decl"&&r.prop===e)return t(r,s)}):(t=e,this.walk((r,s)=>{if(r.type==="decl")return t(r,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if(r.type==="rule"&&r.selector===e)return t(r,s)}):(t=e,this.walk((r,s)=>{if(r.type==="rule")return t(r,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};O.registerParse=i=>{$t=i};O.registerRule=i=>{ke=i};O.registerAtRule=i=>{Be=i};O.registerRoot=i=>{_t=i};var N=O;O.default=O;O.rebuild=i=>{i.type==="atrule"?Object.setPrototypeOf(i,Be.prototype):i.type==="rule"?Object.setPrototypeOf(i,ke.prototype):i.type==="decl"?Object.setPrototypeOf(i,Pt.prototype):i.type==="comment"?Object.setPrototypeOf(i,Tt.prototype):i.type==="root"&&Object.setPrototypeOf(i,_t.prototype),i[Dt]=!0,i.nodes&&i.nodes.forEach(e=>{O.rebuild(e)})};let hs=N,kt,Bt,L=class extends hs{constructor(e){super(v({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new kt(new Bt,this,e).stringify()}};L.registerLazyResult=i=>{kt=i};L.registerProcessor=i=>{Bt=i};var Ue=L;L.default=L;let De=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Ut=De;De.default=De;let cs=Ut,Pe=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new cs(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Fe=Pe;Pe.default=Pe;const we=39,ht=34,q=92,ct=47,J=10,M=32,Y=12,Q=9,X=13,fs=91,ps=93,ms=40,ds=41,gs=123,ys=125,ws=59,bs=42,Rs=58,xs=64,Z=/[\t\n\f\r "#'()/;[\\\]{}]/g,K=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Cs=/.[\r\n"'(/\\]/,ft=/[\da-f]/i;var Es=function(e,t={}){let r=e.css.valueOf(),s=t.ignoreErrors,o,n,a,l,u,c,m,d,R,x,Ye=r.length,f=0,ce=[],W=[];function wr(){return f}function fe(D){throw e.error("Unclosed "+D,f)}function br(){return W.length===0&&f>=Ye}function Rr(D){if(W.length)return W.pop();if(f>=Ye)return;let pe=D?D.ignoreUnclosed:!1;switch(o=r.charCodeAt(f),o){case J:case M:case Q:case X:case Y:{n=f;do n+=1,o=r.charCodeAt(n);while(o===M||o===J||o===Q||o===X||o===Y);x=["space",r.slice(f,n)],f=n-1;break}case fs:case ps:case gs:case ys:case Rs:case ws:case ds:{let Qe=String.fromCharCode(o);x=[Qe,Qe,f];break}case ms:{if(d=ce.length?ce.pop()[1]:"",R=r.charCodeAt(f+1),d==="url"&&R!==we&&R!==ht&&R!==M&&R!==J&&R!==Q&&R!==Y&&R!==X){n=f;do{if(c=!1,n=r.indexOf(")",n+1),n===-1)if(s||pe){n=f;break}else fe("bracket");for(m=n;r.charCodeAt(m-1)===q;)m-=1,c=!c}while(c);x=["brackets",r.slice(f,n+1),f,n],f=n}else n=r.indexOf(")",f+1),l=r.slice(f,n+1),n===-1||Cs.test(l)?x=["(","(",f]:(x=["brackets",l,f,n],f=n);break}case we:case ht:{a=o===we?"'":'"',n=f;do{if(c=!1,n=r.indexOf(a,n+1),n===-1)if(s||pe){n=f+1;break}else fe("string");for(m=n;r.charCodeAt(m-1)===q;)m-=1,c=!c}while(c);x=["string",r.slice(f,n+1),f,n],f=n;break}case xs:{Z.lastIndex=f+1,Z.test(r),Z.lastIndex===0?n=r.length-1:n=Z.lastIndex-2,x=["at-word",r.slice(f,n+1),f,n],f=n;break}case q:{for(n=f,u=!0;r.charCodeAt(n+1)===q;)n+=1,u=!u;if(o=r.charCodeAt(n+1),u&&o!==ct&&o!==M&&o!==J&&o!==Q&&o!==X&&o!==Y&&(n+=1,ft.test(r.charAt(n)))){for(;ft.test(r.charAt(n+1));)n+=1;r.charCodeAt(n+1)===M&&(n+=1)}x=["word",r.slice(f,n+1),f,n],f=n;break}default:{o===ct&&r.charCodeAt(f+1)===bs?(n=r.indexOf("*/",f+2)+1,n===0&&(s||pe?n=r.length:fe("comment")),x=["comment",r.slice(f,n+1),f,n],f=n):(K.lastIndex=f+1,K.test(r),K.lastIndex===0?n=r.length-1:n=K.lastIndex-2,x=["word",r.slice(f,n+1),f,n],ce.push(x),f=n);break}}return f++,x}function xr(D){W.push(D)}return{back:xr,endOfFile:br,nextToken:Rr,position:wr}};let Ft=N,se=class extends Ft{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ze=se;se.default=se;Ft.registerAtRule(se);let zt=N,jt,Wt,P=class extends zt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of s)o.raws.before=t.raws.before}return s}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new jt(new Wt,this,e).stringify()}};P.registerLazyResult=i=>{jt=i};P.registerProcessor=i=>{Wt=i};var z=P;P.default=P;zt.registerRoot(P);let k={comma(i){return k.split(i,[","],!0)},space(i){let e=[" ",`
36
+ `),t=a.length-n):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(s.source=this.sourcePath(l),s.original.line=l.source.end.line,s.original.column=l.source.end.column-1,s.generated.line=e,s.generated.column=t-2,this.map.addMapping(s)):(s.source=r,s.original.line=1,s.original.column=0,s.generated.line=e,s.generated.column=t-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?te(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=te(vt(r,this.mapOpts.annotation)));let s=St(r,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new is(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ut){let r=ut(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Ot==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var At=ls;let as=le,Ne=class extends as{constructor(e){super(e),this.type="comment"}};var he=Ne;Ne.default=Ne;let{isClean:Nt,my:Dt}=F,Pt=ae,Tt=he,us=le,$t,ke,Be,_t;function Mt(i){return i.map(e=>(e.nodes&&(e.nodes=Mt(e.nodes)),delete e.source,e))}function It(i){if(i[Nt]=!1,i.proxyOf.nodes)for(let e of i.proxyOf.nodes)It(e)}let O=class Lt extends us{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let s of r)this.proxyOf.nodes.push(s)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,s;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],s=e(this.proxyOf.nodes[r],r),s!==!1);)this.indexes[t]+=1;return delete this.indexes[t],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(s=>typeof s=="function"?(o,n)=>s(o.toProxy(),n):s)):t==="every"||t==="some"?r=>e[t]((s,...o)=>r(s.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),s=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let n of s)this.proxyOf.nodes.splice(r+1,0,n);let o;for(let n in this.indexes)o=this.indexes[n],r<o&&(this.indexes[n]=o+s.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),s=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],s).reverse();r=this.index(e);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let n;for(let a in this.indexes)n=this.indexes[a],r<=n&&(this.indexes[a]=n+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Mt($t(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Pt(e)]}else if(e.selector)e=[new ke(e)];else if(e.name)e=[new Be(e)];else if(e.text)e=[new Tt(e)];else throw new Error("Unknown node type in node creation");return e.map(s=>(s[Dt]||Lt.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[Nt]&&It(s),typeof s.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(s.raws.before=t.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let s of r)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(o){throw t.addToError(o)}return s!==!1&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if(r.type==="atrule"&&r.name===e)return t(r,s)}):(t=e,this.walk((r,s)=>{if(r.type==="atrule")return t(r,s)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if(r.type==="decl"&&r.prop===e)return t(r,s)}):(t=e,this.walk((r,s)=>{if(r.type==="decl")return t(r,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if(r.type==="rule"&&r.selector===e)return t(r,s)}):(t=e,this.walk((r,s)=>{if(r.type==="rule")return t(r,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};O.registerParse=i=>{$t=i};O.registerRule=i=>{ke=i};O.registerAtRule=i=>{Be=i};O.registerRoot=i=>{_t=i};var N=O;O.default=O;O.rebuild=i=>{i.type==="atrule"?Object.setPrototypeOf(i,Be.prototype):i.type==="rule"?Object.setPrototypeOf(i,ke.prototype):i.type==="decl"?Object.setPrototypeOf(i,Pt.prototype):i.type==="comment"?Object.setPrototypeOf(i,Tt.prototype):i.type==="root"&&Object.setPrototypeOf(i,_t.prototype),i[Dt]=!0,i.nodes&&i.nodes.forEach(e=>{O.rebuild(e)})};let hs=N,kt,Bt,L=class extends hs{constructor(e){super(v({type:"document"},e)),this.nodes||(this.nodes=[])}toResult(e={}){return new kt(new Bt,this,e).stringify()}};L.registerLazyResult=i=>{kt=i};L.registerProcessor=i=>{Bt=i};var Ue=L;L.default=L;let De=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Ut=De;De.default=De;let cs=Ut,Pe=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new cs(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var Fe=Pe;Pe.default=Pe;const we="'".charCodeAt(0),ht='"'.charCodeAt(0),q="\\".charCodeAt(0),ct="/".charCodeAt(0),J=`
37
+ `.charCodeAt(0),M=" ".charCodeAt(0),Y="\f".charCodeAt(0),Q=" ".charCodeAt(0),X="\r".charCodeAt(0),fs="[".charCodeAt(0),ps="]".charCodeAt(0),ms="(".charCodeAt(0),ds=")".charCodeAt(0),gs="{".charCodeAt(0),ys="}".charCodeAt(0),ws=";".charCodeAt(0),bs="*".charCodeAt(0),Rs=":".charCodeAt(0),xs="@".charCodeAt(0),Z=/[\t\n\f\r "#'()/;[\\\]{}]/g,K=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Cs=/.[\r\n"'(/\\]/,ft=/[\da-f]/i;var Es=function(e,t={}){let r=e.css.valueOf(),s=t.ignoreErrors,o,n,a,l,u,c,m,d,R,x,Ye=r.length,f=0,ce=[],W=[];function wr(){return f}function fe(D){throw e.error("Unclosed "+D,f)}function br(){return W.length===0&&f>=Ye}function Rr(D){if(W.length)return W.pop();if(f>=Ye)return;let pe=D?D.ignoreUnclosed:!1;switch(o=r.charCodeAt(f),o){case J:case M:case Q:case X:case Y:{n=f;do n+=1,o=r.charCodeAt(n);while(o===M||o===J||o===Q||o===X||o===Y);x=["space",r.slice(f,n)],f=n-1;break}case fs:case ps:case gs:case ys:case Rs:case ws:case ds:{let Qe=String.fromCharCode(o);x=[Qe,Qe,f];break}case ms:{if(d=ce.length?ce.pop()[1]:"",R=r.charCodeAt(f+1),d==="url"&&R!==we&&R!==ht&&R!==M&&R!==J&&R!==Q&&R!==Y&&R!==X){n=f;do{if(c=!1,n=r.indexOf(")",n+1),n===-1)if(s||pe){n=f;break}else fe("bracket");for(m=n;r.charCodeAt(m-1)===q;)m-=1,c=!c}while(c);x=["brackets",r.slice(f,n+1),f,n],f=n}else n=r.indexOf(")",f+1),l=r.slice(f,n+1),n===-1||Cs.test(l)?x=["(","(",f]:(x=["brackets",l,f,n],f=n);break}case we:case ht:{a=o===we?"'":'"',n=f;do{if(c=!1,n=r.indexOf(a,n+1),n===-1)if(s||pe){n=f+1;break}else fe("string");for(m=n;r.charCodeAt(m-1)===q;)m-=1,c=!c}while(c);x=["string",r.slice(f,n+1),f,n],f=n;break}case xs:{Z.lastIndex=f+1,Z.test(r),Z.lastIndex===0?n=r.length-1:n=Z.lastIndex-2,x=["at-word",r.slice(f,n+1),f,n],f=n;break}case q:{for(n=f,u=!0;r.charCodeAt(n+1)===q;)n+=1,u=!u;if(o=r.charCodeAt(n+1),u&&o!==ct&&o!==M&&o!==J&&o!==Q&&o!==X&&o!==Y&&(n+=1,ft.test(r.charAt(n)))){for(;ft.test(r.charAt(n+1));)n+=1;r.charCodeAt(n+1)===M&&(n+=1)}x=["word",r.slice(f,n+1),f,n],f=n;break}default:{o===ct&&r.charCodeAt(f+1)===bs?(n=r.indexOf("*/",f+2)+1,n===0&&(s||pe?n=r.length:fe("comment")),x=["comment",r.slice(f,n+1),f,n],f=n):(K.lastIndex=f+1,K.test(r),K.lastIndex===0?n=r.length-1:n=K.lastIndex-2,x=["word",r.slice(f,n+1),f,n],ce.push(x),f=n);break}}return f++,x}function xr(D){W.push(D)}return{back:xr,endOfFile:br,nextToken:Rr,position:wr}};let Ft=N,se=class extends Ft{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ze=se;se.default=se;Ft.registerAtRule(se);let zt=N,jt,Wt,P=class extends zt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of s)o.raws.before=t.raws.before}return s}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new jt(new Wt,this,e).stringify()}};P.registerLazyResult=i=>{jt=i};P.registerProcessor=i=>{Wt=i};var z=P;P.default=P;zt.registerRoot(P);let k={comma(i){return k.split(i,[","],!0)},space(i){let e=[" ",`
37
38
  `," "];return k.split(i,e)},split(i,e,t){let r=[],s="",o=!1,n=0,a=!1,l="",u=!1;for(let c of i)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?n+=1:c===")"?n>0&&(n-=1):n===0&&e.includes(c)&&(o=!0),o?(s!==""&&r.push(s.trim()),s="",o=!1):s+=c;return(t||s!=="")&&r.push(s.trim()),r}};var Vt=k;k.default=k;let Ht=N,Ss=Vt,ie=class extends Ht{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ss.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var je=ie;ie.default=ie;Ht.registerRule(ie);let vs=ae,Os=Es,As=he,Ns=ze,Ds=z,pt=je;const mt={empty:!0,space:!0};function Ps(i){for(let e=i.length-1;e>=0;e--){let t=i[e],r=t[3]||t[2];if(r)return r}}let Ts=class{constructor(e){this.input=e,this.root=new Ds,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Ns;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,s,o,n=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(o=l.length-1,s=l[o];s&&s[0]==="space";)s=l[--o];s&&(t.source.end=this.getPosition(s[3]||s[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),n&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,s;for(let o=t-1;o>=0&&(s=e[o],!(s[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(e){let t=0,r,s,o;for(let[n,a]of e.entries()){if(r=a,s=r[0],s==="("&&(t+=1),s===")"&&(t-=1),t===0&&s===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return n}o=r}return!1}comment(e){let t=new As;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let s=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=s[2],t.raws.left=s[1],t.raws.right=s[3]}}createTokenizer(){this.tokenizer=Os(this.input)}decl(e,t){let r=new vs;this.init(r,e[0][2]);let s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||Ps(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let n=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)n.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),m="";for(let d=u;d>0;d--){let R=c[d][0];if(m.trim().indexOf("!")===0&&R!=="space")break;m=c.pop()[1]+m}m.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=m,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=n.map(u=>u[1]).join(""),n=[]),this.raw(r,"value",n.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new pt;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,s=!1,o=null,n=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")o||(o=u),n.push(r==="("?")":"]");else if(a&&s&&r==="{")o||(o=u),n.push("}");else if(n.length===0)if(r===";")if(s){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),t=!0;break}else r===":"&&(s=!0);else r===n[n.length-1]&&(n.pop(),n.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),n.length>0&&this.unclosedBracket(o),t&&s){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let o,n,a=r.length,l="",u=!0,c,m;for(let d=0;d<a;d+=1)o=r[d],n=o[0],n==="space"&&d===a-1&&!s?u=!1:n==="comment"?(m=r[d-1]?r[d-1][0]:"empty",c=r[d+1]?r[d+1][0]:"empty",!mt[m]&&!mt[c]?l.slice(-1)===","?u=!1:l+=o[1]:u=!1):l+=o[1];if(!u){let d=r.reduce((R,x)=>R+x[1],"");e.raws[t]={raw:d,value:l}}e[t]=l}rule(e){e.pop();let t=new pt;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var $s=Ts;let _s=N,Ms=$s,Is=ue;function ne(i,e){let t=new Is(i,e),r=new Ms(t);try{r.parse()}catch(s){throw s}return r.root}var We=ne;ne.default=ne;_s.registerParse(ne);let{isClean:S,my:Ls}=F,ks=At,Bs=oe,Us=N,Fs=Ue;let dt=Fe,zs=We,js=z;const Ws={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Vs={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Hs={Once:!0,postcssPlugin:!0,prepare:!0},T=0;function I(i){return typeof i=="object"&&typeof i.then=="function"}function Gt(i){let e=!1,t=Ws[i.type];return i.type==="decl"?e=i.prop.toLowerCase():i.type==="atrule"&&(e=i.name.toLowerCase()),e&&i.append?[t,t+"-"+e,T,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:i.append?[t,T,t+"Exit"]:[t,t+"Exit"]}function gt(i){let e;return i.type==="document"?e=["Document",T,"DocumentExit"]:i.type==="root"?e=["Root",T,"RootExit"]:e=Gt(i),{eventIndex:0,events:e,iterator:0,node:i,visitorIndex:0,visitors:[]}}function Te(i){return i[S]=!1,i.nodes&&i.nodes.forEach(e=>Te(e)),i}let $e={},$=class qt{constructor(e,t,r){this.stringified=!1,this.processed=!1;let s;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))s=Te(t);else if(t instanceof qt||t instanceof dt)s=Te(t.root),t.map&&(typeof r.map=="undefined"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=zs;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{s=o(t,r)}catch(n){this.processed=!0,this.error=n}s&&!s[Ls]&&Us.rebuild(s)}this.result=new dt(e,s,r),this.helpers=_(v({},$e),{postcss:$e,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?v(v({},o),o.prepare(this.result)):o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(s){console&&console.error&&console.error(s)}return e}prepareVisitors(){this.listeners={};let e=(t,r,s)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,s])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Vs[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Hs[r])if(typeof t[r]=="object")for(let s in t[r])s==="*"?e(t,r,t[r][s]):e(t,r+"-"+s.toLowerCase(),t[r][s]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(I(r))try{await r}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[S];){e[S]=!0;let t=[gt(e)];for(;t.length>0;){let r=this.visitTick(t);if(I(r))try{await r}catch(s){let o=t[t.length-1].node;throw this.handleError(s,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let s=e.nodes.map(o=>r(o,this.helpers));await Promise.all(s)}else await r(e,this.helpers)}catch(s){throw this.handleError(s)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return I(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Bs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new ks(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(I(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[S];)e[S]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){this.result.lastPlugin=r;let o;try{o=s(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(I(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(s.length>0&&t.visitorIndex<s.length){let[n,a]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=n;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(t.iterator!==0){let n=t.iterator,a;for(;a=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!a[S]){a[S]=!0,e.push(gt(a));return}t.iterator=0,delete r.indexes[n]}let o=t.events;for(;t.eventIndex<o.length;){let n=o[t.eventIndex];if(t.eventIndex+=1,n===T){r.nodes&&r.nodes.length&&(r[S]=!0,t.iterator=r.getIterator());return}else if(this.listeners[n]){t.visitors=this.listeners[n];return}}e.pop()}walkSync(e){e[S]=!0;let t=Gt(e);for(let r of t)if(r===T)e.nodes&&e.each(s=>{s[S]||this.walkSync(s)});else{let s=this.listeners[r];if(s&&this.visitSync(s,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};$.registerPostcss=i=>{$e=i};var Jt=$;$.default=$;js.registerLazyResult($);Fs.registerLazyResult($);let Gs=At,qs=oe;let Js=We;const Ys=Fe;let _e=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s,o=qs;this.result=new Ys(this._processor,s,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let a=new Gs(o,s,this._opts,t);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Js;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Qs=_e;_e.default=_e;let Xs=Qs,Zs=Jt,Ks=Ue,ei=z,B=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Xs(this,e,t):new Zs(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ti=B;B.default=B;ei.registerProcessor(B);Ks.registerProcessor(B);let ri=ae,si=Ct,ii=he,ni=ze,oi=ue,li=z,ai=je;function U(i,e){if(Array.isArray(i))return i.map(n=>U(n));let s=i,{inputs:t}=s,r=me(s,["inputs"]);if(t){e=[];for(let n of t){let a=_(v({},n),{__proto__:oi.prototype});a.map&&(a.map=_(v({},a.map),{__proto__:si.prototype})),e.push(a)}}if(r.nodes&&(r.nodes=i.nodes.map(n=>U(n,e))),r.source){let o=r.source,{inputId:n}=o,a=me(o,["inputId"]);r.source=a,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new li(r);if(r.type==="decl")return new ri(r);if(r.type==="rule")return new ai(r);if(r.type==="comment")return new ii(r);if(r.type==="atrule")return new ni(r);throw new Error("Unknown node type: "+i.type)}var ui=U;U.default=U;let hi=Le,Yt=ae,ci=Jt,fi=N,Ve=ti,pi=oe,mi=ui,Qt=Ue,di=Ut,Xt=he,Zt=ze,gi=Fe,yi=ue,wi=We,bi=Vt,Kt=je,er=z,Ri=le;function p(...i){return i.length===1&&Array.isArray(i[0])&&(i=i[0]),new Ve(i)}p.plugin=function(e,t){let r=!1;function s(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
38
39
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
39
40
  https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new Ve().version,a}let o;return Object.defineProperty(s,"postcss",{get(){return o||(o=s()),o}}),s.process=function(n,a,l){return p([s(l)]).process(n,a)},s};p.stringify=pi;p.parse=wi;p.fromJSON=mi;p.list=bi;p.comment=i=>new Xt(i);p.atRule=i=>new Zt(i);p.decl=i=>new Yt(i);p.rule=i=>new Kt(i);p.root=i=>new er(i);p.document=i=>new Qt(i);p.CssSyntaxError=hi;p.Declaration=Yt;p.Container=fi;p.Processor=Ve;p.Document=Qt;p.Comment=Xt;p.Warning=di;p.AtRule=Zt;p.Result=gi;p.Input=yi;p.Rule=Kt;p.Root=er;p.Node=Ri;ci.registerPostcss(p);var xi=p;p.default=p;const y=_r(xi);y.stringify;y.fromJSON;y.plugin;y.parse;y.list;y.document;y.comment;y.atRule;y.rule;y.decl;y.root;y.CssSyntaxError;y.Declaration;y.Container;y.Processor;y.Document;y.Comment;y.Warning;y.AtRule;y.Result;y.Input;y.Rule;y.Root;y.Node;var b=(i=>(i[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i))(b||{});function Ci(i){const e={},t=/;(?![^(]*\))/g,r=/:(.+)/,s=/\/\*.*?\*\//g;return i.replace(s,"").split(t).forEach(function(o){if(o){const n=o.split(r);n.length>1&&(e[Me(n[0].trim())]=n[1].trim())}}),e}function yt(i){const e=[];for(const t in i){const r=i[t];if(typeof r!="string")continue;const s=Oi(t);e.push(`${s}: ${r};`)}return e.join(" ")}const Ei=/-([a-z])/g,Si=/^--[a-zA-Z0-9-]+$/,Me=i=>Si.test(i)?i:i.replace(Ei,(e,t)=>t?t.toUpperCase():""),vi=/\B([A-Z])/g,Oi=i=>i.replace(vi,"-$1").toLowerCase();class A{constructor(...e){h(this,"parentElement",null),h(this,"parentNode",null),h(this,"ownerDocument"),h(this,"firstChild",null),h(this,"lastChild",null),h(this,"previousSibling",null),h(this,"nextSibling",null),h(this,"ELEMENT_NODE",1),h(this,"TEXT_NODE",3),h(this,"nodeType"),h(this,"nodeName"),h(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof A){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class He extends A{constructor(...e){super(e),h(this,"nodeType",9),h(this,"nodeName","#document"),h(this,"compatMode","CSS1Compat"),h(this,"RRNodeType",b.Document),h(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===b.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===b.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===b.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===b.Element||t===b.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===b.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=qe(this,e);return r.parentElement=null,r}insertBefore(e,t){const r=e.RRNodeType;if((r===b.Element||r===b.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===b.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=or(this,e,t);return s.parentElement=null,s}removeChild(e){return lr(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new He}createDocumentType(e,t,r){const s=new tr(e,t,r);return s.ownerDocument=this,s}createElement(e){const t=new Ge(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new rr(e);return t.ownerDocument=this,t}createComment(e){const t=new sr(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new ir(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class tr extends A{constructor(e,t,r){super(),h(this,"nodeType",10),h(this,"RRNodeType",b.DocumentType),h(this,"name"),h(this,"publicId"),h(this,"systemId"),h(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class Ge extends A{constructor(e){super(),h(this,"nodeType",1),h(this,"RRNodeType",b.Element),h(this,"tagName"),h(this,"attributes",{}),h(this,"shadowRoot",null),h(this,"scrollLeft"),h(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new nr(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Ci(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,s,o)=>{if(t.test(r))return;const n=Me(r);s?e[n]=s:delete e[n],o==="important"&&(e[n]+=" !important"),this.attributes.style=yt(e)},e.removeProperty=r=>{if(t.test(r))return"";const s=Me(r),o=e[s]||"";return delete e[s],this.attributes.style=yt(e),o},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return qe(this,e)}insertBefore(e,t){return or(this,e,t)}removeChild(e){return lr(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}class Ai extends Ge{constructor(){super(...arguments),h(this,"currentTime"),h(this,"volume"),h(this,"paused"),h(this,"muted"),h(this,"playbackRate"),h(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class rr extends A{constructor(e){super(),h(this,"nodeType",3),h(this,"nodeName","#text"),h(this,"RRNodeType",b.Text),h(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class sr extends A{constructor(e){super(),h(this,"nodeType",8),h(this,"nodeName","#comment"),h(this,"RRNodeType",b.Comment),h(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class ir extends A{constructor(e){super(),h(this,"nodeName","#cdata-section"),h(this,"nodeType",4),h(this,"RRNodeType",b.CDATA),h(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class nr{constructor(e,t){if(h(this,"onChange"),h(this,"classes",[]),h(this,"add",(...r)=>{for(const s of r){const o=String(s);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),h(this,"remove",(...r)=>{this.classes=this.classes.filter(s=>r.indexOf(s)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}}function qe(i,e){return e.parentNode&&e.parentNode.removeChild(e),i.lastChild?(i.lastChild.nextSibling=e,e.previousSibling=i.lastChild):(i.firstChild=e,e.previousSibling=null),i.lastChild=e,e.nextSibling=null,e.parentNode=i,e.parentElement=i,e.ownerDocument=i.ownerDocument,e}function or(i,e,t){if(!t)return qe(i,e);if(t.parentNode!==i)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,e.parentElement=i,e.parentNode=i,e.ownerDocument=i.ownerDocument),e}function lr(i,e){if(e.parentNode!==i)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:i.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:i.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var Je=(i=>(i[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i))(Je||{});const Ni=require("nwsapi"),Di=require("cssom"),Pi=require("cssstyle");class ar{constructor(){w(this,"scrollLeft",0),w(this,"scrollTop",0)}scrollTo(e){e&&(typeof e.left=="number"&&(this.scrollLeft=e.left),typeof e.top=="number"&&(this.scrollTop=e.top))}}class j extends He{constructor(){super(...arguments),w(this,"nodeName","#document"),w(this,"_nwsapi")}get nwsapi(){return this._nwsapi||(this._nwsapi=Ni({document:this,DOMException:null}),this._nwsapi.configure({LOGERRORS:!1,IDS_DUPES:!0,MIXEDCASE:!0})),this._nwsapi}get documentElement(){return super.documentElement}get body(){return super.body}get head(){return super.head}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){return super.appendChild(e)}insertBefore(e,t){return super.insertBefore(e,t)}querySelectorAll(e){return this.nwsapi.select(e)}getElementsByTagName(e){return this.documentElement?this.documentElement.getElementsByTagName(e):[]}getElementsByClassName(e){return this.documentElement?this.documentElement.getElementsByClassName(e):[]}getElementById(e){return this.documentElement?this.documentElement.getElementById(e):null}createDocument(e,t,r){return new j}createDocumentType(e,t,r){const s=new ur(e,t,r);return s.ownerDocument=this,s}createElement(e){const t=e.toUpperCase();let r;switch(t){case"AUDIO":case"VIDEO":r=new cr(t);break;case"IFRAME":r=new mr(t);break;case"IMG":r=new hr(t);break;case"CANVAS":r=new fr(t);break;case"STYLE":r=new pr(t);break;default:r=new C(t);break}return r.ownerDocument=this,r}createElementNS(e,t){return this.createElement(t)}createComment(e){const t=new gr(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new yr(e);return t.ownerDocument=this,t}createTextNode(e){const t=new dr(e);return t.ownerDocument=this,t}}class ur extends tr{}class C extends Ge{constructor(e){super(e),w(this,"_style"),this._style=new Pi.CSSStyleDeclaration;const t=this._style;Object.defineProperty(this.attributes,"style",{get(){return t.cssText},set(r){t.cssText=r}})}get style(){return this._style}attachShadow(e){return super.attachShadow(e)}appendChild(e){return super.appendChild(e)}insertBefore(e,t){return super.insertBefore(e,t)}getAttribute(e){const t=e&&e.toLowerCase();return t in this.attributes?this.attributes[t]:null}setAttribute(e,t){this.attributes[e.toLowerCase()]=t}removeAttribute(e){delete this.attributes[e.toLowerCase()]}get firstElementChild(){for(const e of this.childNodes)if(e.RRNodeType===Je.Element)return e;return null}get nextElementSibling(){const e=this.parentNode;if(!e)return null;const t=e.childNodes,r=t.indexOf(this);for(let s=r+1;s<t.length;s++)if(t[s]instanceof C)return t[s];return null}querySelectorAll(e){const t=[];return this.ownerDocument!==null&&this.ownerDocument.nwsapi.select(e,this,r=>{r!==this&&t.push(r)}),t}getElementById(e){if(this.id===e)return this;for(const t of this.childNodes)if(t instanceof C){const r=t.getElementById(e);if(r!==null)return r}return null}getElementsByClassName(e){let t=[];const r=new nr(e);this instanceof C&&r.classes.filter(s=>this.classList.classes.some(o=>o===s)).length==r.classes.length&&t.push(this);for(const s of this.childNodes)s instanceof C&&(t=t.concat(s.getElementsByClassName(e)));return t}getElementsByTagName(e){let t=[];const r=e.toUpperCase();this instanceof C&&this.tagName===r&&t.push(this);for(const s of this.childNodes)s instanceof C&&(t=t.concat(s.getElementsByTagName(e)));return t}}class hr extends C{constructor(){super(...arguments),w(this,"src",""),w(this,"width",0),w(this,"height",0),w(this,"onload",null)}}class cr extends Ai{}class fr extends C{getContext(){return null}}class pr extends C{constructor(){super(...arguments),w(this,"_sheet",null)}get sheet(){if(!this._sheet){let e="";for(const t of this.childNodes)t.RRNodeType===Je.Text&&(e+=t.textContent);this._sheet=Di.parse(e)}return this._sheet}}class mr extends C{constructor(e){super(e),w(this,"width",""),w(this,"height",""),w(this,"src",""),w(this,"contentDocument",new j),w(this,"contentWindow",new ar);const t=this.contentDocument.createElement("HTML");this.contentDocument.appendChild(t),t.appendChild(this.contentDocument.createElement("HEAD")),t.appendChild(this.contentDocument.createElement("BODY"))}}class dr extends rr{constructor(){super(...arguments),w(this,"nodeName","#text")}}class gr extends sr{constructor(){super(...arguments),w(this,"nodeName","#comment")}}class yr extends ir{constructor(){super(...arguments),w(this,"nodeName","#cdata-section")}}function Ti(){if(typeof window!="undefined"||"performance"in global)return;const i=require("perf_hooks").performance;global.performance=i}function $i(){if(typeof window!="undefined"||"requestAnimationFrame"in global)return;const i=60,e=1e3/i;let t=null,r=0,s=Object.create(null);function o(){const l=s;s=Object.create(null),t=null,Object.keys(l).forEach(function(u){const c=l[u];c&&c(Date.now())})}function n(l){const u=++r;return s[u]=l,t===null&&(t=setTimeout(o,e)),u}function a(l){delete s[l],Object.keys(s).length===0&&t!==null&&(clearTimeout(t),t=null)}global.requestAnimationFrame=n,global.cancelAnimationFrame=a}function _i(){typeof Event=="undefined"&&(global.Event=function(){})}function Mi(){typeof Node=="undefined"&&(global.Node=A)}function Ii(){if(typeof document!="undefined")return;const i=new j;(()=>{var e,t;i.appendChild(i.createElement("html")),(e=i.documentElement)==null||e.appendChild(i.createElement("head")),(t=i.documentElement)==null||t.appendChild(i.createElement("body"))})(),global.document=i}Ti();$i();_i();Mi();Ii();exports.RRCDATASection=yr;exports.RRCanvasElement=fr;exports.RRComment=gr;exports.RRDocument=j;exports.RRDocumentType=ur;exports.RRElement=C;exports.RRIFrameElement=mr;exports.RRImageElement=hr;exports.RRMediaElement=cr;exports.RRStyleElement=pr;exports.RRText=dr;exports.RRWindow=ar;