Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
5
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-beta.0 to 1.0.0-beta.1

dist/plugins/console-record.js

2

dist/record/rrweb-record-pack.js

@@ -48,2 +48,3 @@ var rrwebRecord = (function (exports) {

EventType[EventType["Custom"] = 5] = "Custom";
EventType[EventType["Plugin"] = 6] = "Plugin";
})(EventType || (EventType = {}));

@@ -83,2 +84,3 @@ var IncrementalSource;

MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
})(MediaInteractions || (MediaInteractions = {}));

@@ -85,0 +87,0 @@ var ReplayerEvents;

4

dist/record/rrweb-record-pack.min.js

@@ -1,2 +0,2 @@

var rrwebRecord=function(r){"use strict";
var rrwebRecord=function(e){"use strict";
/*! *****************************************************************************

@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e,n,t,o,a,f,u=function(){return(u=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)};!function(r){r[r.Document=0]="Document",r[r.DocumentType=1]="DocumentType",r[r.Element=2]="Element",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.Comment=5]="Comment"}(e||(e={})),function(r){r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom"}(n||(n={})),function(r){r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag"}(t||(t={})),function(r){r[r.MouseUp=0]="MouseUp",r[r.MouseDown=1]="MouseDown",r[r.Click=2]="Click",r[r.ContextMenu=3]="ContextMenu",r[r.DblClick=4]="DblClick",r[r.Focus=5]="Focus",r[r.Blur=6]="Blur",r[r.TouchStart=7]="TouchStart",r[r.TouchMove_Departed=8]="TouchMove_Departed",r[r.TouchEnd=9]="TouchEnd"}(o||(o={})),function(r){r[r.Play=0]="Play",r[r.Pause=1]="Pause"}(a||(a={})),function(r){r.Start="start",r.Pause="pause",r.Resume="resume",r.Resize="resize",r.Finish="finish",r.FullsnapshotRebuilded="fullsnapshot-rebuilded",r.LoadStylesheetStart="load-stylesheet-start",r.LoadStylesheetEnd="load-stylesheet-end",r.SkipStart="skip-start",r.SkipEnd="skip-end",r.MouseInteraction="mouse-interaction",r.EventCast="event-cast",r.CustomEvent="custom-event",r.Flush="flush",r.StateChange="state-change",r.PlayBack="play-back"}(f||(f={}));var i="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",s={map:{},getId:function(){return console.error(i),-1},getNode:function(){return console.error(i),null},removeNodeFromMap:function(){console.error(i)},has:function(){return console.error(i),!1},reset:function(){console.error(i)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(s=new Proxy(s,{get:function(r,e,n){return"map"===e&&console.error(i),Reflect.get(r,e,n)}}));var c=Uint8Array,l=Uint16Array,v=Uint32Array,h=new c([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new c([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m=new c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=function(r,e){for(var n=new l(31),t=0;t<31;++t)n[t]=e+=1<<r[t-1];var o=new v(n[30]);for(t=1;t<30;++t)for(var a=n[t];a<n[t+1];++a)o[a]=a-n[t]<<5|t;return[n,o]},p=w(h,2),g=p[0],M=p[1];g[28]=258,M[258]=28;for(var y=w(d,0)[1],C=new l(32768),S=0;S<32768;++S){var D=(43690&S)>>>1|(21845&S)<<1;D=(61680&(D=(52428&D)>>>2|(13107&D)<<2))>>>4|(3855&D)<<4,C[S]=((65280&D)>>>8|(255&D)<<8)>>>1}var T=function(r,e,n){for(var t=r.length,o=0,a=new l(e);o<t;++o)++a[r[o]-1];var f,u=new l(e);for(o=0;o<e;++o)u[o]=u[o-1]+a[o-1]<<1;if(n){f=new l(1<<e);var i=15-e;for(o=0;o<t;++o)if(r[o])for(var s=o<<4|r[o],c=e-r[o],v=u[r[o]-1]++<<c,h=v|(1<<c)-1;v<=h;++v)f[C[v]>>>i]=s}else for(f=new l(t),o=0;o<t;++o)f[o]=C[u[r[o]-1]++]>>>15-r[o];return f},b=new c(288);for(S=0;S<144;++S)b[S]=8;for(S=144;S<256;++S)b[S]=9;for(S=256;S<280;++S)b[S]=7;for(S=280;S<288;++S)b[S]=8;var k=new c(32);for(S=0;S<32;++S)k[S]=5;var x=T(b,9,0),I=(T(b,9,1),T(k,5,0)),P=(T(k,5,1),function(r){return(r/8>>0)+(7&r&&1)}),E=function(r,e,n){(null==e||e<0)&&(e=0),(null==n||n>r.length)&&(n=r.length);var t=new(r instanceof l?l:r instanceof v?v:c)(n-e);return t.set(r.subarray(e,n)),t},F=function(r,e,n){n<<=7&e;var t=e/8>>0;r[t]|=n,r[t+1]|=n>>>8},R=function(r,e,n){n<<=7&e;var t=e/8>>0;r[t]|=n,r[t+1]|=n>>>8,r[t+2]|=n>>>16},A=function(r,e){for(var n=[],t=0;t<r.length;++t)r[t]&&n.push({s:t,f:r[t]});var o=n.length,a=n.slice();if(!o)return[new c(0),0];if(1==o){var f=new c(n[0].s+1);return f[n[0].s]=1,[f,1]}n.sort((function(r,e){return r.f-e.f})),n.push({s:-1,f:25001});var u=n[0],i=n[1],s=0,v=1,h=2;for(n[0]={s:-1,f:u.f+i.f,l:u,r:i};v!=o-1;)u=n[n[s].f<n[h].f?s++:h++],i=n[s!=v&&n[s].f<n[h].f?s++:h++],n[v++]={s:-1,f:u.f+i.f,l:u,r:i};var d=a[0].s;for(t=1;t<o;++t)a[t].s>d&&(d=a[t].s);var m=new l(d+1),w=L(n[v-1],m,0);if(w>e){t=0;var p=0,g=w-e,M=1<<g;for(a.sort((function(r,e){return m[e.s]-m[r.s]||r.f-e.f}));t<o;++t){var y=a[t].s;if(!(m[y]>e))break;p+=M-(1<<w-m[y]),m[y]=e}for(p>>>=g;p>0;){var C=a[t].s;m[C]<e?p-=1<<e-m[C]++-1:++t}for(;t>=0&&p;--t){var S=a[t].s;m[S]==e&&(--m[S],++p)}w=e}return[new c(m),w]},L=function(r,e,n){return-1==r.s?Math.max(L(r.l,e,n+1),L(r.r,e,n+1)):e[r.s]=n},O=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new l(++e),t=0,o=r[0],a=1,f=function(r){n[t++]=r},u=1;u<=e;++u)if(r[u]==o&&u!=e)++a;else{if(!o&&a>2){for(;a>138;a-=138)f(32754);a>2&&(f(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(f(o),--a;a>6;a-=6)f(8304);a>2&&(f(a-3<<5|8208),a=0)}for(;a--;)f(o);a=1,o=r[u]}return[n.subarray(0,t),e]},U=function(r,e){for(var n=0,t=0;t<e.length;++t)n+=r[t]*e[t];return n},z=function(r,e,n){var t=n.length,o=P(e+2);r[o]=255&t,r[o+1]=t>>>8,r[o+2]=255^r[o],r[o+3]=255^r[o+1];for(var a=0;a<t;++a)r[o+a+4]=n[a];return 8*(o+4+t)},_=function(r,e,n,t,o,a,f,u,i,s,c){F(e,c++,n),++o[256];for(var v=A(o,15),w=v[0],p=v[1],g=A(a,15),M=g[0],y=g[1],C=O(w),S=C[0],D=C[1],P=O(M),E=P[0],L=P[1],_=new l(19),j=0;j<S.length;++j)_[31&S[j]]++;for(j=0;j<E.length;++j)_[31&E[j]]++;for(var B=A(_,7),N=B[0],V=B[1],J=19;J>4&&!N[m[J-1]];--J);var q,G,H,K,Q=s+5<<3,W=U(o,b)+U(a,k)+f,X=U(o,w)+U(a,M)+f+14+3*J+U(_,N)+(2*_[16]+3*_[17]+7*_[18]);if(Q<=W&&Q<=X)return z(e,c,r.subarray(i,i+s));if(F(e,c,1+(X<W)),c+=2,X<W){q=T(w,p,0),G=w,H=T(M,y,0),K=M;var Y=T(N,V,0);F(e,c,D-257),F(e,c+5,L-1),F(e,c+10,J-4),c+=14;for(j=0;j<J;++j)F(e,c+3*j,N[m[j]]);c+=3*J;for(var Z=[S,E],$=0;$<2;++$){var rr=Z[$];for(j=0;j<rr.length;++j){var er=31&rr[j];F(e,c,Y[er]),c+=N[er],er>15&&(F(e,c,rr[j]>>>5&127),c+=rr[j]>>>12)}}}else q=x,G=b,H=I,K=k;for(j=0;j<u;++j)if(t[j]>255){er=t[j]>>>18&31;R(e,c,q[er+257]),c+=G[er+257],er>7&&(F(e,c,t[j]>>>23&31),c+=h[er]);var nr=31&t[j];R(e,c,H[nr]),c+=K[nr],nr>3&&(R(e,c,t[j]>>>5&8191),c+=d[nr])}else R(e,c,q[t[j]]),c+=G[t[j]];return R(e,c,q[256]),c+G[256]},j=new v([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),B=new c(0),N=new v(256);for(S=0;S<256;++S){for(var V=S,J=9;--J;)V=(1&V&&3988292384)^V>>>1;N[S]=V}var q=function(r,e,n,t,o){return function(r,e,n,t,o,a){var f=r.length,u=new c(t+f+5*(1+Math.floor(f/7e3))+o),i=u.subarray(t,u.length-o),s=0;if(!e||f<8)for(var m=0;m<=f;m+=65535){var w=m+65535;w<f?s=z(i,s,r.subarray(m,w)):(i[m]=a,s=z(i,s,r.subarray(m,f)))}else{for(var p=j[e-1],g=p>>>13,C=8191&p,S=(1<<n)-1,D=new l(32768),T=new l(S+1),b=Math.ceil(n/3),k=2*b,x=function(e){return(r[e]^r[e+1]<<b^r[e+2]<<k)&S},I=new v(25e3),F=new l(288),R=new l(32),A=0,L=0,O=(m=0,0),U=0,N=0;m<f;++m){var V=x(m),J=32767&m,q=T[V];if(D[J]=q,T[V]=J,U<=m){var G=f-m;if((A>7e3||O>24576)&&G>423){s=_(r,i,0,I,F,R,L,O,N,m-N,s),O=A=L=0,N=m;for(var H=0;H<286;++H)F[H]=0;for(H=0;H<30;++H)R[H]=0}var K=2,Q=0,W=C,X=J-q&32767;if(G>2&&V==x(m-X))for(var Y=Math.min(g,G)-1,Z=Math.min(32767,m),$=Math.min(258,G);X<=Z&&--W&&J!=q;){if(r[m+K]==r[m+K-X]){for(var rr=0;rr<$&&r[m+rr]==r[m+rr-X];++rr);if(rr>K){if(K=rr,Q=X,rr>Y)break;var er=Math.min(X,rr-2),nr=0;for(H=0;H<er;++H){var tr=m-X+H+32768&32767,or=tr-D[tr]+32768&32767;or>nr&&(nr=or,q=tr)}}}X+=(J=q)-(q=D[J])+32768&32767}if(Q){I[O++]=268435456|M[K]<<18|y[Q];var ar=31&M[K],fr=31&y[Q];L+=h[ar]+d[fr],++F[257+ar],++R[fr],U=m+K,++A}else I[O++]=r[m],++F[r[m]]}}s=_(r,i,a,I,F,R,L,O,N,m-N,s),a||(s=z(i,s,B))}return E(u,0,t+P(s)+o)}(r,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,n,t,!o)};function G(r,e){void 0===e&&(e={});var n=function(){var r=1,e=0;return{p:function(n){for(var t=r,o=e,a=n.length,f=0;f!=a;){for(var u=Math.min(f+5552,a);f<u;++f)o+=t+=n[f];t%=65521,o%=65521}r=t,e=o},d:function(){return(r>>>8<<16|(255&e)<<8|e>>>8)+2*((255&r)<<23)}}}();n.p(r);var t=q(r,e,2,4);return function(r,e){var n=e.level,t=0==n?0:n<6?1:9==n?3:2;r[0]=120,r[1]=t<<6|(t?32-2*t:1)}(t,e),function(r,e,n){for(;n;++e)r[e]=n,n>>>=8}(t,t.length-4,n.d()),t}return r.pack=function(r){var e=u(u({},r),{v:"v1"});return function(r,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var t=0;t<r.length;){var o=r[t++];o<128||e?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&r[t++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&r[t++])<<6|63&r[t++]):(o=((15&o)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(G(function(r,e){var n=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new c(r.length+(r.length>>>1)),o=0,a=function(r){t[o++]=r},f=0;f<n;++f){if(o+5>t.length){var u=new c(o+8+(n-f<<1));u.set(t),t=u}var i=r.charCodeAt(f);i<128||e?a(i):i<2048?(a(192|i>>>6),a(128|63&i)):i>55295&&i<57344?(a(240|(i=65536+(1047552&i)|1023&r.charCodeAt(++f))>>>18),a(128|i>>>12&63),a(128|i>>>6&63),a(128|63&i)):(a(224|i>>>12),a(128|i>>>6&63),a(128|63&i))}return E(t,0,o)}(JSON.stringify(e))),!0)},Object.defineProperty(r,"__esModule",{value:!0}),r}({});
***************************************************************************** */var r,n,t,o,a,u,f=function(){return(f=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)};!function(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"}(r||(r={})),function(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"}(n||(n={})),function(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"}(t||(t={})),function(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"}(o||(o={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(a||(a={})),function(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"}(u||(u={}));var i="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",s={map:{},getId:function(){return console.error(i),-1},getNode:function(){return console.error(i),null},removeNodeFromMap:function(){console.error(i)},has:function(){return console.error(i),!1},reset:function(){console.error(i)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(s=new Proxy(s,{get:function(e,r,n){return"map"===r&&console.error(i),Reflect.get(e,r,n)}}));var c=Uint8Array,l=Uint16Array,v=Uint32Array,h=new c([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new c([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m=new c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=function(e,r){for(var n=new l(31),t=0;t<31;++t)n[t]=r+=1<<e[t-1];var o=new v(n[30]);for(t=1;t<30;++t)for(var a=n[t];a<n[t+1];++a)o[a]=a-n[t]<<5|t;return[n,o]},g=w(h,2),p=g[0],M=g[1];p[28]=258,M[258]=28;for(var y=w(d,0)[1],C=new l(32768),S=0;S<32768;++S){var D=(43690&S)>>>1|(21845&S)<<1;D=(61680&(D=(52428&D)>>>2|(13107&D)<<2))>>>4|(3855&D)<<4,C[S]=((65280&D)>>>8|(255&D)<<8)>>>1}var T=function(e,r,n){for(var t=e.length,o=0,a=new l(r);o<t;++o)++a[e[o]-1];var u,f=new l(r);for(o=0;o<r;++o)f[o]=f[o-1]+a[o-1]<<1;if(n){u=new l(1<<r);var i=15-r;for(o=0;o<t;++o)if(e[o])for(var s=o<<4|e[o],c=r-e[o],v=f[e[o]-1]++<<c,h=v|(1<<c)-1;v<=h;++v)u[C[v]>>>i]=s}else for(u=new l(t),o=0;o<t;++o)u[o]=C[f[e[o]-1]++]>>>15-e[o];return u},b=new c(288);for(S=0;S<144;++S)b[S]=8;for(S=144;S<256;++S)b[S]=9;for(S=256;S<280;++S)b[S]=7;for(S=280;S<288;++S)b[S]=8;var k=new c(32);for(S=0;S<32;++S)k[S]=5;var P=T(b,9,0),x=(T(b,9,1),T(k,5,0)),I=(T(k,5,1),function(e){return(e/8>>0)+(7&e&&1)}),E=function(e,r,n){(null==r||r<0)&&(r=0),(null==n||n>e.length)&&(n=e.length);var t=new(e instanceof l?l:e instanceof v?v:c)(n-r);return t.set(e.subarray(r,n)),t},F=function(e,r,n){n<<=7&r;var t=r/8>>0;e[t]|=n,e[t+1]|=n>>>8},R=function(e,r,n){n<<=7&r;var t=r/8>>0;e[t]|=n,e[t+1]|=n>>>8,e[t+2]|=n>>>16},A=function(e,r){for(var n=[],t=0;t<e.length;++t)e[t]&&n.push({s:t,f:e[t]});var o=n.length,a=n.slice();if(!o)return[new c(0),0];if(1==o){var u=new c(n[0].s+1);return u[n[0].s]=1,[u,1]}n.sort((function(e,r){return e.f-r.f})),n.push({s:-1,f:25001});var f=n[0],i=n[1],s=0,v=1,h=2;for(n[0]={s:-1,f:f.f+i.f,l:f,r:i};v!=o-1;)f=n[n[s].f<n[h].f?s++:h++],i=n[s!=v&&n[s].f<n[h].f?s++:h++],n[v++]={s:-1,f:f.f+i.f,l:f,r:i};var d=a[0].s;for(t=1;t<o;++t)a[t].s>d&&(d=a[t].s);var m=new l(d+1),w=L(n[v-1],m,0);if(w>r){t=0;var g=0,p=w-r,M=1<<p;for(a.sort((function(e,r){return m[r.s]-m[e.s]||e.f-r.f}));t<o;++t){var y=a[t].s;if(!(m[y]>r))break;g+=M-(1<<w-m[y]),m[y]=r}for(g>>>=p;g>0;){var C=a[t].s;m[C]<r?g-=1<<r-m[C]++-1:++t}for(;t>=0&&g;--t){var S=a[t].s;m[S]==r&&(--m[S],++g)}w=r}return[new c(m),w]},L=function(e,r,n){return-1==e.s?Math.max(L(e.l,r,n+1),L(e.r,r,n+1)):r[e.s]=n},O=function(e){for(var r=e.length;r&&!e[--r];);for(var n=new l(++r),t=0,o=e[0],a=1,u=function(e){n[t++]=e},f=1;f<=r;++f)if(e[f]==o&&f!=r)++a;else{if(!o&&a>2){for(;a>138;a-=138)u(32754);a>2&&(u(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(u(o),--a;a>6;a-=6)u(8304);a>2&&(u(a-3<<5|8208),a=0)}for(;a--;)u(o);a=1,o=e[f]}return[n.subarray(0,t),r]},U=function(e,r){for(var n=0,t=0;t<r.length;++t)n+=e[t]*r[t];return n},z=function(e,r,n){var t=n.length,o=I(r+2);e[o]=255&t,e[o+1]=t>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var a=0;a<t;++a)e[o+a+4]=n[a];return 8*(o+4+t)},_=function(e,r,n,t,o,a,u,f,i,s,c){F(r,c++,n),++o[256];for(var v=A(o,15),w=v[0],g=v[1],p=A(a,15),M=p[0],y=p[1],C=O(w),S=C[0],D=C[1],I=O(M),E=I[0],L=I[1],_=new l(19),j=0;j<S.length;++j)_[31&S[j]]++;for(j=0;j<E.length;++j)_[31&E[j]]++;for(var B=A(_,7),N=B[0],V=B[1],J=19;J>4&&!N[m[J-1]];--J);var q,G,H,K,Q=s+5<<3,W=U(o,b)+U(a,k)+u,X=U(o,w)+U(a,M)+u+14+3*J+U(_,N)+(2*_[16]+3*_[17]+7*_[18]);if(Q<=W&&Q<=X)return z(r,c,e.subarray(i,i+s));if(F(r,c,1+(X<W)),c+=2,X<W){q=T(w,g,0),G=w,H=T(M,y,0),K=M;var Y=T(N,V,0);F(r,c,D-257),F(r,c+5,L-1),F(r,c+10,J-4),c+=14;for(j=0;j<J;++j)F(r,c+3*j,N[m[j]]);c+=3*J;for(var Z=[S,E],$=0;$<2;++$){var ee=Z[$];for(j=0;j<ee.length;++j){var re=31&ee[j];F(r,c,Y[re]),c+=N[re],re>15&&(F(r,c,ee[j]>>>5&127),c+=ee[j]>>>12)}}}else q=P,G=b,H=x,K=k;for(j=0;j<f;++j)if(t[j]>255){re=t[j]>>>18&31;R(r,c,q[re+257]),c+=G[re+257],re>7&&(F(r,c,t[j]>>>23&31),c+=h[re]);var ne=31&t[j];R(r,c,H[ne]),c+=K[ne],ne>3&&(R(r,c,t[j]>>>5&8191),c+=d[ne])}else R(r,c,q[t[j]]),c+=G[t[j]];return R(r,c,q[256]),c+G[256]},j=new v([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),B=new c(0),N=new v(256);for(S=0;S<256;++S){for(var V=S,J=9;--J;)V=(1&V&&3988292384)^V>>>1;N[S]=V}var q=function(e,r,n,t,o){return function(e,r,n,t,o,a){var u=e.length,f=new c(t+u+5*(1+Math.floor(u/7e3))+o),i=f.subarray(t,f.length-o),s=0;if(!r||u<8)for(var m=0;m<=u;m+=65535){var w=m+65535;w<u?s=z(i,s,e.subarray(m,w)):(i[m]=a,s=z(i,s,e.subarray(m,u)))}else{for(var g=j[r-1],p=g>>>13,C=8191&g,S=(1<<n)-1,D=new l(32768),T=new l(S+1),b=Math.ceil(n/3),k=2*b,P=function(r){return(e[r]^e[r+1]<<b^e[r+2]<<k)&S},x=new v(25e3),F=new l(288),R=new l(32),A=0,L=0,O=(m=0,0),U=0,N=0;m<u;++m){var V=P(m),J=32767&m,q=T[V];if(D[J]=q,T[V]=J,U<=m){var G=u-m;if((A>7e3||O>24576)&&G>423){s=_(e,i,0,x,F,R,L,O,N,m-N,s),O=A=L=0,N=m;for(var H=0;H<286;++H)F[H]=0;for(H=0;H<30;++H)R[H]=0}var K=2,Q=0,W=C,X=J-q&32767;if(G>2&&V==P(m-X))for(var Y=Math.min(p,G)-1,Z=Math.min(32767,m),$=Math.min(258,G);X<=Z&&--W&&J!=q;){if(e[m+K]==e[m+K-X]){for(var ee=0;ee<$&&e[m+ee]==e[m+ee-X];++ee);if(ee>K){if(K=ee,Q=X,ee>Y)break;var re=Math.min(X,ee-2),ne=0;for(H=0;H<re;++H){var te=m-X+H+32768&32767,oe=te-D[te]+32768&32767;oe>ne&&(ne=oe,q=te)}}}X+=(J=q)-(q=D[J])+32768&32767}if(Q){x[O++]=268435456|M[K]<<18|y[Q];var ae=31&M[K],ue=31&y[Q];L+=h[ae]+d[ue],++F[257+ae],++R[ue],U=m+K,++A}else x[O++]=e[m],++F[e[m]]}}s=_(e,i,a,x,F,R,L,O,N,m-N,s),a||(s=z(i,s,B))}return E(f,0,t+I(s)+o)}(e,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+r.mem,n,t,!o)};function G(e,r){void 0===r&&(r={});var n=function(){var e=1,r=0;return{p:function(n){for(var t=e,o=r,a=n.length,u=0;u!=a;){for(var f=Math.min(u+5552,a);u<f;++u)o+=t+=n[u];t%=65521,o%=65521}e=t,r=o},d:function(){return(e>>>8<<16|(255&r)<<8|r>>>8)+2*((255&e)<<23)}}}();n.p(e);var t=q(e,r,2,4);return function(e,r){var n=r.level,t=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=t<<6|(t?32-2*t:1)}(t,r),function(e,r,n){for(;n;++r)e[r]=n,n>>>=8}(t,t.length-4,n.d()),t}return e.pack=function(e){var r=f(f({},e),{v:"v1"});return function(e,r){var n="";if(!r&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t=0;t<e.length;){var o=e[t++];o<128||r?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[t++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[t++])<<6|63&e[t++]):(o=((15&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(G(function(e,r){var n=e.length;if(!r&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var t=new c(e.length+(e.length>>>1)),o=0,a=function(e){t[o++]=e},u=0;u<n;++u){if(o+5>t.length){var f=new c(o+8+(n-u<<1));f.set(t),t=f}var i=e.charCodeAt(u);i<128||r?a(i):i<2048?(a(192|i>>>6),a(128|63&i)):i>55295&&i<57344?(a(240|(i=65536+(1047552&i)|1023&e.charCodeAt(++u))>>>18),a(128|i>>>12&63),a(128|i>>>6&63),a(128|63&i)):(a(224|i>>>12),a(128|i>>>6&63),a(128|63&i))}return E(t,0,o)}(JSON.stringify(r))),!0)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-record-pack.min.js.map

@@ -15,3 +15,3 @@ var rrwebRecord=function(){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}function a(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}!function(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||(e={}));var i=1,s=RegExp("[^a-z0-9-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(l).join(""):null}catch(e){return null}}function l(e){return function(e){return"styleSheet"in e}(e)?u(e.styleSheet)||"":e.cssText}var c,d,p,f,m,h=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,v=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,y=/^(data:)([^,]*),(.*)/i;function g(e,t){return(e||"").replace(h,(function(e,n,r,o,a,i){var s,u=r||a||i,l=n||o||"";if(!u)return e;if(!v.test(u))return"url("+l+u+l+")";if(y.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"}))}function b(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function S(){var e=document.createElement("a");return e.href="",e.href}function C(e,t,n,r){return"src"===n||("href"===n||"xlink:href"===n)&&r?b(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?b(e,n[0])+" "+n[1]:1===n.length?""+b(e,n[0]):""})).join(", ")}(e,r):"style"===n&&r?g(r,S()):r:b(e,r)}function k(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!n||!e.matches(n))||k(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,k(e.parentNode,t,n)}function w(t,n){var r,o,a=n.doc,i=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,m=void 0===f?{}:f,h=n.maskTextFn,v=n.recordCanvas;if(a.__sn){var y=a.__sn.id;r=1===y?void 0:y}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[],rootId:r};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:r};case t.ELEMENT_NODE:for(var b=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,i,l),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return s.test(t)?"div":t}(t),x={},T=0,N=Array.from(t.attributes);T<N.length;T++){var O=N[T],E=O.name,I=O.value;x[E]=C(a,w,E,I)}if("link"===w&&p){var M,L=Array.from(a.styleSheets).find((function(e){return e.href===t.href}));(M=u(L))&&(delete x.rel,delete x.href,x._cssText=g(M,L.href))}if("style"===w&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(M=u(t.sheet))&&(x._cssText=g(M,S()));if("input"===w||"textarea"===w||"select"===w){I=t.value;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&I?x.value=m[x.type]||m[w]?"*".repeat(I.length):I:t.checked&&(x.checked=t.checked)}if("option"===w){var _=t.parentElement;x.value===_.value&&(x.selected=t.selected)}if("canvas"===w&&v&&(x.rr_dataURL=t.toDataURL()),"audio"!==w&&"video"!==w||(x.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop),b){var D=t.getBoundingClientRect(),R=D.width,F=D.height;x={class:x.class,rr_width:R+"px",rr_height:F+"px"}}return"iframe"===w&&delete x.src,{type:e.Element,tagName:w,attributes:x,childNodes:[],isSVG:(o=t,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:b,rootId:r};case t.TEXT_NODE:var A=t.parentNode&&t.parentNode.tagName,z=t.textContent,P="STYLE"===A||void 0,j="SCRIPT"===A||void 0;return P&&z&&(z=g(z,S())),j&&(z="SCRIPT_PLACEHOLDER"),!P&&!j&&k(t,c,d)&&z&&(z=h?h(z):z.replace(/[\S]/g,"*")),{type:e.Text,textContent:z||"",isStyle:P,rootId:r};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:r};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:r};default:return!1}}function x(e){return void 0===e?"":e.toLowerCase()}function T(t,n){var r,o=n.doc,s=n.map,u=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,p=n.skipChild,f=void 0!==p&&p,m=n.inlineStylesheet,h=void 0===m||m,v=n.maskInputOptions,y=void 0===v?{}:v,g=n.maskTextFn,b=n.slimDOMOptions,S=n.recordCanvas,C=void 0!==S&&S,k=n.onSerialize,N=n.onIframeLoad,O=n.iframeLoadTimeout,E=void 0===O?5e3:O,I=n.preserveWhiteSpace,M=void 0===I||I,L=w(t,{doc:o,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:y,maskTextFn:g,recordCanvas:C});if(!L)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(x(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===x(t.attributes.name)||"icon"===x(t.attributes.rel)||"apple-touch-icon"===x(t.attributes.rel)||"shortcut icon"===x(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&x(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(x(t.attributes.property).match(/^(og|twitter|fb):/)||x(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===x(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===x(t.attributes.name)||"googlebot"===x(t.attributes.name)||"bingbot"===x(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===x(t.attributes.name)||"generator"===x(t.attributes.name)||"framework"===x(t.attributes.name)||"publisher"===x(t.attributes.name)||"progid"===x(t.attributes.name)||x(t.attributes.property).match(/^article:/)||x(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===x(t.attributes.name)||"yandex-verification"===x(t.attributes.name)||"csrf-token"===x(t.attributes.name)||"p:domain_verify"===x(t.attributes.name)||"verify-v1"===x(t.attributes.name)||"verification"===x(t.attributes.name)||"shopify-checkout-api-token"===x(t.attributes.name)))return!0}}return!1}(L,b)&&(M||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?i++:-2;var _=Object.assign(L,{id:r});if(t.__sn=_,-2===r)return null;s[r]=t,k&&k(t);var D=!f;if(_.type===e.Element&&(D=D&&!_.needBlock,delete _.needBlock),(_.type===e.Document||_.type===e.Element)&&D){b.headWhitespace&&L.type===e.Element&&"head"===L.tagName&&(M=!1);for(var R={doc:o,map:s,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:f,inlineStylesheet:h,maskInputOptions:y,maskTextFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:N,iframeLoadTimeout:E},F=0,A=Array.from(t.childNodes);F<A.length;F++){(j=T(A[F],R))&&_.childNodes.push(j)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot){_.isShadowHost=!0;for(var z=0,P=Array.from(t.shadowRoot.childNodes);z<P.length;z++){var j;(j=T(P[z],R))&&(j.isShadow=!0,_.childNodes.push(j))}}}return t.parentNode&&a(t.parentNode)&&(_.isShadow=!0),_.type===e.Element&&"iframe"===_.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){"about:blank"===r.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):t()}else{var i=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&N){var n=T(e,{doc:e,map:s,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:N,iframeLoadTimeout:E});n&&N(t,n)}}),E),_}function N(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(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"}(c||(c={})),function(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"}(d||(d={})),function(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"}(p||(p={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(f||(f={})),function(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"}(m||(m={}));var O="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",E={map:{},getId:function(){return console.error(O),-1},getNode:function(){return console.error(O),null},removeNodeFromMap:function(){console.error(O)},has:function(){return console.error(O),!1},reset:function(){console.error(O)}};function I(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(a){var i=Date.now();o||!1!==n.leading||(o=i);var s=t-(i-o),u=this,l=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(u,l)):r||!1===n.trailing||(r=window.setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function M(e,t,n,r,o){void 0===o&&(o=window);var a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return M(e,t,a||{},!0)}}function L(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function _(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function D(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function R(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||R(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,R(e.parentNode,t)}function F(e){return"__sn"in e&&-2===e.__sn.id}function A(e){return Boolean(e.changedTouches)}function z(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function P(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function j(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(E=new Proxy(E,{get:function(e,t,n){return"map"===t&&console.error(O),Reflect.get(e,t,n)}}));var H=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&j(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&j(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),W=function(e,t){return e+"@"+t};function V(e){return"__sn"in e}var B=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var s=[],u=new H,l=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return-1===r&&R(t.nextSibling,e.blockClass)&&(r=null),r},c=function(t){var n,r=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,o=!e.doc.contains(t)&&!e.doc.contains(r);if(t.parentNode&&!o){var i=a(t.parentNode)?e.mirror.getId(r):e.mirror.getId(t.parentNode),c=l(t);if(-1===i||-1===c)return u.addNode(t);var d=T(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,onSerialize:function(n){z(n)&&e.iframeManager.addIframe(n),P(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n)}});d&&s.push({parentId:i,nextId:c,node:d})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var d=n(e.movedSet),p=d.next();!p.done;p=d.next()){var f=p.value;U(e.removes,f,e.mirror)&&!e.movedSet.has(f.parentNode)||c(f)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var m=n(e.addedSet),h=m.next();!h.done;h=m.next()){f=h.value;q(e.droppedSet,f)||U(e.removes,f,e.mirror)?q(e.movedSet,f)?c(f):e.droppedSet.add(f):c(f)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}for(var v=null;u.length;){var y=null;if(v){var g=e.mirror.getId(v.value.parentNode),b=l(v.value);-1!==g&&-1!==b&&(y=v)}if(!y)for(var S=u.length-1;S>=0;S--){var C=u.get(S);g=e.mirror.getId(C.value.parentNode),b=l(C.value);if(-1!==g&&-1!==b){y=C;break}}if(!y){for(;u.head;)u.removeNode(u.head.value);break}v=y.previous,u.removeNode(y.value),c(y.value)}var k={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:s};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(k))}},this.processMutation=function(t){if(!F(t.target))switch(t.type){case"characterData":var n=t.target.textContent;R(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:k(t.target,e.maskTextClass,e.maskTextSelector)&&n?e.maskTextFn?e.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if(R(t.target,e.blockClass)||n===t.oldValue)return;var r=e.attributes.find((function(e){return e.node===t.target}));r||(r={node:t.target,attributes:{}},e.attributes.push(r)),r.attributes[t.attributeName]=C(e.doc,t.target.tagName,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=a(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);R(n,e.blockClass)||R(t.target,e.blockClass)||F(n)||(e.addedSet.has(n)?($(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||function e(t,n){if(a(t))return!1;var r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[W(r,o)]?$(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!a(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!(R(t,e.blockClass)||n&&R(n,e.blockClass))){if(V(t)){if(F(t))return;e.movedSet.add(t);var r=null;n&&V(n)&&(r=n.__sn.id),r&&(e.movedMap[W(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,r,o,a,i,s,u,l,c,d,p,f){this.blockClass=t,this.blockSelector=n,this.maskTextClass=r,this.maskTextSelector=o,this.inlineStylesheet=a,this.maskInputOptions=i,this.maskTextFn=s,this.recordCanvas=u,this.slimDOMOptions=l,this.emissionCallback=e,this.doc=c,this.mirror=d,this.iframeManager=p,this.shadowDomManager=f},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1,this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1,this.emit()},e}();function $(e,t){e.delete(t),t.childNodes.forEach((function(t){return $(e,t)}))}function U(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||U(e,r,n)}function q(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||q(e,n))}function X(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function Y(e,t){var n={numOfKeysLimit:50};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if("object"==typeof e&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=X(u.length?u[0]:null):i[s]=u}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t}))}var K=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),J=/(^|@)\S+:\d+/,G=/^\s*at .*(\S+:\d+|\(native\))/m,Z=/^(eval@)?(\[native code])?$/,Q={parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(G))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(G)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new K({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Z)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new K({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new K({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new K({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new K({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(J)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new K({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}},ee=[];function te(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function ne(e,t,n,r,o,a,i,s,u,l,c,d,p,f,m){var h,v,y,g=new B;ee.push(g),g.init(e,n,r,o,a,i,s,u,l,c,t,d,p,f);var b=window.MutationObserver||window.__rrMutationObserver,S=null===(y=null===(v=null===(h=window)||void 0===h?void 0:h.Zone)||void 0===v?void 0:v.__symbol__)||void 0===y?void 0:y.call(v,"MutationObserver");S&&window[S]&&(b=window[S]);var C=new b(g.processMutations.bind(g));return C.observe(m,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function re(e,t,n,r,o){if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,i=[];return Object.keys(p).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(o){var a=o.toLowerCase(),s=function(t){return function(o){var a=te(o);if(!R(a,r)){var i=A(o)?o.changedTouches[0]:o;if(i){var s=n.getId(a),u=i.clientX,l=i.clientY;e({type:p[t],id:s,x:u,y:l})}}}}(o);i.push(N(a,s,t))})),function(){i.forEach((function(e){return e()}))}}function oe(e,t,n,r,o){return N("scroll",I((function(o){var a=te(o);if(a&&!R(a,r)){var i=n.getId(a);if(a===t){var s=t.scrollingElement||t.documentElement;e({id:i,x:s.scrollLeft,y:s.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})}}),o.scroll||100),t)}var ae=["INPUT","TEXTAREA","SELECT"],ie=new WeakMap;function se(e,r){void 0===r&&(r={}),function(e,t){var n=e.mutationCb,r=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,s=e.viewportResizeCb,u=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb,p=e.fontCb,f=e.logCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,o(e)),n.apply(void 0,o(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,o(e)),r.apply(void 0,o(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,o(e)),a.apply(void 0,o(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,o(e)),i.apply(void 0,o(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,o(e)),s.apply(void 0,o(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,o(e)),u.apply(void 0,o(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,o(e)),l.apply(void 0,o(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,o(e)),c.apply(void 0,o(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,o(e)),d.apply(void 0,o(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,o(e)),p.apply(void 0,o(e))},e.logCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.log&&t.log.apply(t,o(e)),f.apply(void 0,o(e))}}(e,r);var a,i,s,u=ne(e.mutationCb,e.doc,e.blockClass,e.blockSelector,e.maskTextClass,e.maskTextSelector,e.inlineStylesheet,e.maskInputOptions,e.maskTextFn,e.recordCanvas,e.slimDOMOptions,e.mirror,e.iframeManager,e.shadowDomManager,e.doc),l=function(e,t,n,r){if(!1===t.mousemove)return function(){};var o,a="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,s=[],u=I((function(t){var n=Date.now()-o;e(s.map((function(e){return e.timeOffset-=n,e})),t),s=[],o=null}),i),l=I((function(e){var t=te(e),n=A(e)?e.changedTouches[0]:e,a=n.clientX,i=n.clientY;o||(o=Date.now()),s.push({x:a,y:i,id:r.getId(t),timeOffset:Date.now()-o}),u(e instanceof DragEvent?d.Drag:e instanceof MouseEvent?d.MouseMove:d.TouchMove)}),a,{trailing:!1}),c=[N("mousemove",l,n),N("touchmove",l,n),N("drag",l,n)];return function(){c.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling,e.doc,e.mirror),c=re(e.mouseInteractionCb,e.doc,e.mirror,e.blockClass,e.sampling),p=oe(e.scrollCb,e.doc,e.mirror,e.blockClass,e.sampling),m=(a=e.viewportResizeCb,i=-1,s=-1,N("resize",I((function(){var e=_(),t=D();i===e&&s===t||(a({width:Number(t),height:Number(e)}),i=e,s=t)}),200),window)),h=function(e,n,r,a,i,s,u,l){function c(e){var t=te(e);if(t&&t.tagName&&!(ae.indexOf(t.tagName)<0)&&!R(t,a)){var r=t.type;if("password"!==r&&!t.classList.contains(i)){var o=t.value,l=!1;"radio"===r||"checkbox"===r?l=t.checked:(s[t.tagName.toLowerCase()]||s[r])&&(o=u?u(o):"*".repeat(o.length)),d(t,{text:o,isChecked:l});var c=t.name;"radio"===r&&c&&l&&n.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach((function(e){e!==t&&d(e,{text:e.value,isChecked:!l})}))}}}function d(n,o){var a=ie.get(n);if(!a||a.text!==o.text||a.isChecked!==o.isChecked){ie.set(n,o);var i=r.getId(n);e(t(t({},o),{id:i}))}}var p=("last"===l.input?["change"]:["input","change"]).map((function(e){return N(e,c,n)})),f=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return f&&f.set&&p.push.apply(p,o(m.map((function(e){return M(e[0],e[1],{set:function(){c({target:this})}})})))),function(){p.forEach((function(e){return e()}))}}(e.inputCb,e.doc,e.mirror,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling),v=function(e,t,n){var r=function(r){return function(o){var a=te(o);a&&!R(a,t)&&e({type:"play"===r?f.Play:f.Pause,id:n.getId(a)})}},o=[N("play",r("play")),N("pause",r("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass,e.mirror),y=function(e,t){var n=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(r,o){var a=t.getId(this.ownerNode);return-1!==a&&e({id:a,adds:[{rule:r,index:o}]}),n.apply(this,arguments)};var r=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(n){var o=t.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:n}]}),r.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=n,CSSStyleSheet.prototype.deleteRule=r}}(e.styleSheetRuleCb,e.mirror),g=e.recordCanvas?function(e,t,r){var a,i,s=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],l=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var a=L(CanvasRenderingContext2D.prototype,n,(function(a){return function(){for(var i=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return R(this.canvas,t)||setTimeout((function(){var t=o(s);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var a=t[0],u=a.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,a.width,a.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e({id:r.getId(i.canvas),property:n,args:t})}),0),a.apply(this,s)}}));u.push(a)}catch(t){var i=M(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:r.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(i)}};try{for(var c=n(s),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){a={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(a)throw a.error}}return function(){u.forEach((function(e){return e()}))}}(e.canvasMutationCb,e.blockClass,e.mirror):function(){},b=e.collectFonts?function(e){var t=[],n=new WeakMap,r=FontFace;window.FontFace=function(e,t,o){var a=new r(e,t,o);return n.set(a,{family:e,buffer:"string"!=typeof t,descriptors:o,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),a};var o=L(document.fonts,"add",(function(t){return function(r){return setTimeout((function(){var t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}}));return t.push((function(){window.FonFace=r})),t.push(o),function(){t.forEach((function(e){return e()}))}}(e.fontCb):function(){},S=e.logOptions?function(e,t){var r,a,i=this,s=t.logger;if(!s)return function(){};var u=0,l=[];if(t.level.includes("error")&&window){var c=window.onerror;window.onerror=function(n,r,o,a,s){c&&c.apply(i,[n,r,o,a,s]);var u=Q.parse(s).map((function(e){return e.toString()})),l=[Y(n,t.stringifyOptions)];e({level:"error",trace:u,payload:l})},l.push((function(){window.onerror=c}))}try{for(var d=n(t.level),p=d.next();!p.done;p=d.next()){var f=p.value;l.push(m(s,f))}}catch(e){r={error:e}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}return function(){l.forEach((function(e){return e()}))};function m(n,r){var a=this;return n[r]?L(n,r,(function(n){return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];n.apply(a,i);try{var l=Q.parse(new Error).map((function(e){return e.toString()})).splice(1),c=i.map((function(e){return Y(e,t.stringifyOptions)}));++u<t.lengthThreshold?e({level:r,trace:l,payload:c}):u===t.lengthThreshold&&e({level:"warn",trace:[],payload:[Y("The number of log records reached the threshold.")]})}catch(e){n.apply(void 0,o(["rrweb logger error:",e],i))}}})):function(){}}}(e.logCb,e.logOptions):function(){};return function(){u.disconnect(),l(),c(),p(),m(),h(),v(),y(),g(),b(),S()}}var ue,le,ce=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),de=function(){function e(e){this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror}return e.prototype.addShadowRoot=function(e,t){ne(this.mutationCb,t,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.maskTextClass,this.bypassOptions.maskTextSelector,this.bypassOptions.inlineStylesheet,this.bypassOptions.maskInputOptions,this.bypassOptions.maskTextFn,this.bypassOptions.recordCanvas,this.bypassOptions.slimDOMOptions,this.mirror,this.bypassOptions.iframeManager,this,e),oe(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();function pe(e){return t(t({},e),{timestamp:Date.now()})}var fe={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function me(e){void 0===e&&(e={});var n=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,s=void 0===i?"rr-block":i,u=e.blockSelector,l=void 0===u?null:u,p=e.ignoreClass,f=void 0===p?"rr-ignore":p,m=e.maskTextClass,h=void 0===m?"rr-mask":m,v=e.maskTextSelector,y=void 0===v?null:v,g=e.inlineStylesheet,b=void 0===g||g,S=e.maskAllInputs,C=e.maskInputOptions,k=e.slimDOMOptions,w=e.maskInputFn,x=e.maskTextFn,O=e.hooks,E=e.packFn,I=e.sampling,M=void 0===I?{}:I,L=e.mousemoveWait,R=e.recordCanvas,F=void 0!==R&&R,A=e.collectFonts,j=void 0!==A&&A,H=e.recordLog,W=void 0!==H&&H;if(!n)throw new Error("emit function is required");void 0!==L&&void 0===M.mousemove&&(M.mousemove=L);var V,B,$=!0===S?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:void 0!==C?C:{},U=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===k,headMetaDescKeywords:"all"===k}:k||{},q={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:console},X=W?!0===W?q:Object.assign({},q,W):{};void 0===V&&(V=window),"NodeList"in V&&!V.NodeList.prototype.forEach&&(V.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in V&&!V.DOMTokenList.prototype.forEach&&(V.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1});var Y=0;ue=function(e,t){var r;if(!(null===(r=ee[0])||void 0===r?void 0:r.isFrozen())||e.type===c.FullSnapshot||e.type===c.IncrementalSnapshot&&e.data.source===d.Mutation||ee.forEach((function(e){return e.unfreeze()})),n(E?E(e):e,t),e.type===c.FullSnapshot)B=e,Y=0;else if(e.type===c.IncrementalSnapshot){if(e.data.source===d.Mutation&&e.data.isAttachIframe)return;Y++;var i=a&&Y>=a,s=o&&e.timestamp-B.timestamp>o;(i||s)&&le(!0)}};var K=function(e){ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Mutation},e)}))},J=function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Scroll},e)}))},G=new ce({mutationCb:K}),Z=new de({mutationCb:K,scrollCb:J,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:h,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:$,maskTextFn:x,recordCanvas:F,sampling:M,slimDOMOptions:U,iframeManager:G},mirror:fe});le=function(e){var t,n,o,a;void 0===e&&(e=!1),ue(pe({type:c.Meta,data:{href:window.location.href,width:D(),height:_()}}),e),ee.forEach((function(e){return e.lock()}));var i=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,a=n.blockSelector,i=void 0===a?null:a,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,p=void 0===d||d,f=n.recordCanvas,m=void 0!==f&&f,h=n.maskAllInputs,v=void 0!==h&&h,y=n.maskTextFn,g=n.slimDOM,b=void 0!==g&&g,S={};return[T(e,{doc:e,map:S,blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===v?{}:v,maskTextFn:y,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,recordCanvas:m,preserveWhiteSpace:n.preserveWhiteSpace,onSerialize:n.onSerialize,onIframeLoad:n.onIframeLoad,iframeLoadTimeout:n.iframeLoadTimeout}),S]}(document,{blockClass:s,blockSelector:l,maskTextClass:h,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:$,maskTextFn:x,slimDOM:U,recordCanvas:F,onSerialize:function(e){z(e)&&G.addIframe(e),P(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){G.attachIframe(e,t)}}),2),u=i[0],d=i[1];if(!u)return console.warn("Failed to snapshot the document");fe.map=d,ue(pe({type:c.FullSnapshot,data:{node:u,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),ee.forEach((function(e){return e.unlock()}))};try{var Q=[];Q.push(N("DOMContentLoaded",(function(){ue(pe({type:c.DomContentLoaded,data:{}}))})));var te=function(e){return se({mutationCb:K,mousemoveCb:function(e,t){return ue(pe({type:c.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.MouseInteraction},e)}))},scrollCb:J,viewportResizeCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.ViewportResize},e)}))},inputCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Input},e)}))},mediaInteractionCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.StyleSheetRule},e)}))},canvasMutationCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.CanvasMutation},e)}))},fontCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Font},e)}))},logCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Log},e)}))},blockClass:s,ignoreClass:f,maskTextClass:h,maskTextSelector:y,maskInputOptions:$,inlineStylesheet:b,sampling:M,recordCanvas:F,collectFonts:j,doc:e,maskInputFn:w,maskTextFn:x,logOptions:X,blockSelector:l,slimDOMOptions:U,mirror:fe,iframeManager:G,shadowDomManager:Z},O)};G.addLoadListener((function(e){Q.push(te(e.contentDocument))}));var ne=function(){le(),Q.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():Q.push(N("load",(function(){ue(pe({type:c.Load,data:{}})),ne()}),window)),function(){Q.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return me.addCustomEvent=function(e,t){if(!ue)throw new Error("please add custom event after start recording");ue(pe({type:c.Custom,data:{tag:e,payload:t}}))},me.freezePage=function(){ee.forEach((function(e){return e.freeze()}))},me.takeFullSnapshot=function(e){if(!le)throw new Error("please take full snapshot after start recording");le(e)},me.mirror=fe,me}();
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function r(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function i(e){var t=e.maskInputOptions,n=e.tagName,o=e.type,r=e.value,a=e.maskInputFn,i=r||"";return(t[n.toLowerCase()]||t[o])&&(i=a?a(i):"*".repeat(i.length)),i}!function(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||(e={}));var s=1,u=RegExp("[^a-z0-9-_:]");function l(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){return function(e){return"styleSheet"in e}(e)?l(e.styleSheet)||"":e.cssText}var d=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,p=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,m=/^(data:)([^,]*),(.*)/i;function f(e,t){return(e||"").replace(d,(function(e,n,o,r,a,i){var s,u=o||a||i,l=n||r||"";if(!u)return e;if(!p.test(u))return"url("+l+u+l+")";if(m.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var f=0,h=d;f<h.length;f++){var v=h[f];"."!==v&&(".."===v?c.pop():c.push(v))}return"url("+l+c.join("/")+l+")"}))}var h,v,y,b,g,k=/^[^ \t\n\r\u000c]+/,S=/^[, \t\n\r\u000c]+/;function C(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function w(){var e=document.createElement("a");return e.href="",e.href}function I(e,t,n,o){return"src"===n||("href"===n||"xlink:href"===n)&&o?C(e,o):"background"!==n||!o||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&o?function(e,t){if(""===t.trim())return t;var n=0;function o(e){var o,r=e.exec(t.substring(n));return r?(o=r[0],n+=o.length,o):""}for(var r=[];o(S),!(n>=t.length);){var a=o(k);if(","===a.slice(-1))a=C(e,a.substring(0,a.length-1)),r.push(a);else{var i="";a=C(e,a);for(var s=!1;;){var u=t.charAt(n);if(""===u){r.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,r.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,n+=1}}}return r.join(", ")}(e,o):"style"===n&&o?f(o,w()):o:C(e,o)}function T(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!n||!e.matches(n))||T(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,T(e.parentNode,t,n)}function x(t,n){var o,r,a=n.doc,s=n.blockClass,c=n.blockSelector,d=n.maskTextClass,p=n.maskTextSelector,m=n.inlineStylesheet,h=n.maskInputOptions,v=void 0===h?{}:h,y=n.maskTextFn,b=n.maskInputFn,g=n.recordCanvas,k=n.keepIframeSrcFn;if(a.__sn){var S=a.__sn.id;o=1===S?void 0:S}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var C=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var o=0;o<e.classList.length;o++){var r=e.classList[o];if(t.test(r))return!0}return!!n&&e.matches(n)}(t,s,c),x=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return u.test(t)?"div":t}(t),M={},E=0,O=Array.from(t.attributes);E<O.length;E++){var N=O[E],_=N.name,D=N.value;M[_]=I(a,x,_,D)}if("link"===x&&m){var F,L=Array.from(a.styleSheets).find((function(e){return e.href===t.href}));(F=l(L))&&(delete M.rel,delete M.href,M._cssText=f(F,L.href))}if("style"===x&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(F=l(t.sheet))&&(M._cssText=f(F,w()));if("input"===x||"textarea"===x||"select"===x){D=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&D?M.value=i({type:M.type,tagName:x,value:D,maskInputOptions:v,maskInputFn:b}):t.checked&&(M.checked=t.checked)}if("option"===x){var R=t.parentElement;M.value===R.value&&(M.selected=t.selected)}if("canvas"===x&&g&&(M.rr_dataURL=t.toDataURL()),"audio"!==x&&"video"!==x||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),C){var A=t.getBoundingClientRect(),z=A.width,P=A.height;M={class:M.class,rr_width:z+"px",rr_height:P+"px"}}return"iframe"!==x||k(M.src)||delete M.src,{type:e.Element,tagName:x,attributes:M,childNodes:[],isSVG:(r=t,"svg"===r.tagName||r instanceof SVGElement||void 0),needBlock:C,rootId:o};case t.TEXT_NODE:var W=t.parentNode&&t.parentNode.tagName,H=t.textContent,j="STYLE"===W||void 0,V="SCRIPT"===W||void 0;return j&&H&&(H=f(H,w())),V&&(H="SCRIPT_PLACEHOLDER"),!j&&!V&&T(t,d,p)&&H&&(H=y?y(H):H.replace(/[\S]/g,"*")),{type:e.Text,textContent:H||"",isStyle:j,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function M(e){return void 0===e?"":e.toLowerCase()}function E(t,n){var o,r=n.doc,i=n.map,u=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,p=n.skipChild,m=void 0!==p&&p,f=n.inlineStylesheet,h=void 0===f||f,v=n.maskInputOptions,y=void 0===v?{}:v,b=n.maskTextFn,g=n.maskInputFn,k=n.slimDOMOptions,S=n.recordCanvas,C=void 0!==S&&S,w=n.onSerialize,I=n.onIframeLoad,T=n.iframeLoadTimeout,O=void 0===T?5e3:T,N=n.keepIframeSrcFn,_=void 0===N?function(){return!1}:N,D=n.preserveWhiteSpace,F=void 0===D||D,L=x(t,{doc:r,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:y,maskTextFn:b,maskInputFn:g,recordCanvas:C,keepIframeSrcFn:_});if(!L)return console.warn(t,"not serialized"),null;o="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(M(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===M(t.attributes.name)||"icon"===M(t.attributes.rel)||"apple-touch-icon"===M(t.attributes.rel)||"shortcut icon"===M(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&M(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(M(t.attributes.property).match(/^(og|twitter|fb):/)||M(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===M(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===M(t.attributes.name)||"googlebot"===M(t.attributes.name)||"bingbot"===M(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===M(t.attributes.name)||"generator"===M(t.attributes.name)||"framework"===M(t.attributes.name)||"publisher"===M(t.attributes.name)||"progid"===M(t.attributes.name)||M(t.attributes.property).match(/^article:/)||M(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===M(t.attributes.name)||"yandex-verification"===M(t.attributes.name)||"csrf-token"===M(t.attributes.name)||"p:domain_verify"===M(t.attributes.name)||"verify-v1"===M(t.attributes.name)||"verification"===M(t.attributes.name)||"shopify-checkout-api-token"===M(t.attributes.name)))return!0}}return!1}(L,k)&&(F||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?s++:-2;var R=Object.assign(L,{id:o});if(t.__sn=R,-2===o)return null;i[o]=t,w&&w(t);var A=!m;if(R.type===e.Element&&(A=A&&!R.needBlock,delete R.needBlock),(R.type===e.Document||R.type===e.Element)&&A){k.headWhitespace&&L.type===e.Element&&"head"===L.tagName&&(F=!1);for(var z={doc:r,map:i,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:m,inlineStylesheet:h,maskInputOptions:y,maskTextFn:b,maskInputFn:g,slimDOMOptions:k,recordCanvas:C,preserveWhiteSpace:F,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:O,keepIframeSrcFn:_},P=0,W=Array.from(t.childNodes);P<W.length;P++){(V=E(W[P],z))&&R.childNodes.push(V)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot){R.isShadowHost=!0;for(var H=0,j=Array.from(t.shadowRoot.childNodes);H<j.length;H++){var V;(V=E(j[H],z))&&(V.isShadow=!0,R.childNodes.push(V))}}}return t.parentNode&&a(t.parentNode)&&(R.isShadow=!0),R.type===e.Element&&"iframe"===R.tagName&&function(e,t,n){var o=e.contentWindow;if(o){var r,a=!1;try{r=o.document.readyState}catch(e){return}if("complete"===r){"about:blank"===o.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var i=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&I){var n=E(e,{doc:e,map:i,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:b,maskInputFn:g,slimDOMOptions:k,recordCanvas:C,preserveWhiteSpace:F,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:O,keepIframeSrcFn:_});n&&I(t,n)}}),O),R}function O(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}!function(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"}(h||(h={})),function(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"}(v||(v={})),function(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"}(y||(y={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(b||(b={})),function(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"}(g||(g={}));var N="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",_={map:{},getId:function(){return console.error(N),-1},getNode:function(){return console.error(N),null},removeNodeFromMap:function(){console.error(N)},has:function(){return console.error(N),!1},reset:function(){console.error(N)}};function D(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(a){var i=Date.now();r||!1!==n.leading||(r=i);var s=t-(i-r),u=this,l=arguments;s<=0||s>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(u,l)):o||!1===n.trailing||(o=window.setTimeout((function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(u,l)}),s))}}function F(e,t,n,o,r){void 0===r&&(r=window);var a=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return F(e,t,a||{},!0)}}function L(e,t,n){try{if(!(t in e))return function(){};var o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,function(){e[t]=o}}catch(e){return function(){}}}function R(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function A(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function z(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||z(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,z(e.parentNode,t)}function P(e){return"__sn"in e&&-2===e.__sn.id}function W(e){return Boolean(e.changedTouches)}function H(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function j(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function V(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_=new Proxy(_,{get:function(e,t,n){return"map"===t&&console.error(N),Reflect.get(e,t,n)}}));var B=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&V(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&V(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),U=function(e,t){return e+"@"+t};function X(e){return"__sn"in e}var q=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,o,r,i;if(!e.frozen&&!e.locked){for(var s=[],u=new B,l=function(t){for(var n=t,o=-2;-2===o;)o=(n=n&&n.nextSibling)&&e.mirror.getId(n);return-1===o&&z(t.nextSibling,e.blockClass)&&(o=null),o},c=function(t){var n,o=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,r=!e.doc.contains(t)&&!e.doc.contains(o);if(t.parentNode&&!r){var i=a(t.parentNode)?e.mirror.getId(o):e.mirror.getId(t.parentNode),c=l(t);if(-1===i||-1===c)return u.addNode(t);var d=E(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,onSerialize:function(n){H(n)&&e.iframeManager.addIframe(n),j(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n)}});d&&s.push({parentId:i,nextId:c,node:d})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var d=n(e.movedSet),p=d.next();!p.done;p=d.next()){var m=p.value;K(e.removes,m,e.mirror)&&!e.movedSet.has(m.parentNode)||c(m)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){m=h.value;$(e.droppedSet,m)||K(e.removes,m,e.mirror)?$(e.movedSet,m)?c(m):e.droppedSet.add(m):c(m)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}for(var v=null;u.length;){var y=null;if(v){var b=e.mirror.getId(v.value.parentNode),g=l(v.value);-1!==b&&-1!==g&&(y=v)}if(!y)for(var k=u.length-1;k>=0;k--){var S=u.get(k);b=e.mirror.getId(S.value.parentNode),g=l(S.value);if(-1!==b&&-1!==g){y=S;break}}if(!y){for(;u.head;)u.removeNode(u.head.value);break}v=y.previous,u.removeNode(y.value),c(y.value)}var C={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:s};(C.texts.length||C.attributes.length||C.removes.length||C.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(C))}},this.processMutation=function(t){if(!P(t.target))switch(t.type){case"characterData":var n=t.target.textContent;z(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:T(t.target,e.maskTextClass,e.maskTextSelector)&&n?e.maskTextFn?e.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(n=i({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:e.maskInputFn})),z(t.target,e.blockClass)||n===t.oldValue)return;var o=e.attributes.find((function(e){return e.node===t.target}));o||(o={node:t.target,attributes:{}},e.attributes.push(o)),o.attributes[t.attributeName]=I(e.doc,t.target.tagName,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var o=e.mirror.getId(n),r=a(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);z(n,e.blockClass)||z(t.target,e.blockClass)||P(n)||(e.addedSet.has(n)?(Y(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===o||function e(t,n){if(a(t))return!1;var o=n.getId(t);return!n.has(o)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[U(o,r)]?Y(e.movedSet,n):e.removes.push({parentId:r,id:o,isShadow:!!a(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!(z(t,e.blockClass)||n&&z(n,e.blockClass))){if(X(t)){if(P(t))return;e.movedSet.add(t);var o=null;n&&X(n)&&(o=n.__sn.id),o&&(e.movedMap[U(t.__sn.id,o)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,o,r,a,i,s,u,l,c,d,p,m,f){this.blockClass=t,this.blockSelector=n,this.maskTextClass=o,this.maskTextSelector=r,this.inlineStylesheet=a,this.maskInputOptions=i,this.maskTextFn=s,this.maskInputFn=u,this.recordCanvas=l,this.slimDOMOptions=c,this.emissionCallback=e,this.doc=d,this.mirror=p,this.iframeManager=m,this.shadowDomManager=f},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1,this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1,this.emit()},e}();function Y(e,t){e.delete(t),t.childNodes.forEach((function(t){return Y(e,t)}))}function K(e,t,n){var o=t.parentNode;if(!o)return!1;var r=n.getId(o);return!!e.some((function(e){return e.id===r}))||K(e,o,n)}function $(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||$(e,n))}var G=[];function J(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Z(e,t,n,o,r,a,i,s,u,l,c,d,p,m,f,h){var v,y,b,g=new q;G.push(g),g.init(e,n,o,r,a,i,s,u,l,c,d,t,p,m,f);var k=window.MutationObserver||window.__rrMutationObserver,S=null===(b=null===(y=null===(v=window)||void 0===v?void 0:v.Zone)||void 0===y?void 0:y.__symbol__)||void 0===b?void 0:b.call(y,"MutationObserver");S&&window[S]&&(k=window[S]);var C=new k(g.processMutations.bind(g));return C.observe(h,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function Q(e,t,n,o,r){if(!1===r.mouseInteraction)return function(){};var a=!0===r.mouseInteraction||void 0===r.mouseInteraction?{}:r.mouseInteraction,i=[];return Object.keys(y).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(r){var a=r.toLowerCase(),s=function(t){return function(r){var a=J(r);if(!z(a,o)){var i=W(r)?r.changedTouches[0]:r;if(i){var s=n.getId(a),u=i.clientX,l=i.clientY;e({type:y[t],id:s,x:u,y:l})}}}}(r);i.push(O(a,s,t))})),function(){i.forEach((function(e){return e()}))}}function ee(e,t,n,o,r){return O("scroll",D((function(r){var a=J(r);if(a&&!z(a,o)){var i=n.getId(a);if(a===t){var s=t.scrollingElement||t.documentElement;e({id:i,x:s.scrollLeft,y:s.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})}}),r.scroll||100),t)}var te=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function oe(e,o){var a,s;void 0===o&&(o={}),function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,s=e.viewportResizeCb,u=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb,p=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,r(e)),n.apply(void 0,r(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,r(e)),o.apply(void 0,r(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,r(e)),a.apply(void 0,r(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,r(e)),i.apply(void 0,r(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,r(e)),s.apply(void 0,r(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,r(e)),u.apply(void 0,r(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,r(e)),l.apply(void 0,r(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,r(e)),c.apply(void 0,r(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,r(e)),d.apply(void 0,r(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,r(e)),p.apply(void 0,r(e))}}(e,o);var u,l,c,d=Z(e.mutationCb,e.doc,e.blockClass,e.blockSelector,e.maskTextClass,e.maskTextSelector,e.inlineStylesheet,e.maskInputOptions,e.maskTextFn,e.maskInputFn,e.recordCanvas,e.slimDOMOptions,e.mirror,e.iframeManager,e.shadowDomManager,e.doc),p=function(e,t,n,o){if(!1===t.mousemove)return function(){};var r,a="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,s=[],u=D((function(t){var n=Date.now()-r;e(s.map((function(e){return e.timeOffset-=n,e})),t),s=[],r=null}),i),l=D((function(e){var t=J(e),n=W(e)?e.changedTouches[0]:e,a=n.clientX,i=n.clientY;r||(r=Date.now()),s.push({x:a,y:i,id:o.getId(t),timeOffset:Date.now()-r}),u(e instanceof DragEvent?v.Drag:e instanceof MouseEvent?v.MouseMove:v.TouchMove)}),a,{trailing:!1}),c=[O("mousemove",l,n),O("touchmove",l,n),O("drag",l,n)];return function(){c.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling,e.doc,e.mirror),m=Q(e.mouseInteractionCb,e.doc,e.mirror,e.blockClass,e.sampling),f=ee(e.scrollCb,e.doc,e.mirror,e.blockClass,e.sampling),h=(u=e.viewportResizeCb,l=-1,c=-1,O("resize",D((function(){var e=R(),t=A();l===e&&c===t||(u({width:Number(t),height:Number(e)}),l=e,c=t)}),200),window)),y=function(e,n,o,a,s,u,l,c){function d(e){var t=J(e);if(t&&t.tagName&&!(te.indexOf(t.tagName)<0)&&!z(t,a)){var o=t.type;if(!t.classList.contains(s)){var r=t.value,c=!1;"radio"===o||"checkbox"===o?c=t.checked:(u[t.tagName.toLowerCase()]||u[o])&&(r=i({maskInputOptions:u,tagName:t.tagName,type:o,value:r,maskInputFn:l})),p(t,{text:r,isChecked:c});var d=t.name;"radio"===o&&d&&c&&n.querySelectorAll('input[type="radio"][name="'+d+'"]').forEach((function(e){e!==t&&p(e,{text:e.value,isChecked:!c})}))}}}function p(n,r){var a=ne.get(n);if(!a||a.text!==r.text||a.isChecked!==r.isChecked){ne.set(n,r);var i=o.getId(n);e(t(t({},r),{id:i}))}}var m=("last"===c.input?["change"]:["input","change"]).map((function(e){return O(e,d,n)})),f=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return f&&f.set&&m.push.apply(m,r(h.map((function(e){return F(e[0],e[1],{set:function(){d({target:this})}})})))),function(){m.forEach((function(e){return e()}))}}(e.inputCb,e.doc,e.mirror,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling),g=function(e,t,n){var o=function(o){return function(r){var a=J(r);a&&!z(a,t)&&e({type:o,id:n.getId(a),currentTime:a.currentTime})}},r=[O("play",o(b.Play)),O("pause",o(b.Pause)),O("seeked",o(b.Seeked))];return function(){r.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass,e.mirror),k=function(e,t){var n=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(o,r){var a=t.getId(this.ownerNode);return-1!==a&&e({id:a,adds:[{rule:o,index:r}]}),n.apply(this,arguments)};var o=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(n){var r=t.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:n}]}),o.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=n,CSSStyleSheet.prototype.deleteRule=o}}(e.styleSheetRuleCb,e.mirror),S=e.recordCanvas?function(e,t,o){var a,i,s=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],l=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var a=L(CanvasRenderingContext2D.prototype,n,(function(a){return function(){for(var i=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return z(this.canvas,t)||setTimeout((function(){var t=r(s);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var a=t[0],u=a.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,a.width,a.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e({id:o.getId(i.canvas),property:n,args:t})}),0),a.apply(this,s)}}));u.push(a)}catch(t){var i=F(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:o.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(i)}};try{for(var c=n(s),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){a={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(a)throw a.error}}return function(){u.forEach((function(e){return e()}))}}(e.canvasMutationCb,e.blockClass,e.mirror):function(){},C=e.collectFonts?function(e){var t=[],n=new WeakMap,o=FontFace;window.FontFace=function(e,t,r){var a=new o(e,t,r);return n.set(a,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),a};var r=L(document.fonts,"add",(function(t){return function(o){return setTimeout((function(){var t=n.get(o);t&&(e(t),n.delete(o))}),0),t.apply(this,[o])}}));return t.push((function(){window.FonFace=o})),t.push(r),function(){t.forEach((function(e){return e()}))}}(e.fontCb):function(){},w=[];try{for(var I=n(e.plugins),T=I.next();!T.done;T=I.next()){var x=T.value;w.push(x.observer(x.callback,x.options))}}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=I.return)&&s.call(I)}finally{if(a)throw a.error}}return function(){d.disconnect(),p(),m(),f(),h(),y(),g(),k(),S(),C(),w.forEach((function(e){return e()}))}}var re,ae,ie=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),se=function(){function e(e){this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror}return e.prototype.addShadowRoot=function(e,t){Z(this.mutationCb,t,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.maskTextClass,this.bypassOptions.maskTextSelector,this.bypassOptions.inlineStylesheet,this.bypassOptions.maskInputOptions,this.bypassOptions.maskTextFn,this.bypassOptions.maskInputFn,this.bypassOptions.recordCanvas,this.bypassOptions.slimDOMOptions,this.mirror,this.bypassOptions.iframeManager,this,e),ee(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();function ue(e){return t(t({},e),{timestamp:Date.now()})}var le={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function ce(e){void 0===e&&(e={});var n=e.emit,r=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,s=void 0===i?"rr-block":i,u=e.blockSelector,l=void 0===u?null:u,c=e.ignoreClass,d=void 0===c?"rr-ignore":c,p=e.maskTextClass,m=void 0===p?"rr-mask":p,f=e.maskTextSelector,y=void 0===f?null:f,b=e.inlineStylesheet,g=void 0===b||b,k=e.maskAllInputs,S=e.maskInputOptions,C=e.slimDOMOptions,w=e.maskInputFn,I=e.maskTextFn,T=e.hooks,x=e.packFn,M=e.sampling,N=void 0===M?{}:M,_=e.mousemoveWait,D=e.recordCanvas,F=void 0!==D&&D,L=e.collectFonts,z=void 0!==L&&L,P=e.plugins,W=e.keepIframeSrcFn,V=void 0===W?function(){return!1}:W;if(!n)throw new Error("emit function is required");void 0!==_&&void 0===N.mousemove&&(N.mousemove=_);var B,U,X=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},q=!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===C,headMetaDescKeywords:"all"===C}:C||{};void 0===B&&(B=window),"NodeList"in B&&!B.NodeList.prototype.forEach&&(B.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in B&&!B.DOMTokenList.prototype.forEach&&(B.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1});var Y=0;re=function(e,t){var o;if(!(null===(o=G[0])||void 0===o?void 0:o.isFrozen())||e.type===h.FullSnapshot||e.type===h.IncrementalSnapshot&&e.data.source===v.Mutation||G.forEach((function(e){return e.unfreeze()})),n(x?x(e):e,t),e.type===h.FullSnapshot)U=e,Y=0;else if(e.type===h.IncrementalSnapshot){if(e.data.source===v.Mutation&&e.data.isAttachIframe)return;Y++;var i=a&&Y>=a,s=r&&e.timestamp-U.timestamp>r;(i||s)&&ae(!0)}};var K=function(e){re(ue({type:h.IncrementalSnapshot,data:t({source:v.Mutation},e)}))},$=function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.Scroll},e)}))},J=new ie({mutationCb:K}),Z=new se({mutationCb:K,scrollCb:$,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:g,maskInputOptions:X,maskTextFn:I,maskInputFn:w,recordCanvas:F,sampling:N,slimDOMOptions:q,iframeManager:J},mirror:le});ae=function(e){var t,n,r,a;void 0===e&&(e=!1),re(ue({type:h.Meta,data:{href:window.location.href,width:A(),height:R()}}),e),G.forEach((function(e){return e.lock()}));var i=o(function(e,t){var n=t||{},o=n.blockClass,r=void 0===o?"rr-block":o,a=n.blockSelector,i=void 0===a?null:a,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,p=void 0===d||d,m=n.recordCanvas,f=void 0!==m&&m,h=n.maskAllInputs,v=void 0!==h&&h,y=n.maskTextFn,b=n.maskInputFn,g=n.slimDOM,k=void 0!==g&&g,S=n.preserveWhiteSpace,C=n.onSerialize,w=n.onIframeLoad,I=n.iframeLoadTimeout,T=n.keepIframeSrcFn,x={};return[E(e,{doc:e,map:x,blockClass:r,blockSelector:i,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,recordCanvas:f,preserveWhiteSpace:S,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:I,keepIframeSrcFn:void 0===T?function(){return!1}:T}),x]}(document,{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:g,maskAllInputs:X,maskTextFn:I,slimDOM:q,recordCanvas:F,onSerialize:function(e){H(e)&&J.addIframe(e),j(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t)},keepIframeSrcFn:V}),2),u=i[0],c=i[1];if(!u)return console.warn("Failed to snapshot the document");le.map=c,re(ue({type:h.FullSnapshot,data:{node:u,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),G.forEach((function(e){return e.unlock()}))};try{var Q=[];Q.push(O("DOMContentLoaded",(function(){re(ue({type:h.DomContentLoaded,data:{}}))})));var ee=function(e){return oe({mutationCb:K,mousemoveCb:function(e,t){return re(ue({type:h.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.MouseInteraction},e)}))},scrollCb:$,viewportResizeCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.ViewportResize},e)}))},inputCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.Input},e)}))},mediaInteractionCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.StyleSheetRule},e)}))},canvasMutationCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.CanvasMutation},e)}))},fontCb:function(e){return re(ue({type:h.IncrementalSnapshot,data:t({source:v.Font},e)}))},blockClass:s,ignoreClass:d,maskTextClass:m,maskTextSelector:y,maskInputOptions:X,inlineStylesheet:g,sampling:N,recordCanvas:F,collectFonts:z,doc:e,maskInputFn:w,maskTextFn:I,blockSelector:l,slimDOMOptions:q,mirror:le,iframeManager:J,shadowDomManager:Z,plugins:(null==P?void 0:P.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return re(ue({type:h.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},T)};J.addLoadListener((function(e){Q.push(ee(e.contentDocument))}));var te=function(){ae(),Q.push(ee(document))};return"interactive"===document.readyState||"complete"===document.readyState?te():Q.push(O("load",(function(){re(ue({type:h.Load,data:{}})),te()}),window)),function(){Q.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return ce.addCustomEvent=function(e,t){if(!re)throw new Error("please add custom event after start recording");re(ue({type:h.Custom,data:{tag:e,payload:t}}))},ce.freezePage=function(){G.forEach((function(e){return e.freeze()}))},ce.takeFullSnapshot=function(e){if(!ae)throw new Error("please take full snapshot after start recording");ae(e)},ce.mirror=le,ce}();
//# sourceMappingURL=rrweb-record.min.js.map

@@ -15,3 +15,3 @@ var rrwebReplay=function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t,r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(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"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function l(e,t){void 0===t&&(t={});var r=1,n=1;function o(e){var t=e.match(/\n/g);t&&(r+=t.length);var o=e.lastIndexOf("\n");n=-1===o?n+e.length:e.length-o}function i(){var e={line:r,column:n};return function(t){return t.position=new a(e),m(),t}}var a=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};a.prototype.content=e;var l=[];function u(o){var i=new Error(t.source+":"+r+":"+n+": "+o);if(i.reason=o,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;l.push(i)}function f(){return h(/^{\s*/)}function d(){return h(/^}/)}function p(){var t,r=[];for(m(),v(r);e.length&&"}"!==e.charAt(0)&&(t=C()||I());)!1!==t&&(r.push(t),v(r));return r}function h(t){var r=t.exec(e);if(r){var n=r[0];return o(n),e=e.slice(n.length),r}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return u("End of comment missing");var a=e.slice(2,r-2);return n+=2,o(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function w(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=c(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var n=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:r.replace(s,""),value:n?c(n[0]).replace(s,""):""});return h(/^[;\s]*/),o}}function b(){var e,t=[];if(!f())return u("missing '{'");for(v(t);e=w();)!1!==e&&(t.push(e),v(t)),e=w();return d()?t:u("missing '}'")}function S(){for(var e,t=[],r=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:b()})}var x,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=h(t);if(n){var o={type:e};return o[e]=n[1].trim(),r(o)}}}function C(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,o=t[1];if(!f())return u("@keyframes missing '{'");for(var a=v();n=S();)a.push(n),a=a.concat(v());return d()?e({type:"keyframes",name:o,vendor:r,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var r=c(t[1]);if(!f())return u("@media missing '{'");var n=v().concat(p());return d()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var r=c(t[1]);if(!f())return u("@supports missing '{'");var n=v().concat(p());return d()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var r=c(t[1]),n=c(t[2]);if(!f())return u("@document missing '{'");var o=v().concat(p());return d()?e({type:"document",document:n,vendor:r,rules:o}):u("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!f())return u("@page missing '{'");for(var r,n=v();r=w();)n.push(r),n=n.concat(v());return d()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!f())return u("@host missing '{'");var t=v().concat(p());return d()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!f())return u("@font-face missing '{'");for(var t,r=v();t=w();)r.push(t),r=r.concat(v());return d()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function I(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:b()})):u("selector missing")}return function e(t,r){for(var n=t&&"string"==typeof t.type,o=n?t:r,i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,o)})):l&&"object"==typeof l&&e(l,o)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((x=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:x,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u={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"};var f=/([^\\]):hover/,d=new RegExp(f,"g");function p(e){var t=l(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){f.test(e)&&r.push(e)}))})),0===r.length)return e;var n=new RegExp(r.filter((function(e,t){return r.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g");return e.replace(n,(function(e){var t=e.replace(d,"$1.\\:hover");return e+", "+t}))}function h(e,r){var n=r.doc,o=r.hackCss;switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,a=function(e){var t=u[e.tagName]?u[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",a):n.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=r,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=r),"rr_height"===t&&(i.style.height=r),"rr_mediaState"===t)switch(r){case"played":i.play();case"paused":i.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&o&&(r=p(r)),l||c){for(var u=n.createTextNode(r),f=0,d=Array.from(i.childNodes);f<d.length;f++){var h=d[f];h.nodeType===i.TEXT_NODE&&i.removeChild(h)}return i.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?i.setAttributeNS("http://www.w3.org/1999/xlink",t,r):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?i.setAttribute("_"+t,r):i.setAttribute(t,r)}catch(e){}}};for(var l in e.attributes)s(l);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case t.Text:return n.createTextNode(e.isStyle&&o?p(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function m(e,r){var n=r.doc,o=r.map,i=r.skipChild,s=void 0!==i&&i,l=r.hackCss,c=void 0===l||l,u=r.afterAppend,f=h(e,{doc:n,hackCss:c});if(!f)return null;if(e.rootId&&console.assert(o[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),f=n),f.__sn=e,o[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var d=0,p=e.childNodes;d<p.length;d++){var v=p[d],y=m(v,{doc:n,map:o,skipChild:!1,hackCss:c,afterAppend:u});y?(v.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(y):f.appendChild(y),u&&u(y)):console.warn("Failed to rebuild",v)}return f}function v(e,r){var n=r.doc,o=r.onVisit,i=r.hackCss,a={},s=m(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){o&&o(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];"rr_scrollLeft"===o&&(n.scrollLeft=i),"rr_scrollTop"===o&&(n.scrollTop=i)}}}(e)})),[s,a]}function y(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map((function(e){e(r)})),(e["*"]||[]).slice().map((function(e){e(t,r)}))}}}var g,w,b,S,x,E=Object.freeze({__proto__:null,default:y});function T(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var r,n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=d(this),n=r.getBoundingClientRect(),i=this.getBoundingClientRect();r!==t.body?(h.call(this,r,r.scrollLeft+i.left-n.left,r.scrollTop+i.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function f(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function d(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}function p(t){var r,n,o,a=(i()-t.startTime)/468;r=function(e){return.5*(1-Math.cos(Math.PI*e))}(a=a>1?1:a),n=t.startX+(t.x-t.startX)*r,o=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,o),n===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(r,n,a){var l,c,u,f,d=i();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=o.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,f=s),p({scrollable:l,method:f,startTime:d,startX:c,startY:u,x:n,y:a})}}!function(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"}(g||(g={})),function(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"}(w||(w={})),function(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"}(b||(b={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(S||(S={})),function(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"}(x||(x={}));var M,N=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,r=this;this.raf=requestAnimationFrame((function n(){var o=performance.now();for(r.timeOffset+=(o-e)*r.speed,e=o;t.length;){var i=t[0];if(!(r.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(n))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n;r=n-1}}return t},e}();function C(e,t){if(e.type===g.IncrementalSnapshot&&e.data.source===w.MouseMove){var r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}
***************************************************************************** */var t,r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(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"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function c(e,t){void 0===t&&(t={});var r=1,n=1;function o(e){var t=e.match(/\n/g);t&&(r+=t.length);var o=e.lastIndexOf("\n");n=-1===o?n+e.length:e.length-o}function i(){var e={line:r,column:n};return function(t){return t.position=new a(e),m(),t}}var a=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};a.prototype.content=e;var c=[];function u(o){var i=new Error(t.source+":"+r+":"+n+": "+o);if(i.reason=o,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;c.push(i)}function f(){return h(/^{\s*/)}function d(){return h(/^}/)}function p(){var t,r=[];for(m(),v(r);e.length&&"}"!==e.charAt(0)&&(t=C()||I());)!1!==t&&(r.push(t),v(r));return r}function h(t){var r=t.exec(e);if(r){var n=r[0];return o(n),e=e.slice(n.length),r}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return u("End of comment missing");var a=e.slice(2,r-2);return n+=2,o(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return l(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function w(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=l(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var n=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:r.replace(s,""),value:n?l(n[0]).replace(s,""):""});return h(/^[;\s]*/),o}}function b(){var e,t=[];if(!f())return u("missing '{'");for(v(t);e=w();)!1!==e&&(t.push(e),v(t)),e=w();return d()?t:u("missing '}'")}function S(){for(var e,t=[],r=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:b()})}var x,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=h(t);if(n){var o={type:e};return o[e]=n[1].trim(),r(o)}}}function C(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,o=t[1];if(!f())return u("@keyframes missing '{'");for(var a=v();n=S();)a.push(n),a=a.concat(v());return d()?e({type:"keyframes",name:o,vendor:r,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var r=l(t[1]);if(!f())return u("@media missing '{'");var n=v().concat(p());return d()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:l(t[1]),media:l(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var r=l(t[1]);if(!f())return u("@supports missing '{'");var n=v().concat(p());return d()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var r=l(t[1]),n=l(t[2]);if(!f())return u("@document missing '{'");var o=v().concat(p());return d()?e({type:"document",document:n,vendor:r,rules:o}):u("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!f())return u("@page missing '{'");for(var r,n=v();r=w();)n.push(r),n=n.concat(v());return d()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!f())return u("@host missing '{'");var t=v().concat(p());return d()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!f())return u("@font-face missing '{'");for(var t,r=v();t=w();)r.push(t),r=r.concat(v());return d()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function I(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:b()})):u("selector missing")}return function e(t,r){for(var n=t&&"string"==typeof t.type,o=n?t:r,i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],c=t[s];Array.isArray(c)?c.forEach((function(t){e(t,o)})):c&&"object"==typeof c&&e(c,o)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((x=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:x,parsingErrors:c}}))}function l(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u={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"};var f=/([^\\]):hover/,d=new RegExp(f,"g");function p(e){var t=c(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){f.test(e)&&r.push(e)}))})),0===r.length)return e;var n=new RegExp(r.filter((function(e,t){return r.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g");return e.replace(n,(function(e){var t=e.replace(d,"$1.\\:hover");return e+", "+t}))}function h(e,r){var n=r.doc,o=r.hackCss;switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,a=function(e){var t=u[e.tagName]?u[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",a):n.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=r,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=r),"rr_height"===t&&(i.style.height=r),"rr_mediaCurrentTime"===t&&(i.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}}else{var c="textarea"===a&&"value"===t,l="style"===a&&"_cssText"===t;if(l&&o&&(r=p(r)),c||l){for(var u=n.createTextNode(r),f=0,d=Array.from(i.childNodes);f<d.length;f++){var h=d[f];h.nodeType===i.TEXT_NODE&&i.removeChild(h)}return i.appendChild(u),"continue"}try{if(e.isSVG&&"xlink:href"===t)i.setAttributeNS("http://www.w3.org/1999/xlink",t,r);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))i.setAttribute("_"+t,r);else{if("meta"===a&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"==t)return i.setAttribute("csp-content",r),"continue";i.setAttribute(t,r)}}catch(e){}}};for(var c in e.attributes)s(c);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case t.Text:return n.createTextNode(e.isStyle&&o?p(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function m(e,r){var n=r.doc,o=r.map,i=r.skipChild,s=void 0!==i&&i,c=r.hackCss,l=void 0===c||c,u=r.afterAppend,f=h(e,{doc:n,hackCss:l});if(!f)return null;if(e.rootId&&console.assert(o[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),f=n),f.__sn=e,o[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var d=0,p=e.childNodes;d<p.length;d++){var v=p[d],y=m(v,{doc:n,map:o,skipChild:!1,hackCss:l,afterAppend:u});y?(v.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(y):f.appendChild(y),u&&u(y)):console.warn("Failed to rebuild",v)}return f}function v(e,r){var n=r.doc,o=r.onVisit,i=r.hackCss,a={},s=m(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){o&&o(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];"rr_scrollLeft"===o&&(n.scrollLeft=i),"rr_scrollTop"===o&&(n.scrollTop=i)}}}(e)})),[s,a]}function y(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map((function(e){e(r)})),(e["*"]||[]).slice().map((function(e){e(t,r)}))}}}var g,w,b,S,x,E=Object.freeze({__proto__:null,default:y});function T(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var r,n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var r=d(this),n=r.getBoundingClientRect(),i=this.getBoundingClientRect();r!==t.body?(h.call(this,r,r.scrollLeft+i.left-n.left,r.scrollTop+i.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function l(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function f(e){var t=l(e,"Y")&&u(e,"Y"),r=l(e,"X")&&u(e,"X");return t||r}function d(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}function p(t){var r,n,o,a=(i()-t.startTime)/468;r=function(e){return.5*(1-Math.cos(Math.PI*e))}(a=a>1?1:a),n=t.startX+(t.x-t.startX)*r,o=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,o),n===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(r,n,a){var c,l,u,f,d=i();r===t.body?(c=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=o.scroll):(c=r,l=r.scrollLeft,u=r.scrollTop,f=s),p({scrollable:c,method:f,startTime:d,startX:l,startY:u,x:n,y:a})}}!function(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"}(g||(g={})),function(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"}(w||(w={})),function(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"}(b||(b={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(S||(S={})),function(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"}(x||(x={}));var M,N=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,r=this;this.raf=requestAnimationFrame((function n(){var o=performance.now();for(r.timeOffset+=(o-e)*r.speed,e=o;t.length;){var i=t[0];if(!(r.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(n))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n;r=n-1}}return t},e}();function C(e,t){if(e.type===g.IncrementalSnapshot&&e.data.source===w.MouseMove){var r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************

@@ -30,3 +30,3 @@ Copyright (c) Microsoft Corporation. All rights reserved.

and limitations under the License.
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(M||(M={}));var I={type:"xstate.init"};function _(e){return void 0===e?[]:[].concat(e)}function D(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function k(e){return function(t){return e===t}}function O(e){return"string"==typeof e?{type:e}:e}function L(e,t){return{value:e,context:t,actions:[],changed:!1,matches:k(e)}}function F(e,t){void 0===t&&(t={});var r={config:e,_options:t,initialState:{value:e.initial,actions:_(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:k(e.initial)},transition:function(t,n){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=O(n),u=e.states[s];if(u.on){var f=_(u.on[c.type]),d=function(t){if(void 0===t)return{value:L(s,l)};var n="string"==typeof t?{target:t}:t,o=n.target,i=void 0===o?s:o,a=n.actions,f=void 0===a?[]:a,d=n.cond,p=l;if((void 0===d?function(){return!0}:d)(l,c)){var h=e.states[i],m=!1,v=[].concat(u.exit,f,h.entry).filter((function(e){return e})).map((function(e){return A(e,r._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(r){t[r]="function"==typeof e.assignment[r]?e.assignment[r](p,c):e.assignment[r]})),p=t,!1}return!0}));return{value:{value:i,context:p,actions:v,changed:i!==s||v.length>0||m,matches:k(i)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(f),h=p.next();!h.done;h=p.next()){var m=d(h.value);if("object"==typeof m)return m.value}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}return L(s,l)}};return r}var P=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function R(e){var t=e.initialState,r=M.NotStarted,n=new Set,o={_machine:e,send:function(o){r===M.Running&&(t=e.transition(t,o),P(t,O(o)),n.forEach((function(e){return e(t)})))},subscribe:function(e){return n.add(e),e(t),{unsubscribe:function(){return n.delete(e)}}},start:function(n){if(n){var i="object"==typeof n?n:{context:e.config.context,value:n};t={value:i.value,actions:[],context:i.context,matches:k(i.value)}}return r=M.Running,P(t,I),o},stop:function(){return r=M.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var j="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",B={map:{},getId:function(){return console.error(j),-1},getNode:function(){return console.error(j),null},removeNodeFromMap:function(){console.error(j)},has:function(){return console.error(j),!1},reset:function(){console.error(j)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(B=new Proxy(B,{get:function(e,t,r){return"map"===t&&console.error(j),Reflect.get(e,t,r)}}));var U=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),r={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(r.parent=t,t.children[r.id]=r):this.tree[r.id]=r,this.indexes.set(r.id,r)},e.prototype.remove=function(e,t){var r=this,n=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){r.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var n=r.indexes.get(t.id);if(n){var o=n.parent;o&&(delete n.parent,delete o.children[n.id],r.indexes.delete(e.id))}};o?n?(delete o.parent,delete n.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,r,o,i=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:w.Mutation,removes:s,texts:l,attributes:c,adds:[]},f=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(a).forEach((function(e){return f(e,!1)}));try{for(var d=n(this.scrollMap.keys()),p=d.next();!p.done;p=d.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var m=n(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function V(e){var t,r,o={},i=function(e,t){var r={value:e,parent:t,children:[]};return o[e.node.id]=r,r},a=[];try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,f=c.parentId;if(u&&u in o){var d=o[u];if(d.parent){var p=d.parent.children.indexOf(d);d.parent.children.splice(p,0,i(c,d.parent))}else{p=a.indexOf(d);a.splice(p,0,i(c,null))}}else if(f in o){var h=o[f];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function W(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)W(e.children[r],t)}function z(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function Y(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e,t){var o=t.getCastFn,i=t.emitter;return R(F({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:D({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:D((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),r(r({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(e){var t,r,a,s,l,c=e.timer,u=e.events,f=e.baselineTime,d=e.lastPlayedEvent;c.clear();try{for(var p=n(u),h=p.next();!h.done;h=p.next()){C(h.value,f)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.type===g.Meta&&n.timestamp<=t)return e.slice(r)}return e}(u,f),v=null==d?void 0:d.timestamp;(null==d?void 0:d.type)===g.IncrementalSnapshot&&d.data.source===w.MouseMove&&(v=d.timestamp+(null===(l=d.data.positions[0])||void 0===l?void 0:l.timeOffset)),f<(v||0)&&i.emit(x.PlayBack);var y=new Array,b=function(e){if(v&&v<f&&(e.timestamp<=v||e===d))return"continue";var t=e.timestamp<f;if(t&&!function(e){switch(e.type){case g.DomContentLoaded:case g.Load:case g.Custom:return!1;case g.FullSnapshot:case g.Meta:return!0}switch(e.data.source){case w.MouseMove:case w.MouseInteraction:case w.TouchMove:case w.MediaInteraction:return!1;case w.ViewportResize:case w.StyleSheetRule:case w.Scroll:case w.Input:return!0}return!0}(e))return"continue";var r=o(e,t);t?r():y.push({doAction:function(){r(),i.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=n(m),E=S.next();!E.done;E=S.next()){b(E.value)}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}i.emit(x.Flush),c.addActions(y),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:D((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:D({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:D((function(e,t){var n=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;C(l,n);var c=s.length-1;if(!s[c]||s[c].timestamp<=l.timestamp)s.push(l);else{for(var u=-1,f=0;f<=c;){var d=Math.floor((f+c)/2);s[d].timestamp<=l.timestamp?f=d+1:c=d-1}-1===u&&(u=f),s.splice(u,0,l)}var p=l.timestamp<n,h=o(l,p);p?h():a.isActive()&&a.addAction({doAction:function(){h(),i.emit(x.EventCast,l)},delay:l.delay})}return r(r({},e),{events:s})}))}}))}var Q=y||E,H={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},G={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},q=function(){function e(e,t){var r=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Q(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstPlayedEvent=null,this.newDocumentQueue=[],!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:H,logConfig:G};this.config=Object.assign({},o,t),this.config.logConfig.replayLogger||(this.config.logConfig.replayLogger=this.getConsoleLogger()),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new U,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(x.Flush,(function(){var e,t,o,i,a=r.treeIndex.flush(),s=a.scrollMap,l=a.inputMap;r.fragmentParentMap.forEach((function(e,t){return r.restoreRealParent(t,e)})),r.fragmentParentMap.clear(),r.elementStateMap.clear();try{for(var c=n(s.values()),u=c.next();!u.done;u=c.next()){var f=u.value;r.applyScroll(f)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var d=n(l.values()),p=d.next();!p.done;p=d.next()){f=p.value;r.applyInput(f)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}})),this.emitter.on(x.PlayBack,(function(){r.firstPlayedEvent=null,r.mirror.reset()}));var i=new N([],(null==t?void 0:t.speed)||o.speed);this.service=X({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){r.emitter.emit(x.StateChange,{player:e})})),this.speedService=R(F({id:"speed",context:{normalSpeed:-1,timer:i},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:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:D({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){r.emitter.emit(x.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===g.Meta})),s=this.service.state.context.events.find((function(e){return e.type===g.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){r.emitter.emit(x.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){r.firstPlayedEvent||(r.firstPlayedEvent=s,r.rebuildFullSnapshot(s),r.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.config[r]=e[r]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?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"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(x.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){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),!1!==this.config.mouseTail&&(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");var e,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&&(T(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(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=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var o=n([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var r,o=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Custom:r=function(){o.emitter.emit(x.CustomEvent,e)};break;case g.Meta:r=function(){return o.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:r=function(){o.firstPlayedEvent&&o.firstPlayedEvent===e||(o.rebuildFullSnapshot(e,t),o.iframe.contentWindow.scrollTo(e.data.initialOffset))};break;case g.IncrementalSnapshot:r=function(){var r,i;if(o.applyIncremental(e,t),!t&&(e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=n(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&o.isUserInteraction(l)){l.delay-e.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=l);break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}if(o.nextUserInteractionEvent){var c=o.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:u}),o.emitter.emit(x.SkipStart,u)}}}}return function(){if(r&&r(),o.service.send({type:"CAST_EVENT",payload:{event:e}}),e===o.service.state.context.events[o.service.state.context.events.length-1]){var t=function(){o.backToNormal(),o.service.send("END"),o.emitter.emit(x.Finish)};e.type===g.IncrementalSnapshot&&e.data.source===w.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,50-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){var r,o,i=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=v(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}})[1];var s=function(e,t){if(l.attachDocumentToIframe(e,t),l.newDocumentQueue=l.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,o=r.head;l.insertStyleRules(n,o)}},l=this;try{for(var c=n(a),u=c.next();!u.done;u=c.next()){var f=u.value;s(f.mutationInQueue,f.builtNode)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}var d=this.iframe.contentDocument,p=d.documentElement,h=d.head;this.insertStyleRules(p,h),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,o=(n=this.config.blockClass,["."+n+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused * { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)r.sheet.insertRule(o[i],i)},e.prototype.attachDocumentToIframe=function(e,t){var r,o,i=this,a=[];if(!t.contentDocument)for(var s=t.parentNode;s;){if(this.fragmentParentMap.has(s)){var l=s,c=this.fragmentParentMap.get(l);this.restoreRealParent(l,c);break}s=s.parentNode}m(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}});var u=function(e,t){if(f.attachDocumentToIframe(e,t),f.newDocumentQueue=f.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,o=r.head;f.insertStyleRules(n,o)}},f=this;try{for(var d=n(a),p=d.next();!p.done;p=d.next()){var h=p.value;u(h.mutationInQueue,h.builtNode)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(z(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,r=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(r){var n,o=new Set,i=this.service.state,a=function(){i=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(o.add(e),e.addEventListener("load",(function(){o.delete(e),0===o.size&&-1!==n&&(i.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),n&&window.clearTimeout(n),s())})))})),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),n=window.setTimeout((function(){i.matches("playing")&&t.play(t.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,r=this,o=(this.service.state,function(){r.service.state});this.emitter.on(x.Start,o),this.emitter.on(x.Pause,o);var i=0;try{for(var a=n(this.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.type===g.IncrementalSnapshot&&l.data.source===w.CanvasMutation&&"drawImage"===l.data.property&&"string"==typeof l.data.args[0]&&!this.imageMap.has(l)){i++;var c=document.createElement("canvas"),u=c.getContext("2d"),f=null==u?void 0:u.createImageData(c.width,c.height);null==f||f.data;JSON.parse(l.data.args[0]),null==u||u.putImageData(f,0,0)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==i&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var r,n,o=this,i=e.data;switch(i.source){case w.Mutation:t&&(i.adds.forEach((function(e){return o.treeIndex.add(e)})),i.texts.forEach((function(e){return o.treeIndex.text(e)})),i.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),i.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)}))),this.applyMutation(i,t);break;case w.Drag:case w.TouchMove:case w.MouseMove:if(t){var a=i.positions[i.positions.length-1];this.moveAndHover(i,a.x,a.y,a.id)}else i.positions.forEach((function(t){var r={doAction:function(){o.moveAndHover(i,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(r)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(r=i.positions[0])||void 0===r?void 0:r.timeOffset)});break;case w.MouseInteraction:if(-1===i.id)break;var s=new Event(b[i.type].toLowerCase());if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(x.MouseInteraction,{type:i.type,target:v});var l=this.config.triggerFocus;switch(i.type){case b.Blur:"blur"in v&&v.blur();break;case b.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case b.Click:case b.TouchStart:case b.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case w.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case w.ViewportResize:this.emitter.emit(x.Resize,{width:i.width,height:i.height});break;case w.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case w.MediaInteraction:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var c=v;try{i.type===S.Pause&&c.pause(),i.type===S.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case w.StyleSheetRule:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var u=v,f=v.parentNode,d=this.fragmentParentMap.has(f),p=void 0;if(d){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),f.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,r=e.index;try{var n=void 0===r?void 0:Math.min(r,m.rules.length);try{m.insertRule(t,n)}catch(e){}}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),d&&p&&f.replaceChild(v,p);break;case w.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{var y=v.getContext("2d");if(i.setter)return void(y[i.property]=i.args[0]);var g=y[i.property];if("drawImage"===i.property&&"string"==typeof i.args[0]){var E=this.imageMap.get(e);i.args[0]=E,g.apply(y,i.args)}else g.apply(y,i.args)}catch(e){this.warnCanvasMutationFailed(i,i.id,e)}break;case w.Font:try{var T=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(n=this.iframe.contentDocument)||void 0===n||n.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}break;case w.Log:try{var M=e.data,N=this.config.logConfig.replayLogger;"function"==typeof N[M.level]&&N[M.level](M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Y(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var o="__sn"in n?s.fragmentParentMap.get(n):void 0;if(o&&o.contains(r))o.removeChild(r);else if(s.fragmentParentMap.has(r)){var i=s.fragmentParentMap.get(r);n.removeChild(i),s.fragmentParentMap.delete(r)}else n.removeChild(r)}}));var l=r({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var r,n;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var i=s.mirror.getNode(e.parentId);if(!i)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var a=null;s.iframe.contentDocument.contains?a=s.iframe.contentDocument.contains(i):s.iframe.contentDocument.body.contains&&(a=s.iframe.contentDocument.body.contains(i));var u=(null===(n=(r=i).getElementsByTagName)||void 0===n?void 0:n.call(r,"iframe").length)>0;if(o&&a&&!z(i)&&!u){var f=document.createDocumentFragment();for(s.mirror.map[e.parentId]=f,s.fragmentParentMap.set(f,i),s.storeState(i);i.firstChild;)f.appendChild(i.firstChild);i=f}e.node.isShadow&&Y(i)&&(i=i.shadowRoot);var d=null,p=null;if(e.previousId&&(d=s.mirror.getNode(e.previousId)),e.nextId&&(p=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var h=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(z(i))s.attachDocumentToIframe(e,i);else{var v=m(e.node,{doc:h,map:s.mirror.map,skipChild:!0,hackCss:!0});if(-1!==e.previousId&&-1!==e.nextId){if(d&&d.nextSibling&&d.nextSibling.parentNode)i.insertBefore(v,d.nextSibling);else if(p&&p.parentNode)i.contains(p)?i.insertBefore(v,p):i.insertBefore(v,null);else{if(i===h)for(;h.firstChild;)h.removeChild(h.firstChild);i.appendChild(v)}if(z(v)){var y=s.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));if(y&&(s.attachDocumentToIframe(y,v),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==y}))),v.contentDocument){var g=v.contentDocument,w=g.documentElement,b=g.head;s.insertStyleRules(w,b)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,i,v,e)}else l[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var f=Date.now();c.length;){var d=V(c);if(c.length=0,Date.now()-f>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var p=(i=void 0,n(d)),h=p.next();!h.done;h=p.next()){var v=h.value;this.mirror.getNode(v.value.parentId)?W(v,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);for(var n in s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var o=t.attributes[n];try{null!==o?r.setAttribute(n,o):r.removeAttribute(n)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ";return t+=e.trace.join("\n\tat ")},e.prototype.getConsoleLogger=function(){var e,t,r=this,o={},a=function(e){o[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,i(e.payload.map((function(e){return JSON.parse(e)})),[r.formatMessage(e)]))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,i(t.payload.map((function(e){return JSON.parse(e)})),[r.formatMessage(t)]))}};try{for(var s=n(this.config.logConfig.level),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return o},e.prototype.legacy_resolveMissingNode=function(e,t,r,n){var o=n.previousId,i=n.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var f=s;c=f.node,u=f.mutation;t.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,r,n){var o=this.mirror.getNode(n);if(!o)return this.debugNodeNotFound(e,n);var i=function e(t,r){var n,o,i=null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=i.getBoundingClientRect(),s=e(i,r),l=a.height/i.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}(o,this.iframe),a=t*i.absoluteScale+i.x,s=r*i.absoluteScale+i.y;this.mouse.style.left=a+"px",this.mouse.style.top=s+"px",this.drawMouseTail({x:a,y:s}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?H:Object.assign({},H,this.config.mouseTail),n=r.lineCap,o=r.lineWidth,i=r.strokeStyle,a=r.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=n,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},e.prototype.isUserInteraction=function(e){return e.type===g.IncrementalSnapshot&&(e.data.source>w.Mutation&&e.data.source<=w.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,r){this.mirror.map[r.__sn.id]=r,r.__sn.type===t.Element&&"textarea"===r.__sn.tagName&&e.textContent&&(r.value=e.textContent),r.appendChild(e),this.restoreState(r)},e.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]});var i=o.children;try{for(var a=n(Array.from(i)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=n(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,r){this.warn("Has error on update canvas '"+t+"'",e,r)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i(["[replayer]"],e))},e}(),J=Uint8Array,$=Uint16Array,K=Uint32Array,Z=new J([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ee=new J([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),te=new J([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),re=function(e,t){for(var r=new $(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new K(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},ne=re(Z,2),oe=ne[0],ie=ne[1];oe[28]=258,ie[258]=28;for(var ae=re(ee,0)[0],se=new $(32768),le=0;le<32768;++le){var ce=(43690&le)>>>1|(21845&le)<<1;ce=(61680&(ce=(52428&ce)>>>2|(13107&ce)<<2))>>>4|(3855&ce)<<4,se[le]=((65280&ce)>>>8|(255&ce)<<8)>>>1}var ue=function(e,t,r){for(var n=e.length,o=0,i=new $(t);o<n;++o)++i[e[o]-1];var a,s=new $(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new $(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],f=s[e[o]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[se[f]>>>l]=c}else for(a=new $(n),o=0;o<n;++o)a[o]=se[s[e[o]-1]++]>>>15-e[o];return a},fe=new J(288);for(le=0;le<144;++le)fe[le]=8;for(le=144;le<256;++le)fe[le]=9;for(le=256;le<280;++le)fe[le]=7;for(le=280;le<288;++le)fe[le]=8;var de=new J(32);for(le=0;le<32;++le)de[le]=5;ue(fe,9,0);var pe=ue(fe,9,1),he=(ue(de,5,0),ue(de,5,1)),me=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ve=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(7&t)&r},ye=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},ge=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof $?$:e instanceof K?K:J)(r-t);return n.set(e.subarray(t,r)),n},we=new K(256);for(le=0;le<256;++le){for(var be=le,Se=9;--Se;)be=(1&be&&3988292384)^be>>>1;we[le]=be}function xe(e,t){return function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new J(3*n));var a=function(e){var r=t.length;if(e>r){var n=new J(Math.max(2*r,e));n.set(t),t=n}},s=r.f||0,l=r.p||0,c=r.b||0,u=r.l,f=r.d,d=r.m,p=r.n;if(s&&!u)return t;var h,m=8*n;do{if(!u){r.f=s=ve(e,l,1);var v=ve(e,l+1,3);if(l+=3,!v){var y=e[(I=((h=l)/8>>0)+(7&h&&1)+4)-4]|e[I-3]<<8,g=I+y;if(g>n){if(i)throw"unexpected EOF";break}o&&a(c+y),t.set(e.subarray(I,g),c),r.b=c+=y,r.p=l=8*g;continue}if(1==v)u=pe,f=he,d=9,p=5;else{if(2!=v)throw"invalid block type";var w=ve(e,l,31)+257,b=ve(e,l+10,15)+4,S=w+ve(e,l+5,31)+1;l+=14;for(var x=new J(S),E=new J(19),T=0;T<b;++T)E[te[T]]=ve(e,l+3*T,7);l+=3*b;var M=me(E),N=(1<<M)-1;if(!i&&l+S*(M+7)>m)break;var C=ue(E,M,1);for(T=0;T<S;){var I,_=C[ve(e,l,N)];if(l+=15&_,(I=_>>>4)<16)x[T++]=I;else{var D=0,A=0;for(16==I?(A=3+ve(e,l,3),l+=2,D=x[T-1]):17==I?(A=3+ve(e,l,7),l+=3):18==I&&(A=11+ve(e,l,127),l+=7);A--;)x[T++]=D}}var k=x.subarray(0,w),O=x.subarray(w);d=me(k),p=me(O),u=ue(k,d,1),f=ue(O,p,1)}if(l>m)throw"unexpected EOF"}o&&a(c+131072);for(var L=(1<<d)-1,F=(1<<p)-1,P=d+p+18;i||l+P<m;){var R=(D=u[ye(e,l)&L])>>>4;if((l+=15&D)>m)throw"unexpected EOF";if(!D)throw"invalid length/literal";if(R<256)t[c++]=R;else{if(256==R){u=null;break}var j=R-254;if(R>264){var B=Z[T=R-257];j=ve(e,l,(1<<B)-1)+oe[T],l+=B}var U=f[ye(e,l)&F],V=U>>>4;if(!U)throw"invalid distance";l+=15&U;O=ae[V];if(V>3){B=ee[V];O+=ye(e,l)&(1<<B)-1,l+=B}if(l>m)throw"unexpected EOF";o&&a(c+131072);for(var W=c+j;c<W;c+=4)t[c]=t[c-O],t[c+1]=t[c+1-O],t[c+2]=t[c+2-O],t[c+3]=t[c+3-O];c=W}}r.l=u,r.p=l,r.b=c,u&&(s=1,r.m=d,r.d=f,r.n=p)}while(!s);return c==t.length?t:ge(t,0,c)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}return e.Replayer=q,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(xe(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new J(e.length+(e.length>>>1)),o=0,i=function(e){n[o++]=e},a=0;a<r;++a){if(o+5>n.length){var s=new J(o+8+(r-a<<1));s.set(n),n=s}var l=e.charCodeAt(a);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return ge(n,0,o)}(e,!0))))).v)return t;throw new Error("These events were packed with packer "+t.v+" which is incompatible with current packer v1.")}catch(e){throw console.error(e),new Error("Unknown data format.")}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(M||(M={}));var I={type:"xstate.init"};function D(e){return void 0===e?[]:[].concat(e)}function k(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function _(e){return function(t){return e===t}}function O(e){return"string"==typeof e?{type:e}:e}function P(e,t){return{value:e,context:t,actions:[],changed:!1,matches:_(e)}}function F(e,t){void 0===t&&(t={});var r={config:e,_options:t,initialState:{value:e.initial,actions:D(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:_(e.initial)},transition:function(t,n){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,c=a.context,l=O(n),u=e.states[s];if(u.on){var f=D(u.on[l.type]),d=function(t){if(void 0===t)return{value:P(s,c)};var n="string"==typeof t?{target:t}:t,o=n.target,i=void 0===o?s:o,a=n.actions,f=void 0===a?[]:a,d=n.cond,p=c;if((void 0===d?function(){return!0}:d)(c,l)){var h=e.states[i],m=!1,v=[].concat(u.exit,f,h.entry).filter((function(e){return e})).map((function(e){return A(e,r._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,l):Object.keys(e.assignment).forEach((function(r){t[r]="function"==typeof e.assignment[r]?e.assignment[r](p,l):e.assignment[r]})),p=t,!1}return!0}));return{value:{value:i,context:p,actions:v,changed:i!==s||v.length>0||m,matches:_(i)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(f),h=p.next();!h.done;h=p.next()){var m=d(h.value);if("object"==typeof m)return m.value}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}return P(s,c)}};return r}var R=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function L(e){var t=e.initialState,r=M.NotStarted,n=new Set,o={_machine:e,send:function(o){r===M.Running&&(t=e.transition(t,o),R(t,O(o)),n.forEach((function(e){return e(t)})))},subscribe:function(e){return n.add(e),e(t),{unsubscribe:function(){return n.delete(e)}}},start:function(n){if(n){var i="object"==typeof n?n:{context:e.config.context,value:n};t={value:i.value,actions:[],context:i.context,matches:_(i.value)}}return r=M.Running,R(t,I),o},stop:function(){return r=M.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var B="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",j={map:{},getId:function(){return console.error(B),-1},getNode:function(){return console.error(B),null},removeNodeFromMap:function(){console.error(B)},has:function(){return console.error(B),!1},reset:function(){console.error(B)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(j=new Proxy(j,{get:function(e,t,r){return"map"===t&&console.error(B),Reflect.get(e,t,r)}}));var U=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),r={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(r.parent=t,t.children[r.id]=r):this.tree[r.id]=r,this.indexes.set(r.id,r)},e.prototype.remove=function(e,t){var r=this,n=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){r.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var n=r.indexes.get(t.id);if(n){var o=n.parent;o&&(delete n.parent,delete o.children[n.id],r.indexes.delete(e.id))}};o?n?(delete o.parent,delete n.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,r,o,i=this,a=this.tree,s=this.removeNodeMutations,c=this.textMutations,l=this.attributeMutations,u={source:w.Mutation,removes:s,texts:c,attributes:l,adds:[]},f=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(a).forEach((function(e){return f(e,!1)}));try{for(var d=n(this.scrollMap.keys()),p=d.next();!p.done;p=d.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var m=n(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function V(e){var t,r,o={},i=function(e,t){var r={value:e,parent:t,children:[]};return o[e.node.id]=r,r},a=[];try{for(var s=n(e),c=s.next();!c.done;c=s.next()){var l=c.value,u=l.nextId,f=l.parentId;if(u&&u in o){var d=o[u];if(d.parent){var p=d.parent.children.indexOf(d);d.parent.children.splice(p,0,i(l,d.parent))}else{p=a.indexOf(d);a.splice(p,0,i(l,null))}}else if(f in o){var h=o[f];h.children.push(i(l,h))}else a.push(i(l,null))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function z(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)z(e.children[r],t)}function W(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function Y(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e,t){var o=t.getCastFn,i=t.emitter;return L(F({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:k({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:k((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),r(r({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(e){var t,r,a,s,c,l=e.timer,u=e.events,f=e.baselineTime,d=e.lastPlayedEvent;l.clear();try{for(var p=n(u),h=p.next();!h.done;h=p.next()){C(h.value,f)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.type===g.Meta&&n.timestamp<=t)return e.slice(r)}return e}(u,f),v=null==d?void 0:d.timestamp;(null==d?void 0:d.type)===g.IncrementalSnapshot&&d.data.source===w.MouseMove&&(v=d.timestamp+(null===(c=d.data.positions[0])||void 0===c?void 0:c.timeOffset)),f<(v||0)&&i.emit(x.PlayBack);var y=new Array,b=function(e){if(v&&v<f&&(e.timestamp<=v||e===d))return"continue";var t=e.timestamp<f;if(t&&!function(e){switch(e.type){case g.DomContentLoaded:case g.Load:case g.Custom:return!1;case g.FullSnapshot:case g.Meta:case g.Plugin:return!0}switch(e.data.source){case w.MouseMove:case w.MouseInteraction:case w.TouchMove:case w.MediaInteraction:return!1;case w.ViewportResize:case w.StyleSheetRule:case w.Scroll:case w.Input:return!0}return!0}(e))return"continue";var r=o(e,t);t?r():y.push({doAction:function(){r(),i.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=n(m),E=S.next();!E.done;E=S.next()){b(E.value)}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}i.emit(x.Flush),l.addActions(y),l.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:k((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:k({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:k((function(e,t){var n=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var c=t.payload.event;C(c,n);var l=s.length-1;if(!s[l]||s[l].timestamp<=c.timestamp)s.push(c);else{for(var u=-1,f=0;f<=l;){var d=Math.floor((f+l)/2);s[d].timestamp<=c.timestamp?f=d+1:l=d-1}-1===u&&(u=f),s.splice(u,0,c)}var p=c.timestamp<n,h=o(c,p);p?h():a.isActive()&&a.addAction({doAction:function(){h(),i.emit(x.EventCast,c)},delay:c.delay})}return r(r({},e),{events:s})}))}}))}var Q=y||E,H={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},G=function(){function e(e,t){var r=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Q(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstPlayedEvent=null,this.newDocumentQueue=[],!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:H};this.config=Object.assign({},o,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new U,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(x.Flush,(function(){var e,t,o,i,a=r.treeIndex.flush(),s=a.scrollMap,c=a.inputMap;r.fragmentParentMap.forEach((function(e,t){return r.restoreRealParent(t,e)})),r.fragmentParentMap.clear(),r.elementStateMap.clear();try{for(var l=n(s.values()),u=l.next();!u.done;u=l.next()){var f=u.value;r.applyScroll(f)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}try{for(var d=n(c.values()),p=d.next();!p.done;p=d.next()){f=p.value;r.applyInput(f)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}})),this.emitter.on(x.PlayBack,(function(){r.firstPlayedEvent=null,r.mirror.reset()}));var i=new N([],(null==t?void 0:t.speed)||o.speed);this.service=X({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){r.emitter.emit(x.StateChange,{player:e})})),this.speedService=L(F({id:"speed",context:{normalSpeed:-1,timer:i},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:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:k({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){r.emitter.emit(x.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===g.Meta})),s=this.service.state.context.events.find((function(e){return e.type===g.FullSnapshot}));if(a){var c=a.data,l=c.width,u=c.height;setTimeout((function(){r.emitter.emit(x.Resize,{width:l,height:u})}),0)}s&&setTimeout((function(){r.firstPlayedEvent||(r.firstPlayedEvent=s,r.rebuildFullSnapshot(s),r.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.config[r]=e[r]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?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"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(x.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){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),!1!==this.config.mouseTail&&(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");var e,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&&(T(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(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=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var o=n([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var r,o=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Custom:r=function(){o.emitter.emit(x.CustomEvent,e)};break;case g.Meta:r=function(){return o.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:r=function(){o.firstPlayedEvent&&o.firstPlayedEvent===e||(o.rebuildFullSnapshot(e,t),o.iframe.contentWindow.scrollTo(e.data.initialOffset))};break;case g.IncrementalSnapshot:r=function(){var r,i;if(o.applyIncremental(e,t),!t&&(e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=n(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var c=s.value;if(!(c.timestamp<=e.timestamp)&&o.isUserInteraction(c)){c.delay-e.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=c);break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}if(o.nextUserInteractionEvent){var l=o.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(l/5e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:u}),o.emitter.emit(x.SkipStart,u)}}}}return function(){var i,a;r&&r();try{for(var s=n(o.config.plugins||[]),c=s.next();!c.done;c=s.next()){c.value.handler(e,t,{replayer:o})}}catch(e){i={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}o.service.send({type:"CAST_EVENT",payload:{event:e}});var l=o.service.state.context.events.length-1;if(e===o.service.state.context.events[l]){var u=function(){l<o.service.state.context.events.length-1||(o.backToNormal(),o.service.send("END"),o.emitter.emit(x.Finish))};e.type===g.IncrementalSnapshot&&e.data.source===w.MouseMove&&e.data.positions.length?setTimeout((function(){u()}),Math.max(0,50-e.data.positions[0].timeOffset)):u()}}},e.prototype.rebuildFullSnapshot=function(e,t){var r,o,i=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=v(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}})[1];var s=function(e,t){if(c.attachDocumentToIframe(e,t),c.newDocumentQueue=c.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,o=r.head;c.insertStyleRules(n,o)}},c=this;try{for(var l=n(a),u=l.next();!u.done;u=l.next()){var f=u.value;s(f.mutationInQueue,f.builtNode)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}var d=this.iframe.contentDocument,p=d.documentElement,h=d.head;this.insertStyleRules(p,h),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,o=(n=this.config.blockClass,["."+n+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused * { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)r.sheet.insertRule(o[i],i)},e.prototype.attachDocumentToIframe=function(e,t){var r,o,i=this,a=[];if(!t.contentDocument)for(var s=t.parentNode;s;){if(this.fragmentParentMap.has(s)){var c=s,l=this.fragmentParentMap.get(c);this.restoreRealParent(c,l);break}s=s.parentNode}m(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}});var u=function(e,t){if(f.attachDocumentToIframe(e,t),f.newDocumentQueue=f.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,o=r.head;f.insertStyleRules(n,o)}},f=this;try{for(var d=n(a),p=d.next();!p.done;p=d.next()){var h=p.value;u(h.mutationInQueue,h.builtNode)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(W(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,r=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(r){var n,o=new Set,i=this.service.state,a=function(){i=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(o.add(e),e.addEventListener("load",(function(){o.delete(e),0===o.size&&-1!==n&&(i.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),n&&window.clearTimeout(n),s())})))})),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),n=window.setTimeout((function(){i.matches("playing")&&t.play(t.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,r=this,o=(this.service.state,function(){r.service.state});this.emitter.on(x.Start,o),this.emitter.on(x.Pause,o);var i=0;try{for(var a=n(this.service.state.context.events),s=a.next();!s.done;s=a.next()){var c=s.value;if(c.type===g.IncrementalSnapshot&&c.data.source===w.CanvasMutation&&"drawImage"===c.data.property&&"string"==typeof c.data.args[0]&&!this.imageMap.has(c)){i++;var l=document.createElement("canvas"),u=l.getContext("2d"),f=null==u?void 0:u.createImageData(l.width,l.height);null==f||f.data;JSON.parse(c.data.args[0]),null==u||u.putImageData(f,0,0)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==i&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var r,n,o=this,i=e.data;switch(i.source){case w.Mutation:t&&(i.adds.forEach((function(e){return o.treeIndex.add(e)})),i.texts.forEach((function(e){return o.treeIndex.text(e)})),i.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),i.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)}))),this.applyMutation(i,t);break;case w.Drag:case w.TouchMove:case w.MouseMove:if(t){var a=i.positions[i.positions.length-1];this.moveAndHover(i,a.x,a.y,a.id)}else i.positions.forEach((function(t){var r={doAction:function(){o.moveAndHover(i,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(r)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(r=i.positions[0])||void 0===r?void 0:r.timeOffset)});break;case w.MouseInteraction:if(-1===i.id)break;var s=new Event(b[i.type].toLowerCase());if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(x.MouseInteraction,{type:i.type,target:v});var c=this.config.triggerFocus;switch(i.type){case b.Blur:"blur"in v&&v.blur();break;case b.Focus:c&&v.focus&&v.focus({preventScroll:!0});break;case b.Click:case b.TouchStart:case b.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case w.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case w.ViewportResize:this.emitter.emit(x.Resize,{width:i.width,height:i.height});break;case w.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case w.MediaInteraction:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var l=v;try{i.currentTime&&(l.currentTime=i.currentTime),i.type===S.Pause&&l.pause(),i.type===S.Play&&l.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case w.StyleSheetRule:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var u=v,f=v.parentNode,d=this.fragmentParentMap.has(f),p=void 0;if(d){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),f.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,r=e.index;try{var n=void 0===r?void 0:Math.min(r,m.rules.length);try{m.insertRule(t,n)}catch(e){}}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),d&&p&&f.replaceChild(v,p);break;case w.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{var y=v.getContext("2d");if(i.setter)return void(y[i.property]=i.args[0]);var g=y[i.property];if("drawImage"===i.property&&"string"==typeof i.args[0]){var E=this.imageMap.get(e);i.args[0]=E,g.apply(y,i.args)}else g.apply(y,i.args)}catch(e){this.warnCanvasMutationFailed(i,i.id,e)}break;case w.Font:try{var T=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(n=this.iframe.contentDocument)||void 0===n||n.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Y(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var o="__sn"in n?s.fragmentParentMap.get(n):void 0;if(o&&o.contains(r))o.removeChild(r);else if(s.fragmentParentMap.has(r)){var i=s.fragmentParentMap.get(r);n.removeChild(i),s.fragmentParentMap.delete(r)}else n.removeChild(r)}}));var c=r({},this.legacy_missingNodeRetryMap),l=[],u=function(e){var r,n;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var i=s.mirror.getNode(e.parentId);if(!i)return e.node.type===t.Document?s.newDocumentQueue.push(e):l.push(e);var a=null;s.iframe.contentDocument.contains?a=s.iframe.contentDocument.contains(i):s.iframe.contentDocument.body.contains&&(a=s.iframe.contentDocument.body.contains(i));var u=(null===(n=(r=i).getElementsByTagName)||void 0===n?void 0:n.call(r,"iframe").length)>0;if(o&&a&&!W(i)&&!u){var f=document.createDocumentFragment();for(s.mirror.map[e.parentId]=f,s.fragmentParentMap.set(f,i),s.storeState(i);i.firstChild;)f.appendChild(i.firstChild);i=f}e.node.isShadow&&Y(i)&&(i=i.shadowRoot);var d=null,p=null;if(e.previousId&&(d=s.mirror.getNode(e.previousId)),e.nextId&&(p=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return l.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var h=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(W(i))s.attachDocumentToIframe(e,i);else{var v=m(e.node,{doc:h,map:s.mirror.map,skipChild:!0,hackCss:!0});if(-1!==e.previousId&&-1!==e.nextId){if(d&&d.nextSibling&&d.nextSibling.parentNode)i.insertBefore(v,d.nextSibling);else if(p&&p.parentNode)i.contains(p)?i.insertBefore(v,p):i.insertBefore(v,null);else{if(i===h)for(;h.firstChild;)h.removeChild(h.firstChild);i.appendChild(v)}if(W(v)){var y=s.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));if(y&&(s.attachDocumentToIframe(y,v),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==y}))),v.contentDocument){var g=v.contentDocument,w=g.documentElement,b=g.head;s.insertStyleRules(w,b)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(c,i,v,e)}else c[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var f=Date.now();l.length;){var d=V(l);if(l.length=0,Date.now()-f>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var p=(i=void 0,n(d)),h=p.next();!h.done;h=p.next()){var v=h.value;this.mirror.getNode(v.value.parentId)?z(v,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}Object.keys(c).length&&Object.assign(this.legacy_missingNodeRetryMap,c),e.texts.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);for(var n in s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var o=t.attributes[n];try{null!==o?r.setAttribute(n,o):r.removeAttribute(n)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,r,n){var o=n.previousId,i=n.nextId,a=o&&e[o],s=i&&e[i];if(a){var c=a,l=c.node,u=c.mutation;t.insertBefore(l,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,l,u)}if(s){var f=s;l=f.node,u=f.mutation;t.insertBefore(l,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,l,u)}},e.prototype.moveAndHover=function(e,t,r,n){var o=this.mirror.getNode(n);if(!o)return this.debugNodeNotFound(e,n);var i=function e(t,r){var n,o,i=null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=i.getBoundingClientRect(),s=e(i,r),c=a.height/i.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:c,absoluteScale:s.absoluteScale*c}}(o,this.iframe),a=t*i.absoluteScale+i.x,s=r*i.absoluteScale+i.y;this.mouse.style.left=a+"px",this.mouse.style.top=s+"px",this.drawMouseTail({x:a,y:s}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?H:Object.assign({},H,this.config.mouseTail),n=r.lineCap,o=r.lineWidth,i=r.strokeStyle,a=r.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=n,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},e.prototype.isUserInteraction=function(e){return e.type===g.IncrementalSnapshot&&(e.data.source>w.Mutation&&e.data.source<=w.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,r){this.mirror.map[r.__sn.id]=r,r.__sn.type===t.Element&&"textarea"===r.__sn.tagName&&e.textContent&&(r.value=e.textContent),r.appendChild(e),this.restoreState(r)},e.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]});var i=o.children;try{for(var a=n(Array.from(i)),s=a.next();!s.done;s=a.next()){var c=s.value;this.storeState(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=n(Array.from(a)),c=s.next();!c.done;c=s.next()){var l=c.value;this.restoreState(l)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,r){this.warn("Has error on update canvas '"+t+"'",e,r)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i(["[replayer]"],e))},e}(),q=Uint8Array,J=Uint16Array,$=Uint32Array,K=new q([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Z=new q([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ee=new q([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),te=function(e,t){for(var r=new J(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new $(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},re=te(K,2),ne=re[0],oe=re[1];ne[28]=258,oe[258]=28;for(var ie=te(Z,0)[0],ae=new J(32768),se=0;se<32768;++se){var ce=(43690&se)>>>1|(21845&se)<<1;ce=(61680&(ce=(52428&ce)>>>2|(13107&ce)<<2))>>>4|(3855&ce)<<4,ae[se]=((65280&ce)>>>8|(255&ce)<<8)>>>1}var le=function(e,t,r){for(var n=e.length,o=0,i=new J(t);o<n;++o)++i[e[o]-1];var a,s=new J(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new J(1<<t);var c=15-t;for(o=0;o<n;++o)if(e[o])for(var l=o<<4|e[o],u=t-e[o],f=s[e[o]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[ae[f]>>>c]=l}else for(a=new J(n),o=0;o<n;++o)a[o]=ae[s[e[o]-1]++]>>>15-e[o];return a},ue=new q(288);for(se=0;se<144;++se)ue[se]=8;for(se=144;se<256;++se)ue[se]=9;for(se=256;se<280;++se)ue[se]=7;for(se=280;se<288;++se)ue[se]=8;var fe=new q(32);for(se=0;se<32;++se)fe[se]=5;le(ue,9,0);var de=le(ue,9,1),pe=(le(fe,5,0),le(fe,5,1)),he=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},me=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(7&t)&r},ve=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},ye=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof J?J:e instanceof $?$:q)(r-t);return n.set(e.subarray(t,r)),n},ge=new $(256);for(se=0;se<256;++se){for(var we=se,be=9;--be;)we=(1&we&&3988292384)^we>>>1;ge[se]=we}function Se(e,t){return function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new q(3*n));var a=function(e){var r=t.length;if(e>r){var n=new q(Math.max(2*r,e));n.set(t),t=n}},s=r.f||0,c=r.p||0,l=r.b||0,u=r.l,f=r.d,d=r.m,p=r.n;if(s&&!u)return t;var h,m=8*n;do{if(!u){r.f=s=me(e,c,1);var v=me(e,c+1,3);if(c+=3,!v){var y=e[(I=((h=c)/8>>0)+(7&h&&1)+4)-4]|e[I-3]<<8,g=I+y;if(g>n){if(i)throw"unexpected EOF";break}o&&a(l+y),t.set(e.subarray(I,g),l),r.b=l+=y,r.p=c=8*g;continue}if(1==v)u=de,f=pe,d=9,p=5;else{if(2!=v)throw"invalid block type";var w=me(e,c,31)+257,b=me(e,c+10,15)+4,S=w+me(e,c+5,31)+1;c+=14;for(var x=new q(S),E=new q(19),T=0;T<b;++T)E[ee[T]]=me(e,c+3*T,7);c+=3*b;var M=he(E),N=(1<<M)-1;if(!i&&c+S*(M+7)>m)break;var C=le(E,M,1);for(T=0;T<S;){var I,D=C[me(e,c,N)];if(c+=15&D,(I=D>>>4)<16)x[T++]=I;else{var k=0,A=0;for(16==I?(A=3+me(e,c,3),c+=2,k=x[T-1]):17==I?(A=3+me(e,c,7),c+=3):18==I&&(A=11+me(e,c,127),c+=7);A--;)x[T++]=k}}var _=x.subarray(0,w),O=x.subarray(w);d=he(_),p=he(O),u=le(_,d,1),f=le(O,p,1)}if(c>m)throw"unexpected EOF"}o&&a(l+131072);for(var P=(1<<d)-1,F=(1<<p)-1,R=d+p+18;i||c+R<m;){var L=(k=u[ve(e,c)&P])>>>4;if((c+=15&k)>m)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(L<256)t[l++]=L;else{if(256==L){u=null;break}var B=L-254;if(L>264){var j=K[T=L-257];B=me(e,c,(1<<j)-1)+ne[T],c+=j}var U=f[ve(e,c)&F],V=U>>>4;if(!U)throw"invalid distance";c+=15&U;O=ie[V];if(V>3){j=Z[V];O+=ve(e,c)&(1<<j)-1,c+=j}if(c>m)throw"unexpected EOF";o&&a(l+131072);for(var z=l+B;l<z;l+=4)t[l]=t[l-O],t[l+1]=t[l+1-O],t[l+2]=t[l+2-O],t[l+3]=t[l+3-O];l=z}}r.l=u,r.p=c,r.b=l,u&&(s=1,r.m=d,r.d=f,r.n=p)}while(!s);return l==t.length?t:ye(t,0,l)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}return e.Replayer=G,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(Se(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new q(e.length+(e.length>>>1)),o=0,i=function(e){n[o++]=e},a=0;a<r;++a){if(o+5>n.length){var s=new q(o+8+(r-a<<1));s.set(n),n=s}var c=e.charCodeAt(a);c<128||t?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return ye(n,0,o)}(e,!0))))).v)return t;throw new Error("These events were packed with packer "+t.v+" which is incompatible with current packer v1.")}catch(e){throw console.error(e),new Error("Unknown data format.")}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-replay-unpack.min.js.map

@@ -15,3 +15,3 @@ var rrwebReplay=function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(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"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function l(e,t){void 0===t&&(t={});var n=1,r=1;function o(e){var t=e.match(/\n/g);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function i(){var e={line:n,column:r};return function(t){return t.position=new a(e),m(),t}}var a=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};a.prototype.content=e;var l=[];function u(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;l.push(i)}function d(){return h(/^{\s*/)}function f(){return h(/^}/)}function p(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=I()||C());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=c(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(s,""),value:r?c(r[0]).replace(s,""):""});return h(/^[;\s]*/),o}}function w(){var e,t=[];if(!d())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return f()?t:u("missing '}'")}function S(){for(var e,t=[],n=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:w()})}var x,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=i(),r=h(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function I(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,o=t[1];if(!d())return u("@keyframes missing '{'");for(var a=v();r=S();)a.push(r),a=a.concat(v());return f()?e({type:"keyframes",name:o,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@media missing '{'");var r=v().concat(p());return f()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@supports missing '{'");var r=v().concat(p());return f()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=c(t[1]),r=c(t[2]);if(!d())return u("@document missing '{'");var o=v().concat(p());return f()?e({type:"document",document:r,vendor:n,rules:o}):u("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!d())return u("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return f()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!d())return u("@host missing '{'");var t=v().concat(p());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!d())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return f()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function C(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:w()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,o=r?t:n,i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,o)})):l&&"object"==typeof l&&e(l,o)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((x=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:x,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u={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"};var d=/([^\\]):hover/,f=new RegExp(d,"g");function p(e){var t=l(e,{silent:!0});if(!t.stylesheet)return e;var n=[];if(t.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){d.test(e)&&n.push(e)}))})),0===n.length)return e;var r=new RegExp(n.filter((function(e,t){return n.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g");return e.replace(r,(function(e){var t=e.replace(f,"$1.\\:hover");return e+", "+t}))}function h(e,n){var r=n.doc,o=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,a=function(e){var t=u[e.tagName]?u[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=n),"rr_height"===t&&(i.style.height=n),"rr_mediaState"===t)switch(n){case"played":i.play();case"paused":i.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&o&&(n=p(n)),l||c){for(var u=r.createTextNode(n),d=0,f=Array.from(i.childNodes);d<f.length;d++){var h=f[d];h.nodeType===i.TEXT_NODE&&i.removeChild(h)}return i.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?i.setAttributeNS("http://www.w3.org/1999/xlink",t,n):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?i.setAttribute("_"+t,n):i.setAttribute(t,n)}catch(e){}}};for(var l in e.attributes)s(l);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case t.Text:return r.createTextNode(e.isStyle&&o?p(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function m(e,n){var r=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,l=n.hackCss,c=void 0===l||l,u=n.afterAppend,d=h(e,{doc:r,hackCss:c});if(!d)return null;if(e.rootId&&console.assert(o[e.rootId]===r,"Target document should has the same root id."),e.type===t.Document&&(r.close(),r.open(),d=r),d.__sn=e,o[e.id]=d,(e.type===t.Document||e.type===t.Element)&&!s)for(var f=0,p=e.childNodes;f<p.length;f++){var v=p[f],y=m(v,{doc:r,map:o,skipChild:!1,hackCss:c,afterAppend:u});y?(v.isShadow&&a(d)&&d.shadowRoot?d.shadowRoot.appendChild(y):d.appendChild(y),u&&u(y)):console.warn("Failed to rebuild",v)}return d}function v(e,n){var r=n.doc,o=n.onVisit,i=n.hackCss,a={},s=m(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:n.afterAppend});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){o&&o(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var o in n.attributes)if(n.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(r.scrollLeft=i),"rr_scrollTop"===o&&(r.scrollTop=i)}}}(e)})),[s,a]}function y(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}var g,b,w,S,x,E=Object.freeze({__proto__:null,default:y});function T(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,o,a,s=(i()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,o=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,o),r===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=i();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}!function(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"}(g||(g={})),function(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"}(b||(b={})),function(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"}(w||(w={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(S||(S={})),function(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"}(x||(x={}));var M,N=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var o=performance.now();for(n.timeOffset+=(o-e)*n.speed,e=o;t.length;){var i=t[0];if(!(n.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function I(e,t){if(e.type===g.IncrementalSnapshot&&e.data.source===b.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(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"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function l(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function o(){var e={line:n,column:r};return function(t){return t.position=new a(e),m(),t}}var a=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};a.prototype.content=e;var l=[];function u(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;l.push(o)}function d(){return h(/^{\s*/)}function f(){return h(/^}/)}function p(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=I()||C());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=o(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=c(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(s,""),value:r?c(r[0]).replace(s,""):""});return h(/^[;\s]*/),i}}function w(){var e,t=[];if(!d())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return f()?t:u("missing '}'")}function S(){for(var e,t=[],n=o();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:w()})}var x,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=o(),r=h(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function I(){if("@"===e[0])return function(){var e=o(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,i=t[1];if(!d())return u("@keyframes missing '{'");for(var a=v();r=S();)a.push(r),a=a.concat(v());return f()?e({type:"keyframes",name:i,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=o(),t=h(/^@media *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@media missing '{'");var r=v().concat(p());return f()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=o(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=o(),t=h(/^@supports *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@supports missing '{'");var r=v().concat(p());return f()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=o(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=c(t[1]),r=c(t[2]);if(!d())return u("@document missing '{'");var i=v().concat(p());return f()?e({type:"document",document:r,vendor:n,rules:i}):u("@document missing '}'")}}()||function(){var e=o();if(h(/^@page */)){var t=g()||[];if(!d())return u("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return f()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=o();if(h(/^@host\s*/)){if(!d())return u("@host missing '{'");var t=v().concat(p());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=o();if(h(/^@font-face\s*/)){if(!d())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return f()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function C(){var e=o(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:w()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,i=r?t:n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,i)})):l&&"object"==typeof l&&e(l,i)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((x=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:x,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u={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"};var d=/([^\\]):hover/,f=new RegExp(d,"g");function p(e){var t=l(e,{silent:!0});if(!t.stylesheet)return e;var n=[];if(t.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){d.test(e)&&n.push(e)}))})),0===n.length)return e;var r=new RegExp(n.filter((function(e,t){return n.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g");return e.replace(r,(function(e){var t=e.replace(f,"$1.\\:hover");return e+", "+t}))}function h(e,n){var r=n.doc,i=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var o,a=function(e){var t=u[e.tagName]?u[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);o=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(o.style.width=n),"rr_height"===t&&(o.style.height=n),"rr_mediaCurrentTime"===t&&(o.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(n){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&i&&(n=p(n)),l||c){for(var u=r.createTextNode(n),d=0,f=Array.from(o.childNodes);d<f.length;d++){var h=f[d];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(u),"continue"}try{if(e.isSVG&&"xlink:href"===t)o.setAttributeNS("http://www.w3.org/1999/xlink",t,n);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))o.setAttribute("_"+t,n);else{if("meta"===a&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"==t)return o.setAttribute("csp-content",n),"continue";o.setAttribute(t,n)}}catch(e){}}};for(var l in e.attributes)s(l);if(e.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case t.Text:return r.createTextNode(e.isStyle&&i?p(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function m(e,n){var r=n.doc,i=n.map,o=n.skipChild,s=void 0!==o&&o,l=n.hackCss,c=void 0===l||l,u=n.afterAppend,d=h(e,{doc:r,hackCss:c});if(!d)return null;if(e.rootId&&console.assert(i[e.rootId]===r,"Target document should has the same root id."),e.type===t.Document&&(r.close(),r.open(),d=r),d.__sn=e,i[e.id]=d,(e.type===t.Document||e.type===t.Element)&&!s)for(var f=0,p=e.childNodes;f<p.length;f++){var v=p[f],y=m(v,{doc:r,map:i,skipChild:!1,hackCss:c,afterAppend:u});y?(v.isShadow&&a(d)&&d.shadowRoot?d.shadowRoot.appendChild(y):d.appendChild(y),u&&u(y)):console.warn("Failed to rebuild",v)}return d}function v(e,n){var r=n.doc,i=n.onVisit,o=n.hackCss,a={},s=m(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===o||o,afterAppend:n.afterAppend});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){i&&i(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=n.attributes[i];"rr_scrollLeft"===i&&(r.scrollLeft=o),"rr_scrollTop"===i&&(r.scrollTop=o)}}}(e)})),[s,a]}function y(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}var g,b,w,S,x,E=Object.freeze({__proto__:null,default:y});function T(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}!function(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"}(g||(g={})),function(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"}(b||(b={})),function(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"}(w||(w={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(S||(S={})),function(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"}(x||(x={}));var M,N=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var i=performance.now();for(n.timeOffset+=(i-e)*n.speed,e=i;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function I(e,t){if(e.type===g.IncrementalSnapshot&&e.data.source===b.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************

@@ -30,3 +30,3 @@ Copyright (c) Microsoft Corporation. All rights reserved.

and limitations under the License.
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(M||(M={}));var C={type:"xstate.init"};function _(e){return void 0===e?[]:[].concat(e)}function D(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function k(e){return function(t){return e===t}}function L(e){return"string"==typeof e?{type:e}:e}function O(e,t){return{value:e,context:t,actions:[],changed:!1,matches:k(e)}}function P(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:_(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:k(e.initial)},transition:function(t,r){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=L(r),u=e.states[s];if(u.on){var d=_(u.on[c.type]),f=function(t){if(void 0===t)return{value:O(s,l)};var r="string"==typeof t?{target:t}:t,o=r.target,i=void 0===o?s:o,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=l;if((void 0===f?function(){return!0}:f)(l,c)){var h=e.states[i],m=!1,v=[].concat(u.exit,d,h.entry).filter((function(e){return e})).map((function(e){return A(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,c):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:i,context:p,actions:v,changed:i!==s||v.length>0||m,matches:k(i)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}return O(s,l)}};return n}var R=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function F(e){var t=e.initialState,n=M.NotStarted,r=new Set,o={_machine:e,send:function(o){n===M.Running&&(t=e.transition(t,o),R(t,L(o)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var i="object"==typeof r?r:{context:e.config.context,value:r};t={value:i.value,actions:[],context:i.context,matches:k(i.value)}}return n=M.Running,R(t,C),o},stop:function(){return n=M.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var j="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",B={map:{},getId:function(){return console.error(j),-1},getNode:function(){return console.error(j),null},removeNodeFromMap:function(){console.error(j)},has:function(){return console.error(j),!1},reset:function(){console.error(j)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(B=new Proxy(B,{get:function(e,t,n){return"map"===t&&console.error(j),Reflect.get(e,t,n)}}));var V=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){n.removeIdSet.add(e);var r=t.getNode(e);null==r||r.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var r=n.indexes.get(t.id);if(r){var o=r.parent;o&&(delete r.parent,delete o.children[r.id],n.indexes.delete(e.id))}};o?r?(delete o.parent,delete r.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,o,i=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:b.Mutation,removes:s,texts:l,attributes:c,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=r(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=r(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function U(e){var t,n,o={},i=function(e,t){var n={value:e,parent:t,children:[]};return o[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in o){var f=o[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,i(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,i(c,null))}}else if(d in o){var h=o[d];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function W(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)W(e.children[n],t)}function z(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function Y(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e,t){var o=t.getCastFn,i=t.emitter;return F(P({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:D({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:D((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,l,c=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;c.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){I(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===g.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),v=null==f?void 0:f.timestamp;(null==f?void 0:f.type)===g.IncrementalSnapshot&&f.data.source===b.MouseMove&&(v=f.timestamp+(null===(l=f.data.positions[0])||void 0===l?void 0:l.timeOffset)),d<(v||0)&&i.emit(x.PlayBack);var y=new Array,w=function(e){if(v&&v<d&&(e.timestamp<=v||e===f))return"continue";var t=e.timestamp<d;if(t&&!function(e){switch(e.type){case g.DomContentLoaded:case g.Load:case g.Custom:return!1;case g.FullSnapshot:case g.Meta:return!0}switch(e.data.source){case b.MouseMove:case b.MouseInteraction:case b.TouchMove:case b.MediaInteraction:return!1;case b.ViewportResize:case b.StyleSheetRule:case b.Scroll:case b.Input:return!0}return!0}(e))return"continue";var n=o(e,t);t?n():y.push({doAction:function(){n(),i.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=r(m),E=S.next();!E.done;E=S.next()){w(E.value)}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}i.emit(x.Flush),c.addActions(y),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:D((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:D({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:D((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;I(l,r);var c=s.length-1;if(!s[c]||s[c].timestamp<=l.timestamp)s.push(l);else{for(var u=-1,d=0;d<=c;){var f=Math.floor((d+c)/2);s[f].timestamp<=l.timestamp?d=f+1:c=f-1}-1===u&&(u=d),s.splice(u,0,l)}var p=l.timestamp<r,h=o(l,p);p?h():a.isActive()&&a.addAction({doAction:function(){h(),i.emit(x.EventCast,l)},delay:l.delay})}return n(n({},e),{events:s})}))}}))}var Q=y||E,H={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},G={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},q=function(){function e(e,t){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Q(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstPlayedEvent=null,this.newDocumentQueue=[],!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:H,logConfig:G};this.config=Object.assign({},o,t),this.config.logConfig.replayLogger||(this.config.logConfig.replayLogger=this.getConsoleLogger()),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new V,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(x.Flush,(function(){var e,t,o,i,a=n.treeIndex.flush(),s=a.scrollMap,l=a.inputMap;n.fragmentParentMap.forEach((function(e,t){return n.restoreRealParent(t,e)})),n.fragmentParentMap.clear(),n.elementStateMap.clear();try{for(var c=r(s.values()),u=c.next();!u.done;u=c.next()){var d=u.value;n.applyScroll(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var f=r(l.values()),p=f.next();!p.done;p=f.next()){d=p.value;n.applyInput(d)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}})),this.emitter.on(x.PlayBack,(function(){n.firstPlayedEvent=null,n.mirror.reset()}));var i=new N([],(null==t?void 0:t.speed)||o.speed);this.service=X({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){n.emitter.emit(x.StateChange,{player:e})})),this.speedService=F(P({id:"speed",context:{normalSpeed:-1,timer:i},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:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:D({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){n.emitter.emit(x.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===g.Meta})),s=this.service.state.context.events.find((function(e){return e.type===g.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){n.emitter.emit(x.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){n.firstPlayedEvent||(n.firstPlayedEvent=s,n.rebuildFullSnapshot(s),n.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?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"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(x.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){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),!1!==this.config.mouseTail&&(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");var e,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&&(T(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(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=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var o=r([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Custom:n=function(){o.emitter.emit(x.CustomEvent,e)};break;case g.Meta:n=function(){return o.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:n=function(){o.firstPlayedEvent&&o.firstPlayedEvent===e||(o.rebuildFullSnapshot(e,t),o.iframe.contentWindow.scrollTo(e.data.initialOffset))};break;case g.IncrementalSnapshot:n=function(){var n,i;if(o.applyIncremental(e,t),!t&&(e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=r(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&o.isUserInteraction(l)){l.delay-e.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(o.nextUserInteractionEvent){var c=o.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:u}),o.emitter.emit(x.SkipStart,u)}}}}return function(){if(n&&n(),o.service.send({type:"CAST_EVENT",payload:{event:e}}),e===o.service.state.context.events[o.service.state.context.events.length-1]){var t=function(){o.backToNormal(),o.service.send("END"),o.emitter.emit(x.Finish)};e.type===g.IncrementalSnapshot&&e.data.source===b.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,50-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){var n,o,i=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=v(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}})[1];var s=function(e,t){if(l.attachDocumentToIframe(e,t),l.newDocumentQueue=l.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var n=t.contentDocument,r=n.documentElement,o=n.head;l.insertStyleRules(r,o)}},l=this;try{for(var c=r(a),u=c.next();!u.done;u=c.next()){var d=u.value;s(d.mutationInQueue,d.builtNode)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}var f=this.iframe.contentDocument,p=f.documentElement,h=f.head;this.insertStyleRules(p,h),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var n=document.createElement("style");e.insertBefore(n,t);var r,o=(r=this.config.blockClass,["."+r+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused * { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)n.sheet.insertRule(o[i],i)},e.prototype.attachDocumentToIframe=function(e,t){var n,o,i=this,a=[];if(!t.contentDocument)for(var s=t.parentNode;s;){if(this.fragmentParentMap.has(s)){var l=s,c=this.fragmentParentMap.get(l);this.restoreRealParent(l,c);break}s=s.parentNode}m(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}});var u=function(e,t){if(d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var n=t.contentDocument,r=n.documentElement,o=n.head;d.insertStyleRules(r,o)}},d=this;try{for(var f=r(a),p=f.next();!p.done;p=f.next()){var h=p.value;u(h.mutationInQueue,h.builtNode)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(z(t)){var n=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));n&&e.push({mutationInQueue:n,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,o=new Set,i=this.service.state,a=function(){i=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(o.add(e),e.addEventListener("load",(function(){o.delete(e),0===o.size&&-1!==r&&(i.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),r=window.setTimeout((function(){i.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,o=(this.service.state,function(){n.service.state});this.emitter.on(x.Start,o),this.emitter.on(x.Pause,o);var i=0;try{for(var a=r(this.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.type===g.IncrementalSnapshot&&l.data.source===b.CanvasMutation&&"drawImage"===l.data.property&&"string"==typeof l.data.args[0]&&!this.imageMap.has(l)){i++;var c=document.createElement("canvas"),u=c.getContext("2d"),d=null==u?void 0:u.createImageData(c.width,c.height);null==d||d.data;JSON.parse(l.data.args[0]),null==u||u.putImageData(d,0,0)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==i&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,o=this,i=e.data;switch(i.source){case b.Mutation:t&&(i.adds.forEach((function(e){return o.treeIndex.add(e)})),i.texts.forEach((function(e){return o.treeIndex.text(e)})),i.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),i.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)}))),this.applyMutation(i,t);break;case b.Drag:case b.TouchMove:case b.MouseMove:if(t){var a=i.positions[i.positions.length-1];this.moveAndHover(i,a.x,a.y,a.id)}else i.positions.forEach((function(t){var n={doAction:function(){o.moveAndHover(i,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=i.positions[0])||void 0===n?void 0:n.timeOffset)});break;case b.MouseInteraction:if(-1===i.id)break;var s=new Event(w[i.type].toLowerCase());if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(x.MouseInteraction,{type:i.type,target:v});var l=this.config.triggerFocus;switch(i.type){case w.Blur:"blur"in v&&v.blur();break;case w.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case w.Click:case w.TouchStart:case w.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case b.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case b.ViewportResize:this.emitter.emit(x.Resize,{width:i.width,height:i.height});break;case b.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case b.MediaInteraction:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var c=v;try{i.type===S.Pause&&c.pause(),i.type===S.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case b.StyleSheetRule:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var u=v,d=v.parentNode,f=this.fragmentParentMap.has(d),p=void 0;if(f){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),d.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,n=e.index;try{var r=void 0===n?void 0:Math.min(n,m.rules.length);try{m.insertRule(t,r)}catch(e){}}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),f&&p&&d.replaceChild(v,p);break;case b.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{var y=v.getContext("2d");if(i.setter)return void(y[i.property]=i.args[0]);var g=y[i.property];if("drawImage"===i.property&&"string"==typeof i.args[0]){var E=this.imageMap.get(e);i.args[0]=E,g.apply(y,i.args)}else g.apply(y,i.args)}catch(e){this.warnCanvasMutationFailed(i,i.id,e)}break;case b.Font:try{var T=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}break;case b.Log:try{var M=e.data,N=this.config.logConfig.replayLogger;"function"==typeof N[M.level]&&N[M.level](M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);var r=s.mirror.getNode(t.parentId);if(!r)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Y(r)&&(r=r.shadowRoot),s.mirror.removeNodeFromMap(n),r){var o="__sn"in r?s.fragmentParentMap.get(r):void 0;if(o&&o.contains(n))o.removeChild(n);else if(s.fragmentParentMap.has(n)){var i=s.fragmentParentMap.get(n);r.removeChild(i),s.fragmentParentMap.delete(n)}else r.removeChild(n)}}));var l=n({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var n,r;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var i=s.mirror.getNode(e.parentId);if(!i)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var a=null;s.iframe.contentDocument.contains?a=s.iframe.contentDocument.contains(i):s.iframe.contentDocument.body.contains&&(a=s.iframe.contentDocument.body.contains(i));var u=(null===(r=(n=i).getElementsByTagName)||void 0===r?void 0:r.call(n,"iframe").length)>0;if(o&&a&&!z(i)&&!u){var d=document.createDocumentFragment();for(s.mirror.map[e.parentId]=d,s.fragmentParentMap.set(d,i),s.storeState(i);i.firstChild;)d.appendChild(i.firstChild);i=d}e.node.isShadow&&Y(i)&&(i=i.shadowRoot);var f=null,p=null;if(e.previousId&&(f=s.mirror.getNode(e.previousId)),e.nextId&&(p=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var h=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(z(i))s.attachDocumentToIframe(e,i);else{var v=m(e.node,{doc:h,map:s.mirror.map,skipChild:!0,hackCss:!0});if(-1!==e.previousId&&-1!==e.nextId){if(f&&f.nextSibling&&f.nextSibling.parentNode)i.insertBefore(v,f.nextSibling);else if(p&&p.parentNode)i.contains(p)?i.insertBefore(v,p):i.insertBefore(v,null);else{if(i===h)for(;h.firstChild;)h.removeChild(h.firstChild);i.appendChild(v)}if(z(v)){var y=s.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));if(y&&(s.attachDocumentToIframe(y,v),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==y}))),v.contentDocument){var g=v.contentDocument,b=g.documentElement,w=g.head;s.insertStyleRules(b,w)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,i,v,e)}else l[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=U(c);if(c.length=0,Date.now()-d>500){this.warn("Timeout in the loop, please check the resolve tree data:",f);break}try{for(var p=(i=void 0,r(f)),h=p.next();!h.done;h=p.next()){var v=h.value;this.mirror.getNode(v.value.parentId)?W(v,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);for(var r in s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var o=t.attributes[r];try{null!==o?n.setAttribute(r,o):n.removeAttribute(r)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ";return t+=e.trace.join("\n\tat ")},e.prototype.getConsoleLogger=function(){var e,t,n=this,o={},a=function(e){o[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,i(e.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(e)]))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,i(t.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(t)]))}};try{for(var s=r(this.config.logConfig.level),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return o},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){var o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(e,r);var i=function e(t,n){var r,o,i=null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.frameElement;if(!i||i===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=i.getBoundingClientRect(),s=e(i,n),l=a.height/i.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}(o,this.iframe),a=t*i.absoluteScale+i.x,s=n*i.absoluteScale+i.y;this.mouse.style.left=a+"px",this.mouse.style.top=s+"px",this.drawMouseTail({x:a,y:s}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?H:Object.assign({},H,this.config.mouseTail),r=n.lineCap,o=n.lineWidth,i=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=r,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===g.IncrementalSnapshot&&(e.data.source>b.Mutation&&e.data.source<=b.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,n){this.mirror.map[n.__sn.id]=n,n.__sn.type===t.Element&&"textarea"===n.__sn.tagName&&e.textContent&&(n.value=e.textContent),n.appendChild(e),this.restoreState(n)},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]});var i=o.children;try{for(var a=r(Array.from(i)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i(["[replayer]"],e))},e}();return e.Replayer=q,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(M||(M={}));var C={type:"xstate.init"};function D(e){return void 0===e?[]:[].concat(e)}function A(e){return{type:"xstate.assign",assignment:e}}function k(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function _(e){return function(t){return e===t}}function P(e){return"string"==typeof e?{type:e}:e}function O(e,t){return{value:e,context:t,actions:[],changed:!1,matches:_(e)}}function F(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:D(e.states[e.initial].entry).map((function(e){return k(e,t.actions)})),context:e.context,matches:_(e.initial)},transition:function(t,r){var i,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=P(r),u=e.states[s];if(u.on){var d=D(u.on[c.type]),f=function(t){if(void 0===t)return{value:O(s,l)};var r="string"==typeof t?{target:t}:t,i=r.target,o=void 0===i?s:i,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=l;if((void 0===f?function(){return!0}:f)(l,c)){var h=e.states[o],m=!1,v=[].concat(u.exit,d,h.entry).filter((function(e){return e})).map((function(e){return k(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,c):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:o,context:p,actions:v,changed:o!==s||v.length>0||m,matches:_(o)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return O(s,l)}};return n}var R=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function L(e){var t=e.initialState,n=M.NotStarted,r=new Set,i={_machine:e,send:function(i){n===M.Running&&(t=e.transition(t,i),R(t,P(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var o="object"==typeof r?r:{context:e.config.context,value:r};t={value:o.value,actions:[],context:o.context,matches:_(o.value)}}return n=M.Running,R(t,C),i},stop:function(){return n=M.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var B="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",j={map:{},getId:function(){return console.error(B),-1},getNode:function(){return console.error(B),null},removeNodeFromMap:function(){console.error(B)},has:function(){return console.error(B),!1},reset:function(){console.error(B)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(j=new Proxy(j,{get:function(e,t,n){return"map"===t&&console.error(B),Reflect.get(e,t,n)}}));var V=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),o=function(e){n.removeIdSet.add(e);var r=t.getNode(e);null==r||r.childNodes.forEach((function(e){"__sn"in e&&o(e.__sn.id)}))},a=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),a(i)):(delete this.tree[i.id],this.indexes.delete(i.id),a(i)):(this.removeNodeMutations.push(e),o(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,i,o=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:b.Mutation,removes:s,texts:l,attributes:c,adds:[]},d=function(e,t){t&&o.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=r(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=r(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function U(e){var t,n,i={},o=function(e,t){var n={value:e,parent:t,children:[]};return i[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in i){var f=i[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,o(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,o(c,null))}}else if(d in i){var h=i[d];h.children.push(o(c,h))}else a.push(o(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function W(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)W(e.children[n],t)}function z(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function Y(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e,t){var i=t.getCastFn,o=t.emitter;return L(F({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:A({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:A((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,l,c=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;c.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){I(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===g.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),v=null==f?void 0:f.timestamp;(null==f?void 0:f.type)===g.IncrementalSnapshot&&f.data.source===b.MouseMove&&(v=f.timestamp+(null===(l=f.data.positions[0])||void 0===l?void 0:l.timeOffset)),d<(v||0)&&o.emit(x.PlayBack);var y=new Array,w=function(e){if(v&&v<d&&(e.timestamp<=v||e===f))return"continue";var t=e.timestamp<d;if(t&&!function(e){switch(e.type){case g.DomContentLoaded:case g.Load:case g.Custom:return!1;case g.FullSnapshot:case g.Meta:case g.Plugin:return!0}switch(e.data.source){case b.MouseMove:case b.MouseInteraction:case b.TouchMove:case b.MediaInteraction:return!1;case b.ViewportResize:case b.StyleSheetRule:case b.Scroll:case b.Input:return!0}return!0}(e))return"continue";var n=i(e,t);t?n():y.push({doAction:function(){n(),o.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=r(m),E=S.next();!E.done;E=S.next()){w(E.value)}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}o.emit(x.Flush),c.addActions(y),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:A((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:A({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:A((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;I(l,r);var c=s.length-1;if(!s[c]||s[c].timestamp<=l.timestamp)s.push(l);else{for(var u=-1,d=0;d<=c;){var f=Math.floor((d+c)/2);s[f].timestamp<=l.timestamp?d=f+1:c=f-1}-1===u&&(u=d),s.splice(u,0,l)}var p=l.timestamp<r,h=i(l,p);p?h():a.isActive()&&a.addAction({doAction:function(){h(),o.emit(x.EventCast,l)},delay:l.delay})}return n(n({},e),{events:s})}))}}))}var Q=y||E,H={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},G=function(){function e(e,t){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Q(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstPlayedEvent=null,this.newDocumentQueue=[],!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:H};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new V,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(x.Flush,(function(){var e,t,i,o,a=n.treeIndex.flush(),s=a.scrollMap,l=a.inputMap;n.fragmentParentMap.forEach((function(e,t){return n.restoreRealParent(t,e)})),n.fragmentParentMap.clear(),n.elementStateMap.clear();try{for(var c=r(s.values()),u=c.next();!u.done;u=c.next()){var d=u.value;n.applyScroll(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var f=r(l.values()),p=f.next();!p.done;p=f.next()){d=p.value;n.applyInput(d)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}})),this.emitter.on(x.PlayBack,(function(){n.firstPlayedEvent=null,n.mirror.reset()}));var o=new N([],(null==t?void 0:t.speed)||i.speed);this.service=X({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){n.emitter.emit(x.StateChange,{player:e})})),this.speedService=L(F({id:"speed",context:{normalSpeed:-1,timer:o},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:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:A({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){n.emitter.emit(x.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===g.Meta})),s=this.service.state.context.events.find((function(e){return e.type===g.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){n.emitter.emit(x.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){n.firstPlayedEvent||(n.firstPlayedEvent=s,n.rebuildFullSnapshot(s),n.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?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"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(x.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){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),!1!==this.config.mouseTail&&(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");var e,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&&(T(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(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=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var i=r([this.mouseTail,this.iframe]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,i=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Custom:n=function(){i.emitter.emit(x.CustomEvent,e)};break;case g.Meta:n=function(){return i.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:n=function(){i.firstPlayedEvent&&i.firstPlayedEvent===e||(i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset))};break;case g.IncrementalSnapshot:n=function(){var n,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=r(i.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&i.isUserInteraction(l)){l.delay-e.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}if(i.nextUserInteractionEvent){var c=i.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),i.config.maxSpeed)};i.speedService.send({type:"FAST_FORWARD",payload:u}),i.emitter.emit(x.SkipStart,u)}}}}return function(){var o,a;n&&n();try{for(var s=r(i.config.plugins||[]),l=s.next();!l.done;l=s.next()){l.value.handler(e,t,{replayer:i})}}catch(e){o={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}i.service.send({type:"CAST_EVENT",payload:{event:e}});var c=i.service.state.context.events.length-1;if(e===i.service.state.context.events[c]){var u=function(){c<i.service.state.context.events.length-1||(i.backToNormal(),i.service.send("END"),i.emitter.emit(x.Finish))};e.type===g.IncrementalSnapshot&&e.data.source===b.MouseMove&&e.data.positions.length?setTimeout((function(){u()}),Math.max(0,50-e.data.positions[0].timeOffset)):u()}}},e.prototype.rebuildFullSnapshot=function(e,t){var n,i,o=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=v(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)}})[1];var s=function(e,t){if(l.attachDocumentToIframe(e,t),l.newDocumentQueue=l.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var n=t.contentDocument,r=n.documentElement,i=n.head;l.insertStyleRules(r,i)}},l=this;try{for(var c=r(a),u=c.next();!u.done;u=c.next()){var d=u.value;s(d.mutationInQueue,d.builtNode)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var f=this.iframe.contentDocument,p=f.documentElement,h=f.head;this.insertStyleRules(p,h),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var n=document.createElement("style");e.insertBefore(n,t);var r,i=(r=this.config.blockClass,["."+r+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&i.push("html.rrweb-paused * { animation-play-state: paused !important; }");for(var o=0;o<i.length;o++)n.sheet.insertRule(i[o],o)},e.prototype.attachDocumentToIframe=function(e,t){var n,i,o=this,a=[];if(!t.contentDocument)for(var s=t.parentNode;s;){if(this.fragmentParentMap.has(s)){var l=s,c=this.fragmentParentMap.get(l);this.restoreRealParent(l,c);break}s=s.parentNode}m(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)}});var u=function(e,t){if(d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var n=t.contentDocument,r=n.documentElement,i=n.head;d.insertStyleRules(r,i)}},d=this;try{for(var f=r(a),p=f.next();!p.done;p=f.next()){var h=p.value;u(h.mutationInQueue,h.builtNode)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(z(t)){var n=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));n&&e.push({mutationInQueue:n,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),r=window.setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,i=(this.service.state,function(){n.service.state});this.emitter.on(x.Start,i),this.emitter.on(x.Pause,i);var o=0;try{for(var a=r(this.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.type===g.IncrementalSnapshot&&l.data.source===b.CanvasMutation&&"drawImage"===l.data.property&&"string"==typeof l.data.args[0]&&!this.imageMap.has(l)){o++;var c=document.createElement("canvas"),u=c.getContext("2d"),d=null==u?void 0:u.createImageData(c.width,c.height);null==d||d.data;JSON.parse(l.data.args[0]),null==u||u.putImageData(d,0,0)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==o&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,i=this,o=e.data;switch(o.source){case b.Mutation:t&&(o.adds.forEach((function(e){return i.treeIndex.add(e)})),o.texts.forEach((function(e){return i.treeIndex.text(e)})),o.attributes.forEach((function(e){return i.treeIndex.attribute(e)})),o.removes.forEach((function(e){return i.treeIndex.remove(e,i.mirror)}))),this.applyMutation(o,t);break;case b.Drag:case b.TouchMove:case b.MouseMove:if(t){var a=o.positions[o.positions.length-1];this.moveAndHover(o,a.x,a.y,a.id)}else o.positions.forEach((function(t){var n={doAction:function(){i.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-i.service.state.context.baselineTime};i.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=o.positions[0])||void 0===n?void 0:n.timeOffset)});break;case b.MouseInteraction:if(-1===o.id)break;var s=new Event(w[o.type].toLowerCase());if(!(v=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);this.emitter.emit(x.MouseInteraction,{type:o.type,target:v});var l=this.config.triggerFocus;switch(o.type){case w.Blur:"blur"in v&&v.blur();break;case w.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case w.Click:case w.TouchStart:case w.TouchEnd:t||(this.moveAndHover(o,o.x,o.y,o.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case b.Scroll:if(-1===o.id)break;if(t){this.treeIndex.scroll(o);break}this.applyScroll(o);break;case b.ViewportResize:this.emitter.emit(x.Resize,{width:o.width,height:o.height});break;case b.Input:if(-1===o.id)break;if(t){this.treeIndex.input(o);break}this.applyInput(o);break;case b.MediaInteraction:if(!(v=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var c=v;try{o.currentTime&&(c.currentTime=o.currentTime),o.type===S.Pause&&c.pause(),o.type===S.Play&&c.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case b.StyleSheetRule:if(!(v=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var u=v,d=v.parentNode,f=this.fragmentParentMap.has(d),p=void 0;if(f){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),d.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;o.adds&&o.adds.forEach((function(e){var t=e.rule,n=e.index;try{var r=void 0===n?void 0:Math.min(n,m.rules.length);try{m.insertRule(t,r)}catch(e){}}catch(e){}})),o.removes&&o.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),f&&p&&d.replaceChild(v,p);break;case b.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{var y=v.getContext("2d");if(o.setter)return void(y[o.property]=o.args[0]);var g=y[o.property];if("drawImage"===o.property&&"string"==typeof o.args[0]){var E=this.imageMap.get(e);o.args[0]=E,g.apply(y,o.args)}else g.apply(y,o.args)}catch(e){this.warnCanvasMutationFailed(o,o.id,e)}break;case b.Font:try{var T=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,i){var o,a,s=this;e.removes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);var r=s.mirror.getNode(t.parentId);if(!r)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Y(r)&&(r=r.shadowRoot),s.mirror.removeNodeFromMap(n),r){var i="__sn"in r?s.fragmentParentMap.get(r):void 0;if(i&&i.contains(n))i.removeChild(n);else if(s.fragmentParentMap.has(n)){var o=s.fragmentParentMap.get(n);r.removeChild(o),s.fragmentParentMap.delete(n)}else r.removeChild(n)}}));var l=n({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var n,r;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var o=s.mirror.getNode(e.parentId);if(!o)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var a=null;s.iframe.contentDocument.contains?a=s.iframe.contentDocument.contains(o):s.iframe.contentDocument.body.contains&&(a=s.iframe.contentDocument.body.contains(o));var u=(null===(r=(n=o).getElementsByTagName)||void 0===r?void 0:r.call(n,"iframe").length)>0;if(i&&a&&!z(o)&&!u){var d=document.createDocumentFragment();for(s.mirror.map[e.parentId]=d,s.fragmentParentMap.set(d,o),s.storeState(o);o.firstChild;)d.appendChild(o.firstChild);o=d}e.node.isShadow&&Y(o)&&(o=o.shadowRoot);var f=null,p=null;if(e.previousId&&(f=s.mirror.getNode(e.previousId)),e.nextId&&(p=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var h=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(z(o))s.attachDocumentToIframe(e,o);else{var v=m(e.node,{doc:h,map:s.mirror.map,skipChild:!0,hackCss:!0});if(-1!==e.previousId&&-1!==e.nextId){if(f&&f.nextSibling&&f.nextSibling.parentNode)o.insertBefore(v,f.nextSibling);else if(p&&p.parentNode)o.contains(p)?o.insertBefore(v,p):o.insertBefore(v,null);else{if(o===h)for(;h.firstChild;)h.removeChild(h.firstChild);o.appendChild(v)}if(z(v)){var y=s.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));if(y&&(s.attachDocumentToIframe(y,v),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==y}))),v.contentDocument){var g=v.contentDocument,b=g.documentElement,w=g.head;s.insertStyleRules(b,w)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,o,v,e)}else l[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=U(c);if(c.length=0,Date.now()-d>500){this.warn("Timeout in the loop, please check the resolve tree data:",f);break}try{for(var p=(o=void 0,r(f)),h=p.next();!h.done;h=p.next()){var v=h.value;this.mirror.getNode(v.value.parentId)?W(v,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);for(var r in s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var i=t.attributes[r];try{null!==i?n.setAttribute(r,i):n.removeAttribute(r)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){var i=this.mirror.getNode(r);if(!i)return this.debugNodeNotFound(e,r);var o=function e(t,n){var r,i,o=null===(i=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=o.getBoundingClientRect(),s=e(o,n),l=a.height/o.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}(i,this.iframe),a=t*o.absoluteScale+o.x,s=n*o.absoluteScale+o.y;this.mouse.style.left=a+"px",this.mouse.style.top=s+"px",this.drawMouseTail({x:a,y:s}),this.hoverElements(i)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?H:Object.assign({},H,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,o=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=r,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===g.IncrementalSnapshot&&(e.data.source>b.Mutation&&e.data.source<=b.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,n){this.mirror.map[n.__sn.id]=n,n.__sn.type===t.Element&&"textarea"===n.__sn.tagName&&e.textContent&&(n.value=e.textContent),n.appendChild(e),this.restoreState(n)},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]});var o=i.children;try{for(var a=r(Array.from(o)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var i=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(i.scrollLeft=o.scroll[0],i.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var a=i.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,o(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,o(["[replayer]"],e))},e}();return e.Replayer=G,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-replay.min.js.map

@@ -11,1373 +11,2 @@ var NodeType;

function isElement(n) {
return n.nodeType === n.ELEMENT_NODE;
}
function isShadowRoot(n) {
var _a;
var host = (_a = n) === null || _a === void 0 ? void 0 : _a.host;
return Boolean(host && host.shadowRoot && host.shadowRoot === n);
}
var _id = 1;
var tagNameRegex = RegExp('[^a-z0-9-_]');
var IGNORED_NODE = -2;
function genId() {
return _id++;
}
function getValidTagName(element) {
if (element instanceof HTMLFormElement) {
return 'form';
}
var processedTagName = element.tagName.toLowerCase().trim();
if (tagNameRegex.test(processedTagName)) {
return 'div';
}
return processedTagName;
}
function getCssRulesString(s) {
try {
var rules = s.rules || s.cssRules;
return rules ? Array.from(rules).map(getCssRuleString).join('') : null;
}
catch (error) {
return null;
}
}
function getCssRuleString(rule) {
return isCSSImportRule(rule)
? getCssRulesString(rule.styleSheet) || ''
: rule.cssText;
}
function isCSSImportRule(rule) {
return 'styleSheet' in rule;
}
function extractOrigin(url) {
var origin;
if (url.indexOf('//') > -1) {
origin = url.split('/').slice(0, 3).join('/');
}
else {
origin = url.split('/')[0];
}
origin = origin.split('?')[0];
return origin;
}
var URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm;
var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/;
var DATA_URI = /^(data:)([^,]*),(.*)/i;
function absoluteToStylesheet(cssText, href) {
return (cssText || '').replace(URL_IN_CSS_REF, function (origin, quote1, path1, quote2, path2, path3) {
var filePath = path1 || path2 || path3;
var maybeQuote = quote1 || quote2 || '';
if (!filePath) {
return origin;
}
if (!RELATIVE_PATH.test(filePath)) {
return "url(" + maybeQuote + filePath + maybeQuote + ")";
}
if (DATA_URI.test(filePath)) {
return "url(" + maybeQuote + filePath + maybeQuote + ")";
}
if (filePath[0] === '/') {
return "url(" + maybeQuote + (extractOrigin(href) + filePath) + maybeQuote + ")";
}
var stack = href.split('/');
var parts = filePath.split('/');
stack.pop();
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
var part = parts_1[_i];
if (part === '.') {
continue;
}
else if (part === '..') {
stack.pop();
}
else {
stack.push(part);
}
}
return "url(" + maybeQuote + stack.join('/') + maybeQuote + ")";
});
}
function getAbsoluteSrcsetString(doc, attributeValue) {
if (attributeValue.trim() === '') {
return attributeValue;
}
var srcsetValues = attributeValue.split(',');
var resultingSrcsetString = srcsetValues
.map(function (srcItem) {
var trimmedSrcItem = srcItem.trimLeft().trimRight();
var urlAndSize = trimmedSrcItem.split(' ');
if (urlAndSize.length === 2) {
var absUrl = absoluteToDoc(doc, urlAndSize[0]);
return absUrl + " " + urlAndSize[1];
}
else if (urlAndSize.length === 1) {
var absUrl = absoluteToDoc(doc, urlAndSize[0]);
return "" + absUrl;
}
return '';
})
.join(', ');
return resultingSrcsetString;
}
function absoluteToDoc(doc, attributeValue) {
if (!attributeValue || attributeValue.trim() === '') {
return attributeValue;
}
var a = doc.createElement('a');
a.href = attributeValue;
return a.href;
}
function isSVGElement(el) {
return el.tagName === 'svg' || el instanceof SVGElement;
}
function getHref() {
var a = document.createElement('a');
a.href = '';
return a.href;
}
function transformAttribute(doc, tagName, name, value) {
if (name === 'src' || ((name === 'href' || name === 'xlink:href') && value)) {
return absoluteToDoc(doc, value);
}
else if (name === 'background' &&
value &&
(tagName === 'table' || tagName === 'td' || tagName === 'th')) {
return absoluteToDoc(doc, value);
}
else if (name === 'srcset' && value) {
return getAbsoluteSrcsetString(doc, value);
}
else if (name === 'style' && value) {
return absoluteToStylesheet(value, getHref());
}
else {
return value;
}
}
function _isBlockedElement(element, blockClass, blockSelector) {
if (typeof blockClass === 'string') {
if (element.classList.contains(blockClass)) {
return true;
}
}
else {
for (var eIndex = 0; eIndex < element.classList.length; eIndex++) {
var className = element.classList[eIndex];
if (blockClass.test(className)) {
return true;
}
}
}
if (blockSelector) {
return element.matches(blockSelector);
}
return false;
}
function needMaskingText(node, maskTextClass, maskTextSelector) {
if (!node) {
return false;
}
if (node.nodeType === node.ELEMENT_NODE) {
if (typeof maskTextClass === 'string') {
if (node.classList.contains(maskTextClass)) {
return true;
}
}
else {
node.classList.forEach(function (className) {
if (maskTextClass.test(className)) {
return true;
}
});
}
if (maskTextSelector) {
if (node.matches(maskTextSelector)) {
return true;
}
}
return needMaskingText(node.parentNode, maskTextClass, maskTextSelector);
}
if (node.nodeType === node.TEXT_NODE) {
return needMaskingText(node.parentNode, maskTextClass, maskTextSelector);
}
return needMaskingText(node.parentNode, maskTextClass, maskTextSelector);
}
function onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {
var win = iframeEl.contentWindow;
if (!win) {
return;
}
var fired = false;
var readyState;
try {
readyState = win.document.readyState;
}
catch (error) {
return;
}
if (readyState !== 'complete') {
var timer_1 = setTimeout(function () {
if (!fired) {
listener();
fired = true;
}
}, iframeLoadTimeout);
iframeEl.addEventListener('load', function () {
clearTimeout(timer_1);
fired = true;
listener();
});
return;
}
var blankUrl = 'about:blank';
if (win.location.href !== blankUrl ||
iframeEl.src === blankUrl ||
iframeEl.src === '') {
listener();
return;
}
iframeEl.addEventListener('load', listener);
}
function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas;
var rootId;
if (doc.__sn) {
var docId = doc.__sn.id;
rootId = docId === 1 ? undefined : docId;
}
switch (n.nodeType) {
case n.DOCUMENT_NODE:
return {
type: NodeType.Document,
childNodes: [],
rootId: rootId,
};
case n.DOCUMENT_TYPE_NODE:
return {
type: NodeType.DocumentType,
name: n.name,
publicId: n.publicId,
systemId: n.systemId,
rootId: rootId,
};
case n.ELEMENT_NODE:
var needBlock = _isBlockedElement(n, blockClass, blockSelector);
var tagName = getValidTagName(n);
var attributes_1 = {};
for (var _i = 0, _b = Array.from(n.attributes); _i < _b.length; _i++) {
var _c = _b[_i], name = _c.name, value = _c.value;
attributes_1[name] = transformAttribute(doc, tagName, name, value);
}
if (tagName === 'link' && inlineStylesheet) {
var stylesheet = Array.from(doc.styleSheets).find(function (s) {
return s.href === n.href;
});
var cssText = getCssRulesString(stylesheet);
if (cssText) {
delete attributes_1.rel;
delete attributes_1.href;
attributes_1._cssText = absoluteToStylesheet(cssText, stylesheet.href);
}
}
if (tagName === 'style' &&
n.sheet &&
!(n.innerText ||
n.textContent ||
'').trim().length) {
var cssText = getCssRulesString(n.sheet);
if (cssText) {
attributes_1._cssText = absoluteToStylesheet(cssText, getHref());
}
}
if (tagName === 'input' ||
tagName === 'textarea' ||
tagName === 'select') {
var value = n.value;
if (attributes_1.type !== 'radio' &&
attributes_1.type !== 'checkbox' &&
attributes_1.type !== 'submit' &&
attributes_1.type !== 'button' &&
value) {
attributes_1.value =
maskInputOptions[attributes_1.type] ||
maskInputOptions[tagName]
? '*'.repeat(value.length)
: value;
}
else if (n.checked) {
attributes_1.checked = n.checked;
}
}
if (tagName === 'option') {
var selectValue = n.parentElement;
if (attributes_1.value === selectValue.value) {
attributes_1.selected = n.selected;
}
}
if (tagName === 'canvas' && recordCanvas) {
attributes_1.rr_dataURL = n.toDataURL();
}
if (tagName === 'audio' || tagName === 'video') {
attributes_1.rr_mediaState = n.paused
? 'paused'
: 'played';
}
if (n.scrollLeft) {
attributes_1.rr_scrollLeft = n.scrollLeft;
}
if (n.scrollTop) {
attributes_1.rr_scrollTop = n.scrollTop;
}
if (needBlock) {
var _d = n.getBoundingClientRect(), width = _d.width, height = _d.height;
attributes_1 = {
class: attributes_1.class,
rr_width: width + "px",
rr_height: height + "px",
};
}
if (tagName === 'iframe') {
delete attributes_1.src;
}
return {
type: NodeType.Element,
tagName: tagName,
attributes: attributes_1,
childNodes: [],
isSVG: isSVGElement(n) || undefined,
needBlock: needBlock,
rootId: rootId,
};
case n.TEXT_NODE:
var parentTagName = n.parentNode && n.parentNode.tagName;
var textContent = n.textContent;
var isStyle = parentTagName === 'STYLE' ? true : undefined;
var isScript = parentTagName === 'SCRIPT' ? true : undefined;
if (isStyle && textContent) {
textContent = absoluteToStylesheet(textContent, getHref());
}
if (isScript) {
textContent = 'SCRIPT_PLACEHOLDER';
}
if (!isStyle &&
!isScript &&
needMaskingText(n, maskTextClass, maskTextSelector) &&
textContent) {
textContent = maskTextFn
? maskTextFn(textContent)
: textContent.replace(/[\S]/g, '*');
}
return {
type: NodeType.Text,
textContent: textContent || '',
isStyle: isStyle,
rootId: rootId,
};
case n.CDATA_SECTION_NODE:
return {
type: NodeType.CDATA,
textContent: '',
rootId: rootId,
};
case n.COMMENT_NODE:
return {
type: NodeType.Comment,
textContent: n.textContent || '',
rootId: rootId,
};
default:
return false;
}
}
function lowerIfExists(maybeAttr) {
if (maybeAttr === undefined) {
return '';
}
else {
return maybeAttr.toLowerCase();
}
}
function slimDOMExcluded(sn, slimDOMOptions) {
if (slimDOMOptions.comment && sn.type === NodeType.Comment) {
return true;
}
else if (sn.type === NodeType.Element) {
if (slimDOMOptions.script &&
(sn.tagName === 'script' ||
(sn.tagName === 'link' &&
sn.attributes.rel === 'preload' &&
sn.attributes.as === 'script'))) {
return true;
}
else if (slimDOMOptions.headFavicon &&
((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||
(sn.tagName === 'meta' &&
(lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||
lowerIfExists(sn.attributes.name) === 'application-name' ||
lowerIfExists(sn.attributes.rel) === 'icon' ||
lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||
lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {
return true;
}
else if (sn.tagName === 'meta') {
if (slimDOMOptions.headMetaDescKeywords &&
lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {
return true;
}
else if (slimDOMOptions.headMetaSocial &&
(lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||
lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||
lowerIfExists(sn.attributes.name) === 'pinterest')) {
return true;
}
else if (slimDOMOptions.headMetaRobots &&
(lowerIfExists(sn.attributes.name) === 'robots' ||
lowerIfExists(sn.attributes.name) === 'googlebot' ||
lowerIfExists(sn.attributes.name) === 'bingbot')) {
return true;
}
else if (slimDOMOptions.headMetaHttpEquiv &&
sn.attributes['http-equiv'] !== undefined) {
return true;
}
else if (slimDOMOptions.headMetaAuthorship &&
(lowerIfExists(sn.attributes.name) === 'author' ||
lowerIfExists(sn.attributes.name) === 'generator' ||
lowerIfExists(sn.attributes.name) === 'framework' ||
lowerIfExists(sn.attributes.name) === 'publisher' ||
lowerIfExists(sn.attributes.name) === 'progid' ||
lowerIfExists(sn.attributes.property).match(/^article:/) ||
lowerIfExists(sn.attributes.property).match(/^product:/))) {
return true;
}
else if (slimDOMOptions.headMetaVerification &&
(lowerIfExists(sn.attributes.name) === 'google-site-verification' ||
lowerIfExists(sn.attributes.name) === 'yandex-verification' ||
lowerIfExists(sn.attributes.name) === 'csrf-token' ||
lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||
lowerIfExists(sn.attributes.name) === 'verify-v1' ||
lowerIfExists(sn.attributes.name) === 'verification' ||
lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {
return true;
}
}
}
return false;
}
function serializeNodeWithId(n, options) {
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e;
var _f = options.preserveWhiteSpace, preserveWhiteSpace = _f === void 0 ? true : _f;
var _serializedNode = serializeNode(n, {
doc: doc,
blockClass: blockClass,
blockSelector: blockSelector,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
maskTextFn: maskTextFn,
recordCanvas: recordCanvas,
});
if (!_serializedNode) {
console.warn(n, 'not serialized');
return null;
}
var id;
if ('__sn' in n) {
id = n.__sn.id;
}
else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||
(!preserveWhiteSpace &&
_serializedNode.type === NodeType.Text &&
!_serializedNode.isStyle &&
!_serializedNode.textContent.replace(/^\s+|\s+$/gm, '').length)) {
id = IGNORED_NODE;
}
else {
id = genId();
}
var serializedNode = Object.assign(_serializedNode, { id: id });
n.__sn = serializedNode;
if (id === IGNORED_NODE) {
return null;
}
map[id] = n;
if (onSerialize) {
onSerialize(n);
}
var recordChild = !skipChild;
if (serializedNode.type === NodeType.Element) {
recordChild = recordChild && !serializedNode.needBlock;
delete serializedNode.needBlock;
}
if ((serializedNode.type === NodeType.Document ||
serializedNode.type === NodeType.Element) &&
recordChild) {
if (slimDOMOptions.headWhitespace &&
_serializedNode.type === NodeType.Element &&
_serializedNode.tagName === 'head') {
preserveWhiteSpace = false;
}
var bypassOptions = {
doc: doc,
map: map,
blockClass: blockClass,
blockSelector: blockSelector,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
skipChild: skipChild,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
maskTextFn: maskTextFn,
slimDOMOptions: slimDOMOptions,
recordCanvas: recordCanvas,
preserveWhiteSpace: preserveWhiteSpace,
onSerialize: onSerialize,
onIframeLoad: onIframeLoad,
iframeLoadTimeout: iframeLoadTimeout,
};
for (var _i = 0, _g = Array.from(n.childNodes); _i < _g.length; _i++) {
var childN = _g[_i];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);
if (serializedChildNode) {
serializedNode.childNodes.push(serializedChildNode);
}
}
if (isElement(n) && n.shadowRoot) {
serializedNode.isShadowHost = true;
for (var _h = 0, _j = Array.from(n.shadowRoot.childNodes); _h < _j.length; _h++) {
var childN = _j[_h];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);
if (serializedChildNode) {
serializedChildNode.isShadow = true;
serializedNode.childNodes.push(serializedChildNode);
}
}
}
}
if (n.parentNode && isShadowRoot(n.parentNode)) {
serializedNode.isShadow = true;
}
if (serializedNode.type === NodeType.Element &&
serializedNode.tagName === 'iframe') {
onceIframeLoaded(n, function () {
var iframeDoc = n.contentDocument;
if (iframeDoc && onIframeLoad) {
var serializedIframeNode = serializeNodeWithId(iframeDoc, {
doc: iframeDoc,
map: map,
blockClass: blockClass,
blockSelector: blockSelector,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
skipChild: false,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
maskTextFn: maskTextFn,
slimDOMOptions: slimDOMOptions,
recordCanvas: recordCanvas,
preserveWhiteSpace: preserveWhiteSpace,
onSerialize: onSerialize,
onIframeLoad: onIframeLoad,
iframeLoadTimeout: iframeLoadTimeout,
});
if (serializedIframeNode) {
onIframeLoad(n, serializedIframeNode);
}
}
}, iframeLoadTimeout);
}
return serializedNode;
}
function snapshot(n, options) {
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout;
var idNodeMap = {};
var maskInputOptions = maskAllInputs === true
? {
color: true,
date: true,
'datetime-local': true,
email: true,
month: true,
number: true,
range: true,
search: true,
tel: true,
text: true,
time: true,
url: true,
week: true,
textarea: true,
select: true,
}
: maskAllInputs === false
? {}
: maskAllInputs;
var slimDOMOptions = slimDOM === true || slimDOM === 'all'
?
{
script: true,
comment: true,
headFavicon: true,
headWhitespace: true,
headMetaDescKeywords: slimDOM === 'all',
headMetaSocial: true,
headMetaRobots: true,
headMetaHttpEquiv: true,
headMetaAuthorship: true,
headMetaVerification: true,
}
: slimDOM === false
? {}
: slimDOM;
return [
serializeNodeWithId(n, {
doc: n,
map: idNodeMap,
blockClass: blockClass,
blockSelector: blockSelector,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
skipChild: false,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
maskTextFn: maskTextFn,
slimDOMOptions: slimDOMOptions,
recordCanvas: recordCanvas,
preserveWhiteSpace: preserveWhiteSpace,
onSerialize: onSerialize,
onIframeLoad: onIframeLoad,
iframeLoadTimeout: iframeLoadTimeout,
}),
idNodeMap,
];
}
var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
function parse(css, options) {
if (options === void 0) { options = {}; }
var lineno = 1;
var column = 1;
function updatePosition(str) {
var lines = str.match(/\n/g);
if (lines) {
lineno += lines.length;
}
var i = str.lastIndexOf('\n');
column = i === -1 ? column + str.length : str.length - i;
}
function position() {
var start = { line: lineno, column: column };
return function (node) {
node.position = new Position(start);
whitespace();
return node;
};
}
var Position = (function () {
function Position(start) {
this.start = start;
this.end = { line: lineno, column: column };
this.source = options.source;
}
return Position;
}());
Position.prototype.content = css;
var errorsList = [];
function error(msg) {
var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
err.reason = msg;
err.filename = options.source;
err.line = lineno;
err.column = column;
err.source = css;
if (options.silent) {
errorsList.push(err);
}
else {
throw err;
}
}
function stylesheet() {
var rulesList = rules();
return {
type: 'stylesheet',
stylesheet: {
source: options.source,
rules: rulesList,
parsingErrors: errorsList,
},
};
}
function open() {
return match(/^{\s*/);
}
function close() {
return match(/^}/);
}
function rules() {
var node;
var rules = [];
whitespace();
comments(rules);
while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {
if (node !== false) {
rules.push(node);
comments(rules);
}
}
return rules;
}
function match(re) {
var m = re.exec(css);
if (!m) {
return;
}
var str = m[0];
updatePosition(str);
css = css.slice(str.length);
return m;
}
function whitespace() {
match(/^\s*/);
}
function comments(rules) {
if (rules === void 0) { rules = []; }
var c;
while ((c = comment())) {
if (c !== false) {
rules.push(c);
}
c = comment();
}
return rules;
}
function comment() {
var pos = position();
if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {
return;
}
var i = 2;
while ('' !== css.charAt(i) &&
('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {
++i;
}
i += 2;
if ('' === css.charAt(i - 1)) {
return error('End of comment missing');
}
var str = css.slice(2, i - 2);
column += 2;
updatePosition(str);
css = css.slice(i);
column += 2;
return pos({
type: 'comment',
comment: str,
});
}
function selector() {
var m = match(/^([^{]+)/);
if (!m) {
return;
}
return trim(m[0])
.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
.replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) {
return m.replace(/,/g, '\u200C');
})
.split(/\s*(?![^(]*\)),\s*/)
.map(function (s) {
return s.replace(/\u200C/g, ',');
});
}
function declaration() {
var pos = position();
var propMatch = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
if (!propMatch) {
return;
}
var prop = trim(propMatch[0]);
if (!match(/^:\s*/)) {
return error("property missing ':'");
}
var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
var ret = pos({
type: 'declaration',
property: prop.replace(commentre, ''),
value: val ? trim(val[0]).replace(commentre, '') : '',
});
match(/^[;\s]*/);
return ret;
}
function declarations() {
var decls = [];
if (!open()) {
return error("missing '{'");
}
comments(decls);
var decl;
while ((decl = declaration())) {
if (decl !== false) {
decls.push(decl);
comments(decls);
}
decl = declaration();
}
if (!close()) {
return error("missing '}'");
}
return decls;
}
function keyframe() {
var m;
var vals = [];
var pos = position();
while ((m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/))) {
vals.push(m[1]);
match(/^,\s*/);
}
if (!vals.length) {
return;
}
return pos({
type: 'keyframe',
values: vals,
declarations: declarations(),
});
}
function atkeyframes() {
var pos = position();
var m = match(/^@([-\w]+)?keyframes\s*/);
if (!m) {
return;
}
var vendor = m[1];
m = match(/^([-\w]+)\s*/);
if (!m) {
return error('@keyframes missing name');
}
var name = m[1];
if (!open()) {
return error("@keyframes missing '{'");
}
var frame;
var frames = comments();
while ((frame = keyframe())) {
frames.push(frame);
frames = frames.concat(comments());
}
if (!close()) {
return error("@keyframes missing '}'");
}
return pos({
type: 'keyframes',
name: name,
vendor: vendor,
keyframes: frames,
});
}
function atsupports() {
var pos = position();
var m = match(/^@supports *([^{]+)/);
if (!m) {
return;
}
var supports = trim(m[1]);
if (!open()) {
return error("@supports missing '{'");
}
var style = comments().concat(rules());
if (!close()) {
return error("@supports missing '}'");
}
return pos({
type: 'supports',
supports: supports,
rules: style,
});
}
function athost() {
var pos = position();
var m = match(/^@host\s*/);
if (!m) {
return;
}
if (!open()) {
return error("@host missing '{'");
}
var style = comments().concat(rules());
if (!close()) {
return error("@host missing '}'");
}
return pos({
type: 'host',
rules: style,
});
}
function atmedia() {
var pos = position();
var m = match(/^@media *([^{]+)/);
if (!m) {
return;
}
var media = trim(m[1]);
if (!open()) {
return error("@media missing '{'");
}
var style = comments().concat(rules());
if (!close()) {
return error("@media missing '}'");
}
return pos({
type: 'media',
media: media,
rules: style,
});
}
function atcustommedia() {
var pos = position();
var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
if (!m) {
return;
}
return pos({
type: 'custom-media',
name: trim(m[1]),
media: trim(m[2]),
});
}
function atpage() {
var pos = position();
var m = match(/^@page */);
if (!m) {
return;
}
var sel = selector() || [];
if (!open()) {
return error("@page missing '{'");
}
var decls = comments();
var decl;
while ((decl = declaration())) {
decls.push(decl);
decls = decls.concat(comments());
}
if (!close()) {
return error("@page missing '}'");
}
return pos({
type: 'page',
selectors: sel,
declarations: decls,
});
}
function atdocument() {
var pos = position();
var m = match(/^@([-\w]+)?document *([^{]+)/);
if (!m) {
return;
}
var vendor = trim(m[1]);
var doc = trim(m[2]);
if (!open()) {
return error("@document missing '{'");
}
var style = comments().concat(rules());
if (!close()) {
return error("@document missing '}'");
}
return pos({
type: 'document',
document: doc,
vendor: vendor,
rules: style,
});
}
function atfontface() {
var pos = position();
var m = match(/^@font-face\s*/);
if (!m) {
return;
}
if (!open()) {
return error("@font-face missing '{'");
}
var decls = comments();
var decl;
while ((decl = declaration())) {
decls.push(decl);
decls = decls.concat(comments());
}
if (!close()) {
return error("@font-face missing '}'");
}
return pos({
type: 'font-face',
declarations: decls,
});
}
var atimport = _compileAtrule('import');
var atcharset = _compileAtrule('charset');
var atnamespace = _compileAtrule('namespace');
function _compileAtrule(name) {
var re = new RegExp('^@' + name + '\\s*([^;]+);');
return function () {
var pos = position();
var m = match(re);
if (!m) {
return;
}
var ret = { type: name };
ret[name] = m[1].trim();
return pos(ret);
};
}
function atrule() {
if (css[0] !== '@') {
return;
}
return (atkeyframes() ||
atmedia() ||
atcustommedia() ||
atsupports() ||
atimport() ||
atcharset() ||
atnamespace() ||
atdocument() ||
atpage() ||
athost() ||
atfontface());
}
function rule() {
var pos = position();
var sel = selector();
if (!sel) {
return error('selector missing');
}
comments();
return pos({
type: 'rule',
selectors: sel,
declarations: declarations(),
});
}
return addParent(stylesheet());
}
function trim(str) {
return str ? str.replace(/^\s+|\s+$/g, '') : '';
}
function addParent(obj, parent) {
var isNode = obj && typeof obj.type === 'string';
var childParent = isNode ? obj : parent;
for (var _i = 0, _a = Object.keys(obj); _i < _a.length; _i++) {
var k = _a[_i];
var value = obj[k];
if (Array.isArray(value)) {
value.forEach(function (v) {
addParent(v, childParent);
});
}
else if (value && typeof value === 'object') {
addParent(value, childParent);
}
}
if (isNode) {
Object.defineProperty(obj, 'parent', {
configurable: true,
writable: true,
enumerable: false,
value: parent || null,
});
}
return obj;
}
var tagMap = {
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 getTagName(n) {
var tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;
if (tagName === 'link' && n.attributes._cssText) {
tagName = 'style';
}
return tagName;
}
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
var HOVER_SELECTOR = /([^\\]):hover/;
var HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR, 'g');
function addHoverClass(cssText) {
var ast = parse(cssText, {
silent: true,
});
if (!ast.stylesheet) {
return cssText;
}
var selectors = [];
ast.stylesheet.rules.forEach(function (rule) {
if ('selectors' in rule) {
(rule.selectors || []).forEach(function (selector) {
if (HOVER_SELECTOR.test(selector)) {
selectors.push(selector);
}
});
}
});
if (selectors.length === 0)
return cssText;
var selectorMatcher = new RegExp(selectors
.filter(function (selector, index) { return selectors.indexOf(selector) === index; })
.sort(function (a, b) { return b.length - a.length; })
.map(function (selector) {
return escapeRegExp(selector);
})
.join('|'), 'g');
return cssText.replace(selectorMatcher, function (selector) {
var newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\:hover');
return selector + ", " + newSelector;
});
}
function buildNode(n, options) {
var doc = options.doc, hackCss = options.hackCss;
switch (n.type) {
case NodeType.Document:
return doc.implementation.createDocument(null, '', null);
case NodeType.DocumentType:
return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);
case NodeType.Element:
var tagName = getTagName(n);
var node_1;
if (n.isSVG) {
node_1 = doc.createElementNS('http://www.w3.org/2000/svg', tagName);
}
else {
node_1 = doc.createElement(tagName);
}
var _loop_1 = function (name) {
if (!n.attributes.hasOwnProperty(name)) {
return "continue";
}
var value = n.attributes[name];
value =
typeof value === 'boolean' || typeof value === 'number' ? '' : value;
if (!name.startsWith('rr_')) {
var isTextarea = tagName === 'textarea' && name === 'value';
var isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';
if (isRemoteOrDynamicCss && hackCss) {
value = addHoverClass(value);
}
if (isTextarea || isRemoteOrDynamicCss) {
var child = doc.createTextNode(value);
for (var _i = 0, _a = Array.from(node_1.childNodes); _i < _a.length; _i++) {
var c = _a[_i];
if (c.nodeType === node_1.TEXT_NODE) {
node_1.removeChild(c);
}
}
node_1.appendChild(child);
return "continue";
}
if (tagName === 'iframe' && name === 'src') {
return "continue";
}
try {
if (n.isSVG && name === 'xlink:href') {
node_1.setAttributeNS('http://www.w3.org/1999/xlink', name, value);
}
else if (name === 'onload' ||
name === 'onclick' ||
name.substring(0, 7) === 'onmouse') {
node_1.setAttribute('_' + name, value);
}
else {
node_1.setAttribute(name, value);
}
}
catch (error) {
}
}
else {
if (tagName === 'canvas' && name === 'rr_dataURL') {
var image_1 = document.createElement('img');
image_1.src = value;
image_1.onload = function () {
var ctx = node_1.getContext('2d');
if (ctx) {
ctx.drawImage(image_1, 0, 0, image_1.width, image_1.height);
}
};
}
if (name === 'rr_width') {
node_1.style.width = value;
}
if (name === 'rr_height') {
node_1.style.height = value;
}
if (name === 'rr_mediaState') {
switch (value) {
case 'played':
node_1.play();
case 'paused':
node_1.pause();
break;
}
}
}
};
for (var name in n.attributes) {
_loop_1(name);
}
if (n.isShadowHost) {
if (!node_1.shadowRoot) {
node_1.attachShadow({ mode: 'open' });
}
else {
while (node_1.shadowRoot.firstChild) {
node_1.shadowRoot.removeChild(node_1.shadowRoot.firstChild);
}
}
}
return node_1;
case NodeType.Text:
return doc.createTextNode(n.isStyle && hackCss ? addHoverClass(n.textContent) : n.textContent);
case NodeType.CDATA:
return doc.createCDATASection(n.textContent);
case NodeType.Comment:
return doc.createComment(n.textContent);
default:
return null;
}
}
function buildNodeWithSN(n, options) {
var doc = options.doc, map = options.map, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.hackCss, hackCss = _b === void 0 ? true : _b, afterAppend = options.afterAppend;
var node = buildNode(n, { doc: doc, hackCss: hackCss });
if (!node) {
return null;
}
if (n.rootId) {
console.assert(map[n.rootId] === doc, 'Target document should has the same root id.');
}
if (n.type === NodeType.Document) {
doc.close();
doc.open();
node = doc;
}
node.__sn = n;
map[n.id] = node;
if ((n.type === NodeType.Document || n.type === NodeType.Element) &&
!skipChild) {
for (var _i = 0, _c = n.childNodes; _i < _c.length; _i++) {
var childN = _c[_i];
var childNode = buildNodeWithSN(childN, {
doc: doc,
map: map,
skipChild: false,
hackCss: hackCss,
afterAppend: afterAppend,
});
if (!childNode) {
console.warn('Failed to rebuild', childN);
continue;
}
if (childN.isShadow && isElement(node) && node.shadowRoot) {
node.shadowRoot.appendChild(childNode);
}
else {
node.appendChild(childNode);
}
if (afterAppend) {
afterAppend(childNode);
}
}
}
return node;
}
function visit(idNodeMap, onVisit) {
function walk(node) {
onVisit(node);
}
for (var key in idNodeMap) {
if (idNodeMap[key]) {
walk(idNodeMap[key]);
}
}
}
function handleScroll(node) {
var n = node.__sn;
if (n.type !== NodeType.Element) {
return;
}
var el = node;
for (var name in n.attributes) {
if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {
continue;
}
var value = n.attributes[name];
if (name === 'rr_scrollLeft') {
el.scrollLeft = value;
}
if (name === 'rr_scrollTop') {
el.scrollTop = value;
}
}
}
function rebuild(n, options) {
var doc = options.doc, onVisit = options.onVisit, _a = options.hackCss, hackCss = _a === void 0 ? true : _a, afterAppend = options.afterAppend;
var idNodeMap = {};
var node = buildNodeWithSN(n, {
doc: doc,
map: idNodeMap,
skipChild: false,
hackCss: hackCss,
afterAppend: afterAppend,
});
visit(idNodeMap, function (visitedNode) {
if (onVisit) {
onVisit(visitedNode);
}
handleScroll(visitedNode);
});
return [node, idNodeMap];
}
export { IGNORED_NODE, NodeType, addHoverClass, buildNodeWithSN, isElement, isShadowRoot, needMaskingText, rebuild, serializeNodeWithId, snapshot, transformAttribute };
export { NodeType };

@@ -16,13 +16,2 @@ /*! *****************************************************************************

var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __values(o) {

@@ -63,2 +52,2 @@ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;

export { __assign, __read, __spread, __values };
export { __read, __spread, __values };

@@ -10,1 +10,3 @@ export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents } from '../types.js';

export { unpack } from '../packer/unpack.js';
export { PLUGIN_NAME, getRecordConsolePlugin } from '../plugins/console/record/index.js';
export { getLogReplayPlugin } from '../plugins/console/replay/index.js';

@@ -17,3 +17,3 @@ import { __assign, __read } from '../../ext/tslib/tslib.es6.js';

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.blockSelector, blockSelector = _b === void 0 ? null : _b, _c = options.ignoreClass, ignoreClass = _c === void 0 ? 'rr-ignore' : _c, _d = options.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = options.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = options.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, maskAllInputs = options.maskAllInputs, _maskInputOptions = options.maskInputOptions, _slimDOMOptions = options.slimDOMOptions, maskInputFn = options.maskInputFn, maskTextFn = options.maskTextFn, hooks = options.hooks, packFn = options.packFn, _g = options.sampling, sampling = _g === void 0 ? {} : _g, mousemoveWait = options.mousemoveWait, _h = options.recordCanvas, recordCanvas = _h === void 0 ? false : _h, _j = options.collectFonts, collectFonts = _j === void 0 ? false : _j, _k = options.recordLog, recordLog = _k === void 0 ? false : _k;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.blockSelector, blockSelector = _b === void 0 ? null : _b, _c = options.ignoreClass, ignoreClass = _c === void 0 ? 'rr-ignore' : _c, _d = options.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = options.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = options.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, maskAllInputs = options.maskAllInputs, _maskInputOptions = options.maskInputOptions, _slimDOMOptions = options.slimDOMOptions, maskInputFn = options.maskInputFn, maskTextFn = options.maskTextFn, hooks = options.hooks, packFn = options.packFn, _g = options.sampling, sampling = _g === void 0 ? {} : _g, mousemoveWait = options.mousemoveWait, _h = options.recordCanvas, recordCanvas = _h === void 0 ? false : _h, _j = options.collectFonts, collectFonts = _j === void 0 ? false : _j, plugins = options.plugins, _k = options.keepIframeSrcFn, keepIframeSrcFn = _k === void 0 ? function () { return false; } : _k;
if (!emit) {

@@ -42,6 +42,7 @@ throw new Error('emit function is required');

select: true,
password: true,
}
: _maskInputOptions !== undefined
? _maskInputOptions
: {};
: { password: true };
var slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'

@@ -63,32 +64,2 @@ ? {

: {};
var defaultLogOptions = {
level: [
'assert',
'clear',
'count',
'countReset',
'debug',
'dir',
'dirxml',
'error',
'group',
'groupCollapsed',
'groupEnd',
'info',
'log',
'table',
'time',
'timeEnd',
'timeLog',
'trace',
'warn',
],
lengthThreshold: 1000,
logger: console,
};
var logOptions = recordLog
? recordLog === true
? defaultLogOptions
: Object.assign({}, defaultLogOptions, recordLog)
: {};
polyfill();

@@ -150,2 +121,3 @@ var lastFullSnapshotEvent;

maskTextFn: maskTextFn,
maskInputFn: maskInputFn,
recordCanvas: recordCanvas,

@@ -191,2 +163,3 @@ sampling: sampling,

},
keepIframeSrcFn: keepIframeSrcFn,
}), 2), node = _e[0], idNodeMap = _e[1];

@@ -278,8 +251,2 @@ if (!node) {

},
logCb: function (p) {
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,
data: __assign({ source: IncrementalSource.Log }, p),
}));
},
blockClass: blockClass,

@@ -297,3 +264,2 @@ ignoreClass: ignoreClass,

maskTextFn: maskTextFn,
logOptions: logOptions,
blockSelector: blockSelector,

@@ -304,2 +270,15 @@ slimDOMOptions: slimDOMOptions,

shadowDomManager: shadowDomManager,
plugins: (plugins === null || plugins === void 0 ? void 0 : plugins.map(function (p) { return ({
observer: p.observer,
options: p.options,
callback: function (payload) {
return wrappedEmit(wrapEvent({
type: EventType.Plugin,
data: {
plugin: p.name,
payload: payload,
},
}));
},
}); })) || [],
}, hooks);

@@ -306,0 +285,0 @@ };

import { __values } from '../../ext/tslib/tslib.es6.js';
import { isShadowRoot, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { isShadowRoot, maskInputValue, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { isIgnored, isBlocked, isAncestorRemoved, isIframeINode, hasShadowRoot } from '../utils.js';

@@ -149,2 +149,3 @@

maskTextFn: _this.maskTextFn,
maskInputFn: _this.maskInputFn,
slimDOMOptions: _this.slimDOMOptions,

@@ -297,2 +298,11 @@ recordCanvas: _this.recordCanvas,

var value = m.target.getAttribute(m.attributeName);
if (m.attributeName === 'value') {
value = maskInputValue({
maskInputOptions: _this.maskInputOptions,
tagName: m.target.tagName,
type: m.target.getAttribute('type'),
value: value,
maskInputFn: _this.maskInputFn,
});
}
if (isBlocked(m.target, _this.blockClass) || value === m.oldValue) {

@@ -374,3 +384,3 @@ return;

}
MutationBuffer.prototype.init = function (cb, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, recordCanvas, slimDOMOptions, doc, mirror, iframeManager, shadowDomManager) {
MutationBuffer.prototype.init = function (cb, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, maskInputFn, recordCanvas, slimDOMOptions, doc, mirror, iframeManager, shadowDomManager) {
this.blockClass = blockClass;

@@ -383,2 +393,3 @@ this.blockSelector = blockSelector;

this.maskTextFn = maskTextFn;
this.maskInputFn = maskInputFn;
this.recordCanvas = recordCanvas;

@@ -385,0 +396,0 @@ this.slimDOMOptions = slimDOMOptions;

@@ -1,7 +0,6 @@

import { __spread, __values, __assign } from '../../ext/tslib/tslib.es6.js';
import { __values, __spread, __assign } from '../../ext/tslib/tslib.es6.js';
import { maskInputValue } from '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { IncrementalSource, MouseInteractions, MediaInteractions } from '../types.js';
import { on, throttle, isTouchEvent, isBlocked, getWindowHeight, getWindowWidth, hookSetter, patch } from '../utils.js';
import MutationBuffer from './mutation.js';
import { stringify } from './stringify.js';
import { ErrorStackParser } from './error-stack-parser.js';

@@ -27,7 +26,7 @@ var mutationBuffers = [];

}
function initMutationObserver(cb, doc, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, recordCanvas, slimDOMOptions, mirror, iframeManager, shadowDomManager, rootEl) {
function initMutationObserver(cb, doc, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, maskInputFn, recordCanvas, slimDOMOptions, mirror, iframeManager, shadowDomManager, rootEl) {
var _a, _b, _c;
var mutationBuffer = new MutationBuffer();
mutationBuffers.push(mutationBuffer);
mutationBuffer.init(cb, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, recordCanvas, slimDOMOptions, doc, mirror, iframeManager, shadowDomManager);
mutationBuffer.init(cb, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, maskInputFn, recordCanvas, slimDOMOptions, doc, mirror, iframeManager, shadowDomManager);
var mutationObserverCtor = window.MutationObserver ||

@@ -199,4 +198,3 @@ window.__rrMutationObserver;

var type = target.type;
if (type === 'password' ||
target.classList.contains(ignoreClass)) {
if (target.classList.contains(ignoreClass)) {
return;

@@ -211,8 +209,9 @@ }

maskInputOptions[type]) {
if (maskInputFn) {
text = maskInputFn(text);
}
else {
text = '*'.repeat(text.length);
}
text = maskInputValue({
maskInputOptions: maskInputOptions,
tagName: target.tagName,
type: type,
value: text,
maskInputFn: maskInputFn,
});
}

@@ -302,7 +301,12 @@ cbWithDedup(target, { text: text, isChecked: isChecked });

mediaInteractionCb({
type: type === 'play' ? MediaInteractions.Play : MediaInteractions.Pause,
type: type,
id: mirror.getId(target),
currentTime: target.currentTime,
});
}; };
var handlers = [on('play', handler('play')), on('pause', handler('pause'))];
var handlers = [
on('play', handler(MediaInteractions.Play)),
on('pause', handler(MediaInteractions.Pause)),
on('seeked', handler(MediaInteractions.Seeked)),
];
return function () {

@@ -421,93 +425,4 @@ handlers.forEach(function (h) { return h(); });

}
function initLogObserver(cb, logOptions) {
var e_2, _a;
var _this = this;
var logger = logOptions.logger;
if (!logger) {
return function () { };
}
var logCount = 0;
var cancelHandlers = [];
if (logOptions.level.includes('error')) {
if (window) {
var originalOnError_1 = window.onerror;
window.onerror = function (msg, file, line, col, error) {
if (originalOnError_1) {
originalOnError_1.apply(_this, [msg, file, line, col, error]);
}
var trace = ErrorStackParser.parse(error).map(function (stackFrame) { return stackFrame.toString(); });
var payload = [stringify(msg, logOptions.stringifyOptions)];
cb({
level: 'error',
trace: trace,
payload: payload,
});
};
cancelHandlers.push(function () {
window.onerror = originalOnError_1;
});
}
}
try {
for (var _b = __values(logOptions.level), _c = _b.next(); !_c.done; _c = _b.next()) {
var levelType = _c.value;
cancelHandlers.push(replace(logger, levelType));
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return function () {
cancelHandlers.forEach(function (h) { return h(); });
};
function replace(_logger, level) {
var _this = this;
if (!_logger[level]) {
return function () { };
}
return patch(_logger, level, function (original) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
original.apply(_this, args);
try {
var trace = ErrorStackParser.parse(new Error())
.map(function (stackFrame) { return stackFrame.toString(); })
.splice(1);
var payload = args.map(function (s) {
return stringify(s, logOptions.stringifyOptions);
});
logCount++;
if (logCount < logOptions.lengthThreshold) {
cb({
level: level,
trace: trace,
payload: payload,
});
}
else if (logCount === logOptions.lengthThreshold) {
cb({
level: 'warn',
trace: [],
payload: [
stringify('The number of log records reached the threshold.'),
],
});
}
}
catch (error) {
original.apply(void 0, __spread(['rrweb logger error:', error], args));
}
};
});
}
}
function mergeHooks(o, hooks) {
var mutationCb = o.mutationCb, mousemoveCb = o.mousemoveCb, mouseInteractionCb = o.mouseInteractionCb, scrollCb = o.scrollCb, viewportResizeCb = o.viewportResizeCb, inputCb = o.inputCb, mediaInteractionCb = o.mediaInteractionCb, styleSheetRuleCb = o.styleSheetRuleCb, canvasMutationCb = o.canvasMutationCb, fontCb = o.fontCb, logCb = o.logCb;
var mutationCb = o.mutationCb, mousemoveCb = o.mousemoveCb, mouseInteractionCb = o.mouseInteractionCb, scrollCb = o.scrollCb, viewportResizeCb = o.viewportResizeCb, inputCb = o.inputCb, mediaInteractionCb = o.mediaInteractionCb, styleSheetRuleCb = o.styleSheetRuleCb, canvasMutationCb = o.canvasMutationCb, fontCb = o.fontCb;
o.mutationCb = function () {

@@ -613,17 +528,8 @@ var p = [];

};
o.logCb = function () {
var p = [];
for (var _i = 0; _i < arguments.length; _i++) {
p[_i] = arguments[_i];
}
if (hooks.log) {
hooks.log.apply(hooks, __spread(p));
}
logCb.apply(void 0, __spread(p));
};
}
function initObservers(o, hooks) {
var e_2, _a;
if (hooks === void 0) { hooks = {}; }
mergeHooks(o, hooks);
var mutationObserver = initMutationObserver(o.mutationCb, o.doc, o.blockClass, o.blockSelector, o.maskTextClass, o.maskTextSelector, o.inlineStylesheet, o.maskInputOptions, o.maskTextFn, o.recordCanvas, o.slimDOMOptions, o.mirror, o.iframeManager, o.shadowDomManager, o.doc);
var mutationObserver = initMutationObserver(o.mutationCb, o.doc, o.blockClass, o.blockSelector, o.maskTextClass, o.maskTextSelector, o.inlineStylesheet, o.maskInputOptions, o.maskTextFn, o.maskInputFn, o.recordCanvas, o.slimDOMOptions, o.mirror, o.iframeManager, o.shadowDomManager, o.doc);
var mousemoveHandler = initMoveObserver(o.mousemoveCb, o.sampling, o.doc, o.mirror);

@@ -640,5 +546,16 @@ var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.doc, o.mirror, o.blockClass, o.sampling);

var fontObserver = o.collectFonts ? initFontObserver(o.fontCb) : function () { };
var logObserver = o.logOptions
? initLogObserver(o.logCb, o.logOptions)
: function () { };
var pluginHandlers = [];
try {
for (var _b = __values(o.plugins), _c = _b.next(); !_c.done; _c = _b.next()) {
var plugin = _c.value;
pluginHandlers.push(plugin.observer(plugin.callback, plugin.options));
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return function () {

@@ -655,3 +572,3 @@ mutationObserver.disconnect();

fontObserver();
logObserver();
pluginHandlers.forEach(function (h) { return h(); });
};

@@ -658,0 +575,0 @@ }

@@ -11,3 +11,3 @@ import { initMutationObserver, initScrollObserver } from './observer.js';

ShadowDomManager.prototype.addShadowRoot = function (shadowRoot, doc) {
initMutationObserver(this.mutationCb, doc, this.bypassOptions.blockClass, this.bypassOptions.blockSelector, this.bypassOptions.maskTextClass, this.bypassOptions.maskTextSelector, this.bypassOptions.inlineStylesheet, this.bypassOptions.maskInputOptions, this.bypassOptions.maskTextFn, this.bypassOptions.recordCanvas, this.bypassOptions.slimDOMOptions, this.mirror, this.bypassOptions.iframeManager, this, shadowRoot);
initMutationObserver(this.mutationCb, doc, this.bypassOptions.blockClass, this.bypassOptions.blockSelector, this.bypassOptions.maskTextClass, this.bypassOptions.maskTextSelector, this.bypassOptions.inlineStylesheet, this.bypassOptions.maskInputOptions, this.bypassOptions.maskTextFn, this.bypassOptions.maskInputFn, this.bypassOptions.recordCanvas, this.bypassOptions.slimDOMOptions, this.mirror, this.bypassOptions.iframeManager, this, shadowRoot);
initScrollObserver(this.scrollCb, shadowRoot, this.mirror, this.bypassOptions.blockClass, this.bypassOptions.sampling);

@@ -14,0 +14,0 @@ };

@@ -16,3 +16,2 @@ import { __values, __assign, __spread } from '../../ext/tslib/tslib.es6.js';

var REPLAY_CONSOLE_PREFIX = '[replayer]';
var ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
var defaultMouseTailConfig = {

@@ -24,26 +23,2 @@ duration: 500,

};
var defaultLogConfig = {
level: [
'assert',
'clear',
'count',
'countReset',
'debug',
'dir',
'dirxml',
'error',
'group',
'groupCollapsed',
'groupEnd',
'info',
'log',
'table',
'time',
'timeEnd',
'timeLog',
'trace',
'warn',
],
replayLogger: undefined,
};
var Replayer = (function () {

@@ -78,8 +53,4 @@ function Replayer(events, config) {

mouseTail: defaultMouseTailConfig,
logConfig: defaultLogConfig,
};
this.config = Object.assign({}, defaultConfig, config);
if (!this.config.logConfig.replayLogger) {
this.config.logConfig.replayLogger = this.getConsoleLogger();
}
this.handleResize = this.handleResize.bind(this);

@@ -432,9 +403,27 @@ this.getCastFn = this.getCastFn.bind(this);

var wrappedCastFn = function () {
var e_5, _a;
if (castFn) {
castFn();
}
try {
for (var _b = __values(_this.config.plugins || []), _c = _b.next(); !_c.done; _c = _b.next()) {
var plugin = _c.value;
plugin.handler(event, isSync, { replayer: _this });
}
}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_5) throw e_5.error; }
}
_this.service.send({ type: 'CAST_EVENT', payload: { event: event } });
var last_index = _this.service.state.context.events.length - 1;
if (event ===
_this.service.state.context.events[_this.service.state.context.events.length - 1]) {
_this.service.state.context.events[last_index]) {
var finish_1 = function () {
if (last_index < _this.service.state.context.events.length - 1) {
return;
}
_this.backToNormal();

@@ -459,3 +448,3 @@ _this.service.send('END');

Replayer.prototype.rebuildFullSnapshot = function (event, isSync) {
var e_5, _a;
var e_6, _a;
var _this = this;

@@ -492,3 +481,3 @@ if (isSync === void 0) { isSync = false; }

}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
catch (e_6_1) { e_6 = { error: e_6_1 }; }
finally {

@@ -498,3 +487,3 @@ try {

}
finally { if (e_5) throw e_5.error; }
finally { if (e_6) throw e_6.error; }
}

@@ -528,3 +517,3 @@ var _c = this.iframe.contentDocument, documentElement = _c.documentElement, head = _c.head;

Replayer.prototype.attachDocumentToIframe = function (mutation, iframeEl) {
var e_6, _a;
var e_7, _a;
var _this = this;

@@ -568,3 +557,3 @@ var collected = [];

}
catch (e_6_1) { e_6 = { error: e_6_1 }; }
catch (e_7_1) { e_7 = { error: e_7_1 }; }
finally {

@@ -574,3 +563,3 @@ try {

}
finally { if (e_6) throw e_6.error; }
finally { if (e_7) throw e_7.error; }
}

@@ -637,3 +626,3 @@ };

Replayer.prototype.preloadAllImages = function () {
var e_7, _a;
var e_8, _a;
var _this = this;

@@ -666,3 +655,3 @@ var beforeLoadState = this.service.state;

}
catch (e_7_1) { e_7 = { error: e_7_1 }; }
catch (e_8_1) { e_8 = { error: e_8_1 }; }
finally {

@@ -672,3 +661,3 @@ try {

}
finally { if (e_7) throw e_7.error; }
finally { if (e_8) throw e_8.error; }
}

@@ -794,16 +783,12 @@ if (count !== resolved) {

}
var mediaEl_1 = target;
var mediaEl = target;
try {
if (d.currentTime) {
mediaEl.currentTime = d.currentTime;
}
if (d.type === MediaInteractions.Pause) {
mediaEl_1.pause();
mediaEl.pause();
}
if (d.type === MediaInteractions.Play) {
if (mediaEl_1.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA) {
mediaEl_1.play();
}
else {
mediaEl_1.addEventListener('canplay', function () {
mediaEl_1.play();
});
}
mediaEl.play();
}

@@ -907,20 +892,6 @@ }

}
case IncrementalSource.Log: {
try {
var logData_1 = e.data;
var replayLogger = this.config.logConfig.replayLogger;
if (typeof replayLogger[logData_1.level] === 'function') {
replayLogger[logData_1.level](logData_1);
}
}
catch (error) {
if (this.config.showWarning) {
console.warn(error);
}
}
}
}
};
Replayer.prototype.applyMutation = function (d, useVirtualParent) {
var e_8, _a;
var e_9, _a;
var _this = this;

@@ -1083,3 +1054,3 @@ d.removes.forEach(function (mutation) {

try {
for (var resolveTrees_1 = (e_8 = void 0, __values(resolveTrees)), resolveTrees_1_1 = resolveTrees_1.next(); !resolveTrees_1_1.done; resolveTrees_1_1 = resolveTrees_1.next()) {
for (var resolveTrees_1 = (e_9 = void 0, __values(resolveTrees)), resolveTrees_1_1 = resolveTrees_1.next(); !resolveTrees_1_1.done; resolveTrees_1_1 = resolveTrees_1.next()) {
var tree = resolveTrees_1_1.value;

@@ -1097,3 +1068,3 @@ var parent = this.mirror.getNode(tree.value.parentId);

}
catch (e_8_1) { e_8 = { error: e_8_1 }; }
catch (e_9_1) { e_9 = { error: e_9_1 }; }
finally {

@@ -1103,3 +1074,3 @@ try {

}
finally { if (e_8) throw e_8.error; }
finally { if (e_9) throw e_9.error; }
}

@@ -1181,48 +1152,2 @@ }

};
Replayer.prototype.formatMessage = function (data) {
if (data.trace.length === 0) {
return '';
}
var stackPrefix = '\n\tat ';
var result = stackPrefix;
result += data.trace.join(stackPrefix);
return result;
};
Replayer.prototype.getConsoleLogger = function () {
var e_9, _a;
var _this = this;
var replayLogger = {};
var _loop_3 = function (level) {
if (level === 'trace') {
replayLogger[level] = function (data) {
var logger = console.log[ORIGINAL_ATTRIBUTE_NAME]
? console.log[ORIGINAL_ATTRIBUTE_NAME]
: console.log;
logger.apply(void 0, __spread(data.payload.map(function (s) { return JSON.parse(s); }), [_this.formatMessage(data)]));
};
}
else {
replayLogger[level] = function (data) {
var logger = console[level][ORIGINAL_ATTRIBUTE_NAME]
? console[level][ORIGINAL_ATTRIBUTE_NAME]
: console[level];
logger.apply(void 0, __spread(data.payload.map(function (s) { return JSON.parse(s); }), [_this.formatMessage(data)]));
};
}
};
try {
for (var _b = __values(this.config.logConfig.level), _c = _b.next(); !_c.done; _c = _b.next()) {
var level = _c.value;
_loop_3(level);
}
}
catch (e_9_1) { e_9 = { error: e_9_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_9) throw e_9.error; }
}
return replayLogger;
};
Replayer.prototype.legacy_resolveMissingNode = function (map, parent, target, targetMutation) {

@@ -1229,0 +1154,0 @@ var previousId = targetMutation.previousId, nextId = targetMutation.nextId;

@@ -9,2 +9,3 @@ var EventType;

EventType[EventType["Custom"] = 5] = "Custom";
EventType[EventType["Plugin"] = 6] = "Plugin";
})(EventType || (EventType = {}));

@@ -44,2 +45,3 @@ var IncrementalSource;

MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
})(MediaInteractions || (MediaInteractions = {}));

@@ -46,0 +48,0 @@ var ReplayerEvents;

@@ -1,41 +0,4 @@

import { __values } from '../ext/tslib/tslib.es6.js';
import { IGNORED_NODE, isShadowRoot, NodeType } from '../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { EventType, IncrementalSource } from './types.js';
import './types.js';
import '../ext/rrweb-snapshot/es/rrweb-snapshot.js';
function on(type, fn, target) {
if (target === void 0) { target = document; }
var options = { capture: true, passive: true };
target.addEventListener(type, fn, options);
return function () { return target.removeEventListener(type, fn, options); };
}
function createMirror() {
return {
map: {},
getId: function (n) {
if (!n.__sn) {
return -1;
}
return n.__sn.id;
},
getNode: function (id) {
return this.map[id] || null;
},
removeNodeFromMap: function (n) {
var _this = this;
var id = n.__sn && n.__sn.id;
delete this.map[id];
if (n.childNodes) {
n.childNodes.forEach(function (child) {
return _this.removeNodeFromMap(child);
});
}
},
has: function (id) {
return this.map.hasOwnProperty(id);
},
reset: function () {
this.map = {};
},
};
}
var DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +

@@ -77,440 +40,3 @@ '\r\n' +

}
function throttle(func, wait, options) {
if (options === void 0) { options = {}; }
var timeout = null;
var previous = 0;
return function (arg) {
var now = Date.now();
if (!previous && options.leading === false) {
previous = now;
}
var remaining = wait - (now - previous);
var context = this;
var args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
window.clearTimeout(timeout);
timeout = null;
}
previous = now;
func.apply(context, args);
}
else if (!timeout && options.trailing !== false) {
timeout = window.setTimeout(function () {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
func.apply(context, args);
}, remaining);
}
};
}
function hookSetter(target, key, d, isRevoked, win) {
if (win === void 0) { win = window; }
var original = win.Object.getOwnPropertyDescriptor(target, key);
win.Object.defineProperty(target, key, isRevoked
? d
: {
set: function (value) {
var _this = this;
setTimeout(function () {
d.set.call(_this, value);
}, 0);
if (original && original.set) {
original.set.call(this, value);
}
},
});
return function () { return hookSetter(target, key, original || {}, true); };
}
function patch(source, name, replacement) {
try {
if (!(name in source)) {
return function () { };
}
var original_1 = source[name];
var wrapped = replacement(original_1);
if (typeof wrapped === 'function') {
wrapped.prototype = wrapped.prototype || {};
Object.defineProperties(wrapped, {
__rrweb_original__: {
enumerable: false,
value: original_1,
},
});
}
source[name] = wrapped;
return function () {
source[name] = original_1;
};
}
catch (_a) {
return function () { };
}
}
function getWindowHeight() {
return (window.innerHeight ||
(document.documentElement && document.documentElement.clientHeight) ||
(document.body && document.body.clientHeight));
}
function getWindowWidth() {
return (window.innerWidth ||
(document.documentElement && document.documentElement.clientWidth) ||
(document.body && document.body.clientWidth));
}
function isBlocked(node, blockClass) {
if (!node) {
return false;
}
if (node.nodeType === node.ELEMENT_NODE) {
var needBlock_1 = false;
if (typeof blockClass === 'string') {
needBlock_1 = node.classList.contains(blockClass);
}
else {
node.classList.forEach(function (className) {
if (blockClass.test(className)) {
needBlock_1 = true;
}
});
}
return needBlock_1 || isBlocked(node.parentNode, blockClass);
}
if (node.nodeType === node.TEXT_NODE) {
return isBlocked(node.parentNode, blockClass);
}
return isBlocked(node.parentNode, blockClass);
}
function isIgnored(n) {
if ('__sn' in n) {
return n.__sn.id === IGNORED_NODE;
}
return false;
}
function isAncestorRemoved(target, mirror) {
if (isShadowRoot(target)) {
return false;
}
var id = mirror.getId(target);
if (!mirror.has(id)) {
return true;
}
if (target.parentNode &&
target.parentNode.nodeType === target.DOCUMENT_NODE) {
return false;
}
if (!target.parentNode) {
return true;
}
return isAncestorRemoved(target.parentNode, mirror);
}
function isTouchEvent(event) {
return Boolean(event.changedTouches);
}
function polyfill(win) {
if (win === void 0) { win = window; }
if ('NodeList' in win && !win.NodeList.prototype.forEach) {
win.NodeList.prototype.forEach = Array.prototype
.forEach;
}
if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {
win.DOMTokenList.prototype.forEach = Array.prototype
.forEach;
}
if (!Node.prototype.contains) {
Node.prototype.contains = function contains(node) {
if (!(0 in arguments)) {
throw new TypeError('1 argument is required');
}
do {
if (this === node) {
return true;
}
} while ((node = node && node.parentNode));
return false;
};
}
}
function needCastInSyncMode(event) {
switch (event.type) {
case EventType.DomContentLoaded:
case EventType.Load:
case EventType.Custom:
return false;
case EventType.FullSnapshot:
case EventType.Meta:
return true;
}
switch (event.data.source) {
case IncrementalSource.MouseMove:
case IncrementalSource.MouseInteraction:
case IncrementalSource.TouchMove:
case IncrementalSource.MediaInteraction:
return false;
case IncrementalSource.ViewportResize:
case IncrementalSource.StyleSheetRule:
case IncrementalSource.Scroll:
case IncrementalSource.Input:
return true;
}
return true;
}
var TreeIndex = (function () {
function TreeIndex() {
this.reset();
}
TreeIndex.prototype.add = function (mutation) {
var parentTreeNode = this.indexes.get(mutation.parentId);
var treeNode = {
id: mutation.node.id,
mutation: mutation,
children: [],
texts: [],
attributes: [],
};
if (!parentTreeNode) {
this.tree[treeNode.id] = treeNode;
}
else {
treeNode.parent = parentTreeNode;
parentTreeNode.children[treeNode.id] = treeNode;
}
this.indexes.set(treeNode.id, treeNode);
};
TreeIndex.prototype.remove = function (mutation, mirror) {
var _this = this;
var parentTreeNode = this.indexes.get(mutation.parentId);
var treeNode = this.indexes.get(mutation.id);
var deepRemoveFromMirror = function (id) {
_this.removeIdSet.add(id);
var node = mirror.getNode(id);
node === null || node === void 0 ? void 0 : node.childNodes.forEach(function (childNode) {
if ('__sn' in childNode) {
deepRemoveFromMirror(childNode.__sn.id);
}
});
};
var deepRemoveFromTreeIndex = function (node) {
_this.removeIdSet.add(node.id);
Object.values(node.children).forEach(function (n) { return deepRemoveFromTreeIndex(n); });
var _treeNode = _this.indexes.get(node.id);
if (_treeNode) {
var _parentTreeNode = _treeNode.parent;
if (_parentTreeNode) {
delete _treeNode.parent;
delete _parentTreeNode.children[_treeNode.id];
_this.indexes.delete(mutation.id);
}
}
};
if (!treeNode) {
this.removeNodeMutations.push(mutation);
deepRemoveFromMirror(mutation.id);
}
else if (!parentTreeNode) {
delete this.tree[treeNode.id];
this.indexes.delete(treeNode.id);
deepRemoveFromTreeIndex(treeNode);
}
else {
delete treeNode.parent;
delete parentTreeNode.children[treeNode.id];
this.indexes.delete(mutation.id);
deepRemoveFromTreeIndex(treeNode);
}
};
TreeIndex.prototype.text = function (mutation) {
var treeNode = this.indexes.get(mutation.id);
if (treeNode) {
treeNode.texts.push(mutation);
}
else {
this.textMutations.push(mutation);
}
};
TreeIndex.prototype.attribute = function (mutation) {
var treeNode = this.indexes.get(mutation.id);
if (treeNode) {
treeNode.attributes.push(mutation);
}
else {
this.attributeMutations.push(mutation);
}
};
TreeIndex.prototype.scroll = function (d) {
this.scrollMap.set(d.id, d);
};
TreeIndex.prototype.input = function (d) {
this.inputMap.set(d.id, d);
};
TreeIndex.prototype.flush = function () {
var e_1, _a, e_2, _b;
var _this = this;
var _c = this, tree = _c.tree, removeNodeMutations = _c.removeNodeMutations, textMutations = _c.textMutations, attributeMutations = _c.attributeMutations;
var batchMutationData = {
source: IncrementalSource.Mutation,
removes: removeNodeMutations,
texts: textMutations,
attributes: attributeMutations,
adds: [],
};
var walk = function (treeNode, removed) {
if (removed) {
_this.removeIdSet.add(treeNode.id);
}
batchMutationData.texts = batchMutationData.texts
.concat(removed ? [] : treeNode.texts)
.filter(function (m) { return !_this.removeIdSet.has(m.id); });
batchMutationData.attributes = batchMutationData.attributes
.concat(removed ? [] : treeNode.attributes)
.filter(function (m) { return !_this.removeIdSet.has(m.id); });
if (!_this.removeIdSet.has(treeNode.id) &&
!_this.removeIdSet.has(treeNode.mutation.parentId) &&
!removed) {
batchMutationData.adds.push(treeNode.mutation);
if (treeNode.children) {
Object.values(treeNode.children).forEach(function (n) { return walk(n, false); });
}
}
else {
Object.values(treeNode.children).forEach(function (n) { return walk(n, true); });
}
};
Object.values(tree).forEach(function (n) { return walk(n, false); });
try {
for (var _d = __values(this.scrollMap.keys()), _e = _d.next(); !_e.done; _e = _d.next()) {
var id = _e.value;
if (this.removeIdSet.has(id)) {
this.scrollMap.delete(id);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
}
finally { if (e_1) throw e_1.error; }
}
try {
for (var _f = __values(this.inputMap.keys()), _g = _f.next(); !_g.done; _g = _f.next()) {
var id = _g.value;
if (this.removeIdSet.has(id)) {
this.inputMap.delete(id);
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
}
finally { if (e_2) throw e_2.error; }
}
var scrollMap = new Map(this.scrollMap);
var inputMap = new Map(this.inputMap);
this.reset();
return {
mutationData: batchMutationData,
scrollMap: scrollMap,
inputMap: inputMap,
};
};
TreeIndex.prototype.reset = function () {
this.tree = [];
this.indexes = new Map();
this.removeNodeMutations = [];
this.textMutations = [];
this.attributeMutations = [];
this.removeIdSet = new Set();
this.scrollMap = new Map();
this.inputMap = new Map();
};
return TreeIndex;
}());
function queueToResolveTrees(queue) {
var e_3, _a;
var queueNodeMap = {};
var putIntoMap = function (m, parent) {
var nodeInTree = {
value: m,
parent: parent,
children: [],
};
queueNodeMap[m.node.id] = nodeInTree;
return nodeInTree;
};
var queueNodeTrees = [];
try {
for (var queue_1 = __values(queue), queue_1_1 = queue_1.next(); !queue_1_1.done; queue_1_1 = queue_1.next()) {
var mutation = queue_1_1.value;
var nextId = mutation.nextId, parentId = mutation.parentId;
if (nextId && nextId in queueNodeMap) {
var nextInTree = queueNodeMap[nextId];
if (nextInTree.parent) {
var idx = nextInTree.parent.children.indexOf(nextInTree);
nextInTree.parent.children.splice(idx, 0, putIntoMap(mutation, nextInTree.parent));
}
else {
var idx = queueNodeTrees.indexOf(nextInTree);
queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));
}
continue;
}
if (parentId in queueNodeMap) {
var parentInTree = queueNodeMap[parentId];
parentInTree.children.push(putIntoMap(mutation, parentInTree));
continue;
}
queueNodeTrees.push(putIntoMap(mutation, null));
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (queue_1_1 && !queue_1_1.done && (_a = queue_1.return)) _a.call(queue_1);
}
finally { if (e_3) throw e_3.error; }
}
return queueNodeTrees;
}
function iterateResolveTree(tree, cb) {
cb(tree.value);
for (var i = tree.children.length - 1; i >= 0; i--) {
iterateResolveTree(tree.children[i], cb);
}
}
function isIframeINode(node) {
if ('__sn' in node) {
return (node.__sn.type === NodeType.Element && node.__sn.tagName === 'iframe');
}
return false;
}
function getBaseDimension(node, rootIframe) {
var _a, _b;
var frameElement = (_b = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.frameElement;
if (!frameElement || frameElement === rootIframe) {
return {
x: 0,
y: 0,
relativeScale: 1,
absoluteScale: 1,
};
}
var frameDimension = frameElement.getBoundingClientRect();
var frameBaseDimension = getBaseDimension(frameElement, rootIframe);
var relativeScale = frameDimension.height / frameElement.clientHeight;
return {
x: frameDimension.x * frameBaseDimension.relativeScale +
frameBaseDimension.x,
y: frameDimension.y * frameBaseDimension.relativeScale +
frameBaseDimension.y,
relativeScale: relativeScale,
absoluteScale: frameBaseDimension.absoluteScale * relativeScale,
};
}
function hasShadowRoot(n) {
var _a;
return Boolean((_a = n) === null || _a === void 0 ? void 0 : _a.shadowRoot);
}
export { TreeIndex, _mirror, createMirror, getBaseDimension, getWindowHeight, getWindowWidth, hasShadowRoot, hookSetter, isAncestorRemoved, isBlocked, isIframeINode, isIgnored, isTouchEvent, iterateResolveTree, needCastInSyncMode, on, patch, polyfill, queueToResolveTrees, throttle };
export { _mirror };

@@ -49,2 +49,3 @@ 'use strict';

EventType[EventType["Custom"] = 5] = "Custom";
EventType[EventType["Plugin"] = 6] = "Plugin";
})(EventType || (EventType = {}));

@@ -84,2 +85,3 @@ var IncrementalSource;

MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
})(MediaInteractions || (MediaInteractions = {}));

@@ -86,0 +88,0 @@ var ReplayerEvents;

{
"name": "rrweb",
"version": "1.0.0-beta.0",
"version": "1.0.0-beta.1",
"description": "record and replay the web",

@@ -69,4 +69,4 @@ "scripts": {

"mitt": "^1.1.3",
"rrweb-snapshot": "^1.1.4"
"rrweb-snapshot": "^1.1.6"
}
}
export * from '../index';
export * from '../packer';
export * from '../plugins/console/record';
export * from '../plugins/console/replay';

@@ -1,3 +0,3 @@

import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationRecord, blockClass, maskTextClass, mutationCallBack, MaskTextFn, Mirror } from '../types';
import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn } from 'rrweb-snapshot';
import { mutationRecord, blockClass, maskTextClass, mutationCallBack, Mirror } from '../types';
import { IframeManager } from './iframe-manager';

@@ -24,2 +24,3 @@ import { ShadowDomManager } from './shadow-dom-manager';

private maskTextFn;
private maskInputFn;
private recordCanvas;

@@ -31,3 +32,3 @@ private slimDOMOptions;

private shadowDomManager;
init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, doc: Document, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager): void;
init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, maskInputFn: MaskInputFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, doc: Document, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager): void;
freeze(): void;

@@ -34,0 +35,0 @@ unfreeze(): void;

@@ -1,3 +0,3 @@

import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationCallBack, observerParam, listenerHandler, scrollCallback, blockClass, maskTextClass, hooksParam, SamplingStrategy, MaskTextFn, Mirror } from '../types';
import { MaskInputOptions, SlimDOMOptions, MaskInputFn, MaskTextFn } from 'rrweb-snapshot';
import { mutationCallBack, observerParam, listenerHandler, scrollCallback, blockClass, maskTextClass, hooksParam, SamplingStrategy, Mirror } from '../types';
import MutationBuffer from './mutation';

@@ -7,5 +7,5 @@ import { IframeManager } from './iframe-manager';

export declare const mutationBuffers: MutationBuffer[];
export declare function initMutationObserver(cb: mutationCallBack, doc: Document, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, rootEl: Node): MutationObserver;
export declare function initMutationObserver(cb: mutationCallBack, doc: Document, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, maskInputFn: MaskInputFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, rootEl: Node): MutationObserver;
export declare function initScrollObserver(cb: scrollCallback, doc: Document, mirror: Mirror, blockClass: blockClass, sampling: SamplingStrategy): listenerHandler;
export declare const INPUT_TAGS: string[];
export declare function initObservers(o: observerParam, hooks?: hooksParam): listenerHandler;

@@ -1,3 +0,3 @@

import { mutationCallBack, blockClass, maskTextClass, MaskTextFn, Mirror, scrollCallback, SamplingStrategy } from '../types';
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationCallBack, blockClass, maskTextClass, Mirror, scrollCallback, SamplingStrategy } from '../types';
import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn } from 'rrweb-snapshot';
import { IframeManager } from './iframe-manager';

@@ -12,2 +12,3 @@ declare type BypassOptions = {

maskTextFn: MaskTextFn | undefined;
maskInputFn: MaskInputFn | undefined;
recordCanvas: boolean;

@@ -14,0 +15,0 @@ sampling: SamplingStrategy;

@@ -53,4 +53,2 @@ import { Timer } from './timer';

private applyInput;
private formatMessage;
private getConsoleLogger;
private legacy_resolveMissingNode;

@@ -57,0 +55,0 @@ private moveAndHover;

@@ -1,2 +0,2 @@

import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions, SlimDOMOptions, MaskInputFn, MaskTextFn } from 'rrweb-snapshot';
import { PackFn, UnpackFn } from './packer/base';

@@ -6,2 +6,3 @@ import { FontFaceDescriptors } from 'css-font-loading-module';

import { ShadowDomManager } from './record/shadow-dom-manager';
import type { Replayer } from './replay';
export declare enum EventType {

@@ -13,3 +14,4 @@ DomContentLoaded = 0,

Meta = 4,
Custom = 5
Custom = 5,
Plugin = 6
}

@@ -46,6 +48,2 @@ export declare type domContentLoadedEvent = {

};
export declare type logEvent = {
type: EventType.IncrementalSnapshot;
data: incrementalData;
};
export declare type customEvent<T = unknown> = {

@@ -58,2 +56,9 @@ type: EventType.Custom;

};
export declare type pluginEvent<T = unknown> = {
type: EventType.Plugin;
data: {
plugin: string;
payload: T;
};
};
export declare type styleSheetEvent = {};

@@ -107,7 +112,4 @@ export declare enum IncrementalSource {

} & fontParam;
export declare type logData = {
source: IncrementalSource.Log;
} & LogParam;
export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | logData;
export declare type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | logEvent | customEvent;
export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData;
export declare type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
export declare type eventWithTime = event & {

@@ -126,2 +128,7 @@ timestamp: number;

}>;
export declare type RecordPlugin<TOptions = unknown> = {
name: string;
observer: (cb: Function, options: TOptions) => listenerHandler;
options: TOptions;
};
export declare type recordOptions<T> = {

@@ -147,4 +154,5 @@ emit?: (e: T, isCheckout?: boolean) => void;

collectFonts?: boolean;
plugins?: RecordPlugin[];
mousemoveWait?: number;
recordLog?: boolean | LogRecordOptions;
keepIframeSrcFn?: KeepIframeSrcFn;
};

@@ -171,4 +179,2 @@ export declare type observerParam = {

fontCb: fontCallback;
logCb: logCallback;
logOptions: LogRecordOptions;
sampling: SamplingStrategy;

@@ -182,2 +188,7 @@ recordCanvas: boolean;

shadowDomManager: ShadowDomManager;
plugins: Array<{
observer: Function;
callback: Function;
options: unknown;
}>;
};

@@ -195,3 +206,2 @@ export declare type hooksParam = {

font?: fontCallback;
log?: logCallback;
};

@@ -303,32 +313,3 @@ export declare type mutationRecord = {

};
export declare type LogLevel = 'assert' | 'clear' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'groupEnd' | 'info' | 'log' | 'table' | 'time' | 'timeEnd' | 'timeLog' | 'trace' | 'warn';
export declare type Logger = {
assert?: typeof console.assert;
clear?: typeof console.clear;
count?: typeof console.count;
countReset?: typeof console.countReset;
debug?: typeof console.debug;
dir?: typeof console.dir;
dirxml?: typeof console.dirxml;
error?: typeof console.error;
group?: typeof console.group;
groupCollapsed?: typeof console.groupCollapsed;
groupEnd?: () => void;
info?: typeof console.info;
log?: typeof console.log;
table?: typeof console.table;
time?: typeof console.time;
timeEnd?: typeof console.timeEnd;
timeLog?: typeof console.timeLog;
trace?: typeof console.trace;
warn?: typeof console.warn;
};
export declare type ReplayLogger = Partial<Record<LogLevel, (data: logData) => void>>;
export declare type LogParam = {
level: LogLevel;
trace: string[];
payload: string[];
};
export declare type fontCallback = (p: fontParam) => void;
export declare type logCallback = (p: LogParam) => void;
export declare type viewportResizeDimension = {

@@ -348,3 +329,4 @@ width: number;

Play = 0,
Pause = 1
Pause = 1,
Seeked = 2
}

@@ -354,2 +336,3 @@ export declare type mediaInteractionParam = {

id: number;
currentTime?: number;
};

@@ -377,2 +360,7 @@ export declare type mediaInteractionCallback = (p: mediaInteractionParam) => void;

export declare type hookResetter = () => void;
export declare type ReplayPlugin = {
handler: (event: eventWithTime, isSync: boolean, context: {
replayer: Replayer;
}) => void;
};
export declare type playerConfig = {

@@ -399,8 +387,4 @@ speed: number;

unpackFn?: UnpackFn;
logConfig: LogReplayConfig;
plugins?: ReplayPlugin[];
};
export declare type LogReplayConfig = {
level?: LogLevel[] | undefined;
replayLogger: ReplayLogger | undefined;
};
export declare type playerMetaData = {

@@ -447,17 +431,6 @@ startTime: number;

}
export declare type MaskInputFn = (text: string) => string;
export declare type MaskTextFn = (text: string) => string;
export declare type ElementState = {
scroll?: [number, number];
};
export declare type StringifyOptions = {
stringLengthLimit?: number;
numOfKeysLimit: number;
};
export declare type LogRecordOptions = {
level?: LogLevel[] | undefined;
lengthThreshold?: number;
stringifyOptions?: StringifyOptions;
logger?: Logger;
};
export declare type KeepIframeSrcFn = (src: string) => boolean;
export {};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc