Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
4
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.9 to 0.7.10

typings/index.d.ts

83

dist/record/rrweb-record.js

@@ -116,4 +116,3 @@ var rrwebRecord = (function () {

}
var BLOCK_CLASS = 'rr-block';
function serializeNode(n, doc) {
function serializeNode(n, doc, blockClass) {
switch (n.nodeType) {

@@ -133,3 +132,3 @@ case n.DOCUMENT_NODE:

case n.ELEMENT_NODE:
var needBlock = n.classList.contains(BLOCK_CLASS);
var needBlock = n.classList.contains(blockClass);
var tagName = n.tagName.toLowerCase();

@@ -155,7 +154,16 @@ var attributes_1 = {};

if (cssText) {
attributes_1 = {
_cssText: absoluteToStylesheet(cssText, stylesheet.href)
};
delete attributes_1.rel;
delete attributes_1.href;
attributes_1._cssText = absoluteToStylesheet(cssText, stylesheet.href);
}
}
if (tagName === 'style' &&
n.sheet &&
!n.innerText.trim().length) {
var cssText = getCssRulesString(n
.sheet);
if (cssText) {
attributes_1._cssText = absoluteToStylesheet(cssText, location.href);
}
}
if (tagName === 'input' ||

@@ -222,5 +230,5 @@ tagName === 'textarea' ||

}
function serializeNodeWithId(n, doc, map, skipChild) {
function serializeNodeWithId(n, doc, map, blockClass, skipChild) {
if (skipChild === void 0) { skipChild = false; }
var _serializedNode = serializeNode(n, doc);
var _serializedNode = serializeNode(n, doc, blockClass);
if (!_serializedNode) {

@@ -245,3 +253,3 @@ console.warn(n, 'not serialized');

var childN = _a[_i];
var serializedChildNode = serializeNodeWithId(childN, doc, map);
var serializedChildNode = serializeNodeWithId(childN, doc, map, blockClass);
if (serializedChildNode) {

@@ -254,6 +262,7 @@ serializedNode.childNodes.push(serializedChildNode);

}
function snapshot(n) {
function snapshot(n, blockClass) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
resetId();
var idNodeMap = {};
return [serializeNodeWithId(n, n, idNodeMap), idNodeMap];
return [serializeNodeWithId(n, n, idNodeMap, blockClass), idNodeMap];
}

@@ -345,4 +354,3 @@

}
var BLOCK_CLASS$1 = 'rr-block';
function isBlocked(node) {
function isBlocked(node, blockClass) {
if (!node) {

@@ -352,6 +360,6 @@ return false;

if (node.nodeType === node.ELEMENT_NODE) {
return (node.classList.contains(BLOCK_CLASS$1) ||
isBlocked(node.parentNode));
return (node.classList.contains(blockClass) ||
isBlocked(node.parentNode, blockClass));
}
return isBlocked(node.parentNode);
return isBlocked(node.parentNode, blockClass);
}

@@ -443,3 +451,3 @@ function isAncestorRemoved(target) {

function initMutationObserver(cb) {
function initMutationObserver(cb, blockClass) {
var observer = new MutationObserver(function (mutations) {

@@ -453,3 +461,3 @@ var texts = [];

var genAdds = function (n) {
if (isBlocked(n)) {
if (isBlocked(n, blockClass)) {
return;

@@ -466,3 +474,3 @@ }

var value = target.textContent;
if (!isBlocked(target) && value !== oldValue) {
if (!isBlocked(target, blockClass) && value !== oldValue) {
texts.push({

@@ -477,3 +485,3 @@ value: value,

var value = target.getAttribute(attributeName);
if (isBlocked(target) || value === oldValue) {
if (isBlocked(target, blockClass) || value === oldValue) {
return;

@@ -497,3 +505,3 @@ }

var parentId = mirror.getId(target);
if (isBlocked(n)) {
if (isBlocked(n, blockClass)) {
return;

@@ -531,3 +539,3 @@ }

: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, true)
node: serializeNodeWithId(n, document, mirror.map, blockClass, true)
});

@@ -602,7 +610,7 @@ }

}
function initMouseInteractionObserver(cb) {
function initMouseInteractionObserver(cb, blockClass) {
var handlers = [];
var getHandler = function (eventKey) {
return function (event) {
if (isBlocked(event.target)) {
if (isBlocked(event.target, blockClass)) {
return;

@@ -631,5 +639,5 @@ }

}
function initScrollObserver(cb) {
function initScrollObserver(cb, blockClass) {
var updatePosition = throttle(function (evt) {
if (!evt.target || isBlocked(evt.target)) {
if (!evt.target || isBlocked(evt.target, blockClass)) {
return;

@@ -674,5 +682,4 @@ }

];
var IGNORE_CLASS = 'rr-ignore';
var lastInputValueMap = new WeakMap();
function initInputObserver(cb) {
function initInputObserver(cb, blockClass, ignoreClass) {
function eventHandler(event) {

@@ -683,3 +690,3 @@ var target = event.target;

INPUT_TAGS.indexOf(target.tagName) < 0 ||
isBlocked(target)) {
isBlocked(target, blockClass)) {
return;

@@ -689,3 +696,3 @@ }

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

@@ -742,8 +749,8 @@ }

function initObservers(o) {
var mutationObserver = initMutationObserver(o.mutationCb);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass);
var mousemoveHandler = initMousemoveObserver(o.mousemoveCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb);
var scrollHandler = initScrollObserver(o.scrollCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass);
return function () {

@@ -764,3 +771,3 @@ mutationObserver.disconnect();

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b;
if (!emit) {

@@ -797,3 +804,3 @@ throw new Error('emit function is required');

}), isCheckout);
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
var _a = snapshot(document, blockClass), node = _a[0], idNodeMap = _a[1];
if (!node) {

@@ -863,3 +870,5 @@ return console.warn('Failed to snapshot the document');

}));
}
},
blockClass: blockClass,
ignoreClass: ignoreClass
}));

@@ -866,0 +875,0 @@ };

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

var rrwebRecord=function(){"use strict";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(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 n=1;var r=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function i(e,t){return e.replace(r,function(e,n,r,i){var u,c=n||r||i;if(!c)return e;if(!o.test(c))return"url('"+c+"')";if(a.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+c)+"')";var s=t.split("/"),d=c.split("/");s.pop();for(var l=0,p=d;l<p.length;l++){var f=p[l];"."!==f&&(".."===f?s.pop():s.push(f))}return"url('"+s.join("/")+"')"})}function u(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function s(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var r=t.classList.contains(c),o=t.tagName.toLowerCase(),a={},s=0,d=Array.from(t.attributes);s<d.length;s++){var l=d[s],p=l.name,f=l.value;a[p]="src"===p||"href"===p?u(n,f):"style"===p?i(f,location.href):f}if("link"===o){var m=Array.from(n.styleSheets).find(function(e){return e.href===t.href}),h=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(m);h&&(a={_cssText:i(h,m.href)})}if("input"===o||"textarea"===o||"select"===o){f=t.value;"radio"!==a.type&&"checkbox"!==a.type&&f?a.value=f:t.checked&&(a.checked=t.checked)}if("option"===o){var v=t.parentElement;a.value===v.value&&(a.selected=t.selected)}if(r){var y=t.getBoundingClientRect(),g=y.width,E=y.height;a.rr_width=g+"px",a.rr_height=E+"px"}return{type:e.Element,tagName:o,attributes:a,childNodes:[],isSVG:(C=t,"svg"===C.tagName||C instanceof SVGElement||void 0),needBlock:r};case t.TEXT_NODE:var b=t.parentNode&&t.parentNode.tagName,w=t.textContent,N="STYLE"===b||void 0;return N&&w&&(w=i(w,location.href)),"SCRIPT"===b&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:N};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var C}function d(t,r,o,a){void 0===a&&(a=!1);var i=s(t,r);if(!i)return console.warn(t,"not serialized"),null;var u=Object.assign(i,{id:n++});t.__sn=u,o[u.id]=t;var c=!a;if(u.type===e.Element&&(c=c&&!u.needBlock,delete u.needBlock),(u.type===e.Document||u.type===e.Element)&&c)for(var l=0,p=Array.from(t.childNodes);l<p.length;l++){var f=d(p[l],r,o);f&&u.childNodes.push(f)}return u}function l(e){n=1;var t={};return[d(e,e,t),t]}function p(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)}}var f={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return f.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete f.map[t],e.childNodes&&e.childNodes.forEach(function(e){return f.removeNodeFromMap(e)})},has:function(e){return f.map.hasOwnProperty(e)}};function m(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var a=Date.now();o||!1!==n.leading||(o=a);var i=t-(a-o),u=this,c=arguments;i<=0||i>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)},i))}}function h(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function v(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var y,g,E,b,w="rr-block";function N(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(w)||N(e.parentNode))}function C(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],a=[],i=new Set,u=new Set,c=function(e){N(e)||(i.add(e),u.delete(e),e.childNodes.forEach(function(e){return c(e)}))};t.forEach(function(e){var t=e.type,a=e.target,s=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=a.textContent;N(a)||m===s||n.push({value:m,node:a});break;case"attributes":m=a.getAttribute(p);if(N(a)||m===s)return;var h=r.find(function(e){return e.node===a});h||(h={node:a,attributes:{}},r.push(h)),h.attributes[p]=m;break;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){var t=f.getId(e),n=f.getId(a);N(e)||(i.has(e)?(!function e(t,n){t.delete(n),n.childNodes.forEach(function(n){return e(t,n)})}(i,e),u.add(e)):i.has(a)&&-1===t||function e(t){var n=f.getId(t);return!f.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(a)||o.push({parentId:n,id:t}),f.removeNodeFromMap(e))})}}),Array.from(i).forEach(function(e){(function e(t,n){var r=n.parentNode;return!!r&&(!!t.has(r)||e(t,r))})(u,e)||function e(t,n){var r=n.parentNode;if(!r)return!1;var o=f.getId(r);return!!t.some(function(e){return e.id===o})||e(t,r)}(o,e)?u.add(e):a.push({parentId:f.getId(e.parentNode),previousId:e.previousSibling?f.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?f.getId(e.nextSibling):e.nextSibling,node:d(e,document,f.map,!0)})});var s={texts:n.map(function(e){return{id:f.getId(e.node),value:e.value}}).filter(function(e){return f.has(e.id)}),attributes:r.map(function(e){return{id:f.getId(e.node),attributes:e.attributes}}).filter(function(e){return f.has(e.id)}),removes:o,adds:a};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&e(s)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function T(e){var t=[];return Object.keys(E).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!N(n.target)){var r=f.getId(n.target),o=n.clientX,a=n.clientY;e({type:E[t],id:r,x:o,y:a})}}}(n);t.push(p(r,o))}),function(){t.forEach(function(e){return e()})}}!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"}(y||(y={})),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"}(g||(g={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(E||(E={})),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"}(b||(b={}));var I=["INPUT","TEXTAREA","SELECT"],S=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],D="rr-ignore",M=new WeakMap;function x(e){function n(e){var t=e.target;if(t&&t.tagName&&!(I.indexOf(t.tagName)<0)&&!N(t)){var n=t.type;if("password"!==n&&!t.classList.contains(D)){var o=t.value,a=!1;"radio"!==n&&"checkbox"!==n||(a=t.checked),r(t,{text:o,isChecked:a});var i=t.name;"radio"===n&&i&&a&&document.querySelectorAll('input[type="radio"][name="'+i+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!a})})}}}function r(n,r){var o=M.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){M.set(n,r);var a=f.getId(n);e(t({},r,{id:a}))}}var o=["input","change"].map(function(e){return p(e,n)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return a&&a.set&&o.push.apply(o,S.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){n({target:this})}})})),function(){o.forEach(function(e){return e()})}}function O(e){var t,n,r,o,a=C(e.mutationCb),i=(t=e.mousemoveCb,r=[],o=m(function(){var e=Date.now()-n;t(r.map(function(t){return t.timeOffset-=e,t})),r=[],n=null},500),p("mousemove",m(function(e){var t=e.clientX,a=e.clientY,i=e.target;n||(n=Date.now()),r.push({x:t,y:a,id:f.getId(i),timeOffset:Date.now()-n}),o()},50,{trailing:!1}))),u=T(e.mouseInteractionCb),c=function(e){return p("scroll",m(function(t){if(t.target&&!N(t.target)){var n=f.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),s=function(e){return p("resize",m(function(){var t=h(),n=v();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),d=x(e.inputCb);return function(){a.disconnect(),i(),u(),c(),s(),d()}}function L(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n,r=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth;if(!r)throw new Error("emit function is required");var i=0,u=function(e,t){if(r(e,t),e.type===y.FullSnapshot)n=e,i=0;else if(e.type===y.IncrementalSnapshot){i++;var u=a&&i>=a,s=o&&e.timestamp-n.timestamp>o;(u||s)&&c(!0)}};function c(e){void 0===e&&(e=!1),u(L({type:y.Meta,data:{href:window.location.href,width:v(),height:h()}}),e);var t=l(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");f.map=r,u(L({type:y.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var s=[];s.push(p("DOMContentLoaded",function(){u(L({type:y.DomContentLoaded,data:{}}))}));var d=function(){c(),s.push(O({mutationCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.Mutation},e)}))},mousemoveCb:function(e){return u(L({type:y.IncrementalSnapshot,data:{source:g.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.MouseInteraction},e)}))},scrollCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.Scroll},e)}))},viewportResizeCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.ViewportResize},e)}))},inputCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?d():s.push(p("load",function(){u(L({type:y.Load,data:{}})),d()},window)),function(){s.forEach(function(e){return e()})}}catch(e){console.warn(e)}}}();
var rrwebRecord=function(){"use strict";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(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 n=1;function r(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}var o=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,i=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function u(e,t){return e.replace(o,function(e,n,r,o){var u,c=n||r||o;if(!c)return e;if(!a.test(c))return"url('"+c+"')";if(i.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+c)+"')";var s=t.split("/"),l=c.split("/");s.pop();for(var d=0,f=l;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?s.pop():s.push(p))}return"url('"+s.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}function s(t,n,o){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var a=t.classList.contains(o),i=t.tagName.toLowerCase(),s={},l=0,d=Array.from(t.attributes);l<d.length;l++){var f=d[l],p=f.name,m=f.value;s[p]="src"===p||"href"===p?c(n,m):"style"===p?u(m,location.href):m}if("link"===i){var h,v=Array.from(n.styleSheets).find(function(e){return e.href===t.href});(h=r(v))&&(delete s.rel,delete s.href,s._cssText=u(h,v.href))}if("style"===i&&t.sheet&&!t.innerText.trim().length)(h=r(t.sheet))&&(s._cssText=u(h,location.href));if("input"===i||"textarea"===i||"select"===i){m=t.value;"radio"!==s.type&&"checkbox"!==s.type&&m?s.value=m:t.checked&&(s.checked=t.checked)}if("option"===i){var y=t.parentElement;s.value===y.value&&(s.selected=t.selected)}if(a){var g=t.getBoundingClientRect(),E=g.width,b=g.height;s.rr_width=E+"px",s.rr_height=b+"px"}return{type:e.Element,tagName:i,attributes:s,childNodes:[],isSVG:(T=t,"svg"===T.tagName||T instanceof SVGElement||void 0),needBlock:a};case t.TEXT_NODE:var C=t.parentNode&&t.parentNode.tagName,w=t.textContent,N="STYLE"===C||void 0;return N&&w&&(w=u(w,location.href)),"SCRIPT"===C&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:N};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var T}function l(t,r,o,a,i){void 0===i&&(i=!1);var u=s(t,r,a);if(!u)return console.warn(t,"not serialized"),null;var c=Object.assign(u,{id:n++});t.__sn=c,o[c.id]=t;var d=!i;if(c.type===e.Element&&(d=d&&!c.needBlock,delete c.needBlock),(c.type===e.Document||c.type===e.Element)&&d)for(var f=0,p=Array.from(t.childNodes);f<p.length;f++){var m=l(p[f],r,o,a);m&&c.childNodes.push(m)}return c}function d(e,t){void 0===t&&(t="rr-block"),n=1;var r={};return[l(e,e,r,t),r]}function f(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)}}var p,m,h,v,y={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return y.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete y.map[t],e.childNodes&&e.childNodes.forEach(function(e){return y.removeNodeFromMap(e)})},has:function(e){return y.map.hasOwnProperty(e)}};function g(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var a=Date.now();o||!1!==n.leading||(o=a);var i=t-(a-o),u=this,c=arguments;i<=0||i>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)},i))}}function E(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function b(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function C(e,t){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(t)||C(e.parentNode,t))}function w(e,t){var n=new MutationObserver(function(n){var r=[],o=[],a=[],i=[],u=new Set,c=new Set,s=function(e){C(e,t)||(u.add(e),c.delete(e),e.childNodes.forEach(function(e){return s(e)}))};n.forEach(function(e){var n=e.type,i=e.target,l=e.oldValue,d=e.addedNodes,f=e.removedNodes,p=e.attributeName;switch(n){case"characterData":var m=i.textContent;C(i,t)||m===l||r.push({value:m,node:i});break;case"attributes":m=i.getAttribute(p);if(C(i,t)||m===l)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[p]=m;break;case"childList":d.forEach(function(e){return s(e)}),f.forEach(function(e){var n=y.getId(e),r=y.getId(i);C(e,t)||(u.has(e)?(!function e(t,n){t.delete(n),n.childNodes.forEach(function(n){return e(t,n)})}(u,e),c.add(e)):u.has(i)&&-1===n||function e(t){var n=y.getId(t);return!y.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(i)||a.push({parentId:r,id:n}),y.removeNodeFromMap(e))})}}),Array.from(u).forEach(function(e){(function e(t,n){var r=n.parentNode;return!!r&&(!!t.has(r)||e(t,r))})(c,e)||function e(t,n){var r=n.parentNode;if(!r)return!1;var o=y.getId(r);return!!t.some(function(e){return e.id===o})||e(t,r)}(a,e)?c.add(e):i.push({parentId:y.getId(e.parentNode),previousId:e.previousSibling?y.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?y.getId(e.nextSibling):e.nextSibling,node:l(e,document,y.map,t,!0)})});var d={texts:r.map(function(e){return{id:y.getId(e.node),value:e.value}}).filter(function(e){return y.has(e.id)}),attributes:o.map(function(e){return{id:y.getId(e.node),attributes:e.attributes}}).filter(function(e){return y.has(e.id)}),removes:a,adds:i};(d.texts.length||d.attributes.length||d.removes.length||d.adds.length)&&e(d)});return n.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function N(e,t){var n=[];return Object.keys(h).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),a=function(n){return function(r){if(!C(r.target,t)){var o=y.getId(r.target),a=r.clientX,i=r.clientY;e({type:h[n],id:o,x:a,y:i})}}}(r);n.push(f(o,a))}),function(){n.forEach(function(e){return e()})}}!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"}(p||(p={})),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"}(m||(m={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(h||(h={})),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"}(v||(v={}));var T=["INPUT","TEXTAREA","SELECT"],I=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],S=new WeakMap;function D(e,n,r){function o(e){var t=e.target;if(t&&t.tagName&&!(T.indexOf(t.tagName)<0)&&!C(t,n)){var o=t.type;if("password"!==o&&!t.classList.contains(r)){var i=t.value,u=!1;"radio"!==o&&"checkbox"!==o||(u=t.checked),a(t,{text:i,isChecked:u});var c=t.name;"radio"===o&&c&&u&&document.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach(function(e){e!==t&&a(e,{text:e.value,isChecked:!u})})}}}function a(n,r){var o=S.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){S.set(n,r);var a=y.getId(n);e(t({},r,{id:a}))}}var i=["input","change"].map(function(e){return f(e,o)}),u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return u&&u.set&&i.push.apply(i,I.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){o({target:this})}})})),function(){i.forEach(function(e){return e()})}}function M(e){var t,n,r,o,a=w(e.mutationCb,e.blockClass),i=(t=e.mousemoveCb,r=[],o=g(function(){var e=Date.now()-n;t(r.map(function(t){return t.timeOffset-=e,t})),r=[],n=null},500),f("mousemove",g(function(e){var t=e.clientX,a=e.clientY,i=e.target;n||(n=Date.now()),r.push({x:t,y:a,id:y.getId(i),timeOffset:Date.now()-n}),o()},50,{trailing:!1}))),u=N(e.mouseInteractionCb,e.blockClass),c=function(e,t){return f("scroll",g(function(n){if(n.target&&!C(n.target,t)){var r=y.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}(e.scrollCb,e.blockClass),s=function(e){return f("resize",g(function(){var t=E(),n=b();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),l=D(e.inputCb,e.blockClass,e.ignoreClass);return function(){a.disconnect(),i(),u(),c(),s(),l()}}function k(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n,r=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,c=e.ignoreClass,s=void 0===c?"rr-ignore":c;if(!r)throw new Error("emit function is required");var l=0,h=function(e,t){if(r(e,t),e.type===p.FullSnapshot)n=e,l=0;else if(e.type===p.IncrementalSnapshot){l++;var i=a&&l>=a,u=o&&e.timestamp-n.timestamp>o;(i||u)&&v(!0)}};function v(e){void 0===e&&(e=!1),h(k({type:p.Meta,data:{href:window.location.href,width:b(),height:E()}}),e);var t=d(document,u),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");y.map=r,h(k({type:p.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var g=[];g.push(f("DOMContentLoaded",function(){h(k({type:p.DomContentLoaded,data:{}}))}));var C=function(){v(),g.push(M({mutationCb:function(e){return h(k({type:p.IncrementalSnapshot,data:t({source:m.Mutation},e)}))},mousemoveCb:function(e){return h(k({type:p.IncrementalSnapshot,data:{source:m.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return h(k({type:p.IncrementalSnapshot,data:t({source:m.MouseInteraction},e)}))},scrollCb:function(e){return h(k({type:p.IncrementalSnapshot,data:t({source:m.Scroll},e)}))},viewportResizeCb:function(e){return h(k({type:p.IncrementalSnapshot,data:t({source:m.ViewportResize},e)}))},inputCb:function(e){return h(k({type:p.IncrementalSnapshot,data:t({source:m.Input},e)}))},blockClass:u,ignoreClass:s}))};return"interactive"===document.readyState||"complete"===document.readyState?C():g.push(f("load",function(){h(k({type:p.Load,data:{}})),C()},window)),function(){g.forEach(function(e){return e()})}}catch(e){console.warn(e)}}}();
//# sourceMappingURL=rrweb-record.min.js.map

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

var rrweb=function(e){"use strict";var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(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 o=1;var r=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,i=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function s(e,t){return e.replace(r,function(e,n,o,r){var s,l=n||o||r;if(!l)return e;if(!i.test(l))return"url('"+l+"')";if(a.test(l))return"url("+l+")";if("/"===l[0])return"url('"+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+"')";var c=t.split("/"),u=l.split("/");c.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?c.pop():c.push(p))}return"url('"+c.join("/")+"')"})}function l(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var o=e.classList.contains(c),r=e.tagName.toLowerCase(),i={},a=0,u=Array.from(e.attributes);a<u.length;a++){var d=u[a],f=d.name,p=d.value;i[f]="src"===f||"href"===f?l(n,p):"style"===f?s(p,location.href):p}if("link"===r){var h=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),m=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(h);m&&(i={_cssText:s(m,h.href)})}if("input"===r||"textarea"===r||"select"===r){p=e.value;"radio"!==i.type&&"checkbox"!==i.type&&p?i.value=p:e.checked&&(i.checked=e.checked)}if("option"===r){var v=e.parentElement;i.value===v.value&&(i.selected=e.selected)}if(o){var y=e.getBoundingClientRect(),g=y.width,b=y.height;i.rr_width=g+"px",i.rr_height=b+"px"}return{type:t.Element,tagName:r,attributes:i,childNodes:[],isSVG:(T=e,"svg"===T.tagName||T instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,N=e.textContent,E="STYLE"===w||void 0;return E&&N&&(N=s(N,location.href)),"SCRIPT"===w&&(N="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:N||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var T}function d(e,n,r,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:o++});e.__sn=s,r[s.id]=e;var l=!i;if(s.type===t.Element&&(l=l&&!s.needBlock,delete s.needBlock),(s.type===t.Document||s.type===t.Element)&&l)for(var c=0,f=Array.from(e.childNodes);c<f.length;c++){var p=d(f[c],n,r);p&&s.childNodes.push(p)}return s}function f(e){o=1;var t={};return[d(e,e,t),t]}var p={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 h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function v(e){return e.replace(h,function(e,t,n){if(m.test(t)){var o=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function y(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,l="style"===o&&"_cssText"===i;if(l&&(a=v(a)),s||l){var c=n.createTextNode(a);r.appendChild(c);continue}if("iframe"===o&&"src"===i)continue;try{r.setAttribute(i,a)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case t.Text:return n.createTextNode(e.isStyle?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,o,r){void 0===r&&(r=!1);var i=y(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var l=s[a],c=g(l,n,o);c?i.appendChild(c):console.warn("Failed to rebuild",l)}return i}function b(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var w={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return w.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete w.map[t],e.childNodes&&e.childNodes.forEach(function(e){return w.removeNodeFromMap(e)})},has:function(e){return w.map.hasOwnProperty(e)}};function N(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)},a))}}function E(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function T(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var S,I,x,C,M="rr-block";function D(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(M)||D(e.parentNode))}function k(e){var t=new MutationObserver(function(t){var n=[],o=[],r=[],i=[],a=new Set,s=new Set,l=function(e){D(e)||(a.add(e),s.delete(e),e.childNodes.forEach(function(e){return l(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,f=e.attributeName;switch(t){case"characterData":var p=i.textContent;D(i)||p===c||n.push({value:p,node:i});break;case"attributes":p=i.getAttribute(f);if(D(i)||p===c)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[f]=p;break;case"childList":u.forEach(function(e){return l(e)}),d.forEach(function(e){var t=w.getId(e),n=w.getId(i);D(e)||(a.has(e)?(!function e(t,n){t.delete(n),n.childNodes.forEach(function(n){return e(t,n)})}(a,e),s.add(e)):a.has(i)&&-1===t||function e(t){var n=w.getId(t);return!w.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(i)||r.push({parentId:n,id:t}),w.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){(function e(t,n){var o=n.parentNode;return!!o&&(!!t.has(o)||e(t,o))})(s,e)||function e(t,n){var o=n.parentNode;if(!o)return!1;var r=w.getId(o);return!!t.some(function(e){return e.id===r})||e(t,o)}(r,e)?s.add(e):i.push({parentId:w.getId(e.parentNode),previousId:e.previousSibling?w.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?w.getId(e.nextSibling):e.nextSibling,node:d(e,document,w.map,!0)})});var c={texts:n.map(function(e){return{id:w.getId(e.node),value:e.value}}).filter(function(e){return w.has(e.id)}),attributes:o.map(function(e){return{id:w.getId(e.node),attributes:e.attributes}}).filter(function(e){return w.has(e.id)}),removes:r,adds:i};(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&e(c)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function O(e){var t=[];return Object.keys(x).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){if(!D(n.target)){var o=w.getId(n.target),r=n.clientX,i=n.clientY;e({type:x[t],id:o,x:r,y:i})}}}(n);t.push(b(o,r))}),function(){t.forEach(function(e){return e()})}}!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"}(S||(S={})),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"}(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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(x||(x={})),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"}(C||(C={}));var L=["INPUT","TEXTAREA","SELECT"],A=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],F="rr-ignore",R=new WeakMap;function _(e){function t(e){var t=e.target;if(t&&t.tagName&&!(L.indexOf(t.tagName)<0)&&!D(t)){var n=t.type;if("password"!==n&&!t.classList.contains(F)){var r=t.value,i=!1;"radio"!==n&&"checkbox"!==n||(i=t.checked),o(t,{text:r,isChecked:i});var a=t.name;"radio"===n&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&o(e,{text:e.value,isChecked:!i})})}}}function o(t,o){var r=R.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){R.set(t,o);var i=w.getId(t);e(n({},o,{id:i}))}}var r=["input","change"].map(function(e){return b(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&r.push.apply(r,A.map(function(e){return function e(t,n,o){var r=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){o.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return e(t,n,r||{})}}(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function B(e){var t,n,o,r,i=k(e.mutationCb),a=(t=e.mousemoveCb,o=[],r=N(function(){var e=Date.now()-n;t(o.map(function(t){return t.timeOffset-=e,t})),o=[],n=null},500),b("mousemove",N(function(e){var t=e.clientX,i=e.clientY,a=e.target;n||(n=Date.now()),o.push({x:t,y:i,id:w.getId(a),timeOffset:Date.now()-n}),r()},50,{trailing:!1}))),s=O(e.mouseInteractionCb),l=function(e){return b("scroll",N(function(t){if(t.target&&!D(t.target)){var n=w.getId(t.target);if(t.target===document){var o=document.scrollingElement||document.documentElement;e({id:n,x:o.scrollLeft,y:o.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),c=function(e){return b("resize",N(function(){var t=E(),n=T();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),u=_(e.inputCb);return function(){i.disconnect(),a(),s(),l(),c(),u()}}function j(e){return n({},e,{timestamp:Date.now()})}function z(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var P=Object.freeze({default:z});var X,Y=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):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]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");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)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):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))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===f(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,o,r){var s,c,u,d,f=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),p({scrollable:s,method:d,startTime:f,startX:c,startY:u,x:o,y:r})}}}}()}(X={exports:{}},X.exports),X.exports).polyfill,H=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),V=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];Y();var U=z||P,W=function(){function e(e,t){if(this.events=[],this.emitter=U(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1};this.config=Object.assign({},n,t),this.timer=new H(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(C.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(C.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n];if(!(r.timestamp<=this.lastPlayedEvent.timestamp||r===this.lastPlayedEvent)){var i=this.getCastFn(r);t.push({doAction:i,delay:this.getDelay(r)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(C.Resume)},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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===S.IncrementalSnapshot&&e.data.source===I.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case S.DomContentLoaded:case S.Load:break;case S.Meta:n=function(){return o.emitter.emit(C.Resize,{width:e.data.width,height:e.data.height})};break;case S.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case S.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/5e3),360)};o.setConfig(s),o.emitter.emit(C.SkipStart,s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(C.Finish))}},e.prototype.rebuildFullSnapshot=function(e){var t,n,o;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},w.map=(t=e.data.node,n=this.iframe.contentDocument,o={},[g(t,n,o),o])[1];var r=document.createElement("style"),i=this.iframe.contentDocument,a=i.documentElement,s=i.head;a.insertBefore(r,s);for(var l=0;l<V.length;l++)r.sheet.insertRule(V[l],l);this.emitter.emit(C.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(C.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(),e.emitter.emit(C.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case I.Mutation:r.removes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);var n=w.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);w.removeNodeFromMap(t),n&&n.removeChild(t)});var i=n({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=g(e.node,o.iframe.contentDocument,w.map,!0),n=w.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=w.getNode(e.previousId)),e.nextId&&(s=w.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?n.insertBefore(t,a.nextSibling):s&&s.parentNode?n.insertBefore(t,s):n.appendChild(t),(e.previousId||e.nextId)&&o.resolveMissingNode(i,n,t,e)):i[e.node.id]={node:t,mutation:e}}),Object.keys(i).length&&Object.assign(this.missingNodeRetryMap,i),r.texts.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);for(var n in e.attributes)if("string"==typeof n){var i=e.attributes[n];i?t.setAttribute(n,i):t.removeAttribute(n)}});break;case I.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case I.MouseInteraction:if(-1===r.id)break;var a=new Event(x[r.type].toLowerCase());if(!(s=w.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(r.type){case x.Blur:s.blur&&s.blur();break;case x.Focus:s.focus&&s.focus({preventScroll:!0});break;case x.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case I.Scroll:if(-1===r.id)break;if(!(s=w.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(s===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{s.scrollTop=r.y,s.scrollLeft=r.x}catch(e){}break;case I.ViewportResize:this.emitter.emit(C.Resize,{width:r.width,height:r.height});break;case I.Input:if(-1===r.id)break;var s;if(!(s=w.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{s.checked=r.isChecked,s.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=w.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===S.IncrementalSnapshot&&(e.data.source>I.Mutation&&e.data.source<=I.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(C.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},e}();return e.record=function(e){void 0===e&&(e={});var t,o=e.emit,r=e.checkoutEveryNms,i=e.checkoutEveryNth;if(!o)throw new Error("emit function is required");var a=0,s=function(e,n){if(o(e,n),e.type===S.FullSnapshot)t=e,a=0;else if(e.type===S.IncrementalSnapshot){a++;var s=i&&a>=i,c=r&&e.timestamp-t.timestamp>r;(s||c)&&l(!0)}};function l(e){void 0===e&&(e=!1),s(j({type:S.Meta,data:{href:window.location.href,width:T(),height:E()}}),e);var t=f(document),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");w.map=o,s(j({type:S.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var c=[];c.push(b("DOMContentLoaded",function(){s(j({type:S.DomContentLoaded,data:{}}))}));var u=function(){l(),c.push(B({mutationCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.Mutation},e)}))},mousemoveCb:function(e){return s(j({type:S.IncrementalSnapshot,data:{source:I.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.MouseInteraction},e)}))},scrollCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.Scroll},e)}))},viewportResizeCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.ViewportResize},e)}))},inputCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?u():c.push(b("load",function(){s(j({type:S.Load,data:{}})),u()},window)),function(){c.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=W,e.mirror=w,e}({});
var rrweb=function(e){"use strict";var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(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 o=1;function r(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}var i=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,s=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function l(e,t){return e.replace(i,function(e,n,o,r){var i,l=n||o||r;if(!l)return e;if(!a.test(l))return"url('"+l+"')";if(s.test(l))return"url("+l+")";if("/"===l[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+l)+"')";var c=t.split("/"),u=l.split("/");c.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?c.pop():c.push(p))}return"url('"+c.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}function u(e,n,o){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var i=e.classList.contains(o),a=e.tagName.toLowerCase(),s={},u=0,d=Array.from(e.attributes);u<d.length;u++){var f=d[u],p=f.name,h=f.value;s[p]="src"===p||"href"===p?c(n,h):"style"===p?l(h,location.href):h}if("link"===a){var m,v=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(m=r(v))&&(delete s.rel,delete s.href,s._cssText=l(m,v.href))}if("style"===a&&e.sheet&&!e.innerText.trim().length)(m=r(e.sheet))&&(s._cssText=l(m,location.href));if("input"===a||"textarea"===a||"select"===a){h=e.value;"radio"!==s.type&&"checkbox"!==s.type&&h?s.value=h:e.checked&&(s.checked=e.checked)}if("option"===a){var y=e.parentElement;s.value===y.value&&(s.selected=e.selected)}if(i){var g=e.getBoundingClientRect(),b=g.width,w=g.height;s.rr_width=b+"px",s.rr_height=w+"px"}return{type:t.Element,tagName:a,attributes:s,childNodes:[],isSVG:(C=e,"svg"===C.tagName||C instanceof SVGElement||void 0),needBlock:i};case e.TEXT_NODE:var N=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===N||void 0;return T&&E&&(E=l(E,location.href)),"SCRIPT"===N&&(E="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:E||"",isStyle:T};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var C}function d(e,n,r,i,a){void 0===a&&(a=!1);var s=u(e,n,i);if(!s)return console.warn(e,"not serialized"),null;var l=Object.assign(s,{id:o++});e.__sn=l,r[l.id]=e;var c=!a;if(l.type===t.Element&&(c=c&&!l.needBlock,delete l.needBlock),(l.type===t.Document||l.type===t.Element)&&c)for(var f=0,p=Array.from(e.childNodes);f<p.length;f++){var h=d(p[f],n,r,i);h&&l.childNodes.push(h)}return l}function f(e,t){void 0===t&&(t="rr-block"),o=1;var n={};return[d(e,e,n,t),n]}var p={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 h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function v(e){return e.replace(h,function(e,t,n){if(m.test(t)){var o=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function y(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,l="style"===o&&"_cssText"===i;if(l&&(a=v(a)),s||l){var c=n.createTextNode(a);r.appendChild(c);continue}if("iframe"===o&&"src"===i)continue;try{r.setAttribute(i,a)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case t.Text:return n.createTextNode(e.isStyle?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,o,r){void 0===r&&(r=!1);var i=y(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var l=s[a],c=g(l,n,o);c?i.appendChild(c):console.warn("Failed to rebuild",l)}return i}function b(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var w,N,E,T,C={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return C.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete C.map[t],e.childNodes&&e.childNodes.forEach(function(e){return C.removeNodeFromMap(e)})},has:function(e){return C.map.hasOwnProperty(e)}};function S(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)},a))}}function I(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function x(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function M(e,t){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(t)||M(e.parentNode,t))}function D(e,t){var n=new MutationObserver(function(n){var o=[],r=[],i=[],a=[],s=new Set,l=new Set,c=function(e){M(e,t)||(s.add(e),l.delete(e),e.childNodes.forEach(function(e){return c(e)}))};n.forEach(function(e){var n=e.type,a=e.target,u=e.oldValue,d=e.addedNodes,f=e.removedNodes,p=e.attributeName;switch(n){case"characterData":var h=a.textContent;M(a,t)||h===u||o.push({value:h,node:a});break;case"attributes":h=a.getAttribute(p);if(M(a,t)||h===u)return;var m=r.find(function(e){return e.node===a});m||(m={node:a,attributes:{}},r.push(m)),m.attributes[p]=h;break;case"childList":d.forEach(function(e){return c(e)}),f.forEach(function(e){var n=C.getId(e),o=C.getId(a);M(e,t)||(s.has(e)?(!function e(t,n){t.delete(n),n.childNodes.forEach(function(n){return e(t,n)})}(s,e),l.add(e)):s.has(a)&&-1===n||function e(t){var n=C.getId(t);return!C.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(a)||i.push({parentId:o,id:n}),C.removeNodeFromMap(e))})}}),Array.from(s).forEach(function(e){(function e(t,n){var o=n.parentNode;return!!o&&(!!t.has(o)||e(t,o))})(l,e)||function e(t,n){var o=n.parentNode;if(!o)return!1;var r=C.getId(o);return!!t.some(function(e){return e.id===r})||e(t,o)}(i,e)?l.add(e):a.push({parentId:C.getId(e.parentNode),previousId:e.previousSibling?C.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?C.getId(e.nextSibling):e.nextSibling,node:d(e,document,C.map,t,!0)})});var u={texts:o.map(function(e){return{id:C.getId(e.node),value:e.value}}).filter(function(e){return C.has(e.id)}),attributes:r.map(function(e){return{id:C.getId(e.node),attributes:e.attributes}}).filter(function(e){return C.has(e.id)}),removes:i,adds:a};(u.texts.length||u.attributes.length||u.removes.length||u.adds.length)&&e(u)});return n.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function k(e,t){var n=[];return Object.keys(E).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(o){var r=o.toLowerCase(),i=function(n){return function(o){if(!M(o.target,t)){var r=C.getId(o.target),i=o.clientX,a=o.clientY;e({type:E[n],id:r,x:i,y:a})}}}(o);n.push(b(r,i))}),function(){n.forEach(function(e){return e()})}}!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"}(w||(w={})),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"}(N||(N={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(E||(E={})),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"}(T||(T={}));var O=["INPUT","TEXTAREA","SELECT"],L=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],A=new WeakMap;function F(e,t,o){function r(e){var n=e.target;if(n&&n.tagName&&!(O.indexOf(n.tagName)<0)&&!M(n,t)){var r=n.type;if("password"!==r&&!n.classList.contains(o)){var a=n.value,s=!1;"radio"!==r&&"checkbox"!==r||(s=n.checked),i(n,{text:a,isChecked:s});var l=n.name;"radio"===r&&l&&s&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==n&&i(e,{text:e.value,isChecked:!s})})}}}function i(t,o){var r=A.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){A.set(t,o);var i=C.getId(t);e(n({},o,{id:i}))}}var a=["input","change"].map(function(e){return b(e,r)}),s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return s&&s.set&&a.push.apply(a,L.map(function(e){return function e(t,n,o){var r=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){o.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return e(t,n,r||{})}}(e[0],e[1],{set:function(){r({target:this})}})})),function(){a.forEach(function(e){return e()})}}function R(e){var t,n,o,r,i=D(e.mutationCb,e.blockClass),a=(t=e.mousemoveCb,o=[],r=S(function(){var e=Date.now()-n;t(o.map(function(t){return t.timeOffset-=e,t})),o=[],n=null},500),b("mousemove",S(function(e){var t=e.clientX,i=e.clientY,a=e.target;n||(n=Date.now()),o.push({x:t,y:i,id:C.getId(a),timeOffset:Date.now()-n}),r()},50,{trailing:!1}))),s=k(e.mouseInteractionCb,e.blockClass),l=function(e,t){return b("scroll",S(function(n){if(n.target&&!M(n.target,t)){var o=C.getId(n.target);if(n.target===document){var r=document.scrollingElement||document.documentElement;e({id:o,x:r.scrollLeft,y:r.scrollTop})}else e({id:o,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}(e.scrollCb,e.blockClass),c=function(e){return b("resize",S(function(){var t=I(),n=x();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),u=F(e.inputCb,e.blockClass,e.ignoreClass);return function(){i.disconnect(),a(),s(),l(),c(),u()}}function _(e){return n({},e,{timestamp:Date.now()})}function B(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var j=Object.freeze({default:B});var z,P=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):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]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");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)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):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))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===f(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,o,r){var s,c,u,d,f=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),p({scrollable:s,method:d,startTime:f,startX:c,startY:u,x:o,y:r})}}}}()}(z={exports:{}},z.exports),z.exports).polyfill,X=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}();P();var Y=B||j,H=function(){function e(e,t){if(this.events=[],this.emitter=Y(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block"};this.config=Object.assign({},n,t),this.timer=new X(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(T.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(T.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n];if(!(r.timestamp<=this.lastPlayedEvent.timestamp||r===this.lastPlayedEvent)){var i=this.getCastFn(r);t.push({doAction:i,delay:this.getDelay(r)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(T.Resume)},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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===w.IncrementalSnapshot&&e.data.source===N.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case w.DomContentLoaded:case w.Load:break;case w.Meta:n=function(){return o.emitter.emit(T.Resize,{width:e.data.width,height:e.data.height})};break;case w.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case w.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/5e3),360)};o.setConfig(s),o.emitter.emit(T.SkipStart,s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(T.Finish))}},e.prototype.rebuildFullSnapshot=function(e){var t,n,o;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},C.map=(t=e.data.node,n=this.iframe.contentDocument,o={},[g(t,n,o),o])[1];var r=document.createElement("style"),i=this.iframe.contentDocument,a=i.documentElement,s=i.head;a.insertBefore(r,s);for(var l=["iframe, ."+this.config.blockClass+" { background: #ccc }","noscript { display: none !important; }"],c=0;c<l.length;c++)r.sheet.insertRule(l[c],c);this.emitter.emit(T.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(T.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(),e.emitter.emit(T.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case N.Mutation:r.removes.forEach(function(e){var t=C.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);var n=C.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);C.removeNodeFromMap(t),n&&n.removeChild(t)});var i=n({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=g(e.node,o.iframe.contentDocument,C.map,!0),n=C.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=C.getNode(e.previousId)),e.nextId&&(s=C.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?n.insertBefore(t,a.nextSibling):s&&s.parentNode?n.insertBefore(t,s):n.appendChild(t),(e.previousId||e.nextId)&&o.resolveMissingNode(i,n,t,e)):i[e.node.id]={node:t,mutation:e}}),Object.keys(i).length&&Object.assign(this.missingNodeRetryMap,i),r.texts.forEach(function(e){var t=C.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=C.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);for(var n in e.attributes)if("string"==typeof n){var i=e.attributes[n];null!==i?t.setAttribute(n,i):t.removeAttribute(n)}});break;case N.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case N.MouseInteraction:if(-1===r.id)break;var a=new Event(E[r.type].toLowerCase());if(!(s=C.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(r.type){case E.Blur:s.blur&&s.blur();break;case E.Focus:s.focus&&s.focus({preventScroll:!0});break;case E.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case N.Scroll:if(-1===r.id)break;if(!(s=C.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(s===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{s.scrollTop=r.y,s.scrollLeft=r.x}catch(e){}break;case N.ViewportResize:this.emitter.emit(T.Resize,{width:r.width,height:r.height});break;case N.Input:if(-1===r.id)break;var s;if(!(s=C.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{s.checked=r.isChecked,s.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=C.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===w.IncrementalSnapshot&&(e.data.source>N.Mutation&&e.data.source<=N.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(T.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},e}();return e.record=function(e){void 0===e&&(e={});var t,o=e.emit,r=e.checkoutEveryNms,i=e.checkoutEveryNth,a=e.blockClass,s=void 0===a?"rr-block":a,l=e.ignoreClass,c=void 0===l?"rr-ignore":l;if(!o)throw new Error("emit function is required");var u=0,d=function(e,n){if(o(e,n),e.type===w.FullSnapshot)t=e,u=0;else if(e.type===w.IncrementalSnapshot){u++;var a=i&&u>=i,s=r&&e.timestamp-t.timestamp>r;(a||s)&&p(!0)}};function p(e){void 0===e&&(e=!1),d(_({type:w.Meta,data:{href:window.location.href,width:x(),height:I()}}),e);var t=f(document,s),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");C.map=o,d(_({type:w.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var h=[];h.push(b("DOMContentLoaded",function(){d(_({type:w.DomContentLoaded,data:{}}))}));var m=function(){p(),h.push(R({mutationCb:function(e){return d(_({type:w.IncrementalSnapshot,data:n({source:N.Mutation},e)}))},mousemoveCb:function(e){return d(_({type:w.IncrementalSnapshot,data:{source:N.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return d(_({type:w.IncrementalSnapshot,data:n({source:N.MouseInteraction},e)}))},scrollCb:function(e){return d(_({type:w.IncrementalSnapshot,data:n({source:N.Scroll},e)}))},viewportResizeCb:function(e){return d(_({type:w.IncrementalSnapshot,data:n({source:N.ViewportResize},e)}))},inputCb:function(e){return d(_({type:w.IncrementalSnapshot,data:n({source:N.Input},e)}))},blockClass:s,ignoreClass:c}))};return"interactive"===document.readyState||"complete"===document.readyState?m():h.push(b("load",function(){d(_({type:w.Load,data:{}})),m()},window)),function(){h.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=H,e.mirror=C,e}({});
//# sourceMappingURL=rrweb.min.js.map

@@ -113,4 +113,3 @@ /*! *****************************************************************************

}
var BLOCK_CLASS = 'rr-block';
function serializeNode(n, doc) {
function serializeNode(n, doc, blockClass) {
switch (n.nodeType) {

@@ -130,3 +129,3 @@ case n.DOCUMENT_NODE:

case n.ELEMENT_NODE:
var needBlock = n.classList.contains(BLOCK_CLASS);
var needBlock = n.classList.contains(blockClass);
var tagName = n.tagName.toLowerCase();

@@ -152,7 +151,16 @@ var attributes_1 = {};

if (cssText) {
attributes_1 = {
_cssText: absoluteToStylesheet(cssText, stylesheet.href)
};
delete attributes_1.rel;
delete attributes_1.href;
attributes_1._cssText = absoluteToStylesheet(cssText, stylesheet.href);
}
}
if (tagName === 'style' &&
n.sheet &&
!n.innerText.trim().length) {
var cssText = getCssRulesString(n
.sheet);
if (cssText) {
attributes_1._cssText = absoluteToStylesheet(cssText, location.href);
}
}
if (tagName === 'input' ||

@@ -219,5 +227,5 @@ tagName === 'textarea' ||

}
function serializeNodeWithId(n, doc, map, skipChild) {
function serializeNodeWithId(n, doc, map, blockClass, skipChild) {
if (skipChild === void 0) { skipChild = false; }
var _serializedNode = serializeNode(n, doc);
var _serializedNode = serializeNode(n, doc, blockClass);
if (!_serializedNode) {

@@ -242,3 +250,3 @@ console.warn(n, 'not serialized');

var childN = _a[_i];
var serializedChildNode = serializeNodeWithId(childN, doc, map);
var serializedChildNode = serializeNodeWithId(childN, doc, map, blockClass);
if (serializedChildNode) {

@@ -251,6 +259,7 @@ serializedNode.childNodes.push(serializedChildNode);

}
function snapshot(n) {
function snapshot(n, blockClass) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
resetId();
var idNodeMap = {};
return [serializeNodeWithId(n, n, idNodeMap), idNodeMap];
return [serializeNodeWithId(n, n, idNodeMap, blockClass), idNodeMap];
}

@@ -342,4 +351,3 @@

}
var BLOCK_CLASS$1 = 'rr-block';
function isBlocked(node) {
function isBlocked(node, blockClass) {
if (!node) {

@@ -349,6 +357,6 @@ return false;

if (node.nodeType === node.ELEMENT_NODE) {
return (node.classList.contains(BLOCK_CLASS$1) ||
isBlocked(node.parentNode));
return (node.classList.contains(blockClass) ||
isBlocked(node.parentNode, blockClass));
}
return isBlocked(node.parentNode);
return isBlocked(node.parentNode, blockClass);
}

@@ -440,3 +448,3 @@ function isAncestorRemoved(target) {

function initMutationObserver(cb) {
function initMutationObserver(cb, blockClass) {
var observer = new MutationObserver(function (mutations) {

@@ -450,3 +458,3 @@ var texts = [];

var genAdds = function (n) {
if (isBlocked(n)) {
if (isBlocked(n, blockClass)) {
return;

@@ -463,3 +471,3 @@ }

var value = target.textContent;
if (!isBlocked(target) && value !== oldValue) {
if (!isBlocked(target, blockClass) && value !== oldValue) {
texts.push({

@@ -474,3 +482,3 @@ value: value,

var value = target.getAttribute(attributeName);
if (isBlocked(target) || value === oldValue) {
if (isBlocked(target, blockClass) || value === oldValue) {
return;

@@ -494,3 +502,3 @@ }

var parentId = mirror.getId(target);
if (isBlocked(n)) {
if (isBlocked(n, blockClass)) {
return;

@@ -528,3 +536,3 @@ }

: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, true)
node: serializeNodeWithId(n, document, mirror.map, blockClass, true)
});

@@ -599,7 +607,7 @@ }

}
function initMouseInteractionObserver(cb) {
function initMouseInteractionObserver(cb, blockClass) {
var handlers = [];
var getHandler = function (eventKey) {
return function (event) {
if (isBlocked(event.target)) {
if (isBlocked(event.target, blockClass)) {
return;

@@ -628,5 +636,5 @@ }

}
function initScrollObserver(cb) {
function initScrollObserver(cb, blockClass) {
var updatePosition = throttle(function (evt) {
if (!evt.target || isBlocked(evt.target)) {
if (!evt.target || isBlocked(evt.target, blockClass)) {
return;

@@ -671,5 +679,4 @@ }

];
var IGNORE_CLASS = 'rr-ignore';
var lastInputValueMap = new WeakMap();
function initInputObserver(cb) {
function initInputObserver(cb, blockClass, ignoreClass) {
function eventHandler(event) {

@@ -680,3 +687,3 @@ var target = event.target;

INPUT_TAGS.indexOf(target.tagName) < 0 ||
isBlocked(target)) {
isBlocked(target, blockClass)) {
return;

@@ -686,3 +693,3 @@ }

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

@@ -739,8 +746,8 @@ }

function initObservers(o) {
var mutationObserver = initMutationObserver(o.mutationCb);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass);
var mousemoveHandler = initMousemoveObserver(o.mousemoveCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb);
var scrollHandler = initScrollObserver(o.scrollCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass);
return function () {

@@ -761,3 +768,3 @@ mutationObserver.disconnect();

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b;
if (!emit) {

@@ -794,3 +801,3 @@ throw new Error('emit function is required');

}), isCheckout);
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
var _a = snapshot(document, blockClass), node = _a[0], idNodeMap = _a[1];
if (!node) {

@@ -860,3 +867,5 @@ return console.warn('Failed to snapshot the document');

}));
}
},
blockClass: blockClass,
ignoreClass: ignoreClass
}));

@@ -863,0 +872,0 @@ };

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

var NodeType,__assign=function(){return(__assign=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(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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),u=i.split("/");a.pop();for(var s=0,c=u;s<c.length;s++){var d=c[s];"."!==d&&(".."===d?a.pop():a.push(d))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}var BLOCK_CLASS="rr-block";function serializeNode(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.classList.contains(BLOCK_CLASS),r=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var u=a[i],s=u.name,c=u.value;o[s]="src"===s||"href"===s?absoluteToDoc(t,c):"style"===s?absoluteToStylesheet(c,location.href):c}if("link"===r){var d=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),l=getCssRulesString(d);l&&(o={_cssText:absoluteToStylesheet(l,d.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var m=e.getBoundingClientRect(),f=m.width,v=m.height;o.rr_width=f+"px",o.rr_height=v+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var h=e.parentNode&&e.parentNode.tagName,E=e.textContent,y="STYLE"===h||void 0;return y&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===h&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",isStyle:y};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var u=0,s=Array.from(e.childNodes);u<s.length;u++){var c=serializeNodeWithId(s[u],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}function on(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)}}var mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),u=this,s=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(u,s)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,BLOCK_CLASS$1="rr-block";function isBlocked(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(BLOCK_CLASS$1)||isBlocked(e.parentNode))}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=new Set,u=new Set,s=function(e){isBlocked(e)||(a.add(e),u.delete(e),e.childNodes.forEach(function(e){return s(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=i.textContent;isBlocked(i)||m===c||n.push({value:m,node:i});break;case"attributes":m=i.getAttribute(p);if(isBlocked(i)||m===c)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;break;case"childList":d.forEach(function(e){return s(e)}),l.forEach(function(e){var t=mirror.getId(e),n=mirror.getId(i);isBlocked(e)||(a.has(e)?(deepDelete(a,e),u.add(e)):a.has(i)&&-1===t||isAncestorRemoved(i)||o.push({parentId:n,id:t}),mirror.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){isParentDropped(u,e)||isParentRemoved(o,e)?u.add(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})});var c={texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i};(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&e(c)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!isBlocked(n.target)){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target&&!isBlocked(t.target)){var n=mirror.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],IGNORE_CLASS="rr-ignore",lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)&&!isBlocked(t)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth;if(!n)throw new Error("emit function is required");var i=0,a=function(e,a){if(n(e,a),e.type===EventType.FullSnapshot)t=e,i=0;else if(e.type===EventType.IncrementalSnapshot){i++;var s=o&&i>=o,c=r&&e.timestamp-t.timestamp>r;(s||c)&&u(!0)}};function u(e){void 0===e&&(e=!1),a(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,a(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var s=[];s.push(on("DOMContentLoaded",function(){a(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var c=function(){u(),s.push(initObservers({mutationCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?c():s.push(on("load",function(){a(wrapEvent({type:EventType.Load,data:{}})),c()},window)),function(){s.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
var NodeType,__assign=function(){return(__assign=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(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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),u=i.split("/");a.pop();for(var s=0,c=u;s<c.length;s++){var l=c[s];"."!==l&&(".."===l?a.pop():a.push(l))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function serializeNode(e,t,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var r=e.classList.contains(n),o=e.tagName.toLowerCase(),i={},a=0,u=Array.from(e.attributes);a<u.length;a++){var s=u[a],c=s.name,l=s.value;i[c]="src"===c||"href"===c?absoluteToDoc(t,l):"style"===c?absoluteToStylesheet(l,location.href):l}if("link"===o){var d,p=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(d=getCssRulesString(p))&&(delete i.rel,delete i.href,i._cssText=absoluteToStylesheet(d,p.href))}if("style"===o&&e.sheet&&!e.innerText.trim().length)(d=getCssRulesString(e.sheet))&&(i._cssText=absoluteToStylesheet(d,location.href));if("input"===o||"textarea"===o||"select"===o){l=e.value;"radio"!==i.type&&"checkbox"!==i.type&&l?i.value=l:e.checked&&(i.checked=e.checked)}if("option"===o){var m=e.parentElement;i.value===m.value&&(i.selected=e.selected)}if(r){var f=e.getBoundingClientRect(),v=f.width,h=f.height;i.rr_width=v+"px",i.rr_height=h+"px"}return{type:NodeType.Element,tagName:o,attributes:i,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:r};case e.TEXT_NODE:var y=e.parentNode&&e.parentNode.tagName,E=e.textContent,g="STYLE"===y||void 0;return g&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===y&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",isStyle:g};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r,o){void 0===o&&(o=!1);var i=serializeNode(e,t,r);if(!i)return console.warn(e,"not serialized"),null;var a=Object.assign(i,{id:genId()});e.__sn=a,n[a.id]=e;var u=!o;if(a.type===NodeType.Element&&(u=u&&!a.needBlock,delete a.needBlock),(a.type===NodeType.Document||a.type===NodeType.Element)&&u)for(var s=0,c=Array.from(e.childNodes);s<c.length;s++){var l=serializeNodeWithId(c[s],t,n,r);l&&a.childNodes.push(l)}return a}function snapshot(e,t){void 0===t&&(t="rr-block"),resetId();var n={};return[serializeNodeWithId(e,e,n,t),n]}function on(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)}}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),u=this,s=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(u,s)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(e,t){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(t)||isBlocked(e.parentNode,t))}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e,t){var n=new MutationObserver(function(n){var r=[],o=[],i=[],a=[],u=new Set,s=new Set,c=function(e){isBlocked(e,t)||(u.add(e),s.delete(e),e.childNodes.forEach(function(e){return c(e)}))};n.forEach(function(e){var n=e.type,a=e.target,l=e.oldValue,d=e.addedNodes,p=e.removedNodes,m=e.attributeName;switch(n){case"characterData":var f=a.textContent;isBlocked(a,t)||f===l||r.push({value:f,node:a});break;case"attributes":f=a.getAttribute(m);if(isBlocked(a,t)||f===l)return;var v=o.find(function(e){return e.node===a});v||(v={node:a,attributes:{}},o.push(v)),v.attributes[m]=f;break;case"childList":d.forEach(function(e){return c(e)}),p.forEach(function(e){var n=mirror.getId(e),r=mirror.getId(a);isBlocked(e,t)||(u.has(e)?(deepDelete(u,e),s.add(e)):u.has(a)&&-1===n||isAncestorRemoved(a)||i.push({parentId:r,id:n}),mirror.removeNodeFromMap(e))})}}),Array.from(u).forEach(function(e){isParentDropped(s,e)||isParentRemoved(i,e)?s.add(e):a.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0)})});var l={texts:r.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:o.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:i,adds:a};(l.texts.length||l.attributes.length||l.removes.length||l.adds.length)&&e(l)});return n.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=r.clientX,a=r.clientY;e({type:MouseInteractions[n],id:o,x:i,y:a})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var i=r.type;if("password"!==i&&!r.classList.contains(n)){var a=r.value,u=!1;"radio"!==i&&"checkbox"!==i||(u=r.checked),o(r,{text:a,isChecked:u});var s=r.name;"radio"===i&&s&&u&&document.querySelectorAll('input[type="radio"][name="'+s+'"]').forEach(function(e){e!==r&&o(e,{text:e.value,isChecked:!u})})}}}function o(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var i=["input","change"].map(function(e){return on(e,r)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return a&&a.set&&i.push.apply(i,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth,i=e.blockClass,a=void 0===i?"rr-block":i,u=e.ignoreClass,s=void 0===u?"rr-ignore":u;if(!n)throw new Error("emit function is required");var c=0,l=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,c=0;else if(e.type===EventType.IncrementalSnapshot){c++;var a=o&&c>=o,u=r&&e.timestamp-t.timestamp>r;(a||u)&&d(!0)}};function d(e){void 0===e&&(e=!1),l(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,a),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,l(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var p=[];p.push(on("DOMContentLoaded",function(){l(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var m=function(){d(),p.push(initObservers({mutationCb:function(e){return l(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return l(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return l(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return l(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return l(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return l(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:a,ignoreClass:s}))};return"interactive"===document.readyState||"complete"===document.readyState?m():p.push(on("load",function(){l(wrapEvent({type:EventType.Load,data:{}})),m()},window)),function(){p.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
//# sourceMappingURL=rrweb-record.min.js.map

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

var NodeType,__assign=function(){return(__assign=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(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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var l=0,c=s;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?a.pop():a.push(u))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}var BLOCK_CLASS="rr-block";function serializeNode(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.classList.contains(BLOCK_CLASS),r=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var s=a[i],l=s.name,c=s.value;o[l]="src"===l||"href"===l?absoluteToDoc(t,c):"style"===l?absoluteToStylesheet(c,location.href):c}if("link"===r){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(o={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var f=e.getBoundingClientRect(),m=f.width,h=f.height;o.rr_width=m+"px",o.rr_height=h+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var v=e.parentNode&&e.parentNode.tagName,y=e.textContent,g="STYLE"===v||void 0;return g&&y&&(y=absoluteToStylesheet(y,location.href)),"SCRIPT"===v&&(y="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:y||"",isStyle:g};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var s=0,l=Array.from(e.childNodes);s<l.length;s++){var c=serializeNodeWithId(l[s],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),r=void 0;for(var o in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{r.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r){void 0===r&&(r=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],l=buildNodeWithSN(s,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(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)}}var mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),s=this,l=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,l)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,BLOCK_CLASS$1="rr-block";function isBlocked(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(BLOCK_CLASS$1)||isBlocked(e.parentNode))}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=new Set,s=new Set,l=function(e){isBlocked(e)||(a.add(e),s.delete(e),e.childNodes.forEach(function(e){return l(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var f=i.textContent;isBlocked(i)||f===c||n.push({value:f,node:i});break;case"attributes":f=i.getAttribute(p);if(isBlocked(i)||f===c)return;var m=r.find(function(e){return e.node===i});m||(m={node:i,attributes:{}},r.push(m)),m.attributes[p]=f;break;case"childList":u.forEach(function(e){return l(e)}),d.forEach(function(e){var t=mirror.getId(e),n=mirror.getId(i);isBlocked(e)||(a.has(e)?(deepDelete(a,e),s.add(e)):a.has(i)&&-1===t||isAncestorRemoved(i)||o.push({parentId:n,id:t}),mirror.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){isParentDropped(s,e)||isParentRemoved(o,e)?s.add(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})});var c={texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i};(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&e(c)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!isBlocked(n.target)){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target&&!isBlocked(t.target)){var n=mirror.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],IGNORE_CLASS="rr-ignore",lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)&&!isBlocked(t)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth;if(!n)throw new Error("emit function is required");var i=0,a=function(e,a){if(n(e,a),e.type===EventType.FullSnapshot)t=e,i=0;else if(e.type===EventType.IncrementalSnapshot){i++;var l=o&&i>=o,c=r&&e.timestamp-t.timestamp>r;(l||c)&&s(!0)}};function s(e){void 0===e&&(e=!1),a(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,a(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var l=[];l.push(on("DOMContentLoaded",function(){a(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var c=function(){s(),l.push(initObservers({mutationCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?c():l.push(on("load",function(){a(wrapEvent({type:EventType.Load,data:{}})),c()},window)),function(){l.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.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]&&(c(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):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===p(e));return n=null,e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,r,i,s,l=(a()-t.startTime)/o;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,r,o){var s,c,u,d,p=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:s,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(r.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),rules=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"],SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3;smoothscroll_1();var mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.timestamp<=e.timestamp)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var a=r.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/SKIP_TIME_INTERVAL),360)};r.setConfig(s),r.emitter.emit(ReplayerEvents.SkipStart,s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,r=n.documentElement,o=n.head;r.insertBefore(t,o);for(var i=0;i<rules.length;i++)t.sheet.insertRule(rules[i],i);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,r=e.data;switch(r.source){case IncrementalSource.Mutation:r.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);var o=mirror.getNode(e.parentId);if(!o)return n.warnNodeNotFound(r,e.parentId);mirror.removeNodeFromMap(t),o&&o.removeChild(t)});var o=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),i=mirror.getNode(e.parentId);if(!i)return n.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=mirror.getNode(e.previousId)),e.nextId&&(s=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?i.insertBefore(t,a.nextSibling):s&&s.parentNode?i.insertBefore(t,s):i.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,i,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);for(var o in e.attributes)if("string"==typeof o){var i=e.attributes[o];i?t.setAttribute(o,i):t.removeAttribute(o)}});break;case IncrementalSource.MouseMove:t||r.positions.forEach(function(t){var o={doAction:function(){n.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(o)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var i=new Event(MouseInteractions[r.type].toLowerCase());if(!(a=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(r.type){case MouseInteractions.Blur:a.blur&&a.blur();break;case MouseInteractions.Focus:a.focus&&a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(i)}break;case IncrementalSource.Scroll:if(-1===r.id)break;if(!(a=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(a===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{a.scrollTop=r.y,a.scrollLeft=r.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;var a;if(!(a=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{a.checked=r.isChecked,a.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var o=mirror.getNode(r);if(!o)return this.debugNodeNotFound(e,r);this.hoverElements(o)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror};
var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,o,r){var i=n||o||r;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var l=0,c=s;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?a.pop():a.push(u))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function serializeNode(e,t,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var o=e.classList.contains(n),r=e.tagName.toLowerCase(),i={},a=0,s=Array.from(e.attributes);a<s.length;a++){var l=s[a],c=l.name,u=l.value;i[c]="src"===c||"href"===c?absoluteToDoc(t,u):"style"===c?absoluteToStylesheet(u,location.href):u}if("link"===r){var d,p=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(d=getCssRulesString(p))&&(delete i.rel,delete i.href,i._cssText=absoluteToStylesheet(d,p.href))}if("style"===r&&e.sheet&&!e.innerText.trim().length)(d=getCssRulesString(e.sheet))&&(i._cssText=absoluteToStylesheet(d,location.href));if("input"===r||"textarea"===r||"select"===r){u=e.value;"radio"!==i.type&&"checkbox"!==i.type&&u?i.value=u:e.checked&&(i.checked=e.checked)}if("option"===r){var f=e.parentElement;i.value===f.value&&(i.selected=e.selected)}if(o){var m=e.getBoundingClientRect(),h=m.width,v=m.height;i.rr_width=h+"px",i.rr_height=v+"px"}return{type:NodeType.Element,tagName:r,attributes:i,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:o};case e.TEXT_NODE:var y=e.parentNode&&e.parentNode.tagName,g=e.textContent,b="STYLE"===y||void 0;return b&&g&&(g=absoluteToStylesheet(g,location.href)),"SCRIPT"===y&&(g="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:g||"",isStyle:b};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,o,r){void 0===r&&(r=!1);var i=serializeNode(e,t,o);if(!i)return console.warn(e,"not serialized"),null;var a=Object.assign(i,{id:genId()});e.__sn=a,n[a.id]=e;var s=!r;if(a.type===NodeType.Element&&(s=s&&!a.needBlock,delete a.needBlock),(a.type===NodeType.Document||a.type===NodeType.Element)&&s)for(var l=0,c=Array.from(e.childNodes);l<c.length;l++){var u=serializeNodeWithId(c[l],t,n,o);u&&a.childNodes.push(u)}return a}function snapshot(e,t){void 0===t&&(t="rr-block"),resetId();var n={};return[serializeNodeWithId(e,e,n,t),n]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var o=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),o=void 0;for(var r in o=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(r)&&!r.startsWith("rr_")){var i=e.attributes[r];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===r,s="style"===n&&"_cssText"===r;if(s&&(i=addHoverClass(i)),a||s){var l=t.createTextNode(i);o.appendChild(l);continue}if("iframe"===n&&"src"===r)continue;try{o.setAttribute(r,i)}catch(e){}}else e.attributes.rr_width&&(o.style.width=e.attributes.rr_width),e.attributes.rr_height&&(o.style.height=e.attributes.rr_height);return o;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,o){void 0===o&&(o=!1);var r=buildNode(e,t);if(!r)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),r=t),r.__sn=e,n[e.id]=r,(e.type===NodeType.Document||e.type===NodeType.Element)&&!o)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],l=buildNodeWithSN(s,t,n);l?r.appendChild(l):console.warn("Failed to rebuild",s)}return r}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)},a))}}function hookSetter(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return hookSetter(e,t,o||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(e,t){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(t)||isBlocked(e.parentNode,t))}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var o=mirror.getId(n);return!!e.some(function(e){return e.id===o})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e,t){var n=new MutationObserver(function(n){var o=[],r=[],i=[],a=[],s=new Set,l=new Set,c=function(e){isBlocked(e,t)||(s.add(e),l.delete(e),e.childNodes.forEach(function(e){return c(e)}))};n.forEach(function(e){var n=e.type,a=e.target,u=e.oldValue,d=e.addedNodes,p=e.removedNodes,f=e.attributeName;switch(n){case"characterData":var m=a.textContent;isBlocked(a,t)||m===u||o.push({value:m,node:a});break;case"attributes":m=a.getAttribute(f);if(isBlocked(a,t)||m===u)return;var h=r.find(function(e){return e.node===a});h||(h={node:a,attributes:{}},r.push(h)),h.attributes[f]=m;break;case"childList":d.forEach(function(e){return c(e)}),p.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(a);isBlocked(e,t)||(s.has(e)?(deepDelete(s,e),l.add(e)):s.has(a)&&-1===n||isAncestorRemoved(a)||i.push({parentId:o,id:n}),mirror.removeNodeFromMap(e))})}}),Array.from(s).forEach(function(e){isParentDropped(l,e)||isParentRemoved(i,e)?l.add(e):a.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0)})});var u={texts:o.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:i,adds:a};(u.texts.length||u.attributes.length||u.removes.length||u.adds.length)&&e(u)});return n.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function initMousemoveObserver(e){var t,n=[],o=throttle(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var r=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:r,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),o()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(o){var r=o.toLowerCase(),i=function(n){return function(o){if(!isBlocked(o.target,t)){var r=mirror.getId(o.target),i=o.clientX,a=o.clientY;e({type:MouseInteractions[n],id:r,x:i,y:a})}}}(o);n.push(on(r,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var o=mirror.getId(n.target);if(n.target===document){var r=document.scrollingElement||document.documentElement;e({id:o,x:r.scrollLeft,y:r.scrollTop})}else e({id:o,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!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"}(EventType||(EventType={})),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"}(IncrementalSource||(IncrementalSource={})),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=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),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"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function o(e){var o=e.target;if(o&&o.tagName&&!(INPUT_TAGS.indexOf(o.tagName)<0)&&!isBlocked(o,t)){var i=o.type;if("password"!==i&&!o.classList.contains(n)){var a=o.value,s=!1;"radio"!==i&&"checkbox"!==i||(s=o.checked),r(o,{text:a,isChecked:s});var l=o.name;"radio"===i&&l&&s&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==o&&r(e,{text:e.value,isChecked:!s})})}}}function r(t,n){var o=lastInputValueMap.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var r=mirror.getId(t);e(__assign({},n,{id:r}))}}var i=["input","change"].map(function(e){return on(e,o)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return a&&a.set&&i.push.apply(i,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){o({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass),n=initMousemoveObserver(e.mousemoveCb),o=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),r=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);return function(){t.disconnect(),n(),o(),r(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,o=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=void 0===i?"rr-block":i,s=e.ignoreClass,l=void 0===s?"rr-ignore":s;if(!n)throw new Error("emit function is required");var c=0,u=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,c=0;else if(e.type===EventType.IncrementalSnapshot){c++;var a=r&&c>=r,s=o&&e.timestamp-t.timestamp>o;(a||s)&&d(!0)}};function d(e){void 0===e&&(e=!1),u(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,a),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=o,u(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var p=[];p.push(on("DOMContentLoaded",function(){u(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var f=function(){d(),p.push(initObservers({mutationCb:function(e){return u(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return u(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return u(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return u(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return u(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return u(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:a,ignoreClass:l}))};return"interactive"===document.readyState||"complete"===document.readyState?f():p.push(on("load",function(){u(wrapEvent({type:EventType.Load,data:{}})),f()},window)),function(){p.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.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]&&(c(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):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.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)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):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))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===p(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,o,r){var s,c,u,d,p=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:s,method:d,startTime:p,startX:c,startY:u,x:o,y:r})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),rules=function(e){return["iframe, ."+e+" { background: #ccc }","noscript { display: none !important; }"]},SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3;smoothscroll_1();var mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block"};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n];if(!(r.timestamp<=this.lastPlayedEvent.timestamp||r===this.lastPlayedEvent)){var i=this.getCastFn(r);t.push({doAction:i,delay:this.getDelay(r)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return o.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/SKIP_TIME_INTERVAL),360)};o.setConfig(s),o.emitter.emit(ReplayerEvents.SkipStart,s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,o=n.documentElement,r=n.head;o.insertBefore(t,r);for(var i=rules(this.config.blockClass),a=0;a<i.length;a++)t.sheet.insertRule(i[a],a);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,o=e.data;switch(o.source){case IncrementalSource.Mutation:o.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);var r=mirror.getNode(e.parentId);if(!r)return n.warnNodeNotFound(o,e.parentId);mirror.removeNodeFromMap(t),r&&r.removeChild(t)});var r=__assign({},this.missingNodeRetryMap);o.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),i=mirror.getNode(e.parentId);if(!i)return n.warnNodeNotFound(o,e.parentId);var a=null,s=null;e.previousId&&(a=mirror.getNode(e.previousId)),e.nextId&&(s=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?i.insertBefore(t,a.nextSibling):s&&s.parentNode?i.insertBefore(t,s):i.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(r,i,t,e)):r[e.node.id]={node:t,mutation:e}}),Object.keys(r).length&&Object.assign(this.missingNodeRetryMap,r),o.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);t.textContent=e.value}),o.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);for(var r in e.attributes)if("string"==typeof r){var i=e.attributes[r];null!==i?t.setAttribute(r,i):t.removeAttribute(r)}});break;case IncrementalSource.MouseMove:t||o.positions.forEach(function(t){var r={doAction:function(){n.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(r)});break;case IncrementalSource.MouseInteraction:if(-1===o.id)break;var i=new Event(MouseInteractions[o.type].toLowerCase());if(!(a=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);switch(o.type){case MouseInteractions.Blur:a.blur&&a.blur();break;case MouseInteractions.Focus:a.focus&&a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(o,o.x,o.y,o.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(i)}break;case IncrementalSource.Scroll:if(-1===o.id)break;if(!(a=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);if(a===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:o.y,left:o.x,behavior:t?"auto":"smooth"});else try{a.scrollTop=o.y,a.scrollLeft=o.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:o.width,height:o.height});break;case IncrementalSource.Input:if(-1===o.id)break;var a;if(!(a=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{a.checked=o.isChecked,a.value=o.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=mirror.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror};
//# sourceMappingURL=rrweb.min.js.map

@@ -115,4 +115,3 @@ 'use strict';

}
var BLOCK_CLASS = 'rr-block';
function serializeNode(n, doc) {
function serializeNode(n, doc, blockClass) {
switch (n.nodeType) {

@@ -132,3 +131,3 @@ case n.DOCUMENT_NODE:

case n.ELEMENT_NODE:
var needBlock = n.classList.contains(BLOCK_CLASS);
var needBlock = n.classList.contains(blockClass);
var tagName = n.tagName.toLowerCase();

@@ -154,7 +153,16 @@ var attributes_1 = {};

if (cssText) {
attributes_1 = {
_cssText: absoluteToStylesheet(cssText, stylesheet.href)
};
delete attributes_1.rel;
delete attributes_1.href;
attributes_1._cssText = absoluteToStylesheet(cssText, stylesheet.href);
}
}
if (tagName === 'style' &&
n.sheet &&
!n.innerText.trim().length) {
var cssText = getCssRulesString(n
.sheet);
if (cssText) {
attributes_1._cssText = absoluteToStylesheet(cssText, location.href);
}
}
if (tagName === 'input' ||

@@ -221,5 +229,5 @@ tagName === 'textarea' ||

}
function serializeNodeWithId(n, doc, map, skipChild) {
function serializeNodeWithId(n, doc, map, blockClass, skipChild) {
if (skipChild === void 0) { skipChild = false; }
var _serializedNode = serializeNode(n, doc);
var _serializedNode = serializeNode(n, doc, blockClass);
if (!_serializedNode) {

@@ -244,3 +252,3 @@ console.warn(n, 'not serialized');

var childN = _a[_i];
var serializedChildNode = serializeNodeWithId(childN, doc, map);
var serializedChildNode = serializeNodeWithId(childN, doc, map, blockClass);
if (serializedChildNode) {

@@ -253,6 +261,7 @@ serializedNode.childNodes.push(serializedChildNode);

}
function snapshot(n) {
function snapshot(n, blockClass) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
resetId();
var idNodeMap = {};
return [serializeNodeWithId(n, n, idNodeMap), idNodeMap];
return [serializeNodeWithId(n, n, idNodeMap, blockClass), idNodeMap];
}

@@ -344,4 +353,3 @@

}
var BLOCK_CLASS$1 = 'rr-block';
function isBlocked(node) {
function isBlocked(node, blockClass) {
if (!node) {

@@ -351,6 +359,6 @@ return false;

if (node.nodeType === node.ELEMENT_NODE) {
return (node.classList.contains(BLOCK_CLASS$1) ||
isBlocked(node.parentNode));
return (node.classList.contains(blockClass) ||
isBlocked(node.parentNode, blockClass));
}
return isBlocked(node.parentNode);
return isBlocked(node.parentNode, blockClass);
}

@@ -442,3 +450,3 @@ function isAncestorRemoved(target) {

function initMutationObserver(cb) {
function initMutationObserver(cb, blockClass) {
var observer = new MutationObserver(function (mutations) {

@@ -452,3 +460,3 @@ var texts = [];

var genAdds = function (n) {
if (isBlocked(n)) {
if (isBlocked(n, blockClass)) {
return;

@@ -465,3 +473,3 @@ }

var value = target.textContent;
if (!isBlocked(target) && value !== oldValue) {
if (!isBlocked(target, blockClass) && value !== oldValue) {
texts.push({

@@ -476,3 +484,3 @@ value: value,

var value = target.getAttribute(attributeName);
if (isBlocked(target) || value === oldValue) {
if (isBlocked(target, blockClass) || value === oldValue) {
return;

@@ -496,3 +504,3 @@ }

var parentId = mirror.getId(target);
if (isBlocked(n)) {
if (isBlocked(n, blockClass)) {
return;

@@ -530,3 +538,3 @@ }

: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, true)
node: serializeNodeWithId(n, document, mirror.map, blockClass, true)
});

@@ -601,7 +609,7 @@ }

}
function initMouseInteractionObserver(cb) {
function initMouseInteractionObserver(cb, blockClass) {
var handlers = [];
var getHandler = function (eventKey) {
return function (event) {
if (isBlocked(event.target)) {
if (isBlocked(event.target, blockClass)) {
return;

@@ -630,5 +638,5 @@ }

}
function initScrollObserver(cb) {
function initScrollObserver(cb, blockClass) {
var updatePosition = throttle(function (evt) {
if (!evt.target || isBlocked(evt.target)) {
if (!evt.target || isBlocked(evt.target, blockClass)) {
return;

@@ -673,5 +681,4 @@ }

];
var IGNORE_CLASS = 'rr-ignore';
var lastInputValueMap = new WeakMap();
function initInputObserver(cb) {
function initInputObserver(cb, blockClass, ignoreClass) {
function eventHandler(event) {

@@ -682,3 +689,3 @@ var target = event.target;

INPUT_TAGS.indexOf(target.tagName) < 0 ||
isBlocked(target)) {
isBlocked(target, blockClass)) {
return;

@@ -688,3 +695,3 @@ }

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

@@ -741,8 +748,8 @@ }

function initObservers(o) {
var mutationObserver = initMutationObserver(o.mutationCb);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass);
var mousemoveHandler = initMousemoveObserver(o.mousemoveCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb);
var scrollHandler = initScrollObserver(o.scrollCb);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass);
return function () {

@@ -763,3 +770,3 @@ mutationObserver.disconnect();

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b;
if (!emit) {

@@ -796,3 +803,3 @@ throw new Error('emit function is required');

}), isCheckout);
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
var _a = snapshot(document, blockClass), node = _a[0], idNodeMap = _a[1];
if (!node) {

@@ -862,3 +869,5 @@ return console.warn('Failed to snapshot the document');

}));
}
},
blockClass: blockClass,
ignoreClass: ignoreClass
}));

@@ -865,0 +874,0 @@ };

{
"name": "rrweb",
"version": "0.7.9",
"version": "0.7.10",
"description": "record and replay the web",

@@ -27,4 +27,3 @@ "scripts": {

"es",
"index.d.ts",
"src/types.ts"
"typings"
],

@@ -63,5 +62,5 @@ "author": "yanzhen@smartx.com",

"mitt": "^1.1.3",
"rrweb-snapshot": "^0.7.3",
"rrweb-snapshot": "^0.7.6",
"smoothscroll-polyfill": "^0.4.3"
}
}

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc