Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
5
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.9 to 0.9.10

2

dist/record/rrweb-record.min.js

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

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,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 n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function r(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var a=1,i=RegExp("[^a-z1-6-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(s).join(""):null}catch(e){return null}}function s(e){return function(e){return"styleSheet"in e}(e)?u(e.styleSheet)||"":e.cssText}var c,l,d,p,f,m=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,h=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,v=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64|utf-?8).*,(.*)/i;function y(e,t){return(e||"").replace(m,(function(e,n,o,r,a,i){var u,s=o||a||i,c=n||r||"";if(!s)return e;if(!h.test(s))return"url("+c+s+c+")";if(v.test(s))return"url("+c+s+c+")";if("/"===s[0])return"url("+c+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+s)+c+")";var l=t.split("/"),d=s.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?l.pop():l.push(m))}return"url("+c+l.join("/")+c+")"}))}function g(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function b(e,t,n){return"src"===t||"href"===t&&n?g(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?g(e,n[0])+" "+n[1]:1===n.length?""+g(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?y(n,location.href):n}function S(t,n,o,r,a,s,c){switch(void 0===s&&(s={}),t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var l=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!!n&&e.matches(n)}(t,o,r),d=function(e){var t=e.toLowerCase().trim();return i.test(t)?"div":t}(t.tagName),p={},f=0,m=Array.from(t.attributes);f<m.length;f++){var h=m[f],v=h.name,g=h.value;p[v]=b(n,v,g)}if("link"===d&&a){var S,C=Array.from(n.styleSheets).find((function(e){return e.href===t.href}));(S=u(C))&&(delete p.rel,delete p.href,p._cssText=y(S,C.href))}if("style"===d&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(S=u(t.sheet))&&(p._cssText=y(S,location.href));if("input"===d||"textarea"===d||"select"===d){g=t.value;"radio"!==p.type&&"checkbox"!==p.type&&"submit"!==p.type&&"button"!==p.type&&g?p.value=s[p.type]||s[d]?"*".repeat(g.length):g:t.checked&&(p.checked=t.checked)}if("option"===d){var w=t.parentElement;p.value===w.value&&(p.selected=t.selected)}if("canvas"===d&&c&&(p.rr_dataURL=t.toDataURL()),"audio"!==d&&"video"!==d||(p.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(p.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(p.rr_scrollTop=t.scrollTop),l){var E=t.getBoundingClientRect(),M=E.width,x=E.height;p.rr_width=M+"px",p.rr_height=x+"px"}return{type:e.Element,tagName:d,attributes:p,childNodes:[],isSVG:(k=t,"svg"===k.tagName||k instanceof SVGElement||void 0),needBlock:l};case t.TEXT_NODE:var I=t.parentNode&&t.parentNode.tagName,N=t.textContent,T="STYLE"===I||void 0;return T&&N&&(N=y(N,location.href)),"SCRIPT"===I&&(N="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:N||"",isStyle:T};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var k}function C(e){return void 0===e?"":e.toLowerCase()}function w(t,n,o,r,i,u,s,c,l,d,p){void 0===u&&(u=!1),void 0===s&&(s=!0),void 0===l&&(l={}),void 0===p&&(p=!0);var f,m=S(t,n,r,i,s,c,d||!1);if(!m)return console.warn(t,"not serialized"),null;f="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(C(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===C(t.attributes.name)||"icon"===C(t.attributes.rel)||"apple-touch-icon"===C(t.attributes.rel)||"shortcut icon"===C(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&C(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(C(t.attributes.property).match(/^(og|twitter|fb):/)||C(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===C(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===C(t.attributes.name)||"googlebot"===C(t.attributes.name)||"bingbot"===C(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===C(t.attributes.name)||"generator"===C(t.attributes.name)||"framework"===C(t.attributes.name)||"publisher"===C(t.attributes.name)||"progid"===C(t.attributes.name)||C(t.attributes.property).match(/^article:/)||C(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===C(t.attributes.name)||"yandex-verification"===C(t.attributes.name)||"csrf-token"===C(t.attributes.name)||"p:domain_verify"===C(t.attributes.name)||"verify-v1"===C(t.attributes.name)||"verification"===C(t.attributes.name)||"shopify-checkout-api-token"===C(t.attributes.name)))return!0}}return!1}(m,l)&&(p||m.type!==e.Text||m.isStyle||m.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:-2;var h=Object.assign(m,{id:f});if(t.__sn=h,-2===f)return null;o[f]=t;var v=!u;if(h.type===e.Element&&(v=v&&!h.needBlock,delete h.needBlock),(h.type===e.Document||h.type===e.Element)&&v){l.headWhitespace&&m.type===e.Element&&"head"==m.tagName&&(p=!1);for(var y=0,g=Array.from(t.childNodes);y<g.length;y++){var b=w(g[y],n,o,r,i,u,s,c,l,d,p);b&&h.childNodes.push(b)}}return h}function E(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)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(c||(c={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font"}(l||(l={})),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"}(d||(d={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(p||(p={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(f||(f={}));var M={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return M.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete M.map[t],e.childNodes&&e.childNodes.forEach((function(e){return M.removeNodeFromMap(e)}))},has:function(e){return M.map.hasOwnProperty(e)}};function x(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(a){var i=Date.now();r||!1!==n.leading||(r=i);var u=t-(i-r),s=this,c=arguments;u<=0||u>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,c)):o||!1===n.trailing||(o=window.setTimeout((function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,c)}),u))}}function I(e,t,n,o,r){void 0===r&&(r=window);var a=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return I(e,t,a||{},!0)}}function N(e,t,n){try{if(!(t in e))return function(){};var o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,function(){e[t]=o}}catch(e){return function(){}}}function T(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function k(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function _(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||_(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,_(e.parentNode,t)}function D(e){return Boolean(e.changedTouches)}function L(e){return"__ln"in e}var O=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&L(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&L(e.nextSibling)){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),R=function(e,t){return e+"@"+t};function F(e){return"__sn"in e}function z(e,t){e.delete(t),t.childNodes.forEach((function(t){return z(e,t)}))}function A(e,t){var n=t.parentNode;if(!n)return!1;var o=M.getId(n);return!!e.some((function(e){return e.id===o}))||A(e,n)}function P(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||P(e,n))}var j=new(function(){function e(){var e=this;this.frozen=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.frozen||e.emit()},this.emit=function(){for(var t,o,r,a,i=[],u=new O,s=function(t){var n=t.nextSibling&&M.getId(t.nextSibling);return-1===n&&_(t.nextSibling,e.blockClass)&&(n=null),n},c=function(t){if(t.parentNode){var n=M.getId(t.parentNode),o=s(t);if(-1===n||-1===o)return u.addNode(t);i.push({parentId:n,nextId:o,node:w(t,document,M.map,e.blockClass,null,!0,e.inlineStylesheet,e.maskInputOptions,void 0,e.recordCanvas)})}};e.mapRemoves.length;)M.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;A(e.removes,p)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),m=f.next();!m.done;m=f.next()){p=m.value;P(e.droppedSet,p)||A(e.removes,p)?P(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}for(var h=null;u.length;){var v=null;if(h){var y=M.getId(h.value.parentNode),g=s(h.value);-1!==y&&-1!==g&&(v=h)}if(!v)for(var b=u.length-1;b>=0;b--){var S=u.get(b);y=M.getId(S.value.parentNode),g=s(S.value);if(-1!==y&&-1!==g){v=S;break}}if(!v)break;h=v.previous,u.removeNode(v.value),c(v.value)}var C={texts:e.texts.map((function(e){return{id:M.getId(e.node),value:e.value}})).filter((function(e){return M.has(e.id)})),attributes:e.attributes.map((function(e){return{id:M.getId(e.node),attributes:e.attributes}})).filter((function(e){return M.has(e.id)})),removes:e.removes,adds:i};(C.texts.length||C.attributes.length||C.removes.length||C.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(C))},this.processMutation=function(t){switch(t.type){case"characterData":var n=t.target.textContent;_(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if(_(t.target,e.blockClass)||n===t.oldValue)return;var o=e.attributes.find((function(e){return e.node===t.target}));o||(o={node:t.target,attributes:{}},e.attributes.push(o)),o.attributes[t.attributeName]=b(document,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var o=M.getId(n),r=M.getId(t.target);_(n,e.blockClass)||_(t.target,e.blockClass)||(e.addedSet.has(n)?(z(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===o||function e(t){var n=M.getId(t);return!M.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(t.target)||(e.movedSet.has(n)&&e.movedMap[R(o,r)]?z(e.movedSet,n):e.removes.push({parentId:r,id:o})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!_(t,e.blockClass)){if(F(t)){e.movedSet.add(t);var o=null;n&&F(n)&&(o=n.__sn.id),o&&(e.movedMap[R(t.__sn.id,o)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,o,r){this.blockClass=t,this.inlineStylesheet=n,this.maskInputOptions=o,this.recordCanvas=r,this.emissionCallback=e},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.isFrozen=function(){return this.frozen},e}());function H(e,t,n){if(!1===n.mouseInteraction)return function(){};var o=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,r=[];return Object.keys(d).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]})).forEach((function(n){var o=n.toLowerCase(),a=function(n){return function(o){if(!_(o.target,t)){var r=M.getId(o.target),a=D(o)?o.changedTouches[0]:o,i=a.clientX,u=a.clientY;e({type:d[n],id:r,x:i,y:u})}}}(n);r.push(E(o,a))})),function(){r.forEach((function(e){return e()}))}}var V,U=["INPUT","TEXTAREA","SELECT"],W=new WeakMap;function B(e,o){void 0===o&&(o={}),function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,u=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,d=e.canvasMutationCb,p=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,r(e)),n.apply(void 0,r(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,r(e)),o.apply(void 0,r(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,r(e)),a.apply(void 0,r(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,r(e)),i.apply(void 0,r(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,r(e)),u.apply(void 0,r(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,r(e)),s.apply(void 0,r(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,r(e)),c.apply(void 0,r(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,r(e)),l.apply(void 0,r(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,r(e)),d.apply(void 0,r(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,r(e)),p.apply(void 0,r(e))}}(e,o);var a,i,u=function(e,t,n,o,r){j.init(e,t,n,o,r);var a=new MutationObserver(j.processMutations.bind(j));return a.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}(e.mutationCb,e.blockClass,e.inlineStylesheet,e.maskInputOptions,e.recordCanvas),s=function(e,t){if(!1===t.mousemove)return function(){};var n,o="number"==typeof t.mousemove?t.mousemove:50,r=[],a=x((function(t){var o=Date.now()-n;e(r.map((function(e){return e.timeOffset-=o,e})),t?l.TouchMove:l.MouseMove),r=[],n=null}),500),i=x((function(e){var t=e.target,o=D(e)?e.changedTouches[0]:e,i=o.clientX,u=o.clientY;n||(n=Date.now()),r.push({x:i,y:u,id:M.getId(t),timeOffset:Date.now()-n}),a(D(e))}),o,{trailing:!1}),u=[E("mousemove",i),E("touchmove",i)];return function(){u.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling),c=H(e.mouseInteractionCb,e.blockClass,e.sampling),d=(a=e.scrollCb,i=e.blockClass,E("scroll",x((function(e){if(e.target&&!_(e.target,i)){var t=M.getId(e.target);if(e.target===document){var n=document.scrollingElement||document.documentElement;a({id:t,x:n.scrollLeft,y:n.scrollTop})}else a({id:t,x:e.target.scrollLeft,y:e.target.scrollTop})}}),e.sampling.scroll||100))),f=function(e){return E("resize",x((function(){var t=T(),n=k();e({width:Number(n),height:Number(t)})}),200),window)}(e.viewportResizeCb),m=function(e,n,o,a,i){function u(e){var t=e.target;if(t&&t.tagName&&!(U.indexOf(t.tagName)<0)&&!_(t,n)){var r=t.type;if("password"!==r&&!t.classList.contains(o)){var i=t.value,u=!1;"radio"===r||"checkbox"===r?u=t.checked:(a[t.tagName.toLowerCase()]||a[r])&&(i="*".repeat(i.length)),s(t,{text:i,isChecked:u});var c=t.name;"radio"===r&&c&&u&&document.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach((function(e){e!==t&&s(e,{text:e.value,isChecked:!u})}))}}}function s(n,o){var r=W.get(n);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){W.set(n,o);var a=M.getId(n);e(t(t({},o),{id:a}))}}var c=("last"===i.input?["change"]:["input","change"]).map((function(e){return E(e,u)})),l=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),d=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return l&&l.set&&c.push.apply(c,r(d.map((function(e){return I(e[0],e[1],{set:function(){u({target:this})}})})))),function(){c.forEach((function(e){return e()}))}}(e.inputCb,e.blockClass,e.ignoreClass,e.maskInputOptions,e.sampling),h=function(e,t){var n=function(n){return function(o){var r=o.target;r&&!_(r,t)&&e({type:"play"===n?p.Play:p.Pause,id:M.getId(r)})}},o=[E("play",n("play")),E("pause",n("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass),v=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,o){var r=M.getId(this.ownerNode);return-1!==r&&e({id:r,adds:[{rule:n,index:o}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var o=M.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(e.styleSheetRuleCb),y=e.recordCanvas?function(e,t){var o,a,i=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],s=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var o=N(CanvasRenderingContext2D.prototype,n,(function(o){return function(){for(var a=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return _(this.canvas,t)||setTimeout((function(){var t=r(i);"drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement&&(t[0]=t[0].toDataURL()),e({id:M.getId(a.canvas),property:n,args:t})}),0),o.apply(this,i)}}));u.push(o)}catch(t){var a=I(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:M.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(a)}};try{for(var c=n(i),l=c.next();!l.done;l=c.next()){s(l.value)}}catch(e){o={error:e}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return function(){u.forEach((function(e){return e()}))}}(e.canvasMutationCb,e.blockClass):function(){},g=e.collectFonts?function(e){var t=[],n=new WeakMap,o=FontFace;window.FontFace=function(e,t,r){var a=new o(e,t,r);return n.set(a,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),a};var r=N(document.fonts,"add",(function(t){return function(o){return setTimeout((function(){var t=n.get(o);t&&(e(t),n.delete(o))}),0),t.apply(this,[o])}}));return t.push((function(){window.FonFace=o})),t.push(r),function(){t.forEach((function(e){return e()}))}}(e.fontCb):function(){};return function(){u.disconnect(),s(),c(),d(),f(),m(),h(),v(),y(),g()}}function X(e){return t(t({},e),{timestamp:Date.now()})}function Y(e){void 0===e&&(e={});var n=e.emit,r=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,s=e.ignoreClass,d=void 0===s?"rr-ignore":s,p=e.inlineStylesheet,f=void 0===p||p,m=e.maskAllInputs,h=e.maskInputOptions,v=e.hooks,y=e.packFn,g=e.sampling,b=void 0===g?{}:g,S=e.mousemoveWait,C=e.recordCanvas,x=void 0!==C&&C,I=e.collectFonts,N=void 0!==I&&I;if(!n)throw new Error("emit function is required");void 0!==S&&void 0===b.mousemove&&(b.mousemove=S);var _,D,L=!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:void 0!==h?h:{};void 0===_&&(_=window),"NodeList"in _&&!_.NodeList.prototype.forEach&&(_.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in _&&!_.DOMTokenList.prototype.forEach&&(_.DOMTokenList.prototype.forEach=Array.prototype.forEach);var O=0;function R(e){var t,n,r,a;void 0===e&&(e=!1),V(X({type:c.Meta,data:{href:window.location.href,width:k(),height:T()}}),e);var i=j.isFrozen();j.freeze();var s=o(function(e,t,n,o,r,a,i){void 0===t&&(t="rr-block"),void 0===n&&(n=!0),void 0===i&&(i=null);var u={};return[w(e,e,u,t,i,!1,n,!0===o?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===o?{}:o,!0===r||"all"===r?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===r,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===r?{}:r,a),u]}(document,u,f,L,!1,x),2),l=s[0],d=s[1];if(!l)return console.warn("Failed to snapshot the document");M.map=d,V(X({type:c.FullSnapshot,data:{node:l,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),i||(j.emit(),j.unfreeze())}V=function(e,t){if(!j.isFrozen()||e.type===c.FullSnapshot||e.type==c.IncrementalSnapshot&&e.data.source==l.Mutation||(j.emit(),j.unfreeze()),n(y?y(e):e,t),e.type===c.FullSnapshot)D=e,O=0;else if(e.type===c.IncrementalSnapshot){O++;var o=a&&O>=a,i=r&&e.timestamp-D.timestamp>r;(o||i)&&R(!0)}};try{var F=[];F.push(E("DOMContentLoaded",(function(){V(X({type:c.DomContentLoaded,data:{}}))})));var z=function(){R(),F.push(B({mutationCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.Mutation},e)}))},mousemoveCb:function(e,t){return V(X({type:c.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.MouseInteraction},e)}))},scrollCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.Scroll},e)}))},viewportResizeCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.ViewportResize},e)}))},inputCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.Input},e)}))},mediaInteractionCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.StyleSheetRule},e)}))},canvasMutationCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.CanvasMutation},e)}))},fontCb:function(e){return V(X({type:c.IncrementalSnapshot,data:t({source:l.Font},e)}))},blockClass:u,ignoreClass:d,maskInputOptions:L,inlineStylesheet:f,sampling:b,recordCanvas:x,collectFonts:N},v))};return"interactive"===document.readyState||"complete"===document.readyState?z():F.push(E("load",(function(){V(X({type:c.Load,data:{}})),z()}),window)),function(){F.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return Y.addCustomEvent=function(e,t){if(!V)throw new Error("please add custom event after start recording");V(X({type:c.Custom,data:{tag:e,payload:t}}))},Y.freezePage=function(){j.freeze()},Y}();
***************************************************************************** */var e,t=function(){return(t=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 n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function r(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var a=1,i=RegExp("[^a-z1-6-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(s).join(""):null}catch(e){return null}}function s(e){return function(e){return"styleSheet"in e}(e)?u(e.styleSheet)||"":e.cssText}var l,c,d,p,f,m=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,h=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,v=/^(data:)([^,]*),(.*)/i;function y(e,t){return(e||"").replace(m,(function(e,n,o,r,a,i){var u,s=o||a||i,l=n||r||"";if(!s)return e;if(!h.test(s))return"url("+l+s+l+")";if(v.test(s))return"url("+l+s+l+")";if("/"===s[0])return"url("+l+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+s)+l+")";var c=t.split("/"),d=s.split("/");c.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"}))}function b(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function g(e,t,n){return"src"===t||"href"===t&&n?b(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?b(e,n[0])+" "+n[1]:1===n.length?""+b(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?y(n,location.href):n}function S(t,n){var o,r=n.doc,a=n.blockClass,s=n.blockSelector,l=n.inlineStylesheet,c=n.maskInputOptions,d=void 0===c?{}:c,p=n.recordCanvas;switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var f=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!!n&&e.matches(n)}(t,a,s),m=function(e){var t=e.toLowerCase().trim();return i.test(t)?"div":t}(t.tagName),h={},v=0,b=Array.from(t.attributes);v<b.length;v++){var S=b[v],C=S.name,k=S.value;h[C]=g(r,C,k)}if("link"===m&&l){var w,M=Array.from(r.styleSheets).find((function(e){return e.href===t.href}));(w=u(M))&&(delete h.rel,delete h.href,h._cssText=y(w,M.href))}if("style"===m&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(w=u(t.sheet))&&(h._cssText=y(w,location.href));if("input"===m||"textarea"===m||"select"===m){k=t.value;"radio"!==h.type&&"checkbox"!==h.type&&"submit"!==h.type&&"button"!==h.type&&k?h.value=d[h.type]||d[m]?"*".repeat(k.length):k:t.checked&&(h.checked=t.checked)}if("option"===m){var E=t.parentElement;h.value===E.value&&(h.selected=t.selected)}if("canvas"===m&&p&&(h.rr_dataURL=t.toDataURL()),"audio"!==m&&"video"!==m||(h.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(h.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(h.rr_scrollTop=t.scrollTop),f){var I=t.getBoundingClientRect(),x=I.width,N=I.height;h={class:h.class,rr_width:x+"px",rr_height:N+"px"}}return{type:e.Element,tagName:m,attributes:h,childNodes:[],isSVG:(o=t,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:f};case t.TEXT_NODE:var O=t.parentNode&&t.parentNode.tagName,_=t.textContent,T="STYLE"===O||void 0;return T&&_&&(_=y(_,location.href)),"SCRIPT"===O&&(_="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:_||"",isStyle:T};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}}function C(e){return void 0===e?"":e.toLowerCase()}function k(t,n){var o,r=n.doc,i=n.map,u=n.blockClass,s=n.blockSelector,l=n.skipChild,c=void 0!==l&&l,d=n.inlineStylesheet,p=void 0===d||d,f=n.maskInputOptions,m=void 0===f?{}:f,h=n.slimDOMOptions,v=n.recordCanvas,y=void 0!==v&&v,b=n.preserveWhiteSpace,g=void 0===b||b,w=S(t,{doc:r,blockClass:u,blockSelector:s,inlineStylesheet:p,maskInputOptions:m,recordCanvas:y});if(!w)return console.warn(t,"not serialized"),null;o="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(C(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===C(t.attributes.name)||"icon"===C(t.attributes.rel)||"apple-touch-icon"===C(t.attributes.rel)||"shortcut icon"===C(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&C(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(C(t.attributes.property).match(/^(og|twitter|fb):/)||C(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===C(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===C(t.attributes.name)||"googlebot"===C(t.attributes.name)||"bingbot"===C(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===C(t.attributes.name)||"generator"===C(t.attributes.name)||"framework"===C(t.attributes.name)||"publisher"===C(t.attributes.name)||"progid"===C(t.attributes.name)||C(t.attributes.property).match(/^article:/)||C(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===C(t.attributes.name)||"yandex-verification"===C(t.attributes.name)||"csrf-token"===C(t.attributes.name)||"p:domain_verify"===C(t.attributes.name)||"verify-v1"===C(t.attributes.name)||"verification"===C(t.attributes.name)||"shopify-checkout-api-token"===C(t.attributes.name)))return!0}}return!1}(w,h)&&(g||w.type!==e.Text||w.isStyle||w.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:-2;var M=Object.assign(w,{id:o});if(t.__sn=M,-2===o)return null;i[o]=t;var E=!c;if(M.type===e.Element&&(E=E&&!M.needBlock,delete M.needBlock),(M.type===e.Document||M.type===e.Element)&&E){h.headWhitespace&&w.type===e.Element&&"head"===w.tagName&&(g=!1);for(var I=0,x=Array.from(t.childNodes);I<x.length;I++){var N=k(x[I],{doc:r,map:i,blockClass:u,blockSelector:s,skipChild:c,inlineStylesheet:p,maskInputOptions:m,slimDOMOptions:h,recordCanvas:y,preserveWhiteSpace:g});N&&M.childNodes.push(N)}}return M}function w(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)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(l||(l={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font"}(c||(c={})),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"}(d||(d={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(p||(p={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(f||(f={}));var M={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return M.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete M.map[t],e.childNodes&&e.childNodes.forEach((function(e){return M.removeNodeFromMap(e)}))},has:function(e){return M.map.hasOwnProperty(e)}};function E(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(a){var i=Date.now();r||!1!==n.leading||(r=i);var u=t-(i-r),s=this,l=arguments;u<=0||u>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)}),u))}}function I(e,t,n,o,r){void 0===r&&(r=window);var a=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return I(e,t,a||{},!0)}}function x(e,t,n){try{if(!(t in e))return function(){};var o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,function(){e[t]=o}}catch(e){return function(){}}}function N(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function O(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function _(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||_(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,_(e.parentNode,t)}function T(e){return"__sn"in e&&-2===e.__sn.id}function D(e){return Boolean(e.changedTouches)}function L(e){return"__ln"in e}var R=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&L(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&L(e.nextSibling)){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),F=function(e,t){return e+"@"+t};function A(e){return"__sn"in e}function z(e,t){e.delete(t),t.childNodes.forEach((function(t){return z(e,t)}))}function P(e,t){var n=t.parentNode;if(!n)return!1;var o=M.getId(n);return!!e.some((function(e){return e.id===o}))||P(e,n)}function j(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||j(e,n))}var H=new(function(){function e(){var e=this;this.frozen=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.frozen||e.emit()},this.emit=function(){for(var t,o,r,a,i=[],u=new R,s=function(t){for(var n=t,o=-2;-2===o;)o=(n=n&&n.nextSibling)&&M.getId(n);return-1===o&&_(t.nextSibling,e.blockClass)&&(o=null),o},l=function(t){if(t.parentNode){var n=M.getId(t.parentNode),o=s(t);if(-1===n||-1===o)return u.addNode(t);var r=k(t,{doc:document,map:M.map,blockClass:e.blockClass,blockSelector:e.blockSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas});r&&i.push({parentId:n,nextId:o,node:r})}};e.mapRemoves.length;)M.removeNodeFromMap(e.mapRemoves.shift());try{for(var c=n(e.movedSet),d=c.next();!d.done;d=c.next()){var p=d.value;P(e.removes,p)&&!e.movedSet.has(p.parentNode)||l(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),m=f.next();!m.done;m=f.next()){p=m.value;j(e.droppedSet,p)||P(e.removes,p)?j(e.movedSet,p)?l(p):e.droppedSet.add(p):l(p)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}for(var h=null;u.length;){var v=null;if(h){var y=M.getId(h.value.parentNode),b=s(h.value);-1!==y&&-1!==b&&(v=h)}if(!v)for(var g=u.length-1;g>=0;g--){var S=u.get(g);y=M.getId(S.value.parentNode),b=s(S.value);if(-1!==y&&-1!==b){v=S;break}}if(!v)break;h=v.previous,u.removeNode(v.value),l(v.value)}var C={texts:e.texts.map((function(e){return{id:M.getId(e.node),value:e.value}})).filter((function(e){return M.has(e.id)})),attributes:e.attributes.map((function(e){return{id:M.getId(e.node),attributes:e.attributes}})).filter((function(e){return M.has(e.id)})),removes:e.removes,adds:i};(C.texts.length||C.attributes.length||C.removes.length||C.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(C))},this.processMutation=function(t){if(!T(t.target))switch(t.type){case"characterData":var n=t.target.textContent;_(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if(_(t.target,e.blockClass)||n===t.oldValue)return;var o=e.attributes.find((function(e){return e.node===t.target}));o||(o={node:t.target,attributes:{}},e.attributes.push(o)),o.attributes[t.attributeName]=g(document,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var o=M.getId(n),r=M.getId(t.target);_(n,e.blockClass)||_(t.target,e.blockClass)||T(n)||(e.addedSet.has(n)?(z(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===o||function e(t){var n=M.getId(t);return!M.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(t.target)||(e.movedSet.has(n)&&e.movedMap[F(o,r)]?z(e.movedSet,n):e.removes.push({parentId:r,id:o})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!_(t,e.blockClass)){if(A(t)){if(T(t))return;e.movedSet.add(t);var o=null;n&&A(n)&&(o=n.__sn.id),o&&(e.movedMap[F(t.__sn.id,o)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,o,r,a,i){this.blockClass=t,this.blockSelector=n,this.inlineStylesheet=o,this.maskInputOptions=r,this.recordCanvas=a,this.slimDOMOptions=i,this.emissionCallback=e},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.isFrozen=function(){return this.frozen},e}());function V(e,t,n){if(!1===n.mouseInteraction)return function(){};var o=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,r=[];return Object.keys(d).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]})).forEach((function(n){var o=n.toLowerCase(),a=function(n){return function(o){if(!_(o.target,t)){var r=M.getId(o.target),a=D(o)?o.changedTouches[0]:o,i=a.clientX,u=a.clientY;e({type:d[n],id:r,x:i,y:u})}}}(n);r.push(w(o,a))})),function(){r.forEach((function(e){return e()}))}}var W,U=["INPUT","TEXTAREA","SELECT"],B=new WeakMap;function X(e,o){void 0===o&&(o={}),function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,u=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb,p=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,r(e)),n.apply(void 0,r(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,r(e)),o.apply(void 0,r(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,r(e)),a.apply(void 0,r(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,r(e)),i.apply(void 0,r(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,r(e)),u.apply(void 0,r(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,r(e)),s.apply(void 0,r(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,r(e)),l.apply(void 0,r(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,r(e)),c.apply(void 0,r(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,r(e)),d.apply(void 0,r(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,r(e)),p.apply(void 0,r(e))}}(e,o);var a,i,u=function(e,t,n,o,r,a,i){H.init(e,t,n,o,r,a,i);var u=new MutationObserver(H.processMutations.bind(H));return u.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),u}(e.mutationCb,e.blockClass,e.blockSelector,e.inlineStylesheet,e.maskInputOptions,e.recordCanvas,e.slimDOMOptions),s=function(e,t){if(!1===t.mousemove)return function(){};var n,o="number"==typeof t.mousemove?t.mousemove:50,r=[],a=E((function(t){var o=Date.now()-n;e(r.map((function(e){return e.timeOffset-=o,e})),t?c.TouchMove:c.MouseMove),r=[],n=null}),500),i=E((function(e){var t=e.target,o=D(e)?e.changedTouches[0]:e,i=o.clientX,u=o.clientY;n||(n=Date.now()),r.push({x:i,y:u,id:M.getId(t),timeOffset:Date.now()-n}),a(D(e))}),o,{trailing:!1}),u=[w("mousemove",i),w("touchmove",i)];return function(){u.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling),l=V(e.mouseInteractionCb,e.blockClass,e.sampling),d=(a=e.scrollCb,i=e.blockClass,w("scroll",E((function(e){if(e.target&&!_(e.target,i)){var t=M.getId(e.target);if(e.target===document){var n=document.scrollingElement||document.documentElement;a({id:t,x:n.scrollLeft,y:n.scrollTop})}else a({id:t,x:e.target.scrollLeft,y:e.target.scrollTop})}}),e.sampling.scroll||100))),f=function(e){return w("resize",E((function(){var t=N(),n=O();e({width:Number(n),height:Number(t)})}),200),window)}(e.viewportResizeCb),m=function(e,n,o,a,i,u){function s(e){var t=e.target;if(t&&t.tagName&&!(U.indexOf(t.tagName)<0)&&!_(t,n)){var r=t.type;if("password"!==r&&!t.classList.contains(o)){var u=t.value,s=!1;"radio"===r||"checkbox"===r?s=t.checked:(a[t.tagName.toLowerCase()]||a[r])&&(u=i?i(u):"*".repeat(u.length)),l(t,{text:u,isChecked:s});var c=t.name;"radio"===r&&c&&s&&document.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach((function(e){e!==t&&l(e,{text:e.value,isChecked:!s})}))}}}function l(n,o){var r=B.get(n);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){B.set(n,o);var a=M.getId(n);e(t(t({},o),{id:a}))}}var c=("last"===u.input?["change"]:["input","change"]).map((function(e){return w(e,s)})),d=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),p=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return d&&d.set&&c.push.apply(c,r(p.map((function(e){return I(e[0],e[1],{set:function(){s({target:this})}})})))),function(){c.forEach((function(e){return e()}))}}(e.inputCb,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling),h=function(e,t){var n=function(n){return function(o){var r=o.target;r&&!_(r,t)&&e({type:"play"===n?p.Play:p.Pause,id:M.getId(r)})}},o=[w("play",n("play")),w("pause",n("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass),v=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,o){var r=M.getId(this.ownerNode);return-1!==r&&e({id:r,adds:[{rule:n,index:o}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var o=M.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(e.styleSheetRuleCb),y=e.recordCanvas?function(e,t){var o,a,i=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],s=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var o=x(CanvasRenderingContext2D.prototype,n,(function(o){return function(){for(var a=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return _(this.canvas,t)||setTimeout((function(){var t=r(i);"drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement&&(t[0]=t[0].toDataURL()),e({id:M.getId(a.canvas),property:n,args:t})}),0),o.apply(this,i)}}));u.push(o)}catch(t){var a=I(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:M.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(a)}};try{for(var l=n(i),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return function(){u.forEach((function(e){return e()}))}}(e.canvasMutationCb,e.blockClass):function(){},b=e.collectFonts?function(e){var t=[],n=new WeakMap,o=FontFace;window.FontFace=function(e,t,r){var a=new o(e,t,r);return n.set(a,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),a};var r=x(document.fonts,"add",(function(t){return function(o){return setTimeout((function(){var t=n.get(o);t&&(e(t),n.delete(o))}),0),t.apply(this,[o])}}));return t.push((function(){window.FonFace=o})),t.push(r),function(){t.forEach((function(e){return e()}))}}(e.fontCb):function(){};return function(){u.disconnect(),s(),l(),d(),f(),m(),h(),v(),y(),b()}}function q(e){return t(t({},e),{timestamp:Date.now()})}function Y(e){void 0===e&&(e={});var n=e.emit,r=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,s=e.blockSelector,d=void 0===s?null:s,p=e.ignoreClass,f=void 0===p?"rr-ignore":p,m=e.inlineStylesheet,h=void 0===m||m,v=e.maskAllInputs,y=e.maskInputOptions,b=e.slimDOMOptions,g=e.maskInputFn,S=e.hooks,C=e.packFn,E=e.sampling,I=void 0===E?{}:E,x=e.mousemoveWait,_=e.recordCanvas,T=void 0!==_&&_,D=e.collectFonts,L=void 0!==D&&D;if(!n)throw new Error("emit function is required");void 0!==x&&void 0===I.mousemove&&(I.mousemove=x);var R,F,A=!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:void 0!==y?y:{},z=!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===b,headMetaDescKeywords:"all"===b}:{};void 0===R&&(R=window),"NodeList"in R&&!R.NodeList.prototype.forEach&&(R.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in R&&!R.DOMTokenList.prototype.forEach&&(R.DOMTokenList.prototype.forEach=Array.prototype.forEach);var P=0;function j(e){var t,n,r,a;void 0===e&&(e=!1),W(q({type:l.Meta,data:{href:window.location.href,width:O(),height:N()}}),e);var i=H.isFrozen();H.freeze();var s=o(function(e,t){var n=t||{},o=n.blockClass,r=void 0===o?"rr-block":o,a=n.inlineStylesheet,i=void 0===a||a,u=n.recordCanvas,s=void 0!==u&&u,l=n.blockSelector,c=void 0===l?null:l,d=n.maskAllInputs,p=void 0!==d&&d,f=n.slimDOM,m=void 0!==f&&f,h={};return[k(e,{doc:e,map:h,blockClass:r,blockSelector:c,skipChild:!1,inlineStylesheet:i,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===p?{}:p,slimDOMOptions:!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===m,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===m?{}:m,recordCanvas:s}),h]}(document,{blockClass:u,blockSelector:d,inlineStylesheet:h,maskAllInputs:A,slimDOM:z,recordCanvas:T}),2),c=s[0],p=s[1];if(!c)return console.warn("Failed to snapshot the document");M.map=p,W(q({type:l.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),i||(H.emit(),H.unfreeze())}W=function(e,t){if(!H.isFrozen()||e.type===l.FullSnapshot||e.type===l.IncrementalSnapshot&&e.data.source===c.Mutation||(H.emit(),H.unfreeze()),n(C?C(e):e,t),e.type===l.FullSnapshot)F=e,P=0;else if(e.type===l.IncrementalSnapshot){P++;var o=a&&P>=a,i=r&&e.timestamp-F.timestamp>r;(o||i)&&j(!0)}};try{var V=[];V.push(w("DOMContentLoaded",(function(){W(q({type:l.DomContentLoaded,data:{}}))})));var U=function(){j(),V.push(X({mutationCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.Mutation},e)}))},mousemoveCb:function(e,t){return W(q({type:l.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.MouseInteraction},e)}))},scrollCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.Scroll},e)}))},viewportResizeCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.ViewportResize},e)}))},inputCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.Input},e)}))},mediaInteractionCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.StyleSheetRule},e)}))},canvasMutationCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.CanvasMutation},e)}))},fontCb:function(e){return W(q({type:l.IncrementalSnapshot,data:t({source:c.Font},e)}))},blockClass:u,blockSelector:d,ignoreClass:f,maskInputOptions:A,maskInputFn:g,inlineStylesheet:h,sampling:I,recordCanvas:T,collectFonts:L,slimDOMOptions:z},S))};return"interactive"===document.readyState||"complete"===document.readyState?U():V.push(w("load",(function(){W(q({type:l.Load,data:{}})),U()}),window)),function(){V.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return Y.addCustomEvent=function(e,t){if(!W)throw new Error("please add custom event after start recording");W(q({type:l.Custom,data:{tag:e,payload:t}}))},Y.freezePage=function(){H.freeze()},Y}();
//# sourceMappingURL=rrweb-record.min.js.map

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

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}!function(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 a=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function s(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function o(){var e={line:n,column:r};return function(t){return t.position=new s(e),m(),t}}var s=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};s.prototype.content=e;var l=[];function u(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;l.push(o)}function d(){return h(/^{\s*/)}function f(){return h(/^}/)}function p(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=I()||C());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=o(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=c(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(a,""),value:r?c(r[0]).replace(a,""):""});return h(/^[;\s]*/),i}}function x(){var e,t=[];if(!d())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return f()?t:u("missing '}'")}function S(){for(var e,t=[],n=o();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:x()})}var w,E=N("import"),M=N("charset"),T=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=o(),r=h(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function I(){if("@"===e[0])return function(){var e=o(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,i=t[1];if(!d())return u("@keyframes missing '{'");for(var a=v();r=S();)a.push(r),a=a.concat(v());return f()?e({type:"keyframes",name:i,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=o(),t=h(/^@media *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@media missing '{'");var r=v().concat(p());return f()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=o(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=o(),t=h(/^@supports *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@supports missing '{'");var r=v().concat(p());return f()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||M()||T()||function(){var e=o(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=c(t[1]),r=c(t[2]);if(!d())return u("@document missing '{'");var i=v().concat(p());return f()?e({type:"document",document:r,vendor:n,rules:i}):u("@document missing '}'")}}()||function(){var e=o();if(h(/^@page */)){var t=g()||[];if(!d())return u("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return f()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=o();if(h(/^@host\s*/)){if(!d())return u("@host missing '{'");var t=v().concat(p());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=o();if(h(/^@font-face\s*/)){if(!d())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return f()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function C(){var e=o(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:x()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,i=r?t:n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],c=t[s];Array.isArray(c)?c.forEach((function(t){e(t,i)})):c&&"object"==typeof c&&e(c,i)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((w=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:w,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}var l={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 u=/([^\\]):hover/g;function d(e){var t=s(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(u.test(t)){var n=t.replace(u,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e):e}function f(e,n,r){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,o=function(e){var t=l[e.tagName]?l[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o);var a=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var a=e.attributes[t];if(a="boolean"==typeof a||"number"==typeof a?"":a,t.startsWith("rr_")){if("canvas"===o&&"rr_dataURL"===t){var s=document.createElement("img");s.src=a,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=a),"rr_height"===t&&(i.style.height=a),"rr_mediaState"===t)switch(a){case"played":i.play();case"paused":i.pause()}}else{var c="textarea"===o&&"value"===t,l="style"===o&&"_cssText"===t;if(l&&r&&(a=d(a)),c||l){for(var u=n.createTextNode(a),f=0,p=Array.from(i.childNodes);f<p.length;f++){var h=p[f];h.nodeType===i.TEXT_NODE&&i.removeChild(h)}return i.appendChild(u),"continue"}if("iframe"===o&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?i.setAttributeNS("http://www.w3.org/1999/xlink",t,a):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?i.setAttribute("_"+t,a):i.setAttribute(t,a)}catch(e){}}};for(var s in e.attributes)a(s);return i;case t.Text:return n.createTextNode(e.isStyle&&r?d(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function p(e,n,r,i,o){void 0===i&&(i=!1),void 0===o&&(o=!0);var a=f(e,n,o);if(!a)return null;if(e.type===t.Document&&(n.close(),n.open(),a=n),a.__sn=e,r[e.id]=a,(e.type===t.Document||e.type===t.Element)&&!i)for(var s=0,c=e.childNodes;s<c.length;s++){var l=c[s],u=p(l,n,r,!1,o);u?a.appendChild(u):console.warn("Failed to rebuild",l)}return a}function h(e,n,r,i){void 0===i&&(i=!0);var o={},a=p(e,n,o,!1,i);return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(o,(function(e){r&&r(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=n.attributes[i];"rr_scrollLeft"===i&&(r.scrollLeft=o),"rr_scrollTop"===i&&(r.scrollTop=o)}}}(e)})),[a,o]}function m(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 v,y,g,b,x,S=Object.freeze({__proto__:null,default:m});function w(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=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)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;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)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(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 l(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=l(e,"Y")&&u(e,"Y"),n=l(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var c,l,u,d,f=o();n===t.body?(c=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(c=n,l=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:c,method:d,startTime:f,startX:l,startY:u,x:r,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(v||(v={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font"}(y||(y={})),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"}(g||(g={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(b||(b={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(x||(x={}));var E,M=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,o(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;this.raf=requestAnimationFrame((function r(i){for(n.timeOffset+=(i-e)*n.speed,e=i;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function T(e,t){if(e.type===v.IncrementalSnapshot&&e.data.source===y.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}!function(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 a=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function s(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function o(){var e={line:n,column:r};return function(t){return t.position=new s(e),m(),t}}var s=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};s.prototype.content=e;var c=[];function u(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;c.push(o)}function d(){return h(/^{\s*/)}function f(){return h(/^}/)}function p(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=C()||I());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return l(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=o(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=l(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(a,""),value:r?l(r[0]).replace(a,""):""});return h(/^[;\s]*/),i}}function S(){var e,t=[];if(!d())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return f()?t:u("missing '}'")}function x(){for(var e,t=[],n=o();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:S()})}var w,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=o(),r=h(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function C(){if("@"===e[0])return function(){var e=o(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,i=t[1];if(!d())return u("@keyframes missing '{'");for(var a=v();r=x();)a.push(r),a=a.concat(v());return f()?e({type:"keyframes",name:i,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=o(),t=h(/^@media *([^{]+)/);if(t){var n=l(t[1]);if(!d())return u("@media missing '{'");var r=v().concat(p());return f()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=o(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:l(t[1]),media:l(t[2])})}()||function(){var e=o(),t=h(/^@supports *([^{]+)/);if(t){var n=l(t[1]);if(!d())return u("@supports missing '{'");var r=v().concat(p());return f()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=o(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=l(t[1]),r=l(t[2]);if(!d())return u("@document missing '{'");var i=v().concat(p());return f()?e({type:"document",document:r,vendor:n,rules:i}):u("@document missing '}'")}}()||function(){var e=o();if(h(/^@page */)){var t=g()||[];if(!d())return u("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return f()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=o();if(h(/^@host\s*/)){if(!d())return u("@host missing '{'");var t=v().concat(p());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=o();if(h(/^@font-face\s*/)){if(!d())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return f()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function I(){var e=o(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:S()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,i=r?t:n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,i)})):l&&"object"==typeof l&&e(l,i)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((w=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:w,parsingErrors:c}}))}function l(e){return e?e.replace(/^\s+|\s+$/g,""):""}var c={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 u=/([^\\]):hover/g;function d(e){var t=s(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(u.test(t)){var n=t.replace(u,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e):e}function f(e,n){var r=n.doc,i=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var o,a=function(e){var t=c[e.tagName]?c[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);o=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(o.style.width=n),"rr_height"===t&&(o.style.height=n),"rr_mediaState"===t)switch(n){case"played":o.play();case"paused":o.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&i&&(n=d(n)),l||c){for(var u=r.createTextNode(n),f=0,p=Array.from(o.childNodes);f<p.length;f++){var h=p[f];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?o.setAttributeNS("http://www.w3.org/1999/xlink",t,n):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?o.setAttribute("_"+t,n):o.setAttribute(t,n)}catch(e){}}};for(var l in e.attributes)s(l);return o;case t.Text:return r.createTextNode(e.isStyle&&i?d(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function p(e,n){var r=n.doc,i=n.map,o=n.skipChild,a=void 0!==o&&o,s=n.hackCss,l=void 0===s||s,c=f(e,{doc:r,hackCss:l});if(!c)return null;if(e.type===t.Document&&(r.close(),r.open(),c=r),c.__sn=e,i[e.id]=c,(e.type===t.Document||e.type===t.Element)&&!a)for(var u=0,d=e.childNodes;u<d.length;u++){var h=d[u],m=p(h,{doc:r,map:i,skipChild:!1,hackCss:l});m?c.appendChild(m):console.warn("Failed to rebuild",h)}return c}function h(e,n){var r=n.doc,i=n.onVisit,o=n.hackCss,a={},s=p(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===o||o});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){i&&i(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=n.attributes[i];"rr_scrollLeft"===i&&(r.scrollLeft=o),"rr_scrollTop"===i&&(r.scrollTop=o)}}}(e)})),[s,a]}function m(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 v,y,g,b,S,x=Object.freeze({__proto__:null,default:m});function w(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=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!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(v||(v={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font"}(y||(y={})),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"}(g||(g={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(b||(b={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(S||(S={}));var E,T=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,o(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;this.raf=requestAnimationFrame((function r(i){for(n.timeOffset+=(i-e)*n.speed,e=i;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function M(e,t){if(e.type===v.IncrementalSnapshot&&e.data.source===y.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************

@@ -30,3 +30,3 @@ Copyright (c) Microsoft Corporation. All rights reserved.

and limitations under the License.
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(E||(E={}));var N={type:"xstate.init"};function I(e){return void 0===e?[]:[].concat(e)}function C(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function _(e){return function(t){return e===t}}function k(e){return"string"==typeof e?{type:e}:e}function D(e,t){return{value:e,context:t,actions:[],changed:!1,matches:_(e)}}function F(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:I(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:_(e.initial)},transition:function(t,r){var i,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,c=a.context,l=k(r),u=e.states[s];if(u.on){var d=I(u.on[l.type]),f=function(t){if(void 0===t)return{value:D(s,c)};var r="string"==typeof t?{target:t}:t,i=r.target,o=void 0===i?s:i,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=c;if((void 0===f?function(){return!0}:f)(c,l)){var h=e.states[o],m=!1,v=[].concat(u.exit,d,h.entry).filter((function(e){return e})).map((function(e){return A(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,l):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,l):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:o,context:p,actions:v,changed:o!==s||v.length>0||m,matches:_(o)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return D(s,c)}};return n}var O=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function L(e){var t=e.initialState,n=E.NotStarted,r=new Set,i={_machine:e,send:function(i){n===E.Running&&(t=e.transition(t,i),O(t,k(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var o="object"==typeof r?r:{context:e.config.context,value:r};t={value:o.value,actions:[],context:o.context,matches:_(o.value)}}return n=E.Running,O(t,N),i},stop:function(){return n=E.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var P={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return P.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete P.map[t],e.childNodes&&e.childNodes.forEach((function(e){return P.removeNodeFromMap(e)}))},has:function(e){return P.map.hasOwnProperty(e)}};var R=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),i=function(e){t.removeIdSet.add(e);var n=P.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},o=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return o(e)}));var r=t.indexes.get(n.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),o(r)):(delete this.tree[r.id],this.indexes.delete(r.id),o(r)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,i,o=this,a=this.tree,s=this.removeNodeMutations,c=this.textMutations,l=this.attributeMutations,u={source:y.Mutation,removes:s,texts:c,attributes:l,adds:[]},d=function(e,t){t&&o.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=r(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=r(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:g,inputMap:b}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function j(e){var t,n,i={},o=function(e,t){var n={value:e,parent:t,children:[]};return i[e.node.id]=n,n},a=[];try{for(var s=r(e),c=s.next();!c.done;c=s.next()){var l=c.value,u=l.nextId,d=l.parentId;if(u&&u in i){var f=i[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,o(l,f.parent))}else{p=a.indexOf(f);a.splice(p,0,o(l,null))}}else if(d in i){var h=i[d];h.children.push(o(l,h))}else a.push(o(l,null))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function B(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)B(e.children[n],t)}function V(e,t){var i=t.getCastFn,o=t.emitter;return L(F({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:C({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:C((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,c,l=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;l.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){T(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===v.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),g=new Array,b=function(e){var t=null==f?void 0:f.timestamp;if((null==f?void 0:f.type)===v.IncrementalSnapshot&&f.data.source===y.MouseMove&&(t=f.timestamp+(null===(c=f.data.positions[0])||void 0===c?void 0:c.timeOffset)),t&&t<d&&(e.timestamp<=t||e===f))return"continue";var n=e.timestamp<d;if(n&&!function(e){switch(e.type){case v.DomContentLoaded:case v.Load:case v.Custom:return!1;case v.FullSnapshot:case v.Meta:return!0}switch(e.data.source){case y.MouseMove:case y.MouseInteraction:case y.TouchMove:case y.MediaInteraction:return!1;case y.ViewportResize:case y.StyleSheetRule:case y.Scroll:case y.Input:return!0}return!0}(e))return"continue";var r=i(e,n);n?r():g.push({doAction:function(){r(),o.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=r(m),w=S.next();!w.done;w=S.next()){b(w.value)}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}o.emit(x.Flush),l.addActions(g),l.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:C((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:C({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:C((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var c=t.payload.event;T(c,r),s.push(c);var l=c.timestamp<r,u=i(c,l);l?u():(a.addAction({doAction:function(){u(),o.emit(x.EventCast,c)},delay:c.delay}),a.isActive()||a.start())}return n(n({},e),{events:s})}))}}))}var U=m||S,W={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},z=function(){function e(e,n){var o=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=U(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,!(null==n?void 0:n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var a={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,mouseTail:W};this.config=Object.assign({},a,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new R,this.fragmentParentMap=new Map,this.emitter.on(x.Flush,(function(){var e,n,a,s,c,l,u=o.treeIndex.flush(),d=u.scrollMap,f=u.inputMap;try{for(var p=r(d.values()),h=p.next();!h.done;h=p.next()){var m=h.value;o.applyScroll(m)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}try{for(var v=r(f.values()),y=v.next();!y.done;y=v.next()){m=y.value;o.applyInput(m)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}try{for(var g=r(o.fragmentParentMap.entries()),b=g.next();!b.done;b=g.next()){var x=i(b.value,2),S=x[0],w=x[1];P.map[w.__sn.id]=w,w.__sn.type===t.Element&&"textarea"===w.__sn.tagName&&S.textContent&&(w.value=S.textContent),w.appendChild(S)}}catch(e){c={error:e}}finally{try{b&&!b.done&&(l=g.return)&&l.call(g)}finally{if(c)throw c.error}}o.fragmentParentMap.clear()}));var s=new M([],(null==n?void 0:n.speed)||a.speed);this.service=V({events:e.map((function(e){return n&&n.unpackFn?n.unpackFn(e):e})),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){o.emitter.emit(x.StateChange,{player:e})})),this.speedService=L(F({id:"speed",context:{normalSpeed:-1,timer:s},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:C({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){o.emitter.emit(x.StateChange,{speed:e})}));var c=this.service.state.context.events.find((function(e){return e.type===v.Meta})),l=this.service.state.context.events.find((function(e){return e.type===v.FullSnapshot}));if(c){var u=c.data,d=u.width,f=u.height;setTimeout((function(){o.emitter.emit(x.Resize,{width:d,height:f})}),0)}l&&this.rebuildFullSnapshot(l)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),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.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}})},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),this.emitter.emit(x.Start)},e.prototype.pause=function(e){void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="none",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(w(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach))},e.prototype.handleResize=function(e){var t,n;try{for(var i=r([this.mouseTail,this.iframe]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&(a.style.display="inherit",a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,i=this;switch(void 0===t&&(t=!1),e.type){case v.DomContentLoaded:case v.Load:break;case v.Custom:n=function(){i.emitter.emit(x.CustomEvent,e)};break;case v.Meta:n=function(){return i.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case v.FullSnapshot:n=function(){i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case v.IncrementalSnapshot:n=function(){var n,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=r(i.service.state.context.events),s=a.next();!s.done;s=a.next()){var c=s.value;if(!(c.timestamp<=e.timestamp)&&i.isUserInteraction(c)){c.delay-e.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=c);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}if(i.nextUserInteractionEvent){var l=i.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(l/5e3),360)};i.speedService.send({type:"FAST_FORWARD",payload:u}),i.emitter.emit(x.SkipStart,u)}}}}return function(){if(n&&n(),i.service.send({type:"CAST_EVENT",payload:{event:e}}),e===i.service.state.context.events[i.service.state.context.events.length-1]){var t=function(){i.backToNormal(),i.service.send("END"),i.emitter.emit(x.Finish)};e.type===v.IncrementalSnapshot&&e.data.source===y.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={},P.map=h(e.data.node,this.iframe.contentDocument)[1];var n=document.createElement("style"),r=this.iframe.contentDocument,i=r.documentElement,o=r.head;i.insertBefore(n,o);for(var a,s=(a=this.config.blockClass,["iframe, ."+a+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules),c=0;c<s.length;c++)n.sheet.insertRule(s[c],c);this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),r=window.setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,i=this.service.state,o=function(){i=n.service.state};this.emitter.on(x.Start,o),this.emitter.on(x.Pause,o);var a=0,s=0;try{for(var c=r(this.service.state.context.events),l=c.next();!l.done;l=c.next()){var u=l.value;if(u.type===v.IncrementalSnapshot&&u.data.source===y.CanvasMutation&&"drawImage"===u.data.property&&"string"==typeof u.data.args[0]&&!this.imageMap.has(u)){a++;var d=document.createElement("img");d.src=u.data.args[0],this.imageMap.set(u,d),d.onload=function(){++s===a&&(i.matches("playing")&&n.play(n.getCurrentTime()),n.emitter.off(x.Start,o),n.emitter.off(x.Pause,o))}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}a!==s&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,i=this,o=e.data;switch(o.source){case y.Mutation:t&&(o.adds.forEach((function(e){return i.treeIndex.add(e)})),o.texts.forEach((function(e){return i.treeIndex.text(e)})),o.attributes.forEach((function(e){return i.treeIndex.attribute(e)})),o.removes.forEach((function(e){return i.treeIndex.remove(e)}))),this.applyMutation(o,t);break;case y.MouseMove:if(t){var a=o.positions[o.positions.length-1];this.moveAndHover(o,a.x,a.y,a.id)}else o.positions.forEach((function(t){var n={doAction:function(){i.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-i.service.state.context.baselineTime};i.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=o.positions[0])||void 0===n?void 0:n.timeOffset)});break;case y.MouseInteraction:if(-1===o.id)break;var s=new Event(g[o.type].toLowerCase());if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);this.emitter.emit(x.MouseInteraction,{type:o.type,target:v});var c=this.config.triggerFocus;switch(o.type){case g.Blur:"blur"in v&&v.blur();break;case g.Focus:c&&v.focus&&v.focus({preventScroll:!0});break;case g.Click:case g.TouchStart:case g.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:v.dispatchEvent(s)}break;case y.Scroll:if(-1===o.id)break;if(t){this.treeIndex.scroll(o);break}this.applyScroll(o);break;case y.ViewportResize:this.emitter.emit(x.Resize,{width:o.width,height:o.height});break;case y.Input:if(-1===o.id)break;if(t){this.treeIndex.input(o);break}this.applyInput(o);break;case y.MediaInteraction:if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var l=v;try{o.type===b.Pause&&l.pause(),o.type===b.Play&&(l.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?l.play():l.addEventListener("canplay",(function(){l.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case y.StyleSheetRule:if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var u=v,d=v.parentNode,f=this.fragmentParentMap.has(d),p=void 0;if(f){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),d.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;o.adds&&o.adds.forEach((function(e){var t=e.rule,n=e.index,r=void 0===n?void 0:Math.min(n,m.rules.length);try{m.insertRule(t,r)}catch(e){}})),o.removes&&o.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),f&&p&&d.replaceChild(v,p);break;case y.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{var S=v.getContext("2d");if(o.setter)return void(S[o.property]=o.args[0]);var w=S[o.property];if("drawImage"===o.property&&"string"==typeof o.args[0]){var E=this.imageMap.get(e);o.args[0]=E,w.apply(S,o.args)}else w.apply(S,o.args)}catch(e){this.warnCanvasMutationFailed(o,o.id,e)}break;case y.Font:try{var M=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,t){var i,o,a=this;e.removes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);var r=P.getNode(t.parentId);if(!r)return a.warnNodeNotFound(e,t.parentId);if(P.removeNodeFromMap(n),r){var i=a.fragmentParentMap.get(r);i&&i.contains(n)?i.removeChild(n):r.removeChild(n)}}));var s=n({},this.legacy_missingNodeRetryMap),c=[];var l=function(e){if(!a.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var n=P.getNode(e.parentId);if(!n)return c.push(e);var r=null;if(a.iframe.contentDocument.contains?r=a.iframe.contentDocument.contains(n):a.iframe.contentDocument.body.contains&&(r=a.iframe.contentDocument.body.contains(n)),t&&r){var i=document.createDocumentFragment();for(P.map[e.parentId]=i,a.fragmentParentMap.set(i,n);n.firstChild;)i.appendChild(n.firstChild);n=i}var o=null,l=null;if(e.previousId&&(o=P.getNode(e.previousId)),e.nextId&&(l=P.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=P.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);var u=p(e.node,a.iframe.contentDocument,P.map,!0);-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?n.insertBefore(u,o.nextSibling):l&&l.parentNode?n.contains(l)?n.insertBefore(u,l):n.insertBefore(u,null):n.appendChild(u),(e.previousId||e.nextId)&&a.legacy_resolveMissingNode(s,n,u,e)):s[e.node.id]={node:u,mutation:e}};e.adds.forEach((function(e){l(e)}));for(var u=Date.now();c.length;){var d=j(c);if(c.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var f=(i=void 0,r(d)),h=f.next();!h.done;h=f.next()){var m=h.value;P.getNode(m.value.parentId)?B(m,(function(e){l(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),e.texts.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);for(var r in a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var i=t.attributes[r];try{null!==i?n.setAttribute(r,i):n.removeAttribute(r)}catch(e){a.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var c=a,l=c.node,u=c.mutation;t.insertBefore(l,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,l,u)}if(s){var d=s;l=d.node,u=d.mutation;t.insertBefore(l,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,l,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px",this.drawMouseTail({x:t,y:n});var i=P.getNode(r);if(!i)return this.debugNodeNotFound(e,r);this.hoverElements(i)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?W:Object.assign({},W,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,o=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=r,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===v.IncrementalSnapshot&&(e.data.source>y.Mutation&&e.data.source<=y.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,o(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,o(["[replayer]"],e))},e}();return e.Replayer=z,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(E||(E={}));var N={type:"xstate.init"};function C(e){return void 0===e?[]:[].concat(e)}function I(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function k(e){return function(t){return e===t}}function _(e){return"string"==typeof e?{type:e}:e}function D(e,t){return{value:e,context:t,actions:[],changed:!1,matches:k(e)}}function F(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:C(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:k(e.initial)},transition:function(t,r){var i,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=_(r),u=e.states[s];if(u.on){var d=C(u.on[c.type]),f=function(t){if(void 0===t)return{value:D(s,l)};var r="string"==typeof t?{target:t}:t,i=r.target,o=void 0===i?s:i,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=l;if((void 0===f?function(){return!0}:f)(l,c)){var h=e.states[o],m=!1,v=[].concat(u.exit,d,h.entry).filter((function(e){return e})).map((function(e){return A(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,c):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:o,context:p,actions:v,changed:o!==s||v.length>0||m,matches:k(o)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return D(s,l)}};return n}var O=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function L(e){var t=e.initialState,n=E.NotStarted,r=new Set,i={_machine:e,send:function(i){n===E.Running&&(t=e.transition(t,i),O(t,_(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var o="object"==typeof r?r:{context:e.config.context,value:r};t={value:o.value,actions:[],context:o.context,matches:k(o.value)}}return n=E.Running,O(t,N),i},stop:function(){return n=E.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var P={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return P.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete P.map[t],e.childNodes&&e.childNodes.forEach((function(e){return P.removeNodeFromMap(e)}))},has:function(e){return P.map.hasOwnProperty(e)}};var R=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),i=function(e){t.removeIdSet.add(e);var n=P.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},o=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return o(e)}));var r=t.indexes.get(n.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),o(r)):(delete this.tree[r.id],this.indexes.delete(r.id),o(r)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,i,o=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:y.Mutation,removes:s,texts:l,attributes:c,adds:[]},d=function(e,t){t&&o.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=r(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=r(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:g,inputMap:b}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function j(e){var t,n,i={},o=function(e,t){var n={value:e,parent:t,children:[]};return i[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in i){var f=i[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,o(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,o(c,null))}}else if(d in i){var h=i[d];h.children.push(o(c,h))}else a.push(o(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function B(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)B(e.children[n],t)}function V(e,t){var i=t.getCastFn,o=t.emitter;return L(F({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:I({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:I((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,l,c=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;c.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){M(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===v.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),g=new Array,b=function(e){var t=null==f?void 0:f.timestamp;if((null==f?void 0:f.type)===v.IncrementalSnapshot&&f.data.source===y.MouseMove&&(t=f.timestamp+(null===(l=f.data.positions[0])||void 0===l?void 0:l.timeOffset)),t&&t<d&&(e.timestamp<=t||e===f))return"continue";var n=e.timestamp<d;if(n&&!function(e){switch(e.type){case v.DomContentLoaded:case v.Load:case v.Custom:return!1;case v.FullSnapshot:case v.Meta:return!0}switch(e.data.source){case y.MouseMove:case y.MouseInteraction:case y.TouchMove:case y.MediaInteraction:return!1;case y.ViewportResize:case y.StyleSheetRule:case y.Scroll:case y.Input:return!0}return!0}(e))return"continue";var r=i(e,n);n?r():g.push({doAction:function(){r(),o.emit(S.EventCast,e)},delay:e.delay})};try{for(var x=r(m),w=x.next();!w.done;w=x.next()){b(w.value)}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}o.emit(S.Flush),c.addActions(g),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:I((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:I({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:I((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;M(l,r),s.push(l);var c=l.timestamp<r,u=i(l,c);c?u():(a.addAction({doAction:function(){u(),o.emit(S.EventCast,l)},delay:l.delay}),a.isActive()||a.start())}return n(n({},e),{events:s})}))}}))}var U=m||x,W={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},z=function(){function e(e,n){var o=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=U(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,!(null==n?void 0:n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var a={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:W};this.config=Object.assign({},a,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(S.Resize,this.handleResize),this.setupDom(),this.treeIndex=new R,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(S.Flush,(function(){var e,n,a,s,l,c,u=o.treeIndex.flush(),d=u.scrollMap,f=u.inputMap;try{for(var p=r(o.fragmentParentMap.entries()),h=p.next();!h.done;h=p.next()){var m=i(h.value,2),v=m[0],y=m[1];P.map[y.__sn.id]=y,y.__sn.type===t.Element&&"textarea"===y.__sn.tagName&&v.textContent&&(y.value=v.textContent),y.appendChild(v),o.restoreState(y)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}o.fragmentParentMap.clear(),o.elementStateMap.clear();try{for(var g=r(d.values()),b=g.next();!b.done;b=g.next()){var S=b.value;o.applyScroll(S)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}try{for(var x=r(f.values()),w=x.next();!w.done;w=x.next()){S=w.value;o.applyInput(S)}}catch(e){l={error:e}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}}));var s=new T([],(null==n?void 0:n.speed)||a.speed);this.service=V({events:e.map((function(e){return n&&n.unpackFn?n.unpackFn(e):e})),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){o.emitter.emit(S.StateChange,{player:e})})),this.speedService=L(F({id:"speed",context:{normalSpeed:-1,timer:s},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:I({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){o.emitter.emit(S.StateChange,{speed:e})}));var l=this.service.state.context.events.find((function(e){return e.type===v.Meta})),c=this.service.state.context.events.find((function(e){return e.type===v.FullSnapshot}));if(l){var u=l.data,d=u.width,f=u.height;setTimeout((function(){o.emitter.emit(S.Resize,{width:d,height:f})}),0)}c&&setTimeout((function(){o.rebuildFullSnapshot(c)}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(S.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(S.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(S.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(w(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var i=r([this.mouseTail,this.iframe]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,i=this;switch(void 0===t&&(t=!1),e.type){case v.DomContentLoaded:case v.Load:break;case v.Custom:n=function(){i.emitter.emit(S.CustomEvent,e)};break;case v.Meta:n=function(){return i.emitter.emit(S.Resize,{width:e.data.width,height:e.data.height})};break;case v.FullSnapshot:n=function(){i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case v.IncrementalSnapshot:n=function(){var n,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=r(i.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&i.isUserInteraction(l)){l.delay-e.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}if(i.nextUserInteractionEvent){var c=i.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),360)};i.speedService.send({type:"FAST_FORWARD",payload:u}),i.emitter.emit(S.SkipStart,u)}}}}return function(){if(n&&n(),i.service.send({type:"CAST_EVENT",payload:{event:e}}),e===i.service.state.context.events[i.service.state.context.events.length-1]){var t=function(){i.backToNormal(),i.service.send("END"),i.emitter.emit(S.Finish)};e.type===v.IncrementalSnapshot&&e.data.source===y.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={},P.map=h(e.data.node,{doc:this.iframe.contentDocument})[1];var n=document.createElement("style"),r=this.iframe.contentDocument,i=r.documentElement,o=r.head;i.insertBefore(n,o);var a,s=(a=this.config.blockClass,["iframe, ."+a+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&s.push("html.rrweb-paused * { animation-play-state: paused !important; }"),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused");for(var l=0;l<s.length;l++)n.sheet.insertRule(s[l],l);this.emitter.emit(S.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(S.Start,a),this.emitter.on(S.Pause,a);var s=function(){t.emitter.off(S.Start,a),t.emitter.off(S.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(S.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(S.LoadStylesheetStart),r=window.setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,i=this.service.state,o=function(){i=n.service.state};this.emitter.on(S.Start,o),this.emitter.on(S.Pause,o);var a=0,s=0;try{for(var l=r(this.service.state.context.events),c=l.next();!c.done;c=l.next()){var u=c.value;if(u.type===v.IncrementalSnapshot&&u.data.source===y.CanvasMutation&&"drawImage"===u.data.property&&"string"==typeof u.data.args[0]&&!this.imageMap.has(u)){a++;var d=document.createElement("img");d.src=u.data.args[0],this.imageMap.set(u,d),d.onload=function(){++s===a&&(i.matches("playing")&&n.play(n.getCurrentTime()),n.emitter.off(S.Start,o),n.emitter.off(S.Pause,o))}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}a!==s&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,i=this,o=e.data;switch(o.source){case y.Mutation:t&&(o.adds.forEach((function(e){return i.treeIndex.add(e)})),o.texts.forEach((function(e){return i.treeIndex.text(e)})),o.attributes.forEach((function(e){return i.treeIndex.attribute(e)})),o.removes.forEach((function(e){return i.treeIndex.remove(e)}))),this.applyMutation(o,t);break;case y.MouseMove:if(t){var a=o.positions[o.positions.length-1];this.moveAndHover(o,a.x,a.y,a.id)}else o.positions.forEach((function(t){var n={doAction:function(){i.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-i.service.state.context.baselineTime};i.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=o.positions[0])||void 0===n?void 0:n.timeOffset)});break;case y.MouseInteraction:if(-1===o.id)break;var s=new Event(g[o.type].toLowerCase());if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);this.emitter.emit(S.MouseInteraction,{type:o.type,target:v});var l=this.config.triggerFocus;switch(o.type){case g.Blur:"blur"in v&&v.blur();break;case g.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case g.Click:case g.TouchStart:case g.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:v.dispatchEvent(s)}break;case y.Scroll:if(-1===o.id)break;if(t){this.treeIndex.scroll(o);break}this.applyScroll(o);break;case y.ViewportResize:this.emitter.emit(S.Resize,{width:o.width,height:o.height});break;case y.Input:if(-1===o.id)break;if(t){this.treeIndex.input(o);break}this.applyInput(o);break;case y.MediaInteraction:if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var c=v;try{o.type===b.Pause&&c.pause(),o.type===b.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case y.StyleSheetRule:if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var u=v,d=v.parentNode,f=this.fragmentParentMap.has(d),p=void 0;if(f){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),d.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;o.adds&&o.adds.forEach((function(e){var t=e.rule,n=e.index,r=void 0===n?void 0:Math.min(n,m.rules.length);try{m.insertRule(t,r)}catch(e){}})),o.removes&&o.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),f&&p&&d.replaceChild(v,p);break;case y.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{var x=v.getContext("2d");if(o.setter)return void(x[o.property]=o.args[0]);var w=x[o.property];if("drawImage"===o.property&&"string"==typeof o.args[0]){var E=this.imageMap.get(e);o.args[0]=E,w.apply(x,o.args)}else w.apply(x,o.args)}catch(e){this.warnCanvasMutationFailed(o,o.id,e)}break;case y.Font:try{var T=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,t){var i,o,a=this;e.removes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);var r=P.getNode(t.parentId);if(!r)return a.warnNodeNotFound(e,t.parentId);if(P.removeNodeFromMap(n),r){var i=a.fragmentParentMap.get(r);if(i&&i.contains(n))i.removeChild(n);else if(a.fragmentParentMap.has(n)){var o=a.fragmentParentMap.get(n);r.removeChild(o),a.fragmentParentMap.delete(n)}else r.removeChild(n)}}));var s=n({},this.legacy_missingNodeRetryMap),l=[];var c=function(e){if(!a.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var n=P.getNode(e.parentId);if(!n)return l.push(e);var r=null;if(a.iframe.contentDocument.contains?r=a.iframe.contentDocument.contains(n):a.iframe.contentDocument.body.contains&&(r=a.iframe.contentDocument.body.contains(n)),t&&r){var i=document.createDocumentFragment();for(P.map[e.parentId]=i,a.fragmentParentMap.set(i,n),a.storeState(n);n.firstChild;)i.appendChild(n.firstChild);n=i}var o=null,c=null;if(e.previousId&&(o=P.getNode(e.previousId)),e.nextId&&(c=P.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=P.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return l.push(e);var u=p(e.node,{doc:a.iframe.contentDocument,map:P.map,skipChild:!0,hackCss:!0});-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?n.insertBefore(u,o.nextSibling):c&&c.parentNode?n.contains(c)?n.insertBefore(u,c):n.insertBefore(u,null):n.appendChild(u),(e.previousId||e.nextId)&&a.legacy_resolveMissingNode(s,n,u,e)):s[e.node.id]={node:u,mutation:e}};e.adds.forEach((function(e){c(e)}));for(var u=Date.now();l.length;){var d=j(l);if(l.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var f=(i=void 0,r(d)),h=f.next();!h.done;h=f.next()){var m=h.value;P.getNode(m.value.parentId)?B(m,(function(e){c(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),e.texts.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);for(var r in a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var i=t.attributes[r];try{null!==i?n.setAttribute(r,i):n.removeAttribute(r)}catch(e){a.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px",this.drawMouseTail({x:t,y:n});var i=P.getNode(r);if(!i)return this.debugNodeNotFound(e,r);this.hoverElements(i)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?W:Object.assign({},W,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,o=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=r,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===v.IncrementalSnapshot&&(e.data.source>y.Mutation&&e.data.source<=y.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(S.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]});var o=i.children;try{for(var a=r(Array.from(o)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var i=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(i.scrollLeft=o.scroll[0],i.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var a=i.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,o(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,o(["[replayer]"],e))},e}();return e.Replayer=z,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-replay.min.js.map

@@ -27,5 +27,3 @@ var NodeType;

var rules = s.rules || s.cssRules;
return rules
? Array.from(rules).map(getCssRuleString).join('')
: null;
return rules ? Array.from(rules).map(getCssRuleString).join('') : null;
}

@@ -57,7 +55,7 @@ catch (error) {

var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
var DATA_URI = /^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64|utf-?8).*,(.*)/i;
var DATA_URI = /^(data:)([^,]*),(.*)/i;
function absoluteToStylesheet(cssText, href) {
return (cssText || '').replace(URL_IN_CSS_REF, function (origin, quote1, path1, quote2, path2, path3) {
var filePath = path1 || path2 || path3;
var maybe_quote = quote1 || quote2 || '';
var maybeQuote = quote1 || quote2 || '';
if (!filePath) {

@@ -67,9 +65,9 @@ return origin;

if (!RELATIVE_PATH.test(filePath)) {
return "url(" + maybe_quote + filePath + maybe_quote + ")";
return "url(" + maybeQuote + filePath + maybeQuote + ")";
}
if (DATA_URI.test(filePath)) {
return "url(" + maybe_quote + filePath + maybe_quote + ")";
return "url(" + maybeQuote + filePath + maybeQuote + ")";
}
if (filePath[0] === '/') {
return "url(" + maybe_quote + (extractOrigin(href) + filePath) + maybe_quote + ")";
return "url(" + maybeQuote + (extractOrigin(href) + filePath) + maybeQuote + ")";
}

@@ -91,3 +89,3 @@ var stack = href.split('/');

}
return "url(" + maybe_quote + stack.join('/') + maybe_quote + ")";
return "url(" + maybeQuote + stack.join('/') + maybeQuote + ")";
});

@@ -160,4 +158,4 @@ }

}
function serializeNode(n, doc, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas) {
if (maskInputOptions === void 0) { maskInputOptions = {}; }
function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, recordCanvas = options.recordCanvas;
switch (n.nodeType) {

@@ -167,3 +165,3 @@ case n.DOCUMENT_NODE:

type: NodeType.Document,
childNodes: []
childNodes: [],
};

@@ -175,3 +173,3 @@ case n.DOCUMENT_TYPE_NODE:

publicId: n.publicId,
systemId: n.systemId
systemId: n.systemId,
};

@@ -182,4 +180,4 @@ case n.ELEMENT_NODE:

var attributes_1 = {};
for (var _i = 0, _a = Array.from(n.attributes); _i < _a.length; _i++) {
var _b = _a[_i], name = _b.name, value = _b.value;
for (var _i = 0, _b = Array.from(n.attributes); _i < _b.length; _i++) {
var _c = _b[_i], name = _c.name, value = _c.value;
attributes_1[name] = transformAttribute(doc, name, value);

@@ -248,5 +246,8 @@ }

if (needBlock) {
var _c = n.getBoundingClientRect(), width = _c.width, height = _c.height;
attributes_1.rr_width = width + "px";
attributes_1.rr_height = height + "px";
var _d = n.getBoundingClientRect(), width = _d.width, height = _d.height;
attributes_1 = {
class: attributes_1.class,
rr_width: width + "px",
rr_height: height + "px",
};
}

@@ -259,3 +260,3 @@ return {

isSVG: isSVGElement(n) || undefined,
needBlock: needBlock
needBlock: needBlock,
};

@@ -275,3 +276,3 @@ case n.TEXT_NODE:

textContent: textContent || '',
isStyle: isStyle
isStyle: isStyle,
};

@@ -281,3 +282,3 @@ case n.CDATA_SECTION_NODE:

type: NodeType.CDATA,
textContent: ''
textContent: '',
};

@@ -287,3 +288,3 @@ case n.COMMENT_NODE:

type: NodeType.Comment,
textContent: n.textContent || ''
textContent: n.textContent || '',
};

@@ -309,46 +310,56 @@ default:

(sn.tagName === 'script' ||
(sn.tagName === 'link' && sn.attributes.rel === 'preload' && sn.attributes['as'] === 'script'))) {
(sn.tagName === 'link' &&
sn.attributes.rel === 'preload' &&
sn.attributes.as === 'script'))) {
return true;
}
else if (slimDOMOptions.headFavicon && ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon')
|| (sn.tagName === 'meta' && (lowerIfExists(sn.attributes['name']).match(/^msapplication-tile(image|color)$/)
|| lowerIfExists(sn.attributes['name']) === 'application-name'
|| lowerIfExists(sn.attributes['rel']) === 'icon'
|| lowerIfExists(sn.attributes['rel']) === 'apple-touch-icon'
|| lowerIfExists(sn.attributes['rel']) === 'shortcut icon')))) {
else if (slimDOMOptions.headFavicon &&
((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||
(sn.tagName === 'meta' &&
(lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||
lowerIfExists(sn.attributes.name) === 'application-name' ||
lowerIfExists(sn.attributes.rel) === 'icon' ||
lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||
lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {
return true;
}
else if (sn.tagName === 'meta') {
if (slimDOMOptions.headMetaDescKeywords && (lowerIfExists(sn.attributes['name']).match(/^description|keywords$/))) {
if (slimDOMOptions.headMetaDescKeywords &&
lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {
return true;
}
else if (slimDOMOptions.headMetaSocial && (lowerIfExists(sn.attributes['property']).match(/^(og|twitter|fb):/)
|| lowerIfExists(sn.attributes['name']).match(/^(og|twitter):/)
|| lowerIfExists(sn.attributes['name']) === 'pinterest')) {
else if (slimDOMOptions.headMetaSocial &&
(lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||
lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||
lowerIfExists(sn.attributes.name) === 'pinterest')) {
return true;
}
else if (slimDOMOptions.headMetaRobots && (lowerIfExists(sn.attributes['name']) === 'robots'
|| lowerIfExists(sn.attributes['name']) === 'googlebot'
|| lowerIfExists(sn.attributes['name']) === 'bingbot')) {
else if (slimDOMOptions.headMetaRobots &&
(lowerIfExists(sn.attributes.name) === 'robots' ||
lowerIfExists(sn.attributes.name) === 'googlebot' ||
lowerIfExists(sn.attributes.name) === 'bingbot')) {
return true;
}
else if (slimDOMOptions.headMetaHttpEquiv && (sn.attributes['http-equiv'] !== undefined)) {
else if (slimDOMOptions.headMetaHttpEquiv &&
sn.attributes['http-equiv'] !== undefined) {
return true;
}
else if (slimDOMOptions.headMetaAuthorship && (lowerIfExists(sn.attributes['name']) === 'author'
|| lowerIfExists(sn.attributes['name']) === 'generator'
|| lowerIfExists(sn.attributes['name']) === 'framework'
|| lowerIfExists(sn.attributes['name']) === 'publisher'
|| lowerIfExists(sn.attributes['name']) === 'progid'
|| lowerIfExists(sn.attributes['property']).match(/^article:/)
|| lowerIfExists(sn.attributes['property']).match(/^product:/))) {
else if (slimDOMOptions.headMetaAuthorship &&
(lowerIfExists(sn.attributes.name) === 'author' ||
lowerIfExists(sn.attributes.name) === 'generator' ||
lowerIfExists(sn.attributes.name) === 'framework' ||
lowerIfExists(sn.attributes.name) === 'publisher' ||
lowerIfExists(sn.attributes.name) === 'progid' ||
lowerIfExists(sn.attributes.property).match(/^article:/) ||
lowerIfExists(sn.attributes.property).match(/^product:/))) {
return true;
}
else if (slimDOMOptions.headMetaVerification && (lowerIfExists(sn.attributes['name']) === 'google-site-verification'
|| lowerIfExists(sn.attributes['name']) === 'yandex-verification'
|| lowerIfExists(sn.attributes['name']) === 'csrf-token'
|| lowerIfExists(sn.attributes['name']) === 'p:domain_verify'
|| lowerIfExists(sn.attributes['name']) === 'verify-v1'
|| lowerIfExists(sn.attributes['name']) === 'verification'
|| lowerIfExists(sn.attributes['name']) === 'shopify-checkout-api-token')) {
else if (slimDOMOptions.headMetaVerification &&
(lowerIfExists(sn.attributes.name) === 'google-site-verification' ||
lowerIfExists(sn.attributes.name) === 'yandex-verification' ||
lowerIfExists(sn.attributes.name) === 'csrf-token' ||
lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||
lowerIfExists(sn.attributes.name) === 'verify-v1' ||
lowerIfExists(sn.attributes.name) === 'verification' ||
lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {
return true;

@@ -360,8 +371,13 @@ }

}
function serializeNodeWithId(n, doc, map, blockClass, blockSelector, skipChild, inlineStylesheet, maskInputOptions, slimDOMOptions, recordCanvas, preserveWhiteSpace) {
if (skipChild === void 0) { skipChild = false; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
if (slimDOMOptions === void 0) { slimDOMOptions = {}; }
if (preserveWhiteSpace === void 0) { preserveWhiteSpace = true; }
var _serializedNode = serializeNode(n, doc, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas || false);
function serializeNodeWithId(n, options) {
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d;
var _e = options.preserveWhiteSpace, preserveWhiteSpace = _e === void 0 ? true : _e;
var _serializedNode = serializeNode(n, {
doc: doc,
blockClass: blockClass,
blockSelector: blockSelector,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
recordCanvas: recordCanvas,
});
if (!_serializedNode) {

@@ -399,10 +415,21 @@ console.warn(n, 'not serialized');

recordChild) {
if ((slimDOMOptions.headWhitespace &&
if (slimDOMOptions.headWhitespace &&
_serializedNode.type === NodeType.Element &&
_serializedNode.tagName == 'head')) {
_serializedNode.tagName === 'head') {
preserveWhiteSpace = false;
}
for (var _i = 0, _a = Array.from(n.childNodes); _i < _a.length; _i++) {
var childN = _a[_i];
var serializedChildNode = serializeNodeWithId(childN, doc, map, blockClass, blockSelector, skipChild, inlineStylesheet, maskInputOptions, slimDOMOptions, recordCanvas, preserveWhiteSpace);
for (var _i = 0, _f = Array.from(n.childNodes); _i < _f.length; _i++) {
var childN = _f[_i];
var serializedChildNode = serializeNodeWithId(childN, {
doc: doc,
map: map,
blockClass: blockClass,
blockSelector: blockSelector,
skipChild: skipChild,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
slimDOMOptions: slimDOMOptions,
recordCanvas: recordCanvas,
preserveWhiteSpace: preserveWhiteSpace,
});
if (serializedChildNode) {

@@ -415,8 +442,6 @@ serializedNode.childNodes.push(serializedChildNode);

}
function snapshot(n, blockClass, inlineStylesheet, maskAllInputsOrOptions, slimDOMSensibleOrOptions, recordCanvas, blockSelector) {
if (blockClass === void 0) { blockClass = 'rr-block'; }
if (inlineStylesheet === void 0) { inlineStylesheet = true; }
if (blockSelector === void 0) { blockSelector = null; }
function snapshot(n, options) {
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c, _d = _a.recordCanvas, recordCanvas = _d === void 0 ? false : _d, _e = _a.blockSelector, blockSelector = _e === void 0 ? null : _e, _f = _a.maskAllInputs, maskAllInputs = _f === void 0 ? false : _f, _g = _a.slimDOM, slimDOM = _g === void 0 ? false : _g;
var idNodeMap = {};
var maskInputOptions = maskAllInputsOrOptions === true
var maskInputOptions = maskAllInputs === true
? {

@@ -437,26 +462,36 @@ color: true,

textarea: true,
select: true
select: true,
}
: maskAllInputsOrOptions === false
: maskAllInputs === false
? {}
: maskAllInputsOrOptions;
var slimDOMOptions = (slimDOMSensibleOrOptions === true ||
slimDOMSensibleOrOptions === 'all')
? {
script: true,
comment: true,
headFavicon: true,
headWhitespace: true,
headMetaDescKeywords: slimDOMSensibleOrOptions === 'all',
headMetaSocial: true,
headMetaRobots: true,
headMetaHttpEquiv: true,
headMetaAuthorship: true,
headMetaVerification: true
}
: slimDOMSensibleOrOptions === false
: maskAllInputs;
var slimDOMOptions = slimDOM === true || slimDOM === 'all'
?
{
script: true,
comment: true,
headFavicon: true,
headWhitespace: true,
headMetaDescKeywords: slimDOM === 'all',
headMetaSocial: true,
headMetaRobots: true,
headMetaHttpEquiv: true,
headMetaAuthorship: true,
headMetaVerification: true,
}
: slimDOM === false
? {}
: slimDOMSensibleOrOptions;
: slimDOM;
return [
serializeNodeWithId(n, n, idNodeMap, blockClass, blockSelector, false, inlineStylesheet, maskInputOptions, slimDOMOptions, recordCanvas),
serializeNodeWithId(n, {
doc: n,
map: idNodeMap,
blockClass: blockClass,
blockSelector: blockSelector,
skipChild: false,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
slimDOMOptions: slimDOMOptions,
recordCanvas: recordCanvas,
}),
idNodeMap,

@@ -518,4 +553,4 @@ ];

rules: rulesList,
parsingErrors: errorsList
}
parsingErrors: errorsList,
},
};

@@ -587,3 +622,3 @@ }

type: 'comment',
comment: str
comment: str,
});

@@ -620,3 +655,3 @@ }

property: prop.replace(commentre, ''),
value: val ? trim(val[0]).replace(commentre, '') : ''
value: val ? trim(val[0]).replace(commentre, '') : '',
});

@@ -659,3 +694,3 @@ match(/^[;\s]*/);

values: vals,
declarations: declarations()
declarations: declarations(),
});

@@ -691,3 +726,3 @@ }

vendor: vendor,
keyframes: frames
keyframes: frames,
});

@@ -712,3 +747,3 @@ }

supports: supports,
rules: style
rules: style,
});

@@ -731,3 +766,3 @@ }

type: 'host',
rules: style
rules: style,
});

@@ -752,3 +787,3 @@ }

media: media,
rules: style
rules: style,
});

@@ -765,3 +800,3 @@ }

name: trim(m[1]),
media: trim(m[2])
media: trim(m[2]),
});

@@ -791,3 +826,3 @@ }

selectors: sel,
declarations: decls
declarations: decls,
});

@@ -814,3 +849,3 @@ }

vendor: vendor,
rules: style
rules: style,
});

@@ -838,3 +873,3 @@ }

type: 'font-face',
declarations: decls
declarations: decls,
});

@@ -884,3 +919,3 @@ }

selectors: sel,
declarations: declarations()
declarations: declarations(),
});

@@ -913,3 +948,3 @@ }

enumerable: false,
value: parent || null
value: parent || null,
});

@@ -957,3 +992,3 @@ }

lineargradient: 'linearGradient',
radialgradient: 'radialGradient'
radialgradient: 'radialGradient',
};

@@ -985,3 +1020,4 @@ function getTagName(n) {

}
function buildNode(n, doc, HACK_CSS) {
function buildNode(n, options) {
var doc = options.doc, hackCss = options.hackCss;
switch (n.type) {

@@ -1011,3 +1047,3 @@ case NodeType.Document:

var isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';
if (isRemoteOrDynamicCss && HACK_CSS) {
if (isRemoteOrDynamicCss && hackCss) {
value = addHoverClass(value);

@@ -1078,3 +1114,3 @@ }

case NodeType.Text:
return doc.createTextNode(n.isStyle && HACK_CSS ? addHoverClass(n.textContent) : n.textContent);
return doc.createTextNode(n.isStyle && hackCss ? addHoverClass(n.textContent) : n.textContent);
case NodeType.CDATA:

@@ -1088,6 +1124,5 @@ return doc.createCDATASection(n.textContent);

}
function buildNodeWithSN(n, doc, map, skipChild, HACK_CSS) {
if (skipChild === void 0) { skipChild = false; }
if (HACK_CSS === void 0) { HACK_CSS = true; }
var node = buildNode(n, doc, HACK_CSS);
function buildNodeWithSN(n, options) {
var doc = options.doc, map = options.map, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.hackCss, hackCss = _b === void 0 ? true : _b;
var node = buildNode(n, { doc: doc, hackCss: hackCss });
if (!node) {

@@ -1105,5 +1140,10 @@ return null;

!skipChild) {
for (var _i = 0, _a = n.childNodes; _i < _a.length; _i++) {
var childN = _a[_i];
var childNode = buildNodeWithSN(childN, doc, map, false, HACK_CSS);
for (var _i = 0, _c = n.childNodes; _i < _c.length; _i++) {
var childN = _c[_i];
var childNode = buildNodeWithSN(childN, {
doc: doc,
map: map,
skipChild: false,
hackCss: hackCss,
});
if (!childNode) {

@@ -1148,6 +1188,11 @@ console.warn('Failed to rebuild', childN);

}
function rebuild(n, doc, onVisit, HACK_CSS) {
if (HACK_CSS === void 0) { HACK_CSS = true; }
function rebuild(n, options) {
var doc = options.doc, onVisit = options.onVisit, _a = options.hackCss, hackCss = _a === void 0 ? true : _a;
var idNodeMap = {};
var node = buildNodeWithSN(n, doc, idNodeMap, false, HACK_CSS);
var node = buildNodeWithSN(n, {
doc: doc,
map: idNodeMap,
skipChild: false,
hackCss: hackCss,
});
visit(idNodeMap, function (visitedNode) {

@@ -1154,0 +1199,0 @@ if (onVisit) {

@@ -13,3 +13,3 @@ import { __assign, __read } from '../../node_modules/tslib/tslib.es6.js';

if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.ignoreClass, ignoreClass = _b === void 0 ? 'rr-ignore' : _b, _c = options.inlineStylesheet, inlineStylesheet = _c === void 0 ? true : _c, maskAllInputs = options.maskAllInputs, _maskInputOptions = options.maskInputOptions, hooks = options.hooks, packFn = options.packFn, _d = options.sampling, sampling = _d === void 0 ? {} : _d, mousemoveWait = options.mousemoveWait, _e = options.recordCanvas, recordCanvas = _e === void 0 ? false : _e, _f = options.collectFonts, collectFonts = _f === void 0 ? false : _f;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.blockSelector, blockSelector = _b === void 0 ? null : _b, _c = options.ignoreClass, ignoreClass = _c === void 0 ? 'rr-ignore' : _c, _d = options.inlineStylesheet, inlineStylesheet = _d === void 0 ? true : _d, maskAllInputs = options.maskAllInputs, _maskInputOptions = options.maskInputOptions, _slimDOMOptions = options.slimDOMOptions, maskInputFn = options.maskInputFn, hooks = options.hooks, packFn = options.packFn, _e = options.sampling, sampling = _e === void 0 ? {} : _e, mousemoveWait = options.mousemoveWait, _f = options.recordCanvas, recordCanvas = _f === void 0 ? false : _f, _g = options.collectFonts, collectFonts = _g === void 0 ? false : _g;
if (!emit) {

@@ -42,2 +42,16 @@ throw new Error('emit function is required');

: {};
var slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'
? {
script: true,
comment: true,
headFavicon: true,
headWhitespace: true,
headMetaSocial: true,
headMetaRobots: true,
headMetaHttpEquiv: true,
headMetaVerification: true,
headMetaAuthorship: _slimDOMOptions === 'all',
headMetaDescKeywords: _slimDOMOptions === 'all',
}
: {};
polyfill();

@@ -49,4 +63,4 @@ var lastFullSnapshotEvent;

e.type !== EventType.FullSnapshot &&
!(e.type == EventType.IncrementalSnapshot &&
e.data.source == IncrementalSource.Mutation)) {
!(e.type === EventType.IncrementalSnapshot &&
e.data.source === IncrementalSource.Mutation)) {
mutationBuffer.emit();

@@ -83,3 +97,10 @@ mutationBuffer.unfreeze();

mutationBuffer.freeze();
var _e = __read(snapshot(document, blockClass, inlineStylesheet, maskInputOptions, false, recordCanvas), 2), node = _e[0], idNodeMap = _e[1];
var _e = __read(snapshot(document, {
blockClass: blockClass,
blockSelector: blockSelector,
inlineStylesheet: inlineStylesheet,
maskAllInputs: maskInputOptions,
slimDOM: slimDOMOptions,
recordCanvas: recordCanvas,
}), 2), node = _e[0], idNodeMap = _e[1];
if (!node) {

@@ -185,4 +206,6 @@ return console.warn('Failed to snapshot the document');

blockClass: blockClass,
blockSelector: blockSelector,
ignoreClass: ignoreClass,
maskInputOptions: maskInputOptions,
maskInputFn: maskInputFn,
inlineStylesheet: inlineStylesheet,

@@ -192,2 +215,3 @@ sampling: sampling,

collectFonts: collectFonts,
slimDOMOptions: slimDOMOptions,
}, hooks));

@@ -194,0 +218,0 @@ };

import { __values } from '../../node_modules/tslib/tslib.es6.js';
import { transformAttribute, serializeNodeWithId } from '../../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { mirror, isBlocked, isAncestorRemoved } from '../utils.js';
import { transformAttribute, IGNORED_NODE, serializeNodeWithId } from '../../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { mirror, isIgnored, isBlocked, isAncestorRemoved } from '../utils.js';

@@ -108,3 +108,8 @@ function isNodeInLinkedList(n) {

var getNextId = function (n) {
var nextId = n.nextSibling && mirror.getId(n.nextSibling);
var ns = n;
var nextId = IGNORED_NODE;
while (nextId === IGNORED_NODE) {
ns = ns && ns.nextSibling;
nextId = ns && mirror.getId(ns);
}
if (nextId === -1 && isBlocked(n.nextSibling, _this.blockClass)) {

@@ -124,7 +129,20 @@ nextId = null;

}
adds.push({
parentId: parentId,
nextId: nextId,
node: serializeNodeWithId(n, document, mirror.map, _this.blockClass, null, true, _this.inlineStylesheet, _this.maskInputOptions, undefined, _this.recordCanvas),
var sn = serializeNodeWithId(n, {
doc: document,
map: mirror.map,
blockClass: _this.blockClass,
blockSelector: _this.blockSelector,
skipChild: true,
inlineStylesheet: _this.inlineStylesheet,
maskInputOptions: _this.maskInputOptions,
slimDOMOptions: _this.slimDOMOptions,
recordCanvas: _this.recordCanvas,
});
if (sn) {
adds.push({
parentId: parentId,
nextId: nextId,
node: sn,
});
}
};

@@ -233,2 +251,5 @@ while (_this.mapRemoves.length) {

this.processMutation = function (m) {
if (isIgnored(m.target)) {
return;
}
switch (m.type) {

@@ -267,3 +288,4 @@ case 'characterData': {

if (isBlocked(n, _this.blockClass) ||
isBlocked(m.target, _this.blockClass)) {
isBlocked(m.target, _this.blockClass) ||
isIgnored(n)) {
return;

@@ -298,2 +320,5 @@ }

if (isINode(n)) {
if (isIgnored(n)) {
return;
}
_this.movedSet.add(n);

@@ -315,7 +340,9 @@ var targetId = null;

}
MutationBuffer.prototype.init = function (cb, blockClass, inlineStylesheet, maskInputOptions, recordCanvas) {
MutationBuffer.prototype.init = function (cb, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas, slimDOMOptions) {
this.blockClass = blockClass;
this.blockSelector = blockSelector;
this.inlineStylesheet = inlineStylesheet;
this.maskInputOptions = maskInputOptions;
this.recordCanvas = recordCanvas;
this.slimDOMOptions = slimDOMOptions;
this.emissionCallback = cb;

@@ -322,0 +349,0 @@ };

@@ -7,4 +7,4 @@ import { __spread, __values, __assign } from '../../node_modules/tslib/tslib.es6.js';

var mutationBuffer = new MutationBuffer();
function initMutationObserver(cb, blockClass, inlineStylesheet, maskInputOptions, recordCanvas) {
mutationBuffer.init(cb, blockClass, inlineStylesheet, maskInputOptions, recordCanvas);
function initMutationObserver(cb, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas, slimDOMOptions) {
mutationBuffer.init(cb, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas, slimDOMOptions);
var observer = new MutationObserver(mutationBuffer.processMutations.bind(mutationBuffer));

@@ -141,3 +141,3 @@ observer.observe(document, {

var lastInputValueMap = new WeakMap();
function initInputObserver(cb, blockClass, ignoreClass, maskInputOptions, sampling) {
function initInputObserver(cb, blockClass, ignoreClass, maskInputOptions, maskInputFn, sampling) {
function eventHandler(event) {

@@ -163,3 +163,8 @@ var target = event.target;

maskInputOptions[type]) {
text = '*'.repeat(text.length);
if (maskInputFn) {
text = maskInputFn(text);
}
else {
text = '*'.repeat(text.length);
}
}

@@ -469,3 +474,3 @@ cbWithDedup(target, { text: text, isChecked: isChecked });

mergeHooks(o, hooks);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.inlineStylesheet, o.maskInputOptions, o.recordCanvas);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.blockSelector, o.inlineStylesheet, o.maskInputOptions, o.recordCanvas, o.slimDOMOptions);
var mousemoveHandler = initMoveObserver(o.mousemoveCb, o.sampling);

@@ -475,3 +480,3 @@ var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass, o.sampling);

var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass, o.maskInputOptions, o.sampling);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass, o.maskInputOptions, o.maskInputFn, o.sampling);
var mediaInteractionHandler = initMediaInteractionObserver(o.mediaInteractionCb, o.blockClass);

@@ -478,0 +483,0 @@ var styleSheetObserver = initStyleSheetObserver(o.styleSheetRuleCb);

@@ -45,2 +45,3 @@ import { __values, __assign, __spread, __read } from '../../node_modules/tslib/tslib.es6.js';

UNSAFE_replayCanvas: false,
pauseAnimation: true,
mouseTail: defaultMouseTailConfig,

@@ -55,2 +56,3 @@ };

this.fragmentParentMap = new Map();
this.elementStateMap = new Map();
this.emitter.on(ReplayerEvents.Flush, function () {

@@ -60,5 +62,12 @@ var e_1, _a, e_2, _b, e_3, _c;

try {
for (var _e = __values(scrollMap.values()), _f = _e.next(); !_f.done; _f = _e.next()) {
var d = _f.value;
_this.applyScroll(d);
for (var _e = __values(_this.fragmentParentMap.entries()), _f = _e.next(); !_f.done; _f = _e.next()) {
var _g = __read(_f.value, 2), frag = _g[0], parent = _g[1];
mirror.map[parent.__sn.id] = parent;
if (parent.__sn.type === NodeType.Element &&
parent.__sn.tagName === 'textarea' &&
frag.textContent) {
parent.value = frag.textContent;
}
parent.appendChild(frag);
_this.restoreState(parent);
}

@@ -73,6 +82,8 @@ }

}
_this.fragmentParentMap.clear();
_this.elementStateMap.clear();
try {
for (var _g = __values(inputMap.values()), _h = _g.next(); !_h.done; _h = _g.next()) {
var d = _h.value;
_this.applyInput(d);
for (var _h = __values(scrollMap.values()), _j = _h.next(); !_j.done; _j = _h.next()) {
var d = _j.value;
_this.applyScroll(d);
}

@@ -83,3 +94,3 @@ }

try {
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
if (_j && !_j.done && (_b = _h.return)) _b.call(_h);
}

@@ -89,11 +100,5 @@ finally { if (e_2) throw e_2.error; }

try {
for (var _j = __values(_this.fragmentParentMap.entries()), _k = _j.next(); !_k.done; _k = _j.next()) {
var _l = __read(_k.value, 2), frag = _l[0], parent = _l[1];
mirror.map[parent.__sn.id] = parent;
if (parent.__sn.type === NodeType.Element &&
parent.__sn.tagName === 'textarea' &&
frag.textContent) {
parent.value = frag.textContent;
}
parent.appendChild(frag);
for (var _k = __values(inputMap.values()), _l = _k.next(); !_l.done; _l = _k.next()) {
var d = _l.value;
_this.applyInput(d);
}

@@ -104,7 +109,6 @@ }

try {
if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
if (_l && !_l.done && (_c = _k.return)) _c.call(_k);
}
finally { if (e_3) throw e_3.error; }
}
_this.fragmentParentMap.clear();
});

@@ -155,3 +159,5 @@ var timer = new Timer([], (config === null || config === void 0 ? void 0 : config.speed) || defaultConfig.speed);

if (firstFullsnapshot) {
this.rebuildFullSnapshot(firstFullsnapshot);
setTimeout(function () {
_this.rebuildFullSnapshot(firstFullsnapshot);
}, 1);
}

@@ -168,2 +174,3 @@ }

this.emitter.on(event, handler);
return this;
};

@@ -186,2 +193,19 @@ Replayer.prototype.setConfig = function (config) {

}
if (typeof config.mouseTail !== 'undefined') {
if (config.mouseTail === false) {
if (this.mouseTail) {
this.mouseTail.style.display = 'none';
}
}
else {
if (!this.mouseTail) {
this.mouseTail = document.createElement('canvas');
this.mouseTail.width = Number.parseFloat(this.iframe.width);
this.mouseTail.height = Number.parseFloat(this.iframe.height);
this.mouseTail.classList.add('replayer-mouse-tail');
this.wrapper.insertBefore(this.mouseTail, this.iframe);
}
this.mouseTail.style.display = 'inherit';
}
}
};

@@ -205,2 +229,3 @@ Replayer.prototype.getMetaData = function () {

Replayer.prototype.play = function (timeOffset) {
var _a;
if (timeOffset === void 0) { timeOffset = 0; }

@@ -214,5 +239,7 @@ if (this.service.state.matches('paused')) {

}
(_a = this.iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('html')[0].classList.remove('rrweb-paused');
this.emitter.emit(ReplayerEvents.Start);
};
Replayer.prototype.pause = function (timeOffset) {
var _a;
if (timeOffset === undefined && this.service.state.matches('playing')) {

@@ -225,2 +252,3 @@ this.service.send({ type: 'PAUSE' });

}
(_a = this.iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('html')[0].classList.add('rrweb-paused');
this.emitter.emit(ReplayerEvents.Pause);

@@ -264,3 +292,3 @@ };

this.mouseTail.classList.add('replayer-mouse-tail');
this.mouseTail.style.display = 'none';
this.mouseTail.style.display = 'inherit';
this.wrapper.appendChild(this.mouseTail);

@@ -284,2 +312,3 @@ }

var e_4, _a;
this.iframe.style.display = 'inherit';
try {

@@ -291,3 +320,2 @@ for (var _b = __values([this.mouseTail, this.iframe]), _c = _b.next(); !_c.done; _c = _b.next()) {

}
el.style.display = 'inherit';
el.setAttribute('width', String(dimension.width));

@@ -414,3 +442,5 @@ el.setAttribute('height', String(dimension.height));

this.legacy_missingNodeRetryMap = {};
mirror.map = rebuild(event.data.node, this.iframe.contentDocument)[1];
mirror.map = rebuild(event.data.node, {
doc: this.iframe.contentDocument,
})[1];
var styleEl = document.createElement('style');

@@ -420,2 +450,10 @@ var _a = this.iframe.contentDocument, documentElement = _a.documentElement, head = _a.head;

var injectStylesRules = rules(this.config.blockClass).concat(this.config.insertStyleRules);
if (this.config.pauseAnimation) {
injectStylesRules.push('html.rrweb-paused * { animation-play-state: paused !important; }');
}
if (!this.service.state.matches('playing')) {
this.iframe.contentDocument
.getElementsByTagName('html')[0]
.classList.add('rrweb-paused');
}
for (var idx = 0; idx < injectStylesRules.length; idx++) {

@@ -773,2 +811,7 @@ styleEl.sheet.insertRule(injectStylesRules[idx], idx);

}
else if (_this.fragmentParentMap.has(target)) {
var realTarget = _this.fragmentParentMap.get(target);
parent.removeChild(realTarget);
_this.fragmentParentMap.delete(target);
}
else {

@@ -813,2 +856,3 @@ parent.removeChild(target);

_this.fragmentParentMap.set(virtualParent, parent);
_this.storeState(parent);
while (parent.firstChild) {

@@ -830,3 +874,8 @@ virtualParent.appendChild(parent.firstChild);

}
var target = buildNodeWithSN(mutation.node, _this.iframe.contentDocument, mirror.map, true);
var target = buildNodeWithSN(mutation.node, {
doc: _this.iframe.contentDocument,
map: mirror.map,
skipChild: true,
hackCss: true,
});
if (mutation.previousId === -1 || mutation.nextId === -1) {

@@ -1056,2 +1105,57 @@ legacy_missingNodeMap[mutation.node.id] = {

};
Replayer.prototype.storeState = function (parent) {
var e_8, _a;
if (parent) {
if (parent.nodeType === parent.ELEMENT_NODE) {
var parentElement = parent;
if (parentElement.scrollLeft || parentElement.scrollTop) {
this.elementStateMap.set(parent, {
scroll: [parentElement.scrollLeft, parentElement.scrollTop],
});
}
var children = parentElement.children;
try {
for (var _b = __values(Array.from(children)), _c = _b.next(); !_c.done; _c = _b.next()) {
var child = _c.value;
this.storeState(child);
}
}
catch (e_8_1) { e_8 = { error: e_8_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_8) throw e_8.error; }
}
}
}
};
Replayer.prototype.restoreState = function (parent) {
var e_9, _a;
if (parent.nodeType === parent.ELEMENT_NODE) {
var parentElement = parent;
if (this.elementStateMap.has(parent)) {
var storedState = this.elementStateMap.get(parent);
if (storedState.scroll) {
parentElement.scrollLeft = storedState.scroll[0];
parentElement.scrollTop = storedState.scroll[1];
}
this.elementStateMap.delete(parent);
}
var children = parentElement.children;
try {
for (var _b = __values(Array.from(children)), _c = _b.next(); !_c.done; _c = _b.next()) {
var child = _c.value;
this.restoreState(child);
}
}
catch (e_9_1) { e_9 = { error: e_9_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_9) throw e_9.error; }
}
}
};
Replayer.prototype.warnNodeNotFound = function (d, id) {

@@ -1058,0 +1162,0 @@ this.warn("Node with id '" + id + "' not found in", d);

import { __values } from '../node_modules/tslib/tslib.es6.js';
import { IGNORED_NODE } from '../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { EventType, IncrementalSource } from './types.js';

@@ -139,2 +140,8 @@

}
function isIgnored(n) {
if ('__sn' in n) {
return n.__sn.id === IGNORED_NODE;
}
return false;
}
function isAncestorRemoved(target) {

@@ -418,2 +425,2 @@ var id = mirror.getId(target);

export { TreeIndex, getWindowHeight, getWindowWidth, hookSetter, isAncestorRemoved, isBlocked, isTouchEvent, iterateResolveTree, mirror, needCastInSyncMode, on, patch, polyfill, queueToResolveTrees, throttle };
export { TreeIndex, getWindowHeight, getWindowWidth, hookSetter, isAncestorRemoved, isBlocked, isIgnored, isTouchEvent, iterateResolveTree, mirror, needCastInSyncMode, on, patch, polyfill, queueToResolveTrees, throttle };
{
"name": "rrweb",
"version": "0.9.9",
"version": "0.9.10",
"description": "record and replay the web",

@@ -65,4 +65,4 @@ "scripts": {

"pako": "^1.0.11",
"rrweb-snapshot": "^0.8.4"
"rrweb-snapshot": "^1.0.1"
}
}

@@ -10,2 +10,4 @@ <p align="center">

**[The new adventure of the rrweb community](http://www.myriptide.com/rrweb-community/)**
[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb)

@@ -28,2 +30,4 @@ [![Join the chat at https://gitter.im/rrweb-io/rrweb](https://badges.gitter.im/rrweb-io/rrweb.svg)](https://gitter.im/rrweb-io/rrweb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[**Recipes**](./docs/recipes/index.md)
## Project Structure

@@ -30,0 +34,0 @@

@@ -10,2 +10,4 @@ <p align="center">

**[rrweb 社区新的征程](http://www.myriptide.com/rrweb-community-cn/)**
[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb)

@@ -12,0 +14,0 @@ [![Join the chat at https://gitter.im/rrweb-io/rrweb](https://badges.gitter.im/rrweb-io/rrweb.svg)](https://gitter.im/rrweb-io/rrweb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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

import { MaskInputOptions } from 'rrweb-snapshot';
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationRecord, blockClass, mutationCallBack } from '../types';

@@ -15,6 +15,8 @@ export default class MutationBuffer {

private blockClass;
private blockSelector;
private inlineStylesheet;
private maskInputOptions;
private recordCanvas;
init(cb: mutationCallBack, blockClass: blockClass, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, recordCanvas: boolean): void;
private slimDOMOptions;
init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions): void;
freeze(): void;

@@ -21,0 +23,0 @@ unfreeze(): void;

@@ -20,5 +20,6 @@ import { Timer } from './timer';

private fragmentParentMap;
private elementStateMap;
private imageMap;
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
on(event: string, handler: Handler): void;
on(event: string, handler: Handler): this;
setConfig(config: Partial<playerConfig>): void;

@@ -51,2 +52,4 @@ getMetaData(): playerMetaData;

private backToNormal;
private storeState;
private restoreState;
private warnNodeNotFound;

@@ -53,0 +56,0 @@ private warnCanvasMutationFailed;

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

import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions } from 'rrweb-snapshot';
import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { PackFn, UnpackFn } from './packer/base';

@@ -113,5 +113,8 @@ import { FontFaceDescriptors } from 'css-font-loading-module';

blockClass?: blockClass;
blockSelector?: string;
ignoreClass?: string;
maskAllInputs?: boolean;
maskInputOptions?: MaskInputOptions;
maskInputFn?: MaskInputFn;
slimDOMOptions?: SlimDOMOptions;
inlineStylesheet?: boolean;

@@ -134,4 +137,6 @@ hooks?: hooksParam;

blockClass: blockClass;
blockSelector: string | null;
ignoreClass: string;
maskInputOptions: MaskInputOptions;
maskInputFn?: MaskInputFn;
inlineStylesheet: boolean;

@@ -144,2 +149,3 @@ styleSheetRuleCb: styleSheetRuleCallback;

collectFonts: boolean;
slimDOMOptions: SlimDOMOptions;
};

@@ -308,2 +314,3 @@ export declare type hooksParam = {

UNSAFE_replayCanvas: boolean;
pauseAnimation?: boolean;
mouseTail: boolean | {

@@ -357,2 +364,6 @@ duration?: number;

}
export declare type MaskInputFn = (text: string) => string;
export declare type ElementState = {
scroll?: [number, number];
};
export {};

@@ -13,2 +13,3 @@ import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, eventWithTime, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData } from './types';

export declare function isBlocked(node: Node | null, blockClass: blockClass): boolean;
export declare function isIgnored(n: Node | INode): boolean;
export declare function isAncestorRemoved(target: INode): boolean;

@@ -15,0 +16,0 @@ export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

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

Sorry, the diff of this file is not supported yet

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

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

Sorry, the diff of this file is not supported yet

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc