@posthog/rrweb-snapshot 0.0.12 → 0.0.14
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/rrweb-snapshot.cjs +3 -0
- package/dist/rrweb-snapshot.cjs.map +1 -1
- package/dist/rrweb-snapshot.js +3 -0
- package/dist/rrweb-snapshot.js.map +1 -1
- package/dist/rrweb-snapshot.umd.cjs +3 -0
- package/dist/rrweb-snapshot.umd.cjs.map +2 -2
- package/dist/rrweb-snapshot.umd.min.cjs +1 -1
- package/dist/rrweb-snapshot.umd.min.cjs.map +2 -2
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var module = { exports };
|
|
|
39
39
|
`),this.css+=i+"/*# sourceMappingURL="+n+" */"}applyPrevMaps(){for(let n of this.previous()){let i=this.toUrl(this.path(n.file)),d=n.root||e(n.file),p;this.mapOpts.sourcesContent===!1?(p=new s(n.text),p.sourcesContent&&(p.sourcesContent=null)):p=n.consumer(),this.map.applySourceMap(p,i,this.toUrl(this.path(d)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let n;for(let i=this.root.nodes.length-1;i>=0;i--)n=this.root.nodes[i],n.type==="comment"&&n.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(i)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),o&&g&&this.isMap())return this.generateMap();{let n="";return this.stringify(this.root,i=>{n+=i}),[n]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let n=this.previous()[0].consumer();n.file=this.outputFile(),this.map=f.fromSourceMap(n,{ignoreInvalidMapping:!0})}else this.map=new f({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 f({file:this.outputFile(),ignoreInvalidMapping:!0});let n=1,i=1,d="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},m,C;this.stringify(this.root,(S,w,v)=>{if(this.css+=S,w&&v!=="end"&&(p.generated.line=n,p.generated.column=i-1,w.source&&w.source.start?(p.source=this.sourcePath(w),p.original.line=w.source.start.line,p.original.column=w.source.start.column-1,this.map.addMapping(p)):(p.source=d,p.original.line=1,p.original.column=0,this.map.addMapping(p))),C=S.match(/\n/g),C?(n+=C.length,m=S.lastIndexOf(`
|
|
40
40
|
`),i=S.length-m):i+=S.length,w&&v!=="start"){let b=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==b.last||b.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=n,p.generated.column=i-2,this.map.addMapping(p)):(p.source=d,p.original.line=1,p.original.column=0,p.generated.line=n,p.generated.column=i-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(n=>n.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let n=this.mapOpts.annotation;return typeof n!="undefined"&&n!==!0?!1:this.previous().length?this.previous().some(i=>i.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(n=>n.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute||n.charCodeAt(0)===60||/^\w+:\/\//.test(n))return n;let i=this.memoizedPaths.get(n);if(i)return i;let d=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(d=e(l(d,this.mapOpts.annotation)));let p=r(d,n);return this.memoizedPaths.set(n,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(n=>{if(n.source&&n.source.input.map){let i=n.source.input.map;this.previousMaps.includes(i)||this.previousMaps.push(i)}});else{let n=new h(this.originalCSS,this.opts);n.map&&this.previousMaps.push(n.map)}return this.previousMaps}setSourcesContent(){let n={};if(this.root)this.root.walk(i=>{if(i.source){let d=i.source.input.from;if(d&&!n[d]){n[d]=!0;let p=this.usesFileUrls?this.toFileUrl(d):this.toUrl(this.path(d));this.map.setSourceContent(p,i.source.input.css)}}});else if(this.css){let i=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(i,this.css)}}sourcePath(n){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(n.source.input.from):this.toUrl(this.path(n.source.input.from))}toBase64(n){return Buffer?Buffer.from(n).toString("base64"):window.btoa(unescape(encodeURIComponent(n)))}toFileUrl(n){let i=this.memoizedFileURLs.get(n);if(i)return i;if(c){let d=c(n).toString();return this.memoizedFileURLs.set(n,d),d}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(n){let i=this.memoizedURLs.get(n);if(i)return i;u==="\\"&&(n=n.replace(/\\/g,"/"));let d=encodeURI(n).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(n,d),d}}return Be=t,Be}var Fe,Wt;function Cr(){if(Wt)return Fe;Wt=1;const e=39,r=34,l=92,u=47,s=10,f=32,c=12,h=9,g=13,o=91,t=93,a=40,n=41,i=123,d=125,p=59,m=42,C=58,S=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,v=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,b=/.[\r\n"'(/\\]/,y=/[\da-f]/i;return Fe=function(E,M={}){let O=E.css.valueOf(),I=M.ignoreErrors,A,j,q,R,B,D,T,V,z,ut,ct=O.length,N=0,ge=[],re=[];function Mr(){return N}function ye(G){throw E.error("Unclosed "+G,N)}function _r(){return re.length===0&&N>=ct}function Pr(G){if(re.length)return re.pop();if(N>=ct)return;let we=G?G.ignoreUnclosed:!1;switch(A=O.charCodeAt(N),A){case s:case f:case h:case g:case c:{R=N;do R+=1,A=O.charCodeAt(R);while(A===f||A===s||A===h||A===g||A===c);D=["space",O.slice(N,R)],N=R-1;break}case o:case t:case i:case d:case C:case p:case n:{let ft=String.fromCharCode(A);D=[ft,ft,N];break}case a:{if(ut=ge.length?ge.pop()[1]:"",z=O.charCodeAt(N+1),ut==="url"&&z!==e&&z!==r&&z!==f&&z!==s&&z!==h&&z!==c&&z!==g){R=N;do{if(T=!1,R=O.indexOf(")",R+1),R===-1)if(I||we){R=N;break}else ye("bracket");for(V=R;O.charCodeAt(V-1)===l;)V-=1,T=!T}while(T);D=["brackets",O.slice(N,R+1),N,R],N=R}else R=O.indexOf(")",N+1),j=O.slice(N,R+1),R===-1||b.test(j)?D=["(","(",N]:(D=["brackets",j,N,R],N=R);break}case e:case r:{B=A===e?"'":'"',R=N;do{if(T=!1,R=O.indexOf(B,R+1),R===-1)if(I||we){R=N+1;break}else ye("string");for(V=R;O.charCodeAt(V-1)===l;)V-=1,T=!T}while(T);D=["string",O.slice(N,R+1),N,R],N=R;break}case S:{w.lastIndex=N+1,w.test(O),w.lastIndex===0?R=O.length-1:R=w.lastIndex-2,D=["at-word",O.slice(N,R+1),N,R],N=R;break}case l:{for(R=N,q=!0;O.charCodeAt(R+1)===l;)R+=1,q=!q;if(A=O.charCodeAt(R+1),q&&A!==u&&A!==f&&A!==s&&A!==h&&A!==g&&A!==c&&(R+=1,y.test(O.charAt(R)))){for(;y.test(O.charAt(R+1));)R+=1;O.charCodeAt(R+1)===f&&(R+=1)}D=["word",O.slice(N,R+1),N,R],N=R;break}default:{A===u&&O.charCodeAt(N+1)===m?(R=O.indexOf("*/",N+2)+1,R===0&&(I||we?R=O.length:ye("comment")),D=["comment",O.slice(N,R+1),N,R],N=R):(v.lastIndex=N+1,v.test(O),v.lastIndex===0?R=O.length-1:R=v.lastIndex-2,D=["word",O.slice(N,R+1),N,R],ge.push(D),N=R);break}}return N++,D}function kr(G){re.push(G)}return{back:kr,endOfFile:_r,nextToken:Pr,position:Mr}},Fe}var qe,jt;function xr(){if(jt)return qe;jt=1;let e=it(),r=ee(),l=de(),u=te(),s=nt(),f=Cr();const c={empty:!0,space:!0};function h(o){for(let t=o.length-1;t>=0;t--){let a=o[t],n=a[3]||a[2];if(n)return n}}class g{constructor(t){this.input=t,this.root=new u,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 a=new e;a.name=t[1].slice(1),a.name===""&&this.unnamedAtrule(a,t),this.init(a,t[2]);let n,i,d,p=!1,m=!1,C=[],S=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),n=t[0],n==="("||n==="["?S.push(n==="("?")":"]"):n==="{"&&S.length>0?S.push("}"):n===S[S.length-1]&&S.pop(),S.length===0)if(n===";"){a.source.end=this.getPosition(t[2]),a.source.end.offset++,this.semicolon=!0;break}else if(n==="{"){m=!0;break}else if(n==="}"){if(C.length>0){for(d=C.length-1,i=C[d];i&&i[0]==="space";)i=C[--d];i&&(a.source.end=this.getPosition(i[3]||i[2]),a.source.end.offset++)}this.end(t);break}else C.push(t);else C.push(t);if(this.tokenizer.endOfFile()){p=!0;break}}a.raws.between=this.spacesAndCommentsFromEnd(C),C.length?(a.raws.afterName=this.spacesAndCommentsFromStart(C),this.raw(a,"params",C),p&&(t=C[C.length-1],a.source.end=this.getPosition(t[3]||t[2]),a.source.end.offset++,this.spaces=a.raws.between,a.raws.between="")):(a.raws.afterName="",a.params=""),m&&(a.nodes=[],this.current=a)}checkMissedSemicolon(t){let a=this.colon(t);if(a===!1)return;let n=0,i;for(let d=a-1;d>=0&&(i=t[d],!(i[0]!=="space"&&(n+=1,n===2)));d--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let a=0,n,i,d;for(let[p,m]of t.entries()){if(i=m,d=i[0],d==="("&&(a+=1),d===")"&&(a-=1),a===0&&d===":")if(!n)this.doubleColon(i);else{if(n[0]==="word"&&n[1]==="progid")continue;return p}n=i}return!1}comment(t){let a=new r;this.init(a,t[2]),a.source.end=this.getPosition(t[3]||t[2]),a.source.end.offset++;let n=t[1].slice(2,-2);if(/^\s*$/.test(n))a.text="",a.raws.left=n,a.raws.right="";else{let i=n.match(/^(\s*)([^]*\S)(\s*)$/);a.text=i[2],a.raws.left=i[1],a.raws.right=i[3]}}createTokenizer(){this.tokenizer=f(this.input)}decl(t,a){let n=new l;this.init(n,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(i[3]||i[2]||h(t)),n.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let S=t[0][0];if(S===":"||S==="space"||S==="comment")break;n.prop+=t.shift()[1]}n.raws.between="";let d;for(;t.length;)if(d=t.shift(),d[0]===":"){n.raws.between+=d[1];break}else d[0]==="word"&&/\w/.test(d[1])&&this.unknownWord([d]),n.raws.between+=d[1];(n.prop[0]==="_"||n.prop[0]==="*")&&(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let p=[],m;for(;t.length&&(m=t[0][0],!(m!=="space"&&m!=="comment"));)p.push(t.shift());this.precheckMissedSemicolon(t);for(let S=t.length-1;S>=0;S--){if(d=t[S],d[1].toLowerCase()==="!important"){n.important=!0;let w=this.stringFrom(t,S);w=this.spacesFromEnd(t)+w,w!==" !important"&&(n.raws.important=w);break}else if(d[1].toLowerCase()==="important"){let w=t.slice(0),v="";for(let b=S;b>0;b--){let y=w[b][0];if(v.trim().startsWith("!")&&y!=="space")break;v=w.pop()[1]+v}v.trim().startsWith("!")&&(n.important=!0,n.raws.important=v,t=w)}if(d[0]!=="space"&&d[0]!=="comment")break}t.some(S=>S[0]!=="space"&&S[0]!=="comment")&&(n.raws.between+=p.map(S=>S[1]).join(""),p=[]),this.raw(n,"value",p.concat(t),a),n.value.includes(":")&&!a&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let a=new s;this.init(a,t[2]),a.selector="",a.raws.between="",this.current=a}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 a=this.current.nodes[this.current.nodes.length-1];a&&a.type==="rule"&&!a.raws.ownSemicolon&&(a.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let a=this.input.fromOffset(t);return{column:a.col,line:a.line,offset:t}}init(t,a){this.current.push(t),t.source={input:this.input,start:this.getPosition(a)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let a=!1,n=null,i=!1,d=null,p=[],m=t[1].startsWith("--"),C=[],S=t;for(;S;){if(n=S[0],C.push(S),n==="("||n==="[")d||(d=S),p.push(n==="("?")":"]");else if(m&&i&&n==="{")d||(d=S),p.push("}");else if(p.length===0)if(n===";")if(i){this.decl(C,m);return}else break;else if(n==="{"){this.rule(C);return}else if(n==="}"){this.tokenizer.back(C.pop()),a=!0;break}else n===":"&&(i=!0);else n===p[p.length-1]&&(p.pop(),p.length===0&&(d=null));S=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(a=!0),p.length>0&&this.unclosedBracket(d),a&&i){if(!m)for(;C.length&&(S=C[C.length-1][0],!(S!=="space"&&S!=="comment"));)this.tokenizer.back(C.pop());this.decl(C,m)}else this.unknownWord(C)}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,a,n,i){let d,p,m=n.length,C="",S=!0,w,v;for(let b=0;b<m;b+=1)d=n[b],p=d[0],p==="space"&&b===m-1&&!i?S=!1:p==="comment"?(v=n[b-1]?n[b-1][0]:"empty",w=n[b+1]?n[b+1][0]:"empty",!c[v]&&!c[w]?C.slice(-1)===","?S=!1:C+=d[1]:S=!1):C+=d[1];if(!S){let b=n.reduce((y,x)=>y+x[1],"");t.raws[a]={raw:b,value:C}}t[a]=C}rule(t){t.pop();let a=new s;this.init(a,t[0][2]),a.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(a,"selector",t),this.current=a}spacesAndCommentsFromEnd(t){let a,n="";for(;t.length&&(a=t[t.length-1][0],!(a!=="space"&&a!=="comment"));)n=t.pop()[1]+n;return n}spacesAndCommentsFromStart(t){let a,n="";for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)n+=t.shift()[1];return n}spacesFromEnd(t){let a,n="";for(;t.length&&(a=t[t.length-1][0],a==="space");)n=t.pop()[1]+n;return n}stringFrom(t,a){let n="";for(let i=a;i<t.length;i++)n+=t[i][1];return t.splice(a,t.length-a),n}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",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,a){throw this.input.error("At-rule without name",{offset:a[2]},{offset:a[2]+a[1].length})}}return qe=g,qe}var ze,$t;function ot(){if($t)return ze;$t=1;let e=$(),r=me(),l=xr();function u(s,f){let c=new r(s,f),h=new l(c);try{h.parse()}catch(g){throw g}return h.root}return ze=u,u.default=u,e.registerParse(u),ze}var We,Vt;function Rr(){if(Vt)return We;Vt=1;class e{constructor(l,u={}){if(this.type="warning",this.text=l,u.node&&u.node.source){let s=u.node.rangeBy(u);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in u)this[s]=u[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}}return We=e,e.default=e,We}var je,Gt;function lt(){if(Gt)return je;Gt=1;let e=Rr();class r{constructor(u,s,f){this.processor=u,this.messages=[],this.root=s,this.opts=f,this.css=void 0,this.map=void 0}toString(){return this.css}warn(u,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let f=new e(u,s);return this.messages.push(f),f}warnings(){return this.messages.filter(u=>u.type==="warning")}get content(){return this.css}}return je=r,r.default=r,je}var $e,Ht;function Er(){if(Ht)return $e;Ht=1;let e={};return $e=function(l){e[l]||(e[l]=!0,typeof console!="undefined"&&console.warn&&console.warn(l))},$e}var Ve,Jt;function Or(){if(Jt)return Ve;Jt=1;let e=$(),r=st(),l=vr(),u=ot(),s=lt(),f=te(),c=he(),{isClean:h,my:g}=rt(),o=Er();const t={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},a={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},n={Once:!0,postcssPlugin:!0,prepare:!0},i=0;function d(v){return typeof v=="object"&&typeof v.then=="function"}function p(v){let b=!1,y=t[v.type];return v.type==="decl"?b=v.prop.toLowerCase():v.type==="atrule"&&(b=v.name.toLowerCase()),b&&v.append?[y,y+"-"+b,i,y+"Exit",y+"Exit-"+b]:b?[y,y+"-"+b,y+"Exit",y+"Exit-"+b]:v.append?[y,i,y+"Exit"]:[y,y+"Exit"]}function m(v){let b;return v.type==="document"?b=["Document",i,"DocumentExit"]:v.type==="root"?b=["Root",i,"RootExit"]:b=p(v),{eventIndex:0,events:b,iterator:0,node:v,visitorIndex:0,visitors:[]}}function C(v){return v[h]=!1,v.nodes&&v.nodes.forEach(b=>C(b)),v}let S={};class w{constructor(b,y,x){this.stringified=!1,this.processed=!1;let E;if(typeof y=="object"&&y!==null&&(y.type==="root"||y.type==="document"))E=C(y);else if(y instanceof w||y instanceof s)E=C(y.root),y.map&&(typeof x.map=="undefined"&&(x.map={}),x.map.inline||(x.map.inline=!1),x.map.prev=y.map);else{let M=u;x.syntax&&(M=x.syntax.parse),x.parser&&(M=x.parser),M.parse&&(M=M.parse);try{E=M(y,x)}catch(O){this.processed=!0,this.error=O}E&&!E[g]&&e.rebuild(E)}this.result=new s(b,E,x),this.helpers=K(F({},S),{postcss:S,result:this.result}),this.plugins=this.processor.plugins.map(M=>typeof M=="object"&&M.prepare?F(F({},M),M.prepare(this.result)):M)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(b){return this.async().catch(b)}finally(b){return this.async().then(b,b)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(b,y){let x=this.result.lastPlugin;try{y&&y.addToError(b),this.error=b,b.name==="CssSyntaxError"&&!b.plugin?(b.plugin=x.postcssPlugin,b.setMessage()):x.postcssVersion}catch(E){console&&console.error&&console.error(E)}return b}prepareVisitors(){this.listeners={};let b=(y,x,E)=>{this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push([y,E])};for(let y of this.plugins)if(typeof y=="object")for(let x in y){if(!a[x]&&/^[A-Z]/.test(x))throw new Error(`Unknown event ${x} in ${y.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!n[x])if(typeof y[x]=="object")for(let E in y[x])E==="*"?b(y,x,y[x][E]):b(y,x+"-"+E.toLowerCase(),y[x][E]);else typeof y[x]=="function"&&b(y,x,y[x])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let b=0;b<this.plugins.length;b++){let y=this.plugins[b],x=this.runOnRoot(y);if(d(x))try{await x}catch(E){throw this.handleError(E)}}if(this.prepareVisitors(),this.hasListener){let b=this.result.root;for(;!b[h];){b[h]=!0;let y=[m(b)];for(;y.length>0;){let x=this.visitTick(y);if(d(x))try{await x}catch(E){let M=y[y.length-1].node;throw this.handleError(E,M)}}}if(this.listeners.OnceExit)for(let[y,x]of this.listeners.OnceExit){this.result.lastPlugin=y;try{if(b.type==="document"){let E=b.nodes.map(M=>x(M,this.helpers));await Promise.all(E)}else await x(b,this.helpers)}catch(E){throw this.handleError(E)}}}return this.processed=!0,this.stringify()}runOnRoot(b){this.result.lastPlugin=b;try{if(typeof b=="object"&&b.Once){if(this.result.root.type==="document"){let y=this.result.root.nodes.map(x=>b.Once(x,this.helpers));return d(y[0])?Promise.all(y):y}return b.Once(this.result.root,this.helpers)}else if(typeof b=="function")return b(this.result.root,this.result)}catch(y){throw this.handleError(y)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let b=this.result.opts,y=c;b.syntax&&(y=b.syntax.stringify),b.stringifier&&(y=b.stringifier),y.stringify&&(y=y.stringify);let E=new l(y,this.result.root,this.result.opts).generate();return this.result.css=E[0],this.result.map=E[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 b of this.plugins){let y=this.runOnRoot(b);if(d(y))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let b=this.result.root;for(;!b[h];)b[h]=!0,this.walkSync(b);if(this.listeners.OnceExit)if(b.type==="document")for(let y of b.nodes)this.visitSync(this.listeners.OnceExit,y);else this.visitSync(this.listeners.OnceExit,b)}return this.result}then(b,y){return this.async().then(b,y)}toString(){return this.css}visitSync(b,y){for(let[x,E]of b){this.result.lastPlugin=x;let M;try{M=E(y,this.helpers)}catch(O){throw this.handleError(O,y.proxyOf)}if(y.type!=="root"&&y.type!=="document"&&!y.parent)return!0;if(d(M))throw this.getAsyncError()}}visitTick(b){let y=b[b.length-1],{node:x,visitors:E}=y;if(x.type!=="root"&&x.type!=="document"&&!x.parent){b.pop();return}if(E.length>0&&y.visitorIndex<E.length){let[O,I]=E[y.visitorIndex];y.visitorIndex+=1,y.visitorIndex===E.length&&(y.visitors=[],y.visitorIndex=0),this.result.lastPlugin=O;try{return I(x.toProxy(),this.helpers)}catch(A){throw this.handleError(A,x)}}if(y.iterator!==0){let O=y.iterator,I;for(;I=x.nodes[x.indexes[O]];)if(x.indexes[O]+=1,!I[h]){I[h]=!0,b.push(m(I));return}y.iterator=0,delete x.indexes[O]}let M=y.events;for(;y.eventIndex<M.length;){let O=M[y.eventIndex];if(y.eventIndex+=1,O===i){x.nodes&&x.nodes.length&&(x[h]=!0,y.iterator=x.getIterator());return}else if(this.listeners[O]){y.visitors=this.listeners[O];return}}b.pop()}walkSync(b){b[h]=!0;let y=p(b);for(let x of y)if(x===i)b.nodes&&b.each(E=>{E[h]||this.walkSync(E)});else{let E=this.listeners[x];if(E&&this.visitSync(E,b.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return w.registerPostcss=v=>{S=v},Ve=w,w.default=w,f.registerLazyResult(w),r.registerLazyResult(w),Ve}var Ge,Yt;function ki(){if(Yt)return Ge;Yt=1;let e=vr(),r=ot();const l=lt();let u=he(),s=Er();class f{constructor(h,g,o){g=g.toString(),this.stringified=!1,this._processor=h,this._css=g,this._opts=o,this._map=void 0;let t,a=u;this.result=new l(this._processor,t,this._opts),this.result.css=g;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let i=new e(a,t,this._opts,g);if(i.isMap()){let[d,p]=i.generate();d&&(this.result.css=d),p&&(this.result.map=p)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(h){return this.async().catch(h)}finally(h){return this.async().then(h,h)}sync(){if(this.error)throw this.error;return this.result}then(h,g){return this.async().then(h,g)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let h,g=r;try{h=g(this._css,this._opts)}catch(o){this.error=o}if(this.error)throw this.error;return this._root=h,h}get[Symbol.toStringTag](){return"NoWorkResult"}}return Ge=f,f.default=f,Ge}var He,Kt;function Ii(){if(Kt)return He;Kt=1;let e=st(),r=Or(),l=ki(),u=te();class s{constructor(c=[]){this.version="8.5.1",this.plugins=this.normalize(c)}normalize(c){let h=[];for(let g of c)if(g.postcss===!0?g=g():g.postcss&&(g=g.postcss),typeof g=="object"&&Array.isArray(g.plugins))h=h.concat(g.plugins);else if(typeof g=="object"&&g.postcssPlugin)h.push(g);else if(typeof g=="function")h.push(g);else if(!(typeof g=="object"&&(g.parse||g.stringify)))throw new Error(g+" is not a PostCSS plugin");return h}process(c,h={}){return!this.plugins.length&&!h.parser&&!h.stringifier&&!h.syntax?new l(this,c,h):new r(this,c,h)}use(c){return this.plugins=this.plugins.concat(this.normalize([c])),this}}return He=s,s.default=s,u.registerProcessor(s),e.registerProcessor(s),He}var Je,Qt;function Ar(){if(Qt)return Je;Qt=1;let e=it(),r=ee(),l=$(),u=tt(),s=de(),f=st(),c=Pi(),h=me(),g=Or(),o=Sr(),t=pe(),a=ot(),n=Ii(),i=lt(),d=te(),p=nt(),m=he(),C=Rr();function S(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new n(w)}return S.plugin=function(v,b){let y=!1;function x(...M){console&&console.warn&&!y&&(y=!0,console.warn(v+`: postcss.plugin was deprecated. Migration guide:
|
|
41
41
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(v+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
42
|
-
https://www.w3ctech.com/topic/2226`));let O=b(...M);return O.postcssPlugin=v,O.postcssVersion=new n().version,O}let E;return Object.defineProperty(x,"postcss",{get(){return E||(E=x()),E}}),x.process=function(M,O,I){return S([x(I)]).process(M,O)},x},S.stringify=m,S.parse=a,S.fromJSON=c,S.list=o,S.comment=w=>new r(w),S.atRule=w=>new e(w),S.decl=w=>new s(w),S.rule=w=>new p(w),S.root=w=>new d(w),S.document=w=>new f(w),S.CssSyntaxError=u,S.Declaration=s,S.Container=l,S.Processor=n,S.Document=f,S.Comment=r,S.Warning=C,S.AtRule=e,S.Result=i,S.Input=h,S.Rule=p,S.Root=d,S.Node=t,g.registerPostcss(S),Je=S,S.default=S,Je}var Ye,Xt;function Li(){if(Xt)return Ye;Xt=1;let e=ee(),r=xr(),l=Cr();class u extends r{checkMissedSemicolon(){}comment(f){let c=new e;this.init(c,f[2]);let h=this.input.fromOffset(f[3])||this.input.fromOffset(this.input.css.length-1);c.source.end={column:h.col,line:h.line,offset:f[3]+1};let g=f[1].slice(2);if(g.slice(-2)==="*/"&&(g=g.slice(0,-2)),/^\s*$/.test(g))c.text="",c.raws.left=g,c.raws.right="";else{let o=g.match(/^(\s*)([^]*\S)(\s*)$/);c.text=o[2],c.raws.left=o[1],c.raws.right=o[3]}}createTokenizer(){this.tokenizer=l(this.input,{ignoreErrors:!0})}decl(f){f.length>1&&f.some(c=>c[0]==="word")&&super.decl(f)}doubleColon(){}endFile(){for(this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.current.parent;)this.current=this.current.parent,this.current.raws.after="";this.root.source.end=this.getPosition(this.tokenizer.position())}precheckMissedSemicolon(f){let c=this.colon(f);if(c===!1)return;let h,g;for(h=c-1;h>=0&&f[h][0]!=="word";h--);if(h===0||h<0)return;for(g=h-1;g>=0;g--)if(f[g][0]!=="space"){g+=1;break}let o=f.slice(h),t=f.slice(g,h);f.splice(g,f.length-g),this.spaces=t.map(a=>a[1]).join(""),this.decl(o)}unclosedBracket(){}unexpectedClose(){this.current.raws.after+="}"}unknownWord(f){this.spaces+=f.map(c=>c[1]).join("")}unnamedAtrule(f){f.name=""}}return Ye=u,Ye}var Ke,Zt;function Di(){if(Zt)return Ke;Zt=1;let{Input:e}=Ar(),r=Li();return Ke=function(u,s){let f=new e(u,s),c=new r(f);return c.parse(),c.root},Ke}var Ti=Di();const Ui=yr(Ti);var Nr=(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))(Nr||{}),Bi=Ar();const k=yr(Bi);k.stringify;k.fromJSON;k.plugin;k.parse;k.list;k.document;k.comment;k.atRule;k.rule;k.decl;k.root;k.CssSyntaxError;k.Declaration;k.Container;k.Processor;k.Document;k.Comment;k.Warning;k.AtRule;k.Result;k.Input;k.Rule;k.Root;k.Node;const er={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 Fi(e){let r=er[e.tagName]?er[e.tagName]:e.tagName;return r==="link"&&e.attributes._cssText&&(r="style"),r}function Xe(e,r){const l=r==null?void 0:r.stylesWithHoverClass.get(e);if(l)return l;let u=e;try{u=k([Ri,Ei]).process(e,{parser:Ui}).css}catch(s){console.warn("Failed to adapt css for replay",s)}return r==null||r.stylesWithHoverClass.set(e,u),u}function qi(){return{stylesWithHoverClass:new Map}}function zi(e,r){var l;const{doc:u,hackCss:s,cache:f}=r;switch(e.type){case _.Document:return u.implementation.createDocument(null,"",null);case _.DocumentType:return u.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case _.Element:{const c=Fi(e);let h;e.isSVG?h=u.createElementNS("http://www.w3.org/2000/svg",c):(e.isCustom&&((l=u.defaultView)!=null&&l.customElements)&&!u.defaultView.customElements.get(e.tagName)&&u.defaultView.customElements.define(e.tagName,class extends u.defaultView.HTMLElement{}),h=u.createElement(c));const g={};for(const o in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,o))continue;let t=e.attributes[o];if(c==="option"&&o==="selected"&&t===!1||t===null)continue;if(t===!0&&(t=""),o.startsWith("rr_")){g[o]=t;continue}const a=c==="textarea"&&o==="value",n=c==="style"&&o==="_cssText";if(n&&s&&typeof t=="string"&&(t=Xe(t,f)),(a||n)&&typeof t=="string"){h.appendChild(u.createTextNode(t)),e.childNodes=[];continue}try{if(e.isSVG&&o==="xlink:href")h.setAttributeNS("http://www.w3.org/1999/xlink",o,t.toString());else if(o==="onload"||o==="onclick"||o.substring(0,7)==="onmouse")h.setAttribute("_"+o,t.toString());else if(c==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&o==="content"){h.setAttribute("csp-content",t.toString());continue}else c==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||c==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&fe(e.attributes.href)==="js"||(c==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?h.setAttribute("rrweb-original-srcset",e.attributes.srcset):h.setAttribute(o,t.toString()))}catch(i){}}for(const o in g){const t=g[o];if(c==="canvas"&&o==="rr_dataURL"){const a=u.createElement("img");a.onload=()=>{const n=h.getContext("2d");n&&n.drawImage(a,0,0,a.width,a.height)},a.src=t.toString(),h.RRNodeType&&(h.rr_dataURL=t.toString())}else if(c==="img"&&o==="rr_dataURL"){const a=h;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",e.attributes.src),a.src=t.toString())}if(o==="rr_width")h.style.setProperty("width",t.toString());else if(o==="rr_height")h.style.setProperty("height",t.toString());else if(o==="rr_mediaCurrentTime"&&typeof t=="number")h.currentTime=t;else if(o==="rr_mediaState")switch(t){case"played":h.play().catch(a=>console.warn("media playback error",a));break;case"paused":h.pause();break}else o==="rr_mediaPlaybackRate"&&typeof t=="number"?h.playbackRate=t:o==="rr_mediaMuted"&&typeof t=="boolean"?h.muted=t:o==="rr_mediaLoop"&&typeof t=="boolean"?h.loop=t:o==="rr_mediaVolume"&&typeof t=="number"?h.volume=t:o==="rr_open_mode"&&h.setAttribute("rr_open_mode",t)}if(e.isShadowHost)if(!h.shadowRoot)h.attachShadow({mode:"open"});else for(;h.shadowRoot.firstChild;)h.shadowRoot.removeChild(h.shadowRoot.firstChild);return h}case _.Text:return u.createTextNode(e.isStyle&&s?Xe(e.textContent,f):e.textContent);case _.CDATA:return u.createCDATASection(e.textContent);case _.Comment:return u.createComment(e.textContent);default:return null}}function at(e,r){const{doc:l,mirror:u,skipChild:s=!1,hackCss:f=!0,afterAppend:c,cache:h}=r;if(u.has(e.id)){const o=u.getNode(e.id),t=u.getMeta(o);if(cr(t,e))return u.getNode(e.id)}let g=zi(e,{doc:l,hackCss:f,cache:h});if(!g)return null;if(e.rootId&&u.getNode(e.rootId)!==l&&u.replace(e.rootId,l),e.type===_.Document&&(l.close(),l.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==_.DocumentType&&(e.childNodes[0].type===_.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?l.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):l.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),g=l),u.add(g,e),(e.type===_.Document||e.type===_.Element)&&!s)for(const o of e.childNodes){const t=at(o,{doc:l,mirror:u,skipChild:!1,hackCss:f,afterAppend:c,cache:h});if(!t){console.warn("Failed to rebuild",o);continue}if(o.isShadow&&ue(g)&&g.shadowRoot)g.shadowRoot.appendChild(t);else if(e.type===_.Document&&o.type==_.Element){const a=t;let n=null;a.childNodes.forEach(i=>{i.nodeName==="BODY"&&(n=i)}),n?(a.removeChild(n),g.appendChild(t),a.appendChild(n)):g.appendChild(t)}else g.appendChild(t);c&&c(t,o.id)}return g}function Wi(e,r){function l(u){r(u)}for(const u of e.getIds())e.has(u)&&l(e.getNode(u))}function ji(e,r){const l=r.getMeta(e);if((l==null?void 0:l.type)!==_.Element)return;const u=e;for(const s in l.attributes){if(!(Object.prototype.hasOwnProperty.call(l.attributes,s)&&s.startsWith("rr_")))continue;const f=l.attributes[s];s==="rr_scrollLeft"&&(u.scrollLeft=f),s==="rr_scrollTop"&&(u.scrollTop=f)}}function $i(e,r){const{doc:l,onVisit:u,hackCss:s=!0,afterAppend:f,cache:c,mirror:h=new ce}=r,g=at(e,{doc:l,mirror:h,skipChild:!1,hackCss:s,afterAppend:f,cache:c});return Wi(h,o=>{u&&u(o),ji(o,h)}),g}exports.IGNORED_NODE=Qe;exports.Mirror=ce;exports.NodeType=Nr;exports.absolutifyURLs=X;exports.adaptCssForReplay=Xe;exports.buildNodeWithSN=at;exports.classMatchesRegex=ae;exports.cleanupSnapshot=Ci;exports.createCache=qi;exports.createMirror=Zr;exports.escapeImportStatement=ir;exports.extractFileExtension=fe;exports.fixSafariColons=nr;exports.genId=pr;exports.getInputType=fr;exports.ignoreAttribute=mr;exports.is2DCanvasBlank=ur;exports.isCSSImportRule=or;exports.isCSSStyleRule=lr;exports.isElement=ue;exports.isNativeShadowDom=le;exports.isNodeMetaEqual=cr;exports.isShadowRoot=rr;exports.maskInputValue=ar;exports.needMaskingText=gr;exports.rebuild=$i;exports.serializeNodeWithId=Y;exports.snapshot=Si;exports.stringifyRule=sr;exports.stringifyStylesheet=Q;exports.toLowerCase=Z;exports.transformAttribute=dr;exports.visitSnapshot=vi;
|
|
42
|
+
https://www.w3ctech.com/topic/2226`));let O=b(...M);return O.postcssPlugin=v,O.postcssVersion=new n().version,O}let E;return Object.defineProperty(x,"postcss",{get(){return E||(E=x()),E}}),x.process=function(M,O,I){return S([x(I)]).process(M,O)},x},S.stringify=m,S.parse=a,S.fromJSON=c,S.list=o,S.comment=w=>new r(w),S.atRule=w=>new e(w),S.decl=w=>new s(w),S.rule=w=>new p(w),S.root=w=>new d(w),S.document=w=>new f(w),S.CssSyntaxError=u,S.Declaration=s,S.Container=l,S.Processor=n,S.Document=f,S.Comment=r,S.Warning=C,S.AtRule=e,S.Result=i,S.Input=h,S.Rule=p,S.Root=d,S.Node=t,g.registerPostcss(S),Je=S,S.default=S,Je}var Ye,Xt;function Li(){if(Xt)return Ye;Xt=1;let e=ee(),r=xr(),l=Cr();class u extends r{checkMissedSemicolon(){}comment(f){let c=new e;this.init(c,f[2]);let h=this.input.fromOffset(f[3])||this.input.fromOffset(this.input.css.length-1);c.source.end={column:h.col,line:h.line,offset:f[3]+1};let g=f[1].slice(2);if(g.slice(-2)==="*/"&&(g=g.slice(0,-2)),/^\s*$/.test(g))c.text="",c.raws.left=g,c.raws.right="";else{let o=g.match(/^(\s*)([^]*\S)(\s*)$/);c.text=o[2],c.raws.left=o[1],c.raws.right=o[3]}}createTokenizer(){this.tokenizer=l(this.input,{ignoreErrors:!0})}decl(f){f.length>1&&f.some(c=>c[0]==="word")&&super.decl(f)}doubleColon(){}endFile(){for(this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces;this.current.parent;)this.current=this.current.parent,this.current.raws.after="";this.root.source.end=this.getPosition(this.tokenizer.position())}precheckMissedSemicolon(f){let c=this.colon(f);if(c===!1)return;let h,g;for(h=c-1;h>=0&&f[h][0]!=="word";h--);if(h===0||h<0)return;for(g=h-1;g>=0;g--)if(f[g][0]!=="space"){g+=1;break}let o=f.slice(h),t=f.slice(g,h);f.splice(g,f.length-g),this.spaces=t.map(a=>a[1]).join(""),this.decl(o)}unclosedBracket(){}unexpectedClose(){this.current.raws.after+="}"}unknownWord(f){this.spaces+=f.map(c=>c[1]).join("")}unnamedAtrule(f){f.name=""}}return Ye=u,Ye}var Ke,Zt;function Di(){if(Zt)return Ke;Zt=1;let{Input:e}=Ar(),r=Li();return Ke=function(u,s){let f=new e(u,s),c=new r(f);return c.parse(),c.root},Ke}var Ti=Di();const Ui=yr(Ti);var Nr=(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))(Nr||{}),Bi=Ar();const k=yr(Bi);k.stringify;k.fromJSON;k.plugin;k.parse;k.list;k.document;k.comment;k.atRule;k.rule;k.decl;k.root;k.CssSyntaxError;k.Declaration;k.Container;k.Processor;k.Document;k.Comment;k.Warning;k.AtRule;k.Result;k.Input;k.Rule;k.Root;k.Node;const er={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 Fi(e){let r=er[e.tagName]?er[e.tagName]:e.tagName;return r==="link"&&e.attributes._cssText&&(r="style"),r}function Xe(e,r){const l=r==null?void 0:r.stylesWithHoverClass.get(e);if(l)return l;let u=e;try{u=k([Ri,Ei]).process(e,{parser:Ui}).css}catch(s){console.warn("Failed to adapt css for replay",s)}return r==null||r.stylesWithHoverClass.set(e,u),u}function qi(){return{stylesWithHoverClass:new Map}}function zi(e,r){var l;const{doc:u,hackCss:s,cache:f}=r;switch(e.type){case _.Document:return u.implementation.createDocument(null,"",null);case _.DocumentType:return u.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case _.Element:{const c=Fi(e);let h;e.isSVG?h=u.createElementNS("http://www.w3.org/2000/svg",c):(e.isCustom&&((l=u.defaultView)!=null&&l.customElements)&&!u.defaultView.customElements.get(e.tagName)&&u.defaultView.customElements.define(e.tagName,class extends u.defaultView.HTMLElement{}),h=u.createElement(c));const g={};for(const o in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,o))continue;let t=e.attributes[o];if(c==="option"&&o==="selected"&&t===!1||t===null)continue;if(t===!0&&(t=""),o.startsWith("rr_")){g[o]=t;continue}const a=c==="textarea"&&o==="value",n=c==="style"&&o==="_cssText";if(n&&s&&typeof t=="string"&&(t=Xe(t,f)),(a||n)&&typeof t=="string"){h.appendChild(u.createTextNode(t)),e.childNodes=[];continue}try{if(e.isSVG&&o==="xlink:href")h.setAttributeNS("http://www.w3.org/1999/xlink",o,t.toString());else if(o==="onload"||o==="onclick"||o.substring(0,7)==="onmouse")h.setAttribute("_"+o,t.toString());else if(c==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&o==="content"){h.setAttribute("csp-content",t.toString());continue}else c==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||c==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&fe(e.attributes.href)==="js"||(c==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?h.setAttribute("rrweb-original-srcset",e.attributes.srcset):h.setAttribute(o,t.toString()))}catch(i){}}for(const o in g){const t=g[o];if(c==="canvas"&&o==="rr_dataURL"){const a=u.createElement("img");a.onload=()=>{const n=h.getContext("2d");n&&n.drawImage(a,0,0,a.width,a.height)},a.src=t.toString(),h.RRNodeType&&(h.rr_dataURL=t.toString())}else if(c==="img"&&o==="rr_dataURL"){const a=h;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",e.attributes.src),a.src=t.toString())}if(o==="rr_width")h.style.setProperty("width",t.toString());else if(o==="rr_height")h.style.setProperty("height",t.toString());else if(o==="rr_mediaCurrentTime"&&typeof t=="number")h.currentTime=t;else if(o==="rr_mediaState")switch(t){case"played":h.play().catch(a=>console.warn("media playback error",a));break;case"paused":h.pause();break}else o==="rr_mediaPlaybackRate"&&typeof t=="number"?h.playbackRate=t:o==="rr_mediaMuted"&&typeof t=="boolean"?h.muted=t:o==="rr_mediaLoop"&&typeof t=="boolean"?h.loop=t:o==="rr_mediaVolume"&&typeof t=="number"?h.volume=t:o==="rr_open_mode"&&h.setAttribute("rr_open_mode",t)}if(e.isShadowHost)if(!h.shadowRoot)h.attachShadow({mode:"open"});else for(;h.shadowRoot.firstChild;)h.shadowRoot.removeChild(h.shadowRoot.firstChild);return h}case _.Text:return u.createTextNode(e.isStyle&&s?Xe(e.textContent,f):e.textContent);case _.CDATA:return e.textContent.trim()===""?null:u.createCDATASection(e.textContent);case _.Comment:return u.createComment(e.textContent);default:return null}}function at(e,r){const{doc:l,mirror:u,skipChild:s=!1,hackCss:f=!0,afterAppend:c,cache:h}=r;if(u.has(e.id)){const o=u.getNode(e.id),t=u.getMeta(o);if(cr(t,e))return u.getNode(e.id)}let g=zi(e,{doc:l,hackCss:f,cache:h});if(!g)return null;if(e.rootId&&u.getNode(e.rootId)!==l&&u.replace(e.rootId,l),e.type===_.Document&&(l.close(),l.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==_.DocumentType&&(e.childNodes[0].type===_.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?l.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):l.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),g=l),u.add(g,e),(e.type===_.Document||e.type===_.Element)&&!s)for(const o of e.childNodes){const t=at(o,{doc:l,mirror:u,skipChild:!1,hackCss:f,afterAppend:c,cache:h});if(!t){console.warn("Failed to rebuild",o);continue}if(o.isShadow&&ue(g)&&g.shadowRoot)g.shadowRoot.appendChild(t);else if(e.type===_.Document&&o.type==_.Element){const a=t;let n=null;a.childNodes.forEach(i=>{i.nodeName==="BODY"&&(n=i)}),n?(a.removeChild(n),g.appendChild(t),a.appendChild(n)):g.appendChild(t)}else g.appendChild(t);c&&c(t,o.id)}return g}function Wi(e,r){function l(u){r(u)}for(const u of e.getIds())e.has(u)&&l(e.getNode(u))}function ji(e,r){const l=r.getMeta(e);if((l==null?void 0:l.type)!==_.Element)return;const u=e;for(const s in l.attributes){if(!(Object.prototype.hasOwnProperty.call(l.attributes,s)&&s.startsWith("rr_")))continue;const f=l.attributes[s];s==="rr_scrollLeft"&&(u.scrollLeft=f),s==="rr_scrollTop"&&(u.scrollTop=f)}}function $i(e,r){const{doc:l,onVisit:u,hackCss:s=!0,afterAppend:f,cache:c,mirror:h=new ce}=r,g=at(e,{doc:l,mirror:h,skipChild:!1,hackCss:s,afterAppend:f,cache:c});return Wi(h,o=>{u&&u(o),ji(o,h)}),g}exports.IGNORED_NODE=Qe;exports.Mirror=ce;exports.NodeType=Nr;exports.absolutifyURLs=X;exports.adaptCssForReplay=Xe;exports.buildNodeWithSN=at;exports.classMatchesRegex=ae;exports.cleanupSnapshot=Ci;exports.createCache=qi;exports.createMirror=Zr;exports.escapeImportStatement=ir;exports.extractFileExtension=fe;exports.fixSafariColons=nr;exports.genId=pr;exports.getInputType=fr;exports.ignoreAttribute=mr;exports.is2DCanvasBlank=ur;exports.isCSSImportRule=or;exports.isCSSStyleRule=lr;exports.isElement=ue;exports.isNativeShadowDom=le;exports.isNodeMetaEqual=cr;exports.isShadowRoot=rr;exports.maskInputValue=ar;exports.needMaskingText=gr;exports.rebuild=$i;exports.serializeNodeWithId=Y;exports.snapshot=Si;exports.stringifyRule=sr;exports.stringifyStylesheet=Q;exports.toLowerCase=Z;exports.transformAttribute=dr;exports.visitSnapshot=vi;
|
|
43
43
|
if (typeof module.exports == "object" && typeof exports == "object") {
|
|
44
44
|
var __cp = (to, from, except, desc) => {
|
|
45
45
|
if ((from && typeof from === "object") || typeof from === "function") {
|