Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
4
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.1 to 0.7.2

2

dist/rrweb.min.js

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

var rrweb=function(e){"use strict";var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var o=1;var r=/url\((['"]|)([^'"]*)\1\)/gm,i=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function s(e,t){return e.replace(r,function(e,n,o){if(!i.test(o))return"url('"+o+"')";if(a.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,s=t.split("/"),c=o.split("/");s.pop();for(var l=0,u=c;l<u.length;l++){var d=u[l];"."!==d&&(".."===d?s.pop():s.push(d))}return"url('"+s.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}var l="rr-block";function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var o=e.classList.contains(l),r=e.tagName.toLowerCase(),i={},a=0,u=Array.from(e.attributes);a<u.length;a++){var d=u[a],f=d.name,p=d.value;i[f]="src"===f||"href"===f?c(n,p):p}if("link"===r){var h=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),m=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(h);m&&(i={_cssText:s(m,h.href)})}if("input"===r||"textarea"===r||"select"===r){p=e.value;"radio"!==i.type&&"checkbox"!==i.type&&p?i.value=p:e.checked&&(i.checked=e.checked)}if("option"===r){var v=e.parentElement;i.value===v.value&&(i.selected=e.selected)}if(o){var y=e.getBoundingClientRect(),g=y.width,b=y.height;i.rr_width=g+"px",i.rr_height=b+"px"}return{type:t.Element,tagName:r,attributes:i,childNodes:[],isSVG:(I=e,"svg"===I.tagName||I 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=s(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 I}function d(e,n,r,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:o++});e.__sn=s,r[s.id]=e;var 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 l=0,f=Array.from(e.childNodes);l<f.length;l++){var p=d(f[l],n,r);p&&s.childNodes.push(p)}return s}function f(e){o=1;var t={};return[d(e,e,t),t]}var p={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function v(e){return e.replace(h,function(e,t,n){if(m.test(t)){var o=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function y(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,c="style"===o&&"_cssText"===i;if(c&&(a=v(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?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,o,r){void 0===r&&(r=!1);var i=y(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var c=s[a],l=g(c,n,o);l?i.appendChild(l):console.warn("Failed to rebuild",c)}return i}function b(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var w,E,T,I={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return I.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete I.map[t],e.childNodes&&e.childNodes.forEach(function(e){return I.removeNodeFromMap(e)})},has:function(e){return I.map.hasOwnProperty(e)}};function x(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 C(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function N(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function S(e){var t=[];return Object.keys(T).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){var o=I.getId(n.target),r=n.clientX,i=n.clientY;e({type:T[t],id:o,x:r,y:i})}}(n);t.push(b(o,r))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(w||(w={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(E||(E={})),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"}(T||(T={}));var M=["INPUT","TEXTAREA","SELECT"],D=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],O="rr-ignore",L=new WeakMap;function k(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(O)){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=L.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){L.set(t,o);var i=I.getId(t);e(n({},o,{id:i}))}}var r=["input","change"].map(function(e){return b(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&r.push.apply(r,D.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,f=e.attributeName;switch(t){case"characterData":(p=i.textContent)!==l&&n.push({value:p,node:i});break;case"attributes":var p;if((p=i.getAttribute(f))===l)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[f]=p;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)&&!I.getId(e)||r.push({parentId:I.getId(i),id:I.getId(e)}),I.removeNodeFromMap(e)})}}),r=r.map(function(e){return e.parentNode&&(e.parentId=I.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 n=I.getId(t);return!!r.some(function(e){return e.id===n})||u(t)};Array.from(s).forEach(function(e){l(e)||u(e)?a.push(e):i.push({parentId:I.getId(e.parentNode),previousId:e.previousSibling?I.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?I.getId(e.nextSibling):e.nextSibling,node:d(e,document,I.map,!0)})}),t({texts:n.map(function(e){return{id:I.getId(e.node),value:e.value}}).filter(function(e){return I.has(e.id)}),attributes:o.map(function(e){return{id:I.getId(e.node),attributes:e.attributes}}).filter(function(e){return I.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=x(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500);return b("mousemove",x(function(e){var r=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:r,y:i,id:I.getId(a),timeOffset:Date.now()-t}),o()},20,{trailing:!1}))}(e.mousemoveCb),i=S(e.mouseInteractionCb),a=function(e){return b("scroll",x(function(t){if(t.target){var n=I.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 b("resize",x(function(){var t=C(),n=N();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=k(e.inputCb);return function(){o.disconnect(),r(),i(),a(),s(),c()}}function _(e){return n({},e,{timestamp:Date.now()})}function R(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 F=Object.freeze({default:R});var B,j=(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===f(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function 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 f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,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(p.bind(e,t))}function h(n,o,r){var s,l,u,d,f=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),p({scrollable:s,method:d,startTime:f,startX:l,startY:u,x:o,y:r})}}}}()}(B={exports:{}},B.exports),B.exports).polyfill,z=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),P=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];j();var X=R||F,Y={speed:1,root:document.body,loadTimeout:0,skipInactive:!1},V=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 z(this.config),this.setConfig(Object.assign({},t)),this.setupDom(),this.emitter.on("resize",this.handleResize),this.noramlSpeed=this.config.speed}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.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start()},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===w.IncrementalSnapshot&&e.data.source===E.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case w.DomContentLoaded:case w.Load:break;case w.Meta:n=function(){return o.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case w.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case w.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.delay<=e.delay)&&o.isUserInteraction(i)){i.delay-e.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/5e3),360)};o.setConfig(s),o.emitter.emit("skip-start",s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),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={},I.map=(t=e.data.node,n=this.iframe.contentDocument,o={},[g(t,n,o),o])[1];var r=document.createElement("style"),i=this.iframe.contentDocument,a=i.documentElement,s=i.head;a.insertBefore(r,s);for(var c=0;c<P.length;c++)r.sheet.insertRule(P[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 E.Mutation:r.removes.forEach(function(e){var t=I.getNode(e.id);if(t){var n=I.getNode(e.parentId);I.removeNodeFromMap(t),n&&n.removeChild(t)}});var i=n({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=g(e.node,o.iframe.contentDocument,I.map,!0),n=I.getNode(e.parentId),r=null,a=null;e.previousId&&(r=I.getNode(e.previousId)),e.nextId&&(a=I.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){I.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=I.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 E.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=I.getNode(t.id);e&&o.hoverElements(e)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case E.MouseInteraction:if(-1===r.id)break;var a=new Event(T[r.type].toLowerCase()),s=I.getNode(r.id);switch(r.type){case T.Blur:s.blur();break;case T.Focus:s.focus({preventScroll:!0});break;case T.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case E.Scroll:if(-1===r.id)break;if((s=I.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 E.ViewportResize:this.emitter.emit("resize",{width:r.width,height:r.height});break;case E.Input:if(-1===r.id)break;s=I.getNode(r.id);try{s.checked=r.isChecked,s.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var 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.prototype.isUserInteraction=function(e){return e.type===w.IncrementalSnapshot&&(e.data.source>E.Mutation&&e.data.source<=E.Input)},e.prototype.restoreSpeed=function(){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit("skip-end",e)},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(b("DOMContentLoaded",function(){t(_({type:w.DomContentLoaded,data:{}}))}));var r=function(){t(_({type:w.Meta,data:{href:window.location.href,width:N(),height:C()}}));var e=f(document),r=e[0],i=e[1];if(!r)return console.warn("Failed to snapshot the document");I.map=i,t(_({type:w.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),o.push(A({mutationCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.Mutation},e)}))},mousemoveCb:function(e){return t(_({type:w.IncrementalSnapshot,data:{source:E.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.MouseInteraction},e)}))},scrollCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.Scroll},e)}))},viewportResizeCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.ViewportResize},e)}))},inputCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():o.push(b("load",function(){t(_({type:w.Load,data:{}})),r()},window)),function(){o.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=V,e.mirror=I,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]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function s(e,t){return e.replace(r,function(e,n,o){if(!i.test(o))return"url('"+o+"')";if(a.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,s=t.split("/"),c=o.split("/");s.pop();for(var l=0,u=c;l<u.length;l++){var d=u[l];"."!==d&&(".."===d?s.pop():s.push(d))}return"url('"+s.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}var l="rr-block";function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var o=e.classList.contains(l),r=e.tagName.toLowerCase(),i={},a=0,u=Array.from(e.attributes);a<u.length;a++){var d=u[a],f=d.name,p=d.value;i[f]="src"===f||"href"===f?c(n,p):p}if("link"===r){var h=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),m=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(h);m&&(i={_cssText:s(m,h.href)})}if("input"===r||"textarea"===r||"select"===r){p=e.value;"radio"!==i.type&&"checkbox"!==i.type&&p?i.value=p:e.checked&&(i.checked=e.checked)}if("option"===r){var v=e.parentElement;i.value===v.value&&(i.selected=e.selected)}if(o){var y=e.getBoundingClientRect(),g=y.width,b=y.height;i.rr_width=g+"px",i.rr_height=b+"px"}return{type:t.Element,tagName:r,attributes:i,childNodes:[],isSVG:(T=e,"svg"===T.tagName||T instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,E=e.textContent,I="STYLE"===w||void 0;return I&&E&&(E=s(E,location.href)),"SCRIPT"===w&&(E="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:E||"",isStyle:I};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var T}function d(e,n,r,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:o++});e.__sn=s,r[s.id]=e;var 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 l=0,f=Array.from(e.childNodes);l<f.length;l++){var p=d(f[l],n,r);p&&s.childNodes.push(p)}return s}function f(e){o=1;var t={};return[d(e,e,t),t]}var p={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function v(e){return e.replace(h,function(e,t,n){if(m.test(t)){var o=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function y(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,c="style"===o&&"_cssText"===i;if(c&&(a=v(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?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,o,r){void 0===r&&(r=!1);var i=y(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var c=s[a],l=g(c,n,o);l?i.appendChild(l):console.warn("Failed to rebuild",c)}return i}function b(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var w,E,I,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 x(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 C(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function N(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function S(e){var t=[];return Object.keys(I).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:I[t],id:o,x:r,y:i})}}(n);t.push(b(o,r))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(w||(w={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(E||(E={})),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"}(I||(I={}));var M=["INPUT","TEXTAREA","SELECT"],D=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],O="rr-ignore",L=new WeakMap;function k(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(O)){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=L.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){L.set(t,o);var i=T.getId(t);e(n({},o,{id:i}))}}var r=["input","change"].map(function(e){return b(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&r.push.apply(r,D.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,f=e.attributeName;switch(t){case"characterData":(p=i.textContent)!==l&&n.push({value:p,node:i});break;case"attributes":var p;if((p=i.getAttribute(f))===l)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[f]=p;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))},u=function(e){var t=e.parentNode;if(!t)return!1;var n=T.getId(t);return!!r.some(function(e){return e.id===n})||u(t)};Array.from(s).forEach(function(e){l(e)||u(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:d(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=x(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500);return b("mousemove",x(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=S(e.mouseInteractionCb),a=function(e){return b("scroll",x(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 b("resize",x(function(){var t=C(),n=N();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=k(e.inputCb);return function(){o.disconnect(),r(),i(),a(),s(),c()}}function _(e){return n({},e,{timestamp:Date.now()})}function R(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 F=Object.freeze({default:R});var B,j=(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===f(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function 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 f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,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(p.bind(e,t))}function h(n,o,r){var s,l,u,d,f=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),p({scrollable:s,method:d,startTime:f,startX:l,startY:u,x:o,y:r})}}}}()}(B={exports:{}},B.exports),B.exports).polyfill,z=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),P=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];j();var X=R||F,Y={speed:1,root:document.body,loadTimeout:0,skipInactive:!1},V=function(){function e(e,t){if(this.events=[],this.config=Y,this.emitter=X(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new z(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]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start()},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===w.IncrementalSnapshot&&e.data.source===E.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case w.DomContentLoaded:case w.Load:break;case w.Meta:n=function(){return o.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case w.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case w.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/5e3),360)};o.setConfig(s),o.emitter.emit("skip-start",s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),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={},[g(t,n,o),o])[1];var r=document.createElement("style"),i=this.iframe.contentDocument,a=i.documentElement,s=i.head;a.insertBefore(r,s);for(var c=0;c<P.length;c++)r.sheet.insertRule(P[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 E.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=g(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 E.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 E.MouseInteraction:if(-1===r.id)break;var a=new Event(I[r.type].toLowerCase()),s=T.getNode(r.id);switch(r.type){case I.Blur:s.blur();break;case I.Focus:s.focus({preventScroll:!0});break;case I.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case E.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 E.ViewportResize:this.emitter.emit("resize",{width:r.width,height:r.height});break;case E.Input:if(-1===r.id)break;s=T.getNode(r.id);try{s.checked=r.isChecked,s.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var 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.prototype.isUserInteraction=function(e){return e.type===w.IncrementalSnapshot&&(e.data.source>E.Mutation&&e.data.source<=E.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit("skip-end",e),this.noramlSpeed=-1}},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(b("DOMContentLoaded",function(){t(_({type:w.DomContentLoaded,data:{}}))}));var r=function(){t(_({type:w.Meta,data:{href:window.location.href,width:N(),height:C()}}));var e=f(document),r=e[0],i=e[1];if(!r)return console.warn("Failed to snapshot the document");T.map=i,t(_({type:w.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),o.push(A({mutationCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.Mutation},e)}))},mousemoveCb:function(e){return t(_({type:w.IncrementalSnapshot,data:{source:E.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.MouseInteraction},e)}))},scrollCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.Scroll},e)}))},viewportResizeCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.ViewportResize},e)}))},inputCb:function(e){return t(_({type:w.IncrementalSnapshot,data:n({source:E.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():o.push(b("load",function(){t(_({type:w.Load,data:{}})),r()},window)),function(){o.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=V,e.mirror=T,e}({});
//# sourceMappingURL=rrweb.min.js.map

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

var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((['"]|)([^'"]*)\1\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!RELATIVE_PATH.test(r))return"url('"+r+"')";if(DATA_URI.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,s=i;a<s.length;a++){var l=s[a];"."!==l&&(".."===l?o.pop():o.push(l))}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 s=a[i],l=s.name,c=s.value;o[l]="src"===l||"href"===l?absoluteToDoc(t,c):c}if("link"===r){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(o={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var f=e.getBoundingClientRect(),m=f.width,h=f.height;o.rr_width=m+"px",o.rr_height=h+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var v=e.parentNode&&e.parentNode.tagName,y=e.textContent,g="STYLE"===v||void 0;return g&&y&&(y=absoluteToStylesheet(y,location.href)),"SCRIPT"===v&&(y="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:y||"",isStyle:g};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var s=0,l=Array.from(e.childNodes);s<l.length;s++){var c=serializeNodeWithId(l[s],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),r=void 0;for(var o in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{r.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r){void 0===r&&(r=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],l=buildNodeWithSN(s,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var 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),s=this,l=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,l)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],s=new Set,l=function(e){s.add(e),e.childNodes.forEach(function(e){return l(e)})};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=i.textContent)!==c&&n.push({value:f,node:i});break;case"attributes":var f;if((f=i.getAttribute(p))===c)return;var m=r.find(function(e){return e.node===i});m||(m={node:i,attributes:{}},r.push(m)),m.attributes[p]=f;case"childList":u.forEach(function(e){return l(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 c=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||c(t))},u=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!o.some(function(e){return e.id===n})||u(t)};Array.from(s).forEach(function(e){c(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: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)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===p(e));return n=null,e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,r,i,s,l=(a()-t.startTime)/o;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,r,o){var s,c,u,d,p=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:s,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(r.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),rules=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"],SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3;smoothscroll_1();var mitt$1=mitt||mittProxy,defaultConfig={speed:1,root:document.body,loadTimeout:0,skipInactive:!1},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),this.noramlSpeed=this.config.speed}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.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start()},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 o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit("resume")},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.delay<=e.delay)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var a=r.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/SKIP_TIME_INTERVAL),360)};r.setConfig(s),r.emitter.emit("skip-start",s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),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,o=n.head;r.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 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 o=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),r=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?r.insertBefore(t,i.nextSibling):a&&a.parentNode?r.insertBefore(t,a):r.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,r,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),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 i=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(i)}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);try{a.checked=r.isChecked,a.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit("skip-end",e)},e}();export{record,Replayer,mirror};
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]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!RELATIVE_PATH.test(r))return"url('"+r+"')";if(DATA_URI.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,s=i;a<s.length;a++){var l=s[a];"."!==l&&(".."===l?o.pop():o.push(l))}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 s=a[i],l=s.name,c=s.value;o[l]="src"===l||"href"===l?absoluteToDoc(t,c):c}if("link"===r){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(o={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var f=e.getBoundingClientRect(),m=f.width,h=f.height;o.rr_width=m+"px",o.rr_height=h+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var v=e.parentNode&&e.parentNode.tagName,y=e.textContent,g="STYLE"===v||void 0;return g&&y&&(y=absoluteToStylesheet(y,location.href)),"SCRIPT"===v&&(y="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:y||"",isStyle:g};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var s=0,l=Array.from(e.childNodes);s<l.length;s++){var c=serializeNodeWithId(l[s],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),r=void 0;for(var o in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{r.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r){void 0===r&&(r=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],l=buildNodeWithSN(s,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var 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),s=this,l=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,l)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],s=new Set,l=function(e){s.add(e),e.childNodes.forEach(function(e){return l(e)})};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=i.textContent)!==c&&n.push({value:f,node:i});break;case"attributes":var f;if((f=i.getAttribute(p))===c)return;var m=r.find(function(e){return e.node===i});m||(m={node:i,attributes:{}},r.push(m)),m.attributes[p]=f;case"childList":u.forEach(function(e){return l(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 c=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||c(t))},u=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!o.some(function(e){return e.id===n})||u(t)};Array.from(s).forEach(function(e){c(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: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)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(c(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===p(e));return n=null,e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,r,i,s,l=(a()-t.startTime)/o;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,r,o){var s,c,u,d,p=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:s,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(r.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),rules=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"],SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3;smoothscroll_1();var mitt$1=mitt||mittProxy,defaultConfig={speed:1,root:document.body,loadTimeout:0,skipInactive:!1},Replayer=function(){function e(e,t){if(this.events=[],this.config=defaultConfig,this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),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]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start()},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 o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit("resume")},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.timestamp<=e.timestamp)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var a=r.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/SKIP_TIME_INTERVAL),360)};r.setConfig(s),r.emitter.emit("skip-start",s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),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,o=n.head;r.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 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 o=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),r=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?r.insertBefore(t,i.nextSibling):a&&a.parentNode?r.insertBefore(t,a):r.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,r,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),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 i=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(i)}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);try{a.checked=r.isChecked,a.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit("skip-end",e),this.noramlSpeed=-1}},e}();export{record,Replayer,mirror};
//# sourceMappingURL=rrweb.min.js.map
{
"name": "rrweb",
"version": "0.7.1",
"version": "0.7.2",
"description": "record and replay the web",

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

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

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