Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb - npm Package Compare versions

Comparing version 0.7.17 to 0.7.18

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

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

@@ -198,2 +198,3 @@ import { serializedNodeWithId, idNodeMap, INode } from 'rrweb-snapshot';

liveMode: boolean;
insertStyleRules: string[];
};

@@ -200,0 +201,0 @@ export declare type playerMetaData = {

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc