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.6.9 to 0.6.11

5

dist/record/rrweb-record.js

@@ -555,6 +555,7 @@ var rrwebRecord = (function () {

if (evt.target === document) {
var scrollEl = (document.scrollingElement || document.documentElement);
cb({
id: id,
x: document.documentElement.scrollLeft,
y: document.documentElement.scrollTop
x: scrollEl.scrollLeft,
y: scrollEl.scrollTop
});

@@ -561,0 +562,0 @@ }

2

dist/record/rrweb-record.min.js

@@ -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\((['"]|)([^'"]*)\1\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function u(e,t){return e.replace(r,function(e,n,r){if(!o.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+r)+"')";var u,a=t.split("/"),i=r.split("/");a.pop();for(var c=0,d=i;c<d.length;c++){var s=d[c];"."!==s&&(".."===s?a.pop():a.push(s))}return"url('"+a.join("/")+"')"})}function a(e,t){var n=e.createElement("a");return n.href=t,n.href}var i="rr-block";function c(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(i),o=t.tagName.toLowerCase(),c={},d=0,s=Array.from(t.attributes);d<s.length;d++){var l=s[d],p=l.name,f=l.value;c[p]="src"===p||"href"===p?a(n,f):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&&(c={_cssText:u(h,m.href)})}if("input"===o||"textarea"===o||"select"===o){f=t.value;"radio"!==c.type&&"checkbox"!==c.type&&f?c.value=f:t.checked&&(c.checked=t.checked)}if("option"===o){var v=t.parentElement;c.value===v.value&&(c.selected=t.selected)}if(r){var y=t.getBoundingClientRect(),g=y.width,E=y.height;c.rr_width=g+"px",c.rr_height=E+"px"}return{type:e.Element,tagName:o,attributes:c,childNodes:[],isSVG:(I=t,"svg"===I.tagName||I instanceof SVGElement||void 0),needBlock:r};case t.TEXT_NODE:var b=t.parentNode&&t.parentNode.tagName,w=t.textContent,C="STYLE"===b||void 0;return C&&w&&(w=u(w,location.href)),"SCRIPT"===b&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:C};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 I}function d(t,r,o,u){void 0===u&&(u=!1);var a=c(t,r);if(!a)return console.warn(t,"not serialized"),null;var i=Object.assign(a,{id:n++});t.__sn=i,o[i.id]=t;var s=!u;if(i.type===e.Element&&(s=s&&!i.needBlock,delete i.needBlock),(i.type===e.Document||i.type===e.Element)&&s)for(var l=0,p=Array.from(t.childNodes);l<p.length;l++){var f=d(p[l],r,o);f&&i.childNodes.push(f)}return i}function s(e){n=1;var t={};return[d(e,e,t),t]}function l(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,f,m,h={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return h.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete h.map[t],e.childNodes&&e.childNodes.forEach(function(e){return h.removeNodeFromMap(e)})},has:function(e){return h.map.hasOwnProperty(e)}};function v(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var u=Date.now();o||!1!==n.leading||(o=u);var a=t-(u-o),i=this,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=u,e.apply(i,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(i,c)},a))}}function y(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function g(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function E(e){var t=[];return Object.keys(m).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=h.getId(n.target),o=n.clientX,u=n.clientY;e({type:m[t],id:r,x:o,y:u})}}(n);t.push(l(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"}(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"}(f||(f={})),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"}(m||(m={}));var b=["INPUT","TEXTAREA","SELECT"],w=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],C="rr-ignore",I=new WeakMap;function N(e){function n(e){var t=e.target;if(t&&t.tagName&&!(b.indexOf(t.tagName)<0)){var n=t.type;if("password"!==n&&!t.classList.contains(C)){var o=t.value,u=!1;"radio"!==n&&"checkbox"!==n||(u=t.checked),r(t,{text:o,isChecked:u});var a=t.name;"radio"===n&&a&&u&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!u})})}}}function r(n,r){var o=I.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){I.set(n,r);var u=h.getId(n);e(t({},r,{id:u}))}}var o=["input","change"].map(function(e){return l(e,n)}),u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return u&&u.set&&o.push.apply(o,w.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 T(e){var t,n,r=(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],u=[],a=[],i=new Set,c=function(e){i.add(e),e.childNodes.forEach(function(e){return c(e)})};e.forEach(function(e){var t=e.type,u=e.target,d=e.oldValue,s=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=u.textContent)!==d&&n.push({value:f,node:u});break;case"attributes":var f;if((f=u.getAttribute(p))===d)return;var m=r.find(function(e){return e.node===u});m||(m={node:u,attributes:{}},r.push(m)),m.attributes[p]=f;case"childList":s.forEach(function(e){return c(e)}),l.forEach(function(e){i.has(e)?(i.delete(e),a.push(e)):i.has(u)&&!h.getId(e)||o.push({parentId:h.getId(u),id:h.getId(e)}),h.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=h.getId(e.parentNode),delete e.parentNode),e});var s=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||s(t))},l=function(e){var t=e.parentNode;if(!t)return!1;var n=h.getId(t);return!!o.some(function(e){return e.id===n})||l(t)};Array.from(i).forEach(function(e){s(e)||l(e)?a.push(e):u.push({parentId:h.getId(e.parentNode),previousId:e.previousSibling?h.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?h.getId(e.nextSibling):e.nextSibling,node:d(e,document,h.map,!0)})}),t({texts:n.map(function(e){return{id:h.getId(e.node),value:e.value}}).filter(function(e){return h.has(e.id)}),attributes:r.map(function(e){return{id:h.getId(e.node),attributes:e.attributes}}).filter(function(e){return h.has(e.id)}),removes:o,adds:u})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),o=function(e){var t,n=[],r=v(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return l("mousemove",v(function(e){var o=e.clientX,u=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:u,id:h.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),u=E(e.mouseInteractionCb),a=function(e){return l("scroll",v(function(t){if(t.target){var n=h.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),i=function(e){return l("resize",v(function(){var t=y(),n=g();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=N(e.inputCb);return function(){r.disconnect(),o(),u(),a(),i(),c()}}function D(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n=e.emit;if(!n)throw new Error("emit function is required");try{var r=[];r.push(l("DOMContentLoaded",function(){n(D({type:p.DomContentLoaded,data:{}}))}));var o=function(){n(D({type:p.Meta,data:{href:window.location.href,width:g(),height:y()}}));var e=s(document),o=e[0],u=e[1];if(!o)return console.warn("Failed to snapshot the document");h.map=u,n(D({type:p.FullSnapshot,data:{node:o,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),r.push(T({mutationCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.Mutation},e)}))},mousemoveCb:function(e){return n(D({type:p.IncrementalSnapshot,data:{source:f.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.MouseInteraction},e)}))},scrollCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.Scroll},e)}))},viewportResizeCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.ViewportResize},e)}))},inputCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?o():r.push(l("load",function(){n(D({type:p.Load,data:{}})),o()},window)),function(){r.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;var r=/url\((['"]|)([^'"]*)\1\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function u(e,t){return e.replace(r,function(e,n,r){if(!o.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+r)+"')";var u,a=t.split("/"),i=r.split("/");a.pop();for(var c=0,s=i;c<s.length;c++){var d=s[c];"."!==d&&(".."===d?a.pop():a.push(d))}return"url('"+a.join("/")+"')"})}function a(e,t){var n=e.createElement("a");return n.href=t,n.href}var i="rr-block";function c(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(i),o=t.tagName.toLowerCase(),c={},s=0,d=Array.from(t.attributes);s<d.length;s++){var l=d[s],p=l.name,f=l.value;c[p]="src"===p||"href"===p?a(n,f):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&&(c={_cssText:u(h,m.href)})}if("input"===o||"textarea"===o||"select"===o){f=t.value;"radio"!==c.type&&"checkbox"!==c.type&&f?c.value=f:t.checked&&(c.checked=t.checked)}if("option"===o){var v=t.parentElement;c.value===v.value&&(c.selected=t.selected)}if(r){var y=t.getBoundingClientRect(),g=y.width,E=y.height;c.rr_width=g+"px",c.rr_height=E+"px"}return{type:e.Element,tagName:o,attributes:c,childNodes:[],isSVG:(I=t,"svg"===I.tagName||I instanceof SVGElement||void 0),needBlock:r};case t.TEXT_NODE:var b=t.parentNode&&t.parentNode.tagName,w=t.textContent,C="STYLE"===b||void 0;return C&&w&&(w=u(w,location.href)),"SCRIPT"===b&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:C};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 I}function s(t,r,o,u){void 0===u&&(u=!1);var a=c(t,r);if(!a)return console.warn(t,"not serialized"),null;var i=Object.assign(a,{id:n++});t.__sn=i,o[i.id]=t;var d=!u;if(i.type===e.Element&&(d=d&&!i.needBlock,delete i.needBlock),(i.type===e.Document||i.type===e.Element)&&d)for(var l=0,p=Array.from(t.childNodes);l<p.length;l++){var f=s(p[l],r,o);f&&i.childNodes.push(f)}return i}function d(e){n=1;var t={};return[s(e,e,t),t]}function l(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,f,m,h={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return h.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete h.map[t],e.childNodes&&e.childNodes.forEach(function(e){return h.removeNodeFromMap(e)})},has:function(e){return h.map.hasOwnProperty(e)}};function v(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var u=Date.now();o||!1!==n.leading||(o=u);var a=t-(u-o),i=this,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=u,e.apply(i,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(i,c)},a))}}function y(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function g(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function E(e){var t=[];return Object.keys(m).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=h.getId(n.target),o=n.clientX,u=n.clientY;e({type:m[t],id:r,x:o,y:u})}}(n);t.push(l(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"}(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"}(f||(f={})),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"}(m||(m={}));var b=["INPUT","TEXTAREA","SELECT"],w=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],C="rr-ignore",I=new WeakMap;function N(e){function n(e){var t=e.target;if(t&&t.tagName&&!(b.indexOf(t.tagName)<0)){var n=t.type;if("password"!==n&&!t.classList.contains(C)){var o=t.value,u=!1;"radio"!==n&&"checkbox"!==n||(u=t.checked),r(t,{text:o,isChecked:u});var a=t.name;"radio"===n&&a&&u&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!u})})}}}function r(n,r){var o=I.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){I.set(n,r);var u=h.getId(n);e(t({},r,{id:u}))}}var o=["input","change"].map(function(e){return l(e,n)}),u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return u&&u.set&&o.push.apply(o,w.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 T(e){var t,n,r=(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],u=[],a=[],i=new Set,c=function(e){i.add(e),e.childNodes.forEach(function(e){return c(e)})};e.forEach(function(e){var t=e.type,u=e.target,s=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=u.textContent)!==s&&n.push({value:f,node:u});break;case"attributes":var f;if((f=u.getAttribute(p))===s)return;var m=r.find(function(e){return e.node===u});m||(m={node:u,attributes:{}},r.push(m)),m.attributes[p]=f;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){i.has(e)?(i.delete(e),a.push(e)):i.has(u)&&!h.getId(e)||o.push({parentId:h.getId(u),id:h.getId(e)}),h.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=h.getId(e.parentNode),delete e.parentNode),e});var d=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||d(t))},l=function(e){var t=e.parentNode;if(!t)return!1;var n=h.getId(t);return!!o.some(function(e){return e.id===n})||l(t)};Array.from(i).forEach(function(e){d(e)||l(e)?a.push(e):u.push({parentId:h.getId(e.parentNode),previousId:e.previousSibling?h.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?h.getId(e.nextSibling):e.nextSibling,node:s(e,document,h.map,!0)})}),t({texts:n.map(function(e){return{id:h.getId(e.node),value:e.value}}).filter(function(e){return h.has(e.id)}),attributes:r.map(function(e){return{id:h.getId(e.node),attributes:e.attributes}}).filter(function(e){return h.has(e.id)}),removes:o,adds:u})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),o=function(e){var t,n=[],r=v(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return l("mousemove",v(function(e){var o=e.clientX,u=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:u,id:h.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),u=E(e.mouseInteractionCb),a=function(e){return l("scroll",v(function(t){if(t.target){var n=h.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),i=function(e){return l("resize",v(function(){var t=y(),n=g();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=N(e.inputCb);return function(){r.disconnect(),o(),u(),a(),i(),c()}}function D(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n=e.emit;if(!n)throw new Error("emit function is required");try{var r=[];r.push(l("DOMContentLoaded",function(){n(D({type:p.DomContentLoaded,data:{}}))}));var o=function(){n(D({type:p.Meta,data:{href:window.location.href,width:g(),height:y()}}));var e=d(document),o=e[0],u=e[1];if(!o)return console.warn("Failed to snapshot the document");h.map=u,n(D({type:p.FullSnapshot,data:{node:o,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),r.push(T({mutationCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.Mutation},e)}))},mousemoveCb:function(e){return n(D({type:p.IncrementalSnapshot,data:{source:f.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.MouseInteraction},e)}))},scrollCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.Scroll},e)}))},viewportResizeCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.ViewportResize},e)}))},inputCb:function(e){return n(D({type:p.IncrementalSnapshot,data:t({source:f.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?o():r.push(l("load",function(){n(D({type:p.Load,data:{}})),o()},window)),function(){r.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,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};!function(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 r=1;var i=/url\((['"]|)([^'"]*)\1\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function a(e,t){return e.replace(i,function(e,n,r){if(!o.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+r)+"')";var i,a=t.split("/"),s=r.split("/");a.pop();for(var c=0,u=s;c<u.length;c++){var d=u[c];"."!==d&&(".."===d?a.pop():a.push(d))}return"url('"+a.join("/")+"')"})}function s(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 r=e.classList.contains(c),i=e.tagName.toLowerCase(),o={},u=0,d=Array.from(e.attributes);u<d.length;u++){var l=d[u],p=l.name,h=l.value;o[p]="src"===p||"href"===p?s(n,h):h}if("link"===i){var m=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),f=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);f&&(o={_cssText:a(f,m.href)})}if("input"===i||"textarea"===i||"select"===i){h=e.value;"radio"!==o.type&&"checkbox"!==o.type&&h?o.value=h:e.checked&&(o.checked=e.checked)}if("option"===i){var v=e.parentElement;o.value===v.value&&(o.selected=e.selected)}if(r){var y=e.getBoundingClientRect(),g=y.width,b=y.height;o.rr_width=g+"px",o.rr_height=b+"px"}return{type:t.Element,tagName:i,attributes:o,childNodes:[],isSVG:(C=e,"svg"===C.tagName||C instanceof SVGElement||void 0),needBlock:r};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,E=e.textContent,N="STYLE"===w||void 0;return N&&E&&(E=a(E,location.href)),"SCRIPT"===w&&(E="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:E||"",isStyle:N};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,i,o){void 0===o&&(o=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:r++});e.__sn=s,i[s.id]=e;var c=!o;if(s.type===t.Element&&(c=c&&!s.needBlock,delete s.needBlock),(s.type===t.Document||s.type===t.Element)&&c)for(var l=0,p=Array.from(e.childNodes);l<p.length;l++){var h=d(p[l],n,i);h&&s.childNodes.push(h)}return s}function l(e){r=1;var t={};return[d(e,e,t),t]}var p={script:"noscript"};var h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function f(e){return e.replace(h,function(e,t,n){if(m.test(t)){var r=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function v(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 r=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),i=void 0;for(var o in i=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",r):n.createElement(r),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var a=e.attributes[o];a="boolean"==typeof a?"":a;var s="textarea"===r&&"value"===o,c="style"===r&&"_cssText"===o;if(c&&(a=f(a)),s||c){var u=n.createTextNode(a);i.appendChild(u);continue}if("iframe"===r&&"src"===o)continue;try{i.setAttribute(o,a)}catch(e){}}else e.attributes.rr_width&&(i.style.width=e.attributes.rr_width),e.attributes.rr_height&&(i.style.height=e.attributes.rr_height);return i;case t.Text:return n.createTextNode(e.isStyle?f(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function y(e,n,r,i){void 0===i&&(i=!1);var o=v(e,n);if(!o)return null;if(e.type===t.Document&&(n.close(),n.open(),o=n),o.__sn=e,r[e.id]=o,(e.type===t.Document||e.type===t.Element)&&!i)for(var a=0,s=e.childNodes;a<s.length;a++){var c=s[a],u=y(c,n,r);u?o.appendChild(u):console.warn("Failed to rebuild",c)}return o}function g(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 b,w,E,N={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return N.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete N.map[t],e.childNodes&&e.childNodes.forEach(function(e){return N.removeNodeFromMap(e)})},has:function(e){return N.map.hasOwnProperty(e)}};function C(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(){var o=Date.now();i||!1!==n.leading||(i=o);var a=t-(o-i),s=this,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),i=o,e.apply(s,c)):r||!1===n.trailing||(r=window.setTimeout(function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(s,c)},a))}}function I(){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}function x(e){var t=[];return Object.keys(E).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),i=function(t){return function(n){var r=N.getId(n.target),i=n.clientX,o=n.clientY;e({type:E[t],id:r,x:i,y:o})}}(n);t.push(g(r,i))}),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"}(b||(b={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(w||(w={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(E||(E={}));var M=["INPUT","TEXTAREA","SELECT"],D=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],S="rr-ignore",k=new WeakMap;function A(e){function t(e){var t=e.target;if(t&&t.tagName&&!(M.indexOf(t.tagName)<0)){var n=t.type;if("password"!==n&&!t.classList.contains(S)){var i=t.value,o=!1;"radio"!==n&&"checkbox"!==n||(o=t.checked),r(t,{text:i,isChecked:o});var a=t.name;"radio"===n&&a&&o&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!o})})}}}function r(t,r){var i=k.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){k.set(t,r);var o=N.getId(t);e(n({},r,{id:o}))}}var i=["input","change"].map(function(e){return g(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&i.push.apply(i,D.map(function(e){return function e(t,n,r){var i=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),i&&i.set&&i.set.call(this,e)}}),function(){return e(t,n,i||{})}}(e[0],e[1],{set:function(){t({target:this})}})})),function(){i.forEach(function(e){return e()})}}function O(e){var t,n,r=(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],i=[],o=[],a=[],s=new Set,c=function(e){s.add(e),e.childNodes.forEach(function(e){return c(e)})};e.forEach(function(e){var t=e.type,o=e.target,u=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(h=o.textContent)!==u&&n.push({value:h,node:o});break;case"attributes":var h;if((h=o.getAttribute(p))===u)return;var m=r.find(function(e){return e.node===o});m||(m={node:o,attributes:{}},r.push(m)),m.attributes[p]=h;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(o)&&!N.getId(e)||i.push({parentId:N.getId(o),id:N.getId(e)}),N.removeNodeFromMap(e)})}}),i=i.map(function(e){return e.parentNode&&(e.parentId=N.getId(e.parentNode),delete e.parentNode),e});var u=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||u(t))},l=function(e){var t=e.parentNode;if(!t)return!1;var n=N.getId(t);return!!i.some(function(e){return e.id===n})||l(t)};Array.from(s).forEach(function(e){u(e)||l(e)?a.push(e):o.push({parentId:N.getId(e.parentNode),previousId:e.previousSibling?N.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?N.getId(e.nextSibling):e.nextSibling,node:d(e,document,N.map,!0)})}),t({texts:n.map(function(e){return{id:N.getId(e.node),value:e.value}}).filter(function(e){return N.has(e.id)}),attributes:r.map(function(e){return{id:N.getId(e.node),attributes:e.attributes}}).filter(function(e){return N.has(e.id)}),removes:i,adds:o})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),i=function(e){var t,n=[],r=C(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return g("mousemove",C(function(e){var i=e.clientX,o=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:i,y:o,id:N.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),o=x(e.mouseInteractionCb),a=function(e){return g("scroll",C(function(t){if(t.target){var n=N.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),s=function(e){return g("resize",C(function(){var t=I(),n=T();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=A(e.inputCb);return function(){r.disconnect(),i(),o(),a(),s(),c()}}function L(e){return n({},e,{timestamp:Date.now()})}function _(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 R=Object.freeze({default:_}),F=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,r=this.config,i=this;this.raf=requestAnimationFrame(function o(a){for(e=a-t;n.length;){var s=n[0],c=s.delay/r.speed;if(!(e>=c))break;n.shift(),s.doAction()}n.length>0&&(i.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}(),z=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"],j=_||R,P={speed:1,root:document.body,loadTimeout:0},B=function(){function e(e,t){if(this.events=[],this.config=P,this.emitter=j(),this.baselineTime=0,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new F(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.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 i=r[n],o=i.timestamp<this.baselineTime,a=this.getCastFn(i,o);o?a():t.push({doAction:a,delay:this.getDelay(i)})}this.timer.addActions(t),this.timer.start()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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 i=r[n];if(!(i.timestamp<=this.lastPlayedEvent.timestamp||i===this.lastPlayedEvent)){var o=this.getCastFn(i);t.push({doAction:o,delay:this.getDelay(i)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit("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.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===b.IncrementalSnapshot&&e.data.source===w.MouseMove){var t=e.data.positions[0].timeOffset;return e.timestamp+t-this.baselineTime}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case b.DomContentLoaded:case b.Load:break;case b.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case b.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case b.IncrementalSnapshot:n=function(){r.applyIncremental(e,t)}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&r.emitter.emit("finish")}},e.prototype.rebuildFullSnapshot=function(e){var t,n,r;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},N.map=(t=e.data.node,n=this.iframe.contentDocument,r={},[y(t,n,r),r])[1];var i=document.createElement("style"),o=this.iframe.contentDocument,a=o.documentElement,s=o.head;a.insertBefore(i,s);for(var c=0;c<z.length;c++)i.sheet.insertRule(z[c],c);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("wait-stylesheet"),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("stylesheet-loaded"),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var r=this,i=e.data;switch(i.source){case w.Mutation:i.removes.forEach(function(e){var t=N.getNode(e.id);if(t){var n=N.getNode(e.parentId);N.removeNodeFromMap(t),n&&n.removeChild(t)}});var o=n({},this.missingNodeRetryMap);i.adds.forEach(function(e){var t=y(e.node,r.iframe.contentDocument,N.map,!0),n=N.getNode(e.parentId),i=null,a=null;e.previousId&&(i=N.getNode(e.previousId)),e.nextId&&(a=N.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?n.insertBefore(t,i.nextSibling):a&&a.parentNode?n.insertBefore(t,a):n.appendChild(t),(e.previousId||e.nextId)&&r.resolveMissingNode(o,n,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),i.texts.forEach(function(e){N.getNode(e.id).textContent=e.value}),i.attributes.forEach(function(e){var t=N.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case w.MouseMove:t||i.positions.forEach(function(t){var n={doAction:function(){r.mouse.style.left=t.x+"px",r.mouse.style.top=t.y+"px";var e=N.getNode(t.id);e&&r.hoverElements(e)},delay:t.timeOffset+e.timestamp-r.baselineTime};r.timer.addAction(n)});break;case w.MouseInteraction:if(-1===i.id)break;var a=new Event(E[i.type].toLowerCase()),s=N.getNode(i.id);switch(i.type){case E.Blur:s.blur();break;case E.Focus:s.focus({preventScroll:!0});break;case E.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case w.Scroll:if(-1===i.id)break;if((s=N.getNode(i.id))===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:i.y,left:i.x,behavior:t?"instant":"smooth"});else try{s.scrollTop=i.y,s.scrollLeft=i.x}catch(e){}break;case w.ViewportResize:this.emitter.emit("resize",{width:i.width,height:i.height});break;case w.Input:if(-1===i.id)break;(s=N.getNode(i.id)).checked=i.isChecked,s.value=i.text}},e.prototype.resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var c=a,u=c.node,d=c.mutation;t.insertBefore(u,n),delete e[d.node.id],delete this.missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.resolveMissingNode(e,t,u,d)}if(s){var l=s;u=l.node,d=l.mutation;t.insertBefore(u,n.nextSibling),delete e[d.node.id],delete this.missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.resolveMissingNode(e,t,u,d)}},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}();return e.record=function(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{var r=[];r.push(g("DOMContentLoaded",function(){t(L({type:b.DomContentLoaded,data:{}}))}));var i=function(){t(L({type:b.Meta,data:{href:window.location.href,width:T(),height:I()}}));var e=l(document),i=e[0],o=e[1];if(!i)return console.warn("Failed to snapshot the document");N.map=o,t(L({type:b.FullSnapshot,data:{node:i,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),r.push(O({mutationCb:function(e){return t(L({type:b.IncrementalSnapshot,data:n({source:w.Mutation},e)}))},mousemoveCb:function(e){return t(L({type:b.IncrementalSnapshot,data:{source:w.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(L({type:b.IncrementalSnapshot,data:n({source:w.MouseInteraction},e)}))},scrollCb:function(e){return t(L({type:b.IncrementalSnapshot,data:n({source:w.Scroll},e)}))},viewportResizeCb:function(e){return t(L({type:b.IncrementalSnapshot,data:n({source:w.ViewportResize},e)}))},inputCb:function(e){return t(L({type:b.IncrementalSnapshot,data:n({source:w.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?i():r.push(g("load",function(){t(L({type:b.Load,data:{}})),i()},window)),function(){r.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=B,e.mirror=N,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;var r=/url\((['"]|)([^'"]*)\1\)/gm,i=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function a(e,t){return e.replace(r,function(e,n,o){if(!i.test(o))return"url('"+o+"')";if("/"===o[0])return"url('"+(((r=t).indexOf("//")>-1?r.split("/").slice(0,3).join("/"):r.split("/")[0]).split("?")[0]+o)+"')";var r,a=t.split("/"),s=o.split("/");a.pop();for(var c=0,l=s;c<l.length;c++){var u=l[c];"."!==u&&(".."===u?a.pop():a.push(u))}return"url('"+a.join("/")+"')"})}function s(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function l(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={},l=0,u=Array.from(e.attributes);l<u.length;l++){var d=u[l],p=d.name,f=d.value;i[p]="src"===p||"href"===p?s(n,f):f}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:a(m,h.href)})}if("input"===r||"textarea"===r||"select"===r){f=e.value;"radio"!==i.type&&"checkbox"!==i.type&&f?i.value=f: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:(N=e,"svg"===N.tagName||N instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===w||void 0;return T&&E&&(E=a(E,location.href)),"SCRIPT"===w&&(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 N}function u(e,n,r,i){void 0===i&&(i=!1);var a=l(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 c=!i;if(s.type===t.Element&&(c=c&&!s.needBlock,delete s.needBlock),(s.type===t.Document||s.type===t.Element)&&c)for(var d=0,p=Array.from(e.childNodes);d<p.length;d++){var f=u(p[d],n,r);f&&s.childNodes.push(f)}return s}function d(e){o=1;var t={};return[u(e,e,t),t]}var p={script:"noscript"};var f=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,h=/([^\\]):hover/g;function m(e){return e.replace(f,function(e,t,n){if(h.test(t)){var o=t.replace(h,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function v(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,c="style"===o&&"_cssText"===i;if(c&&(a=m(a)),s||c){var l=n.createTextNode(a);r.appendChild(l);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?m(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function y(e,n,o,r){void 0===r&&(r=!1);var i=v(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 c=s[a],l=y(c,n,o);l?i.appendChild(l):console.warn("Failed to rebuild",c)}return i}function g(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 b,w,E,T={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return T.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete T.map[t],e.childNodes&&e.childNodes.forEach(function(e){return T.removeNodeFromMap(e)})},has:function(e){return T.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,c=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,c)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,c)},a))}}function x(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function C(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function I(e){var t=[];return Object.keys(E).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){var o=T.getId(n.target),r=n.clientX,i=n.clientY;e({type:E[t],id:o,x:r,y:i})}}(n);t.push(g(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"}(b||(b={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(w||(w={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(E||(E={}));var S=["INPUT","TEXTAREA","SELECT"],M=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],D="rr-ignore",O=new WeakMap;function L(e){function t(e){var t=e.target;if(t&&t.tagName&&!(S.indexOf(t.tagName)<0)){var n=t.type;if("password"!==n&&!t.classList.contains(D)){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=O.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){O.set(t,o);var i=T.getId(t);e(n({},o,{id:i}))}}var r=["input","change"].map(function(e){return g(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&r.push.apply(r,M.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 A(e){var t,n,o=(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],o=[],r=[],i=[],a=[],s=new Set,c=function(e){s.add(e),e.childNodes.forEach(function(e){return c(e)})};e.forEach(function(e){var t=e.type,i=e.target,l=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=i.textContent)!==l&&n.push({value:f,node:i});break;case"attributes":var f;if((f=i.getAttribute(p))===l)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[p]=f;case"childList":u.forEach(function(e){return c(e)}),d.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!T.getId(e)||r.push({parentId:T.getId(i),id:T.getId(e)}),T.removeNodeFromMap(e)})}}),r=r.map(function(e){return e.parentNode&&(e.parentId=T.getId(e.parentNode),delete e.parentNode),e});var l=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||l(t))},d=function(e){var t=e.parentNode;if(!t)return!1;var n=T.getId(t);return!!r.some(function(e){return e.id===n})||d(t)};Array.from(s).forEach(function(e){l(e)||d(e)?a.push(e):i.push({parentId:T.getId(e.parentNode),previousId:e.previousSibling?T.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?T.getId(e.nextSibling):e.nextSibling,node:u(e,document,T.map,!0)})}),t({texts:n.map(function(e){return{id:T.getId(e.node),value:e.value}}).filter(function(e){return T.has(e.id)}),attributes:o.map(function(e){return{id:T.getId(e.node),attributes:e.attributes}}).filter(function(e){return T.has(e.id)}),removes:r,adds:i})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),r=function(e){var t,n=[],o=N(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500);return g("mousemove",N(function(e){var r=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:r,y:i,id:T.getId(a),timeOffset:Date.now()-t}),o()},20,{trailing:!1}))}(e.mousemoveCb),i=I(e.mouseInteractionCb),a=function(e){return g("scroll",N(function(t){if(t.target){var n=T.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),s=function(e){return g("resize",N(function(){var t=x(),n=C();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=L(e.inputCb);return function(){o.disconnect(),r(),i(),a(),s(),c()}}function k(e){return n({},e,{timestamp:Date.now()})}function _(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 R=Object.freeze({default:_});var F,B=(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||c,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!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},o.prototype.scrollIntoView=function(){if(!0!==l(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?(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 c(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function 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,c=(a()-t.startTime)/r;s=c=c>1?1:c,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 h(n,o,r){var s,l,u,d,p=a();n===t.body?(s=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,l=n.scrollLeft,u=n.scrollTop,d=c),f({scrollable:s,method:d,startTime:p,startX:l,startY:u,x:o,y:r})}}}}()}(F={exports:{}},F.exports),F.exports).polyfill,j=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,o=this.config,r=this;this.raf=requestAnimationFrame(function i(a){for(e=a-t;n.length;){var s=n[0],c=s.delay/o.speed;if(!(e>=c))break;n.shift(),s.doAction()}n.length>0&&(r.raf=requestAnimationFrame(i))})},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}(),z=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];B();var X=_||R,Y={speed:1,root:document.body,loadTimeout:0},P=function(){function e(e,t){if(this.events=[],this.config=Y,this.emitter=X(),this.baselineTime=0,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new j(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.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()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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("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===b.IncrementalSnapshot&&e.data.source===w.MouseMove){var t=e.data.positions[0].timeOffset;return e.timestamp+t-this.baselineTime}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case b.DomContentLoaded:case b.Load:break;case b.Meta:n=function(){return o.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case b.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case b.IncrementalSnapshot:n=function(){o.applyIncremental(e,t)}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&o.emitter.emit("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={},T.map=(t=e.data.node,n=this.iframe.contentDocument,o={},[y(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 c=0;c<z.length;c++)r.sheet.insertRule(z[c],c);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("wait-stylesheet"),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("stylesheet-loaded"),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case w.Mutation:r.removes.forEach(function(e){var t=T.getNode(e.id);if(t){var n=T.getNode(e.parentId);T.removeNodeFromMap(t),n&&n.removeChild(t)}});var i=n({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=y(e.node,o.iframe.contentDocument,T.map,!0),n=T.getNode(e.parentId),r=null,a=null;e.previousId&&(r=T.getNode(e.previousId)),e.nextId&&(a=T.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(r&&r.nextSibling&&r.nextSibling.parentNode?n.insertBefore(t,r.nextSibling):a&&a.parentNode?n.insertBefore(t,a):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){T.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=T.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var o=e.attributes[n];o?t.setAttribute(n,o):t.removeAttribute(n)}});break;case w.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.mouse.style.left=t.x+"px",o.mouse.style.top=t.y+"px";var e=T.getNode(t.id);e&&o.hoverElements(e)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case w.MouseInteraction:if(-1===r.id)break;var a=new Event(E[r.type].toLowerCase()),s=T.getNode(r.id);switch(r.type){case E.Blur:s.blur();break;case E.Focus:s.focus({preventScroll:!0});break;case E.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case w.Scroll:if(-1===r.id)break;if((s=T.getNode(r.id))===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"instant":"smooth"});else try{s.scrollTop=r.y,s.scrollLeft=r.x}catch(e){}break;case w.ViewportResize:this.emitter.emit("resize",{width:r.width,height:r.height});break;case w.Input:if(-1===r.id)break;(s=T.getNode(r.id)).checked=r.isChecked,s.value=r.text}},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 c=a,l=c.node,u=c.mutation;t.insertBefore(l,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}if(s){var d=s;l=d.node,u=d.mutation;t.insertBefore(l,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}},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}();return e.record=function(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{var o=[];o.push(g("DOMContentLoaded",function(){t(k({type:b.DomContentLoaded,data:{}}))}));var r=function(){t(k({type:b.Meta,data:{href:window.location.href,width:C(),height:x()}}));var e=d(document),r=e[0],i=e[1];if(!r)return console.warn("Failed to snapshot the document");T.map=i,t(k({type:b.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),o.push(A({mutationCb:function(e){return t(k({type:b.IncrementalSnapshot,data:n({source:w.Mutation},e)}))},mousemoveCb:function(e){return t(k({type:b.IncrementalSnapshot,data:{source:w.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(k({type:b.IncrementalSnapshot,data:n({source:w.MouseInteraction},e)}))},scrollCb:function(e){return t(k({type:b.IncrementalSnapshot,data:n({source:w.Scroll},e)}))},viewportResizeCb:function(e){return t(k({type:b.IncrementalSnapshot,data:n({source:w.ViewportResize},e)}))},inputCb:function(e){return t(k({type:b.IncrementalSnapshot,data:n({source:w.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():o.push(g("load",function(){t(k({type:b.Load,data:{}})),r()},window)),function(){o.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=P,e.mirror=T,e}({});
//# sourceMappingURL=rrweb.min.js.map

@@ -552,6 +552,7 @@ /*! *****************************************************************************

if (evt.target === document) {
var scrollEl = (document.scrollingElement || document.documentElement);
cb({
id: id,
x: document.documentElement.scrollLeft,
y: document.documentElement.scrollTop
x: scrollEl.scrollLeft,
y: scrollEl.scrollTop
});

@@ -558,0 +559,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\((['"]|)([^'"]*)\1\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!RELATIVE_PATH.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(extractOrigin(t)+r)+"')";var o=t.split("/"),i=r.split("/");o.pop();for(var a=0,u=i;a<u.length;a++){var c=u[a];"."!==c&&(".."===c?o.pop():o.push(c))}return"url('"+o.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],c=u.name,s=u.value;o[c]="src"===c||"href"===c?absoluteToDoc(t,s):s}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){s=e.value;"radio"!==o.type&&"checkbox"!==o.type&&s?o.value=s: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,c=Array.from(e.childNodes);u<c.length;u++){var s=serializeNodeWithId(c[u],t,n);s&&i.childNodes.push(s)}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 EventType,IncrementalSource,MouseInteractions,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,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,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)},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 initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],u=new Set,c=function(e){u.add(e),e.childNodes.forEach(function(e){return c(e)})};t.forEach(function(e){var t=e.type,i=e.target,s=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(m=i.textContent)!==s&&n.push({value:m,node:i});break;case"attributes":var m;if((m=i.getAttribute(p))===s)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){u.has(e)?(u.delete(e),a.push(e)):u.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),e});var s=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||s(t))},d=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!o.some(function(e){return e.id===n})||d(t)};Array.from(u).forEach(function(e){s(e)||d(e)?a.push(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)})}),e({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})});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()},20,{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){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){var n=mirror.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):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={}));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)){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=e.emit;if(!t)throw new Error("emit function is required");try{var n=[];n.push(on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var r=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");mirror.map=o,t(wrapEvent({type:EventType.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),n.push(initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():n.push(on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),r()},window)),function(){n.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\((['"]|)([^'"]*)\1\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!RELATIVE_PATH.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(extractOrigin(t)+r)+"')";var o=t.split("/"),i=r.split("/");o.pop();for(var a=0,u=i;a<u.length;a++){var c=u[a];"."!==c&&(".."===c?o.pop():o.push(c))}return"url('"+o.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],c=u.name,s=u.value;o[c]="src"===c||"href"===c?absoluteToDoc(t,s):s}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){s=e.value;"radio"!==o.type&&"checkbox"!==o.type&&s?o.value=s: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,c=Array.from(e.childNodes);u<c.length;u++){var s=serializeNodeWithId(c[u],t,n);s&&i.childNodes.push(s)}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 EventType,IncrementalSource,MouseInteractions,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,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,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)},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 initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],u=new Set,c=function(e){u.add(e),e.childNodes.forEach(function(e){return c(e)})};t.forEach(function(e){var t=e.type,i=e.target,s=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(m=i.textContent)!==s&&n.push({value:m,node:i});break;case"attributes":var m;if((m=i.getAttribute(p))===s)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){u.has(e)?(u.delete(e),a.push(e)):u.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),e});var s=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||s(t))},d=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!o.some(function(e){return e.id===n})||d(t)};Array.from(u).forEach(function(e){s(e)||d(e)?a.push(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)})}),e({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})});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()},20,{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){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){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={}));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)){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=e.emit;if(!t)throw new Error("emit function is required");try{var n=[];n.push(on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var r=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");mirror.map=o,t(wrapEvent({type:EventType.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),n.push(initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():n.push(on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),r()},window)),function(){n.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
//# sourceMappingURL=rrweb-record.min.js.map

@@ -667,6 +667,7 @@ /*! *****************************************************************************

if (evt.target === document) {
var scrollEl = (document.scrollingElement || document.documentElement);
cb({
id: id,
x: document.documentElement.scrollLeft,
y: document.documentElement.scrollTop
x: scrollEl.scrollLeft,
y: scrollEl.scrollTop
});

@@ -953,2 +954,445 @@ }

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var smoothscroll = createCommonjsModule(function (module, exports) {
/* smoothscroll v0.4.0 - 2018 - Dustan Kasten, Jeremias Menichelli - MIT License */
(function () {
// polyfill
function polyfill() {
// aliases
var w = window;
var d = document;
// return if scroll behavior is supported and polyfill is not forced
if (
'scrollBehavior' in d.documentElement.style &&
w.__forceSmoothScrollPolyfill__ !== true
) {
return;
}
// globals
var Element = w.HTMLElement || w.Element;
var SCROLL_TIME = 468;
// object gathering original scroll methods
var original = {
scroll: w.scroll || w.scrollTo,
scrollBy: w.scrollBy,
elementScroll: Element.prototype.scroll || scrollElement,
scrollIntoView: Element.prototype.scrollIntoView
};
// define timing method
var now =
w.performance && w.performance.now
? w.performance.now.bind(w.performance)
: Date.now;
/**
* indicates if a the current browser is made by Microsoft
* @method isMicrosoftBrowser
* @param {String} userAgent
* @returns {Boolean}
*/
function isMicrosoftBrowser(userAgent) {
var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];
return new RegExp(userAgentPatterns.join('|')).test(userAgent);
}
/*
* IE has rounding bug rounding down clientHeight and clientWidth and
* rounding up scrollHeight and scrollWidth causing false positives
* on hasScrollableSpace
*/
var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;
/**
* changes scroll position inside an element
* @method scrollElement
* @param {Number} x
* @param {Number} y
* @returns {undefined}
*/
function scrollElement(x, y) {
this.scrollLeft = x;
this.scrollTop = y;
}
/**
* returns result of applying ease math function to a number
* @method ease
* @param {Number} k
* @returns {Number}
*/
function ease(k) {
return 0.5 * (1 - Math.cos(Math.PI * k));
}
/**
* indicates if a smooth behavior should be applied
* @method shouldBailOut
* @param {Number|Object} firstArg
* @returns {Boolean}
*/
function shouldBailOut(firstArg) {
if (
firstArg === null ||
typeof firstArg !== 'object' ||
firstArg.behavior === undefined ||
firstArg.behavior === 'auto' ||
firstArg.behavior === 'instant'
) {
// first argument is not an object/null
// or behavior is auto, instant or undefined
return true;
}
if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {
// first argument is an object and behavior is smooth
return false;
}
// throw error when behavior is not supported
throw new TypeError(
'behavior member of ScrollOptions ' +
firstArg.behavior +
' is not a valid value for enumeration ScrollBehavior.'
);
}
/**
* indicates if an element has scrollable space in the provided axis
* @method hasScrollableSpace
* @param {Node} el
* @param {String} axis
* @returns {Boolean}
*/
function hasScrollableSpace(el, axis) {
if (axis === 'Y') {
return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;
}
if (axis === 'X') {
return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;
}
}
/**
* indicates if an element has a scrollable overflow property in the axis
* @method canOverflow
* @param {Node} el
* @param {String} axis
* @returns {Boolean}
*/
function canOverflow(el, axis) {
var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];
return overflowValue === 'auto' || overflowValue === 'scroll';
}
/**
* indicates if an element can be scrolled in either axis
* @method isScrollable
* @param {Node} el
* @param {String} axis
* @returns {Boolean}
*/
function isScrollable(el) {
var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');
var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');
return isScrollableY || isScrollableX;
}
/**
* finds scrollable parent of an element
* @method findScrollableParent
* @param {Node} el
* @returns {Node} el
*/
function findScrollableParent(el) {
var isBody;
do {
el = el.parentNode;
isBody = el === d.body;
} while (isBody === false && isScrollable(el) === false);
isBody = null;
return el;
}
/**
* self invoked function that, given a context, steps through scrolling
* @method step
* @param {Object} context
* @returns {undefined}
*/
function step(context) {
var time = now();
var value;
var currentX;
var currentY;
var elapsed = (time - context.startTime) / SCROLL_TIME;
// avoid elapsed times higher than one
elapsed = elapsed > 1 ? 1 : elapsed;
// apply easing to elapsed time
value = ease(elapsed);
currentX = context.startX + (context.x - context.startX) * value;
currentY = context.startY + (context.y - context.startY) * value;
context.method.call(context.scrollable, currentX, currentY);
// scroll more if we have not reached our destination
if (currentX !== context.x || currentY !== context.y) {
w.requestAnimationFrame(step.bind(w, context));
}
}
/**
* scrolls window or element with a smooth behavior
* @method smoothScroll
* @param {Object|Node} el
* @param {Number} x
* @param {Number} y
* @returns {undefined}
*/
function smoothScroll(el, x, y) {
var scrollable;
var startX;
var startY;
var method;
var startTime = now();
// define scroll context
if (el === d.body) {
scrollable = w;
startX = w.scrollX || w.pageXOffset;
startY = w.scrollY || w.pageYOffset;
method = original.scroll;
} else {
scrollable = el;
startX = el.scrollLeft;
startY = el.scrollTop;
method = scrollElement;
}
// scroll looping over a frame
step({
scrollable: scrollable,
method: method,
startTime: startTime,
startX: startX,
startY: startY,
x: x,
y: y
});
}
// ORIGINAL METHODS OVERRIDES
// w.scroll and w.scrollTo
w.scroll = w.scrollTo = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
original.scroll.call(
w,
arguments[0].left !== undefined
? arguments[0].left
: typeof arguments[0] !== 'object'
? arguments[0]
: w.scrollX || w.pageXOffset,
// use top prop, second argument if present or fallback to scrollY
arguments[0].top !== undefined
? arguments[0].top
: arguments[1] !== undefined
? arguments[1]
: w.scrollY || w.pageYOffset
);
return;
}
// LET THE SMOOTHNESS BEGIN!
smoothScroll.call(
w,
d.body,
arguments[0].left !== undefined
? ~~arguments[0].left
: w.scrollX || w.pageXOffset,
arguments[0].top !== undefined
? ~~arguments[0].top
: w.scrollY || w.pageYOffset
);
};
// w.scrollBy
w.scrollBy = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0])) {
original.scrollBy.call(
w,
arguments[0].left !== undefined
? arguments[0].left
: typeof arguments[0] !== 'object' ? arguments[0] : 0,
arguments[0].top !== undefined
? arguments[0].top
: arguments[1] !== undefined ? arguments[1] : 0
);
return;
}
// LET THE SMOOTHNESS BEGIN!
smoothScroll.call(
w,
d.body,
~~arguments[0].left + (w.scrollX || w.pageXOffset),
~~arguments[0].top + (w.scrollY || w.pageYOffset)
);
};
// Element.prototype.scroll and Element.prototype.scrollTo
Element.prototype.scroll = Element.prototype.scrollTo = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
// if one number is passed, throw error to match Firefox implementation
if (typeof arguments[0] === 'number' && arguments[1] === undefined) {
throw new SyntaxError('Value could not be converted');
}
original.elementScroll.call(
this,
// use left prop, first number argument or fallback to scrollLeft
arguments[0].left !== undefined
? ~~arguments[0].left
: typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,
// use top prop, second argument or fallback to scrollTop
arguments[0].top !== undefined
? ~~arguments[0].top
: arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop
);
return;
}
var left = arguments[0].left;
var top = arguments[0].top;
// LET THE SMOOTHNESS BEGIN!
smoothScroll.call(
this,
this,
typeof left === 'undefined' ? this.scrollLeft : ~~left,
typeof top === 'undefined' ? this.scrollTop : ~~top
);
};
// Element.prototype.scrollBy
Element.prototype.scrollBy = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
original.elementScroll.call(
this,
arguments[0].left !== undefined
? ~~arguments[0].left + this.scrollLeft
: ~~arguments[0] + this.scrollLeft,
arguments[0].top !== undefined
? ~~arguments[0].top + this.scrollTop
: ~~arguments[1] + this.scrollTop
);
return;
}
this.scroll({
left: ~~arguments[0].left + this.scrollLeft,
top: ~~arguments[0].top + this.scrollTop,
behavior: arguments[0].behavior
});
};
// Element.prototype.scrollIntoView
Element.prototype.scrollIntoView = function() {
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
original.scrollIntoView.call(
this,
arguments[0] === undefined ? true : arguments[0]
);
return;
}
// LET THE SMOOTHNESS BEGIN!
var scrollableParent = findScrollableParent(this);
var parentRects = scrollableParent.getBoundingClientRect();
var clientRects = this.getBoundingClientRect();
if (scrollableParent !== d.body) {
// reveal element inside parent
smoothScroll.call(
this,
scrollableParent,
scrollableParent.scrollLeft + clientRects.left - parentRects.left,
scrollableParent.scrollTop + clientRects.top - parentRects.top
);
// reveal parent in viewport unless is fixed
if (w.getComputedStyle(scrollableParent).position !== 'fixed') {
w.scrollBy({
left: parentRects.left,
top: parentRects.top,
behavior: 'smooth'
});
}
} else {
// reveal element in viewport
w.scrollBy({
left: clientRects.left,
top: clientRects.top,
behavior: 'smooth'
});
}
};
}
{
// commonjs
module.exports = { polyfill: polyfill };
}
}());
});
var smoothscroll_1 = smoothscroll.polyfill;
var Timer = (function () {

@@ -1024,2 +1468,3 @@ function Timer(config, actions) {

smoothscroll_1();
var mitt$1 = mitt || mittProxy;

@@ -1117,2 +1562,3 @@ var defaultConfig = {

this.iframe.setAttribute('sandbox', 'allow-same-origin');
this.iframe.setAttribute('scrolling', 'no');
this.wrapper.appendChild(this.iframe);

@@ -1119,0 +1565,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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);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\((['"]|)([^'"]*)\1\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!RELATIVE_PATH.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(extractOrigin(t)+r)+"')";var i=t.split("/"),o=r.split("/");i.pop();for(var a=0,s=o;a<s.length;a++){var u=s[a];"."!==u&&(".."===u?i.pop():i.push(u))}return"url('"+i.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(),i={},o=0,a=Array.from(e.attributes);o<a.length;o++){var s=a[o],u=s.name,c=s.value;i[u]="src"===u||"href"===u?absoluteToDoc(t,c):c}if("link"===r){var d=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),l=getCssRulesString(d);l&&(i={_cssText:absoluteToStylesheet(l,d.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==i.type&&"checkbox"!==i.type&&c?i.value=c:e.checked&&(i.checked=e.checked)}if("option"===r){var p=e.parentElement;i.value===p.value&&(i.selected=e.selected)}if(n){var m=e.getBoundingClientRect(),h=m.width,f=m.height;i.rr_width=h+"px",i.rr_height=f+"px"}return{type:NodeType.Element,tagName:r,attributes:i,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 i=serializeNode(e,t);if(!i)return console.warn(e,"not serialized"),null;var o=Object.assign(i,{id:genId()});e.__sn=o,n[o.id]=e;var a=!r;if(o.type===NodeType.Element&&(a=a&&!o.needBlock,delete o.needBlock),(o.type===NodeType.Document||o.type===NodeType.Element)&&a)for(var s=0,u=Array.from(e.childNodes);s<u.length;s++){var c=serializeNodeWithId(u[s],t,n);c&&o.childNodes.push(c)}return o}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript"};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 i in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var o=e.attributes[i];o="boolean"==typeof o?"":o;var a="textarea"===n&&"value"===i,s="style"===n&&"_cssText"===i;if(s&&(o=addHoverClass(o)),a||s){var u=t.createTextNode(o);r.appendChild(u);continue}if("iframe"===n&&"src"===i)continue;try{r.setAttribute(i,o)}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 i=buildNode(e,t);if(!i)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),i=t),i.__sn=e,n[e.id]=i,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var o=0,a=e.childNodes;o<a.length;o++){var s=a[o],u=buildNodeWithSN(s,t,n);u?i.appendChild(u):console.warn("Failed to rebuild",s)}return i}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 EventType,IncrementalSource,MouseInteractions,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,i=0;return function(){var o=Date.now();i||!1!==n.leading||(i=o);var a=t-(o-i),s=this,u=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),i=o,e.apply(s,u)):r||!1===n.trailing||(r=window.setTimeout(function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(s,u)},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 initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],i=[],o=[],a=[],s=new Set,u=function(e){s.add(e),e.childNodes.forEach(function(e){return u(e)})};t.forEach(function(e){var t=e.type,o=e.target,c=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(m=o.textContent)!==c&&n.push({value:m,node:o});break;case"attributes":var m;if((m=o.getAttribute(p))===c)return;var h=r.find(function(e){return e.node===o});h||(h={node:o,attributes:{}},r.push(h)),h.attributes[p]=m;case"childList":d.forEach(function(e){return u(e)}),l.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(o)&&!mirror.getId(e)||i.push({parentId:mirror.getId(o),id:mirror.getId(e)}),mirror.removeNodeFromMap(e)})}}),i=i.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),e});var c=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||c(t))},d=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!i.some(function(e){return e.id===n})||d(t)};Array.from(s).forEach(function(e){c(e)||d(e)?a.push(e):o.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)})}),e({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:i,adds:o})});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 i=e.clientX,o=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:i,y:o,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},20,{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(),i=function(t){return function(n){var r=mirror.getId(n.target),i=n.clientX,o=n.clientY;e({type:MouseInteractions[t],id:r,x:i,y:o})}}(n);t.push(on(r,i))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target){var n=mirror.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):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={}));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)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var i=t.value,o=!1;"radio"!==r&&"checkbox"!==r||(o=t.checked),n(t,{text:i,isChecked:o});var a=t.name;"radio"===r&&a&&o&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!o})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var i=mirror.getId(t);e(__assign({},n,{id:i}))}}var r=["input","change"].map(function(e){return on(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.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),i=initScrollObserver(e.scrollCb),o=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),i(),o(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{var n=[];n.push(on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var r=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),r=e[0],i=e[1];if(!r)return console.warn("Failed to snapshot the document");mirror.map=i,t(wrapEvent({type:EventType.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),n.push(initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():n.push(on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),r()},window)),function(){n.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}),Timer=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,r=this.config,i=this;this.raf=requestAnimationFrame(function o(a){for(e=a-t;n.length;){var s=n[0],u=s.delay/r.speed;if(!(e>=u))break;n.shift(),s.doAction()}n.length>0&&(i.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; }"],mitt$1=mitt||mittProxy,defaultConfig={speed:1,root:document.body,loadTimeout:0},Replayer=function(){function e(e,t){if(this.events=[],this.config=defaultConfig,this.emitter=mitt$1(),this.baselineTime=0,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new Timer(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.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 i=r[n],o=i.timestamp<this.baselineTime,a=this.getCastFn(i,o);o?a():t.push({doAction:a,delay:this.getDelay(i)})}this.timer.addActions(t),this.timer.start()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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 i=r[n];if(!(i.timestamp<=this.lastPlayedEvent.timestamp||i===this.lastPlayedEvent)){var o=this.getCastFn(i);t.push({doAction:o,delay:this.getDelay(i)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit("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.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;return e.timestamp+t-this.baselineTime}return 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("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(){r.applyIncremental(e,t)}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&r.emitter.emit("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,i=n.head;r.insertBefore(t,i);for(var o=0;o<rules.length;o++)t.sheet.insertRule(rules[o],o);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("wait-stylesheet"),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("stylesheet-loaded"),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){var n=mirror.getNode(e.parentId);mirror.removeNodeFromMap(t),n&&n.removeChild(t)}});var i=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),r=mirror.getNode(e.parentId),o=null,a=null;e.previousId&&(o=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?r.insertBefore(t,o.nextSibling):a&&a.parentNode?r.insertBefore(t,a):r.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(i,r,t,e)):i[e.node.id]={node:t,mutation:e}}),Object.keys(i).length&&Object.assign(this.missingNodeRetryMap,i),r.texts.forEach(function(e){mirror.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case IncrementalSource.MouseMove:t||r.positions.forEach(function(t){var r={doAction:function(){n.mouse.style.left=t.x+"px",n.mouse.style.top=t.y+"px";var e=mirror.getNode(t.id);e&&n.hoverElements(e)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(r)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var o=new Event(MouseInteractions[r.type].toLowerCase()),a=mirror.getNode(r.id);switch(r.type){case MouseInteractions.Blur:a.blur();break;case MouseInteractions.Focus:a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(o)}break;case IncrementalSource.Scroll:if(-1===r.id)break;if((a=mirror.getNode(r.id))===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"instant":"smooth"});else try{a.scrollTop=r.y,a.scrollLeft=r.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit("resize",{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;(a=mirror.getNode(r.id)).checked=r.isChecked,a.value=r.text}},e.prototype.resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var u=a,c=u.node,d=u.mutation;t.insertBefore(c,n),delete e[d.node.id],delete this.missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.resolveMissingNode(e,t,c,d)}if(s){var l=s;c=l.node,d=l.mutation;t.insertBefore(c,n.nextSibling),delete e[d.node.id],delete this.missingNodeRetryMap[d.node.id],(d.previousId||d.nextId)&&this.resolveMissingNode(e,t,c,d)}},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}();export{record,Replayer,mirror};
var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(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\((['"]|)([^'"]*)\1\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,r,n){if(!RELATIVE_PATH.test(n))return"url('"+n+"')";if("/"===n[0])return"url('"+(extractOrigin(t)+n)+"')";var o=t.split("/"),i=n.split("/");o.pop();for(var a=0,s=i;a<s.length;a++){var c=s[a];"."!==c&&(".."===c?o.pop():o.push(c))}return"url('"+o.join("/")+"')"})}function absoluteToDoc(e,t){var r=e.createElement("a");return r.href=t,r.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 r=e.classList.contains(BLOCK_CLASS),n=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var s=a[i],c=s.name,l=s.value;o[c]="src"===c||"href"===c?absoluteToDoc(t,l):l}if("link"===n){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"===n||"textarea"===n||"select"===n){l=e.value;"radio"!==o.type&&"checkbox"!==o.type&&l?o.value=l:e.checked&&(o.checked=e.checked)}if("option"===n){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(r){var m=e.getBoundingClientRect(),f=m.width,h=m.height;o.rr_width=f+"px",o.rr_height=h+"px"}return{type:NodeType.Element,tagName:n,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:r};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,r,n){void 0===n&&(n=!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,r[i.id]=e;var a=!n;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,c=Array.from(e.childNodes);s<c.length;s++){var l=serializeNodeWithId(c[s],t,r);l&&i.childNodes.push(l)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript"};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,r){if(HOVER_SELECTOR.test(t)){var n=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+n.replace(/^\s*/,"")+r}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 r=getTagName(e),n=void 0;for(var o in n=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",r):t.createElement(r),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===r&&"value"===o,s="style"===r&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var c=t.createTextNode(i);n.appendChild(c);continue}if("iframe"===r&&"src"===o)continue;try{n.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(n.style.width=e.attributes.rr_width),e.attributes.rr_height&&(n.style.height=e.attributes.rr_height);return n;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,r,n){void 0===n&&(n=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,r[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!n)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],c=buildNodeWithSN(s,t,r);c?o.appendChild(c):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var r={};return[buildNodeWithSN(e,t,r),r]}function on(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}var EventType,IncrementalSource,MouseInteractions,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,r){void 0===r&&(r={});var n=null,o=0;return function(){var i=Date.now();o||!1!==r.leading||(o=i);var a=t-(i-o),s=this,c=arguments;a<=0||a>t?(n&&(window.clearTimeout(n),n=null),o=i,e.apply(s,c)):n||!1===r.trailing||(n=window.setTimeout(function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(s,c)},a))}}function hookSetter(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),n&&n.set&&n.set.call(this,e)}}),function(){return hookSetter(e,t,n||{})}}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 initMutationObserver(e){var t=new MutationObserver(function(t){var r=[],n=[],o=[],i=[],a=[],s=new Set,c=function(e){s.add(e),e.childNodes.forEach(function(e){return c(e)})};t.forEach(function(e){var t=e.type,i=e.target,l=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(m=i.textContent)!==l&&r.push({value:m,node:i});break;case"attributes":var m;if((m=i.getAttribute(p))===l)return;var f=n.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},n.push(f)),f.attributes[p]=m;case"childList":u.forEach(function(e){return c(e)}),d.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),e});var l=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||l(t))},u=function(e){var t=e.parentNode;if(!t)return!1;var r=mirror.getId(t);return!!o.some(function(e){return e.id===r})||u(t)};Array.from(s).forEach(function(e){l(e)||u(e)?a.push(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)})}),e({texts:r.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:n.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i})});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,r=[],n=throttle(function(){var n=Date.now()-t;e(r.map(function(e){return e.timeOffset-=n,e})),r=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),r.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),n()},20,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var n=r.toLowerCase(),o=function(t){return function(r){var n=mirror.getId(r.target),o=r.clientX,i=r.clientY;e({type:MouseInteractions[t],id:n,x:o,y:i})}}(r);t.push(on(n,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target){var r=mirror.getId(t.target);if(t.target===document){var n=document.scrollingElement||document.documentElement;e({id:r,x:n.scrollLeft,y:n.scrollTop})}else e({id:r,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),r=getWindowWidth();e({width:Number(r),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={}));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)){var n=t.type;if("password"!==n&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==n&&"checkbox"!==n||(i=t.checked),r(t,{text:o,isChecked:i});var a=t.name;"radio"===n&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!i})})}}}function r(t,r){var n=lastInputValueMap.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){lastInputValueMap.set(t,r);var o=mirror.getId(t);e(__assign({},r,{id:o}))}}var n=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&n.push.apply(n,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){n.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),r=initMousemoveObserver(e.mousemoveCb),n=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),r(),n(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{var r=[];r.push(on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var n=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),n=e[0],o=e[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=o,t(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),r.push(initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?n():r.push(on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),n()},window)),function(){r.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map(function(e){e(r)}),(e["*"]||[]).slice().map(function(e){e(t,r)})}}}var 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 r,n=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?f.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):f.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;f.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=function(e){var r;do{r=(e=e.parentNode)===t.body}while(!1===r&&!1===p(e));return r=null,e}(this),n=r.getBoundingClientRect(),o=this.getBoundingClientRect();r!==t.body?(f.call(this,r,r.scrollLeft+o.left-n.left,r.scrollTop+o.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function c(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function p(e){var t=u(e,"Y")&&d(e,"Y"),r=u(e,"X")&&d(e,"X");return t||r}function m(t){var r,n,i,s,c=(a()-t.startTime)/o;s=c=c>1?1:c,r=.5*(1-Math.cos(Math.PI*s)),n=t.startX+(t.x-t.startX)*r,i=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,i),n===t.x&&i===t.y||e.requestAnimationFrame(m.bind(e,t))}function f(r,n,o){var s,l,u,d,p=a();r===t.body?(s=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=r,l=r.scrollLeft,u=r.scrollTop,d=c),m({scrollable:s,method:d,startTime:p,startX:l,startY:u,x:n,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),r=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function i(a){for(e=a-t;r.length;){var s=r[0],c=s.delay/n.speed;if(!(e>=c))break;r.shift(),s.doAction()}r.length>0&&(o.raf=requestAnimationFrame(i))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n;r=n-1}}return t},e}(),rules=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];smoothscroll_1();var mitt$1=mitt||mittProxy,defaultConfig={speed:1,root:document.body,loadTimeout:0},Replayer=function(){function e(e,t){if(this.events=[],this.config=defaultConfig,this.emitter=mitt$1(),this.baselineTime=0,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new Timer(this.config),this.setConfig(Object.assign({},t)),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(r){t.config[r]=e[r]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.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,r=0,n=this.events;r<n.length;r++){var o=n[r],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()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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,r=0,n=this.events;r<n.length;r++){var o=n[r];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("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;return e.timestamp+t-this.baselineTime}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var r,n=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:r=function(){return n.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:r=function(){n.rebuildFullSnapshot(e),n.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:r=function(){n.applyIncremental(e,t)}}return function(){r&&r(),n.lastPlayedEvent=e,e===n.events[n.events.length-1]&&n.emitter.emit("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"),r=this.iframe.contentDocument,n=r.documentElement,o=r.head;n.insertBefore(t,o);for(var i=0;i<rules.length;i++)t.sheet.insertRule(rules[i],i);this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var r,n=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===n.size&&(e.pause(),e.emitter.emit("wait-stylesheet"),r=window.setTimeout(function(){e.resume(),r=-1},e.config.loadTimeout)),n.add(t),t.addEventListener("load",function(){n.delete(t),0===n.size&&-1!==r&&(e.resume(),e.emitter.emit("stylesheet-loaded"),r&&window.clearTimeout(r))}))})}},e.prototype.applyIncremental=function(e,t){var r=this,n=e.data;switch(n.source){case IncrementalSource.Mutation:n.removes.forEach(function(e){var t=mirror.getNode(e.id);if(t){var r=mirror.getNode(e.parentId);mirror.removeNodeFromMap(t),r&&r.removeChild(t)}});var o=__assign({},this.missingNodeRetryMap);n.adds.forEach(function(e){var t=buildNodeWithSN(e.node,r.iframe.contentDocument,mirror.map,!0),n=mirror.getNode(e.parentId),i=null,a=null;e.previousId&&(i=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?n.insertBefore(t,i.nextSibling):a&&a.parentNode?n.insertBefore(t,a):n.appendChild(t),(e.previousId||e.nextId)&&r.resolveMissingNode(o,n,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),n.texts.forEach(function(e){mirror.getNode(e.id).textContent=e.value}),n.attributes.forEach(function(e){var t=mirror.getNode(e.id);for(var r in e.attributes)if("string"==typeof r){var n=e.attributes[r];n?t.setAttribute(r,n):t.removeAttribute(r)}});break;case IncrementalSource.MouseMove:t||n.positions.forEach(function(t){var n={doAction:function(){r.mouse.style.left=t.x+"px",r.mouse.style.top=t.y+"px";var e=mirror.getNode(t.id);e&&r.hoverElements(e)},delay:t.timeOffset+e.timestamp-r.baselineTime};r.timer.addAction(n)});break;case IncrementalSource.MouseInteraction:if(-1===n.id)break;var i=new Event(MouseInteractions[n.type].toLowerCase()),a=mirror.getNode(n.id);switch(n.type){case MouseInteractions.Blur:a.blur();break;case MouseInteractions.Focus:a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(i)}break;case IncrementalSource.Scroll:if(-1===n.id)break;if((a=mirror.getNode(n.id))===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:n.y,left:n.x,behavior:t?"instant":"smooth"});else try{a.scrollTop=n.y,a.scrollLeft=n.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit("resize",{width:n.width,height:n.height});break;case IncrementalSource.Input:if(-1===n.id)break;(a=mirror.getNode(n.id)).checked=n.isChecked,a.value=n.text}},e.prototype.resolveMissingNode=function(e,t,r,n){var o=n.previousId,i=n.nextId,a=o&&e[o],s=i&&e[i];if(a){var c=a,l=c.node,u=c.mutation;t.insertBefore(l,r),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}if(s){var d=s;l=d.node,u=d.mutation;t.insertBefore(l,r.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}},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}();export{record,Replayer,mirror};
//# sourceMappingURL=rrweb.min.js.map

@@ -554,6 +554,7 @@ 'use strict';

if (evt.target === document) {
var scrollEl = (document.scrollingElement || document.documentElement);
cb({
id: id,
x: document.documentElement.scrollLeft,
y: document.documentElement.scrollTop
x: scrollEl.scrollLeft,
y: scrollEl.scrollTop
});

@@ -560,0 +561,0 @@ }

@@ -671,6 +671,7 @@ 'use strict';

if (evt.target === document) {
var scrollEl = (document.scrollingElement || document.documentElement);
cb({
id: id,
x: document.documentElement.scrollLeft,
y: document.documentElement.scrollTop
x: scrollEl.scrollLeft,
y: scrollEl.scrollTop
});

@@ -957,2 +958,445 @@ }

function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var smoothscroll = createCommonjsModule(function (module, exports) {
/* smoothscroll v0.4.0 - 2018 - Dustan Kasten, Jeremias Menichelli - MIT License */
(function () {
// polyfill
function polyfill() {
// aliases
var w = window;
var d = document;
// return if scroll behavior is supported and polyfill is not forced
if (
'scrollBehavior' in d.documentElement.style &&
w.__forceSmoothScrollPolyfill__ !== true
) {
return;
}
// globals
var Element = w.HTMLElement || w.Element;
var SCROLL_TIME = 468;
// object gathering original scroll methods
var original = {
scroll: w.scroll || w.scrollTo,
scrollBy: w.scrollBy,
elementScroll: Element.prototype.scroll || scrollElement,
scrollIntoView: Element.prototype.scrollIntoView
};
// define timing method
var now =
w.performance && w.performance.now
? w.performance.now.bind(w.performance)
: Date.now;
/**
* indicates if a the current browser is made by Microsoft
* @method isMicrosoftBrowser
* @param {String} userAgent
* @returns {Boolean}
*/
function isMicrosoftBrowser(userAgent) {
var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];
return new RegExp(userAgentPatterns.join('|')).test(userAgent);
}
/*
* IE has rounding bug rounding down clientHeight and clientWidth and
* rounding up scrollHeight and scrollWidth causing false positives
* on hasScrollableSpace
*/
var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;
/**
* changes scroll position inside an element
* @method scrollElement
* @param {Number} x
* @param {Number} y
* @returns {undefined}
*/
function scrollElement(x, y) {
this.scrollLeft = x;
this.scrollTop = y;
}
/**
* returns result of applying ease math function to a number
* @method ease
* @param {Number} k
* @returns {Number}
*/
function ease(k) {
return 0.5 * (1 - Math.cos(Math.PI * k));
}
/**
* indicates if a smooth behavior should be applied
* @method shouldBailOut
* @param {Number|Object} firstArg
* @returns {Boolean}
*/
function shouldBailOut(firstArg) {
if (
firstArg === null ||
typeof firstArg !== 'object' ||
firstArg.behavior === undefined ||
firstArg.behavior === 'auto' ||
firstArg.behavior === 'instant'
) {
// first argument is not an object/null
// or behavior is auto, instant or undefined
return true;
}
if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {
// first argument is an object and behavior is smooth
return false;
}
// throw error when behavior is not supported
throw new TypeError(
'behavior member of ScrollOptions ' +
firstArg.behavior +
' is not a valid value for enumeration ScrollBehavior.'
);
}
/**
* indicates if an element has scrollable space in the provided axis
* @method hasScrollableSpace
* @param {Node} el
* @param {String} axis
* @returns {Boolean}
*/
function hasScrollableSpace(el, axis) {
if (axis === 'Y') {
return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;
}
if (axis === 'X') {
return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;
}
}
/**
* indicates if an element has a scrollable overflow property in the axis
* @method canOverflow
* @param {Node} el
* @param {String} axis
* @returns {Boolean}
*/
function canOverflow(el, axis) {
var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];
return overflowValue === 'auto' || overflowValue === 'scroll';
}
/**
* indicates if an element can be scrolled in either axis
* @method isScrollable
* @param {Node} el
* @param {String} axis
* @returns {Boolean}
*/
function isScrollable(el) {
var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');
var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');
return isScrollableY || isScrollableX;
}
/**
* finds scrollable parent of an element
* @method findScrollableParent
* @param {Node} el
* @returns {Node} el
*/
function findScrollableParent(el) {
var isBody;
do {
el = el.parentNode;
isBody = el === d.body;
} while (isBody === false && isScrollable(el) === false);
isBody = null;
return el;
}
/**
* self invoked function that, given a context, steps through scrolling
* @method step
* @param {Object} context
* @returns {undefined}
*/
function step(context) {
var time = now();
var value;
var currentX;
var currentY;
var elapsed = (time - context.startTime) / SCROLL_TIME;
// avoid elapsed times higher than one
elapsed = elapsed > 1 ? 1 : elapsed;
// apply easing to elapsed time
value = ease(elapsed);
currentX = context.startX + (context.x - context.startX) * value;
currentY = context.startY + (context.y - context.startY) * value;
context.method.call(context.scrollable, currentX, currentY);
// scroll more if we have not reached our destination
if (currentX !== context.x || currentY !== context.y) {
w.requestAnimationFrame(step.bind(w, context));
}
}
/**
* scrolls window or element with a smooth behavior
* @method smoothScroll
* @param {Object|Node} el
* @param {Number} x
* @param {Number} y
* @returns {undefined}
*/
function smoothScroll(el, x, y) {
var scrollable;
var startX;
var startY;
var method;
var startTime = now();
// define scroll context
if (el === d.body) {
scrollable = w;
startX = w.scrollX || w.pageXOffset;
startY = w.scrollY || w.pageYOffset;
method = original.scroll;
} else {
scrollable = el;
startX = el.scrollLeft;
startY = el.scrollTop;
method = scrollElement;
}
// scroll looping over a frame
step({
scrollable: scrollable,
method: method,
startTime: startTime,
startX: startX,
startY: startY,
x: x,
y: y
});
}
// ORIGINAL METHODS OVERRIDES
// w.scroll and w.scrollTo
w.scroll = w.scrollTo = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
original.scroll.call(
w,
arguments[0].left !== undefined
? arguments[0].left
: typeof arguments[0] !== 'object'
? arguments[0]
: w.scrollX || w.pageXOffset,
// use top prop, second argument if present or fallback to scrollY
arguments[0].top !== undefined
? arguments[0].top
: arguments[1] !== undefined
? arguments[1]
: w.scrollY || w.pageYOffset
);
return;
}
// LET THE SMOOTHNESS BEGIN!
smoothScroll.call(
w,
d.body,
arguments[0].left !== undefined
? ~~arguments[0].left
: w.scrollX || w.pageXOffset,
arguments[0].top !== undefined
? ~~arguments[0].top
: w.scrollY || w.pageYOffset
);
};
// w.scrollBy
w.scrollBy = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0])) {
original.scrollBy.call(
w,
arguments[0].left !== undefined
? arguments[0].left
: typeof arguments[0] !== 'object' ? arguments[0] : 0,
arguments[0].top !== undefined
? arguments[0].top
: arguments[1] !== undefined ? arguments[1] : 0
);
return;
}
// LET THE SMOOTHNESS BEGIN!
smoothScroll.call(
w,
d.body,
~~arguments[0].left + (w.scrollX || w.pageXOffset),
~~arguments[0].top + (w.scrollY || w.pageYOffset)
);
};
// Element.prototype.scroll and Element.prototype.scrollTo
Element.prototype.scroll = Element.prototype.scrollTo = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
// if one number is passed, throw error to match Firefox implementation
if (typeof arguments[0] === 'number' && arguments[1] === undefined) {
throw new SyntaxError('Value could not be converted');
}
original.elementScroll.call(
this,
// use left prop, first number argument or fallback to scrollLeft
arguments[0].left !== undefined
? ~~arguments[0].left
: typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,
// use top prop, second argument or fallback to scrollTop
arguments[0].top !== undefined
? ~~arguments[0].top
: arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop
);
return;
}
var left = arguments[0].left;
var top = arguments[0].top;
// LET THE SMOOTHNESS BEGIN!
smoothScroll.call(
this,
this,
typeof left === 'undefined' ? this.scrollLeft : ~~left,
typeof top === 'undefined' ? this.scrollTop : ~~top
);
};
// Element.prototype.scrollBy
Element.prototype.scrollBy = function() {
// avoid action when no arguments are passed
if (arguments[0] === undefined) {
return;
}
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
original.elementScroll.call(
this,
arguments[0].left !== undefined
? ~~arguments[0].left + this.scrollLeft
: ~~arguments[0] + this.scrollLeft,
arguments[0].top !== undefined
? ~~arguments[0].top + this.scrollTop
: ~~arguments[1] + this.scrollTop
);
return;
}
this.scroll({
left: ~~arguments[0].left + this.scrollLeft,
top: ~~arguments[0].top + this.scrollTop,
behavior: arguments[0].behavior
});
};
// Element.prototype.scrollIntoView
Element.prototype.scrollIntoView = function() {
// avoid smooth behavior if not required
if (shouldBailOut(arguments[0]) === true) {
original.scrollIntoView.call(
this,
arguments[0] === undefined ? true : arguments[0]
);
return;
}
// LET THE SMOOTHNESS BEGIN!
var scrollableParent = findScrollableParent(this);
var parentRects = scrollableParent.getBoundingClientRect();
var clientRects = this.getBoundingClientRect();
if (scrollableParent !== d.body) {
// reveal element inside parent
smoothScroll.call(
this,
scrollableParent,
scrollableParent.scrollLeft + clientRects.left - parentRects.left,
scrollableParent.scrollTop + clientRects.top - parentRects.top
);
// reveal parent in viewport unless is fixed
if (w.getComputedStyle(scrollableParent).position !== 'fixed') {
w.scrollBy({
left: parentRects.left,
top: parentRects.top,
behavior: 'smooth'
});
}
} else {
// reveal element in viewport
w.scrollBy({
left: clientRects.left,
top: clientRects.top,
behavior: 'smooth'
});
}
};
}
{
// commonjs
module.exports = { polyfill: polyfill };
}
}());
});
var smoothscroll_1 = smoothscroll.polyfill;
var Timer = (function () {

@@ -1028,2 +1472,3 @@ function Timer(config, actions) {

smoothscroll_1();
var mitt$1 = mitt || mittProxy;

@@ -1121,2 +1566,3 @@ var defaultConfig = {

this.iframe.setAttribute('sandbox', 'allow-same-origin');
this.iframe.setAttribute('scrolling', 'no');
this.wrapper.appendChild(this.iframe);

@@ -1123,0 +1569,0 @@ };

{
"name": "rrweb",
"version": "0.6.9",
"version": "0.6.11",
"description": "record and replay the web",

@@ -45,2 +45,3 @@ "scripts": {

"rollup": "^0.66.6",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^3.4.0",

@@ -56,5 +57,7 @@ "rollup-plugin-postcss": "^1.6.2",

"dependencies": {
"@types/smoothscroll-polyfill": "^0.3.0",
"mitt": "^1.1.3",
"rrweb-snapshot": "^0.6.11"
"rrweb-snapshot": "^0.6.11",
"smoothscroll-polyfill": "^0.4.3"
}
}

@@ -7,11 +7,11 @@ # rrweb

rrweb means 'record and replay the web', which is a tool for recording and replaying users' interactions on the web.
rrweb refers to 'record and replay the web', which is a tool for recording and replaying users' interactions on the web.
**Currently, rrweb has already solved many difficult problems in recording and replaying, but the data structure may still be changed before the release of version 1.0. So please be cautious to use rrweb in the production environment.**
**Currently, rrweb has already solved many difficult problems in recording and replaying, but the data structure may still be changed before the release of Version 1.0. So please be cautious to use rrweb in the production environment.**
## Project structure
## Project Structure
rrweb is mainly composed of 3 parts:
- **[rrweb-snapshot](https://github.com/rrweb-io/rrweb-snapshot)**, including both snapshot and rebuild features. The snapshot is used to convert the DOM and its state into a serializable data structure with a unique identifier; the rebuild is to rebuild the snapshot into corresponding DOM.
- **[rrweb-snapshot](https://github.com/rrweb-io/rrweb-snapshot)**, including both snapshot and rebuilding features. The snapshot is used to convert the DOM and its state into a serializable data structure with an unique identifier; the rebuilding feature is to rebuild the snapshot into corresponding DOM.
- **[rrweb](https://github.com/rrweb-io/rrweb)**, including two functions, record and replay. The record function is used to record all the mutations in the DOM; the replay is to replay the recorded mutations one by one according to the corresponding timestamp.

@@ -23,3 +23,3 @@ - **[rrweb-player](https://github.com/rrweb-io/rrweb-player)**, is a player UI for rrweb, providing GUI-based functions like pause, fast-forward, drag and drop to play at any time.

- rrweb
- handling cross-domain request errors
- handle cross-domain request errors
- record in web worker

@@ -45,3 +45,3 @@ - implement transmission data compression

Since we want the record and replay sides can share a strongly typed data structure, rrweb is developed with typescript which provide stronger type support.
Since we want the record and replay sides to share a strongly typed data structure, rrweb is developed with typescript which provides stronger type support.

@@ -57,3 +57,3 @@ [Typescript handbook](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)

Run `npm run repl` will launch a browser and ask for a URL you want to test on the CLI:
Run `npm run repl` to launch a browser and ask for a URL you want to test on the CLI:

@@ -73,3 +73,3 @@ ```

At this point, you can interact in the web page. After the desired operations has been recorded, enter 'y' on the CLI, and the test tool will replay the operations to verify whether the recording was successful.
At this point, you can interact in the web page. After the desired operations have been recorded, enter 'y' on the CLI, and the test tool will replay the operations to verify whether the recording was successful.

@@ -88,2 +88,2 @@ The following messages will be printed on the CLI during replay:

This file use the latest rrweb bundle code, so we can run `npm run bundle:browser` after patching the code, then refresh the static file to see and debug the impact of the latest code on replay.
This file uses the latest rrweb bundle code, so we can run `npm run bundle:browser` after patching the code, then refresh the static file to see and debug the impact of the latest code on replay.

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 not supported yet

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