@sailfish-rrweb/replay 0.5.9 → 0.5.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.
- package/dist/replay.cjs +52 -52
- package/dist/replay.cjs.map +1 -1
- package/dist/replay.js +4117 -4144
- package/dist/replay.js.br +0 -0
- package/dist/replay.js.gz +0 -0
- package/dist/replay.js.map +1 -1
- package/dist/replay.umd.cjs +52 -52
- package/dist/replay.umd.cjs.map +1 -1
- package/dist/replay.umd.min.cjs +46 -46
- package/dist/replay.umd.min.cjs.map +3 -3
- package/dist/replay.umd.umd.cjs +46 -46
- package/dist/replay.umd.umd.cjs.map +3 -3
- package/dist/replay.umd.umd.min.cjs +46 -46
- package/dist/replay.umd.umd.min.cjs.map +3 -3
- package/dist/style.css.gz +0 -0
- package/dist/style.min.css.gz +0 -0
- package/package.json +3 -3
package/dist/replay.cjs
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
2
|
-
`+g+
|
|
3
|
-
`+
|
|
4
|
-
`)}toString(){let
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Fr=Object.defineProperty,_r=(e,t,s)=>t in e?Fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,v=(e,t,s)=>_r(e,typeof t!="symbol"?t+"":t,s),Br=Object.defineProperty,Ur=(e,t,s)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Gs=(e,t,s)=>Ur(e,typeof t!="symbol"?t+"":t,s),R=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(R||{});function Wr(e){return e.nodeType===e.ELEMENT_NODE}let Zi=class{constructor(){Gs(this,"idNodeMap",new Map),Gs(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Xi(){return new Zi}function jr(e){return e.toLowerCase()}function Vr(e,t){return!e||!t||e.type!==t.type?!1:e.type===R.Document?e.compatMode===t.compatMode:e.type===R.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===R.Comment||e.type===R.Text||e.type===R.CDATA?e.textContent===t.textContent:e.type===R.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(s,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),s}var ys={exports:{}},x=String,Hi=function(){return{isColorSupported:!1,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};ys.exports=Hi();ys.exports.createColors=Hi;var Gr=ys.exports;const Zr={},Xr=Object.freeze(Object.defineProperty({__proto__:null,default:Zr},Symbol.toStringTag,{value:"Module"})),j=Yr(Xr);let Zs=Gr,Xs=j,Be=class Ji extends Error{constructor(t,s,i,n,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),a&&(this.plugin=a),typeof s<"u"&&typeof i<"u"&&(typeof s=="number"?(this.line=s,this.column=i):(this.line=s.line,this.column=s.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ji)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let s=this.source;t==null&&(t=Zs.isColorSupported);let i=h=>h,n=h=>h,o=h=>h;if(t){let{bold:h,gray:c,red:d}=Zs.createColors(!0);n=m=>h(d(m)),i=m=>c(m),Xs&&(o=m=>Xs(m))}let a=s.split(/\r?\n/),r=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),u=String(l).length;return a.slice(r,l).map((h,c)=>{let d=r+1+c,m=" "+(" "+d).slice(-u)+" | ";if(d===this.line){if(h.length>160){let p=20,S=Math.max(0,this.column-p),f=Math.max(this.column+p,this.endColumn+p),w=h.slice(S,f),g=i(m.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,p-1)).replace(/[^\t]/g," ");return n(">")+i(m)+o(w)+`
|
|
2
|
+
`+g+n("^")}let b=i(m.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+i(m)+o(h)+`
|
|
3
|
+
`+b+n("^")}return" "+i(m)+o(h)}).join(`
|
|
4
|
+
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
5
5
|
|
|
6
|
-
`+
|
|
7
|
-
`),this.name+": "+this.message+
|
|
6
|
+
`+t+`
|
|
7
|
+
`),this.name+": "+this.message+t}};var ws=Be;Be.default=Be;const Hs={after:`
|
|
8
8
|
`,beforeClose:`
|
|
9
9
|
`,beforeComment:`
|
|
10
10
|
`,beforeDecl:`
|
|
11
11
|
`,beforeOpen:" ",beforeRule:`
|
|
12
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
13
|
-
`)){let o=this.raw(
|
|
14
|
-
`)&&(
|
|
15
|
-
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(
|
|
16
|
-
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(
|
|
17
|
-
`)&&(
|
|
18
|
-
`);return
|
|
19
|
-
`?(s=1,
|
|
20
|
-
`?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:Z(e,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Z(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let i=e.slice(Z(e,this.source.start),Z(e,this.source.end)).indexOf(t.word);i!==-1&&(s=this.positionInside(i),r=this.positionInside(i+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:Z(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:Z(e,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(t,e){return new qn().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){if(a==null)continue;let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=eo){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s={}){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var mt=Vt;Vt.default=Vt;let so=mt,zt=class extends so{constructor(t){super(t),this.type="comment"}};var gt=zt;zt.default=zt;let ro=mt,Yt=class extends ro{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};var yt=Yt;Yt.default=Yt;let qr=gt,ei=yt,io=mt,{isClean:ti,my:si}=Re,bs,ri,ii,vs;function ni(t){return t.map(e=>(e.nodes&&(e.nodes=ni(e.nodes)),delete e.source,e))}function oi(t){if(t[ti]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)oi(e)}let H=class ai extends io{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}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,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=ni(ri(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new ei(e)]}else if(e.selector||e.selectors)e=[new vs(e)];else if(e.name)e=[new bs(e)];else if(e.text)e=[new qr(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[si]||ai.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[ti]&&oi(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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 s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};H.registerParse=t=>{ri=t};H.registerRule=t=>{vs=t};H.registerAtRule=t=>{bs=t};H.registerRoot=t=>{ii=t};var q=H;H.default=H;H.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,bs.prototype):t.type==="rule"?Object.setPrototypeOf(t,vs.prototype):t.type==="decl"?Object.setPrototypeOf(t,ei.prototype):t.type==="comment"?Object.setPrototypeOf(t,qr.prototype):t.type==="root"&&Object.setPrototypeOf(t,ii.prototype),t[si]=!0,t.nodes&&t.nodes.forEach(e=>{H.rebuild(e)})};let li=q,st=class extends li{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Ss=st;st.default=st;li.registerAtRule(st);let no=q,ui,hi,xe=class extends no{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ui(new hi,this,t).stringify()}};xe.registerLazyResult=t=>{ui=t};xe.registerProcessor=t=>{hi=t};var xs=xe;xe.default=xe;let oo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ao=(t=21)=>{let e="",s=t|0;for(;s--;)e+=oo[Math.random()*64|0];return e};var lo={nanoid:ao};let{existsSync:uo,readFileSync:ho}=j,{dirname:Tt,join:co}=j,{SourceMapConsumer:Js,SourceMapGenerator:$s}=j;function po(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let Gt=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Tt(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Js(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return po(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=Tt(t),uo(t))return this.mapFile=t,ho(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof Js)return $s.fromSourceMap(e).toString();if(e instanceof $s)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=co(Tt(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ci=Gt;Gt.default=Gt;let{nanoid:fo}=lo,{isAbsolute:Zt,resolve:Xt}=j,{SourceMapConsumer:mo,SourceMapGenerator:go}=j,{fileURLToPath:Qs,pathToFileURL:Pe}=j,Ks=ws,yo=ci,kt=j,Dt=Symbol("lineToIndexCache"),wo=!!(mo&&go),qs=!!(Xt&&Zt);function er(t){if(t[Dt])return t[Dt];let e=t.css.split(`
|
|
21
|
-
`)
|
|
22
|
-
`," "];return
|
|
12
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Hr(e){return e[0].toUpperCase()+e.slice(1)}let Ue=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?s+=e.raws.afterName:i&&(s+=" "),e.nodes)this.block(e,s+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+i+n,e)}}beforeAfter(e,t){let s;e.type==="decl"?s=this.raw(e,null,"beforeDecl"):e.type==="comment"?s=this.raw(e,null,"beforeComment"):t==="before"?s=this.raw(e,null,"beforeRule"):s=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(s.includes(`
|
|
13
|
+
`)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)s+=o}return s}block(e,t){let s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let s=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),i=e.prop+s+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,s){let i;if(s||(s=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(s==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Hs[s];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(e,s);{let a="raw"+Hr(s);this[a]?i=this[a](o,e):o.walk(r=>{if(i=r.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Hs[s]),o.rawCache[s]=i,i}rawBeforeClose(e){let t;return e.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return t=s.raws.after,t.includes(`
|
|
14
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(i=>{if(typeof i.raws.before<"u")return s=i.raws.before,s.includes(`
|
|
15
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return s=i.raws.before,s.includes(`
|
|
16
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(s=>{if(s.type!=="decl"&&(t=s.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&typeof s.raws.before<"u")return t=s.raws.before,t.includes(`
|
|
17
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(s=>{if(typeof s.raws.between<"u")return t=s.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(s=>{if(s.nodes&&s.nodes.length===0&&(t=s.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let i=s.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof s.raws.before<"u"){let n=s.raws.before.split(`
|
|
18
|
+
`);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(t=s.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let s=e[t],i=e.raws[t];return i&&i.value===s?i.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var $i=Ue;Ue.default=Ue;let Jr=$i;function We(e,t){new Jr(t).stringify(e)}var fe=We;We.default=We;var Rt={};Rt.isClean=Symbol("isClean");Rt.my=Symbol("my");let $r=ws,Qr=$i,Kr=fe,{isClean:ht,my:qr}=Rt;function je(e,t){let s=new e.constructor;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="proxyCache")continue;let n=e[i],o=typeof n;i==="parent"&&o==="object"?t&&(s[i]=t):i==="source"?s[i]=n:Array.isArray(n)?s[i]=n.map(a=>je(a,s)):(o==="object"&&n!==null&&(n=je(n)),s[i]=n)}return s}function ct(e,t){if(t&&typeof t.offset<"u")return t.offset;let s=1,i=1,n=0;for(let o=0;o<e.length;o++){if(i===t.line&&s===t.column){n=o;break}e[o]===`
|
|
19
|
+
`?(s=1,i+=1):s+=1}return n}let Ve=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[ht]=!1,this[qr]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let s of e[t])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=je(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:s,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:s.column,line:s.line},t)}return new $r(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,s){return e[t]===s||(e[t]=s,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[ht]=!0}markDirty(){if(this[ht]){this[ht]=!1;let e=this;for(;e=e.parent;)e[ht]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,i=s.slice(ct(s,this.source.start),ct(s,this.source.end)).indexOf(e.word);i!==-1&&(t=this.positionInside(i))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,n=ct(i,this.source.start),o=n+e;for(let a=n;a<o;a++)i[a]===`
|
|
20
|
+
`?(t=1,s+=1):t+=1;return{column:t,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,n=i.slice(ct(i,this.source.start),ct(i,this.source.end)).indexOf(e.word);n!==-1&&(t=this.positionInside(n),s=this.positionInside(n+e.word.length))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return new Qr().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let i of e)i===this?s=!0:s?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);s||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let s={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(r=>typeof r=="object"&&r.toJSON?r.toJSON(null,t):r);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,t);else if(o==="source"){let r=t.get(a.input);r==null&&(r=n,t.set(a.input,n),n++),s[o]={end:a.end,inputId:r,start:a.start}}else s[o]=a}return i&&(s.inputs=[...t.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Kr){e.stringify&&(e=e.stringify);let t="";return e(this,s=>{t+=s}),t}warn(e,t,s){let i={node:this};for(let n in s)i[n]=s[n];return e.warn(t,i)}};var me=Ve;Ve.default=Ve;let to=me,ze=class extends to{constructor(e){super(e),this.type="comment"}};var ge=ze;ze.default=ze;let eo=me,Ye=class extends eo{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};var ye=Ye;Ye.default=Ye;let Qi=ge,Ki=ye,so=me,{isClean:qi,my:tn}=Rt,bs,en,sn,vs;function nn(e){return e.map(t=>(t.nodes&&(t.nodes=nn(t.nodes)),delete t.source,t))}function rn(e){if(e[qi]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)rn(t)}let Z=class on extends so{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]}append(...t){for(let s of t){let i=this.normalize(s,this.last);for(let n of i)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let s of this.nodes)s.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let s=this.getIterator(),i,n;for(;this.indexes[s]<this.proxyOf.nodes.length&&(i=this.indexes[s],n=t(this.proxyOf.nodes[i],i),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,s){return s==="proxyOf"?t:t[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...i)=>t[s](...i.map(n=>typeof n=="function"?(o,a)=>n(o.toProxy(),a):n)):s==="every"||s==="some"?i=>t[s]((n,...o)=>i(n.toProxy(),...o)):s==="root"?()=>t.root().toProxy():s==="nodes"?t.nodes.map(i=>i.toProxy()):s==="first"||s==="last"?t[s].toProxy():t[s]:t[s]},set(t,s,i){return t[s]===i||(t[s]=i,(s==="name"||s==="params"||s==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,s){let i=this.index(t),n=this.normalize(s,this.proxyOf.nodes[i]).reverse();i=this.index(t);for(let a of n)this.proxyOf.nodes.splice(i+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],i<o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}insertBefore(t,s){let i=this.index(t),n=i===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[i],n).reverse();i=this.index(t);for(let r of o)this.proxyOf.nodes.splice(i,0,r);let a;for(let r in this.indexes)a=this.indexes[r],i<=a&&(this.indexes[r]=a+o.length);return this.markDirty(),this}normalize(t,s){if(typeof t=="string")t=nn(en(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Ki(t)]}else if(t.selector||t.selectors)t=[new vs(t)];else if(t.name)t=[new bs(t)];else if(t.text)t=[new Qi(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[tn]||on.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[qi]&&rn(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(i.raws.before=s.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let s of t){let i=this.normalize(s,this.first,"prepend").reverse();for(let n of i)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+i.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let s;for(let i in this.indexes)s=this.indexes[i],s>=t&&(this.indexes[i]=s-1);return this.markDirty(),this}replaceValues(t,s,i){return i||(i=s,s={}),this.walkDecls(n=>{s.props&&!s.props.includes(n.prop)||s.fast&&!n.value.includes(s.fast)||(n.value=n.value.replace(t,i))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((s,i)=>{let n;try{n=t(s,i)}catch(o){throw s.addToError(o)}return n!==!1&&s.walk&&(n=s.walk(t)),n})}walkAtRules(t,s){return s?t instanceof RegExp?this.walk((i,n)=>{if(i.type==="atrule"&&t.test(i.name))return s(i,n)}):this.walk((i,n)=>{if(i.type==="atrule"&&i.name===t)return s(i,n)}):(s=t,this.walk((i,n)=>{if(i.type==="atrule")return s(i,n)}))}walkComments(t){return this.walk((s,i)=>{if(s.type==="comment")return t(s,i)})}walkDecls(t,s){return s?t instanceof RegExp?this.walk((i,n)=>{if(i.type==="decl"&&t.test(i.prop))return s(i,n)}):this.walk((i,n)=>{if(i.type==="decl"&&i.prop===t)return s(i,n)}):(s=t,this.walk((i,n)=>{if(i.type==="decl")return s(i,n)}))}walkRules(t,s){return s?t instanceof RegExp?this.walk((i,n)=>{if(i.type==="rule"&&t.test(i.selector))return s(i,n)}):this.walk((i,n)=>{if(i.type==="rule"&&i.selector===t)return s(i,n)}):(s=t,this.walk((i,n)=>{if(i.type==="rule")return s(i,n)}))}};Z.registerParse=e=>{en=e};Z.registerRule=e=>{vs=e};Z.registerAtRule=e=>{bs=e};Z.registerRoot=e=>{sn=e};var Q=Z;Z.default=Z;Z.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,bs.prototype):e.type==="rule"?Object.setPrototypeOf(e,vs.prototype):e.type==="decl"?Object.setPrototypeOf(e,Ki.prototype):e.type==="comment"?Object.setPrototypeOf(e,Qi.prototype):e.type==="root"&&Object.setPrototypeOf(e,sn.prototype),e[tn]=!0,e.nodes&&e.nodes.forEach(t=>{Z.rebuild(t)})};let an=Q,se=class extends an{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 Ss=se;se.default=se;an.registerAtRule(se);let io=Q,ln,un,xt=class extends io{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ln(new un,this,e).stringify()}};xt.registerLazyResult=e=>{ln=e};xt.registerProcessor=e=>{un=e};var xs=xt;xt.default=xt;let no="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ro=(e=21)=>{let t="",s=e|0;for(;s--;)t+=no[Math.random()*64|0];return t};var oo={nanoid:ro};let{existsSync:ao,readFileSync:lo}=j,{dirname:Te,join:uo}=j,{SourceMapConsumer:Js,SourceMapGenerator:$s}=j;function ho(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}let Ge=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,i=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Te(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Js(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,o=e.match(i)||e.match(n);if(o)return decodeURIComponent(e.substr(o[0].length));let a=e.match(t)||e.match(s);if(a)return ho(e.substr(a[0].length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),i=e.indexOf("*/",s);s>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,i)))}loadFile(e){if(this.root=Te(e),ao(e))return this.mapFile=e,lo(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let s=t(e);if(s){let i=this.loadFile(s);if(!i)throw new Error("Unable to load previous source map: "+s.toString());return i}}else{if(t instanceof Js)return $s.fromSourceMap(t).toString();if(t instanceof $s)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return e&&(s=uo(Te(e),s)),this.loadFile(s)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var hn=Ge;Ge.default=Ge;let{nanoid:co}=oo,{isAbsolute:Ze,resolve:Xe}=j,{SourceMapConsumer:po,SourceMapGenerator:fo}=j,{fileURLToPath:Qs,pathToFileURL:Pt}=j,Ks=ws,mo=hn,ke=j,De=Symbol("fromOffsetCache"),go=!!(po&&fo),qs=!!(Xe&&Ze),ie=class{get from(){return this.file||this.id}constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!qs||/^\w+:\/\//.test(t.from)||Ze(t.from)?this.file=t.from:this.file=Xe(t.from)),qs&&go){let s=new mo(this.css,t);if(s.text){this.map=s;let i=s.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+co(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,i={}){let n,o,a;if(t&&typeof t=="object"){let l=t,u=s;if(typeof l.offset=="number"){let h=this.fromOffset(l.offset);t=h.line,s=h.col}else t=l.line,s=l.column;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);o=h.line,n=h.col}else o=u.line,n=u.column}else if(!s){let l=this.fromOffset(t);t=l.line,s=l.col}let r=this.origin(t,s,o,n);return r?a=new Ks(e,r.endLine===void 0?r.line:{column:r.column,line:r.line},r.endLine===void 0?r.column:{column:r.endColumn,line:r.endLine},r.source,r.file,i.plugin):a=new Ks(e,o===void 0?t:{column:s,line:t},o===void 0?s:{column:n,line:o},this.css,this.file,i.plugin),a.input={column:s,endColumn:n,endLine:o,line:t,source:this.css},this.file&&(Pt&&(a.input.url=Pt(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,s;if(this[De])s=this[De];else{let n=this.css.split(`
|
|
21
|
+
`);s=new Array(n.length);let o=0;for(let a=0,r=n.length;a<r;a++)s[a]=o,o+=n[a].length+1;this[De]=s}t=s[s.length-1];let i=0;if(e>=t)i=s.length-1;else{let n=s.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<s[o])n=o-1;else if(e>=s[o+1])i=o+1;else{i=o;break}}return{col:e-s[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Xe(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let a;typeof s=="number"&&(a=n.originalPositionFor({column:i,line:s}));let r;Ze(o.source)?r=Pt(o.source):r=new URL(o.source,this.map.consumer().sourceRoot||Pt(this.map.mapFile));let l={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:r.toString()};if(r.protocol==="file:")if(Qs)l.file=Qs(r);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(o.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};var we=ie;ie.default=ie;ke&&ke.registerInput&&ke.registerInput(ie);let cn=Q,pn,dn,it=class extends cn{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let i=super.normalize(e);if(t){if(s==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let s=this.index(e);return!t&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new pn(new dn,this,e).stringify()}};it.registerLazyResult=e=>{pn=e};it.registerProcessor=e=>{dn=e};var Ot=it;it.default=it;cn.registerRoot(it);let Ct={comma(e){return Ct.split(e,[","],!0)},space(e){let t=[" ",`
|
|
22
|
+
`," "];return Ct.split(e,t)},split(e,t,s){let i=[],n="",o=!1,a=0,r=!1,l="",u=!1;for(let h of e)u?u=!1:h==="\\"?u=!0:r?h===l&&(r=!1):h==='"'||h==="'"?(r=!0,l=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&t.includes(h)&&(o=!0),o?(n!==""&&i.push(n.trim()),n="",o=!1):n+=h;return(s||n!=="")&&i.push(n.trim()),i}};var fn=Ct;Ct.default=Ct;let mn=Q,yo=fn,ne=class extends mn{get selectors(){return yo.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};var Cs=ne;ne.default=ne;mn.registerRule(ne);let wo=Ss,bo=ge,vo=ye,So=we,xo=hn,Co=Ot,Eo=Cs;function Et(e,t){if(Array.isArray(e))return e.map(n=>Et(n));let{inputs:s,...i}=e;if(s){t=[];for(let n of s){let o={...n,__proto__:So.prototype};o.map&&(o.map={...o.map,__proto__:xo.prototype}),t.push(o)}}if(i.nodes&&(i.nodes=e.nodes.map(n=>Et(n,t))),i.source){let{inputId:n,...o}=i.source;i.source=o,n!=null&&(i.source.input=t[n])}if(i.type==="root")return new Co(i);if(i.type==="decl")return new vo(i);if(i.type==="rule")return new Eo(i);if(i.type==="comment")return new bo(i);if(i.type==="atrule")return new wo(i);throw new Error("Unknown node type: "+e.type)}var Mo=Et;Et.default=Et;let{dirname:Kt,relative:gn,resolve:yn,sep:wn}=j,{SourceMapConsumer:bn,SourceMapGenerator:qt}=j,{pathToFileURL:ti}=j,No=we,To=!!(bn&&qt),ko=!!(Kt&&yn&&gn&&wn),Do=class{constructor(e,t,s,i){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
23
23
|
`;this.css.includes(`\r
|
|
24
|
-
`)&&(
|
|
25
|
-
`),this.css+=
|
|
26
|
-
`),e=a.length-i):e+=a.length,n&&u!=="start"){let l=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==l.last||l.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?Ke(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=Ke(wi(s,this.mapOpts.annotation)));let r=yi(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new ko(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(tr){let s=tr(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;bi==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var Si=Oo;const Rt=39,sr=34,Le=92,rr=47,Fe=10,de=32,_e=12,Be=9,Ue=13,Ao=91,Io=93,Po=40,Lo=41,Fo=123,_o=125,Bo=59,Uo=42,Wo=58,jo=64,We=/[\t\n\f\r "#'()/;[\\\]{}]/g,je=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Vo=/.[\r\n"'(/\\]/,ir=/[\da-f]/i;var zo=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,u,l,h,c,p,m,v=s.length,d=0,S=[],f=[];function w(){return d}function g(L){throw t.error("Unclosed "+L,d)}function E(){return f.length===0&&d>=v}function I(L){if(f.length)return f.pop();if(d>=v)return;let W=L?L.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Fe:case de:case Be:case Ue:case _e:{n=d;do n+=1,i=s.charCodeAt(n);while(i===de||i===Fe||i===Be||i===Ue||i===_e);l=["space",s.slice(d,n)],d=n-1;break}case Ao:case Io:case Fo:case _o:case Wo:case Bo:case Lo:{let K=String.fromCharCode(i);l=[K,K,d];break}case Po:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Rt&&p!==sr&&p!==de&&p!==Fe&&p!==Be&&p!==_e&&p!==Ue){n=d;do{if(h=!1,n=s.indexOf(")",n+1),n===-1)if(r||W){n=d;break}else g("bracket");for(c=n;s.charCodeAt(c-1)===Le;)c-=1,h=!h}while(h);l=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||Vo.test(o)?l=["(","(",d]:(l=["brackets",o,d,n],d=n);break}case Rt:case sr:{u=i===Rt?"'":'"',n=d;do{if(h=!1,n=s.indexOf(u,n+1),n===-1)if(r||W){n=d+1;break}else g("string");for(c=n;s.charCodeAt(c-1)===Le;)c-=1,h=!h}while(h);l=["string",s.slice(d,n+1),d,n],d=n;break}case jo:{We.lastIndex=d+1,We.test(s),We.lastIndex===0?n=s.length-1:n=We.lastIndex-2,l=["at-word",s.slice(d,n+1),d,n],d=n;break}case Le:{for(n=d,a=!0;s.charCodeAt(n+1)===Le;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==rr&&i!==de&&i!==Fe&&i!==Be&&i!==Ue&&i!==_e&&(n+=1,ir.test(s.charAt(n)))){for(;ir.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===de&&(n+=1)}l=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===rr&&s.charCodeAt(d+1)===Uo?(n=s.indexOf("*/",d+2)+1,n===0&&(r||W?n=s.length:g("comment")),l=["comment",s.slice(d,n+1),d,n],d=n):(je.lastIndex=d+1,je.test(s),je.lastIndex===0?n=s.length-1:n=je.lastIndex-2,l=["word",s.slice(d,n+1),d,n],S.push(l),d=n);break}}return d++,l}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:I,position:w}};let Yo=Ss,Go=gt,Zo=yt,Xo=Oe,nr=Cs,Ho=zo;const or={empty:!0,space:!0};function Jo(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let $o=class{constructor(t){this.input=t,this.root=new Xo,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new Yo;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?u.push(s==="("?")":"]"):s==="{"&&u.length>0?u.push("}"):s===u[u.length-1]&&u.pop(),u.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new Go;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=Ho(this.input)}decl(t,e){let s=new Zo;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||Jo(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let u=this.stringFrom(t,n);u=this.spacesFromEnd(t)+u,u!==" !important"&&(s.raws.important=u);break}else if(i[1].toLowerCase()==="important"){let u=t.slice(0),l="";for(let h=n;h>0;h--){let c=u[h][0];if(l.trim().startsWith("!")&&c!=="space")break;l=u.pop()[1]+l}l.trim().startsWith("!")&&(s.important=!0,s.raws.important=l,t=u)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new nr;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],u=t;for(;u;){if(s=u[0],n.push(u),s==="("||s==="[")i||(i=u),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=u),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(u=n[n.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",u=!0,l,h;for(let c=0;c<a;c+=1)i=s[c],o=i[0],o==="space"&&c===a-1&&!r?u=!1:o==="comment"?(h=s[c-1]?s[c-1][0]:"empty",l=s[c+1]?s[c+1][0]:"empty",!or[h]&&!or[l]?n.slice(-1)===","?u=!1:n+=i[1]:u=!1):n+=i[1];if(!u){let c=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:c,value:n}}t[e]=n}rule(t){t.pop();let e=new nr;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var Qo=$o;let Ko=q,qo=wt,ea=Qo;function nt(t,e){let s=new qo(t,e),r=new ea(s);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
|
|
27
|
-
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(
|
|
28
|
-
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(
|
|
29
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Es=nt;nt.default=nt;Ko.registerParse(nt);let Ht=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[s]}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 xi=Ht;Ht.default=Ht;let ta=xi,Jt=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new ta(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ms=Jt;Jt.default=Jt;let ar={};var Ci=function(t){ar[t]||(ar[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let sa=q,ra=xs,ia=Si,na=Es,lr=Ms,oa=Oe,aa=ft,{isClean:z,my:la}=Re,ua=Ci;const ha={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ca={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},pa={Once:!0,postcssPlugin:!0,prepare:!0},oe=0;function fe(t){return typeof t=="object"&&typeof t.then=="function"}function Ei(t){let e=!1,s=ha[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,oe,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,oe,s+"Exit"]:[s,s+"Exit"]}function ur(t){let e;return t.type==="document"?e=["Document",oe,"DocumentExit"]:t.type==="root"?e=["Root",oe,"RootExit"]:e=Ei(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function $t(t){return t[z]=!1,t.nodes&&t.nodes.forEach(e=>$t(e)),t}let Qt={},ae=class Mi{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=$t(s);else if(s instanceof Mi||s instanceof lr)i=$t(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=na;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[la]&&sa.rebuild(i)}this.result=new lr(e,i,r),this.helpers={...Qt,postcss:Qt,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...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,s){let r=this.result.lastPlugin;try{if(s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,a=this.result.processor.version,n=o.split("."),u=a.split(".");(n[0]!==u[0]||parseInt(n[1])>parseInt(u[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!ca[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!pa[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(fe(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[z];){e[z]=!0;let s=[ur(e)];for(;s.length>0;){let r=this.visitTick(s);if(fe(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}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 s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return fe(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=aa;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new ia(s,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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 s=this.runOnRoot(e);if(fe(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[z];)e[z]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||ua("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(fe(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(u){throw this.handleError(u,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[z]){n[z]=!0,e.push(ur(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===oe){r.nodes&&r.nodes.length&&(r[z]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[z]=!0;let s=Ei(e);for(let r of s)if(r===oe)e.nodes&&e.each(i=>{i[z]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};ae.registerPostcss=t=>{Qt=t};var Ni=ae;ae.default=ae;oa.registerLazyResult(ae);ra.registerLazyResult(ae);let da=Si,fa=Es;const ma=Ms;let ga=ft,ya=Ci,Kt=class{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 t,e=fa;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=ga;this.result=new ma(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new da(i,r,this._opts,e);if(a.isMap()){let[n,u]=a.generate();n&&(this.result.css=n),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(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return process.env.NODE_ENV!=="production"&&("from"in this._opts||ya("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,e)}toString(){return this._css}warnings(){return[]}};var wa=Kt;Kt.default=Kt;let ba=xs,va=Ni,Sa=wa,xa=Oe,Me=class{constructor(t=[]){this.version="8.5.6",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Sa(this,t,e):new va(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Ca=Me;Me.default=Me;xa.registerProcessor(Me);ba.registerProcessor(Me);let Ti=Ss,ki=gt,Ea=q,Ma=ws,Di=yt,Ri=xs,Na=To,Ta=wt,ka=Ni,Da=mi,Ra=mt,Oa=Es,Ns=Ca,Aa=Ms,Oi=Oe,Ai=Cs,Ia=ft,Pa=xi;function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ns(t)}k.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
30
|
-
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(
|
|
31
|
-
https://www.w3ctech.com/topic/2226`));let a=
|
|
32
|
-
`+a)}}))}}}},
|
|
24
|
+
`)&&(t=`\r
|
|
25
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),s=e.root||Kt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new bn(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(s)))}}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.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ko&&To&&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=qt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new qt({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 qt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(a,r,l)=>{if(this.css+=a,r&&l!=="end"&&(i.generated.line=e,i.generated.column=t-1,r.source&&r.source.start?(i.source=this.sourcePath(r),i.original.line=r.source.start.line,i.original.column=r.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(e+=o.length,n=a.lastIndexOf(`
|
|
26
|
+
`),t=a.length-n):t+=a.length,r&&l!=="start"){let u=r.parent||{raws:{}};(!(r.type==="decl"||r.type==="atrule"&&!r.nodes)||r!==u.last||u.raws.semicolon)&&(r.source&&r.source.end?(i.source=this.sourcePath(r),i.original.line=r.source.end.line,i.original.column=r.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?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 s=this.opts.to?Kt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=Kt(yn(s,this.mapOpts.annotation)));let i=gn(s,e);return this.memoizedPaths.set(e,i),i}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 No(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let i=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(i,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(ti){let s=ti(e).toString();return this.memoizedFileURLs.set(e,s),s}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;wn==="\\"&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};var vn=Do;const Re=39,ei=34,Lt=92,si=47,Ft=10,pt=32,_t=12,Bt=9,Ut=13,Ro=91,Oo=93,Ao=40,Io=41,Po=123,Lo=125,Fo=59,_o=42,Bo=58,Uo=64,Wt=/[\t\n\f\r "#'()/;[\\\]{}]/g,jt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Wo=/.[\r\n"'(/\\]/,ii=/[\da-f]/i;var jo=function(e,t={}){let s=e.css.valueOf(),i=t.ignoreErrors,n,o,a,r,l,u,h,c,d,m,b=s.length,p=0,S=[],f=[];function w(){return p}function g(L){throw e.error("Unclosed "+L,p)}function E(){return f.length===0&&p>=b}function P(L){if(f.length)return f.pop();if(p>=b)return;let W=L?L.ignoreUnclosed:!1;switch(n=s.charCodeAt(p),n){case Ft:case pt:case Bt:case Ut:case _t:{r=p;do r+=1,n=s.charCodeAt(r);while(n===pt||n===Ft||n===Bt||n===Ut||n===_t);u=["space",s.slice(p,r)],p=r-1;break}case Ro:case Oo:case Po:case Lo:case Bo:case Fo:case Io:{let $=String.fromCharCode(n);u=[$,$,p];break}case Ao:{if(m=S.length?S.pop()[1]:"",d=s.charCodeAt(p+1),m==="url"&&d!==Re&&d!==ei&&d!==pt&&d!==Ft&&d!==Bt&&d!==_t&&d!==Ut){r=p;do{if(h=!1,r=s.indexOf(")",r+1),r===-1)if(i||W){r=p;break}else g("bracket");for(c=r;s.charCodeAt(c-1)===Lt;)c-=1,h=!h}while(h);u=["brackets",s.slice(p,r+1),p,r],p=r}else r=s.indexOf(")",p+1),o=s.slice(p,r+1),r===-1||Wo.test(o)?u=["(","(",p]:(u=["brackets",o,p,r],p=r);break}case Re:case ei:{l=n===Re?"'":'"',r=p;do{if(h=!1,r=s.indexOf(l,r+1),r===-1)if(i||W){r=p+1;break}else g("string");for(c=r;s.charCodeAt(c-1)===Lt;)c-=1,h=!h}while(h);u=["string",s.slice(p,r+1),p,r],p=r;break}case Uo:{Wt.lastIndex=p+1,Wt.test(s),Wt.lastIndex===0?r=s.length-1:r=Wt.lastIndex-2,u=["at-word",s.slice(p,r+1),p,r],p=r;break}case Lt:{for(r=p,a=!0;s.charCodeAt(r+1)===Lt;)r+=1,a=!a;if(n=s.charCodeAt(r+1),a&&n!==si&&n!==pt&&n!==Ft&&n!==Bt&&n!==Ut&&n!==_t&&(r+=1,ii.test(s.charAt(r)))){for(;ii.test(s.charAt(r+1));)r+=1;s.charCodeAt(r+1)===pt&&(r+=1)}u=["word",s.slice(p,r+1),p,r],p=r;break}default:{n===si&&s.charCodeAt(p+1)===_o?(r=s.indexOf("*/",p+2)+1,r===0&&(i||W?r=s.length:g("comment")),u=["comment",s.slice(p,r+1),p,r],p=r):(jt.lastIndex=p+1,jt.test(s),jt.lastIndex===0?r=s.length-1:r=jt.lastIndex-2,u=["word",s.slice(p,r+1),p,r],S.push(u),p=r);break}}return p++,u}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:P,position:w}};let Vo=Ss,zo=ge,Yo=ye,Go=Ot,ni=Cs,Zo=jo;const ri={empty:!0,space:!0};function Xo(e){for(let t=e.length-1;t>=0;t--){let s=e[t],i=s[3]||s[2];if(i)return i}}let Ho=class{constructor(e){this.input=e,this.root=new Go,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 Vo;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let s,i,n,o=!1,a=!1,r=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),s=e[0],s==="("||s==="["?l.push(s==="("?")":"]"):s==="{"&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),l.length===0)if(s===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(r.length>0){for(n=r.length-1,i=r[n];i&&i[0]==="space";)i=r[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else r.push(e);else r.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(r),r.length?(t.raws.afterName=this.spacesAndCommentsFromStart(r),this.raw(t,"params",r),o&&(e=r[r.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 s=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(s+=1,s===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,s,i,n;for(let[o,a]of e.entries()){if(i=a,n=i[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=i}return!1}comment(e){let t=new zo;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let i=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=Zo(this.input)}decl(e,t){let s=new Yo;this.init(s,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(i[3]||i[2]||Xo(e)),s.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let r=e[0][0];if(r===":"||r==="space"||r==="comment")break;s.prop+=e.shift()[1]}s.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){s.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),s.raws.between+=n[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let r=e.length-1;r>=0;r--){if(n=e[r],n[1].toLowerCase()==="!important"){s.important=!0;let l=this.stringFrom(e,r);l=this.spacesFromEnd(e)+l,l!==" !important"&&(s.raws.important=l);break}else if(n[1].toLowerCase()==="important"){let l=e.slice(0),u="";for(let h=r;h>0;h--){let c=l[h][0];if(u.trim().startsWith("!")&&c!=="space")break;u=l.pop()[1]+u}u.trim().startsWith("!")&&(s.important=!0,s.raws.important=u,e=l)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(r=>r[0]!=="space"&&r[0]!=="comment")&&(s.raws.between+=o.map(r=>r[1]).join(""),o=[]),this.raw(s,"value",o.concat(e),t),s.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 ni;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="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=!1,n=null,o=[],a=e[1].startsWith("--"),r=[],l=e;for(;l;){if(s=l[0],r.push(l),s==="("||s==="[")n||(n=l),o.push(s==="("?")":"]");else if(a&&i&&s==="{")n||(n=l),o.push("}");else if(o.length===0)if(s===";")if(i){this.decl(r,a);return}else break;else if(s==="{"){this.rule(r);return}else if(s==="}"){this.tokenizer.back(r.pop()),t=!0;break}else s===":"&&(i=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!a)for(;r.length&&(l=r[r.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(r.pop());this.decl(r,a)}else this.unknownWord(r)}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,s,i){let n,o,a=s.length,r="",l=!0,u,h;for(let c=0;c<a;c+=1)n=s[c],o=n[0],o==="space"&&c===a-1&&!i?l=!1:o==="comment"?(h=s[c-1]?s[c-1][0]:"empty",u=s[c+1]?s[c+1][0]:"empty",!ri[h]&&!ri[u]?r.slice(-1)===","?l=!1:r+=n[1]:l=!1):r+=n[1];if(!l){let c=s.reduce((d,m)=>d+m[1],"");e.raws[t]={raw:c,value:r}}e[t]=r}rule(e){e.pop();let t=new ni;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],t==="space");)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let i=t;i<e.length;i++)s+=e[i][1];return e.splice(t,e.length-t),s}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 "+e[0][1],{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 Jo=Ho;let $o=Q,Qo=we,Ko=Jo;function re(e,t){let s=new Qo(e,t),i=new Ko(s);try{i.parse()}catch(n){throw process.env.NODE_ENV!=="production"&&n.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?n.message+=`
|
|
27
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?n.message+=`
|
|
28
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(n.message+=`
|
|
29
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),n}return i.root}var Es=re;re.default=re;$o.registerParse(re);let He=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let s=t.node.rangeBy(t);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in t)this[s]=t[s]}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 Sn=He;He.default=He;let qo=Sn,Je=class{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new qo(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>e.type==="warning")}};var Ms=Je;Je.default=Je;let oi={};var xn=function(e){oi[e]||(oi[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let ta=Q,ea=xs,sa=vn,ia=Es,ai=Ms,na=Ot,ra=fe,{isClean:z,my:oa}=Rt,aa=xn;const la={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ua={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},ha={Once:!0,postcssPlugin:!0,prepare:!0},nt=0;function dt(e){return typeof e=="object"&&typeof e.then=="function"}function Cn(e){let t=!1,s=la[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,nt,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,nt,s+"Exit"]:[s,s+"Exit"]}function li(e){let t;return e.type==="document"?t=["Document",nt,"DocumentExit"]:e.type==="root"?t=["Root",nt,"RootExit"]:t=Cn(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function $e(e){return e[z]=!1,e.nodes&&e.nodes.forEach(t=>$e(t)),e}let Qe={},rt=class En{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"}constructor(t,s,i){this.stringified=!1,this.processed=!1;let n;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))n=$e(s);else if(s instanceof En||s instanceof ai)n=$e(s.root),s.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=s.map);else{let o=ia;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{n=o(s,i)}catch(a){this.processed=!0,this.error=a}n&&!n[oa]&&ta.rebuild(n)}this.result=new ai(t,n,i),this.helpers={...Qe,postcss:Qe,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...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(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,s){let i=this.result.lastPlugin;try{if(s&&s.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){let n=i.postcssPlugin,o=i.postcssVersion,a=this.result.processor.version,r=o.split("."),l=a.split(".");(r[0]!==l[0]||parseInt(r[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+n+" uses "+o+". Perhaps this is the source of the error below.")}}catch(n){console&&console.error&&console.error(n)}return t}prepareVisitors(){this.listeners={};let t=(s,i,n)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([s,n])};for(let s of this.plugins)if(typeof s=="object")for(let i in s){if(!ua[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ha[i])if(typeof s[i]=="object")for(let n in s[i])n==="*"?t(s,i,s[i][n]):t(s,i+"-"+n.toLowerCase(),s[i][n]);else typeof s[i]=="function"&&t(s,i,s[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let s=this.plugins[t],i=this.runOnRoot(s);if(dt(i))try{await i}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[z];){t[z]=!0;let s=[li(t)];for(;s.length>0;){let i=this.visitTick(s);if(dt(i))try{await i}catch(n){let o=s[s.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[s,i]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(t.type==="document"){let n=t.nodes.map(o=>i(o,this.helpers));await Promise.all(n)}else await i(t,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(i=>t.Once(i,this.helpers));return dt(s[0])?Promise.all(s):s}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,s=ra;t.syntax&&(s=t.syntax.stringify),t.stringifier&&(s=t.stringifier),s.stringify&&(s=s.stringify);let i=new sa(s,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 t of this.plugins){let s=this.runOnRoot(t);if(dt(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[z];)t[z]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let s of t.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||aa("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,s)}toString(){return this.css}visitSync(t,s){for(let[i,n]of t){this.result.lastPlugin=i;let o;try{o=n(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(dt(o))throw this.getAsyncError()}}visitTick(t){let s=t[t.length-1],{node:i,visitors:n}=s;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(n.length>0&&s.visitorIndex<n.length){let[a,r]=n[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===n.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return r(i.toProxy(),this.helpers)}catch(l){throw this.handleError(l,i)}}if(s.iterator!==0){let a=s.iterator,r;for(;r=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!r[z]){r[z]=!0,t.push(li(r));return}s.iterator=0,delete i.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===nt){i.nodes&&i.nodes.length&&(i[z]=!0,s.iterator=i.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[z]=!0;let s=Cn(t);for(let i of s)if(i===nt)t.nodes&&t.each(n=>{n[z]||this.walkSync(n)});else{let n=this.listeners[i];if(n&&this.visitSync(n,t.toProxy()))return}}warnings(){return this.sync().warnings()}};rt.registerPostcss=e=>{Qe=e};var Mn=rt;rt.default=rt;na.registerLazyResult(rt);ea.registerLazyResult(rt);let ca=vn,pa=Es;const da=Ms;let fa=fe,ma=xn,Ke=class{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=pa;try{e=t(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,s){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let i,n=fa;this.result=new da(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new ca(n,i,this._opts,t);if(a.isMap()){let[r,l]=a.generate();r&&(this.result.css=r),l&&(this.result.map=l)}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 process.env.NODE_ENV!=="production"&&("from"in this._opts||ma("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};var ga=Ke;Ke.default=Ke;let ya=xs,wa=Mn,ba=ga,va=Ot,Mt=class{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)t.push(s);else if(typeof s=="function")t.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new ba(this,e,t):new wa(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Sa=Mt;Mt.default=Mt;va.registerProcessor(Mt);ya.registerProcessor(Mt);let Nn=Ss,Tn=ge,xa=Q,Ca=ws,kn=ye,Dn=xs,Ea=Mo,Ma=we,Na=Mn,Ta=fn,ka=me,Da=Es,Ns=Sa,Ra=Ms,Rn=Ot,On=Cs,Oa=fe,Aa=Sn;function k(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ns(e)}k.plugin=function(e,t){let s=!1;function i(...o){console&&console.warn&&!s&&(s=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
30
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
31
|
+
https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new Ns().version,a}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,a,r){return k([i(r)]).process(o,a)},i};k.stringify=Oa;k.parse=Da;k.fromJSON=Ea;k.list=Ta;k.comment=e=>new Tn(e);k.atRule=e=>new Nn(e);k.decl=e=>new kn(e);k.rule=e=>new On(e);k.root=e=>new Rn(e);k.document=e=>new Dn(e);k.CssSyntaxError=Ca;k.Declaration=kn;k.Container=xa;k.Processor=Ns;k.Document=Dn;k.Comment=Tn;k.Warning=Aa;k.AtRule=Nn;k.Result=Ra;k.Input=Ma;k.Rule=On;k.Root=Rn;k.Node=ka;Na.registerPostcss(k);var Ia=k;k.default=k;const O=zr(Ia);O.stringify;O.fromJSON;O.plugin;O.parse;O.list;O.document;O.comment;O.atRule;O.rule;O.decl;O.root;O.CssSyntaxError;O.Declaration;O.Container;O.Processor;O.Document;O.Comment;O.Warning;O.AtRule;O.Result;O.Input;O.Rule;O.Root;O.Node;const Pa=/(max|min)-device-(width|height)/,ui=new RegExp(Pa.source,"g"),La={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(ui)&&(e.params=e.params.replace(ui,"$1-$2"))}}}},Fa={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(s){if(!s.includes(":"))return;const i=s.replace(/\n/g," ").split(" "),n=[];i.forEach(function(a){const r=a.match(/::?([^:]+)/g);if(!r){n.push(a);return}const l=a.substr(0,a.length-r.join("").length),u=r.map(function(h){return h.replace(/\(.*/g,"")!==":hover"||h.match(/^::/)?h:(h=h.substr(1),h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)"),".\\:"+h)});n.push(l+u.join(""))}),o(n.join(" "));function o(a){a&&a!==s&&(t.selector+=`,
|
|
32
|
+
`+a)}}))}}}},hi={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function _a(e){let t=hi[e.tagName]?hi[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function ci(e,t){const s=t==null?void 0:t.stylesWithHoverClass.get(e);if(s)return s;const i=O([La,Fa]).process(e).css;return t==null||t.stylesWithHoverClass.set(e,i),i}function pi(){return{stylesWithHoverClass:new Map}}function Ba(e,t){var s;const{doc:i,hackCss:n,cache:o}=t;switch(e.type){case R.Document:return i.implementation.createDocument(null,"",null);case R.DocumentType:return i.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case R.Element:{const a=_a(e);let r;e.isSVG?r=i.createElementNS("http://www.w3.org/2000/svg",a):(e.isCustom&&(s=i.defaultView)!=null&&s.customElements&&!i.defaultView.customElements.get(e.tagName)&&i.defaultView.customElements.define(e.tagName,class extends i.defaultView.HTMLElement{}),r=i.createElement(a));const l={};for(const u in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,u))continue;let h=e.attributes[u];if(a==="option"&&u==="selected"&&h===!1||h===null)continue;if(h===!0&&(h=""),u.startsWith("rr_")){l[u]=h;continue}const c=a==="textarea"&&u==="value",d=a==="style"&&u==="_cssText";if(d&&n&&typeof h=="string"&&(h=ci(h,o)),(c||d)&&typeof h=="string"){r.appendChild(i.createTextNode(h)),e.childNodes=[];continue}try{if(e.isSVG&&u==="xlink:href")r.setAttributeNS("http://www.w3.org/1999/xlink",u,h.toString());else if(u==="onload"||u==="onclick"||u.substring(0,7)==="onmouse")r.setAttribute("_"+u,h.toString());else if(a==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&u==="content"){r.setAttribute("csp-content",h.toString());continue}else a==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||a==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(a==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?r.setAttribute("original-srcset",e.attributes.srcset):r.setAttribute(u,h.toString()))}catch{}}for(const u in l){const h=l[u];if(a==="canvas"&&u==="rr_dataURL"){const c=i.createElement("img");c.onload=()=>{const d=r.getContext("2d");d&&d.drawImage(c,0,0,c.width,c.height)},c.src=h.toString(),r.RRNodeType&&(r.rr_dataURL=h.toString())}else if(a==="img"&&u==="rr_dataURL"){const c=r;c.currentSrc.startsWith("data:")||(c.setAttribute("original-src",e.attributes.src),c.src=h.toString())}if(u==="rr_width")r.style.width=h.toString();else if(u==="rr_height")r.style.height=h.toString();else if(u==="rr_mediaCurrentTime"&&typeof h=="number")r.currentTime=h;else if(u==="rr_mediaState")switch(h){case"played":r.play().catch(c=>console.warn("media playback error",c));break;case"paused":r.pause();break}else u==="rr_mediaPlaybackRate"&&typeof h=="number"?r.playbackRate=h:u==="rr_mediaMuted"&&typeof h=="boolean"?r.muted=h:u==="rr_mediaLoop"&&typeof h=="boolean"?r.loop=h:u==="rr_mediaVolume"&&typeof h=="number"&&(r.volume=h)}if(e.isShadowHost)if(!r.shadowRoot)r.attachShadow({mode:"open"});else for(;r.shadowRoot.firstChild;)r.shadowRoot.removeChild(r.shadowRoot.firstChild);return r}case R.Text:return i.createTextNode(e.isStyle&&n?ci(e.textContent,o):e.textContent);case R.CDATA:return i.createCDATASection(e.textContent);case R.Comment:return i.createComment(e.textContent);default:return null}}function St(e,t){const{doc:s,mirror:i,skipChild:n=!1,hackCss:o=!0,afterAppend:a,cache:r}=t;if(i.has(e.id)){const u=i.getNode(e.id),h=i.getMeta(u);if(Vr(h,e))return i.getNode(e.id)}let l=Ba(e,{doc:s,hackCss:o,cache:r});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==s&&i.replace(e.rootId,s),e.type===R.Document&&(s.close(),s.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==R.DocumentType&&(e.childNodes[0].type===R.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=s),i.add(l,e),(e.type===R.Document||e.type===R.Element)&&!n)for(const u of e.childNodes){const h=St(u,{doc:s,mirror:i,skipChild:!1,hackCss:o,afterAppend:a,cache:r});if(!h){console.warn("Failed to rebuild",u);continue}if(u.isShadow&&Wr(l)&&l.shadowRoot)l.shadowRoot.appendChild(h);else if(e.type===R.Document&&u.type==R.Element){const c=h;let d=null;c.childNodes.forEach(m=>{m.nodeName==="BODY"&&(d=m)}),d?(c.removeChild(d),l.appendChild(h),c.appendChild(d)):l.appendChild(h)}else l.appendChild(h);a&&a(h,u.id)}return l}function Ua(e,t){function s(i){t(i)}for(const i of e.getIds())e.has(i)&&s(e.getNode(i))}function Wa(e,t){const s=t.getMeta(e);if((s==null?void 0:s.type)!==R.Element)return;const i=e;for(const n in s.attributes){if(!(Object.prototype.hasOwnProperty.call(s.attributes,n)&&n.startsWith("rr_")))continue;const o=s.attributes[n];n==="rr_scrollLeft"&&(i.scrollLeft=o),n==="rr_scrollTop"&&(i.scrollTop=o)}}function ja(e,t){const{doc:s,onVisit:i,hackCss:n=!0,afterAppend:o,cache:a,mirror:r=new Zi}=t,l=St(e,{doc:s,mirror:r,skipChild:!1,hackCss:n,afterAppend:o,cache:a});return Ua(r,u=>{i&&i(u),Wa(u,r)}),l}var A=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Device=24]="Device",e[e.SailfishCustom=25]="SailfishCustom",e))(A||{}),T=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e[e.Typing=17]="Typing",e))(T||{}),wt=(e=>(e.Append="append",e.Insert="insert",e.Delete="delete",e.Replace="replace",e))(wt||{}),F=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(F||{}),oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(oe||{}),qe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(qe||{}),N=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(N||{});const q=`Please stop import mirror directly. Instead of that,\r
|
|
33
33
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
34
|
-
or you can use record.mirror to access the mirror instance during recording.`;let
|
|
35
|
-
`+g+
|
|
36
|
-
`+
|
|
37
|
-
`)}toString(){let
|
|
34
|
+
or you can use record.mirror to access the mirror instance during recording.`;let di={map:{},getId(){return console.error(q),-1},getNode(){return console.error(q),null},removeNodeFromMap(){console.error(q)},has(){return console.error(q),!1},reset(){console.error(q)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(di=new Proxy(di,{get(e,t,s){return t==="map"&&console.error(q),Reflect.get(e,t,s)}}));Date.now().toString();function Va(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let s=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===s)return!0;while(s=s&&s.parentNode);return!1})}function za(e){const t={},s=(n,o)=>{const a={value:n,parent:o,children:[]};return t[n.node.id]=a,a},i=[];for(const n of e){const{nextId:o,parentId:a}=n;if(o&&o in t){const r=t[o];if(r.parent){const l=r.parent.children.indexOf(r);r.parent.children.splice(l,0,s(n,r.parent))}else{const l=i.indexOf(r);i.splice(l,0,s(n,null))}continue}if(a in t){const r=t[a];r.children.push(s(n,r));continue}i.push(s(n,null))}return i}function An(e,t){t(e.value);for(let s=e.children.length-1;s>=0;s--)An(e.children[s],t)}function Oe(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function In(e,t){var s,i;const n=(i=(s=e.ownerDocument)==null?void 0:s.defaultView)==null?void 0:i.frameElement;if(!n||n===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=n.getBoundingClientRect(),a=In(n,t),r=o.height/n.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:r,absoluteScale:a.absoluteScale*r}}function Vt(e){return!!(e!=null&&e.shadowRoot)}function bt(e,t){const s=e[t[0]];return t.length===1?s:bt(s.cssRules[t[1]].cssRules,t.slice(2))}function fi(e){const t=[...e],s=t.pop();return{positions:t,index:s}}function Ya(e){const t=new Set,s=[];for(let i=e.length;i--;){const n=e[i];t.has(n.id)||(s.push(n),t.add(n.id))}return s}class Ga{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,s){if(this.has(t))return this.getId(t);let i;return s===void 0?i=this.id++:i=s,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Za(e,t){const s=e||"";switch(t.op){case wt.Append:return s+t.text;case wt.Insert:return s.slice(0,t.pos)+t.text+s.slice(t.pos);case wt.Delete:return s.slice(0,t.pos)+s.slice(t.pos+t.length);case wt.Replace:return s.slice(0,t.pos)+t.text+s.slice(t.pos+t.deleteCount);default:return s}}const Xa="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",Ha=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0));typeof self<"u"&&self.Blob&&new Blob([Ha(Xa)],{type:"text/javascript;charset=utf-8"});var mi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var zt=0;zt<mi.length;zt++)vt[mi.charCodeAt(zt)]=zt;var Ja=function(e){var t=e.length*.75,s=e.length,i,n=0,o,a,r,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=new ArrayBuffer(t),h=new Uint8Array(u);for(i=0;i<s;i+=4)o=vt[e.charCodeAt(i)],a=vt[e.charCodeAt(i+1)],r=vt[e.charCodeAt(i+2)],l=vt[e.charCodeAt(i+3)],h[n++]=o<<2|a>>4,h[n++]=(a&15)<<4|r>>2,h[n++]=(r&3)<<6|l&63;return u},gi;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((gi=e.contentWindow)==null?void 0:gi.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}Xi();var $a=Object.defineProperty,Qa=(e,t,s)=>t in e?$a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,y=(e,t,s)=>Qa(e,typeof t!="symbol"?t+"":t,s),Ka=Object.defineProperty,qa=(e,t,s)=>t in e?Ka(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,yi=(e,t,s)=>qa(e,typeof t!="symbol"?t+"":t,s),M=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(M||{});class tl{constructor(){yi(this,"idNodeMap",new Map),yi(this,"nodeMetaMap",new WeakMap)}getId(t){var s;return t?((s=this.getMeta(t))==null?void 0:s.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const s=this.getId(t);this.idNodeMap.delete(s),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,s){const i=s.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,s)}replace(t,s){const i=this.getNode(t);if(i){const n=this.nodeMetaMap.get(i);n&&this.nodeMetaMap.set(s,n)}this.idNodeMap.set(t,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function el(){return new tl}function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function il(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(s,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),s}var Ts={exports:{}},C=String,Pn=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C,blackBright:C,redBright:C,greenBright:C,yellowBright:C,blueBright:C,magentaBright:C,cyanBright:C,whiteBright:C,bgBlackBright:C,bgRedBright:C,bgGreenBright:C,bgYellowBright:C,bgBlueBright:C,bgMagentaBright:C,bgCyanBright:C,bgWhiteBright:C}};Ts.exports=Pn();Ts.exports.createColors=Pn;var nl=Ts.exports;const rl={},ol=Object.freeze(Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"})),V=il(ol);let wi=nl,bi=V,ts=class Ln extends Error{constructor(t,s,i,n,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),a&&(this.plugin=a),typeof s<"u"&&typeof i<"u"&&(typeof s=="number"?(this.line=s,this.column=i):(this.line=s.line,this.column=s.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ln)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let s=this.source;t==null&&(t=wi.isColorSupported);let i=h=>h,n=h=>h,o=h=>h;if(t){let{bold:h,gray:c,red:d}=wi.createColors(!0);n=m=>h(d(m)),i=m=>c(m),bi&&(o=m=>bi(m))}let a=s.split(/\r?\n/),r=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),u=String(l).length;return a.slice(r,l).map((h,c)=>{let d=r+1+c,m=" "+(" "+d).slice(-u)+" | ";if(d===this.line){if(h.length>160){let p=20,S=Math.max(0,this.column-p),f=Math.max(this.column+p,this.endColumn+p),w=h.slice(S,f),g=i(m.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,p-1)).replace(/[^\t]/g," ");return n(">")+i(m)+o(w)+`
|
|
35
|
+
`+g+n("^")}let b=i(m.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+i(m)+o(h)+`
|
|
36
|
+
`+b+n("^")}return" "+i(m)+o(h)}).join(`
|
|
37
|
+
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
38
38
|
|
|
39
|
-
`+
|
|
40
|
-
`),this.name+": "+this.message+
|
|
39
|
+
`+t+`
|
|
40
|
+
`),this.name+": "+this.message+t}};var ks=ts;ts.default=ts;const vi={after:`
|
|
41
41
|
`,beforeClose:`
|
|
42
42
|
`,beforeComment:`
|
|
43
43
|
`,beforeDecl:`
|
|
44
44
|
`,beforeOpen:" ",beforeRule:`
|
|
45
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
46
|
-
`)){let o=this.raw(
|
|
47
|
-
`)&&(
|
|
48
|
-
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(
|
|
49
|
-
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(
|
|
50
|
-
`)&&(
|
|
51
|
-
`);return
|
|
52
|
-
`?(s=1,
|
|
53
|
-
`?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:X(e,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:X(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let i=e.slice(X(e,this.source.start),X(e,this.source.end)).indexOf(t.word);i!==-1&&(s=this.positionInside(i),r=this.positionInside(i+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:X(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:X(e,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(t,e){return new pl().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){if(a==null)continue;let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=dl){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s={}){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var vt=is;is.default=is;let ml=vt,ns=class extends ml{constructor(t){super(t),this.type="comment"}};var St=ns;ns.default=ns;let gl=vt,os=class extends gl{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};var xt=os;os.default=os;let Bi=St,Ui=xt,yl=vt,{isClean:Wi,my:ji}=Ae,Ds,Vi,zi,Rs;function Yi(t){return t.map(e=>(e.nodes&&(e.nodes=Yi(e.nodes)),delete e.source,e))}function Gi(t){if(t[Wi]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)Gi(e)}let J=class Zi extends yl{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}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,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=Yi(Vi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ui(e)]}else if(e.selector||e.selectors)e=[new Rs(e)];else if(e.name)e=[new Ds(e)];else if(e.text)e=[new Bi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[ji]||Zi.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Wi]&&Gi(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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 s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};J.registerParse=t=>{Vi=t};J.registerRule=t=>{Rs=t};J.registerAtRule=t=>{Ds=t};J.registerRoot=t=>{zi=t};var ee=J;J.default=J;J.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Ds.prototype):t.type==="rule"?Object.setPrototypeOf(t,Rs.prototype):t.type==="decl"?Object.setPrototypeOf(t,Ui.prototype):t.type==="comment"?Object.setPrototypeOf(t,Bi.prototype):t.type==="root"&&Object.setPrototypeOf(t,zi.prototype),t[ji]=!0,t.nodes&&t.nodes.forEach(e=>{J.rebuild(e)})};let Xi=ee,at=class extends Xi{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Os=at;at.default=at;Xi.registerAtRule(at);let wl=ee,Hi,Ji,Ne=class extends wl{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Hi(new Ji,this,t).stringify()}};Ne.registerLazyResult=t=>{Hi=t};Ne.registerProcessor=t=>{Ji=t};var As=Ne;Ne.default=Ne;let bl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",vl=(t=21)=>{let e="",s=t|0;for(;s--;)e+=bl[Math.random()*64|0];return e};var Sl={nanoid:vl};let{existsSync:xl,readFileSync:Cl}=V,{dirname:At,join:El}=V,{SourceMapConsumer:xr,SourceMapGenerator:Cr}=V;function Ml(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let as=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=At(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new xr(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return Ml(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=At(t),xl(t))return this.mapFile=t,Cl(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof xr)return Cr.fromSourceMap(e).toString();if(e instanceof Cr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=El(At(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var $i=as;as.default=as;let{nanoid:Nl}=Sl,{isAbsolute:ls,resolve:us}=V,{SourceMapConsumer:Tl,SourceMapGenerator:kl}=V,{fileURLToPath:Er,pathToFileURL:Ye}=V,Mr=ks,Dl=$i,It=V,Pt=Symbol("lineToIndexCache"),Rl=!!(Tl&&kl),Nr=!!(us&&ls);function Tr(t){if(t[Pt])return t[Pt];let e=t.css.split(`
|
|
54
|
-
`)
|
|
55
|
-
`," "];return
|
|
45
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function al(e){return e[0].toUpperCase()+e.slice(1)}let es=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?s+=e.raws.afterName:i&&(s+=" "),e.nodes)this.block(e,s+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+i+n,e)}}beforeAfter(e,t){let s;e.type==="decl"?s=this.raw(e,null,"beforeDecl"):e.type==="comment"?s=this.raw(e,null,"beforeComment"):t==="before"?s=this.raw(e,null,"beforeRule"):s=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(s.includes(`
|
|
46
|
+
`)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)s+=o}return s}block(e,t){let s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let s=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),i=e.prop+s+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,s){let i;if(s||(s=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(s==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return vi[s];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(e,s);{let a="raw"+al(s);this[a]?i=this[a](o,e):o.walk(r=>{if(i=r.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=vi[s]),o.rawCache[s]=i,i}rawBeforeClose(e){let t;return e.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return t=s.raws.after,t.includes(`
|
|
47
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(i=>{if(typeof i.raws.before<"u")return s=i.raws.before,s.includes(`
|
|
48
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return s=i.raws.before,s.includes(`
|
|
49
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(s=>{if(s.type!=="decl"&&(t=s.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&typeof s.raws.before<"u")return t=s.raws.before,t.includes(`
|
|
50
|
+
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(s=>{if(typeof s.raws.between<"u")return t=s.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(s=>{if(s.nodes&&s.nodes.length===0&&(t=s.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let i=s.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof s.raws.before<"u"){let n=s.raws.before.split(`
|
|
51
|
+
`);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(t=s.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let s=e[t],i=e.raws[t];return i&&i.value===s?i.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Fn=es;es.default=es;let ll=Fn;function ss(e,t){new ll(t).stringify(e)}var be=ss;ss.default=ss;var At={};At.isClean=Symbol("isClean");At.my=Symbol("my");let ul=ks,hl=Fn,cl=be,{isClean:ft,my:pl}=At;function is(e,t){let s=new e.constructor;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="proxyCache")continue;let n=e[i],o=typeof n;i==="parent"&&o==="object"?t&&(s[i]=t):i==="source"?s[i]=n:Array.isArray(n)?s[i]=n.map(a=>is(a,s)):(o==="object"&&n!==null&&(n=is(n)),s[i]=n)}return s}function mt(e,t){if(t&&typeof t.offset<"u")return t.offset;let s=1,i=1,n=0;for(let o=0;o<e.length;o++){if(i===t.line&&s===t.column){n=o;break}e[o]===`
|
|
52
|
+
`?(s=1,i+=1):s+=1}return n}let ns=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[ft]=!1,this[pl]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let s of e[t])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=is(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:s,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:s.column,line:s.line},t)}return new ul(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,s){return e[t]===s||(e[t]=s,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markClean(){this[ft]=!0}markDirty(){if(this[ft]){this[ft]=!1;let e=this;for(;e=e.parent;)e[ft]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,i=s.slice(mt(s,this.source.start),mt(s,this.source.end)).indexOf(e.word);i!==-1&&(t=this.positionInside(i))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,n=mt(i,this.source.start),o=n+e;for(let a=n;a<o;a++)i[a]===`
|
|
53
|
+
`?(t=1,s+=1):t+=1;return{column:t,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,n=i.slice(mt(i,this.source.start),mt(i,this.source.end)).indexOf(e.word);n!==-1&&(t=this.positionInside(n),s=this.positionInside(n+e.word.length))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return new hl().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let i of e)i===this?s=!0:s?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);s||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let s={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(r=>typeof r=="object"&&r.toJSON?r.toJSON(null,t):r);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,t);else if(o==="source"){let r=t.get(a.input);r==null&&(r=n,t.set(a.input,n),n++),s[o]={end:a.end,inputId:r,start:a.start}}else s[o]=a}return i&&(s.inputs=[...t.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=cl){e.stringify&&(e=e.stringify);let t="";return e(this,s=>{t+=s}),t}warn(e,t,s){let i={node:this};for(let n in s)i[n]=s[n];return e.warn(t,i)}};var ve=ns;ns.default=ns;let dl=ve,rs=class extends dl{constructor(e){super(e),this.type="comment"}};var Se=rs;rs.default=rs;let fl=ve,os=class extends fl{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};var xe=os;os.default=os;let _n=Se,Bn=xe,ml=ve,{isClean:Un,my:Wn}=At,Ds,jn,Vn,Rs;function zn(e){return e.map(t=>(t.nodes&&(t.nodes=zn(t.nodes)),delete t.source,t))}function Yn(e){if(e[Un]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Yn(t)}let X=class Gn extends ml{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]}append(...t){for(let s of t){let i=this.normalize(s,this.last);for(let n of i)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let s of this.nodes)s.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let s=this.getIterator(),i,n;for(;this.indexes[s]<this.proxyOf.nodes.length&&(i=this.indexes[s],n=t(this.proxyOf.nodes[i],i),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,s){return s==="proxyOf"?t:t[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...i)=>t[s](...i.map(n=>typeof n=="function"?(o,a)=>n(o.toProxy(),a):n)):s==="every"||s==="some"?i=>t[s]((n,...o)=>i(n.toProxy(),...o)):s==="root"?()=>t.root().toProxy():s==="nodes"?t.nodes.map(i=>i.toProxy()):s==="first"||s==="last"?t[s].toProxy():t[s]:t[s]},set(t,s,i){return t[s]===i||(t[s]=i,(s==="name"||s==="params"||s==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,s){let i=this.index(t),n=this.normalize(s,this.proxyOf.nodes[i]).reverse();i=this.index(t);for(let a of n)this.proxyOf.nodes.splice(i+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],i<o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}insertBefore(t,s){let i=this.index(t),n=i===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[i],n).reverse();i=this.index(t);for(let r of o)this.proxyOf.nodes.splice(i,0,r);let a;for(let r in this.indexes)a=this.indexes[r],i<=a&&(this.indexes[r]=a+o.length);return this.markDirty(),this}normalize(t,s){if(typeof t=="string")t=zn(jn(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new Bn(t)]}else if(t.selector||t.selectors)t=[new Rs(t)];else if(t.name)t=[new Ds(t)];else if(t.text)t=[new _n(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Wn]||Gn.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Un]&&Yn(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(i.raws.before=s.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let s of t){let i=this.normalize(s,this.first,"prepend").reverse();for(let n of i)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+i.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let s;for(let i in this.indexes)s=this.indexes[i],s>=t&&(this.indexes[i]=s-1);return this.markDirty(),this}replaceValues(t,s,i){return i||(i=s,s={}),this.walkDecls(n=>{s.props&&!s.props.includes(n.prop)||s.fast&&!n.value.includes(s.fast)||(n.value=n.value.replace(t,i))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((s,i)=>{let n;try{n=t(s,i)}catch(o){throw s.addToError(o)}return n!==!1&&s.walk&&(n=s.walk(t)),n})}walkAtRules(t,s){return s?t instanceof RegExp?this.walk((i,n)=>{if(i.type==="atrule"&&t.test(i.name))return s(i,n)}):this.walk((i,n)=>{if(i.type==="atrule"&&i.name===t)return s(i,n)}):(s=t,this.walk((i,n)=>{if(i.type==="atrule")return s(i,n)}))}walkComments(t){return this.walk((s,i)=>{if(s.type==="comment")return t(s,i)})}walkDecls(t,s){return s?t instanceof RegExp?this.walk((i,n)=>{if(i.type==="decl"&&t.test(i.prop))return s(i,n)}):this.walk((i,n)=>{if(i.type==="decl"&&i.prop===t)return s(i,n)}):(s=t,this.walk((i,n)=>{if(i.type==="decl")return s(i,n)}))}walkRules(t,s){return s?t instanceof RegExp?this.walk((i,n)=>{if(i.type==="rule"&&t.test(i.selector))return s(i,n)}):this.walk((i,n)=>{if(i.type==="rule"&&i.selector===t)return s(i,n)}):(s=t,this.walk((i,n)=>{if(i.type==="rule")return s(i,n)}))}};X.registerParse=e=>{jn=e};X.registerRule=e=>{Rs=e};X.registerAtRule=e=>{Ds=e};X.registerRoot=e=>{Vn=e};var K=X;X.default=X;X.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Ds.prototype):e.type==="rule"?Object.setPrototypeOf(e,Rs.prototype):e.type==="decl"?Object.setPrototypeOf(e,Bn.prototype):e.type==="comment"?Object.setPrototypeOf(e,_n.prototype):e.type==="root"&&Object.setPrototypeOf(e,Vn.prototype),e[Wn]=!0,e.nodes&&e.nodes.forEach(t=>{X.rebuild(t)})};let Zn=K,ae=class extends Zn{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 Os=ae;ae.default=ae;Zn.registerAtRule(ae);let gl=K,Xn,Hn,Nt=class extends gl{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Xn(new Hn,this,e).stringify()}};Nt.registerLazyResult=e=>{Xn=e};Nt.registerProcessor=e=>{Hn=e};var As=Nt;Nt.default=Nt;let yl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",wl=(e=21)=>{let t="",s=e|0;for(;s--;)t+=yl[Math.random()*64|0];return t};var bl={nanoid:wl};let{existsSync:vl,readFileSync:Sl}=V,{dirname:Ae,join:xl}=V,{SourceMapConsumer:Si,SourceMapGenerator:xi}=V;function Cl(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}let as=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,i=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Ae(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Si(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,o=e.match(i)||e.match(n);if(o)return decodeURIComponent(e.substr(o[0].length));let a=e.match(t)||e.match(s);if(a)return Cl(e.substr(a[0].length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),i=e.indexOf("*/",s);s>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,i)))}loadFile(e){if(this.root=Ae(e),vl(e))return this.mapFile=e,Sl(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let s=t(e);if(s){let i=this.loadFile(s);if(!i)throw new Error("Unable to load previous source map: "+s.toString());return i}}else{if(t instanceof Si)return xi.fromSourceMap(t).toString();if(t instanceof xi)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return e&&(s=xl(Ae(e),s)),this.loadFile(s)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Jn=as;as.default=as;let{nanoid:El}=bl,{isAbsolute:ls,resolve:us}=V,{SourceMapConsumer:Ml,SourceMapGenerator:Nl}=V,{fileURLToPath:Ci,pathToFileURL:Yt}=V,Ei=ks,Tl=Jn,Ie=V,Pe=Symbol("fromOffsetCache"),kl=!!(Ml&&Nl),Mi=!!(us&&ls),le=class{get from(){return this.file||this.id}constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,t.document&&(this.document=t.document.toString()),t.from&&(!Mi||/^\w+:\/\//.test(t.from)||ls(t.from)?this.file=t.from:this.file=us(t.from)),Mi&&kl){let s=new Tl(this.css,t);if(s.text){this.map=s;let i=s.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+El(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,i={}){let n,o,a;if(t&&typeof t=="object"){let l=t,u=s;if(typeof l.offset=="number"){let h=this.fromOffset(l.offset);t=h.line,s=h.col}else t=l.line,s=l.column;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);o=h.line,n=h.col}else o=u.line,n=u.column}else if(!s){let l=this.fromOffset(t);t=l.line,s=l.col}let r=this.origin(t,s,o,n);return r?a=new Ei(e,r.endLine===void 0?r.line:{column:r.column,line:r.line},r.endLine===void 0?r.column:{column:r.endColumn,line:r.endLine},r.source,r.file,i.plugin):a=new Ei(e,o===void 0?t:{column:s,line:t},o===void 0?s:{column:n,line:o},this.css,this.file,i.plugin),a.input={column:s,endColumn:n,endLine:o,line:t,source:this.css},this.file&&(Yt&&(a.input.url=Yt(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,s;if(this[Pe])s=this[Pe];else{let n=this.css.split(`
|
|
54
|
+
`);s=new Array(n.length);let o=0;for(let a=0,r=n.length;a<r;a++)s[a]=o,o+=n[a].length+1;this[Pe]=s}t=s[s.length-1];let i=0;if(e>=t)i=s.length-1;else{let n=s.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<s[o])n=o-1;else if(e>=s[o+1])i=o+1;else{i=o;break}}return{col:e-s[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:us(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let a;typeof s=="number"&&(a=n.originalPositionFor({column:i,line:s}));let r;ls(o.source)?r=Yt(o.source):r=new URL(o.source,this.map.consumer().sourceRoot||Yt(this.map.mapFile));let l={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:r.toString()};if(r.protocol==="file:")if(Ci)l.file=Ci(r);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(o.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};var Ce=le;le.default=le;Ie&&Ie.registerInput&&Ie.registerInput(le);let $n=K,Qn,Kn,ot=class extends $n{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let i=super.normalize(e);if(t){if(s==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let s=this.index(e);return!t&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new Qn(new Kn,this,e).stringify()}};ot.registerLazyResult=e=>{Qn=e};ot.registerProcessor=e=>{Kn=e};var It=ot;ot.default=ot;$n.registerRoot(ot);let Tt={comma(e){return Tt.split(e,[","],!0)},space(e){let t=[" ",`
|
|
55
|
+
`," "];return Tt.split(e,t)},split(e,t,s){let i=[],n="",o=!1,a=0,r=!1,l="",u=!1;for(let h of e)u?u=!1:h==="\\"?u=!0:r?h===l&&(r=!1):h==='"'||h==="'"?(r=!0,l=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&t.includes(h)&&(o=!0),o?(n!==""&&i.push(n.trim()),n="",o=!1):n+=h;return(s||n!=="")&&i.push(n.trim()),i}};var qn=Tt;Tt.default=Tt;let tr=K,Dl=qn,ue=class extends tr{get selectors(){return Dl.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};var Is=ue;ue.default=ue;tr.registerRule(ue);let Rl=Os,Ol=Se,Al=xe,Il=Ce,Pl=Jn,Ll=It,Fl=Is;function kt(e,t){if(Array.isArray(e))return e.map(n=>kt(n));let{inputs:s,...i}=e;if(s){t=[];for(let n of s){let o={...n,__proto__:Il.prototype};o.map&&(o.map={...o.map,__proto__:Pl.prototype}),t.push(o)}}if(i.nodes&&(i.nodes=e.nodes.map(n=>kt(n,t))),i.source){let{inputId:n,...o}=i.source;i.source=o,n!=null&&(i.source.input=t[n])}if(i.type==="root")return new Ll(i);if(i.type==="decl")return new Al(i);if(i.type==="rule")return new Fl(i);if(i.type==="comment")return new Ol(i);if(i.type==="atrule")return new Rl(i);throw new Error("Unknown node type: "+e.type)}var _l=kt;kt.default=kt;let{dirname:te,relative:er,resolve:sr,sep:ir}=V,{SourceMapConsumer:nr,SourceMapGenerator:ee}=V,{pathToFileURL:Ni}=V,Bl=Ce,Ul=!!(nr&&ee),Wl=!!(te&&sr&&er&&ir),jl=class{constructor(e,t,s,i){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
56
56
|
`;this.css.includes(`\r
|
|
57
|
-
`)&&(
|
|
58
|
-
`),this.css+=
|
|
59
|
-
`),e=a.length-i):e+=a.length,n&&u!=="start"){let l=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==l.last||l.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?et(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=et(rn(s,this.mapOpts.annotation)));let r=sn(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Wl(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(kr){let s=kr(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;nn==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var an=zl;const Lt=39,Dr=34,Ge=92,Rr=47,Ze=10,ge=32,Xe=12,He=9,Je=13,Yl=91,Gl=93,Zl=40,Xl=41,Hl=123,Jl=125,$l=59,Ql=42,Kl=58,ql=64,$e=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qe=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,eu=/.[\r\n"'(/\\]/,Or=/[\da-f]/i;var tu=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,u,l,h,c,p,m,v=s.length,d=0,S=[],f=[];function w(){return d}function g(L){throw t.error("Unclosed "+L,d)}function E(){return f.length===0&&d>=v}function I(L){if(f.length)return f.pop();if(d>=v)return;let W=L?L.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Ze:case ge:case He:case Je:case Xe:{n=d;do n+=1,i=s.charCodeAt(n);while(i===ge||i===Ze||i===He||i===Je||i===Xe);l=["space",s.slice(d,n)],d=n-1;break}case Yl:case Gl:case Hl:case Jl:case Kl:case $l:case Xl:{let K=String.fromCharCode(i);l=[K,K,d];break}case Zl:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Lt&&p!==Dr&&p!==ge&&p!==Ze&&p!==He&&p!==Xe&&p!==Je){n=d;do{if(h=!1,n=s.indexOf(")",n+1),n===-1)if(r||W){n=d;break}else g("bracket");for(c=n;s.charCodeAt(c-1)===Ge;)c-=1,h=!h}while(h);l=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||eu.test(o)?l=["(","(",d]:(l=["brackets",o,d,n],d=n);break}case Lt:case Dr:{u=i===Lt?"'":'"',n=d;do{if(h=!1,n=s.indexOf(u,n+1),n===-1)if(r||W){n=d+1;break}else g("string");for(c=n;s.charCodeAt(c-1)===Ge;)c-=1,h=!h}while(h);l=["string",s.slice(d,n+1),d,n],d=n;break}case ql:{$e.lastIndex=d+1,$e.test(s),$e.lastIndex===0?n=s.length-1:n=$e.lastIndex-2,l=["at-word",s.slice(d,n+1),d,n],d=n;break}case Ge:{for(n=d,a=!0;s.charCodeAt(n+1)===Ge;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==Rr&&i!==ge&&i!==Ze&&i!==He&&i!==Je&&i!==Xe&&(n+=1,Or.test(s.charAt(n)))){for(;Or.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===ge&&(n+=1)}l=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===Rr&&s.charCodeAt(d+1)===Ql?(n=s.indexOf("*/",d+2)+1,n===0&&(r||W?n=s.length:g("comment")),l=["comment",s.slice(d,n+1),d,n],d=n):(Qe.lastIndex=d+1,Qe.test(s),Qe.lastIndex===0?n=s.length-1:n=Qe.lastIndex-2,l=["word",s.slice(d,n+1),d,n],S.push(l),d=n);break}}return d++,l}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:I,position:w}};let su=Os,ru=St,iu=xt,nu=Ie,Ar=Is,ou=tu;const Ir={empty:!0,space:!0};function au(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let lu=class{constructor(t){this.input=t,this.root=new nu,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new su;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?u.push(s==="("?")":"]"):s==="{"&&u.length>0?u.push("}"):s===u[u.length-1]&&u.pop(),u.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new ru;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=ou(this.input)}decl(t,e){let s=new iu;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||au(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let u=this.stringFrom(t,n);u=this.spacesFromEnd(t)+u,u!==" !important"&&(s.raws.important=u);break}else if(i[1].toLowerCase()==="important"){let u=t.slice(0),l="";for(let h=n;h>0;h--){let c=u[h][0];if(l.trim().startsWith("!")&&c!=="space")break;l=u.pop()[1]+l}l.trim().startsWith("!")&&(s.important=!0,s.raws.important=l,t=u)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new Ar;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],u=t;for(;u;){if(s=u[0],n.push(u),s==="("||s==="[")i||(i=u),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=u),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(u=n[n.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",u=!0,l,h;for(let c=0;c<a;c+=1)i=s[c],o=i[0],o==="space"&&c===a-1&&!r?u=!1:o==="comment"?(h=s[c-1]?s[c-1][0]:"empty",l=s[c+1]?s[c+1][0]:"empty",!Ir[h]&&!Ir[l]?n.slice(-1)===","?u=!1:n+=i[1]:u=!1):n+=i[1];if(!u){let c=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:c,value:n}}t[e]=n}rule(t){t.pop();let e=new Ar;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var uu=lu;let hu=ee,cu=Ct,pu=uu;function ht(t,e){let s=new cu(t,e),r=new pu(s);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
|
|
60
|
-
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(
|
|
61
|
-
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(
|
|
62
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ps=ht;ht.default=ht;hu.registerParse(ht);let hs=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[s]}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 ln=hs;hs.default=hs;let du=ln,cs=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new du(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ls=cs;cs.default=cs;let Pr={};var un=function(t){Pr[t]||(Pr[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let fu=ee,mu=As,gu=an,yu=Ps,Lr=Ls,wu=Ie,bu=bt,{isClean:Y,my:vu}=Ae,Su=un;const xu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Cu={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},Eu={Once:!0,postcssPlugin:!0,prepare:!0},ue=0;function ye(t){return typeof t=="object"&&typeof t.then=="function"}function hn(t){let e=!1,s=xu[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,ue,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,ue,s+"Exit"]:[s,s+"Exit"]}function Fr(t){let e;return t.type==="document"?e=["Document",ue,"DocumentExit"]:t.type==="root"?e=["Root",ue,"RootExit"]:e=hn(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function ps(t){return t[Y]=!1,t.nodes&&t.nodes.forEach(e=>ps(e)),t}let ds={},he=class cn{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=ps(s);else if(s instanceof cn||s instanceof Lr)i=ps(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=yu;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[vu]&&fu.rebuild(i)}this.result=new Lr(e,i,r),this.helpers={...ds,postcss:ds,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...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,s){let r=this.result.lastPlugin;try{if(s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,a=this.result.processor.version,n=o.split("."),u=a.split(".");(n[0]!==u[0]||parseInt(n[1])>parseInt(u[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!Cu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Eu[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(ye(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Y];){e[Y]=!0;let s=[Fr(e)];for(;s.length>0;){let r=this.visitTick(s);if(ye(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}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 s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ye(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=bu;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new gu(s,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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 s=this.runOnRoot(e);if(ye(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Y];)e[Y]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Su("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ye(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(u){throw this.handleError(u,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[Y]){n[Y]=!0,e.push(Fr(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===ue){r.nodes&&r.nodes.length&&(r[Y]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[Y]=!0;let s=hn(e);for(let r of s)if(r===ue)e.nodes&&e.each(i=>{i[Y]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};he.registerPostcss=t=>{ds=t};var pn=he;he.default=he;wu.registerLazyResult(he);mu.registerLazyResult(he);let Mu=an,Nu=Ps;const Tu=Ls;let ku=bt,Du=un,fs=class{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 t,e=Nu;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=ku;this.result=new Tu(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Mu(i,r,this._opts,e);if(a.isMap()){let[n,u]=a.generate();n&&(this.result.css=n),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(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Du("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,e)}toString(){return this._css}warnings(){return[]}};var Ru=fs;fs.default=fs;let Ou=As,Au=pn,Iu=Ru,Pu=Ie,De=class{constructor(t=[]){this.version="8.5.6",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Iu(this,t,e):new Au(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Lu=De;De.default=De;Pu.registerProcessor(De);Ou.registerProcessor(De);let dn=Os,fn=St,Fu=ee,_u=ks,mn=xt,gn=As,Bu=Ul,Uu=Ct,Wu=pn,ju=en,Vu=vt,zu=Ps,Fs=Lu,Yu=Ls,yn=Ie,wn=Is,Gu=bt,Zu=ln;function D(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Fs(t)}D.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
63
|
-
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(
|
|
64
|
-
https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Fs().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return D([r(n)]).process(o,a)},r};D.stringify=Gu;D.parse=zu;D.fromJSON=Bu;D.list=ju;D.comment=t=>new fn(t);D.atRule=t=>new dn(t);D.decl=t=>new mn(t);D.rule=t=>new wn(t);D.root=t=>new yn(t);D.document=t=>new gn(t);D.CssSyntaxError=_u;D.Declaration=mn;D.Container=Fu;D.Processor=Fs;D.Document=gn;D.Comment=fn;D.Warning=Zu;D.AtRule=dn;D.Result=Yu;D.Input=Uu;D.Rule=wn;D.Root=yn;D.Node=Vu;Wu.registerPostcss(D);var Xu=D;D.default=D;const A=il(Xu);A.stringify;A.fromJSON;A.plugin;A.parse;A.list;A.document;A.comment;A.atRule;A.rule;A.decl;A.root;A.CssSyntaxError;A.Declaration;A.Container;A.Processor;A.Document;A.Comment;A.Warning;A.AtRule;A.Result;A.Input;A.Rule;A.Root;A.Node;function Hu(t){const e={},s=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return t.replace(i,"").split(s).forEach(function(o){if(o){const a=o.split(r);a.length>1&&(e[ms(a[0].trim())]=a[1].trim())}}),e}function _r(t){const e=[];for(const s in t){const r=t[s];if(typeof r!="string")continue;const i=Ku(s);e.push(`${i}: ${r};`)}return e.join(" ")}const Ju=/-([a-z])/g,$u=/^--[a-zA-Z0-9-]+$/,ms=t=>$u.test(t)?t:t.replace(Ju,(e,s)=>s?s.toUpperCase():""),Qu=/\B([A-Z])/g,Ku=t=>t.replace(Qu,"-$1").toLowerCase();class Q{constructor(...e){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType")}get childNodes(){const e=[];let s=this.firstChild;for(;s;)e.push(s),s=s.nextSibling;return e}contains(e){if(e instanceof Q){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,s){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 _s extends Q{constructor(...e){super(e),y(this,"nodeType",9),y(this,"nodeName","#document"),y(this,"compatMode","CSS1Compat"),y(this,"RRNodeType",M.Document),y(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===M.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const s=e.RRNodeType;if((s===M.Element||s===M.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${s===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Us(this,e);return r.parentElement=null,r}insertBefore(e,s){const r=e.RRNodeType;if((r===M.Element||r===M.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Cn(this,e,s);return i.parentElement=null,i}removeChild(e){return En(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let s;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?s="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(s="-//W3C//DTD HTML 4.0 Transitional//EN"),s){const r=this.createDocumentType("html",s,"");this.open(),this.appendChild(r)}}createDocument(e,s,r){return new _s}createDocumentType(e,s,r){const i=new bn(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=new Bs(e);return s.ownerDocument=this,s}createElementNS(e,s){return this.createElement(s)}createTextNode(e){const s=new vn(e);return s.ownerDocument=this,s}createComment(e){const s=new Sn(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new xn(e);return s.ownerDocument=this,s}toString(){return"RRDocument"}}class bn extends Q{constructor(e,s,r){super(),y(this,"nodeType",10),y(this,"RRNodeType",M.DocumentType),y(this,"name"),y(this,"publicId"),y(this,"systemId"),y(this,"textContent",null),this.name=e,this.publicId=s,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class Bs extends Q{constructor(e){super(),y(this,"nodeType",1),y(this,"RRNodeType",M.Element),y(this,"tagName"),y(this,"attributes",{}),y(this,"shadowRoot",null),y(this,"scrollLeft"),y(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(s=>e+=s.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new eh(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?Hu(this.attributes.style):{},s=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(s.test(r))return;const a=ms(r);i?e[a]=i:delete e[a],o==="important"&&(e[a]+=" !important"),this.attributes.style=_r(e)},e.removeProperty=r=>{if(s.test(r))return"";const i=ms(r),o=e[i]||"";return delete e[i],this.attributes.style=_r(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,s){this.attributes[e]=s}setAttributeNS(e,s,r){this.setAttribute(s,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Us(this,e)}insertBefore(e,s){return Cn(this,e,s)}removeChild(e){return En(this,e)}attachShadow(e){const s=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=s,s}dispatchEvent(e){return!0}toString(){let e="";for(const s in this.attributes)e+=`${s}="${this.attributes[s]}" `;return`${this.tagName} ${e}`}}class qu extends Bs{constructor(){super(...arguments),y(this,"currentTime"),y(this,"volume"),y(this,"paused"),y(this,"muted"),y(this,"playbackRate"),y(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 vn extends Q{constructor(e){super(),y(this,"nodeType",3),y(this,"nodeName","#text"),y(this,"RRNodeType",M.Text),y(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 Sn extends Q{constructor(e){super(),y(this,"nodeType",8),y(this,"nodeName","#comment"),y(this,"RRNodeType",M.Comment),y(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 xn extends Q{constructor(e){super(),y(this,"nodeName","#cdata-section"),y(this,"nodeType",4),y(this,"RRNodeType",M.CDATA),y(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 eh{constructor(e,s){if(y(this,"onChange"),y(this,"classes",[]),y(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),y(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=s}}function Us(t,e){return e.parentNode&&e.parentNode.removeChild(e),t.lastChild?(t.lastChild.nextSibling=e,e.previousSibling=t.lastChild):(t.firstChild=e,e.previousSibling=null),t.lastChild=e,e.nextSibling=null,e.parentNode=t,e.parentElement=t,e.ownerDocument=t.ownerDocument,e}function Cn(t,e,s){if(!s)return Us(t,e);if(s.parentNode!==t)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===s||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=s.previousSibling,s.previousSibling=e,e.nextSibling=s,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,e.parentElement=t,e.parentNode=t,e.ownerDocument=t.ownerDocument),e}function En(t,e){if(e.parentNode!==t)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:t.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:t.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var U=(t=>(t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t))(U||{});const gs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},th={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let G=null;function ct(t,e,s,r=e.mirror||e.ownerDocument.mirror){t=sh(t,e,s,r),Mn(t,e,s,r),rh(t,e,s)}function sh(t,e,s,r){var i;if(s.afterAppend&&!G&&(G=new WeakSet,setTimeout(()=>{G=null},0)),!Ws(t,e)){const o=pt(e,s.mirror,r);(i=t.parentNode)==null||i.replaceChild(o,t),t=o}switch(e.RRNodeType){case M.Document:{if(!se(t,e,s.mirror,r)){const o=r.getMeta(e);o&&(s.mirror.removeNodeFromMap(t),t.close(),t.open(),s.mirror.add(t,o),G==null||G.add(t))}break}case M.Element:{const o=t,a=e;switch(a.tagName){case"IFRAME":{const n=t.contentDocument;if(!n)break;ct(n,e.contentDocument,s,r);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Mn(o.shadowRoot,a.shadowRoot,s,r)),ih(o,a,r);break}}return t}function rh(t,e,s){var r;switch(e.RRNodeType){case M.Document:{const i=e.scrollData;i&&s.applyScroll(i,!0);break}case M.Element:{const i=t,o=e;switch(o.scrollData&&s.applyScroll(o.scrollData,!0),o.inputData&&s.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=t,n=o;n.paused!==void 0&&(n.paused?a.pause():a.play()),n.muted!==void 0&&(a.muted=n.muted),n.volume!==void 0&&(a.volume=n.volume),n.currentTime!==void 0&&(a.currentTime=n.currentTime),n.playbackRate!==void 0&&(a.playbackRate=n.playbackRate),n.loop!==void 0&&(a.loop=n.loop);break}case"CANVAS":{const a=e;if(a.rr_dataURL!==null){const n=document.createElement("img");n.onload=()=>{const u=i.getContext("2d");u&&u.drawImage(n,0,0,n.width,n.height)},n.src=a.rr_dataURL}a.canvasMutations.forEach(n=>s.applyCanvas(n.event,n.mutation,t));break}case"STYLE":{const a=i.sheet;a&&e.rules.forEach(n=>s.applyStyleSheetMutation(n,a));break}}break}case M.Text:case M.Comment:case M.CDATA:{t.textContent!==e.data&&(t.textContent=e.data);break}}G!=null&&G.has(t)&&(G.delete(t),(r=s.afterAppend)==null||r.call(s,t,s.mirror.getId(t)))}function ih(t,e,s){const r=t.attributes,i=e.attributes;for(const o in i){const a=i[o],n=s.getMeta(e);if(n!=null&&n.isSVG&&gs[o])t.setAttributeNS(gs[o],o,a);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const u=document.createElement("img");u.src=a,u.onload=()=>{const l=t.getContext("2d");l&&l.drawImage(u,0,0,u.width,u.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;t.setAttribute(o,a)}}for(const{name:o}of Array.from(r))o in i||t.removeAttribute(o);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Mn(t,e,s,r){const i=Array.from(t.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let a=0,n=i.length-1,u=0,l=o.length-1,h=i[a],c=i[n],p=o[u],m=o[l],v,d;for(;a<=n&&u<=l;)if(h===void 0)h=i[++a];else if(c===void 0)c=i[--n];else if(se(h,p,s.mirror,r))h=i[++a],p=o[++u];else if(se(c,m,s.mirror,r))c=i[--n],m=o[--l];else if(se(h,m,s.mirror,r)){try{t.insertBefore(h,c.nextSibling)}catch(w){console.warn(w)}h=i[++a],m=o[--l]}else if(se(c,p,s.mirror,r)){try{t.insertBefore(c,h)}catch(w){console.warn(w)}c=i[--n],p=o[++u]}else{if(!v){v={};for(let g=a;g<=n;g++){const E=i[g];E&&s.mirror.hasNode(E)&&(v[s.mirror.getId(E)]=g)}}d=v[r.getId(p)];const w=i[d];if(d!==void 0&&w&&se(w,p,s.mirror,r)){try{t.insertBefore(w,h)}catch(g){console.warn(g)}i[d]=void 0}else{const g=pt(p,s.mirror,r);t.nodeName==="#document"&&h&&(g.nodeType===g.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||g.nodeType===g.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(t.removeChild(h),s.mirror.removeNodeFromMap(h),h=i[++a]);try{t.insertBefore(g,h||null)}catch(E){console.warn(E)}}p=o[++u]}if(a>n){const w=o[l+1];let g=null;for(w&&(g=s.mirror.getNode(r.getId(w)));u<=l;++u){const E=pt(o[u],s.mirror,r);try{t.insertBefore(E,g)}catch(I){console.warn(I)}}}else if(u>l)for(;a<=n;a++){const w=i[a];if(!(!w||w.parentNode!==t))try{t.removeChild(w),s.mirror.removeNodeFromMap(w)}catch(g){console.warn(g)}}let S=t.firstChild,f=e.firstChild;for(;S!==null&&f!==null;)ct(S,f,s,r),S=S.nextSibling,f=f.nextSibling}function pt(t,e,s){const r=s.getId(t),i=s.getMeta(t);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&Ws(o,t))return o;switch(t.RRNodeType){case M.Document:o=new Document;break;case M.DocumentType:o=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case M.Element:{let a=t.tagName.toLowerCase();a=th[a]||a,i&&"isSVG"in i&&i!=null&&i.isSVG?o=document.createElementNS(gs.svg,a):o=document.createElement(t.tagName);break}case M.Text:o=document.createTextNode(t.data);break;case M.Comment:o=document.createComment(t.data);break;case M.CDATA:o=document.createCDATASection(t.data);break}i&&e.add(o,{...i});try{G==null||G.add(o)}catch{}return o}function Ws(t,e){return t.nodeType!==e.nodeType?!1:t.nodeType!==t.ELEMENT_NODE||t.tagName.toUpperCase()===e.tagName}function se(t,e,s,r){const i=s.getId(t),o=r.getId(e);return i===-1||i!==o?!1:Ws(t,e)}class ce extends _s{constructor(e){super(),y(this,"UNSERIALIZED_STARTING_ID",-2),y(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),y(this,"mirror",mh()),y(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,s,r){return new ce}createDocumentType(e,s,r){const i=new nh(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=e.toUpperCase();let r;switch(s){case"AUDIO":case"VIDEO":r=new oh(s);break;case"IFRAME":r=new uh(s,this.mirror);break;case"CANVAS":r=new ah(s);break;case"STYLE":r=new lh(s);break;default:r=new Et(s);break}return r.ownerDocument=this,r}createComment(e){const s=new ch(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new ph(e);return s.ownerDocument=this,s}createTextNode(e){const s=new hh(e);return s.ownerDocument=this,s}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const nh=bn;class Et extends Bs{constructor(){super(...arguments),y(this,"inputData",null),y(this,"scrollData",null)}}class oh extends qu{}class ah extends Et{constructor(){super(...arguments),y(this,"rr_dataURL",null),y(this,"canvasMutations",[])}getContext(){return null}}class lh extends Et{constructor(){super(...arguments),y(this,"rules",[])}}class uh extends Et{constructor(e,s){super(e),y(this,"contentDocument",new ce),this.contentDocument.mirror=s}}const hh=vn,ch=Sn,ph=xn;function dh(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Nn(t,e,s,r){let i;switch(t.nodeType){case U.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=t.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const a=t;i=e.createDocumentType(a.name,a.publicId,a.systemId);break}case U.ELEMENT_NODE:{const a=t,n=dh(a);i=e.createElement(n);const u=i;for(const{name:l,value:h}of Array.from(a.attributes))u.attributes[l]=h;a.scrollLeft&&(u.scrollLeft=a.scrollLeft),a.scrollTop&&(u.scrollTop=a.scrollTop);break}case U.TEXT_NODE:i=e.createTextNode(t.textContent||"");break;case U.CDATA_SECTION_NODE:i=e.createCDATASection(t.data);break;case U.COMMENT_NODE:i=e.createComment(t.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=s.getMeta(t);return e instanceof ce&&(o||(o=Tn(i,e.unserializedId),s.add(t,o)),e.mirror.add(i,{...o})),i}function fh(t,e=rl(),s=new ce){function r(i,o){const a=Nn(i,s,e,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){const n=i.contentDocument;n&&r(n,a)}else(i.nodeType===U.DOCUMENT_NODE||i.nodeType===U.ELEMENT_NODE||i.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===U.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(n=>r(n,a)))}return r(t,null),s}function mh(){return new gh}class gh{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap)}getId(e){var s;return e?((s=this.getMeta(e))==null?void 0:s.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Tn(t,e){switch(t.RRNodeType){case M.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case M.DocumentType:{const s=t;return{id:e,type:t.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case M.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case M.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function kn(t){return{all:t=t||new Map,on:function(e,s){var r=t.get(e);r?r.push(s):t.set(e,[s])},off:function(e,s){var r=t.get(e);r&&(s?r.splice(r.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var r=t.get(e);r&&r.slice().map(function(i){i(s)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,s)})}}}const yh=Object.freeze(Object.defineProperty({__proto__:null,default:kn},Symbol.toStringTag,{value:"Module"})),Br=new Map;function Dn(t,e){let s=Br.get(t);return s||(s=new Map,Br.set(t,s)),s.has(e)||s.set(e,[]),s.get(e)}function $(t,e,s){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(s&&(s.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await $(t,e,s)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(s||e===null)return r;const{rr_type:i,index:o}=r;return Dn(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,a=window[i];return new a(...await Promise.all(o.map($(t,e,s))))}else{if("base64"in r)return Qa(r.base64);if("src"in r){const i=t.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,t.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map($(t,e,s)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map($(t,e,s)));return r}}async function wh({event:t,mutations:e,target:s,imageMap:r,errorHandler:i}){const o=s.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const a=e.map(async n=>Promise.all(n.args.map($(r,o))));(await Promise.all(a)).forEach((n,u)=>{const l=e[u];try{if(l.setter){o[l.property]=l.args[0];return}const h=o[l.property];l.property==="drawImage"&&typeof l.args[0]=="string"?(r.get(t),h.apply(o,l.args)):h.apply(o,n)}catch(h){i(l,h)}})}function bh(t,e){try{return e===ot.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const vh=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Sh(t,e){if(!(e!=null&&e.constructor))return;const{name:s}=e.constructor;if(!vh.includes(s))return;const r=Dn(t,s);r.includes(e)||r.push(e)}async function xh({mutation:t,target:e,type:s,imageMap:r,errorHandler:i}){try{const o=bh(e,s);if(!o)return;if(t.setter){o[t.property]=t.args[0];return}const a=o[t.property],n=await Promise.all(t.args.map($(r,o))),u=a.apply(o,n);Sh(o,u);const l=!1}catch(o){i(t,o)}}async function Ur({event:t,mutation:e,target:s,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const a=i.get(t)||e,n="commands"in a?a.commands:[a];if([ot.WebGL,ot.WebGL2].includes(e.type)){for(let u=0;u<n.length;u++){const l=n[u];await xh({mutation:l,type:e.type,target:s,imageMap:r,errorHandler:o})}return}await wh({event:t,mutations:n,target:s,imageMap:r,errorHandler:o})}catch(a){o(e,a)}}/*! *****************************************************************************
|
|
57
|
+
`)&&(t=`\r
|
|
58
|
+
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),s=e.root||te(e.file),i;this.mapOpts.sourcesContent===!1?(i=new nr(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(s)))}}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.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Wl&&Ul&&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,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(a,r,l)=>{if(this.css+=a,r&&l!=="end"&&(i.generated.line=e,i.generated.column=t-1,r.source&&r.source.start?(i.source=this.sourcePath(r),i.original.line=r.source.start.line,i.original.column=r.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(e+=o.length,n=a.lastIndexOf(`
|
|
59
|
+
`),t=a.length-n):t+=a.length,r&&l!=="start"){let u=r.parent||{raws:{}};(!(r.type==="decl"||r.type==="atrule"&&!r.nodes)||r!==u.last||u.raws.semicolon)&&(r.source&&r.source.end?(i.source=this.sourcePath(r),i.original.line=r.source.end.line,i.original.column=r.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?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 s=this.opts.to?te(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=te(sr(s,this.mapOpts.annotation)));let i=er(s,e);return this.memoizedPaths.set(e,i),i}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 Bl(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let i=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(i,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(Ni){let s=Ni(e).toString();return this.memoizedFileURLs.set(e,s),s}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;ir==="\\"&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};var rr=jl;const Le=39,Ti=34,Gt=92,ki=47,Zt=10,gt=32,Xt=12,Ht=9,Jt=13,Vl=91,zl=93,Yl=40,Gl=41,Zl=123,Xl=125,Hl=59,Jl=42,$l=58,Ql=64,$t=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Kl=/.[\r\n"'(/\\]/,Di=/[\da-f]/i;var ql=function(e,t={}){let s=e.css.valueOf(),i=t.ignoreErrors,n,o,a,r,l,u,h,c,d,m,b=s.length,p=0,S=[],f=[];function w(){return p}function g(L){throw e.error("Unclosed "+L,p)}function E(){return f.length===0&&p>=b}function P(L){if(f.length)return f.pop();if(p>=b)return;let W=L?L.ignoreUnclosed:!1;switch(n=s.charCodeAt(p),n){case Zt:case gt:case Ht:case Jt:case Xt:{r=p;do r+=1,n=s.charCodeAt(r);while(n===gt||n===Zt||n===Ht||n===Jt||n===Xt);u=["space",s.slice(p,r)],p=r-1;break}case Vl:case zl:case Zl:case Xl:case $l:case Hl:case Gl:{let $=String.fromCharCode(n);u=[$,$,p];break}case Yl:{if(m=S.length?S.pop()[1]:"",d=s.charCodeAt(p+1),m==="url"&&d!==Le&&d!==Ti&&d!==gt&&d!==Zt&&d!==Ht&&d!==Xt&&d!==Jt){r=p;do{if(h=!1,r=s.indexOf(")",r+1),r===-1)if(i||W){r=p;break}else g("bracket");for(c=r;s.charCodeAt(c-1)===Gt;)c-=1,h=!h}while(h);u=["brackets",s.slice(p,r+1),p,r],p=r}else r=s.indexOf(")",p+1),o=s.slice(p,r+1),r===-1||Kl.test(o)?u=["(","(",p]:(u=["brackets",o,p,r],p=r);break}case Le:case Ti:{l=n===Le?"'":'"',r=p;do{if(h=!1,r=s.indexOf(l,r+1),r===-1)if(i||W){r=p+1;break}else g("string");for(c=r;s.charCodeAt(c-1)===Gt;)c-=1,h=!h}while(h);u=["string",s.slice(p,r+1),p,r],p=r;break}case Ql:{$t.lastIndex=p+1,$t.test(s),$t.lastIndex===0?r=s.length-1:r=$t.lastIndex-2,u=["at-word",s.slice(p,r+1),p,r],p=r;break}case Gt:{for(r=p,a=!0;s.charCodeAt(r+1)===Gt;)r+=1,a=!a;if(n=s.charCodeAt(r+1),a&&n!==ki&&n!==gt&&n!==Zt&&n!==Ht&&n!==Jt&&n!==Xt&&(r+=1,Di.test(s.charAt(r)))){for(;Di.test(s.charAt(r+1));)r+=1;s.charCodeAt(r+1)===gt&&(r+=1)}u=["word",s.slice(p,r+1),p,r],p=r;break}default:{n===ki&&s.charCodeAt(p+1)===Jl?(r=s.indexOf("*/",p+2)+1,r===0&&(i||W?r=s.length:g("comment")),u=["comment",s.slice(p,r+1),p,r],p=r):(Qt.lastIndex=p+1,Qt.test(s),Qt.lastIndex===0?r=s.length-1:r=Qt.lastIndex-2,u=["word",s.slice(p,r+1),p,r],S.push(u),p=r);break}}return p++,u}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:P,position:w}};let tu=Os,eu=Se,su=xe,iu=It,Ri=Is,nu=ql;const Oi={empty:!0,space:!0};function ru(e){for(let t=e.length-1;t>=0;t--){let s=e[t],i=s[3]||s[2];if(i)return i}}let ou=class{constructor(e){this.input=e,this.root=new iu,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 tu;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let s,i,n,o=!1,a=!1,r=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),s=e[0],s==="("||s==="["?l.push(s==="("?")":"]"):s==="{"&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),l.length===0)if(s===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(r.length>0){for(n=r.length-1,i=r[n];i&&i[0]==="space";)i=r[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else r.push(e);else r.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(r),r.length?(t.raws.afterName=this.spacesAndCommentsFromStart(r),this.raw(t,"params",r),o&&(e=r[r.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 s=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(s+=1,s===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,s,i,n;for(let[o,a]of e.entries()){if(i=a,n=i[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=i}return!1}comment(e){let t=new eu;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let i=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=nu(this.input)}decl(e,t){let s=new su;this.init(s,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(i[3]||i[2]||ru(e)),s.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let r=e[0][0];if(r===":"||r==="space"||r==="comment")break;s.prop+=e.shift()[1]}s.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){s.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),s.raws.between+=n[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let r=e.length-1;r>=0;r--){if(n=e[r],n[1].toLowerCase()==="!important"){s.important=!0;let l=this.stringFrom(e,r);l=this.spacesFromEnd(e)+l,l!==" !important"&&(s.raws.important=l);break}else if(n[1].toLowerCase()==="important"){let l=e.slice(0),u="";for(let h=r;h>0;h--){let c=l[h][0];if(u.trim().startsWith("!")&&c!=="space")break;u=l.pop()[1]+u}u.trim().startsWith("!")&&(s.important=!0,s.raws.important=u,e=l)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(r=>r[0]!=="space"&&r[0]!=="comment")&&(s.raws.between+=o.map(r=>r[1]).join(""),o=[]),this.raw(s,"value",o.concat(e),t),s.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 Ri;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="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=!1,n=null,o=[],a=e[1].startsWith("--"),r=[],l=e;for(;l;){if(s=l[0],r.push(l),s==="("||s==="[")n||(n=l),o.push(s==="("?")":"]");else if(a&&i&&s==="{")n||(n=l),o.push("}");else if(o.length===0)if(s===";")if(i){this.decl(r,a);return}else break;else if(s==="{"){this.rule(r);return}else if(s==="}"){this.tokenizer.back(r.pop()),t=!0;break}else s===":"&&(i=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!a)for(;r.length&&(l=r[r.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(r.pop());this.decl(r,a)}else this.unknownWord(r)}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,s,i){let n,o,a=s.length,r="",l=!0,u,h;for(let c=0;c<a;c+=1)n=s[c],o=n[0],o==="space"&&c===a-1&&!i?l=!1:o==="comment"?(h=s[c-1]?s[c-1][0]:"empty",u=s[c+1]?s[c+1][0]:"empty",!Oi[h]&&!Oi[u]?r.slice(-1)===","?l=!1:r+=n[1]:l=!1):r+=n[1];if(!l){let c=s.reduce((d,m)=>d+m[1],"");e.raws[t]={raw:c,value:r}}e[t]=r}rule(e){e.pop();let t=new Ri;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],t==="space");)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let i=t;i<e.length;i++)s+=e[i][1];return e.splice(t,e.length-t),s}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 "+e[0][1],{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 au=ou;let lu=K,uu=Ce,hu=au;function he(e,t){let s=new uu(e,t),i=new hu(s);try{i.parse()}catch(n){throw process.env.NODE_ENV!=="production"&&n.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?n.message+=`
|
|
60
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?n.message+=`
|
|
61
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(n.message+=`
|
|
62
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),n}return i.root}var Ps=he;he.default=he;lu.registerParse(he);let hs=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let s=t.node.rangeBy(t);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in t)this[s]=t[s]}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 or=hs;hs.default=hs;let cu=or,cs=class{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new cu(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>e.type==="warning")}};var Ls=cs;cs.default=cs;let Ai={};var ar=function(e){Ai[e]||(Ai[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let pu=K,du=As,fu=rr,mu=Ps,Ii=Ls,gu=It,yu=be,{isClean:Y,my:wu}=At,bu=ar;const vu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Su={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},xu={Once:!0,postcssPlugin:!0,prepare:!0},at=0;function yt(e){return typeof e=="object"&&typeof e.then=="function"}function lr(e){let t=!1,s=vu[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,at,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,at,s+"Exit"]:[s,s+"Exit"]}function Pi(e){let t;return e.type==="document"?t=["Document",at,"DocumentExit"]:e.type==="root"?t=["Root",at,"RootExit"]:t=lr(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ps(e){return e[Y]=!1,e.nodes&&e.nodes.forEach(t=>ps(t)),e}let ds={},lt=class ur{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"}constructor(t,s,i){this.stringified=!1,this.processed=!1;let n;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))n=ps(s);else if(s instanceof ur||s instanceof Ii)n=ps(s.root),s.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=s.map);else{let o=mu;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{n=o(s,i)}catch(a){this.processed=!0,this.error=a}n&&!n[wu]&&pu.rebuild(n)}this.result=new Ii(t,n,i),this.helpers={...ds,postcss:ds,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...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(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,s){let i=this.result.lastPlugin;try{if(s&&s.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){let n=i.postcssPlugin,o=i.postcssVersion,a=this.result.processor.version,r=o.split("."),l=a.split(".");(r[0]!==l[0]||parseInt(r[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+n+" uses "+o+". Perhaps this is the source of the error below.")}}catch(n){console&&console.error&&console.error(n)}return t}prepareVisitors(){this.listeners={};let t=(s,i,n)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([s,n])};for(let s of this.plugins)if(typeof s=="object")for(let i in s){if(!Su[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!xu[i])if(typeof s[i]=="object")for(let n in s[i])n==="*"?t(s,i,s[i][n]):t(s,i+"-"+n.toLowerCase(),s[i][n]);else typeof s[i]=="function"&&t(s,i,s[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let s=this.plugins[t],i=this.runOnRoot(s);if(yt(i))try{await i}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Y];){t[Y]=!0;let s=[Pi(t)];for(;s.length>0;){let i=this.visitTick(s);if(yt(i))try{await i}catch(n){let o=s[s.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[s,i]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(t.type==="document"){let n=t.nodes.map(o=>i(o,this.helpers));await Promise.all(n)}else await i(t,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(i=>t.Once(i,this.helpers));return yt(s[0])?Promise.all(s):s}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,s=yu;t.syntax&&(s=t.syntax.stringify),t.stringifier&&(s=t.stringifier),s.stringify&&(s=s.stringify);let i=new fu(s,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 t of this.plugins){let s=this.runOnRoot(t);if(yt(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Y];)t[Y]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let s of t.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||bu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,s)}toString(){return this.css}visitSync(t,s){for(let[i,n]of t){this.result.lastPlugin=i;let o;try{o=n(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(yt(o))throw this.getAsyncError()}}visitTick(t){let s=t[t.length-1],{node:i,visitors:n}=s;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(n.length>0&&s.visitorIndex<n.length){let[a,r]=n[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===n.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return r(i.toProxy(),this.helpers)}catch(l){throw this.handleError(l,i)}}if(s.iterator!==0){let a=s.iterator,r;for(;r=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!r[Y]){r[Y]=!0,t.push(Pi(r));return}s.iterator=0,delete i.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===at){i.nodes&&i.nodes.length&&(i[Y]=!0,s.iterator=i.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Y]=!0;let s=lr(t);for(let i of s)if(i===at)t.nodes&&t.each(n=>{n[Y]||this.walkSync(n)});else{let n=this.listeners[i];if(n&&this.visitSync(n,t.toProxy()))return}}warnings(){return this.sync().warnings()}};lt.registerPostcss=e=>{ds=e};var hr=lt;lt.default=lt;gu.registerLazyResult(lt);du.registerLazyResult(lt);let Cu=rr,Eu=Ps;const Mu=Ls;let Nu=be,Tu=ar,fs=class{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=Eu;try{e=t(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,t,s){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let i,n=Nu;this.result=new Mu(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Cu(n,i,this._opts,t);if(a.isMap()){let[r,l]=a.generate();r&&(this.result.css=r),l&&(this.result.map=l)}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 process.env.NODE_ENV!=="production"&&("from"in this._opts||Tu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}};var ku=fs;fs.default=fs;let Du=As,Ru=hr,Ou=ku,Au=It,Dt=class{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)t.push(s);else if(typeof s=="function")t.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Ou(this,e,t):new Ru(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Iu=Dt;Dt.default=Dt;Au.registerProcessor(Dt);Du.registerProcessor(Dt);let cr=Os,pr=Se,Pu=K,Lu=ks,dr=xe,fr=As,Fu=_l,_u=Ce,Bu=hr,Uu=qn,Wu=ve,ju=Ps,Fs=Iu,Vu=Ls,mr=It,gr=Is,zu=be,Yu=or;function D(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Fs(e)}D.plugin=function(e,t){let s=!1;function i(...o){console&&console.warn&&!s&&(s=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
63
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
64
|
+
https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new Fs().version,a}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,a,r){return D([i(r)]).process(o,a)},i};D.stringify=zu;D.parse=ju;D.fromJSON=Fu;D.list=Uu;D.comment=e=>new pr(e);D.atRule=e=>new cr(e);D.decl=e=>new dr(e);D.rule=e=>new gr(e);D.root=e=>new mr(e);D.document=e=>new fr(e);D.CssSyntaxError=Lu;D.Declaration=dr;D.Container=Pu;D.Processor=Fs;D.Document=fr;D.Comment=pr;D.Warning=Yu;D.AtRule=cr;D.Result=Vu;D.Input=_u;D.Rule=gr;D.Root=mr;D.Node=Wu;Bu.registerPostcss(D);var Gu=D;D.default=D;const I=sl(Gu);I.stringify;I.fromJSON;I.plugin;I.parse;I.list;I.document;I.comment;I.atRule;I.rule;I.decl;I.root;I.CssSyntaxError;I.Declaration;I.Container;I.Processor;I.Document;I.Comment;I.Warning;I.AtRule;I.Result;I.Input;I.Rule;I.Root;I.Node;function Zu(e){const t={},s=/;(?![^(]*\))/g,i=/:(.+)/,n=/\/\*.*?\*\//g;return e.replace(n,"").split(s).forEach(function(o){if(o){const a=o.split(i);a.length>1&&(t[ms(a[0].trim())]=a[1].trim())}}),t}function Li(e){const t=[];for(const s in e){const i=e[s];if(typeof i!="string")continue;const n=$u(s);t.push(`${n}: ${i};`)}return t.join(" ")}const Xu=/-([a-z])/g,Hu=/^--[a-zA-Z0-9-]+$/,ms=e=>Hu.test(e)?e:e.replace(Xu,(t,s)=>s?s.toUpperCase():""),Ju=/\B([A-Z])/g,$u=e=>e.replace(Ju,"-$1").toLowerCase();class J{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType")}get childNodes(){const t=[];let s=this.firstChild;for(;s;)t.push(s),s=s.nextSibling;return t}contains(t){if(t instanceof J){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,s){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class _s extends J{constructor(...t){super(t),y(this,"nodeType",9),y(this,"nodeName","#document"),y(this,"compatMode","CSS1Compat"),y(this,"RRNodeType",M.Document),y(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===M.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const s=t.RRNodeType;if((s===M.Element||s===M.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${s===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Us(this,t);return i.parentElement=null,i}insertBefore(t,s){const i=t.RRNodeType;if((i===M.Element||i===M.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=Sr(this,t,s);return n.parentElement=null,n}removeChild(t){return xr(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let s;if(t==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?s="-//W3C//DTD XHTML 1.0 Transitional//EN":t==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(s="-//W3C//DTD HTML 4.0 Transitional//EN"),s){const i=this.createDocumentType("html",s,"");this.open(),this.appendChild(i)}}createDocument(t,s,i){return new _s}createDocumentType(t,s,i){const n=new yr(t,s,i);return n.ownerDocument=this,n}createElement(t){const s=new Bs(t);return s.ownerDocument=this,s}createElementNS(t,s){return this.createElement(s)}createTextNode(t){const s=new wr(t);return s.ownerDocument=this,s}createComment(t){const s=new br(t);return s.ownerDocument=this,s}createCDATASection(t){const s=new vr(t);return s.ownerDocument=this,s}toString(){return"RRDocument"}}class yr extends J{constructor(t,s,i){super(),y(this,"nodeType",10),y(this,"RRNodeType",M.DocumentType),y(this,"name"),y(this,"publicId"),y(this,"systemId"),y(this,"textContent",null),this.name=t,this.publicId=s,this.systemId=i,this.nodeName=t}toString(){return"RRDocumentType"}}class Bs extends J{constructor(t){super(),y(this,"nodeType",1),y(this,"RRNodeType",M.Element),y(this,"tagName"),y(this,"attributes",{}),y(this,"shadowRoot",null),y(this,"scrollLeft"),y(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(s=>t+=s.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new Ku(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?Zu(this.attributes.style):{},s=/\B([A-Z])/g;return t.setProperty=(i,n,o)=>{if(s.test(i))return;const a=ms(i);n?t[a]=n:delete t[a],o==="important"&&(t[a]+=" !important"),this.attributes.style=Li(t)},t.removeProperty=i=>{if(s.test(i))return"";const n=ms(i),o=t[n]||"";return delete t[n],this.attributes.style=Li(t),o},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,s){this.attributes[t]=s}setAttributeNS(t,s,i){this.setAttribute(s,i)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Us(this,t)}insertBefore(t,s){return Sr(this,t,s)}removeChild(t){return xr(this,t)}attachShadow(t){const s=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=s,s}dispatchEvent(t){return!0}toString(){let t="";for(const s in this.attributes)t+=`${s}="${this.attributes[s]}" `;return`${this.tagName} ${t}`}}class Qu extends Bs{constructor(){super(...arguments),y(this,"currentTime"),y(this,"volume"),y(this,"paused"),y(this,"muted"),y(this,"playbackRate"),y(this,"loop")}attachShadow(t){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 wr extends J{constructor(t){super(),y(this,"nodeType",3),y(this,"nodeName","#text"),y(this,"RRNodeType",M.Text),y(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class br extends J{constructor(t){super(),y(this,"nodeType",8),y(this,"nodeName","#comment"),y(this,"RRNodeType",M.Comment),y(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class vr extends J{constructor(t){super(),y(this,"nodeName","#cdata-section"),y(this,"nodeType",4),y(this,"RRNodeType",M.CDATA),y(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Ku{constructor(t,s){if(y(this,"onChange"),y(this,"classes",[]),y(this,"add",(...i)=>{for(const n of i){const o=String(n);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),y(this,"remove",(...i)=>{this.classes=this.classes.filter(n=>i.indexOf(n)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const i=t.trim().split(/\s+/);this.classes.push(...i)}this.onChange=s}}function Us(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Sr(e,t,s){if(!s)return Us(e,t);if(s.parentNode!==e)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 t===s||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=s.previousSibling,s.previousSibling=t,t.nextSibling=s,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function xr(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var U=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(U||{});const gs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},qu={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let G=null;function ce(e,t,s,i=t.mirror||t.ownerDocument.mirror){e=th(e,t,s,i),Cr(e,t,s,i),eh(e,t,s)}function th(e,t,s,i){var n;if(s.afterAppend&&!G&&(G=new WeakSet,setTimeout(()=>{G=null},0)),!Ws(e,t)){const o=pe(t,s.mirror,i);(n=e.parentNode)==null||n.replaceChild(o,e),e=o}switch(t.RRNodeType){case M.Document:{if(!tt(e,t,s.mirror,i)){const o=i.getMeta(t);o&&(s.mirror.removeNodeFromMap(e),e.close(),e.open(),s.mirror.add(e,o),G==null||G.add(e))}break}case M.Element:{const o=e,a=t;switch(a.tagName){case"IFRAME":{const r=e.contentDocument;if(!r)break;ce(r,t.contentDocument,s,i);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Cr(o.shadowRoot,a.shadowRoot,s,i)),sh(o,a,i);break}}return e}function eh(e,t,s){var i;switch(t.RRNodeType){case M.Document:{const n=t.scrollData;n&&s.applyScroll(n,!0);break}case M.Element:{const n=e,o=t;switch(o.scrollData&&s.applyScroll(o.scrollData,!0),o.inputData&&s.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=e,r=o;r.paused!==void 0&&(r.paused?a.pause():a.play()),r.muted!==void 0&&(a.muted=r.muted),r.volume!==void 0&&(a.volume=r.volume),r.currentTime!==void 0&&(a.currentTime=r.currentTime),r.playbackRate!==void 0&&(a.playbackRate=r.playbackRate),r.loop!==void 0&&(a.loop=r.loop);break}case"CANVAS":{const a=t;if(a.rr_dataURL!==null){const r=document.createElement("img");r.onload=()=>{const l=n.getContext("2d");l&&l.drawImage(r,0,0,r.width,r.height)},r.src=a.rr_dataURL}a.canvasMutations.forEach(r=>s.applyCanvas(r.event,r.mutation,e));break}case"STYLE":{const a=n.sheet;a&&t.rules.forEach(r=>s.applyStyleSheetMutation(r,a));break}}break}case M.Text:case M.Comment:case M.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}G!=null&&G.has(e)&&(G.delete(e),(i=s.afterAppend)==null||i.call(s,e,s.mirror.getId(e)))}function sh(e,t,s){const i=e.attributes,n=t.attributes;for(const o in n){const a=n[o],r=s.getMeta(t);if(r!=null&&r.isSVG&&gs[o])e.setAttributeNS(gs[o],o,a);else if(t.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const u=e.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)}}else{if(t.tagName==="IFRAME"&&o==="srcdoc")continue;e.setAttribute(o,a)}}for(const{name:o}of Array.from(i))o in n||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Cr(e,t,s,i){const n=Array.from(e.childNodes),o=t.childNodes;if(n.length===0&&o.length===0)return;let a=0,r=n.length-1,l=0,u=o.length-1,h=n[a],c=n[r],d=o[l],m=o[u],b,p;for(;a<=r&&l<=u;)if(h===void 0)h=n[++a];else if(c===void 0)c=n[--r];else if(tt(h,d,s.mirror,i))h=n[++a],d=o[++l];else if(tt(c,m,s.mirror,i))c=n[--r],m=o[--u];else if(tt(h,m,s.mirror,i)){try{e.insertBefore(h,c.nextSibling)}catch(w){console.warn(w)}h=n[++a],m=o[--u]}else if(tt(c,d,s.mirror,i)){try{e.insertBefore(c,h)}catch(w){console.warn(w)}c=n[--r],d=o[++l]}else{if(!b){b={};for(let g=a;g<=r;g++){const E=n[g];E&&s.mirror.hasNode(E)&&(b[s.mirror.getId(E)]=g)}}p=b[i.getId(d)];const w=n[p];if(p!==void 0&&w&&tt(w,d,s.mirror,i)){try{e.insertBefore(w,h)}catch(g){console.warn(g)}n[p]=void 0}else{const g=pe(d,s.mirror,i);e.nodeName==="#document"&&h&&(g.nodeType===g.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||g.nodeType===g.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),s.mirror.removeNodeFromMap(h),h=n[++a]);try{e.insertBefore(g,h||null)}catch(E){console.warn(E)}}d=o[++l]}if(a>r){const w=o[u+1];let g=null;for(w&&(g=s.mirror.getNode(i.getId(w)));l<=u;++l){const E=pe(o[l],s.mirror,i);try{e.insertBefore(E,g)}catch(P){console.warn(P)}}}else if(l>u)for(;a<=r;a++){const w=n[a];if(!(!w||w.parentNode!==e))try{e.removeChild(w),s.mirror.removeNodeFromMap(w)}catch(g){console.warn(g)}}let S=e.firstChild,f=t.firstChild;for(;S!==null&&f!==null;)ce(S,f,s,i),S=S.nextSibling,f=f.nextSibling}function pe(e,t,s){const i=s.getId(e),n=s.getMeta(e);let o=null;if(i>-1&&(o=t.getNode(i)),o!==null&&Ws(o,e))return o;switch(e.RRNodeType){case M.Document:o=new Document;break;case M.DocumentType:o=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case M.Element:{let a=e.tagName.toLowerCase();a=qu[a]||a,n&&"isSVG"in n&&n!=null&&n.isSVG?o=document.createElementNS(gs.svg,a):o=document.createElement(e.tagName);break}case M.Text:o=document.createTextNode(e.data);break;case M.Comment:o=document.createComment(e.data);break;case M.CDATA:o=document.createCDATASection(e.data);break}n&&t.add(o,{...n});try{G==null||G.add(o)}catch{}return o}function Ws(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function tt(e,t,s,i){const n=s.getId(e),o=i.getId(t);return n===-1||n!==o?!1:Ws(e,t)}class ut extends _s{constructor(t){super(),y(this,"UNSERIALIZED_STARTING_ID",-2),y(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),y(this,"mirror",dh()),y(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,s,i){return new ut}createDocumentType(t,s,i){const n=new ih(t,s,i);return n.ownerDocument=this,n}createElement(t){const s=t.toUpperCase();let i;switch(s){case"AUDIO":case"VIDEO":i=new nh(s);break;case"IFRAME":i=new ah(s,this.mirror);break;case"CANVAS":i=new rh(s);break;case"STYLE":i=new oh(s);break;default:i=new Ee(s);break}return i.ownerDocument=this,i}createComment(t){const s=new uh(t);return s.ownerDocument=this,s}createCDATASection(t){const s=new hh(t);return s.ownerDocument=this,s}createTextNode(t){const s=new lh(t);return s.ownerDocument=this,s}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const ih=yr;class Ee extends Bs{constructor(){super(...arguments),y(this,"inputData",null),y(this,"scrollData",null)}}class nh extends Qu{}class rh extends Ee{constructor(){super(...arguments),y(this,"rr_dataURL",null),y(this,"canvasMutations",[])}getContext(){return null}}class oh extends Ee{constructor(){super(...arguments),y(this,"rules",[])}}class ah extends Ee{constructor(t,s){super(t),y(this,"contentDocument",new ut),this.contentDocument.mirror=s}}const lh=wr,uh=br,hh=vr;function ch(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Er(e,t,s,i){let n;switch(e.nodeType){case U.DOCUMENT_NODE:i&&i.nodeName==="IFRAME"?n=i.contentDocument:(n=t,n.compatMode=e.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const a=e;n=t.createDocumentType(a.name,a.publicId,a.systemId);break}case U.ELEMENT_NODE:{const a=e,r=ch(a);n=t.createElement(r);const l=n;for(const{name:u,value:h}of Array.from(a.attributes))l.attributes[u]=h;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case U.TEXT_NODE:n=t.createTextNode(e.textContent||"");break;case U.CDATA_SECTION_NODE:n=t.createCDATASection(e.data);break;case U.COMMENT_NODE:n=t.createComment(e.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:n=i.attachShadow({mode:"open"});break;default:return null}let o=s.getMeta(e);return t instanceof ut&&(o||(o=Mr(n,t.unserializedId),s.add(e,o)),t.mirror.add(n,{...o})),n}function ph(e,t=el(),s=new ut){function i(n,o){const a=Er(n,s,t,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&n.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),n.nodeName==="IFRAME"){const r=n.contentDocument;r&&i(r,a)}else(n.nodeType===U.DOCUMENT_NODE||n.nodeType===U.ELEMENT_NODE||n.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(n.nodeType===U.ELEMENT_NODE&&n.shadowRoot&&i(n.shadowRoot,a),n.childNodes.forEach(r=>i(r,a)))}return i(e,null),s}function dh(){return new fh}class fh{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap)}getId(t){var s;return t?((s=this.getMeta(t))==null?void 0:s.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const s=this.getId(t);this.idNodeMap.delete(s),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,s){const i=s.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,s)}replace(t,s){const i=this.getNode(t);if(i){const n=this.nodeMetaMap.get(i);n&&this.nodeMetaMap.set(s,n)}this.idNodeMap.set(t,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Mr(e,t){switch(e.RRNodeType){case M.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case M.DocumentType:{const s=e;return{id:t,type:e.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case M.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case M.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case M.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case M.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Nr(e){return{all:e=e||new Map,on:function(t,s){var i=e.get(t);i?i.push(s):e.set(t,[s])},off:function(t,s){var i=e.get(t);i&&(s?i.splice(i.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var i=e.get(t);i&&i.slice().map(function(n){n(s)}),(i=e.get("*"))&&i.slice().map(function(n){n(t,s)})}}}const mh=Object.freeze(Object.defineProperty({__proto__:null,default:Nr},Symbol.toStringTag,{value:"Module"})),Fi=new Map;function Tr(e,t){let s=Fi.get(e);return s||(s=new Map,Fi.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}function H(e,t,s){return async i=>{if(i&&typeof i=="object"&&"rr_type"in i)if(s&&(s.isUnchanged=!1),i.rr_type==="ImageBitmap"&&"args"in i){const n=await H(e,t,s)(i.args);return await createImageBitmap.apply(null,n)}else if("index"in i){if(s||t===null)return i;const{rr_type:n,index:o}=i;return Tr(t,n)[o]}else if("args"in i){const{rr_type:n,args:o}=i,a=window[n];return new a(...await Promise.all(o.map(H(e,t,s))))}else{if("base64"in i)return Ja(i.base64);if("src"in i){const n=e.get(i.src);if(n)return n;{const o=new Image;return o.src=i.src,e.set(i.src,o),o}}else if("data"in i&&i.rr_type==="Blob"){const n=await Promise.all(i.data.map(H(e,t,s)));return new Blob(n,{type:i.type})}}else if(Array.isArray(i))return await Promise.all(i.map(H(e,t,s)));return i}}async function gh({event:e,mutations:t,target:s,imageMap:i,errorHandler:n}){const o=s.getContext("2d");if(!o){n(t[0],new Error("Canvas context is null"));return}const a=t.map(async r=>Promise.all(r.args.map(H(i,o))));(await Promise.all(a)).forEach((r,l)=>{const u=t[l];try{if(u.setter){o[u.property]=u.args[0];return}const h=o[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(i.get(e),h.apply(o,u.args)):h.apply(o,r)}catch(h){n(u,h)}})}function yh(e,t){try{return t===oe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const wh=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function bh(e,t){if(!(t!=null&&t.constructor))return;const{name:s}=t.constructor;if(!wh.includes(s))return;const i=Tr(e,s);i.includes(t)||i.push(t)}async function vh({mutation:e,target:t,type:s,imageMap:i,errorHandler:n}){try{const o=yh(t,s);if(!o)return;if(e.setter){o[e.property]=e.args[0];return}const a=o[e.property],r=await Promise.all(e.args.map(H(i,o))),l=a.apply(o,r);bh(o,l);const u=!1}catch(o){n(e,o)}}async function _i({event:e,mutation:t,target:s,imageMap:i,canvasEventMap:n,errorHandler:o}){try{const a=n.get(e)||t,r="commands"in a?a.commands:[a];if([oe.WebGL,oe.WebGL2].includes(t.type)){for(let l=0;l<r.length;l++){const u=r[l];await vh({mutation:u,type:t.type,target:s,imageMap:i,errorHandler:o})}return}await gh({event:e,mutations:r,target:s,imageMap:i,errorHandler:o})}catch(a){o(t,a)}}/*! *****************************************************************************
|
|
65
65
|
Copyright (c) Microsoft Corporation.
|
|
66
66
|
|
|
67
67
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -74,5 +74,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
74
74
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
75
75
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
76
76
|
PERFORMANCE OF THIS SOFTWARE.
|
|
77
|
-
***************************************************************************** */function Wr(t,e){var s=typeof Symbol=="function"&&t[Symbol.iterator];if(!s)return t;var r,i,o=s.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(n){i={error:n}}finally{try{r&&!r.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return a}var ie;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(ie||(ie={}));var Rn={type:"xstate.init"};function Ft(t){return t===void 0?[]:[].concat(t)}function re(t){return{type:"xstate.assign",assignment:t}}function jr(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function dt(t){return function(e){return t===e}}function On(t){return typeof t=="string"?{type:t}:t}function Vr(t,e){return{value:t,context:e,actions:[],changed:!1,matches:dt(t)}}function zr(t,e,s){var r=e,i=!1;return[t.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},r);return typeof o.assignment=="function"?a=o.assignment(r,s):Object.keys(o.assignment).forEach(function(n){a[n]=typeof o.assignment[n]=="function"?o.assignment[n](r,s):o.assignment[n]}),r=a,!1}return!0}),r,i]}function An(t,e){e===void 0&&(e={});var s=Wr(zr(Ft(t.states[t.initial].entry).map(function(a){return jr(a,e.actions)}),t.context,Rn),2),r=s[0],i=s[1],o={config:t,_options:e,initialState:{value:t.initial,actions:r,context:i,matches:dt(t.initial)},transition:function(a,n){var u,l,h=typeof a=="string"?{value:a,context:t.context}:a,c=h.value,p=h.context,m=On(n),v=t.states[c];if(v.on){var d=Ft(v.on[m.type]);try{for(var S=function(_){var Nt=typeof Symbol=="function"&&Symbol.iterator,zs=Nt&&_[Nt],Ys=0;if(zs)return zs.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&Ys>=_.length&&(_=void 0),{value:_&&_[Ys++],done:!_}}};throw new TypeError(Nt?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=S.next();!f.done;f=S.next()){var w=f.value;if(w===void 0)return Vr(c,p);var g=typeof w=="string"?{target:w}:w,E=g.target,I=g.actions,B=I===void 0?[]:I,L=g.cond,W=L===void 0?function(){return!0}:L,K=E===void 0,Pn=E??c,Ln=t.states[Pn];if(W(p,m)){var Mt=Wr(zr((K?Ft(B):[].concat(v.exit,B,Ln.entry).filter(function(_){return _})).map(function(_){return jr(_,o._options.actions)}),p,m),3),js=Mt[0],Fn=Mt[1],_n=Mt[2],Vs=E??c;return{value:Vs,context:Fn,actions:js,changed:E!==c||js.length>0||_n,matches:dt(Vs)}}}}catch(_){u={error:_}}finally{try{f&&!f.done&&(l=S.return)&&l.call(S)}finally{if(u)throw u.error}}}return Vr(c,p)}};return o}var Yr=function(t,e){return t.actions.forEach(function(s){var r=s.exec;return r&&r(t.context,e)})};function In(t){var e=t.initialState,s=ie.NotStarted,r=new Set,i={_machine:t,send:function(o){s===ie.Running&&(e=t.transition(e,o),Yr(e,On(o)),r.forEach(function(a){return a(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:t.config.context,value:o};e={value:a.value,actions:[],context:a.context,matches:dt(a.value)}}return s=ie.Running,Yr(e,Rn),i},stop:function(){return s=ie.Stopped,r.clear(),i},get state(){return e},get status(){return s}};return i}class Ch{constructor(e=[],s){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=s.speed}addAction(e){const s=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}s&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const s=this.actions[0];if(this.timeOffset>=s.delay)this.actions.shift(),s.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let s=0,r=this.actions.length-1;for(;s<=r;){const i=Math.floor((s+r)/2);if(this.actions[i].delay<e.delay)s=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return s}}function Gr(t,e){if(t.type===P.IncrementalSnapshot&&t.data.source===T.MouseMove&&t.data.positions&&t.data.positions.length){const s=t.data.positions[0].timeOffset,r=t.timestamp+s;return t.delay=r-e,r-e}return t.delay=t.timestamp-e,t.delay}function Eh(t,e){for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.type===P.FullSnapshot&&r.timestamp<=e)return s>0&&t[s-1].type===P.Meta&&t[s-1].timestamp<=e?t.slice(s-1):t.slice(s)}return t}function Mh(t,{getCastFn:e,applyEventsSynchronously:s,emitter:r}){const i=An({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:re({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:re((o,a)=>{let n=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(n=a.payload.timeOffset),{...o,timeOffset:n,baselineTime:o.events[0].timestamp+n}}),play(o){const{timer:a,events:n,baselineTime:u}=o;a.clear();for(const c of n)Gr(c,u);const l=Eh(n,u);r.emit(N.PlayBack);const h=new Array;for(const c of l)if(c.timestamp<u)h.push(c);else{const p=e(c,!1);a.addAction({doAction:()=>{p()},delay:c.delay})}s(h),r.emit(N.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:re(o=>({...o,lastPlayedEvent:null})),startLive:re({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:re((o,a)=>{const{baselineTime:n,timer:u,events:l}=o;if(a.type==="ADD_EVENT"){const{event:h}=a.payload;Gr(h,n);let c=l.length-1;if(!l[c]||l[c].timestamp<=h.timestamp)l.push(h);else{let v=-1,d=0;for(;d<=c;){const S=Math.floor((d+c)/2);l[S].timestamp<=h.timestamp?d=S+1:c=S-1}v===-1&&(v=d),l.splice(v,0,h)}const p=h.timestamp<n,m=e(h,p);p?m():u.isActive()&&u.addAction({doAction:()=>{m()},delay:h.delay})}return{...o,events:l}})}});return In(i)}function Nh(t){const e=An({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(s,r)=>{"payload"in r&&s.timer.setSpeed(r.payload.speed)},recordSpeed:re({normalSpeed:s=>s.timer.speed}),restoreSpeed:s=>{s.timer.setSpeed(s.normalSpeed)}}});return In(e)}class Th{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(N.Start,this.start.bind(this)),this.emitter.on(N.SkipStart,this.start.bind(this)),this.emitter.on(N.Pause,this.pause.bind(this)),this.emitter.on(N.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((s,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:s,mediaState:r}){if(r.isPlaying){const i=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in s&&s.duration;if(Number.isNaN(o)){this.waitForMetadata(s);return}let a=r.currentTimeAtLastInteraction+i;s.loop&&o!==!1&&(a=a%o),s.currentTime=a}else s.pause(),s.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const s=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,s),e.addEventListener("loadedmetadata",s,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:s,mutation:r}){const i=this.mediaMap.get(e),{type:o,playbackRate:a,currentTime:n,muted:u,volume:l,loop:h}=r;return{isPlaying:o===qt.Play||o!==qt.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:n??(i==null?void 0:i.currentTimeAtLastInteraction)??0,lastInteractionTimeOffset:s,playbackRate:a??(i==null?void 0:i.playbackRate)??1,volume:l??(i==null?void 0:i.volume)??1,muted:u??(i==null?void 0:i.muted)??e.getAttribute("muted")===null,loop:h??(i==null?void 0:i.loop)??e.getAttribute("loop")===null}}syncTargetWithState(e){const s=this.mediaMap.get(e);if(!s)return;const{muted:r,loop:i,volume:o,isPlaying:a}=s,n=this.service.state.matches("paused"),u=s.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==u&&(e.playbackRate=u),a&&!n?e.play():e.pause()}catch(l){this.warn(`Failed to replay media interactions: ${l.message||l}`)}}addMediaElements(e,s,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),n=o.attributes;let u=!1;n.rr_mediaState?u=n.rr_mediaState==="played":u=i.getAttribute("autoplay")!==null,u&&a&&i.pause();let l=1;typeof n.rr_mediaPlaybackRate=="number"&&(l=n.rr_mediaPlaybackRate);let h=!1;typeof n.rr_mediaMuted=="boolean"?h=n.rr_mediaMuted:h=i.getAttribute("muted")!==null;let c=!1;typeof n.rr_mediaLoop=="boolean"?c=n.rr_mediaLoop:c=i.getAttribute("loop")!==null;let p=1;typeof n.rr_mediaVolume=="number"&&(p=n.rr_mediaVolume);let m=0;typeof n.rr_mediaCurrentTime=="number"&&(m=n.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:u,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:s,playbackRate:l,volume:p,muted:h,loop:c}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:s,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:s,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function kh(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const s=t.HTMLElement||t.Element,r=468,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:s.prototype.scroll||u,scrollIntoView:s.prototype.scrollIntoView},o=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function a(f){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(f)}const n=a(t.navigator.userAgent)?1:0;function u(f,w){this.scrollLeft=f,this.scrollTop=w}function l(f){return .5*(1-Math.cos(Math.PI*f))}function h(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(f,w){if(w==="Y")return f.clientHeight+n<f.scrollHeight;if(w==="X")return f.clientWidth+n<f.scrollWidth}function p(f,w){const g=t.getComputedStyle(f,null)["overflow"+w];return g==="auto"||g==="scroll"}function m(f){const w=c(f,"Y")&&p(f,"Y"),g=c(f,"X")&&p(f,"X");return w||g}function v(f){for(;f!==e.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function d(f){const w=o();let g,E,I,B=(w-f.startTime)/r;B=B>1?1:B,g=l(B),E=f.startX+(f.x-f.startX)*g,I=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,E,I),(E!==f.x||I!==f.y)&&t.requestAnimationFrame(d.bind(t,f))}function S(f,w,g){let E,I,B,L;const W=o();f===e.body?(E=t,I=t.scrollX||t.pageXOffset,B=t.scrollY||t.pageYOffset,L=i.scroll):(E=f,I=f.scrollLeft,B=f.scrollTop,L=u),d({scrollable:E,method:L,startTime:W,startX:I,startY:B,x:w,y:g})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){i.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}S.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])){i.scrollBy.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},s.prototype.scroll=s.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(h(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,w=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof w>"u"?this.scrollTop:~~w)},s.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},s.prototype.scrollIntoView=function(){if(h(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=v(this),w=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==e.body?(S.call(this,f,f.scrollLeft+g.left-w.left,f.scrollTop+g.top-w.top),t.getComputedStyle(f).position!=="fixed"&&t.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}const Dh=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],Rh=5*1e3,Oh=kn||yh,Zr="[replayer]",_t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Xr(t){return t.type==P.IncrementalSnapshot&&(t.data.source==T.TouchMove||t.data.source==T.MouseInteraction&&t.data.type==F.TouchStart)}class Ah{constructor(e,s){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new ce),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",Oh()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",dr()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",Jr()),b(this,"styleMirror",new Xa),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"textValueMap",new Map),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",n=>{this.iframe.style.display="inherit";for(const u of[this.mouseTail,this.iframe])u&&(u.setAttribute("width",String(n.width)),u.setAttribute("height",String(n.height)))}),b(this,"applyEventsSynchronously",n=>{for(const u of n){switch(u.type){case P.DomContentLoaded:case P.Load:case P.Custom:continue;case P.FullSnapshot:case P.Meta:case P.Plugin:case P.IncrementalSnapshot:break}this.getCastFn(u,!0)()}}),b(this,"getCastFn",(n,u=!1)=>{let l;switch(n.type){case P.DomContentLoaded:case P.Load:break;case P.Custom:l=()=>{this.emitter.emit(N.CustomEvent,n)};break;case P.Meta:l=()=>this.emitter.emit(N.Resize,{width:n.data.width,height:n.data.height});break;case P.FullSnapshot:l=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===n){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(n,u),(h=this.iframe.contentWindow)==null||h.scrollTo(n.data.initialOffset)};break;case P.IncrementalSnapshot:l=()=>{if(this.applyIncremental(n,u),!u&&(n===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=n.timestamp)&&this.isUserInteraction(h)){h.delay-n.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent)if(this.config.skipInactive)this.play(this.nextUserInteractionEvent.timestamp-this.getMetaData().startTime-1e3);else{const h=this.nextUserInteractionEvent.delay-n.delay,c={speed:Math.min(Math.round(h/Rh),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:c}),this.emitter.emit(N.SkipStart,c)}}};break}return()=>{l&&l();for(const c of this.config.plugins||[])c.handler&&c.handler(n,u,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:n}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&n===this.service.state.context.events[h]){const c=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};let p=50;n.type===P.IncrementalSnapshot&&n.data.source===T.MouseMove&&n.data.positions.length&&(p+=Math.max(0,-n.data.positions[0].timeOffset)),setTimeout(c,p)}this.emitter.emit(N.EventCast,n)}}),!(s!=null&&s.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:_t,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,s),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom();for(const n of this.config.plugins||[])n.getMirror&&n.getMirror({nodeMirror:this.mirror});this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const n={mirror:this.mirror,applyCanvas:(u,l,h)=>{Ur({event:u,mutation:l,target:h,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(u,l)=>{u.source===T.StyleSheetRule?this.applyStyleSheetRule(u,l):u.source===T.StyleDeclaration&&this.applyStyleDeclaration(u,l)},afterAppend:(u,l)=>{for(const h of this.config.plugins||[])h.onBuild&&h.onBuild(u,{id:l,replayer:this})}};if(this.iframe.contentDocument)try{ct(this.iframe.contentDocument,this.virtualDom,n,this.virtualDom.mirror)}catch(u){console.warn(u)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const u in this.legacy_missingNodeRetryMap)try{const l=this.legacy_missingNodeRetryMap[u],h=pt(l.node,this.mirror,this.virtualDom.mirror);ct(h,l.node,n,this.virtualDom.mirror),l.node=h}catch(l){this.warn(l)}this.constructedStyleMutations.forEach(u=>{this.applyStyleSheetMutation(u)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(u=>{this.applyAdoptedStyleSheet(u)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[n,u]=this.lastMouseDownEvent;n.dispatchEvent(u)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear()});const i=new Ch([],{speed:this.config.speed});this.service=Mh({events:e.map(n=>s&&s.unpackFn?s.unpackFn(n):n).sort((n,u)=>n.timestamp-u.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(n=>{this.emitter.emit(N.StateChange,{player:n})}),this.speedService=Nh({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(n=>{this.emitter.emit(N.StateChange,{speed:n})}),this.mediaManager=new Th({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(n=>n.type===P.Meta),a=this.service.state.context.events.find(n=>n.type===P.FullSnapshot);if(o){const{width:n,height:u}=o.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:n,height:u})},0)}a&&setTimeout(()=>{var n;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(n=this.iframe.contentWindow)==null||n.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Xr)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,s){return this.emitter.on(e,s),this}off(e,s){return this.emitter.off(e,s),this}setConfig(e){Object.keys(e).forEach(s=>{e[s],this.config[s]=e[s]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],s=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:s.timestamp,totalTime:s.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:s}=this.service.state.context;return e-s[0].timestamp}getMirror(){return this.mirror}play(e=0){var s,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.remove("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Start)}pause(e){var s,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(N.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear(),this.config.root.removeChild(this.wrapper),this.emitter.emit(N.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const s=this.config.unpackFn?this.config.unpackFn(e):e;Xr(s)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:s}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=dr()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(kh(this.iframe.contentWindow,this.iframe.contentDocument),Ya(this.iframe.contentWindow))}rebuildFullSnapshot(e,s=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=(n,u)=>{if(this.collectIframeAndAttachDocument(r,n),this.mediaManager.isSupportedMediaElement(n)){const{events:l}=this.service.state.context;this.mediaManager.addMediaElements(n,e.timestamp-l[0].timestamp,this.mirror)}for(const l of this.config.plugins||[])l.onBuild&&l.onBuild(n,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.textValueMap.clear(),za(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:n,builtNode:u}of r)this.attachDocumentToIframe(n,u),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==n);const{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,e),s||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,s){var r;const i=Dh(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Tn(o,this.virtualDom.unserializedId)),e.insertBefore(o,s),o.rules.push({source:T.StyleSheetRule,adds:i.map((a,n)=>({rule:a,index:n}))})}else{const o=document.createElement("style");e.insertBefore(o,s);for(let a=0;a<i.length;a++)(r=o.sheet)==null||r.insertRule(i[a],a)}}attachDocumentToIframe(e,s){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(a,n)=>{this.collectIframeAndAttachDocument(i,a);const u=r.getMeta(a);if((u==null?void 0:u.type)===R.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:l,head:h}=s.contentDocument;this.insertStyleRules(l,h)}if(!this.usingVirtualDom)for(const l of this.config.plugins||[])l.onBuild&&l.onBuild(a,{id:n,replayer:this})};Se(e.node,{doc:s.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(s.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:n}of i)this.attachDocumentToIframe(a,n),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a)}collectIframeAndAttachDocument(e,s){if(Ot(s,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(s));r&&e.push({mutationInQueue:r,builtNode:s})}}waitForStylesheetLoad(){var e;const s=(e=this.iframe.contentDocument)==null?void 0:e.head;if(s){const r=new Set;let i,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const n=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};s.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{u.sheet||(r.add(u),u.addEventListener("load",()=>{r.delete(u),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),i&&clearTimeout(i),n())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,n()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const s of this.service.state.context.events)s.type===P.IncrementalSnapshot&&s.data.source===T.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(s.data,s)),("commands"in s.data?s.data.commands:[s.data]).forEach(r=>{this.preloadImages(r,s)}));return Promise.all(e)}preloadImages(e,s){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(s)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,s){if(!this.canvasEventMap.has(s)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const a=await Promise.all(o.args.map($(this.imageMap,null,r)));return{...o,args:a}}));r.isUnchanged===!1&&this.canvasEventMap.set(s,{...e,commands:i})}else{const i=await Promise.all(e.args.map($(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(s,{...e,args:i})}}}applyIncremental(e,s){var r,i,o;const{data:a}=e;switch(a.source){case T.Mutation:{try{this.applyMutation(a,s)}catch(n){this.warn(`Exception in mutation ${n.message||n}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(s){const n=a.positions[a.positions.length-1];this.mousePos={x:n.x,y:n.y,id:n.id,debugData:a}}else a.positions.forEach(n=>{const u={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,s,a)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(u)}),this.timer.addAction({doAction(){},delay:e.delay-((r=a.positions[0])==null?void 0:r.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const n=new Event(zn(F[a.type])),u=this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);this.emitter.emit(N.MouseInteraction,{type:a.type,target:u});const{triggerFocus:l}=this.config;switch(a.type){case F.Blur:"blur"in u&&u.blur();break;case F.Focus:l&&u.focus&&u.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:s?(a.type===F.TouchStart?this.touchActive=!0:a.type===F.TouchEnd&&(this.touchActive=!1),a.type===F.MouseDown?this.lastMouseDownEvent=[u,n]:a.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,s,a),a.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):u.dispatchEvent(n));break;case F.TouchCancel:s?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:u.dispatchEvent(n)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.scrollData=a;break}this.applyScroll(a,s);break}case T.ViewportResize:this.emitter.emit(N.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const n=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);const u=n,{events:l}=this.service.state.context;this.mediaManager.mediaMutation({target:u,timeOffset:e.timestamp-l[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.canvasMutations.push({event:e,mutation:a})}else{const n=this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);Ur({event:e,mutation:a,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const n=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(n)}catch(n){this.warn(n)}break}case T.Selection:{if(s){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,s){if(this.config.useVirtualDom&&!this.usingVirtualDom&&s&&(this.usingVirtualDom=!0,fh(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const l in this.legacy_missingNodeRetryMap)try{const h=this.legacy_missingNodeRetryMap[l],c=Nn(h.node,this.virtualDom,this.mirror);c&&(h.node=c)}catch(h){this.warn(h)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes.filter(l=>r.getNode(l.id)?!0:(this.warnNodeNotFound(e,l.id),!1)).forEach(l=>{var h;const c=r.getNode(l.id);if(!c)return;let p=r.getNode(l.parentId);if(!p)return this.warnNodeNotFound(e,l.parentId);if(l.isShadow&&Ve(p)&&(p=p.shadowRoot),r.removeNodeFromMap(c),p)try{p.removeChild(c),this.usingVirtualDom&&c.nodeName==="#text"&&p.nodeName==="STYLE"&&((h=p.rules)==null?void 0:h.length)>0&&(p.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",p,c,e);else throw m}});const i={...this.legacy_missingNodeRetryMap},o=[],a=l=>{let h=null;return l.nextId&&(h=r.getNode(l.nextId)),l.nextId!==null&&l.nextId!==void 0&&l.nextId!==-1&&!h},n=l=>{var h,c;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let p=r.getNode(l.parentId);if(!p)return l.node.type===R.Document?this.newDocumentQueue.push(l):o.push(l);l.node.isShadow&&(Ve(p)||p.attachShadow({mode:"open"}),p=p.shadowRoot);let m=null,v=null;if(l.previousId&&(m=r.getNode(l.previousId)),l.nextId&&(v=r.getNode(l.nextId)),a(l))return o.push(l);if(l.node.rootId&&!r.getNode(l.node.rootId))return;const d=l.node.rootId?r.getNode(l.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ot(p,r)){this.attachDocumentToIframe(l,p);return}const S=(g,E)=>{if(!this.usingVirtualDom)for(const I of this.config.plugins||[])I.onBuild&&I.onBuild(g,{id:E,replayer:this})},f=Se(l.node,{doc:d,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:S});if(l.previousId===-1||l.nextId===-1){i[l.node.id]={node:f,mutation:l};return}const w=r.getMeta(p);if(w&&w.type===R.Element&&l.node.type===R.Text){const g=Array.isArray(p.childNodes)?p.childNodes:Array.from(p.childNodes);if(w.tagName==="textarea")for(const E of g)E.nodeType===p.TEXT_NODE&&p.removeChild(E);else if(w.tagName==="style"&&g.length===1)for(const E of g)E.nodeType===p.TEXT_NODE&&!r.hasNode(E)&&(f.textContent=E.textContent,p.removeChild(E))}else if((w==null?void 0:w.type)===R.Document){const g=p;l.node.type===R.DocumentType&&((h=g.childNodes[0])==null?void 0:h.nodeType)===Node.DOCUMENT_TYPE_NODE&&g.removeChild(g.childNodes[0]),f.nodeName==="HTML"&&g.documentElement&&g.removeChild(g.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?p.insertBefore(f,m.nextSibling):v&&v.parentNode?p.contains(v)?p.insertBefore(f,v):p.insertBefore(f,null):p.appendChild(f),S(f,l.node.id),this.usingVirtualDom&&f.nodeName==="#text"&&p.nodeName==="STYLE"&&((c=p.rules)==null?void 0:c.length)>0&&(p.rules=[]),Ot(f,this.mirror)){const g=this.mirror.getId(f),E=this.newDocumentQueue.find(I=>I.parentId===g);E&&(this.attachDocumentToIframe(E,f),this.newDocumentQueue=this.newDocumentQueue.filter(I=>I!==E))}(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(i,p,f,l)};e.adds.forEach(l=>{n(l)});const u=Date.now();for(;o.length;){const l=Ga(o);if(o.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",l);break}for(const h of l)r.getNode(h.value.parentId)?Ii(h,c=>{n(c)}):this.debug("Drop resolve tree since there is no parent for the root node.",h)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Za(e.texts).forEach(l=>{var h;const c=r.getNode(l.id);if(!c)return e.removes.find(m=>m.id===l.id)?void 0:this.warnNodeNotFound(e,l.id);let p;if(l.delta){const m=this.textValueMap.get(l.id)||"";p=Ha(m,l.delta)}else p=l.value??null;if(c.textContent=p,p!==null&&this.textValueMap.set(l.id,p),this.usingVirtualDom){const m=c.parentNode;((h=m==null?void 0:m.rules)==null?void 0:h.length)>0&&(m.rules=[])}}),e.attributes.forEach(l=>{var h;const c=r.getNode(l.id);if(!c)return e.removes.find(p=>p.id===l.id)?void 0:this.warnNodeNotFound(e,l.id);for(const p in l.attributes)if(typeof p=="string"){const m=l.attributes[p];if(m===null)c.removeAttribute(p);else if(typeof m=="string")try{if(p==="_cssText"&&(c.nodeName==="LINK"||c.nodeName==="STYLE"))try{const v=r.getMeta(c);Object.assign(v.attributes,l.attributes);const d=Se(v,{doc:c.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),S=c.nextSibling,f=c.parentNode;if(d&&f){f.removeChild(c),f.insertBefore(d,S),r.replace(l.id,d);break}}catch{}if(p==="value"&&c.nodeName==="TEXTAREA"){const v=c;v.childNodes.forEach(S=>v.removeChild(S));const d=(h=c.ownerDocument)==null?void 0:h.createTextNode(m);d&&v.appendChild(d)}else c.setAttribute(p,m)}catch(v){this.warn("An error occurred may due to the checkout feature.",v)}else if(p==="style"){const v=m,d=c;for(const S in v)if(v[S]===!1)d.style.removeProperty(S);else if(v[S]instanceof Array){const f=v[S];d.style.setProperty(S,f[0],f[1])}else{const f=v[S];d.style.setProperty(S,f)}}}})}applyScroll(e,s){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else if((a==null?void 0:a.type)===R.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"})}catch{}}applyInput(e){const s=this.mirror.getNode(e.id);if(!s)return this.debugNodeNotFound(e,e.id);try{s.checked=e.isChecked,s.value=e.text}catch{}}applySelection(e){try{const s=new Set,r=e.ranges.map(({start:i,startOffset:o,end:a,endOffset:n})=>{const u=this.mirror.getNode(i),l=this.mirror.getNode(a);if(!u||!l)return;const h=new Range;h.setStart(u,o),h.setEnd(l,n);const c=u.ownerDocument,p=c==null?void 0:c.getSelection();return p&&s.add(p),{range:h,selection:p}});s.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var s;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((s=this.mirror.getNode(e.id))==null?void 0:s.sheet)||null),r&&(e.source===T.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===T.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,s){var r,i,o,a;if((r=e.adds)==null||r.forEach(({rule:n,index:u})=>{try{if(Array.isArray(u)){const{positions:l,index:h}=mr(u);be(s.cssRules,l).insertRule(n,h)}else{const l=u===void 0?void 0:Math.min(u,s.cssRules.length);s==null||s.insertRule(n,l)}}catch{}}),(i=e.removes)==null||i.forEach(({index:n})=>{try{if(Array.isArray(n)){const{positions:u,index:l}=mr(n);be(s.cssRules,u).deleteRule(l||0)}else s==null||s.deleteRule(n)}catch{}}),e.replace)try{(o=s.replace)==null||o.call(s,e.replace)}catch{}if(e.replaceSync)try{(a=s.replaceSync)==null||a.call(s,e.replaceSync)}catch{}}applyStyleDeclaration(e,s){e.set&&be(s.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&be(s.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var s;const r=this.mirror.getNode(e.id);if(!r)return;(s=e.styles)==null||s.forEach(n=>{var u;let l=null,h=null;if(Ve(r)?h=((u=r.ownerDocument)==null?void 0:u.defaultView)||null:r.nodeName==="#document"&&(h=r.defaultView),!!h)try{l=new h.CSSStyleSheet,this.styleMirror.add(l,n.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:n.rules},l)}catch{}});const i=10;let o=0;const a=(n,u)=>{const l=u.map(h=>this.styleMirror.getStyle(h)).filter(h=>h!==null);Ve(n)?n.shadowRoot.adoptedStyleSheets=l:n.nodeName==="#document"&&(n.adoptedStyleSheets=l),l.length!==u.length&&o<i&&(setTimeout(()=>a(n,u),0+100*o),o++)};a(r,e.styleIds)}legacy_resolveMissingNode(e,s,r,i){const{previousId:o,nextId:a}=i,n=o&&e[o],u=a&&e[a];if(n){const{node:l,mutation:h}=n;s.insertBefore(l,r),delete e[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(e,s,l,h)}if(u){const{node:l,mutation:h}=u;s.insertBefore(l,r.nextSibling),delete e[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(e,s,l,h)}}moveAndHover(e,s,r,i,o){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(o,r);const n=Pi(a,this.iframe),u=e*n.absoluteScale+n.x,l=s*n.absoluteScale+n.y;this.mouse.style.left=`${u}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:u,y:l}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:s,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?_t:Object.assign({},_t,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const n=this.mouseTail.getContext("2d");!n||!this.tailPositions.length||(n.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),n.beginPath(),n.lineWidth=r,n.lineCap=s,n.strokeStyle=i,n.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(u=>n.lineTo(u.x,u.y)),n.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(n=>n!==e),a()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var s;(s=this.lastHoveredRootNode||this.iframe.contentDocument)==null||s.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==P.IncrementalSnapshot?!1:e.data.source>T.Mutation&&e.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,s){this.warn(`Node with id '${s}' not found. `,e)}warnCanvasMutationFailed(e,s){this.warn("Has error on canvas update",s,"canvas mutation:",e)}debugNodeNotFound(e,s){this.debug(`Node with id '${s}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Zr,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Zr,...e)}}exports.Replayer=Ah;
|
|
77
|
+
***************************************************************************** */function Bi(e,t){var s=typeof Symbol=="function"&&e[Symbol.iterator];if(!s)return e;var i,n,o=s.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(r){n={error:r}}finally{try{i&&!i.done&&(s=o.return)&&s.call(o)}finally{if(n)throw n.error}}return a}var st;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(st||(st={}));var kr={type:"xstate.init"};function Fe(e){return e===void 0?[]:[].concat(e)}function et(e){return{type:"xstate.assign",assignment:e}}function Ui(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function de(e){return function(t){return e===t}}function Dr(e){return typeof e=="string"?{type:e}:e}function Wi(e,t){return{value:e,context:t,actions:[],changed:!1,matches:de(e)}}function ji(e,t,s){var i=t,n=!1;return[e.filter(function(o){if(o.type==="xstate.assign"){n=!0;var a=Object.assign({},i);return typeof o.assignment=="function"?a=o.assignment(i,s):Object.keys(o.assignment).forEach(function(r){a[r]=typeof o.assignment[r]=="function"?o.assignment[r](i,s):o.assignment[r]}),i=a,!1}return!0}),i,n]}function Rr(e,t){t===void 0&&(t={});var s=Bi(ji(Fe(e.states[e.initial].entry).map(function(a){return Ui(a,t.actions)}),e.context,kr),2),i=s[0],n=s[1],o={config:e,_options:t,initialState:{value:e.initial,actions:i,context:n,matches:de(e.initial)},transition:function(a,r){var l,u,h=typeof a=="string"?{value:a,context:e.context}:a,c=h.value,d=h.context,m=Dr(r),b=e.states[c];if(b.on){var p=Fe(b.on[m.type]);try{for(var S=function(_){var Ne=typeof Symbol=="function"&&Symbol.iterator,zs=Ne&&_[Ne],Ys=0;if(zs)return zs.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&Ys>=_.length&&(_=void 0),{value:_&&_[Ys++],done:!_}}};throw new TypeError(Ne?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),f=S.next();!f.done;f=S.next()){var w=f.value;if(w===void 0)return Wi(c,d);var g=typeof w=="string"?{target:w}:w,E=g.target,P=g.actions,B=P===void 0?[]:P,L=g.cond,W=L===void 0?function(){return!0}:L,$=E===void 0,Ar=E??c,Ir=e.states[Ar];if(W(d,m)){var Me=Bi(ji(($?Fe(B):[].concat(b.exit,B,Ir.entry).filter(function(_){return _})).map(function(_){return Ui(_,o._options.actions)}),d,m),3),js=Me[0],Pr=Me[1],Lr=Me[2],Vs=E??c;return{value:Vs,context:Pr,actions:js,changed:E!==c||js.length>0||Lr,matches:de(Vs)}}}}catch(_){l={error:_}}finally{try{f&&!f.done&&(u=S.return)&&u.call(S)}finally{if(l)throw l.error}}}return Wi(c,d)}};return o}var Vi=function(e,t){return e.actions.forEach(function(s){var i=s.exec;return i&&i(e.context,t)})};function Or(e){var t=e.initialState,s=st.NotStarted,i=new Set,n={_machine:e,send:function(o){s===st.Running&&(t=e.transition(t,o),Vi(t,Dr(o)),i.forEach(function(a){return a(t)}))},subscribe:function(o){return i.add(o),o(t),{unsubscribe:function(){return i.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:e.config.context,value:o};t={value:a.value,actions:[],context:a.context,matches:de(a.value)}}return s=st.Running,Vi(t,kr),n},stop:function(){return s=st.Stopped,i.clear(),n},get state(){return t},get status(){return s}};return n}class Sh{constructor(t=[],s){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(this,"lastTimestamp"),this.actions=t,this.speed=s.speed}addAction(t){const s=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const i=this.findActionIndex(t);this.actions.splice(i,0,t)}s&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const s=this.actions[0];if(this.timeOffset>=s.delay)this.actions.shift(),s.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let s=0,i=this.actions.length-1;for(;s<=i;){const n=Math.floor((s+i)/2);if(this.actions[n].delay<t.delay)s=n+1;else if(this.actions[n].delay>t.delay)i=n-1;else return n+1}return s}}function zi(e,t){if(e.type===A.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions&&e.data.positions.length){const s=e.data.positions[0].timeOffset,i=e.timestamp+s;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}function xh(e,t){for(let s=e.length-1;s>=0;s--){const i=e[s];if(i.type===A.FullSnapshot&&i.timestamp<=t)return s>0&&e[s-1].type===A.Meta&&e[s-1].timestamp<=t?e.slice(s-1):e.slice(s)}return e}function Ch(e,{getCastFn:t,applyEventsSynchronously:s,emitter:i}){const n=Rr({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:et({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:et((o,a)=>{let r=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(r=a.payload.timeOffset),{...o,timeOffset:r,baselineTime:o.events[0].timestamp+r}}),play(o){const{timer:a,events:r,baselineTime:l}=o;a.clear();for(const c of r)zi(c,l);const u=xh(r,l);i.emit(N.PlayBack);const h=new Array;for(const c of u)if(c.timestamp<l)h.push(c);else{const d=t(c,!1);a.addAction({doAction:()=>{d()},delay:c.delay})}s(h),i.emit(N.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:et(o=>({...o,lastPlayedEvent:null})),startLive:et({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:et((o,a)=>{const{baselineTime:r,timer:l,events:u}=o;if(a.type==="ADD_EVENT"){const{event:h}=a.payload;zi(h,r);let c=u.length-1;if(!u[c]||u[c].timestamp<=h.timestamp)u.push(h);else{let b=-1,p=0;for(;p<=c;){const S=Math.floor((p+c)/2);u[S].timestamp<=h.timestamp?p=S+1:c=S-1}b===-1&&(b=p),u.splice(b,0,h)}const d=h.timestamp<r;let m=!1;if(d)for(let b=u.length-1;b>=0;b--){const p=u[b];if(p===h)break;if(p.type===A.FullSnapshot&&p.timestamp>h.timestamp&&p.timestamp<=r){m=!0;break}}if(!m){const b=t(h,d);d?b():l.isActive()&&l.addAction({doAction:()=>{b()},delay:h.delay})}}return{...o,events:u}})}});return Or(n)}function Eh(e){const t=Rr({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(s,i)=>{"payload"in i&&s.timer.setSpeed(i.payload.speed)},recordSpeed:et({normalSpeed:s=>s.timer.speed}),restoreSpeed:s=>{s.timer.setSpeed(s.normalSpeed)}}});return Or(t)}class Mh{constructor(t){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on(N.Start,this.start.bind(this)),this.emitter.on(N.SkipStart,this.start.bind(this)),this.emitter.on(N.Pause,this.pause.bind(this)),this.emitter.on(N.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((s,i)=>{this.syncTargetWithState(i),t.pause&&i.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:s,mediaState:i}){if(i.isPlaying){const n=(t-i.lastInteractionTimeOffset)/1e3*i.playbackRate,o="duration"in s&&s.duration;if(Number.isNaN(o)){this.waitForMetadata(s);return}let a=i.currentTimeAtLastInteraction+n;s.loop&&o!==!1&&(a=a%o),s.currentTime=a}else s.pause(),s.currentTime=i.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;const s=()=>{this.metadataCallbackMap.delete(t);const i=this.mediaMap.get(t);i&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:i})};this.metadataCallbackMap.set(t,s),t.addEventListener("loadedmetadata",s,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:s,mutation:i}){const n=this.mediaMap.get(t),{type:o,playbackRate:a,currentTime:r,muted:l,volume:u,loop:h}=i;return{isPlaying:o===qe.Play||o!==qe.Pause&&((n==null?void 0:n.isPlaying)||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:r??(n==null?void 0:n.currentTimeAtLastInteraction)??0,lastInteractionTimeOffset:s,playbackRate:a??(n==null?void 0:n.playbackRate)??1,volume:u??(n==null?void 0:n.volume)??1,muted:l??(n==null?void 0:n.muted)??t.getAttribute("muted")===null,loop:h??(n==null?void 0:n.loop)??t.getAttribute("loop")===null}}syncTargetWithState(t){const s=this.mediaMap.get(t);if(!s)return;const{muted:i,loop:n,volume:o,isPlaying:a}=s,r=this.service.state.matches("paused"),l=s.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:s}),t.volume!==o&&(t.volume=o),t.muted=i,t.loop=n,t.playbackRate!==l&&(t.playbackRate=l),a&&!r?t.play():t.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(t,s,i){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;const n=t,o=i.getMeta(n);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),r=o.attributes;let l=!1;r.rr_mediaState?l=r.rr_mediaState==="played":l=n.getAttribute("autoplay")!==null,l&&a&&n.pause();let u=1;typeof r.rr_mediaPlaybackRate=="number"&&(u=r.rr_mediaPlaybackRate);let h=!1;typeof r.rr_mediaMuted=="boolean"?h=r.rr_mediaMuted:h=n.getAttribute("muted")!==null;let c=!1;typeof r.rr_mediaLoop=="boolean"?c=r.rr_mediaLoop:c=n.getAttribute("loop")!==null;let d=1;typeof r.rr_mediaVolume=="number"&&(d=r.rr_mediaVolume);let m=0;typeof r.rr_mediaCurrentTime=="number"&&(m=r.rr_mediaCurrentTime),this.mediaMap.set(n,{isPlaying:l,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:s,playbackRate:u,volume:d,muted:h,loop:c}),this.syncTargetWithState(n)}mediaMutation({target:t,timeOffset:s,mutation:i}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:s,mutation:i})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}}function Nh(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const s=e.HTMLElement||e.Element,i=468,n={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:s.prototype.scroll||l,scrollIntoView:s.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(f){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(f)}const r=a(e.navigator.userAgent)?1:0;function l(f,w){this.scrollLeft=f,this.scrollTop=w}function u(f){return .5*(1-Math.cos(Math.PI*f))}function h(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(f,w){if(w==="Y")return f.clientHeight+r<f.scrollHeight;if(w==="X")return f.clientWidth+r<f.scrollWidth}function d(f,w){const g=e.getComputedStyle(f,null)["overflow"+w];return g==="auto"||g==="scroll"}function m(f){const w=c(f,"Y")&&d(f,"Y"),g=c(f,"X")&&d(f,"X");return w||g}function b(f){for(;f!==t.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function p(f){const w=o();let g,E,P,B=(w-f.startTime)/i;B=B>1?1:B,g=u(B),E=f.startX+(f.x-f.startX)*g,P=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,E,P),(E!==f.x||P!==f.y)&&e.requestAnimationFrame(p.bind(e,f))}function S(f,w,g){let E,P,B,L;const W=o();f===t.body?(E=e,P=e.scrollX||e.pageXOffset,B=e.scrollY||e.pageYOffset,L=n.scroll):(E=f,P=f.scrollLeft,B=f.scrollTop,L=l),p({scrollable:E,method:L,startTime:W,startX:P,startY:B,x:w,y:g})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){n.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}S.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])){n.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},s.prototype.scroll=s.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(h(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");n.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,w=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof w>"u"?this.scrollTop:~~w)},s.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){n.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},s.prototype.scrollIntoView=function(){if(h(arguments[0])===!0){n.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=b(this),w=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==t.body?(S.call(this,f,f.scrollLeft+g.left-w.left,f.scrollTop+g.top-w.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):e.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}const Th=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],kh=5*1e3,Dh=Nr||mh,Yi="[replayer]",_e={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Gi(e){return e.type==A.IncrementalSnapshot&&(e.data.source==T.TouchMove||e.data.source==T.MouseInteraction&&e.data.type==F.TouchStart)}class Rh{constructor(t,s){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new ut),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",Dh()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",pi()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",Xi()),v(this,"styleMirror",new Ga),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"textValueMap",new Map),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(this,"handleResize",r=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(r.width)),l.setAttribute("height",String(r.height)))}),v(this,"applyEventsSynchronously",r=>{for(const l of r){switch(l.type){case A.DomContentLoaded:case A.Load:case A.Custom:continue;case A.FullSnapshot:case A.Meta:case A.Plugin:case A.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),v(this,"getCastFn",(r,l=!1)=>{let u;switch(r.type){case A.DomContentLoaded:case A.Load:break;case A.Custom:u=()=>{this.emitter.emit(N.CustomEvent,r)};break;case A.Meta:u=()=>this.emitter.emit(N.Resize,{width:r.data.width,height:r.data.height});break;case A.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===r){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(r,l),(h=this.iframe.contentWindow)==null||h.scrollTo(r.data.initialOffset)};break;case A.IncrementalSnapshot:u=()=>{if(this.applyIncremental(r,l),!l&&(r===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=r.timestamp)&&this.isUserInteraction(h)){h.delay-r.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent)if(this.config.skipInactive)this.play(this.nextUserInteractionEvent.timestamp-this.getMetaData().startTime-1e3);else{const h=this.nextUserInteractionEvent.delay-r.delay,c={speed:Math.min(Math.round(h/kh),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:c}),this.emitter.emit(N.SkipStart,c)}}};break}return()=>{u&&u();for(const c of this.config.plugins||[])c.handler&&c.handler(r,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:r}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&r===this.service.state.context.events[h]){const c=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};let d=50;r.type===A.IncrementalSnapshot&&r.data.source===T.MouseMove&&r.data.positions.length&&(d+=Math.max(0,-r.data.positions[0].timeOffset)),setTimeout(c,d)}this.emitter.emit(N.EventCast,r)}}),!(s!=null&&s.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:_e,useVirtualDom:!0,logger:console};this.config=Object.assign({},i,s),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom();for(const r of this.config.plugins||[])r.getMirror&&r.getMirror({nodeMirror:this.mirror});this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const r={mirror:this.mirror,applyCanvas:(l,u,h)=>{_i({event:l,mutation:u,target:h,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===T.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===T.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(const h of this.config.plugins||[])h.onBuild&&h.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{ce(this.iframe.contentDocument,this.virtualDom,r,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],h=pe(u.node,this.mirror,this.virtualDom.mirror);ce(h,u.node,r,this.virtualDom.mirror),u.node=h}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[r,l]=this.lastMouseDownEvent;r.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear()});const n=new Sh([],{speed:this.config.speed});this.service=Ch({events:t.map(r=>s&&s.unpackFn?s.unpackFn(r):r).sort((r,l)=>r.timestamp-l.timestamp),timer:n,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(r=>{this.emitter.emit(N.StateChange,{player:r})}),this.speedService=Eh({normalSpeed:-1,timer:n}),this.speedService.start(),this.speedService.subscribe(r=>{this.emitter.emit(N.StateChange,{speed:r})}),this.mediaManager=new Mh({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(r=>r.type===A.Meta),a=this.service.state.context.events.find(r=>r.type===A.FullSnapshot);if(o){const{width:r,height:l}=o.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:r,height:l})},0)}a&&setTimeout(()=>{var r;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(r=this.iframe.contentWindow)==null||r.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Gi)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,s){return this.emitter.on(t,s),this}off(t,s){return this.emitter.off(t,s),this}setConfig(t){Object.keys(t).forEach(s=>{t[s],this.config[s]=t[s]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const t=this.service.state.context.events[0],s=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:s.timestamp,totalTime:s.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:s}=this.service.state.context;return t-s[0].timestamp}getMirror(){return this.mirror}play(t=0){var s,i;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(i=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||i.classList.remove("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Start)}pause(t){var s,i;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(i=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||i.classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Pause)}resume(t=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(N.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear(),this.config.root.removeChild(this.wrapper),this.emitter.emit(N.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const s=this.config.unpackFn?this.config.unpackFn(t):t;Gi(s)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:s}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=pi()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Nh(this.iframe.contentWindow,this.iframe.contentDocument),Va(this.iframe.contentWindow))}rebuildFullSnapshot(t,s=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const i=[],n=(r,l)=>{if(this.collectIframeAndAttachDocument(i,r),this.mediaManager.isSupportedMediaElement(r)){const{events:u}=this.service.state.context;this.mediaManager.addMediaElements(r,t.timestamp-u[0].timestamp,this.mirror)}for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(r,{id:l,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.textValueMap.clear(),ja(t.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,t.data.node.id);for(const{mutationInQueue:r,builtNode:l}of i)this.attachDocumentToIframe(r,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==r);const{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,t),s||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,s){var i;const n=Th(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Mr(o,this.virtualDom.unserializedId)),t.insertBefore(o,s),o.rules.push({source:T.StyleSheetRule,adds:n.map((a,r)=>({rule:a,index:r}))})}else{const o=document.createElement("style");t.insertBefore(o,s);for(let a=0;a<n.length;a++)(i=o.sheet)==null||i.insertRule(n[a],a)}}attachDocumentToIframe(t,s){const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,n=[],o=(a,r)=>{this.collectIframeAndAttachDocument(n,a);const l=i.getMeta(a);if((l==null?void 0:l.type)===R.Element&&(l==null?void 0:l.tagName.toUpperCase())==="HTML"){const{documentElement:u,head:h}=s.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:r,replayer:this})};St(t.node,{doc:s.contentDocument,mirror:i,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(s.contentDocument,t.node.id);for(const{mutationInQueue:a,builtNode:r}of n)this.attachDocumentToIframe(a,r),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==a)}collectIframeAndAttachDocument(t,s){if(Oe(s,this.mirror)){const i=this.newDocumentQueue.find(n=>n.parentId===this.mirror.getId(s));i&&t.push({mutationInQueue:i,builtNode:s})}}waitForStylesheetLoad(){var t;const s=(t=this.iframe.contentDocument)==null?void 0:t.head;if(s){const i=new Set;let n,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const r=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};s.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(i.add(l),l.addEventListener("load",()=>{i.delete(l),i.size===0&&n!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),n&&clearTimeout(n),r())}))}),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),n=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),n=-1,r()},this.config.loadTimeout))}}async preloadAllImages(){const t=[];for(const s of this.service.state.context.events)s.type===A.IncrementalSnapshot&&s.data.source===T.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(s.data,s)),("commands"in s.data?s.data.commands:[s.data]).forEach(i=>{this.preloadImages(i,s)}));return Promise.all(t)}preloadImages(t,s){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(s)){const i=document.createElement("canvas"),n=i.getContext("2d"),o=n==null?void 0:n.createImageData(i.width,i.height);n==null||n.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(t,s){if(!this.canvasEventMap.has(s)){const i={isUnchanged:!0};if("commands"in t){const n=await Promise.all(t.commands.map(async o=>{const a=await Promise.all(o.args.map(H(this.imageMap,null,i)));return{...o,args:a}}));i.isUnchanged===!1&&this.canvasEventMap.set(s,{...t,commands:n})}else{const n=await Promise.all(t.args.map(H(this.imageMap,null,i)));i.isUnchanged===!1&&this.canvasEventMap.set(s,{...t,args:n})}}}applyIncremental(t,s){var i,n,o;const{data:a}=t;switch(a.source){case T.Mutation:{try{this.applyMutation(a,s)}catch(r){this.warn(`Exception in mutation ${r.message||r}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(s){const r=a.positions[a.positions.length-1];this.mousePos={x:r.x,y:r.y,id:r.id,debugData:a}}else a.positions.forEach(r=>{const l={doAction:()=>{this.moveAndHover(r.x,r.y,r.id,s,a)},delay:r.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((i=a.positions[0])==null?void 0:i.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const r=new Event(jr(F[a.type])),l=this.mirror.getNode(a.id);if(!l)return this.debugNodeNotFound(a,a.id);this.emitter.emit(N.MouseInteraction,{type:a.type,target:l});const{triggerFocus:u}=this.config;switch(a.type){case F.Blur:"blur"in l&&l.blur();break;case F.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:s?(a.type===F.TouchStart?this.touchActive=!0:a.type===F.TouchEnd&&(this.touchActive=!1),a.type===F.MouseDown?this.lastMouseDownEvent=[l,r]:a.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,s,a),a.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(r));break;case F.TouchCancel:s?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(r)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const r=this.virtualDom.mirror.getNode(a.id);if(!r)return this.debugNodeNotFound(a,a.id);r.scrollData=a;break}this.applyScroll(a,s);break}case T.ViewportResize:this.emitter.emit(N.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const r=this.virtualDom.mirror.getNode(a.id);if(!r)return this.debugNodeNotFound(a,a.id);r.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const r=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!r)return this.debugNodeNotFound(a,a.id);const l=r,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:t.timestamp-u[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((n=this.virtualDom.mirror.getNode(a.id))==null||n.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const r=this.virtualDom.mirror.getNode(a.id);if(!r)return this.debugNodeNotFound(a,a.id);r.canvasMutations.push({event:t,mutation:a})}else{const r=this.mirror.getNode(a.id);if(!r)return this.debugNodeNotFound(a,a.id);_i({event:t,mutation:a,target:r,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const r=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(r)}catch(r){this.warn(r)}break}case T.Selection:{if(s){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(t,s){if(this.config.useVirtualDom&&!this.usingVirtualDom&&s&&(this.usingVirtualDom=!0,ph(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const h=this.legacy_missingNodeRetryMap[u],c=Er(h.node,this.virtualDom,this.mirror);c&&(h.node=c)}catch(h){this.warn(h)}const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.filter(u=>i.getNode(u.id)?!0:(this.warnNodeNotFound(t,u.id),!1)).forEach(u=>{var h;const c=i.getNode(u.id);if(!c)return;let d=i.getNode(u.parentId);if(!d)return this.warnNodeNotFound(t,u.parentId);if(u.isShadow&&Vt(d)&&(d=d.shadowRoot),i.removeNodeFromMap(c),d)try{d.removeChild(c),this.usingVirtualDom&&c.nodeName==="#text"&&d.nodeName==="STYLE"&&((h=d.rules)==null?void 0:h.length)>0&&(d.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",d,c,t);else throw m}});const n={...this.legacy_missingNodeRetryMap},o=[],a=u=>{let h=null;return u.nextId&&(h=i.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!h},r=u=>{var h,c;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=i.getNode(u.parentId);if(!d)return u.node.type===R.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Vt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,b=null;if(u.previousId&&(m=i.getNode(u.previousId)),u.nextId&&(b=i.getNode(u.nextId)),a(u))return o.push(u);if(u.node.rootId&&!i.getNode(u.node.rootId))return;const p=u.node.rootId?i.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Oe(d,i)){this.attachDocumentToIframe(u,d);return}const S=(g,E)=>{if(!this.usingVirtualDom)for(const P of this.config.plugins||[])P.onBuild&&P.onBuild(g,{id:E,replayer:this})},f=St(u.node,{doc:p,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:S});if(u.previousId===-1||u.nextId===-1){n[u.node.id]={node:f,mutation:u};return}const w=i.getMeta(d);if(w&&w.type===R.Element&&u.node.type===R.Text){const g=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(w.tagName==="textarea")for(const E of g)E.nodeType===d.TEXT_NODE&&d.removeChild(E);else if(w.tagName==="style"&&g.length===1)for(const E of g)E.nodeType===d.TEXT_NODE&&!i.hasNode(E)&&(f.textContent=E.textContent,d.removeChild(E))}else if((w==null?void 0:w.type)===R.Document){const g=d;u.node.type===R.DocumentType&&((h=g.childNodes[0])==null?void 0:h.nodeType)===Node.DOCUMENT_TYPE_NODE&&g.removeChild(g.childNodes[0]),f.nodeName==="HTML"&&g.documentElement&&g.removeChild(g.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?d.insertBefore(f,m.nextSibling):b&&b.parentNode?d.contains(b)?d.insertBefore(f,b):d.insertBefore(f,null):d.appendChild(f),S(f,u.node.id),this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((c=d.rules)==null?void 0:c.length)>0&&(d.rules=[]),Oe(f,this.mirror)){const g=this.mirror.getId(f),E=this.newDocumentQueue.find(P=>P.parentId===g);E&&(this.attachDocumentToIframe(E,f),this.newDocumentQueue=this.newDocumentQueue.filter(P=>P!==E))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(n,d,f,u)};t.adds.forEach(u=>{r(u)});const l=Date.now();for(;o.length;){const u=za(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const h of u)i.getNode(h.value.parentId)?An(h,c=>{r(c)}):this.debug("Drop resolve tree since there is no parent for the root node.",h)}Object.keys(n).length&&Object.assign(this.legacy_missingNodeRetryMap,n),Ya(t.texts).forEach(u=>{var h;const c=i.getNode(u.id);if(!c)return t.removes.find(m=>m.id===u.id)?void 0:this.warnNodeNotFound(t,u.id);let d;if(u.delta){const m=this.textValueMap.get(u.id)||"";d=Za(m,u.delta)}else d=u.value??null;if(c.textContent=d,d!==null&&this.textValueMap.set(u.id,d),this.usingVirtualDom){const m=c.parentNode;((h=m==null?void 0:m.rules)==null?void 0:h.length)>0&&(m.rules=[])}}),t.attributes.forEach(u=>{var h;const c=i.getNode(u.id);if(!c)return t.removes.find(d=>d.id===u.id)?void 0:this.warnNodeNotFound(t,u.id);for(const d in u.attributes)if(typeof d=="string"){const m=u.attributes[d];if(m===null)c.removeAttribute(d);else if(typeof m=="string")try{if(d==="_cssText"&&(c.nodeName==="LINK"||c.nodeName==="STYLE"))try{const b=i.getMeta(c);Object.assign(b.attributes,u.attributes);const p=St(b,{doc:c.ownerDocument,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache}),S=c.nextSibling,f=c.parentNode;if(p&&f){f.removeChild(c),f.insertBefore(p,S),i.replace(u.id,p);break}}catch{}if(d==="value"&&c.nodeName==="TEXTAREA"){const b=c;b.childNodes.forEach(S=>b.removeChild(S));const p=(h=c.ownerDocument)==null?void 0:h.createTextNode(m);p&&b.appendChild(p)}else c.setAttribute(d,m)}catch(b){this.warn("An error occurred may due to the checkout feature.",b)}else if(d==="style"){const b=m,p=c;for(const S in b)if(b[S]===!1)p.style.removeProperty(S);else if(b[S]instanceof Array){const f=b[S];p.style.setProperty(S,f[0],f[1])}else{const f=b[S];p.style.setProperty(S,f)}}}})}applyScroll(t,s){var i,n;const o=this.mirror.getNode(t.id);if(!o)return this.debugNodeNotFound(t,t.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(i=this.iframe.contentWindow)==null||i.scrollTo({top:t.y,left:t.x,behavior:s?"auto":"smooth"});else if((a==null?void 0:a.type)===R.Document)(n=o.defaultView)==null||n.scrollTo({top:t.y,left:t.x,behavior:s?"auto":"smooth"});else try{o.scrollTo({top:t.y,left:t.x,behavior:s?"auto":"smooth"})}catch{}}applyInput(t){const s=this.mirror.getNode(t.id);if(!s)return this.debugNodeNotFound(t,t.id);try{s.checked=t.isChecked,s.value=t.text}catch{}}applySelection(t){try{const s=new Set,i=t.ranges.map(({start:n,startOffset:o,end:a,endOffset:r})=>{const l=this.mirror.getNode(n),u=this.mirror.getNode(a);if(!l||!u)return;const h=new Range;h.setStart(l,o),h.setEnd(u,r);const c=l.ownerDocument,d=c==null?void 0:c.getSelection();return d&&s.add(d),{range:h,selection:d}});s.forEach(n=>n.removeAllRanges()),i.forEach(n=>{var o;return n&&((o=n.selection)==null?void 0:o.addRange(n.range))})}catch{}}applyStyleSheetMutation(t){var s;let i=null;t.styleId?i=this.styleMirror.getStyle(t.styleId):t.id&&(i=((s=this.mirror.getNode(t.id))==null?void 0:s.sheet)||null),i&&(t.source===T.StyleSheetRule?this.applyStyleSheetRule(t,i):t.source===T.StyleDeclaration&&this.applyStyleDeclaration(t,i))}applyStyleSheetRule(t,s){var i,n,o,a;if((i=t.adds)==null||i.forEach(({rule:r,index:l})=>{try{if(Array.isArray(l)){const{positions:u,index:h}=fi(l);bt(s.cssRules,u).insertRule(r,h)}else{const u=l===void 0?void 0:Math.min(l,s.cssRules.length);s==null||s.insertRule(r,u)}}catch{}}),(n=t.removes)==null||n.forEach(({index:r})=>{try{if(Array.isArray(r)){const{positions:l,index:u}=fi(r);bt(s.cssRules,l).deleteRule(u||0)}else s==null||s.deleteRule(r)}catch{}}),t.replace)try{(o=s.replace)==null||o.call(s,t.replace)}catch{}if(t.replaceSync)try{(a=s.replaceSync)==null||a.call(s,t.replaceSync)}catch{}}applyStyleDeclaration(t,s){t.set&&bt(s.rules,t.index).style.setProperty(t.set.property,t.set.value,t.set.priority),t.remove&&bt(s.rules,t.index).style.removeProperty(t.remove.property)}applyAdoptedStyleSheet(t){var s;const i=this.mirror.getNode(t.id);if(!i)return;(s=t.styles)==null||s.forEach(r=>{var l;let u=null,h=null;if(Vt(i)?h=((l=i.ownerDocument)==null?void 0:l.defaultView)||null:i.nodeName==="#document"&&(h=i.defaultView),!!h)try{u=new h.CSSStyleSheet,this.styleMirror.add(u,r.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:r.rules},u)}catch{}});const n=10;let o=0;const a=(r,l)=>{const u=l.map(h=>this.styleMirror.getStyle(h)).filter(h=>h!==null);Vt(r)?r.shadowRoot.adoptedStyleSheets=u:r.nodeName==="#document"&&(r.adoptedStyleSheets=u),u.length!==l.length&&o<n&&(setTimeout(()=>a(r,l),0+100*o),o++)};a(i,t.styleIds)}legacy_resolveMissingNode(t,s,i,n){const{previousId:o,nextId:a}=n,r=o&&t[o],l=a&&t[a];if(r){const{node:u,mutation:h}=r;s.insertBefore(u,i),delete t[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(t,s,u,h)}if(l){const{node:u,mutation:h}=l;s.insertBefore(u,i.nextSibling),delete t[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(t,s,u,h)}}moveAndHover(t,s,i,n,o){const a=this.mirror.getNode(i);if(!a)return this.debugNodeNotFound(o,i);const r=In(a,this.iframe),l=t*r.absoluteScale+r.x,u=s*r.absoluteScale+r.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,n||this.drawMouseTail({x:l,y:u}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:s,lineWidth:i,strokeStyle:n,duration:o}=this.config.mouseTail===!0?_e:Object.assign({},_e,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const r=this.mouseTail.getContext("2d");!r||!this.tailPositions.length||(r.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),r.beginPath(),r.lineWidth=i,r.lineCap=s,r.strokeStyle=n,r.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>r.lineTo(l.x,l.y)),r.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(r=>r!==t),a()},o/this.speedService.state.context.timer.speed)}hoverElements(t){var s;(s=this.lastHoveredRootNode||this.iframe.contentDocument)==null||s.querySelectorAll(".\\:hover").forEach(n=>{n.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let i=t;for(;i;)i.classList&&i.classList.add(":hover"),i=i.parentElement}isUserInteraction(t){return t.type!==A.IncrementalSnapshot?!1:t.data.source>T.Mutation&&t.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,s){this.warn(`Node with id '${s}' not found. `,t)}warnCanvasMutationFailed(t,s){this.warn("Has error on canvas update",s,"canvas mutation:",t)}debugNodeNotFound(t,s){this.debug(`Node with id '${s}' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(Yi,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(Yi,...t)}}exports.Replayer=Rh;
|
|
78
78
|
//# sourceMappingURL=replay.cjs.map
|