Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

17

dist/plugins/console-record.js

@@ -222,2 +222,5 @@ var rrwebConsoleRecord = (function (exports) {

parse: function (error) {
if (!error) {
return [];
}
if (typeof error.stacktrace !== 'undefined' ||

@@ -529,3 +532,2 @@ typeof error['opera#sourceloc'] !== 'undefined') {

var e_1, _a;
var _this = this;
var loggerType = logOptions.logger;

@@ -546,9 +548,6 @@ if (!loggerType) {

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 errorHandler_1 = function (event) {
var message = event.message, error = event.error;
var trace = ErrorStackParser.parse(error).map(function (stackFrame) { return stackFrame.toString(); });
var payload = [stringify(msg, logOptions.stringifyOptions)];
var payload = [stringify(message, logOptions.stringifyOptions)];
cb({

@@ -560,4 +559,6 @@ level: 'error',

};
window.addEventListener('error', errorHandler_1);
cancelHandlers.push(function () {
window.onerror = originalOnError_1;
if (window)
window.removeEventListener('error', errorHandler_1);
});

@@ -564,0 +565,0 @@ }

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

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function r(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.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(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function t(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,i=t.call(e),a=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function n(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(t(arguments[r]));return e}var o,i,a,u,c,l;!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"}(o||(o={})),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",e[e.StyleDeclaration=13]="StyleDeclaration"}(i||(i={})),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",e[e.TouchCancel=10]="TouchCancel"}(a||(a={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(u||(u={})),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"}(c||(c={})),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"}(l||(l={}));var s="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.",f={map:{},getId:function(){return console.error(s),-1},getNode:function(){return console.error(s),null},removeNodeFromMap:function(){console.error(s)},has:function(){return console.error(s),!1},reset:function(){console.error(s)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(f=new Proxy(f,{get:function(e,r,t){return"map"===r&&console.error(s),Reflect.get(e,r,t)}}));var p=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||"",r=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+r+")":this.fileName+":"+e+":"+r},e}(),h=/(^|@)\S+:\d+/,d=/^\s*at .*(\S+:\d+|\(native\))/m,m=/^(eval@)?(\[native code])?$/,v={parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(d))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 r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!r)throw new Error("Cannot parse given url: "+e);return[r[1],r[2]||void 0,r[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(d)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var r=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),t=r.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(r=t?r.replace(t[0],""):r).split(/\s+/).slice(1),o=this.extractLocation(t?t[1]:n.pop()),i=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new p({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(m)}),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 p({functionName:e});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,t=e.match(r),n=t&&t[1]?t[1]:void 0,o=this.extractLocation(e.replace(r,""));return new p({functionName:n,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 r=/Line (\d+).*script (?:in )?(\S+)/i,t=e.message.split("\n"),n=[],o=2,i=t.length;o<i;o+=2){var a=r.exec(t[o]);a&&n.push(new p({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,t=e.stacktrace.split("\n"),n=[],o=0,i=t.length;o<i;o+=2){var a=r.exec(t[o]);a&&n.push(new p({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(h)&&!e.match(/^Error created at/)}),this).map((function(e){var r=e.split("@"),t=this.extractLocation(r.pop()),n=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new p({functionName:n,fileName:t[0],lineNumber:t[1],columnNumber:t[2]})}),this)}};function g(e){if(!e||!e.outerHTML)return"";for(var r="";e.parentElement;){var t=e.localName;if(!t)break;t=t.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var i=0;i<n.children.length;i++){var a=n.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===t&&o.push(a)}o.length>1&&(t+=":eq("+o.indexOf(e)+")"),r=t+(r?">"+r:""),e=n}return r}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e,t){var n,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=r(i),u=a.next();!u.done;u=a.next()){var c=u.value;if(y(e[c])&&b(e[c],t-1))return!0}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!1}function w(e,r){var t={numOfKeysLimit:50,depthOfLimit:4};Object.assign(t,r);var n=[],o=[];return JSON.stringify(e,(function(e,r){if(n.length>0){var i=n.indexOf(this);~i?n.splice(i+1):n.push(this),~i?o.splice(i,1/0,e):o.push(e),~n.indexOf(r)&&(r=n[0]===r?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(r)).join(".")+"]")}else n.push(r);if(null==r)return r;if(function(e){if(y(e)&&Object.keys(e).length>t.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(y(e)&&b(e,t.depthOfLimit))return!0;return!1}(r))return function(e){var r=e.toString();t.stringLengthLimit&&r.length>t.stringLengthLimit&&(r=r.slice(0,t.stringLengthLimit)+"...");return r}(r);if(r instanceof Event){var a={};for(var u in r){var c=r[u];Array.isArray(c)?a[u]=g(c.length?c[0]:null):a[u]=c}return a}return r instanceof Node?r instanceof HTMLElement?r?r.outerHTML:"":r.nodeName:r}))}var N={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function S(e,t,o){var i,a,u,c=this,l=o.logger;if(!l)return function(){};u="string"==typeof l?t[l]:l;var s=0,f=[];if(o.level.includes("error")&&window){var p=window.onerror;window.onerror=function(r,t,n,i,a){p&&p.apply(c,[r,t,n,i,a]);var u=v.parse(a).map((function(e){return e.toString()})),l=[w(r,o.stringifyOptions)];e({level:"error",trace:u,payload:l})},f.push((function(){window.onerror=p}))}try{for(var h=r(o.level),d=h.next();!d.done;d=h.next()){var m=d.value;f.push(g(u,m))}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}return function(){f.forEach((function(e){return e()}))};function g(r,t){var i=this;return r[t]?function(e,r,t){try{if(!(r in e))return function(){};var n=e[r],o=t(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[r]=o,function(){e[r]=n}}catch(e){return function(){}}}(r,t,(function(r){return function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];r.apply(i,a);try{var c=v.parse(new Error).map((function(e){return e.toString()})).splice(1),l=a.map((function(e){return w(e,o.stringifyOptions)}));++s<o.lengthThreshold?e({level:t,trace:c,payload:l}):s===o.lengthThreshold&&e({level:"warn",trace:[],payload:[w("The number of log records reached the threshold.")]})}catch(e){r.apply(void 0,n(["rrweb logger error:",e],a))}}})):function(){}}}var O="rrweb/console@1";return e.PLUGIN_NAME=O,e.getRecordConsolePlugin=function(e){return{name:O,observer:S,options:e?Object.assign({},N,e):N}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */function r(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.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(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function t(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,i=t.call(e),a=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function n(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(t(arguments[r]));return e}var o,i,a,u,c,l;!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"}(o||(o={})),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",e[e.StyleDeclaration=13]="StyleDeclaration"}(i||(i={})),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",e[e.TouchCancel=10]="TouchCancel"}(a||(a={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(u||(u={})),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"}(c||(c={})),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"}(l||(l={}));var s="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.",f={map:{},getId:function(){return console.error(s),-1},getNode:function(){return console.error(s),null},removeNodeFromMap:function(){console.error(s)},has:function(){return console.error(s),!1},reset:function(){console.error(s)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(f=new Proxy(f,{get:function(e,r,t){return"map"===r&&console.error(s),Reflect.get(e,r,t)}}));var p=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||"",r=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+r+")":this.fileName+":"+e+":"+r},e}(),h=/(^|@)\S+:\d+/,d=/^\s*at .*(\S+:\d+|\(native\))/m,m=/^(eval@)?(\[native code])?$/,v={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(d))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 r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!r)throw new Error("Cannot parse given url: "+e);return[r[1],r[2]||void 0,r[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(d)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var r=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),t=r.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(r=t?r.replace(t[0],""):r).split(/\s+/).slice(1),o=this.extractLocation(t?t[1]:n.pop()),i=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new p({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(m)}),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 p({functionName:e});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,t=e.match(r),n=t&&t[1]?t[1]:void 0,o=this.extractLocation(e.replace(r,""));return new p({functionName:n,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 r=/Line (\d+).*script (?:in )?(\S+)/i,t=e.message.split("\n"),n=[],o=2,i=t.length;o<i;o+=2){var a=r.exec(t[o]);a&&n.push(new p({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,t=e.stacktrace.split("\n"),n=[],o=0,i=t.length;o<i;o+=2){var a=r.exec(t[o]);a&&n.push(new p({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(h)&&!e.match(/^Error created at/)}),this).map((function(e){var r=e.split("@"),t=this.extractLocation(r.pop()),n=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new p({functionName:n,fileName:t[0],lineNumber:t[1],columnNumber:t[2]})}),this)}};function g(e){if(!e||!e.outerHTML)return"";for(var r="";e.parentElement;){var t=e.localName;if(!t)break;t=t.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var i=0;i<n.children.length;i++){var a=n.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===t&&o.push(a)}o.length>1&&(t+=":eq("+o.indexOf(e)+")"),r=t+(r?">"+r:""),e=n}return r}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e,t){var n,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=r(i),u=a.next();!u.done;u=a.next()){var c=u.value;if(y(e[c])&&b(e[c],t-1))return!0}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!1}function w(e,r){var t={numOfKeysLimit:50,depthOfLimit:4};Object.assign(t,r);var n=[],o=[];return JSON.stringify(e,(function(e,r){if(n.length>0){var i=n.indexOf(this);~i?n.splice(i+1):n.push(this),~i?o.splice(i,1/0,e):o.push(e),~n.indexOf(r)&&(r=n[0]===r?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(r)).join(".")+"]")}else n.push(r);if(null==r)return r;if(function(e){if(y(e)&&Object.keys(e).length>t.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(y(e)&&b(e,t.depthOfLimit))return!0;return!1}(r))return function(e){var r=e.toString();t.stringLengthLimit&&r.length>t.stringLengthLimit&&(r=r.slice(0,t.stringLengthLimit)+"...");return r}(r);if(r instanceof Event){var a={};for(var u in r){var c=r[u];Array.isArray(c)?a[u]=g(c.length?c[0]:null):a[u]=c}return a}return r instanceof Node?r instanceof HTMLElement?r?r.outerHTML:"":r.nodeName:r}))}var N={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function S(e,t,o){var i,a,u,c=o.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,s=[];if(o.level.includes("error")&&window){var f=function(r){var t=r.message,n=r.error,i=v.parse(n).map((function(e){return e.toString()})),a=[w(t,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",f),s.push((function(){window&&window.removeEventListener("error",f)}))}try{for(var p=r(o.level),h=p.next();!h.done;h=p.next()){var d=h.value;s.push(m(u,d))}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return function(){s.forEach((function(e){return e()}))};function m(r,t){var i=this;return r[t]?function(e,r,t){try{if(!(r in e))return function(){};var n=e[r],o=t(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[r]=o,function(){e[r]=n}}catch(e){return function(){}}}(r,t,(function(r){return function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];r.apply(i,a);try{var c=v.parse(new Error).map((function(e){return e.toString()})).splice(1),s=a.map((function(e){return w(e,o.stringifyOptions)}));++l<o.lengthThreshold?e({level:t,trace:c,payload:s}):l===o.lengthThreshold&&e({level:"warn",trace:[],payload:[w("The number of log records reached the threshold.")]})}catch(e){r.apply(void 0,n(["rrweb logger error:",e],a))}}})):function(){}}}var O="rrweb/console@1";return e.PLUGIN_NAME=O,e.getRecordConsolePlugin=function(e){return{name:O,observer:S,options:e?Object.assign({},N,e):N}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=console-record.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 i(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(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){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=l(e.styleSheet)||t}catch(e){}return t}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,r,o,a,i){var s,u=r||a||i,l=n||o||"";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,S,g,b=/^[^ \t\n\r\u000c]+/,k=/^[, \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 I(){var e=document.createElement("a");return e.href="",e.href}function w(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?C(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(k),!(n>=t.length);){var a=r(b);if(","===a.slice(-1))a=C(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=C(e,a);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?f(r,I()):r:C(e,r)}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 r,o,a,s,c=n.doc,d=n.blockClass,p=n.blockSelector,m=n.maskTextClass,h=n.maskTextSelector,v=n.inlineStylesheet,y=n.maskInputOptions,S=void 0===y?{}:y,g=n.maskTextFn,b=n.maskInputFn,k=n.recordCanvas,C=n.keepIframeSrcFn;if(c.__sn){var x=c.__sn.id;o=1===x?void 0:x}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{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 M=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,d,p),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return u.test(t)?"div":t}(t),N={},O=0,R=Array.from(t.attributes);O<R.length;O++){var D=R[O],_=D.name,F=D.value;N[_]=w(c,E,_,F)}if("link"===E&&v){var L,A=Array.from(c.styleSheets).find((function(e){return e.href===t.href}));(L=l(A))&&(delete N.rel,delete N.href,N._cssText=f(L,A.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(L=l(t.sheet))&&(N._cssText=f(L,I()));if("input"===E||"textarea"===E||"select"===E){F=t.value;"radio"!==N.type&&"checkbox"!==N.type&&"submit"!==N.type&&"button"!==N.type&&F?N.value=i({type:N.type,tagName:E,value:F,maskInputOptions:S,maskInputFn:b}):t.checked&&(N.checked=t.checked)}if("option"===E&&(t.selected?N.selected=!0:delete N.selected),"canvas"===E&&k&&(N.rr_dataURL=t.toDataURL()),"audio"!==E&&"video"!==E||(N.rr_mediaState=t.paused?"paused":"played",N.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(N.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(N.rr_scrollTop=t.scrollTop),M){var P=t.getBoundingClientRect(),z=P.width,V=P.height;N={class:N.class,rr_width:z+"px",rr_height:V+"px"}}return"iframe"!==E||C(N.src)||(t.contentDocument||(N.rr_src=N.src),delete N.src),{type:e.Element,tagName:E,attributes:N,childNodes:[],isSVG:(s=t,"svg"===s.tagName||s instanceof SVGElement||void 0),needBlock:M,rootId:o};case t.TEXT_NODE:var j=t.parentNode&&t.parentNode.tagName,W=t.textContent,H="STYLE"===j||void 0,B="SCRIPT"===j||void 0;if(H&&W){try{(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(W=(a=t.parentNode.sheet).cssRules?Array.from(a.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}W=f(W,I())}return B&&(W="SCRIPT_PLACEHOLDER"),!H&&!B&&T(t,m,h)&&W&&(W=g?g(W):W.replace(/[\S]/g,"*")),{type:e.Text,textContent:W||"",isStyle:H,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 r,o=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,S=n.maskTextFn,g=n.maskInputFn,b=n.slimDOMOptions,k=n.recordCanvas,C=void 0!==k&&k,I=n.onSerialize,w=n.onIframeLoad,T=n.iframeLoadTimeout,N=void 0===T?5e3:T,O=n.keepIframeSrcFn,R=void 0===O?function(){return!1}:O,D=n.preserveWhiteSpace,_=void 0===D||D,F=x(t,{doc:o,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:y,maskTextFn:S,maskInputFn:g,recordCanvas:C,keepIframeSrcFn:R});if(!F)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||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))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}(F,b)&&(_||F.type!==e.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?s++:-2;var L=Object.assign(F,{id:r});if(t.__sn=L,-2===r)return null;i[r]=t,I&&I(t);var A=!m;if(L.type===e.Element&&(A=A&&!L.needBlock,delete L.needBlock),(L.type===e.Document||L.type===e.Element)&&A){b.headWhitespace&&F.type===e.Element&&"head"===F.tagName&&(_=!1);for(var P={doc:o,map:i,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:m,inlineStylesheet:h,maskInputOptions:y,maskTextFn:S,maskInputFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:N,keepIframeSrcFn:R},z=0,V=Array.from(t.childNodes);z<V.length;z++){(H=E(V[z],P))&&L.childNodes.push(H)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot){L.isShadowHost=!0;for(var j=0,W=Array.from(t.shadowRoot.childNodes);j<W.length;j++){var H;(H=E(W[j],P))&&(H.isShadow=!0,L.childNodes.push(H))}}}return t.parentNode&&a(t.parentNode)&&(L.isShadow=!0),L.type===e.Element&&"iframe"===L.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){var i="about:blank";r.location.href===i&&e.src!==i&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&w){var n=E(e,{doc:e,map:i,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:S,maskInputFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:N,keepIframeSrcFn:R});n&&w(t,n)}}),N),L}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",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",e[e.StyleDeclaration=13]="StyleDeclaration"}(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",e[e.TouchCancel=10]="TouchCancel"}(y||(y={})),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"}(g||(g={}));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.",R={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 D(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&&(clearTimeout(r),r=null),o=i,e.apply(u,l)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function _(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 _(e,t,a||{},!0)}}function F(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 L(){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 P(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||P(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,P(e.parentNode,t)}function z(e){return"__sn"in e&&-2===e.__sn.id}function V(e,t){if(a(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||V(e.parentNode,t))}function j(e){return Boolean(e.changedTouches)}function W(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function H(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function B(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(R=new Proxy(R,{get:function(e,t,n){return"map"===t&&console.error(O),Reflect.get(e,t,n)}}));var U=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&&B(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&&B(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}(),X=function(e,t){return e+"@"+t};function q(e){return"__sn"in e}var G=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 U,l=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return 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)||r instanceof Node&&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=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){W(n)&&e.iframeManager.addIframe(n),H(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&&(r=d.return)&&r.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){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}for(var v=null;u.length;){var y=null;if(v){var S=e.mirror.getId(v.value.parentNode),g=l(v.value);-1!==S&&-1!==g&&(y=v)}if(!y)for(var b=u.length-1;b>=0;b--){var k=u.get(b);if(k){S=e.mirror.getId(k.value.parentNode),g=l(k.value);if(-1!==S&&-1!==g){y=k;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){var r,o,s,u;if(!z(t.target))switch(t.type){case"characterData":var l=t.target.textContent;P(t.target,e.blockClass)||l===t.oldValue||e.texts.push({value:T(t.target,e.maskTextClass,e.maskTextSelector)&&l?e.maskTextFn?e.maskTextFn(l):l.replace(/[\S]/g,"*"):l,node:t.target});break;case"attributes":var c=t.target;l=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(l=i({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:l,maskInputFn:e.maskInputFn})),P(t.target,e.blockClass)||l===t.oldValue)return;var d=e.attributes.find((function(e){return e.node===t.target}));if(d||(d={node:t.target,attributes:{}},e.attributes.push(d)),"style"===t.attributeName){var p=e.doc.createElement("span");t.oldValue&&p.setAttribute("style",t.oldValue),void 0!==d.attributes.style&&null!==d.attributes.style||(d.attributes.style={});var m=d.attributes.style;try{for(var f=n(Array.from(c.style)),h=f.next();!h.done;h=f.next()){var v=h.value,y=c.style.getPropertyValue(v),S=c.style.getPropertyPriority(v);y===p.style.getPropertyValue(v)&&S===p.style.getPropertyPriority(v)||(m[v]=""===S?y:[y,S])}}catch(e){r={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}try{for(var g=n(Array.from(p.style)),b=g.next();!b.done;b=g.next()){v=b.value;""!==c.style.getPropertyValue(v)&&c.style.getPropertyValue(v)||(m[v]=!1)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(u=g.return)&&u.call(g)}finally{if(s)throw s.error}}}else d.attributes[t.attributeName]=w(e.doc,t.target.tagName,t.attributeName,l);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);P(t.target,e.blockClass)||z(n)||(e.addedSet.has(n)?(Y(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||V(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[X(r,o)]?Y(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(!n||!P(n,e.blockClass)){if(q(t)){if(z(t))return;e.movedSet.add(t);var r=null;n&&q(n)&&(r=n.__sn.id),r&&(e.movedMap[X(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);P(t,e.blockClass)||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,m,f){this.blockClass=t,this.blockSelector=n,this.maskTextClass=r,this.maskTextSelector=o,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 r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||K(e,r,n)}function $(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||$(e,n))}var J=[],Z="undefined"!=typeof CSSGroupingRule,Q="undefined"!=typeof CSSMediaRule,ee="undefined"!=typeof CSSSupportsRule,te="undefined"!=typeof CSSConditionRule;function ne(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 re(e,t,n,r,o,a,i,s,u,l,c,d,p,m,f,h){var v,y,S,g=new G;J.push(g),g.init(e,n,r,o,a,i,s,u,l,c,d,t,p,m,f);var b=window.MutationObserver||window.__rrMutationObserver,k=null===(S=null===(y=null===(v=window)||void 0===v?void 0:v.Zone)||void 0===y?void 0:y.__symbol__)||void 0===S?void 0:S.call(y,"MutationObserver");k&&window[k]&&(b=window[k]);var C=new b(g.processMutations.bind(g));return C.observe(h,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function oe(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(y).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=ne(o);if(!P(a,r)){var i=j(o)?o.changedTouches[0]:o;if(i){var s=n.getId(a),u=i.clientX,l=i.clientY;e({type:y[t],id:s,x:u,y:l})}}}}(o);i.push(N(a,s,t))})),function(){i.forEach((function(e){return e()}))}}function ae(e,t,n,r,o){return N("scroll",D((function(o){var a=ne(o);if(a&&!P(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)}function ie(e,n){var r=t({},e);return n||delete r.userTriggered,r}var se=["INPUT","TEXTAREA","SELECT"],ue=new WeakMap;function le(e){return function(e,t){if(Z&&e.parentRule instanceof CSSGroupingRule||Q&&e.parentRule instanceof CSSMediaRule||ee&&e.parentRule instanceof CSSSupportsRule||te&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ce(e,a){var s,u;void 0===a&&(a={});var l=e.doc.defaultView;if(!l)return function(){};!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.styleDeclarationCb,p=e.canvasMutationCb,m=e.fontCb;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.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,o(e)),d.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)),p.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)),m.apply(void 0,o(e))}}(e,a);var c,d,p,m=re(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),f=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=D((function(t){var n=Date.now()-o;e(s.map((function(e){return e.timeOffset-=n,e})),t),s=[],o=null}),i),l=D((function(e){var t=ne(e),n=j(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("undefined"!=typeof DragEvent&&e instanceof DragEvent?v.Drag:e instanceof MouseEvent?v.MouseMove:v.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),h=oe(e.mouseInteractionCb,e.doc,e.mirror,e.blockClass,e.sampling),y=ae(e.scrollCb,e.doc,e.mirror,e.blockClass,e.sampling),S=(c=e.viewportResizeCb,d=-1,p=-1,N("resize",D((function(){var e=L(),t=A();d===e&&p===t||(c({width:Number(t),height:Number(e)}),d=e,p=t)}),200),window)),g=function(e,n,r,a,s,u,l,c,d){function p(e){var t=ne(e),r=e.isTrusted;if(t&&t.tagName&&!(se.indexOf(t.tagName)<0)&&!P(t,a)){var o=t.type;if(!t.classList.contains(s)){var c=t.value,p=!1;"radio"===o||"checkbox"===o?p=t.checked:(u[t.tagName.toLowerCase()]||u[o])&&(c=i({maskInputOptions:u,tagName:t.tagName,type:o,value:c,maskInputFn:l})),m(t,ie({text:c,isChecked:p,userTriggered:r},d));var f=t.name;"radio"===o&&f&&p&&n.querySelectorAll('input[type="radio"][name="'+f+'"]').forEach((function(e){e!==t&&m(e,ie({text:e.value,isChecked:!p,userTriggered:!1},d))}))}}}function m(n,o){var a=ue.get(n);if(!a||a.text!==o.text||a.isChecked!==o.isChecked){ue.set(n,o);var i=r.getId(n);e(t(t({},o),{id:i}))}}var f=("last"===c.input?["change"]:["input","change"]).map((function(e){return N(e,p,n)})),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),v=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return h&&h.set&&f.push.apply(f,o(v.map((function(e){return _(e[0],e[1],{set:function(){p({target:this})}})})))),function(){f.forEach((function(e){return e()}))}}(e.inputCb,e.doc,e.mirror,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling,e.userTriggeredOnInput),b=function(e,t,n){var r=function(r){return function(o){var a=ne(o);a&&!P(a,t)&&e({type:r,id:n.getId(a),currentTime:a.currentTime})}},o=[N("play",r(0)),N("pause",r(1)),N("seeked",r(2))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass,e.mirror),k=function(e,t,n){var a=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=function(t,r){var o=n.getId(this.ownerNode);return-1!==o&&e({id:o,adds:[{rule:t,index:r}]}),a.apply(this,arguments)};var i=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=function(t){var r=n.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:t}]}),i.apply(this,arguments)};var s={};Z?s.CSSGroupingRule=t.CSSGroupingRule:(Q&&(s.CSSMediaRule=t.CSSMediaRule),te&&(s.CSSConditionRule=t.CSSConditionRule),ee&&(s.CSSSupportsRule=t.CSSSupportsRule));var u={};return Object.entries(s).forEach((function(t){var a=r(t,2),i=a[0],s=a[1];u[i]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(t,r){var a=n.getId(this.parentStyleSheet.ownerNode);return-1!==a&&e({id:a,adds:[{rule:t,index:o(le(this),[r||0])}]}),u[i].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(t){var r=n.getId(this.parentStyleSheet.ownerNode);return-1!==r&&e({id:r,removes:[{index:o(le(this),[t])}]}),u[i].deleteRule.apply(this,arguments)}})),function(){t.CSSStyleSheet.prototype.insertRule=a,t.CSSStyleSheet.prototype.deleteRule=i,Object.entries(s).forEach((function(e){var t=r(e,2),n=t[0],o=t[1];o.prototype.insertRule=u[n].insertRule,o.prototype.deleteRule=u[n].deleteRule}))}}(e.styleSheetRuleCb,l,e.mirror),C=function(e,t,n){var r=t.CSSStyleDeclaration.prototype.setProperty;t.CSSStyleDeclaration.prototype.setProperty=function(t,o,a){var i,s,u=n.getId(null===(s=null===(i=this.parentRule)||void 0===i?void 0:i.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&e({id:u,set:{property:t,value:o,priority:a},index:le(this.parentRule)}),r.apply(this,arguments)};var o=t.CSSStyleDeclaration.prototype.removeProperty;return t.CSSStyleDeclaration.prototype.removeProperty=function(t){var r,a,i=n.getId(null===(a=null===(r=this.parentRule)||void 0===r?void 0:r.parentStyleSheet)||void 0===a?void 0:a.ownerNode);return-1!==i&&e({id:i,remove:{property:t},index:le(this.parentRule)}),o.apply(this,arguments)},function(){t.CSSStyleDeclaration.prototype.setProperty=r,t.CSSStyleDeclaration.prototype.removeProperty=o}}(e.styleDeclarationCb,l,e.mirror),I=e.recordCanvas?function(e,t,r,a){var i,s,u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),l=[],c=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var i=F(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var i=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return P(this.canvas,r)||setTimeout((function(){var t=o(s);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var r=t[0],u=r.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,r.width,r.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e({id:a.getId(i.canvas),property:n,args:t})}),0),t.apply(this,s)}}));l.push(i)}catch(r){var s=_(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:a.getId(this.canvas),property:n,args:[t],setter:!0})}});l.push(s)}};try{for(var d=n(u),p=d.next();!p.done;p=d.next())c(p.value)}catch(e){i={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}return function(){l.forEach((function(e){return e()}))}}(e.canvasMutationCb,l,e.blockClass,e.mirror):function(){},w=e.collectFonts?function(e,t){var n=t.defaultView;if(!n)return function(){};var r=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){var r=new a(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var i=F(t.fonts,"add",(function(t){return function(n){return setTimeout((function(){var t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}}));return r.push((function(){n.FontFace=a})),r.push(i),function(){r.forEach((function(e){return e()}))}}(e.fontCb,e.doc):function(){},T=[];try{for(var x=n(e.plugins),M=x.next();!M.done;M=x.next()){var E=M.value;T.push(E.observer(E.callback,l,E.options))}}catch(e){s={error:e}}finally{try{M&&!M.done&&(u=x.return)&&u.call(x)}finally{if(s)throw s.error}}return function(){m.disconnect(),f(),h(),y(),S(),g(),b(),k(),C(),I(),w(),T.forEach((function(e){return e()}))}}var de,pe,me=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}(),fe=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){re(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),ae(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();function he(e){return t(t({},e),{timestamp:Date.now()})}var ve={map:{},getId:function(e){return e&&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 ye(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,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,S=e.inlineStylesheet,g=void 0===S||S,b=e.maskAllInputs,k=e.maskInputOptions,C=e.slimDOMOptions,I=e.maskInputFn,w=e.maskTextFn,T=e.hooks,x=e.packFn,M=e.sampling,O=void 0===M?{}:M,R=e.mousemoveWait,D=e.recordCanvas,_=void 0!==D&&D,F=e.userTriggeredOnInput,P=void 0!==F&&F,z=e.collectFonts,V=void 0!==z&&z,j=e.plugins,B=e.keepIframeSrcFn,U=void 0===B?function(){return!1}:B;if(!n)throw new Error("emit function is required");void 0!==R&&void 0===O.mousemove&&(O.mousemove=R);var X,q,G=!0===b?{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!==k?k:{password:!0},Y=!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===X&&(X=window),"NodeList"in X&&!X.NodeList.prototype.forEach&&(X.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in X&&!X.DOMTokenList.prototype.forEach&&(X.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 K=0;de=function(e,t){var r;if(!(null===(r=J[0])||void 0===r?void 0:r.isFrozen())||e.type===h.FullSnapshot||e.type===h.IncrementalSnapshot&&e.data.source===v.Mutation||J.forEach((function(e){return e.unfreeze()})),n(x?x(e):e,t),e.type===h.FullSnapshot)q=e,K=0;else if(e.type===h.IncrementalSnapshot){if(e.data.source===v.Mutation&&e.data.isAttachIframe)return;K++;var i=a&&K>=a,s=o&&e.timestamp-q.timestamp>o;(i||s)&&pe(!0)}};var $=function(e){de(he({type:h.IncrementalSnapshot,data:t({source:v.Mutation},e)}))},Z=function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.Scroll},e)}))},Q=new me({mutationCb:$}),ee=new fe({mutationCb:$,scrollCb:Z,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:g,maskInputOptions:G,maskTextFn:w,maskInputFn:I,recordCanvas:_,sampling:O,slimDOMOptions:Y,iframeManager:Q},mirror:ve});pe=function(e){var t,n,o,a;void 0===e&&(e=!1),de(he({type:h.Meta,data:{href:window.location.href,width:A(),height:L()}}),e),J.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,m=n.recordCanvas,f=void 0!==m&&m,h=n.maskAllInputs,v=void 0!==h&&h,y=n.maskTextFn,S=n.maskInputFn,g=n.slimDOM,b=void 0!==g&&g,k=n.preserveWhiteSpace,C=n.onSerialize,I=n.onIframeLoad,w=n.iframeLoadTimeout,T=n.keepIframeSrcFn,x={};return[E(e,{doc:e,map:x,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,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,maskInputFn:S,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:f,preserveWhiteSpace:k,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:w,keepIframeSrcFn:void 0===T?function(){return!1}:T}),x]}(document,{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:g,maskAllInputs:G,maskTextFn:w,slimDOM:Y,recordCanvas:_,onSerialize:function(e){W(e)&&Q.addIframe(e),H(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){Q.attachIframe(e,t)},keepIframeSrcFn:U}),2),u=i[0],c=i[1];if(!u)return console.warn("Failed to snapshot the document");ve.map=c,de(he({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===(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}}})),J.forEach((function(e){return e.unlock()}))};try{var te=[];te.push(N("DOMContentLoaded",(function(){de(he({type:h.DomContentLoaded,data:{}}))})));var ne=function(e){return ce({mutationCb:$,mousemoveCb:function(e,t){return de(he({type:h.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.MouseInteraction},e)}))},scrollCb:Z,viewportResizeCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.ViewportResize},e)}))},inputCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.Input},e)}))},mediaInteractionCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.StyleDeclaration},e)}))},canvasMutationCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.CanvasMutation},e)}))},fontCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.Font},e)}))},blockClass:s,ignoreClass:d,maskTextClass:m,maskTextSelector:y,maskInputOptions:G,inlineStylesheet:g,sampling:O,recordCanvas:_,userTriggeredOnInput:P,collectFonts:V,doc:e,maskInputFn:I,maskTextFn:w,blockSelector:l,slimDOMOptions:Y,mirror:ve,iframeManager:Q,shadowDomManager:ee,plugins:(null==j?void 0:j.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return de(he({type:h.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},T)};Q.addLoadListener((function(e){te.push(ne(e.contentDocument))}));var re=function(){pe(),te.push(ne(document))};return"interactive"===document.readyState||"complete"===document.readyState?re():te.push(N("load",(function(){de(he({type:h.Load,data:{}})),re()}),window)),function(){te.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return ye.addCustomEvent=function(e,t){if(!de)throw new Error("please add custom event after start recording");de(he({type:h.Custom,data:{tag:e,payload:t}}))},ye.freezePage=function(){J.forEach((function(e){return e.freeze()}))},ye.takeFullSnapshot=function(e){if(!pe)throw new Error("please take full snapshot after start recording");pe(e)},ye.mirror=ve,ye}();
***************************************************************************** */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 i(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(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=new 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){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=l(e.styleSheet)||t}catch(e){}return t}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,r,o,a,i){var s,u=r||a||i,l=n||o||"";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,S,g,b=/^[^ \t\n\r\u000c]+/,k=/^[, \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 I(){var e=document.createElement("a");return e.href="",e.href}function w(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?C(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(k),!(n>=t.length);){var a=r(b);if(","===a.slice(-1))a=C(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=C(e,a);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?f(r,I()):"object"===t&&"data"===n&&r?C(e,r):r:C(e,r)}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 r,o,a,s,c=n.doc,d=n.blockClass,p=n.blockSelector,m=n.maskTextClass,h=n.maskTextSelector,v=n.inlineStylesheet,y=n.maskInputOptions,S=void 0===y?{}:y,g=n.maskTextFn,b=n.maskInputFn,k=n.recordCanvas,C=n.keepIframeSrcFn;if(c.__sn){var x=c.__sn.id;o=1===x?void 0:x}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{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 M=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,d,p),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return u.test(t)?"div":t}(t),N={},O=0,R=Array.from(t.attributes);O<R.length;O++){var D=R[O],_=D.name,F=D.value;N[_]=w(c,E,_,F)}if("link"===E&&v){var L,A=Array.from(c.styleSheets).find((function(e){return e.href===t.href}));(L=l(A))&&(delete N.rel,delete N.href,N._cssText=f(L,A.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(L=l(t.sheet))&&(N._cssText=f(L,I()));if("input"===E||"textarea"===E||"select"===E){F=t.value;"radio"!==N.type&&"checkbox"!==N.type&&"submit"!==N.type&&"button"!==N.type&&F?N.value=i({type:N.type,tagName:E,value:F,maskInputOptions:S,maskInputFn:b}):t.checked&&(N.checked=t.checked)}if("option"===E&&(t.selected?N.selected=!0:delete N.selected),"canvas"===E&&k&&(N.rr_dataURL=t.toDataURL()),"audio"!==E&&"video"!==E||(N.rr_mediaState=t.paused?"paused":"played",N.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(N.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(N.rr_scrollTop=t.scrollTop),M){var P=t.getBoundingClientRect(),z=P.width,j=P.height;N={class:N.class,rr_width:z+"px",rr_height:j+"px"}}return"iframe"!==E||C(N.src)||(t.contentDocument||(N.rr_src=N.src),delete N.src),{type:e.Element,tagName:E,attributes:N,childNodes:[],isSVG:(s=t,"svg"===s.tagName||s instanceof SVGElement||void 0),needBlock:M,rootId:o};case t.TEXT_NODE:var V=t.parentNode&&t.parentNode.tagName,W=t.textContent,H="STYLE"===V||void 0,B="SCRIPT"===V||void 0;if(H&&W){try{(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(W=(a=t.parentNode.sheet).cssRules?Array.from(a.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}W=f(W,I())}return B&&(W="SCRIPT_PLACEHOLDER"),!H&&!B&&T(t,m,h)&&W&&(W=g?g(W):W.replace(/[\S]/g,"*")),{type:e.Text,textContent:W||"",isStyle:H,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 r,o=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,S=n.maskTextFn,g=n.maskInputFn,b=n.slimDOMOptions,k=n.recordCanvas,C=void 0!==k&&k,I=n.onSerialize,w=n.onIframeLoad,T=n.iframeLoadTimeout,N=void 0===T?5e3:T,O=n.keepIframeSrcFn,R=void 0===O?function(){return!1}:O,D=n.preserveWhiteSpace,_=void 0===D||D,F=x(t,{doc:o,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:y,maskTextFn:S,maskInputFn:g,recordCanvas:C,keepIframeSrcFn:R});if(!F)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||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))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}(F,b)&&(_||F.type!==e.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?s++:-2;var L=Object.assign(F,{id:r});if(t.__sn=L,-2===r)return null;i[r]=t,I&&I(t);var A=!m;if(L.type===e.Element&&(A=A&&!L.needBlock,delete L.needBlock),(L.type===e.Document||L.type===e.Element)&&A){b.headWhitespace&&F.type===e.Element&&"head"===F.tagName&&(_=!1);for(var P={doc:o,map:i,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:m,inlineStylesheet:h,maskInputOptions:y,maskTextFn:S,maskInputFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:N,keepIframeSrcFn:R},z=0,j=Array.from(t.childNodes);z<j.length;z++){(H=E(j[z],P))&&L.childNodes.push(H)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot){L.isShadowHost=!0;for(var V=0,W=Array.from(t.shadowRoot.childNodes);V<W.length;V++){var H;(H=E(W[V],P))&&(H.isShadow=!0,L.childNodes.push(H))}}}return t.parentNode&&a(t.parentNode)&&(L.isShadow=!0),L.type===e.Element&&"iframe"===L.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){var i="about:blank";r.location.href===i&&e.src!==i&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&w){var n=E(e,{doc:e,map:i,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:S,maskInputFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:_,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:N,keepIframeSrcFn:R});n&&w(t,n)}}),N),L}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",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",e[e.StyleDeclaration=13]="StyleDeclaration"}(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",e[e.TouchCancel=10]="TouchCancel"}(y||(y={})),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"}(g||(g={}));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.",R={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 D(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&&(clearTimeout(r),r=null),o=i,e.apply(u,l)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function _(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 _(e,t,a||{},!0)}}function F(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 L(){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 P(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||P(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,P(e.parentNode,t)}function z(e){return"__sn"in e&&-2===e.__sn.id}function j(e,t){if(a(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||j(e.parentNode,t))}function V(e){return Boolean(e.changedTouches)}function W(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function H(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function B(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(R=new Proxy(R,{get:function(e,t,n){return"map"===t&&console.error(O),Reflect.get(e,t,n)}}));var U=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&&B(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&&B(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}(),X=function(e,t){return e+"@"+t};function q(e){return"__sn"in e}var G=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 U,l=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return 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)||r instanceof Node&&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=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){W(n)&&e.iframeManager.addIframe(n),H(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&&(r=d.return)&&r.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){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}for(var v=null;u.length;){var y=null;if(v){var S=e.mirror.getId(v.value.parentNode),g=l(v.value);-1!==S&&-1!==g&&(y=v)}if(!y)for(var b=u.length-1;b>=0;b--){var k=u.get(b);if(k){S=e.mirror.getId(k.value.parentNode),g=l(k.value);if(-1!==S&&-1!==g){y=k;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){var r,o,s,u;if(!z(t.target))switch(t.type){case"characterData":var l=t.target.textContent;P(t.target,e.blockClass)||l===t.oldValue||e.texts.push({value:T(t.target,e.maskTextClass,e.maskTextSelector)&&l?e.maskTextFn?e.maskTextFn(l):l.replace(/[\S]/g,"*"):l,node:t.target});break;case"attributes":var c=t.target;l=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(l=i({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:l,maskInputFn:e.maskInputFn})),P(t.target,e.blockClass)||l===t.oldValue)return;var d=e.attributes.find((function(e){return e.node===t.target}));if(d||(d={node:t.target,attributes:{}},e.attributes.push(d)),"style"===t.attributeName){var p=e.doc.createElement("span");t.oldValue&&p.setAttribute("style",t.oldValue),void 0!==d.attributes.style&&null!==d.attributes.style||(d.attributes.style={});var m=d.attributes.style;try{for(var f=n(Array.from(c.style)),h=f.next();!h.done;h=f.next()){var v=h.value,y=c.style.getPropertyValue(v),S=c.style.getPropertyPriority(v);y===p.style.getPropertyValue(v)&&S===p.style.getPropertyPriority(v)||(m[v]=""===S?y:[y,S])}}catch(e){r={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}try{for(var g=n(Array.from(p.style)),b=g.next();!b.done;b=g.next()){v=b.value;""===c.style.getPropertyValue(v)&&(m[v]=!1)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(u=g.return)&&u.call(g)}finally{if(s)throw s.error}}}else d.attributes[t.attributeName]=w(e.doc,t.target.tagName,t.attributeName,l);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);P(t.target,e.blockClass)||z(n)||(e.addedSet.has(n)?(Y(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||j(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[X(r,o)]?Y(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(!n||!P(n,e.blockClass)){if(q(t)){if(z(t))return;e.movedSet.add(t);var r=null;n&&q(n)&&(r=n.__sn.id),r&&(e.movedMap[X(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);P(t,e.blockClass)||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,m,f){this.blockClass=t,this.blockSelector=n,this.maskTextClass=r,this.maskTextSelector=o,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 r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||K(e,r,n)}function $(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||$(e,n))}var J=[],Z="undefined"!=typeof CSSGroupingRule,Q="undefined"!=typeof CSSMediaRule,ee="undefined"!=typeof CSSSupportsRule,te="undefined"!=typeof CSSConditionRule;function ne(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 re(e,t,n,r,o,a,i,s,u,l,c,d,p,m,f,h){var v,y,S,g=new G;J.push(g),g.init(e,n,r,o,a,i,s,u,l,c,d,t,p,m,f);var b=window.MutationObserver||window.__rrMutationObserver,k=null===(S=null===(y=null===(v=window)||void 0===v?void 0:v.Zone)||void 0===y?void 0:y.__symbol__)||void 0===S?void 0:S.call(y,"MutationObserver");k&&window[k]&&(b=window[k]);var C=new b(g.processMutations.bind(g));return C.observe(h,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function oe(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(y).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=ne(o);if(!P(a,r)){var i=V(o)?o.changedTouches[0]:o;if(i){var s=n.getId(a),u=i.clientX,l=i.clientY;e({type:y[t],id:s,x:u,y:l})}}}}(o);i.push(N(a,s,t))})),function(){i.forEach((function(e){return e()}))}}function ae(e,t,n,r,o){return N("scroll",D((function(o){var a=ne(o);if(a&&!P(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)}function ie(e,n){var r=t({},e);return n||delete r.userTriggered,r}var se=["INPUT","TEXTAREA","SELECT"],ue=new WeakMap;function le(e){return function(e,t){if(Z&&e.parentRule instanceof CSSGroupingRule||Q&&e.parentRule instanceof CSSMediaRule||ee&&e.parentRule instanceof CSSSupportsRule||te&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ce(e,a){var s,u;void 0===a&&(a={});var l=e.doc.defaultView;if(!l)return function(){};!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.styleDeclarationCb,p=e.canvasMutationCb,m=e.fontCb;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.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,o(e)),d.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)),p.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)),m.apply(void 0,o(e))}}(e,a);var c,d,p,m=re(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),f=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=D((function(t){var n=Date.now()-o;e(s.map((function(e){return e.timeOffset-=n,e})),t),s=[],o=null}),i),l=D((function(e){var t=ne(e),n=V(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("undefined"!=typeof DragEvent&&e instanceof DragEvent?v.Drag:e instanceof MouseEvent?v.MouseMove:v.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),h=oe(e.mouseInteractionCb,e.doc,e.mirror,e.blockClass,e.sampling),y=ae(e.scrollCb,e.doc,e.mirror,e.blockClass,e.sampling),S=(c=e.viewportResizeCb,d=-1,p=-1,N("resize",D((function(){var e=L(),t=A();d===e&&p===t||(c({width:Number(t),height:Number(e)}),d=e,p=t)}),200),window)),g=function(e,n,r,a,s,u,l,c,d){function p(e){var t=ne(e),r=e.isTrusted;if(t&&t.tagName&&!(se.indexOf(t.tagName)<0)&&!P(t,a)){var o=t.type;if(!t.classList.contains(s)){var c=t.value,p=!1;"radio"===o||"checkbox"===o?p=t.checked:(u[t.tagName.toLowerCase()]||u[o])&&(c=i({maskInputOptions:u,tagName:t.tagName,type:o,value:c,maskInputFn:l})),m(t,ie({text:c,isChecked:p,userTriggered:r},d));var f=t.name;"radio"===o&&f&&p&&n.querySelectorAll('input[type="radio"][name="'+f+'"]').forEach((function(e){e!==t&&m(e,ie({text:e.value,isChecked:!p,userTriggered:!1},d))}))}}}function m(n,o){var a=ue.get(n);if(!a||a.text!==o.text||a.isChecked!==o.isChecked){ue.set(n,o);var i=r.getId(n);e(t(t({},o),{id:i}))}}var f=("last"===c.input?["change"]:["input","change"]).map((function(e){return N(e,p,n)})),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),v=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return h&&h.set&&f.push.apply(f,o(v.map((function(e){return _(e[0],e[1],{set:function(){p({target:this})}})})))),function(){f.forEach((function(e){return e()}))}}(e.inputCb,e.doc,e.mirror,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling,e.userTriggeredOnInput),b=function(e,t,n){var r=function(r){return function(o){var a=ne(o);a&&!P(a,t)&&e({type:r,id:n.getId(a),currentTime:a.currentTime})}},o=[N("play",r(0)),N("pause",r(1)),N("seeked",r(2))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass,e.mirror),k=function(e,t,n){var a=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=function(t,r){var o=n.getId(this.ownerNode);return-1!==o&&e({id:o,adds:[{rule:t,index:r}]}),a.apply(this,arguments)};var i=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=function(t){var r=n.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:t}]}),i.apply(this,arguments)};var s={};Z?s.CSSGroupingRule=t.CSSGroupingRule:(Q&&(s.CSSMediaRule=t.CSSMediaRule),te&&(s.CSSConditionRule=t.CSSConditionRule),ee&&(s.CSSSupportsRule=t.CSSSupportsRule));var u={};return Object.entries(s).forEach((function(t){var a=r(t,2),i=a[0],s=a[1];u[i]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(t,r){var a=n.getId(this.parentStyleSheet.ownerNode);return-1!==a&&e({id:a,adds:[{rule:t,index:o(le(this),[r||0])}]}),u[i].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(t){var r=n.getId(this.parentStyleSheet.ownerNode);return-1!==r&&e({id:r,removes:[{index:o(le(this),[t])}]}),u[i].deleteRule.apply(this,arguments)}})),function(){t.CSSStyleSheet.prototype.insertRule=a,t.CSSStyleSheet.prototype.deleteRule=i,Object.entries(s).forEach((function(e){var t=r(e,2),n=t[0],o=t[1];o.prototype.insertRule=u[n].insertRule,o.prototype.deleteRule=u[n].deleteRule}))}}(e.styleSheetRuleCb,l,e.mirror),C=function(e,t,n){var r=t.CSSStyleDeclaration.prototype.setProperty;t.CSSStyleDeclaration.prototype.setProperty=function(t,o,a){var i,s,u=n.getId(null===(s=null===(i=this.parentRule)||void 0===i?void 0:i.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&e({id:u,set:{property:t,value:o,priority:a},index:le(this.parentRule)}),r.apply(this,arguments)};var o=t.CSSStyleDeclaration.prototype.removeProperty;return t.CSSStyleDeclaration.prototype.removeProperty=function(t){var r,a,i=n.getId(null===(a=null===(r=this.parentRule)||void 0===r?void 0:r.parentStyleSheet)||void 0===a?void 0:a.ownerNode);return-1!==i&&e({id:i,remove:{property:t},index:le(this.parentRule)}),o.apply(this,arguments)},function(){t.CSSStyleDeclaration.prototype.setProperty=r,t.CSSStyleDeclaration.prototype.removeProperty=o}}(e.styleDeclarationCb,l,e.mirror),I=e.recordCanvas?function(e,t,r,a){var i,s,u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),l=[],c=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var i=F(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var i=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return P(this.canvas,r)||setTimeout((function(){var t=o(s);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var r=t[0],u=r.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,r.width,r.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e({id:a.getId(i.canvas),property:n,args:t})}),0),t.apply(this,s)}}));l.push(i)}catch(r){var s=_(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:a.getId(this.canvas),property:n,args:[t],setter:!0})}});l.push(s)}};try{for(var d=n(u),p=d.next();!p.done;p=d.next())c(p.value)}catch(e){i={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}return function(){l.forEach((function(e){return e()}))}}(e.canvasMutationCb,l,e.blockClass,e.mirror):function(){},w=e.collectFonts?function(e,t){var n=t.defaultView;if(!n)return function(){};var r=[],o=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){var r=new a(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var i=F(t.fonts,"add",(function(t){return function(n){return setTimeout((function(){var t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}}));return r.push((function(){n.FontFace=a})),r.push(i),function(){r.forEach((function(e){return e()}))}}(e.fontCb,e.doc):function(){},T=[];try{for(var x=n(e.plugins),M=x.next();!M.done;M=x.next()){var E=M.value;T.push(E.observer(E.callback,l,E.options))}}catch(e){s={error:e}}finally{try{M&&!M.done&&(u=x.return)&&u.call(x)}finally{if(s)throw s.error}}return function(){m.disconnect(),f(),h(),y(),S(),g(),b(),k(),C(),I(),w(),T.forEach((function(e){return e()}))}}var de,pe,me=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}(),fe=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){re(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),ae(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();function he(e){return t(t({},e),{timestamp:Date.now()})}var ve={map:{},getId:function(e){return e&&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 ye(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,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,S=e.inlineStylesheet,g=void 0===S||S,b=e.maskAllInputs,k=e.maskInputOptions,C=e.slimDOMOptions,I=e.maskInputFn,w=e.maskTextFn,T=e.hooks,x=e.packFn,M=e.sampling,O=void 0===M?{}:M,R=e.mousemoveWait,D=e.recordCanvas,_=void 0!==D&&D,F=e.userTriggeredOnInput,P=void 0!==F&&F,z=e.collectFonts,j=void 0!==z&&z,V=e.plugins,B=e.keepIframeSrcFn,U=void 0===B?function(){return!1}:B;if(!n)throw new Error("emit function is required");void 0!==R&&void 0===O.mousemove&&(O.mousemove=R);var X,q,G=!0===b?{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!==k?k:{password:!0},Y=!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===X&&(X=window),"NodeList"in X&&!X.NodeList.prototype.forEach&&(X.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in X&&!X.DOMTokenList.prototype.forEach&&(X.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 K=0;de=function(e,t){var r;if(!(null===(r=J[0])||void 0===r?void 0:r.isFrozen())||e.type===h.FullSnapshot||e.type===h.IncrementalSnapshot&&e.data.source===v.Mutation||J.forEach((function(e){return e.unfreeze()})),n(x?x(e):e,t),e.type===h.FullSnapshot)q=e,K=0;else if(e.type===h.IncrementalSnapshot){if(e.data.source===v.Mutation&&e.data.isAttachIframe)return;K++;var i=a&&K>=a,s=o&&e.timestamp-q.timestamp>o;(i||s)&&pe(!0)}};var $=function(e){de(he({type:h.IncrementalSnapshot,data:t({source:v.Mutation},e)}))},Z=function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.Scroll},e)}))},Q=new me({mutationCb:$}),ee=new fe({mutationCb:$,scrollCb:Z,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:g,maskInputOptions:G,maskTextFn:w,maskInputFn:I,recordCanvas:_,sampling:O,slimDOMOptions:Y,iframeManager:Q},mirror:ve});pe=function(e){var t,n,o,a;void 0===e&&(e=!1),de(he({type:h.Meta,data:{href:window.location.href,width:A(),height:L()}}),e),J.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,m=n.recordCanvas,f=void 0!==m&&m,h=n.maskAllInputs,v=void 0!==h&&h,y=n.maskTextFn,S=n.maskInputFn,g=n.slimDOM,b=void 0!==g&&g,k=n.preserveWhiteSpace,C=n.onSerialize,I=n.onIframeLoad,w=n.iframeLoadTimeout,T=n.keepIframeSrcFn,x={};return[E(e,{doc:e,map:x,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,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,maskInputFn:S,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:f,preserveWhiteSpace:k,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:w,keepIframeSrcFn:void 0===T?function(){return!1}:T}),x]}(document,{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:g,maskAllInputs:G,maskTextFn:w,slimDOM:Y,recordCanvas:_,onSerialize:function(e){W(e)&&Q.addIframe(e),H(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){Q.attachIframe(e,t)},keepIframeSrcFn:U}),2),u=i[0],c=i[1];if(!u)return console.warn("Failed to snapshot the document");ve.map=c,de(he({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===(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}}})),J.forEach((function(e){return e.unlock()}))};try{var te=[];te.push(N("DOMContentLoaded",(function(){de(he({type:h.DomContentLoaded,data:{}}))})));var ne=function(e){return ce({mutationCb:$,mousemoveCb:function(e,t){return de(he({type:h.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.MouseInteraction},e)}))},scrollCb:Z,viewportResizeCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.ViewportResize},e)}))},inputCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.Input},e)}))},mediaInteractionCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.StyleDeclaration},e)}))},canvasMutationCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.CanvasMutation},e)}))},fontCb:function(e){return de(he({type:h.IncrementalSnapshot,data:t({source:v.Font},e)}))},blockClass:s,ignoreClass:d,maskTextClass:m,maskTextSelector:y,maskInputOptions:G,inlineStylesheet:g,sampling:O,recordCanvas:_,userTriggeredOnInput:P,collectFonts:j,doc:e,maskInputFn:I,maskTextFn:w,blockSelector:l,slimDOMOptions:Y,mirror:ve,iframeManager:Q,shadowDomManager:ee,plugins:(null==V?void 0:V.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return de(he({type:h.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},T)};Q.addLoadListener((function(e){te.push(ne(e.contentDocument))}));var re=function(){pe(),te.push(ne(document))};return"interactive"===document.readyState||"complete"===document.readyState?re():te.push(N("load",(function(){de(he({type:h.Load,data:{}})),re()}),window)),function(){te.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return ye.addCustomEvent=function(e,t){if(!de)throw new Error("please add custom event after start recording");de(he({type:h.Custom,data:{tag:e,payload:t}}))},ye.freezePage=function(){J.forEach((function(e){return e.freeze()}))},ye.takeFullSnapshot=function(e){if(!pe)throw new Error("please take full snapshot after start recording");pe(e)},ye.mirror=ve,ye}();
//# 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 i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);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 i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.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 r=1,n=1;function i(e){var t=e.match(/\n/g);t&&(r+=t.length);var i=e.lastIndexOf("\n");n=-1===i?n+e.length:e.length-i}function o(){var e={line:r,column:n};return function(t){return t.position=new a(e),v(),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 d(i){var o=new Error(t.source+":"+r+":"+n+": "+i);if(o.reason=i,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;l.push(o)}function f(){return m(/^{\s*/)}function h(){return m(/^}/)}function p(){var t,r=[];for(v(),y(r);e.length&&"}"!==e.charAt(0)&&(t=C()||D());)!1!==t&&(r.push(t),y(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return i(n),e=e.slice(n.length),r}}function v(){m(/^\s*/)}function y(e){var t;for(void 0===e&&(e=[]);t=g();)!1!==t&&e.push(t),t=g();return e}function g(){var t=o();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 d("End of comment missing");var a=e.slice(2,r-2);return n+=2,i(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function S(){var e=m(/^([^{]+)/);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 x(){var e=o(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=c(t[0]);if(!m(/^:\s*/))return d("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(s,""),value:n?c(n[0]).replace(s,""):""});return m(/^[;\s]*/),i}}function b(){var e,t=[];if(!f())return d("missing '{'");for(y(t);e=x();)!1!==e&&(t.push(e),y(t)),e=x();return h()?t:d("missing '}'")}function w(){for(var e,t=[],r=o();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:b()})}var T,E=I("import"),M=I("charset"),N=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=m(t);if(n){var i={type:e};return i[e]=n[1].trim(),r(i)}}}function C(){if("@"===e[0])return function(){var e=o(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return d("@keyframes missing name");var n,i=t[1];if(!f())return d("@keyframes missing '{'");for(var a=y();n=w();)a.push(n),a=a.concat(y());return h()?e({type:"keyframes",name:i,vendor:r,keyframes:a}):d("@keyframes missing '}'")}}()||function(){var e=o(),t=m(/^@media *([^{]+)/);if(t){var r=c(t[1]);if(!f())return d("@media missing '{'");var n=y().concat(p());return h()?e({type:"media",media:r,rules:n}):d("@media missing '}'")}}()||function(){var e=o(),t=m(/^@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=m(/^@supports *([^{]+)/);if(t){var r=c(t[1]);if(!f())return d("@supports missing '{'");var n=y().concat(p());return h()?e({type:"supports",supports:r,rules:n}):d("@supports missing '}'")}}()||E()||M()||N()||function(){var e=o(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=c(t[1]),n=c(t[2]);if(!f())return d("@document missing '{'");var i=y().concat(p());return h()?e({type:"document",document:n,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=o();if(m(/^@page */)){var t=S()||[];if(!f())return d("@page missing '{'");for(var r,n=y();r=x();)n.push(r),n=n.concat(y());return h()?e({type:"page",selectors:t,declarations:n}):d("@page missing '}'")}}()||function(){var e=o();if(m(/^@host\s*/)){if(!f())return d("@host missing '{'");var t=y().concat(p());return h()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=o();if(m(/^@font-face\s*/)){if(!f())return d("@font-face missing '{'");for(var t,r=y();t=x();)r.push(t),r=r.concat(y());return h()?e({type:"font-face",declarations:r}):d("@font-face missing '}'")}}()}function D(){var e=o(),t=S();return t?(y(),e({type:"rule",selectors:t,declarations:b()})):d("selector missing")}return u((T=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}function u(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,i=0,o=Object.keys(e);i<o.length;i++){var a=e[o[i]];Array.isArray(a)?a.forEach((function(e){u(e,n)})):a&&"object"==typeof a&&u(a,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var d={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/,h=new RegExp(f,"g");function p(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=l(e,{silent:!0});if(!n.stylesheet)return e;var i=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){f.test(e)&&i.push(e)}))})),0===i.length)return e;var o=new RegExp(i.filter((function(e,t){return i.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),a=e.replace(o,(function(e){var t=e.replace(h,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,a),a}function m(){return{stylesWithHoverClass:new Map}}function v(e,r){var n=r.doc,i=r.hackCss,o=r.cache;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 a,s=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);a=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var l=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if("option"===s&&"selected"===t&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===t){var l=document.createElement("img");l.src=r,l.onload=function(){var e=a.getContext("2d");e&&e.drawImage(l,0,0,l.width,l.height)}}if("rr_width"===t&&(a.style.width=r),"rr_height"===t&&(a.style.height=r),"rr_mediaCurrentTime"===t&&(a.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(r){case"played":a.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":a.pause()}}else{var c="textarea"===s&&"value"===t,u="style"===s&&"_cssText"===t;if(u&&i&&(r=p(r,o)),c||u){for(var d=n.createTextNode(r),f=0,h=Array.from(a.childNodes);f<h.length;f++){var m=h[f];m.nodeType===a.TEXT_NODE&&a.removeChild(m)}return a.appendChild(d),"continue"}try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,r);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,r);else{if("meta"===s&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return a.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===s&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||a.setAttribute(t,r)}}catch(e){}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case t.Text:return n.createTextNode(e.isStyle&&i?p(e.textContent,o):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function y(e,r){var n=r.doc,i=r.map,o=r.skipChild,s=void 0!==o&&o,l=r.hackCss,c=void 0===l||l,u=r.afterAppend,d=r.cache,f=v(e,{doc:n,hackCss:c,cache:d});if(!f)return null;if(e.rootId&&console.assert(i[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==t.DocumentType&&(e.childNodes[0].type===t.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=n),f.__sn=e,i[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var h=0,p=e.childNodes;h<p.length;h++){var m=p[h],g=y(m,{doc:n,map:i,skipChild:!1,hackCss:c,afterAppend:u,cache:d});g?(m.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(g):f.appendChild(g),u&&u(g)):console.warn("Failed to rebuild",m)}return f}function g(e,r){var n=r.doc,i=r.onVisit,o=r.hackCss,a={},s=y(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){i&&i(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var i in r.attributes)if(r.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=r.attributes[i];"rr_scrollLeft"===i&&(n.scrollLeft=o),"rr_scrollTop"===i&&(n.scrollTop=o)}}}(e)})),[s,a]}function S(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 x,b,w,T,E,M=Object.freeze({__proto__:null,default:S});function N(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,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},o=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])?p.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):p.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;p.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)}},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}):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))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=f(this),n=r.getBoundingClientRect(),o=this.getBoundingClientRect();r!==t.body?(p.call(this,r,r.scrollLeft+o.left-n.left,r.scrollTop+o.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.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,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function d(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function h(t){var r,n,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,r=.5*(1-Math.cos(Math.PI*a)),n=t.startX+(t.x-t.startX)*r,i=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,i),n===t.x&&i===t.y||e.requestAnimationFrame(h.bind(e,t))}function p(r,n,a){var l,c,u,d,f=o();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,d=s),h({scrollable:l,method:d,startTime:f,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",e[e.Plugin=6]="Plugin"}(x||(x={})),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",e[e.StyleDeclaration=13]="StyleDeclaration"}(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",e[e.TouchCancel=10]="TouchCancel"}(w||(w={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(T||(T={})),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"}(E||(E={}));var I,C=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 i=performance.now();for(r.timeOffset+=(i-e)*r.speed,e=i;t.length;){var o=t[0];if(!(r.timeOffset>=o.delay))break;t.shift(),o.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+1;r=n-1}}return t},e}();function D(e,t){if(e.type===x.IncrementalSnapshot&&e.data.source===b.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 i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);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 i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.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 r=1,n=1;function i(e){var t=e.match(/\n/g);t&&(r+=t.length);var i=e.lastIndexOf("\n");n=-1===i?n+e.length:e.length-i}function o(){var e={line:r,column:n};return function(t){return t.position=new a(e),v(),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 d(i){var o=new Error(t.source+":"+r+":"+n+": "+i);if(o.reason=i,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;l.push(o)}function f(){return m(/^{\s*/)}function h(){return m(/^}/)}function p(){var t,r=[];for(v(),y(r);e.length&&"}"!==e.charAt(0)&&(t=C()||D());)!1!==t&&(r.push(t),y(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return i(n),e=e.slice(n.length),r}}function v(){m(/^\s*/)}function y(e){var t;for(void 0===e&&(e=[]);t=g();)!1!==t&&e.push(t),t=g();return e}function g(){var t=o();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 d("End of comment missing");var a=e.slice(2,r-2);return n+=2,i(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function S(){var e=m(/^([^{]+)/);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=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=c(t[0]);if(!m(/^:\s*/))return d("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(s,""),value:n?c(n[0]).replace(s,""):""});return m(/^[;\s]*/),i}}function x(){var e,t=[];if(!f())return d("missing '{'");for(y(t);e=b();)!1!==e&&(t.push(e),y(t)),e=b();return h()?t:d("missing '}'")}function w(){for(var e,t=[],r=o();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:x()})}var T,E=I("import"),M=I("charset"),N=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=m(t);if(n){var i={type:e};return i[e]=n[1].trim(),r(i)}}}function C(){if("@"===e[0])return function(){var e=o(),t=m(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return d("@keyframes missing name");var n,i=t[1];if(!f())return d("@keyframes missing '{'");for(var a=y();n=w();)a.push(n),a=a.concat(y());return h()?e({type:"keyframes",name:i,vendor:r,keyframes:a}):d("@keyframes missing '}'")}}()||function(){var e=o(),t=m(/^@media *([^{]+)/);if(t){var r=c(t[1]);if(!f())return d("@media missing '{'");var n=y().concat(p());return h()?e({type:"media",media:r,rules:n}):d("@media missing '}'")}}()||function(){var e=o(),t=m(/^@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=m(/^@supports *([^{]+)/);if(t){var r=c(t[1]);if(!f())return d("@supports missing '{'");var n=y().concat(p());return h()?e({type:"supports",supports:r,rules:n}):d("@supports missing '}'")}}()||E()||M()||N()||function(){var e=o(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=c(t[1]),n=c(t[2]);if(!f())return d("@document missing '{'");var i=y().concat(p());return h()?e({type:"document",document:n,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=o();if(m(/^@page */)){var t=S()||[];if(!f())return d("@page missing '{'");for(var r,n=y();r=b();)n.push(r),n=n.concat(y());return h()?e({type:"page",selectors:t,declarations:n}):d("@page missing '}'")}}()||function(){var e=o();if(m(/^@host\s*/)){if(!f())return d("@host missing '{'");var t=y().concat(p());return h()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=o();if(m(/^@font-face\s*/)){if(!f())return d("@font-face missing '{'");for(var t,r=y();t=b();)r.push(t),r=r.concat(y());return h()?e({type:"font-face",declarations:r}):d("@font-face missing '}'")}}()}function D(){var e=o(),t=S();return t?(y(),e({type:"rule",selectors:t,declarations:x()})):d("selector missing")}return u((T=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}function u(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,i=0,o=Object.keys(e);i<o.length;i++){var a=e[o[i]];Array.isArray(a)?a.forEach((function(e){u(e,n)})):a&&"object"==typeof a&&u(a,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var d={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/,h=new RegExp(f.source,"g");function p(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=l(e,{silent:!0});if(!n.stylesheet)return e;var i=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){f.test(e)&&i.push(e)}))})),0===i.length)return e;var o=new RegExp(i.filter((function(e,t){return i.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),a=e.replace(o,(function(e){var t=e.replace(h,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,a),a}function m(){return{stylesWithHoverClass:new Map}}function v(e,r){var n=r.doc,i=r.hackCss,o=r.cache;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 a,s=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);a=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var l=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if("option"===s&&"selected"===t&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===t){var l=document.createElement("img");l.src=r,l.onload=function(){var e=a.getContext("2d");e&&e.drawImage(l,0,0,l.width,l.height)}}if("rr_width"===t&&(a.style.width=r),"rr_height"===t&&(a.style.height=r),"rr_mediaCurrentTime"===t&&(a.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(r){case"played":a.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":a.pause()}}else{var c="textarea"===s&&"value"===t,u="style"===s&&"_cssText"===t;if(u&&i&&(r=p(r,o)),c||u){for(var d=n.createTextNode(r),f=0,h=Array.from(a.childNodes);f<h.length;f++){var m=h[f];m.nodeType===a.TEXT_NODE&&a.removeChild(m)}return a.appendChild(d),"continue"}try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,r);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,r);else{if("meta"===s&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return a.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===s&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||a.setAttribute(t,r)}}catch(e){}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case t.Text:return n.createTextNode(e.isStyle&&i?p(e.textContent,o):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function y(e,r){var n=r.doc,i=r.map,o=r.skipChild,s=void 0!==o&&o,l=r.hackCss,c=void 0===l||l,u=r.afterAppend,d=r.cache,f=v(e,{doc:n,hackCss:c,cache:d});if(!f)return null;if(e.rootId&&console.assert(i[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==t.DocumentType&&(e.childNodes[0].type===t.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=n),f.__sn=e,i[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var h=0,p=e.childNodes;h<p.length;h++){var m=p[h],g=y(m,{doc:n,map:i,skipChild:!1,hackCss:c,afterAppend:u,cache:d});g?(m.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(g):f.appendChild(g),u&&u(g)):console.warn("Failed to rebuild",m)}return f}function g(e,r){var n=r.doc,i=r.onVisit,o=r.hackCss,a={},s=y(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){i&&i(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var i in r.attributes)if(r.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=r.attributes[i];"rr_scrollLeft"===i&&(n.scrollLeft=o),"rr_scrollTop"===i&&(n.scrollTop=o)}}}(e)})),[s,a]}function S(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 b,x,w,T,E,M=Object.freeze({__proto__:null,default:S});function N(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,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},o=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])?p.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):p.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;p.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)}},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}):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))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=f(this),n=r.getBoundingClientRect(),o=this.getBoundingClientRect();r!==t.body?(p.call(this,r,r.scrollLeft+o.left-n.left,r.scrollTop+o.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.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,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function d(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function h(t){var r,n,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,r=.5*(1-Math.cos(Math.PI*a)),n=t.startX+(t.x-t.startX)*r,i=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,i),n===t.x&&i===t.y||e.requestAnimationFrame(h.bind(e,t))}function p(r,n,a){var l,c,u,d,f=o();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,d=s),h({scrollable:l,method:d,startTime:f,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",e[e.Plugin=6]="Plugin"}(b||(b={})),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",e[e.StyleDeclaration=13]="StyleDeclaration"}(x||(x={})),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",e[e.TouchCancel=10]="TouchCancel"}(w||(w={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked"}(T||(T={})),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"}(E||(E={}));var I,C=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 i=performance.now();for(r.timeOffset+=(i-e)*r.speed,e=i;t.length;){var o=t[0];if(!(r.timeOffset>=o.delay))break;t.shift(),o.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+1;r=n-1}}return t},e}();function D(e,t){if(e.type===b.IncrementalSnapshot&&e.data.source===x.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.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function A(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(I||(I={}));var R={type:"xstate.init"};function k(e){return void 0===e?[]:[].concat(e)}function _(e){return{type:"xstate.assign",assignment:e}}function P(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 F(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:F(e)}}function B(e,t,r){var n=t,i=!1;return[e.filter((function(e){if("xstate.assign"===e.type){i=!0;var t=Object.assign({},n);return"function"==typeof e.assignment?t=e.assignment(n,r):Object.keys(e.assignment).forEach((function(i){t[i]="function"==typeof e.assignment[i]?e.assignment[i](n,r):e.assignment[i]})),n=t,!1}return!0})),n,i]}function j(e,t){void 0===t&&(t={});var r=A(B(k(e.states[e.initial].entry).map((function(e){return P(e,t.actions)})),e.context,R),2),n=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:F(e.initial)},transition:function(t,r){var n,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=k(u.on[c.type]);try{for(var f=function(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.")}(d),h=f.next();!h.done;h=f.next()){var p=h.value;if(void 0===p)return O(s,l);var m="string"==typeof p?{target:p}:p,v=m.target,y=m.actions,g=void 0===y?[]:y,S=m.cond,x=void 0===S?function(){return!0}:S,b=void 0===v,w=null!=v?v:s,T=e.states[w];if(x(l,c)){var E=A(B((b?k(g):[].concat(u.exit,g,T.entry).filter((function(e){return e}))).map((function(e){return P(e,o._options.actions)})),l,c),3),M=E[0],N=E[1],I=E[2],C=null!=v?v:s;return{value:C,context:N,actions:M,changed:v!==s||M.length>0||I,matches:F(C)}}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}return O(s,l)}};return o}var W=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function V(e){var t=e.initialState,r=I.NotStarted,n=new Set,i={_machine:e,send:function(i){r===I.Running&&(t=e.transition(t,i),W(t,L(i)),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 o="object"==typeof n?n:{context:e.config.context,value:n};t={value:o.value,actions:[],context:o.context,matches:F(o.value)}}return r=I.Running,W(t,R),i},stop:function(){return r=I.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}function U(e,t){var i=t.getCastFn,o=t.applyEventsSynchronously,a=t.emitter;return V(j({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:_({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:_((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,s,l,c,u=e.timer,d=e.events,f=e.baselineTime,h=e.lastPlayedEvent;u.clear();try{for(var p=n(d),m=p.next();!m.done;m=p.next()){D(m.value,f)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}var v=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.type===x.Meta&&n.timestamp<=t)return e.slice(r)}return e}(d,f),y=null==h?void 0:h.timestamp;(null==h?void 0:h.type)===x.IncrementalSnapshot&&h.data.source===b.MouseMove&&(y=h.timestamp+(null===(c=h.data.positions[0])||void 0===c?void 0:c.timeOffset)),f<(y||0)&&a.emit(E.PlayBack);var g=new Array,S=new Array,w=function(e){if(y&&y<f&&(e.timestamp<=y||e===h))return"continue";if(e.timestamp<f)g.push(e);else{var t=i(e,!1);S.push({doAction:function(){t(),a.emit(E.EventCast,e)},delay:e.delay})}};try{for(var T=n(v),M=T.next();!M.done;M=T.next()){w(M.value)}}catch(e){s={error:e}}finally{try{M&&!M.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}o(g),a.emit(E.Flush),u.addActions(S),u.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:_((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:_({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:_((function(e,t){var n=e.baselineTime,o=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;D(l,n);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 h=l.timestamp<n,p=i(l,h);h?p():o.isActive()&&o.addAction({doAction:function(){p(),a.emit(E.EventCast,l)},delay:l.delay})}return r(r({},e),{events:s})}))}}))}var Y="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.",z={map:{},getId:function(){return console.error(Y),-1},getNode:function(){return console.error(Y),null},removeNodeFromMap:function(){console.error(Y)},has:function(){return console.error(Y),!1},reset:function(){console.error(Y)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(z=new Proxy(z,{get:function(e,t,r){return"map"===t&&console.error(Y),Reflect.get(e,t,r)}}));var X=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),i=this.indexes.get(e.id),o=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&o(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 i=n.parent;i&&(delete n.parent,delete i.children[n.id],r.indexes.delete(e.id))}};i?n?(delete i.parent,delete n.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,r,i,o=this,a=this,s=a.tree,l=a.removeNodeMutations,c=a.textMutations,u=a.attributeMutations,d={source:b.Mutation,removes:l,texts:c,attributes:u,adds:[]},f=function(e,t){t&&o.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),d.attributes=d.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 f(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(s).forEach((function(e){return f(e,!1)}));try{for(var h=n(this.scrollMap.keys()),p=h.next();!p.done;p=h.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var v=n(this.inputMap.keys()),y=v.next();!y.done;y=v.next()){m=y.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}var g=new Map(this.scrollMap),S=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:g,inputMap:S}},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.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e}();function H(e){var t,r,i={},o=function(e,t){var r={value:e,parent:t,children:[]};return i[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,d=c.parentId;if(u&&u in i){var f=i[u];if(f.parent){var h=f.parent.children.indexOf(f);f.parent.children.splice(h,0,o(c,f.parent))}else{h=a.indexOf(f);a.splice(h,0,o(c,null))}}else if(d in i){var p=i[d];p.children.push(o(c,p))}else a.push(o(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 Q(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)Q(e.children[r],t)}function G(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function q(e,t){var r,n,i=null===(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===n?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=i.getBoundingClientRect(),a=q(i,t),s=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function $(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}var J;function K(e,t){var r=e[t[0]];return 1===t.length?r:K(r.cssRules[t[1]].cssRules,t.slice(2))}function Z(e){var t=o(e),r=t.pop();return{positions:t,index:r}}function ee(e,t){var r=t.sheet;r&&e.forEach((function(e){if(e.type===J.Insert)try{if(Array.isArray(e.index)){var n=Z(e.index),o=n.positions,a=n.index;K(r.cssRules,o).insertRule(e.cssText,a)}else r.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===J.Remove)try{if(Array.isArray(e.index)){var s=Z(e.index);o=s.positions,a=s.index;K(r.cssRules,o).deleteRule(a||0)}else r.deleteRule(e.index)}catch(e){}else if(e.type===J.Snapshot)!function(e,t){var r;try{var n=Array.from((null===(r=t.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText})),o=Object.entries(n).reverse(),a=n.length;o.forEach((function(r){var n,o=i(r,2),s=o[0],l=o[1],c=e.indexOf(l);if(-1===c||c>a)try{null===(n=t.sheet)||void 0===n||n.deleteRule(Number(s))}catch(e){}a=c})),e.forEach((function(e,r){var n,i,o;try{(null===(i=null===(n=t.sheet)||void 0===n?void 0:n.cssRules[r])||void 0===i?void 0:i.cssText)!==e&&(null===(o=t.sheet)||void 0===o||o.insertRule(e,r))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===J.SetProperty){K(r.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===J.RemoveProperty){K(r.cssRules,e.index).style.removeProperty(e.property)}}))}!function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"}(J||(J={}));var te=S||M,re="[replayer]",ne={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ie(e){return e.type==x.IncrementalSnapshot&&(e.data.source==b.TouchMove||e.data.source==b.MouseInteraction&&e.data.type==w.TouchStart)}var oe=function(){function e(e,t){var r=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=te(),this.legacy_missingNodeRetryMap={},this.cache=m(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&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.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(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:ne};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(E.Resize,this.handleResize),this.setupDom(),this.treeIndex=new X,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(E.Flush,(function(){var e,t,i,o,a,s,l=r.treeIndex.flush(),c=l.scrollMap,u=l.inputMap;r.fragmentParentMap.forEach((function(e,t){return r.restoreRealParent(t,e)}));try{for(var d=n(r.virtualStyleRulesMap.keys()),f=d.next();!f.done;f=d.next()){var h=f.value;r.restoreNodeSheet(h)}}catch(t){e={error:t}}finally{try{f&&!f.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}r.fragmentParentMap.clear(),r.elementStateMap.clear(),r.virtualStyleRulesMap.clear();try{for(var p=n(c.values()),m=p.next();!m.done;m=p.next()){var v=m.value;r.applyScroll(v)}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}try{for(var y=n(u.values()),g=y.next();!g.done;g=y.next()){v=g.value;r.applyInput(v)}}catch(e){a={error:e}}finally{try{g&&!g.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}})),this.emitter.on(E.PlayBack,(function(){r.firstFullSnapshot=null,r.mirror.reset()}));var o=new C([],(null==t?void 0:t.speed)||i.speed);this.service=U({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,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){r.emitter.emit(E.StateChange,{player:e})})),this.speedService=V(j({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:_({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(E.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===x.Meta})),s=this.service.state.context.events.find((function(e){return e.type===x.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){r.emitter.emit(E.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){r.firstFullSnapshot||(r.firstFullSnapshot=s,r.rebuildFullSnapshot(s),r.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(ie)&&this.mouse.classList.add("touch-device")}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(E.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(E.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(E.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;ie(r)&&this.mouse.classList.add("touch-device"),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.resetCache=function(){this.cache=m()},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&&(N(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 i=n([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&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.applyEventsSynchronously=function(e){var t,r;try{for(var i=n(e),o=i.next();!o.done;o=i.next()){var a=o.value;switch(a.type){case x.DomContentLoaded:case x.Load:case x.Custom:continue;case x.FullSnapshot:case x.Meta:case x.Plugin:break;case x.IncrementalSnapshot:switch(a.data.source){case b.MediaInteraction:continue}}this.getCastFn(a,!0)()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},e.prototype.getCastFn=function(e,t){var r,i=this;switch(void 0===t&&(t=!1),e.type){case x.DomContentLoaded:case x.Load:break;case x.Custom:r=function(){i.emitter.emit(E.CustomEvent,e)};break;case x.Meta:r=function(){return i.emitter.emit(E.Resize,{width:e.data.width,height:e.data.height})};break;case x.FullSnapshot:r=function(){if(i.firstFullSnapshot){if(i.firstFullSnapshot===e)return void(i.firstFullSnapshot=!0)}else i.firstFullSnapshot=!0;i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case x.IncrementalSnapshot:r=function(){var r,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=n(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){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.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(E.SkipStart,u)}}}}return function(){var o,a;r&&r();try{for(var s=n(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(E.Finish))};e.type===x.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 r,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=g(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)},cache:this.cache})[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,i=r.head;l.insertStyleRules(n,i)}},l=this;try{for(var c=n(a),u=c.next();!u.done;u=c.next()){var d=u.value;s(d.mutationInQueue,d.builtNode)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}var f=this.iframe.contentDocument,h=f.documentElement,p=f.head;this.insertStyleRules(h,p),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(E.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,i=(n=this.config.blockClass,["."+n+" { background: currentColor }","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++)r.sheet.insertRule(i[o],o)},e.prototype.attachDocumentToIframe=function(e,t){var r,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}y(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)},cache:this.cache});var u=function(e,t){if(d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,i=r.head;d.insertStyleRules(n,i)}},d=this;try{for(var f=n(a),h=f.next();!h.done;h=f.next()){var p=h.value;u(p.mutationInQueue,p.builtNode)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(G(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,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(E.Start,a),this.emitter.on(E.Pause,a);var s=function(){t.emitter.off(E.Start,a),t.emitter.off(E.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==n&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(E.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(E.LoadStylesheetStart),n=setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,r=this;this.service.state;var i=function(){r.service.state};this.emitter.on(E.Start,i),this.emitter.on(E.Pause,i);try{for(var o=n(this.service.state.context.events),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.type===x.IncrementalSnapshot&&s.data.source===b.CanvasMutation&&"drawImage"===s.data.property&&"string"==typeof s.data.args[0]&&!this.imageMap.has(s)){var l=document.createElement("canvas"),c=l.getContext("2d"),u=null==c?void 0:c.createImageData(l.width,l.height);null==u||u.data;JSON.parse(s.data.args[0]),null==c||c.putImageData(u,0,0)}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.applyIncremental=function(e,t){var n,i,o=this,a=e.data;switch(a.source){case b.Mutation:t&&(a.adds.forEach((function(e){return o.treeIndex.add(e)})),a.texts.forEach((function(e){return o.treeIndex.text(e)})),a.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),a.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)})));try{this.applyMutation(a,t)}catch(e){this.warn("Exception in mutation "+(e.message||e),a)}break;case b.Drag:case b.TouchMove:case b.MouseMove:if(t){var s=a.positions[a.positions.length-1];this.mousePos={x:s.x,y:s.y,id:s.id,debugData:a}}else a.positions.forEach((function(r){var n={doAction:function(){o.moveAndHover(r.x,r.y,r.id,t,a)},delay:r.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=a.positions[0])||void 0===n?void 0:n.timeOffset)});break;case b.MouseInteraction:if(-1===a.id)break;var l=new Event(w[a.type].toLowerCase());if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);this.emitter.emit(E.MouseInteraction,{type:a.type,target:S});var c=this.config.triggerFocus;switch(a.type){case w.Blur:"blur"in S&&S.blur();break;case w.Focus:c&&S.focus&&S.focus({preventScroll:!0});break;case w.Click:case w.TouchStart:case w.TouchEnd:t?(a.type===w.TouchStart?this.touchActive=!0:a.type===w.TouchEnd&&(this.touchActive=!1),this.mousePos={x:a.x,y:a.y,id:a.id,debugData:a}):(a.type===w.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x,a.y,a.id,t,a),a.type===w.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===w.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===w.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case w.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:S.dispatchEvent(l)}break;case b.Scroll:if(-1===a.id)break;if(t){this.treeIndex.scroll(a);break}this.applyScroll(a);break;case b.ViewportResize:this.emitter.emit(E.Resize,{width:a.width,height:a.height});break;case b.Input:if(-1===a.id)break;if(t){this.treeIndex.input(a);break}this.applyInput(a);break;case b.MediaInteraction:if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);var u=S;try{a.currentTime&&(u.currentTime=a.currentTime),1===a.type&&u.pause(),0===a.type&&u.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case b.StyleSheetRule:if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);var d,f=S,h=S.parentNode,p=this.fragmentParentMap.has(h),m=p?null:f.sheet;m||(this.virtualStyleRulesMap.has(S)?d=this.virtualStyleRulesMap.get(S):(d=[],this.virtualStyleRulesMap.set(S,d))),a.adds&&a.adds.forEach((function(e){var t=e.rule,r=e.index;if(m)try{if(Array.isArray(r)){var n=Z(r),i=n.positions,o=n.index;K(m.cssRules,i).insertRule(t,o)}else{o=void 0===r?void 0:Math.min(r,m.cssRules.length);m.insertRule(t,o)}}catch(e){}else null==d||d.push({cssText:t,index:r,type:J.Insert})})),a.removes&&a.removes.forEach((function(e){var t=e.index;if(p)null==d||d.push({index:t,type:J.Remove});else try{if(Array.isArray(t)){var r=Z(t),n=r.positions,i=r.index;K(m.cssRules,n).deleteRule(i||0)}else null==m||m.deleteRule(t)}catch(e){}}));break;case b.StyleDeclaration:if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);f=S;var v=S.parentNode,y=this.fragmentParentMap.has(v)?null:f.sheet,g=[];if(y||(this.virtualStyleRulesMap.has(S)?g=this.virtualStyleRulesMap.get(S):(g=[],this.virtualStyleRulesMap.set(S,g))),a.set)if(y)K(y.rules,a.index).style.setProperty(a.set.property,a.set.value,a.set.priority);else g.push(r({type:J.SetProperty,index:a.index},a.set));if(a.remove)if(y)K(y.rules,a.index).style.removeProperty(a.remove.property);else g.push(r({type:J.RemoveProperty,index:a.index},a.remove));break;case b.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var S;if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);try{var x=S.getContext("2d");if(a.setter)return void(x[a.property]=a.args[0]);var T=x[a.property];if("drawImage"===a.property&&"string"==typeof a.args[0]){var M=this.imageMap.get(e);a.args[0]=M,T.apply(x,a.args)}else T.apply(x,a.args)}catch(e){this.warnCanvasMutationFailed(a,a.id,e)}break;case b.Font:try{var N=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(N)}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 r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.parentId})))return;return s.warnNodeNotFound(e,t.id)}s.virtualStyleRulesMap.has(r)&&s.virtualStyleRulesMap.delete(r);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&$(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var i=null,o="__sn"in n?s.fragmentParentMap.get(n):void 0;o&&o.contains(r)?n=o:s.fragmentParentMap.has(r)&&(i=s.fragmentParentMap.get(r),s.fragmentParentMap.delete(r),r=i);try{n.removeChild(r)}catch(t){if(!(t instanceof DOMException))throw t;s.warn("parent could not remove child in mutation",n,o,r,i,e)}}}));var l=r({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var r,o,a,u;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var d=s.mirror.getNode(e.parentId);if(!d)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var f=null;s.iframe.contentDocument.contains?f=s.iframe.contentDocument.contains(d):s.iframe.contentDocument.body.contains&&(f=s.iframe.contentDocument.body.contains(d));var h=(null===(u=(a=d).getElementsByTagName)||void 0===u?void 0:u.call(a,"iframe").length)>0;if(i&&f&&!G(d)&&!h){var p=document.createDocumentFragment();for(s.mirror.map[e.parentId]=p,s.fragmentParentMap.set(p,d),s.storeState(d);d.firstChild;)p.appendChild(d.firstChild);d=p}e.node.isShadow&&$(d)&&(d=d.shadowRoot);var m=null,v=null;if(e.previousId&&(m=s.mirror.getNode(e.previousId)),e.nextId&&(v=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 g=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(G(d))s.attachDocumentToIframe(e,d);else{var S=y(e.node,{doc:g,map:s.mirror.map,skipChild:!0,hackCss:!0,cache:s.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in d&&d.__sn.type===t.Element&&"textarea"===d.__sn.tagName&&e.node.type===t.Text)try{for(var x=n(Array.from(d.childNodes)),b=x.next();!b.done;b=x.next()){var w=b.value;w.nodeType===d.TEXT_NODE&&d.removeChild(w)}}catch(e){r={error:e}}finally{try{b&&!b.done&&(o=x.return)&&o.call(x)}finally{if(r)throw r.error}}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(S,m.nextSibling);else if(v&&v.parentNode)d.contains(v)?d.insertBefore(S,v):d.insertBefore(S,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(S)}if(G(S)){var T=s.newDocumentQueue.find((function(e){return e.parentId===S.__sn.id}));if(T&&(s.attachDocumentToIframe(T,S),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==T}))),S.contentDocument){var E=S.contentDocument,M=E.documentElement,N=E.head;s.insertStyleRules(M,N)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,d,S,e)}else l[e.node.id]={node:S,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=H(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 h=(o=void 0,n(f)),p=h.next();!p.done;p=h.next()){var m=p.value;this.mirror.getNode(m.value.parentId)?Q(m,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.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){if(e.removes.find((function(e){return e.id===t.id})))return;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){if(e.removes.find((function(e){return e.id===t.id})))return;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 i=t.attributes[n];if(null===i)r.removeAttribute(n);else if("string"==typeof i)try{r.setAttribute(n,i)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===n){var o=i,a=r;for(var l in o)if(!1===o[l])a.style.removeProperty(l);else if(o[l]instanceof Array){var c=o[l];a.style.setProperty(l,c[0],c[1])}else{var u=o[l];a.style.setProperty(l,u)}}}}))},e.prototype.applyScroll=function(e){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else if(r.__sn.type===t.Document)r.defaultView.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{r.scrollTop=e.y,r.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 i=n.previousId,o=n.nextId,a=i&&e[i],s=o&&e[o];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 d=s;c=d.node,u=d.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,i){var o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(i,r);var a=q(o,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left=s+"px",this.mouse.style.top=l+"px",n||this.drawMouseTail({x:s,y:l}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?ne:Object.assign({},ne,this.config.mouseTail),n=r.lineCap,i=r.lineWidth,o=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=i,e.lineCap=n,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 r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},e.prototype.isUserInteraction=function(e){return e.type===x.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(E.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 i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]}),"STYLE"===i.tagName&&function(e,t){var r;try{var n=Array.from((null===(r=e.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:J.Snapshot,cssTexts:n}])}catch(e){}}(i,this.virtualStyleRulesMap);var o=i.children;try{for(var a=n(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&&(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 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=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.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&ee(t,e))},e.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '"+t+"' was previously removed. ",e):this.warn("Node with id '"+t+"' not found. ",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.treeIndex.idRemoved(t)?this.debug(re,"Node with id '"+t+"' was previously removed. ",e):this.debug(re,"Node with id '"+t+"' not found. ",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([re],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([re],e))},e}();return e.Replayer=oe,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */function A(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(I||(I={}));var R={type:"xstate.init"};function k(e){return void 0===e?[]:[].concat(e)}function _(e){return{type:"xstate.assign",assignment:e}}function P(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 F(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:F(e)}}function B(e,t,r){var n=t,i=!1;return[e.filter((function(e){if("xstate.assign"===e.type){i=!0;var t=Object.assign({},n);return"function"==typeof e.assignment?t=e.assignment(n,r):Object.keys(e.assignment).forEach((function(i){t[i]="function"==typeof e.assignment[i]?e.assignment[i](n,r):e.assignment[i]})),n=t,!1}return!0})),n,i]}function j(e,t){void 0===t&&(t={});var r=A(B(k(e.states[e.initial].entry).map((function(e){return P(e,t.actions)})),e.context,R),2),n=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:F(e.initial)},transition:function(t,r){var n,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=k(u.on[c.type]);try{for(var f=function(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.")}(d),h=f.next();!h.done;h=f.next()){var p=h.value;if(void 0===p)return O(s,l);var m="string"==typeof p?{target:p}:p,v=m.target,y=m.actions,g=void 0===y?[]:y,S=m.cond,b=void 0===S?function(){return!0}:S,x=void 0===v,w=null!=v?v:s,T=e.states[w];if(b(l,c)){var E=A(B((x?k(g):[].concat(u.exit,g,T.entry).filter((function(e){return e}))).map((function(e){return P(e,o._options.actions)})),l,c),3),M=E[0],N=E[1],I=E[2],C=null!=v?v:s;return{value:C,context:N,actions:M,changed:v!==s||M.length>0||I,matches:F(C)}}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}return O(s,l)}};return o}var W=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function V(e){var t=e.initialState,r=I.NotStarted,n=new Set,i={_machine:e,send:function(i){r===I.Running&&(t=e.transition(t,i),W(t,L(i)),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 o="object"==typeof n?n:{context:e.config.context,value:n};t={value:o.value,actions:[],context:o.context,matches:F(o.value)}}return r=I.Running,W(t,R),i},stop:function(){return r=I.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}function U(e,t){var i=t.getCastFn,o=t.applyEventsSynchronously,a=t.emitter;return V(j({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:_({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:_((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,s,l,c,u=e.timer,d=e.events,f=e.baselineTime,h=e.lastPlayedEvent;u.clear();try{for(var p=n(d),m=p.next();!m.done;m=p.next()){D(m.value,f)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}var v=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.type===b.Meta&&n.timestamp<=t)return e.slice(r)}return e}(d,f),y=null==h?void 0:h.timestamp;(null==h?void 0:h.type)===b.IncrementalSnapshot&&h.data.source===x.MouseMove&&(y=h.timestamp+(null===(c=h.data.positions[0])||void 0===c?void 0:c.timeOffset)),f<(y||0)&&a.emit(E.PlayBack);var g=new Array,S=new Array,w=function(e){if(y&&y<f&&(e.timestamp<=y||e===h))return"continue";if(e.timestamp<f)g.push(e);else{var t=i(e,!1);S.push({doAction:function(){t(),a.emit(E.EventCast,e)},delay:e.delay})}};try{for(var T=n(v),M=T.next();!M.done;M=T.next()){w(M.value)}}catch(e){s={error:e}}finally{try{M&&!M.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}o(g),a.emit(E.Flush),u.addActions(S),u.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:_((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:_({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:_((function(e,t){var n=e.baselineTime,o=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;D(l,n);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 h=l.timestamp<n,p=i(l,h);h?p():o.isActive()&&o.addAction({doAction:function(){p(),a.emit(E.EventCast,l)},delay:l.delay})}return r(r({},e),{events:s})}))}}))}var Y="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.",z={map:{},getId:function(){return console.error(Y),-1},getNode:function(){return console.error(Y),null},removeNodeFromMap:function(){console.error(Y)},has:function(){return console.error(Y),!1},reset:function(){console.error(Y)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(z=new Proxy(z,{get:function(e,t,r){return"map"===t&&console.error(Y),Reflect.get(e,t,r)}}));var X=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),i=this.indexes.get(e.id),o=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&o(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 i=n.parent;i&&(delete n.parent,delete i.children[n.id],r.indexes.delete(e.id))}};i?n?(delete i.parent,delete n.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,r,i,o=this,a=this,s=a.tree,l=a.removeNodeMutations,c=a.textMutations,u=a.attributeMutations,d={source:x.Mutation,removes:l,texts:c,attributes:u,adds:[]},f=function(e,t){t&&o.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),d.attributes=d.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 f(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(s).forEach((function(e){return f(e,!1)}));try{for(var h=n(this.scrollMap.keys()),p=h.next();!p.done;p=h.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var v=n(this.inputMap.keys()),y=v.next();!y.done;y=v.next()){m=y.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}var g=new Map(this.scrollMap),S=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:g,inputMap:S}},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.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e}();function H(e){var t,r,i={},o=function(e,t){var r={value:e,parent:t,children:[]};return i[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,d=c.parentId;if(u&&u in i){var f=i[u];if(f.parent){var h=f.parent.children.indexOf(f);f.parent.children.splice(h,0,o(c,f.parent))}else{h=a.indexOf(f);a.splice(h,0,o(c,null))}}else if(d in i){var p=i[d];p.children.push(o(c,p))}else a.push(o(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 Q(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)Q(e.children[r],t)}function G(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function q(e,t){var r,n,i=null===(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===n?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=i.getBoundingClientRect(),a=q(i,t),s=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function $(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}var J;function K(e,t){var r=e[t[0]];return 1===t.length?r:K(r.cssRules[t[1]].cssRules,t.slice(2))}function Z(e){var t=o(e),r=t.pop();return{positions:t,index:r}}function ee(e,t){var r=t.sheet;r&&e.forEach((function(e){if(e.type===J.Insert)try{if(Array.isArray(e.index)){var n=Z(e.index),o=n.positions,a=n.index;K(r.cssRules,o).insertRule(e.cssText,a)}else r.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===J.Remove)try{if(Array.isArray(e.index)){var s=Z(e.index);o=s.positions,a=s.index;K(r.cssRules,o).deleteRule(a||0)}else r.deleteRule(e.index)}catch(e){}else if(e.type===J.Snapshot)!function(e,t){var r;try{var n=Array.from((null===(r=t.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText})),o=Object.entries(n).reverse(),a=n.length;o.forEach((function(r){var n,o=i(r,2),s=o[0],l=o[1],c=e.indexOf(l);if(-1===c||c>a)try{null===(n=t.sheet)||void 0===n||n.deleteRule(Number(s))}catch(e){}a=c})),e.forEach((function(e,r){var n,i,o;try{(null===(i=null===(n=t.sheet)||void 0===n?void 0:n.cssRules[r])||void 0===i?void 0:i.cssText)!==e&&(null===(o=t.sheet)||void 0===o||o.insertRule(e,r))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===J.SetProperty){K(r.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===J.RemoveProperty){K(r.cssRules,e.index).style.removeProperty(e.property)}}))}!function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"}(J||(J={}));var te=S||M,re="[replayer]",ne={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ie(e){return e.type==b.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==w.TouchStart)}var oe=function(){function e(e,t){var r=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=te(),this.legacy_missingNodeRetryMap={},this.cache=m(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&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.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(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:ne};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(E.Resize,this.handleResize),this.setupDom(),this.treeIndex=new X,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(E.Flush,(function(){var e,t,i,o,a,s,l=r.treeIndex.flush(),c=l.scrollMap,u=l.inputMap;r.fragmentParentMap.forEach((function(e,t){return r.restoreRealParent(t,e)}));try{for(var d=n(r.virtualStyleRulesMap.keys()),f=d.next();!f.done;f=d.next()){var h=f.value;r.restoreNodeSheet(h)}}catch(t){e={error:t}}finally{try{f&&!f.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}r.fragmentParentMap.clear(),r.elementStateMap.clear(),r.virtualStyleRulesMap.clear();try{for(var p=n(c.values()),m=p.next();!m.done;m=p.next()){var v=m.value;r.applyScroll(v)}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}try{for(var y=n(u.values()),g=y.next();!g.done;g=y.next()){v=g.value;r.applyInput(v)}}catch(e){a={error:e}}finally{try{g&&!g.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}})),this.emitter.on(E.PlayBack,(function(){r.firstFullSnapshot=null,r.mirror.reset()}));var o=new C([],(null==t?void 0:t.speed)||i.speed);this.service=U({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,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){r.emitter.emit(E.StateChange,{player:e})})),this.speedService=V(j({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:_({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(E.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===b.Meta})),s=this.service.state.context.events.find((function(e){return e.type===b.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){r.emitter.emit(E.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){r.firstFullSnapshot||(r.firstFullSnapshot=s,r.rebuildFullSnapshot(s),r.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(ie)&&this.mouse.classList.add("touch-device")}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(E.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(E.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(E.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;ie(r)&&this.mouse.classList.add("touch-device"),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.resetCache=function(){this.cache=m()},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&&(N(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 i=n([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&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.applyEventsSynchronously=function(e){var t,r;try{for(var i=n(e),o=i.next();!o.done;o=i.next()){var a=o.value;switch(a.type){case b.DomContentLoaded:case b.Load:case b.Custom:continue;case b.FullSnapshot:case b.Meta:case b.Plugin:break;case b.IncrementalSnapshot:switch(a.data.source){case x.MediaInteraction:continue}}this.getCastFn(a,!0)()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},e.prototype.getCastFn=function(e,t){var r,i=this;switch(void 0===t&&(t=!1),e.type){case b.DomContentLoaded:case b.Load:break;case b.Custom:r=function(){i.emitter.emit(E.CustomEvent,e)};break;case b.Meta:r=function(){return i.emitter.emit(E.Resize,{width:e.data.width,height:e.data.height})};break;case b.FullSnapshot:r=function(){if(i.firstFullSnapshot){if(i.firstFullSnapshot===e)return void(i.firstFullSnapshot=!0)}else i.firstFullSnapshot=!0;i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case b.IncrementalSnapshot:r=function(){var r,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=n(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){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.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(E.SkipStart,u)}}}}return function(){var o,a;r&&r();try{for(var s=n(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(E.Finish))};e.type===b.IncrementalSnapshot&&e.data.source===x.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,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=g(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)},cache:this.cache})[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,i=r.head;l.insertStyleRules(n,i)}},l=this;try{for(var c=n(a),u=c.next();!u.done;u=c.next()){var d=u.value;s(d.mutationInQueue,d.builtNode)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}var f=this.iframe.contentDocument,h=f.documentElement,p=f.head;this.insertStyleRules(h,p),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(E.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,i=(n=this.config.blockClass,["."+n+" { background: currentColor }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }");for(var o=0;o<i.length;o++)r.sheet.insertRule(i[o],o)},e.prototype.attachDocumentToIframe=function(e,t){var r,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}y(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){o.collectIframeAndAttachDocument(a,e)},cache:this.cache});var u=function(e,t){if(d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,i=r.head;d.insertStyleRules(n,i)}},d=this;try{for(var f=n(a),h=f.next();!h.done;h=f.next()){var p=h.value;u(p.mutationInQueue,p.builtNode)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(G(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,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(E.Start,a),this.emitter.on(E.Pause,a);var s=function(){t.emitter.off(E.Start,a),t.emitter.off(E.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==n&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(E.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(E.LoadStylesheetStart),n=setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,r=this;this.service.state;var i=function(){r.service.state};this.emitter.on(E.Start,i),this.emitter.on(E.Pause,i);try{for(var o=n(this.service.state.context.events),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.type===b.IncrementalSnapshot&&s.data.source===x.CanvasMutation&&"drawImage"===s.data.property&&"string"==typeof s.data.args[0]&&!this.imageMap.has(s)){var l=document.createElement("canvas"),c=l.getContext("2d"),u=null==c?void 0:c.createImageData(l.width,l.height);null==u||u.data;JSON.parse(s.data.args[0]),null==c||c.putImageData(u,0,0)}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.applyIncremental=function(e,t){var n,i,o=this,a=e.data;switch(a.source){case x.Mutation:t&&(a.adds.forEach((function(e){return o.treeIndex.add(e)})),a.texts.forEach((function(e){return o.treeIndex.text(e)})),a.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),a.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)})));try{this.applyMutation(a,t)}catch(e){this.warn("Exception in mutation "+(e.message||e),a)}break;case x.Drag:case x.TouchMove:case x.MouseMove:if(t){var s=a.positions[a.positions.length-1];this.mousePos={x:s.x,y:s.y,id:s.id,debugData:a}}else a.positions.forEach((function(r){var n={doAction:function(){o.moveAndHover(r.x,r.y,r.id,t,a)},delay:r.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=a.positions[0])||void 0===n?void 0:n.timeOffset)});break;case x.MouseInteraction:if(-1===a.id)break;var l=new Event(w[a.type].toLowerCase());if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);this.emitter.emit(E.MouseInteraction,{type:a.type,target:S});var c=this.config.triggerFocus;switch(a.type){case w.Blur:"blur"in S&&S.blur();break;case w.Focus:c&&S.focus&&S.focus({preventScroll:!0});break;case w.Click:case w.TouchStart:case w.TouchEnd:t?(a.type===w.TouchStart?this.touchActive=!0:a.type===w.TouchEnd&&(this.touchActive=!1),this.mousePos={x:a.x,y:a.y,id:a.id,debugData:a}):(a.type===w.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x,a.y,a.id,t,a),a.type===w.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===w.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===w.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case w.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:S.dispatchEvent(l)}break;case x.Scroll:if(-1===a.id)break;if(t){this.treeIndex.scroll(a);break}this.applyScroll(a);break;case x.ViewportResize:this.emitter.emit(E.Resize,{width:a.width,height:a.height});break;case x.Input:if(-1===a.id)break;if(t){this.treeIndex.input(a);break}this.applyInput(a);break;case x.MediaInteraction:if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);var u=S;try{a.currentTime&&(u.currentTime=a.currentTime),1===a.type&&u.pause(),0===a.type&&u.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case x.StyleSheetRule:if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);var d,f=S,h=S.parentNode,p=this.fragmentParentMap.has(h),m=p?null:f.sheet;m||(this.virtualStyleRulesMap.has(S)?d=this.virtualStyleRulesMap.get(S):(d=[],this.virtualStyleRulesMap.set(S,d))),a.adds&&a.adds.forEach((function(e){var t=e.rule,r=e.index;if(m)try{if(Array.isArray(r)){var n=Z(r),i=n.positions,o=n.index;K(m.cssRules,i).insertRule(t,o)}else{o=void 0===r?void 0:Math.min(r,m.cssRules.length);m.insertRule(t,o)}}catch(e){}else null==d||d.push({cssText:t,index:r,type:J.Insert})})),a.removes&&a.removes.forEach((function(e){var t=e.index;if(p)null==d||d.push({index:t,type:J.Remove});else try{if(Array.isArray(t)){var r=Z(t),n=r.positions,i=r.index;K(m.cssRules,n).deleteRule(i||0)}else null==m||m.deleteRule(t)}catch(e){}}));break;case x.StyleDeclaration:if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);f=S;var v=S.parentNode,y=this.fragmentParentMap.has(v)?null:f.sheet,g=[];if(y||(this.virtualStyleRulesMap.has(S)?g=this.virtualStyleRulesMap.get(S):(g=[],this.virtualStyleRulesMap.set(S,g))),a.set)if(y)K(y.rules,a.index).style.setProperty(a.set.property,a.set.value,a.set.priority);else g.push(r({type:J.SetProperty,index:a.index},a.set));if(a.remove)if(y)K(y.rules,a.index).style.removeProperty(a.remove.property);else g.push(r({type:J.RemoveProperty,index:a.index},a.remove));break;case x.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var S;if(!(S=this.mirror.getNode(a.id)))return this.debugNodeNotFound(a,a.id);try{var b=S.getContext("2d");if(a.setter)return void(b[a.property]=a.args[0]);var T=b[a.property];if("drawImage"===a.property&&"string"==typeof a.args[0]){var M=this.imageMap.get(e);a.args[0]=M,T.apply(b,a.args)}else T.apply(b,a.args)}catch(e){this.warnCanvasMutationFailed(a,a.id,e)}break;case x.Font:try{var N=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(N)}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 r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.parentId})))return;return s.warnNodeNotFound(e,t.id)}s.virtualStyleRulesMap.has(r)&&s.virtualStyleRulesMap.delete(r);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&$(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var i=null,o="__sn"in n?s.fragmentParentMap.get(n):void 0;o&&o.contains(r)?n=o:s.fragmentParentMap.has(r)&&(i=s.fragmentParentMap.get(r),s.fragmentParentMap.delete(r),r=i);try{n.removeChild(r)}catch(t){if(!(t instanceof DOMException))throw t;s.warn("parent could not remove child in mutation",n,o,r,i,e)}}}));var l=r({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var r,o,a,u;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var d=s.mirror.getNode(e.parentId);if(!d)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var f=null;s.iframe.contentDocument.contains?f=s.iframe.contentDocument.contains(d):s.iframe.contentDocument.body.contains&&(f=s.iframe.contentDocument.body.contains(d));var h=(null===(u=(a=d).getElementsByTagName)||void 0===u?void 0:u.call(a,"iframe").length)>0;if(i&&f&&!G(d)&&!h){var p=document.createDocumentFragment();for(s.mirror.map[e.parentId]=p,s.fragmentParentMap.set(p,d),s.storeState(d);d.firstChild;)p.appendChild(d.firstChild);d=p}e.node.isShadow&&$(d)&&(d=d.shadowRoot);var m=null,v=null;if(e.previousId&&(m=s.mirror.getNode(e.previousId)),e.nextId&&(v=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 g=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(G(d))s.attachDocumentToIframe(e,d);else{var S=y(e.node,{doc:g,map:s.mirror.map,skipChild:!0,hackCss:!0,cache:s.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in d&&d.__sn.type===t.Element&&"textarea"===d.__sn.tagName&&e.node.type===t.Text)try{for(var b=n(Array.from(d.childNodes)),x=b.next();!x.done;x=b.next()){var w=x.value;w.nodeType===d.TEXT_NODE&&d.removeChild(w)}}catch(e){r={error:e}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(r)throw r.error}}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(S,m.nextSibling);else if(v&&v.parentNode)d.contains(v)?d.insertBefore(S,v):d.insertBefore(S,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(S)}if(G(S)){var T=s.newDocumentQueue.find((function(e){return e.parentId===S.__sn.id}));if(T&&(s.attachDocumentToIframe(T,S),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==T}))),S.contentDocument){var E=S.contentDocument,M=E.documentElement,N=E.head;s.insertStyleRules(M,N)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,d,S,e)}else l[e.node.id]={node:S,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=H(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 h=(o=void 0,n(f)),p=h.next();!p.done;p=h.next()){var m=p.value;this.mirror.getNode(m.value.parentId)?Q(m,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.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){if(e.removes.find((function(e){return e.id===t.id})))return;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){if(e.removes.find((function(e){return e.id===t.id})))return;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 i=t.attributes[n];if(null===i)r.removeAttribute(n);else if("string"==typeof i)try{r.setAttribute(n,i)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===n){var o=i,a=r;for(var l in o)if(!1===o[l])a.style.removeProperty(l);else if(o[l]instanceof Array){var c=o[l];a.style.setProperty(l,c[0],c[1])}else{var u=o[l];a.style.setProperty(l,u)}}}}))},e.prototype.applyScroll=function(e){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else if(r.__sn.type===t.Document)r.defaultView.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{r.scrollTop=e.y,r.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 i=n.previousId,o=n.nextId,a=i&&e[i],s=o&&e[o];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 d=s;c=d.node,u=d.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,i){var o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(i,r);var a=q(o,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left=s+"px",this.mouse.style.top=l+"px",n||this.drawMouseTail({x:s,y:l}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?ne:Object.assign({},ne,this.config.mouseTail),n=r.lineCap,i=r.lineWidth,o=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=i,e.lineCap=n,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 r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},e.prototype.isUserInteraction=function(e){return e.type===b.IncrementalSnapshot&&(e.data.source>x.Mutation&&e.data.source<=x.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(E.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 i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]}),"STYLE"===i.tagName&&function(e,t){var r;try{var n=Array.from((null===(r=e.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:J.Snapshot,cssTexts:n}])}catch(e){}}(i,this.virtualStyleRulesMap);var o=i.children;try{for(var a=n(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&&(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 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=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.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&ee(t,e))},e.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '"+t+"' was previously removed. ",e):this.warn("Node with id '"+t+"' not found. ",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.treeIndex.idRemoved(t)?this.debug(re,"Node with id '"+t+"' was previously removed. ",e):this.debug(re,"Node with id '"+t+"' not found. ",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([re],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([re],e))},e}();return e.Replayer=oe,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-replay.min.js.map

@@ -35,3 +35,3 @@ var NodeType;

var _id = 1;
var tagNameRegex = RegExp('[^a-z0-9-_:]');
var tagNameRegex = new RegExp('[^a-z0-9-_:]');
var IGNORED_NODE = -2;

@@ -214,2 +214,5 @@ function genId() {

}
else if (tagName === 'object' && name === 'data' && value) {
return absoluteToDoc(doc, value);
}
else {

@@ -1256,3 +1259,3 @@ return value;

var HOVER_SELECTOR = /([^\\]):hover/;
var HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR, 'g');
var HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');
function addHoverClass(cssText, cache) {

@@ -1259,0 +1262,0 @@ var cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);

@@ -30,2 +30,5 @@ var StackFrame = (function () {

parse: function (error) {
if (!error) {
return [];
}
if (typeof error.stacktrace !== 'undefined' ||

@@ -32,0 +35,0 @@ typeof error['opera#sourceloc'] !== 'undefined') {

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

var e_1, _a;
var _this = this;
var loggerType = logOptions.logger;

@@ -50,9 +49,6 @@ if (!loggerType) {

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 errorHandler_1 = function (event) {
var message = event.message, error = event.error;
var trace = ErrorStackParser.parse(error).map(function (stackFrame) { return stackFrame.toString(); });
var payload = [stringify(msg, logOptions.stringifyOptions)];
var payload = [stringify(message, logOptions.stringifyOptions)];
cb({

@@ -64,4 +60,6 @@ level: 'error',

};
window.addEventListener('error', errorHandler_1);
cancelHandlers.push(function () {
window.onerror = originalOnError_1;
if (window)
window.removeEventListener('error', errorHandler_1);
});

@@ -68,0 +66,0 @@ }

@@ -355,4 +355,3 @@ import { __values } from '../../../../ext/tslib/tslib.es6.js';

var pname = _f.value;
if (target.style.getPropertyValue(pname) === '' ||
!target.style.getPropertyValue(pname)) {
if (target.style.getPropertyValue(pname) === '') {
styleObj[pname] = false;

@@ -359,0 +358,0 @@ }

@@ -223,2 +223,5 @@ 'use strict';

parse: function (error) {
if (!error) {
return [];
}
if (typeof error.stacktrace !== 'undefined' ||

@@ -530,3 +533,2 @@ typeof error['opera#sourceloc'] !== 'undefined') {

var e_1, _a;
var _this = this;
var loggerType = logOptions.logger;

@@ -547,9 +549,6 @@ if (!loggerType) {

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 errorHandler_1 = function (event) {
var message = event.message, error = event.error;
var trace = ErrorStackParser.parse(error).map(function (stackFrame) { return stackFrame.toString(); });
var payload = [stringify(msg, logOptions.stringifyOptions)];
var payload = [stringify(message, logOptions.stringifyOptions)];
cb({

@@ -561,4 +560,6 @@ level: 'error',

};
window.addEventListener('error', errorHandler_1);
cancelHandlers.push(function () {
window.onerror = originalOnError_1;
if (window)
window.removeEventListener('error', errorHandler_1);
});

@@ -565,0 +566,0 @@ }

{
"name": "rrweb",
"version": "1.0.7",
"version": "1.0.8",
"description": "record and replay the web",

@@ -78,5 +78,5 @@ "scripts": {

"mitt": "^1.1.3",
"rrweb-snapshot": "^1.1.10"
"rrweb-snapshot": "^1.1.11"
},
"gitHead": "7223e929a3b73ae96402fac26b44d9c7bf536804"
"gitHead": "bdbd2041031fbd48a72be0416e41ac46da54740f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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 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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc