@appsurify-testmap/rrweb 2.1.3-alpha.1 → 2.1.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rrweb.cjs +2 -2
- package/dist/rrweb.js +2 -2
- package/dist/rrweb.umd.cjs +2 -2
- package/dist/rrweb.umd.min.cjs +2 -2
- package/package.json +5 -5
package/dist/rrweb.cjs
CHANGED
|
@@ -14536,7 +14536,7 @@ class VisibilityManager {
|
|
|
14536
14536
|
}
|
|
14537
14537
|
}
|
|
14538
14538
|
}
|
|
14539
|
-
const version$1 = "2.1.3-alpha.
|
|
14539
|
+
const version$1 = "2.1.3-alpha.2";
|
|
14540
14540
|
let wrappedEmit;
|
|
14541
14541
|
let takeFullSnapshot$1;
|
|
14542
14542
|
let canvasManager;
|
|
@@ -18035,7 +18035,7 @@ class Replayer {
|
|
|
18035
18035
|
this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
|
|
18036
18036
|
}
|
|
18037
18037
|
}
|
|
18038
|
-
const version = "2.1.3-alpha.
|
|
18038
|
+
const version = "2.1.3-alpha.2";
|
|
18039
18039
|
const { getVersion } = record;
|
|
18040
18040
|
const { isRecording } = record;
|
|
18041
18041
|
const { flushCustomEventQueue } = record;
|
package/dist/rrweb.js
CHANGED
|
@@ -14534,7 +14534,7 @@ class VisibilityManager {
|
|
|
14534
14534
|
}
|
|
14535
14535
|
}
|
|
14536
14536
|
}
|
|
14537
|
-
const version$1 = "2.1.3-alpha.
|
|
14537
|
+
const version$1 = "2.1.3-alpha.2";
|
|
14538
14538
|
let wrappedEmit;
|
|
14539
14539
|
let takeFullSnapshot$1;
|
|
14540
14540
|
let canvasManager;
|
|
@@ -18033,7 +18033,7 @@ class Replayer {
|
|
|
18033
18033
|
this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
|
|
18034
18034
|
}
|
|
18035
18035
|
}
|
|
18036
|
-
const version = "2.1.3-alpha.
|
|
18036
|
+
const version = "2.1.3-alpha.2";
|
|
18037
18037
|
const { getVersion } = record;
|
|
18038
18038
|
const { isRecording } = record;
|
|
18039
18039
|
const { flushCustomEventQueue } = record;
|
package/dist/rrweb.umd.cjs
CHANGED
|
@@ -14981,7 +14981,7 @@ class VisibilityManager {
|
|
|
14981
14981
|
}
|
|
14982
14982
|
}
|
|
14983
14983
|
}
|
|
14984
|
-
const version$1 = "2.1.3-alpha.
|
|
14984
|
+
const version$1 = "2.1.3-alpha.2";
|
|
14985
14985
|
let wrappedEmit;
|
|
14986
14986
|
let takeFullSnapshot$1;
|
|
14987
14987
|
let canvasManager;
|
|
@@ -18499,7 +18499,7 @@ class Replayer {
|
|
|
18499
18499
|
this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
|
|
18500
18500
|
}
|
|
18501
18501
|
}
|
|
18502
|
-
const version = "2.1.3-alpha.
|
|
18502
|
+
const version = "2.1.3-alpha.2";
|
|
18503
18503
|
const { getVersion } = record;
|
|
18504
18504
|
const { isRecording } = record;
|
|
18505
18505
|
const { flushCustomEventQueue } = record;
|
package/dist/rrweb.umd.min.cjs
CHANGED
|
@@ -66,7 +66,7 @@ https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.p
|
|
|
66
66
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
67
67
|
https://www.w3ctech.com/topic/2226`));let a=t(...n);return a.postcssPlugin=e,a.postcssVersion=new Ii().version,a}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(n,a,l){return U([i(l)]).process(n,a)},i};U.stringify=pd;U.parse=wd;U.fromJSON=md;U.list=vd;U.comment=s=>new _a(s);U.atRule=s=>new ka(s);U.decl=s=>new Ta(s);U.rule=s=>new $a(s);U.root=s=>new La(s);U.document=s=>new Da(s);U.CssSyntaxError=hd;U.Declaration=Ta;U.Container=dd;U.Processor=Ii;U.Document=Da;U.Comment=_a;U.Warning=gd;U.AtRule=ka;U.Result=yd;U.Input=bd;U.Rule=$a;U.Root=La;U.Node=Sd;fd.registerPostcss(U);var Cd=U;U.default=U;const X=_h(Cd);X.stringify;X.fromJSON;X.plugin;X.parse;X.list;X.document;X.comment;X.atRule;X.rule;X.decl;X.root;X.CssSyntaxError;X.Declaration;X.Container;X.Processor;X.Document;X.Comment;X.Warning;X.AtRule;X.Result;X.Input;X.Rule;X.Root;X.Node;var $=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))($||{});function Ed(s){const e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return s.replace(i,"").split(t).forEach(function(o){if(o){const n=o.split(r);n.length>1&&(e[Zs(n[0].trim())]=n[1].trim())}}),e}function Vn(s){const e=[];for(const t in s){const r=s[t];if(typeof r!="string")continue;const i=Nd(t);e.push(`${i}: ${r};`)}return e.join(" ")}const Id=/-([a-z])/g,xd=/^--[a-zA-Z0-9-]+$/,Zs=s=>xd.test(s)?s:s.replace(Id,(e,t)=>t?t.toUpperCase():""),Md=/\B([A-Z])/g,Nd=s=>s.replace(Md,"-$1").toLowerCase();class be{constructor(...e){x(this,"parentElement",null),x(this,"parentNode",null),x(this,"ownerDocument"),x(this,"firstChild",null),x(this,"lastChild",null),x(this,"previousSibling",null),x(this,"nextSibling",null),x(this,"ELEMENT_NODE",1),x(this,"TEXT_NODE",3),x(this,"nodeType"),x(this,"nodeName"),x(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof be){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class xi extends be{constructor(...e){super(e),x(this,"nodeType",9),x(this,"nodeName","#document"),x(this,"compatMode","CSS1Compat"),x(this,"RRNodeType",$.Document),x(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===$.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===$.Element||t===$.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Mi(this,e);return r.parentElement=null,r}insertBefore(e,t){const r=e.RRNodeType;if((r===$.Element||r===$.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Va(this,e,t);return i.parentElement=null,i}removeChild(e){return Wa(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new xi}createDocumentType(e,t,r){const i=new Pa(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=new zr(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new Fa(e);return t.ownerDocument=this,t}createComment(e){const t=new Ba(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Ua(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class Pa extends be{constructor(e,t,r){super(),x(this,"nodeType",10),x(this,"RRNodeType",$.DocumentType),x(this,"name"),x(this,"publicId"),x(this,"systemId"),x(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class zr extends be{constructor(e){super(),x(this,"nodeType",1),x(this,"RRNodeType",$.Element),x(this,"tagName"),x(this,"attributes",{}),x(this,"shadowRoot",null),x(this,"scrollLeft"),x(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Od(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Ed(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(t.test(r))return;const n=Zs(r);i?e[n]=i:delete e[n],o==="important"&&(e[n]+=" !important"),this.attributes.style=Vn(e)},e.removeProperty=r=>{if(t.test(r))return"";const i=Zs(r),o=e[i]||"";return delete e[i],this.attributes.style=Vn(e),o},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Mi(this,e)}insertBefore(e,t){return Va(this,e,t)}removeChild(e){return Wa(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}class Rd extends zr{constructor(){super(...arguments),x(this,"currentTime"),x(this,"volume"),x(this,"paused"),x(this,"muted"),x(this,"playbackRate"),x(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class Ad extends zr{constructor(){super(...arguments),x(this,"tagName","DIALOG"),x(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class Fa extends be{constructor(e){super(),x(this,"nodeType",3),x(this,"nodeName","#text"),x(this,"RRNodeType",$.Text),x(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class Ba extends be{constructor(e){super(),x(this,"nodeType",8),x(this,"nodeName","#comment"),x(this,"RRNodeType",$.Comment),x(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class Ua extends be{constructor(e){super(),x(this,"nodeName","#cdata-section"),x(this,"nodeType",4),x(this,"RRNodeType",$.CDATA),x(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Od{constructor(e,t){if(x(this,"onChange"),x(this,"classes",[]),x(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),x(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}}function Mi(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function Va(s,e,t){if(!t)return Mi(s,e);if(t.parentNode!==s)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function Wa(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var he=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(he||{});const Xs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Td={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"};let Se=null;function Mr(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=Dd(s,e,t,r),za(s,e,t,r),_d(s,e,t)}function Dd(s,e,t,r){var i;if(t.afterAppend&&!Se&&(Se=new WeakSet,setTimeout(()=>{Se=null},0)),!Ni(s,e)){const o=Nr(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(o,s),s=o}switch(e.RRNodeType){case $.Document:{if(!Ge(s,e,t.mirror,r)){const o=r.getMeta(e);o&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,o),Se==null||Se.add(s))}break}case $.Element:{const o=s,n=e;switch(n.tagName){case"IFRAME":{const a=s.contentDocument;if(!a)break;Mr(a,e.contentDocument,t,r);break}}n.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),za(o.shadowRoot,n.shadowRoot,t,r)),kd(o,n,r);break}}return s}function _d(s,e,t){var r;switch(e.RRNodeType){case $.Document:{const i=e.scrollData;i&&t.applyScroll(i,!0);break}case $.Element:{const i=s,o=e;switch(o.scrollData&&t.applyScroll(o.scrollData,!0),o.inputData&&t.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const n=s,a=o;a.paused!==void 0&&(a.paused?n.pause():n.play()),a.muted!==void 0&&(n.muted=a.muted),a.volume!==void 0&&(n.volume=a.volume),a.currentTime!==void 0&&(n.currentTime=a.currentTime),a.playbackRate!==void 0&&(n.playbackRate=a.playbackRate),a.loop!==void 0&&(n.loop=a.loop);break}case"CANVAS":{const n=e;if(n.rr_dataURL!==null){const a=document.createElement("img");a.onload=()=>{const l=i.getContext("2d");l&&l.drawImage(a,0,0,a.width,a.height)},a.src=n.rr_dataURL}n.canvasMutations.forEach(a=>t.applyCanvas(a.event,a.mutation,s));break}case"STYLE":{const n=i.sheet;n&&e.rules.forEach(a=>t.applyStyleSheetMutation(a,n));break}case"DIALOG":{const n=i,a=o,l=n.open,u=n.matches("dialog:modal"),c=a.open,h=a.isModal,f=u!==h,g=l!==c;if((f||l&&g)&&n.close(),c&&(g||f))try{h?n.showModal():n.show()}catch(p){console.warn(p)}break}}break}case $.Text:case $.Comment:case $.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}Se!=null&&Se.has(s)&&(Se.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function kd(s,e,t){const r=s.attributes,i=e.attributes;for(const o in i){const n=i[o],a=t.getMeta(e);if(a!=null&&a.isSVG&&Xs[o])s.setAttributeNS(Xs[o],o,n);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=n,l.onload=()=>{const u=s.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;try{s.setAttribute(o,n)}catch(l){console.warn(l)}}}for(const{name:o}of Array.from(r))o in i||s.removeAttribute(o);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function za(s,e,t,r){const i=Array.from(s.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let n=0,a=i.length-1,l=0,u=o.length-1,c=i[n],h=i[a],f=o[l],g=o[u],p,y;for(;n<=a&&l<=u;)if(c===void 0)c=i[++n];else if(h===void 0)h=i[--a];else if(Ge(c,f,t.mirror,r))c=i[++n],f=o[++l];else if(Ge(h,g,t.mirror,r))h=i[--a],g=o[--u];else if(Ge(c,g,t.mirror,r)){try{s.insertBefore(c,h.nextSibling)}catch(S){console.warn(S)}c=i[++n],g=o[--u]}else if(Ge(h,f,t.mirror,r)){try{s.insertBefore(h,c)}catch(S){console.warn(S)}h=i[--a],f=o[++l]}else{if(!p){p={};for(let v=n;v<=a;v++){const b=i[v];b&&t.mirror.hasNode(b)&&(p[t.mirror.getId(b)]=v)}}y=p[r.getId(f)];const S=i[y];if(y!==void 0&&S&&Ge(S,f,t.mirror,r)){try{s.insertBefore(S,c)}catch(v){console.warn(v)}i[y]=void 0}else{const v=Nr(f,t.mirror,r);s.nodeName==="#document"&&c&&(v.nodeType===v.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||v.nodeType===v.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=i[++n]);try{s.insertBefore(v,c||null)}catch(b){console.warn(b)}}f=o[++l]}if(n>a){const S=o[u+1];let v=null;for(S&&(v=t.mirror.getNode(r.getId(S)));l<=u;++l){const b=Nr(o[l],t.mirror,r);try{s.insertBefore(b,v)}catch(C){console.warn(C)}}}else if(l>u)for(;n<=a;n++){const S=i[n];if(!(!S||S.parentNode!==s))try{s.removeChild(S),t.mirror.removeNodeFromMap(S)}catch(v){console.warn(v)}}let d=s.firstChild,m=e.firstChild;for(;d!==null&&m!==null;)Mr(d,m,t,r),d=d.nextSibling,m=m.nextSibling}function Nr(s,e,t){const r=t.getId(s),i=t.getMeta(s);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&Ni(o,s))return o;switch(s.RRNodeType){case $.Document:o=new Document;break;case $.DocumentType:o=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case $.Element:{let n=s.tagName.toLowerCase();n=Td[n]||n,i&&"isSVG"in i&&(i!=null&&i.isSVG)?o=document.createElementNS(Xs.svg,n):o=document.createElement(s.tagName);break}case $.Text:o=document.createTextNode(s.data);break;case $.Comment:o=document.createComment(s.data);break;case $.CDATA:o=document.createCDATASection(s.data);break}i&&e.add(o,N({},i));try{Se==null||Se.add(o)}catch(n){}return o}function Ni(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Ge(s,e,t,r){const i=t.getId(s),o=r.getId(e);return i===-1||i!==o?!1:Ni(s,e)}class lt extends xi{constructor(e){super(),x(this,"UNSERIALIZED_STARTING_ID",-2),x(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),x(this,"mirror",Hd()),x(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new lt}createDocumentType(e,t,r){const i=new $d(e,t,r);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let r;switch(t){case"AUDIO":case"VIDEO":r=new Ld(t);break;case"IFRAME":r=new Ud(t,this.mirror);break;case"CANVAS":r=new Fd(t);break;case"STYLE":r=new Bd(t);break;case"DIALOG":r=new Pd(t);break;default:r=new Gr(t);break}return r.ownerDocument=this,r}createComment(e){const t=new Wd(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new zd(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Vd(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const $d=Pa;class Gr extends zr{constructor(){super(...arguments),x(this,"inputData",null),x(this,"scrollData",null)}}class Ld extends Rd{}class Pd extends Ad{}class Fd extends Gr{constructor(){super(...arguments),x(this,"rr_dataURL",null),x(this,"canvasMutations",[])}getContext(){return null}}class Bd extends Gr{constructor(){super(...arguments),x(this,"rules",[])}}class Ud extends Gr{constructor(e,t){super(e),x(this,"contentDocument",new lt),this.contentDocument.mirror=t}}const Vd=Fa,Wd=Ba,zd=Ua;function Gd(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function Ga(s,e,t,r){let i;switch(s.nodeType){case he.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case he.DOCUMENT_TYPE_NODE:{const n=s;i=e.createDocumentType(n.name,n.publicId,n.systemId);break}case he.ELEMENT_NODE:{const n=s,a=Gd(n);i=e.createElement(a);const l=i;for(const{name:u,value:c}of Array.from(n.attributes))l.attributes[u]=c;n.scrollLeft&&(l.scrollLeft=n.scrollLeft),n.scrollTop&&(l.scrollTop=n.scrollTop);break}case he.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case he.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case he.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case he.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=t.getMeta(s);return e instanceof lt&&(o||(o=ja(i,e.unserializedId),t.add(s,o)),e.mirror.add(i,N({},o))),i}function jd(s,e=Rh(),t=new lt){function r(i,o){const n=Ga(i,t,e,o);if(n!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==he.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(n),n.parentNode=o,n.parentElement=o),i.nodeName==="IFRAME"){const a=i.contentDocument;a&&r(a,n)}else(i.nodeType===he.DOCUMENT_NODE||i.nodeType===he.ELEMENT_NODE||i.nodeType===he.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===he.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,n),i.childNodes.forEach(a=>r(a,n)))}return r(s,null),t}function Hd(){return new Yd}class Yd{constructor(){x(this,"idNodeMap",new Map),x(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ja(s,e){switch(s.RRNodeType){case $.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case $.DocumentType:{const t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case $.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case $.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case $.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}const Wn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},sr={},Zd=()=>!!globalThis.Zone;function Ri(s){if(sr[s])return sr[s];const e=globalThis[s],t=e.prototype,r=s in Wn?Wn[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=s in zn?zn[s]:void 0,n=!!(o&&o.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&n&&!Zd())return sr[s]=e.prototype,e.prototype;try{const a=document.createElement("iframe");document.body.appendChild(a);const l=a.contentWindow;if(!l)return e.prototype;const u=l[s].prototype;return document.body.removeChild(a),u?sr[s]=u:t}catch(a){return t}}const ls={};function _e(s,e,t){var r;const i=`${s}.${String(t)}`;if(ls[i])return ls[i].call(e);const o=Ri(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(ls[i]=n,n.call(e)):e[t]}const us={};function Ha(s,e,t){const r=`${s}.${String(t)}`;if(us[r])return us[r].bind(e);const o=Ri(s)[t];return typeof o!="function"?e[t]:(us[r]=o,o.bind(e))}function Xd(s){return _e("Node",s,"childNodes")}function Jd(s){return _e("Node",s,"parentNode")}function Kd(s){return _e("Node",s,"parentElement")}function Qd(s){return _e("Node",s,"textContent")}function qd(s,e){return Ha("Node",s,"contains")(e)}function ep(s){return Ha("Node",s,"getRootNode")()}function tp(s){return!s||!("host"in s)?null:_e("ShadowRoot",s,"host")}function rp(s){return s.styleSheets}function sp(s){return!s||!("shadowRoot"in s)?null:_e("Element",s,"shadowRoot")}function ip(s,e){return _e("Element",s,"querySelector")(e)}function np(s,e){return _e("Element",s,"querySelectorAll")(e)}function Ya(){return Ri("MutationObserver").constructor}function Ue(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch(r){return()=>{}}}function op(s){const e=s.tagName.toLowerCase(),t=s.id?`#${s.id}`:"",r=s.classList.length?"."+Array.from(s.classList).join("."):"";return`${e}${t}${r}`}function ap(s){var f;var e,t;const r=(f=(e=s.ownerDocument)==null?void 0:e.defaultView)!=null?f:window,i=s.getBoundingClientRect(),o=r.innerWidth||r.document.documentElement.clientWidth||0,n=r.innerHeight||r.document.documentElement.clientHeight||0,a=i.width>0&&i.height>0&&i.bottom>0&&i.right>0&&i.top<n&&i.left<o,l=(t=r.getComputedStyle)==null?void 0:t.call(r,s),c=!!l&&l.display!=="none"&&l.visibility!=="hidden"&&(parseFloat(l.opacity)||0)>0&&a;let h=0;if(c){const g=Math.max(0,Math.min(i.right,o)-Math.max(i.left,0)),p=Math.max(0,Math.min(i.bottom,n)-Math.max(i.top,0)),y=g*p,d=i.width*i.height;h=d>0?y/d:0}return{isVisible:c,ratio:h}}const T={childNodes:Xd,parentNode:Jd,parentElement:Kd,textContent:Qd,contains:qd,getRootNode:ep,host:tp,styleSheets:rp,shadowRoot:sp,querySelector:ip,querySelectorAll:np,mutationObserver:Ya,patch:Ue,describeNode:op,getElementVisibility:ap};function se(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const je=`Please stop import mirror directly. Instead of that,\r
|
|
68
68
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
69
|
-
or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(je),-1},getNode(){return console.error(je),null},removeNodeFromMap(){console.error(je)},has(){return console.error(je),!1},reset(){console.error(je)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(je),Reflect.get(s,e,t)}}));function ot(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const a=e-(n-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(l,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,o)},a))}}function _t(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>_t(s,e,o||{},!0)}function me(){return Math.round(performance.timeOrigin+performance.now())}function Ai(s=window){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=T.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=T.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Oi(s=window){const e=s.document;return s.innerHeight||e.documentElement&&e.documentElement.clientHeight||e.body&&e.body.clientHeight||0}function Ti(s=window){const e=s.document;return s.innerWidth||e.documentElement&&e.documentElement.clientWidth||e.body&&e.body.clientWidth||0}function Di(s){return s?s.nodeType===s.ELEMENT_NODE?s:T.parentElement(s):null}function oe(s,e,t,r){if(!s)return!1;const i=Di(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(yr(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Za(s,e){return e.getId(s)!==-1}function fr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===vt}function _i(s,e){if(gt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=T.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?_i(r,e):!0}function Rr(s){return!!s.changedTouches}function ki(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Xa(s){const e={},t=(i,o)=>{const n={value:i,parent:o,children:[]};return e[i.node.id]=n,n},r=[];for(const i of s){const{nextId:o,parentId:n}=i;if(o&&o in e){const a=e[o];if(a.parent){const l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{const l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(n in e){const a=e[n];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function $i(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)$i(s.children[t],e)}function Qe(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Li(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Pi(s,e){var t,r;const i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),n=Pi(i,e),a=o.height/i.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function Ae(s){return s?s instanceof be&&"shadowRoot"in s?!!s.shadowRoot:!!T.shadowRoot(s):!1}function Xe(s,e){const t=s[e[0]];return e.length===1?t:Xe(t.cssRules[e[1]].cssRules,e.slice(2))}function Js(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Ja(s){const e=new Set,t=[];for(let r=s.length;r--;){const i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}class Fi{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Bi(s){var e;let t=null;return"getRootNode"in s&&((e=T.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(s))&&(t=T.host(T.getRootNode(s))),t}function Ka(s){let e=s,t;for(;t=Bi(e);)e=t;return e}function Qa(s){const e=s.ownerDocument;if(!e)return!1;const t=Ka(s);return T.contains(e,t)}function Ui(s){const e=s.ownerDocument;return e?T.contains(e,s)||Qa(s):!1}const lp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Fi,get _mirror(){return exports.mirror},closestElementOfNode:Di,getBaseDimension:Pi,getNestedRule:Xe,getPositionsAndIndex:Js,getRootShadowHost:Ka,getShadowHost:Bi,getWindowHeight:Oi,getWindowScroll:Ai,getWindowWidth:Ti,hasShadowRoot:Ae,hookSetter:_t,inDom:Ui,isAncestorRemoved:_i,isBlocked:oe,isIgnored:fr,isSerialized:Za,isSerializedIframe:Qe,isSerializedStylesheet:Li,iterateResolveTree:$i,legacy_isTouchEvent:Rr,nowTimestamp:me,on:se,polyfill:ki,queueToResolveTrees:Xa,shadowHostInDom:Qa,throttle:ot,uniqueTextMutations:Ja},Symbol.toStringTag,{value:"Module"}));var M=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(M||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s[s.VisibilityMutation=17]="VisibilityMutation",s))(I||{}),F=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(F||{}),Ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Ce||{}),Me=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Me||{}),Re=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Re||{}),P=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(P||{}),Ee=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Ee||{});function Gn(s){return"__ln"in s}class up{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gn(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gn(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const jn=(s,e)=>`${s}@${e}`;class cp{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"excludeAttribute"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"visibilityManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new up,i=l=>{let u=l,c=vt;for(;c===vt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=T.parentNode(l);if(!u||!Ui(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){const p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=gt(u)?this.mirror.getId(Bi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const g=Ze(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Qe(p,this.mirror)&&this.iframeManager.addIframe(p),Li(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ae(l)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(l),this.doc)},onIframeLoad:(p,y)=>{this.iframeManager.attachIframe(p,y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,y)=>{this.stylesheetManager.attachLinkElement(p,y)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Hn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(T.parentNode(l))||o(l);for(const l of this.addedSet)!Yn(this.droppedSet,l)&&!Hn(this.removesSubTreeCache,l,this.mirror)||Yn(this.movedSet,l)?o(l):this.droppedSet.add(l);let n=null;for(;r.length;){let l=null;if(n){const u=this.mirror.getId(T.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(l=n)}if(!l){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(T.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const g=c.value,p=T.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=T.host(p);if(this.mirror.getId(y)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}n=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{const u=l.node,c=T.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:u}=l;if(typeof u.style=="string"){const c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(T.childNodes(e),i=>T.textContent(i)||"").join("");t.attributes.value=pr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:mr(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!fr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=T.textContent(e.target);!oe(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:yo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Di(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);const n=t[r],a=typeof n=="boolean",l=document.contains(t),u=ri(t),c=ys(r,this.excludeAttribute);if(i===null&&!t.hasAttribute(r)&&e.oldValue!==null&&(n===""||n===null||typeof n=="undefined")){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(ys(r,this.excludeAttribute)){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(r==="value"){const g=mr(t);i=pr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:g,value:i,maskInputFn:this.maskInputFn})}if(oe(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let f=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(f||(f={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(e.target,f)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!go(t.tagName,r))if(f.attributes[r]=mo(this.doc,Te(t.tagName),Te(r),i),r!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${me()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===n?"mirrored in DOM property":null,i===f.attributes[r]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,transformedValue:f.attributes[r],excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c}),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");e.oldValue&&p.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const d=t.style.getPropertyValue(y),m=t.style.getPropertyPriority(y);d!==p.style.getPropertyValue(y)||m!==p.style.getPropertyPriority(y)?m===""?f.styleDiff[y]=d:f.styleDiff[y]=[d,m]:f._unchangedStyles[y]=[d,m]}for(const y of Array.from(p.style))t.style.getPropertyValue(y)===""&&(f.styleDiff[y]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(oe(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=gt(e.target)?this.mirror.getId(T.host(e.target)):this.mirror.getId(e.target);oe(e.target,this.blockClass,this.blockSelector,!1)||fr(t,this.mirror,this.slimDOMOptions)||!Za(t,this.mirror)||(this.addedSet.has(t)?(Ks(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||_i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[jn(r,i)]?Ks(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:gt(e.target)&&yt(e.target)?!0:void 0}),hp(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(fr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[jn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);oe(e,this.blockClass,this.blockSelector,!1)||(T.childNodes(e).forEach(r=>this.genAdds(r)),Ae(e)&&T.childNodes(T.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","visibilityManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze(),this.visibilityManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.visibilityManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock(),this.visibilityManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.visibilityManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset(),this.visibilityManager.reset()}}function Ks(s,e){s.delete(e),T.childNodes(e).forEach(t=>Ks(s,t))}function hp(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),T.childNodes(r).forEach(i=>t.push(i)))}}function Hn(s,e,t){return s.size===0?!1:fp(s,e)}function fp(s,e,t){const r=T.parentNode(e);return r?s.has(r):!1}function Yn(s,e){return s.size===0?!1:qa(s,e)}function qa(s,e){const t=T.parentNode(e);return t?s.has(t)?!0:qa(s,t):!1}let wt;function dp(s){wt=s}function pp(){wt=void 0}const L=s=>wt?(...t)=>{try{return s(...t)}catch(r){if(wt&&wt(r)===!0)return;throw r}}:s,Pe=[];function at(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function el(s,e){const t=new cp;Pe.push(t),t.init(s);const r=new(Ya())(L(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function mp({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],a;const l=ot(L(h=>{const f=Date.now()-a;s(n.map(g=>(g.timeOffset-=f,g)),h),n=[],a=null}),o),u=L(ot(L(h=>{const f=at(h),{clientX:g,clientY:p}=Rr(h)?h.changedTouches[0]:h;a||(a=me()),n.push({x:g,y:p,id:r.getId(f),timeOffset:me()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[se("mousemove",u,t),se("touchmove",u,t),se("drag",u,t)];return L(()=>{c.forEach(h=>h())})}function gp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const u=c=>h=>{const f=at(h);if(oe(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=Ce.Mouse;break;case"touch":g=Ce.Touch;break;case"pen":g=Ce.Pen;break}g===Ce.Touch?F[c]===F.MouseDown?p="TouchStart":F[c]===F.MouseUp&&(p="TouchEnd"):Ce.Pen}else Rr(h)&&(g=Ce.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===Ce.Touch||p.startsWith("Mouse")&&g===Ce.Mouse)&&(g=null)):F[c]===F.Click&&(g=l,l=null);const y=Rr(h)?h.changedTouches[0]:h;if(!y)return;const d=t.getId(f),{clientX:m,clientY:S}=y;L(s)(N({type:F[p],id:d,x:m,y:S},g!==null&&{pointerType:g}))};return Object.keys(F).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let h=Te(c);const f=u(c);if(window.PointerEvent)switch(F[c]){case F.MouseDown:case F.MouseUp:h=h.replace("mouse","pointer");break;case F.TouchStart:case F.TouchEnd:return}a.push(se(h,f,e))}),L(()=>{a.forEach(c=>c())})}function tl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=L(ot(L(a=>{const l=at(a);if(!l||oe(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=Ai(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return se("scroll",n,e)}function yp({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=L(ot(L(()=>{const o=Oi(),n=Ti();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return se("resize",i,e)}const cs=["INPUT","TEXTAREA","SELECT"],Zn=new WeakMap,bp=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],Xn=new WeakMap;function wp({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(v){let b=at(v);const C=v.isTrusted,E=b&&b.tagName;if(b&&E==="OPTION"&&(b=T.parentElement(b)),!b||!E||cs.indexOf(E)<0||oe(b,r,i,!0)||b.classList.contains(o)||n&&b.matches(n))return;let _=b.value,A=!1;const V=mr(b)||"";V==="radio"||V==="checkbox"?A=b.checked:(a[E.toLowerCase()]||a[V])&&(_=pr({element:b,maskInputOptions:a,tagName:E,type:V,value:_,maskInputFn:l})),f(b,c?{text:_,isChecked:A,userTriggered:C}:{text:_,isChecked:A});const z=b.name;V==="radio"&&z&&A&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(J=>{if(J!==b){const Q=J.value;f(J,c?{text:Q,isChecked:!A,userTriggered:!1}:{text:Q,isChecked:!A})}})}function f(v,b){const C=Zn.get(v),E=v,_=E.hasAttribute("placeholder"),A=E.value==="",V=typeof E.defaultValue=="string"?E.defaultValue==="":!0,z=!b.userTriggered,J=!C||C.text==="",Q=_&&A&&V&&J&&z&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),te=E.tagName==="INPUT"&&E.type==="text"&&!b.userTriggered&&b.text===E.defaultValue&&!C&&E.hasAttribute("placeholder"),R=!b.userTriggered&&E.value===E.defaultValue&&!C&&E.hasAttribute("placeholder")&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),ie=E.type==="checkbox"&&!b.userTriggered&&!b.isChecked&&!C,ne=E.type==="radio"&&!b.userTriggered&&!b.isChecked&&!C;if(Q||te||R||ie||ne){console.debug(`[${me()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:T.describeNode(E),tag:E.tagName,nodeType:E.nodeType,attribute:E.attributes,value:E.value,isLikelyPhantom:Q,isRenderDrivenTextInput:te,isValueFromDefault:R,isPhantomCheckbox:ie,isPhantomRadio:ne});return}if(!C||C.text!==b.text||C.isChecked!==b.isChecked){Zn.set(v,b);const O=t.getId(v);L(s)(q(N({},b),{id:O}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(v=>se(v,L(h),e)),y=v=>{const b=at(v);if(!b||!b.tagName)return;if(u.input==="all"){h(v);return}const C=b.tagName,E=v.key,_=bp.includes(E),A=C==="TEXTAREA",V=e.activeElement===b,z=b.value,J=Xn.get(b);if(Xn.set(b,z),!V){h(v);return}if(_){if(!A){h(v);return}let Q=J!=null?J:"",te=0;const R=2,ie=()=>{const ne=b.value,O=e.activeElement===b,ue=ne!==Q;if(!O){h(v);return}if(ue)te=0,Q=ne;else if(te++,te>=R){h(v);return}requestAnimationFrame(ie)};requestAnimationFrame(ie);return}};p.push(se("keydown",L(y),e));const d=e.defaultView;if(!d)return()=>{p.forEach(v=>v())};const m=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...S.map(v=>_t(v[0],v[1],{set(){L(h)({target:this,isTrusted:!1})}},!1,d))),L(()=>{p.forEach(v=>v())})}function Ar(s){const e=[];function t(r,i){if(ir("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ir("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ir("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ir("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function Ne(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function vp({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:L((c,h,f)=>{const[g,p]=f,{id:y,styleId:d}=Ne(h,e,t.styleMirror);return(y&&y!==-1||d&&d!==-1)&&s({id:y,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){const g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,replaceSync:g}),c.apply(h,f)})}));const l={};nr("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(nr("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),nr("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),nr("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:L((f,g,p)=>{const[y,d]=p,{id:m,styleId:S}=Ne(g.parentStyleSheet,e,t.styleMirror);return(m&&m!==-1||S&&S!==-1)&&s({id:m,styleId:S,adds:[{rule:y,index:[...Ar(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:L((f,g,p)=>{const[y]=p,{id:d,styleId:m}=Ne(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||m&&m!==-1)&&s({id:d,styleId:m,removes:[{index:[...Ar(g),y]}]}),f.apply(g,p)})})}),L(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function rl({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(T.host(t));const a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=l.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(f){}return h}}),L(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Sp({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:L((a,l,u)=>{var c;const[h,f,g]=u;if(t.has(h))return o.apply(l,[h,f,g]);const{id:p,styleId:y}=Ne((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,set:{property:h,value:f,priority:g},index:Ar(l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:L((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:g}=Ne((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:Ar(l.parentRule)}),a.apply(l,u)})}),L(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function Cp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=L(l=>ot(L(u=>{const c=at(u);if(!c||oe(c,e,t,!0))return;const{currentTime:h,volume:f,muted:g,playbackRate:p,loop:y}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:y})}),i.media||500)),a=[se("play",n(Re.Play),o),se("pause",n(Re.Pause),o),se("seeked",n(Re.Seeked),o),se("volumechange",n(Re.VolumeChange),o),se("ratechange",n(Re.RateChange),o)];return L(()=>{a.forEach(l=>l())})}function Ep({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(l,u,c){const h=new o(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const n=Ue(e.fonts,"add",function(a){return function(l){return setTimeout(L(()=>{const u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=o}),r.push(n),L(()=>{r.forEach(a=>a())})}function Ip(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=L(()=>{const l=e.getSelection();if(!l||n&&(l!=null&&l.isCollapsed))return;n=l.isCollapsed||!1;const u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){const f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:y,endOffset:d}=f;oe(g,r,i,!0)||oe(y,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(y),endOffset:d})}o({ranges:u})});return a(),se("selectionchange",a)}function xp({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ue(t.customElements,"define",function(i){return function(o,n,a){try{e({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,a])}})}function Mp(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,visibilityMutationCb:f,fontCb:g,selectionCb:p,customElementCb:y}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),o(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),n(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),a(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),l(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.visibilityMutationCb=(...d)=>{e.visibilityMutation&&e.visibilityMutation(...d),f(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),g(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),p(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),y(...d)}}function Np(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Mp(s,e);let r;s.recordDOM&&(r=el(s,s.doc));const i=mp(s),o=gp(s),n=tl(s),a=yp(s,{win:t}),l=wp(s),u=Cp(s);let c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=vp(s,{win:t}),h=rl(s,s.doc),f=Sp(s,{win:t}),s.collectFonts&&(g=Ep(s)));const p=Ip(s),y=xp(s),d=[];for(const m of s.plugins)d.push(m.observer(m.callback,t,m.options));return L(()=>{Pe.forEach(m=>m.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),g(),p(),y(),d.forEach(m=>m())})}function ir(s){return typeof window[s]!="undefined"}function nr(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Jn{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),n.set(a,t)),a}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Rp{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new Jn(po)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case M.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:M.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case M.Meta:case M.Load:case M.DomContentLoaded:return!1;case M.Plugin:return t;case M.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case M.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Ee.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Ap{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!yt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=el(q(N({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(tl(q(N({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(T.host(e))),this.restoreHandlers.push(rl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Ue(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=T.shadowRoot(this);return a&&Ui(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var or=0;or<Je.length;or++)dt[Je.charCodeAt(or)]=or;var Op=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Je[e[t]>>2],i+=Je[(e[t]&3)<<4|e[t+1]>>4],i+=Je[(e[t+1]&15)<<2|e[t+2]>>6],i+=Je[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Tp=function(s){var e=s.length*.75,t=s.length,r,i=0,o,n,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)o=dt[s.charCodeAt(r)],n=dt[s.charCodeAt(r+1)],a=dt[s.charCodeAt(r+2)],l=dt[s.charCodeAt(r+3)],c[i++]=o<<2|n>>4,c[i++]=(n&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u};const Kn=new Map;function Dp(s,e){let t=Kn.get(s);return t||(t=new Map,Kn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const sl=(s,e,t)=>{if(!s||!(nl(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Dp(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function dr(s,e,t){if(s instanceof Array)return s.map(r=>dr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Op(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[dr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[dr(s.data,e,t),s.width,s.height]};if(nl(s,e)||typeof s=="object"){const r=s.constructor.name,i=sl(s,e,t);return{rr_type:r,index:i}}}}return s}const il=(s,e,t)=>s.map(r=>dr(r,e,t)),nl=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function _p(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const a=Ue(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return oe(this.canvas,t,r,!0)||setTimeout(()=>{const c=il(u,e,this);s(this.canvas,{type:Me["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=_t(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:Me["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function kp(s){return s==="experimental-webgl"?"webgl":s}function Qn(s,e,t,r){const i=[];try{const o=Ue(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!oe(this,e,t,!0)){const u=kp(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){const c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[a,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function qn(s,e,t,r,i,o){const n=[],a=Object.getOwnPropertyNames(s);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;const u=Ue(s,l,function(c){return function(...h){const f=c.apply(this,h);if(sl(f,o,this),"tagName"in this.canvas&&!oe(this.canvas,r,i,!0)){const g=il(h,o,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});n.push(u)}catch(u){const c=_t(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function $p(s,e,t,r){const i=[];return i.push(...qn(e.WebGLRenderingContext.prototype,Me.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...qn(e.WebGL2RenderingContext.prototype,Me.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const ol="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Lp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),eo=typeof window!="undefined"&&window.Blob&&new Blob([Lp(ol)],{type:"text/javascript;charset=utf-8"});function Pp(s){let e;try{if(e=eo&&(window.URL||window.webkitURL).createObjectURL(eo),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+ol,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Fp{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){const n=Qn(t,r,i,!0),a=new Map,l=new Pp;l.onmessage=p=>{const{id:y}=p.data;if(a.set(y,!1),!("base64"in p.data))return;const{base64:d,type:m,width:S,height:v}=p.data;this.mutationCb({id:y,type:Me["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:m}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(y=>{oe(y,r,i,!0)||p.push(y)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async y=>{var d;const m=this.mirror.getId(y);if(a.get(m)||y.width===0||y.height===0)return;if(a.set(m,!0),["webgl","webgl2"].includes(y.__context)){const v=y.getContext(y.__context);((d=v==null?void 0:v.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=await createImageBitmap(y);l.postMessage({id:m,bitmap:S,width:y.width,height:y.height,dataURLOptions:o.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{n(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Qn(e,t,r,!1),o=_p(this.processMutation.bind(this),e,t,r),n=$p(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(n=>{const u=n,{type:a}=u;return We(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Bp{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new Fi),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:ho(a,o.href),index:l}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Up{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}function Vp(s,e,t){var c,h,f,g,p,y;const r=(c=t==null?void 0:t.root)!=null?c:null,i=(h=t==null?void 0:t.threshold)!=null?h:.5,o=(f=t==null?void 0:t.sensitivity)!=null?f:.05,n=Wp((g=t==null?void 0:t.rootMargin)!=null?g:"0px"),a=new Map,l=zp(r),u=Gp(l,n);for(const d of s){const m=d.getBoundingClientRect();let S=Yp(),v=0;m.width>0&&m.height>0&&(S=jp(m,u),v=Hp(m,S),v=Math.round(v*100)/100);const b=Zp(d),C=(p=e.get(d))!=null?p:null,E=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,_=v,A=(C==null?void 0:C.isStyleVisible)&&E>i,V=b&&_>i;!C||A!==V||A!==V&&Math.abs(_-E)>o?a.set(d,{target:d,isVisible:V,isStyleVisible:b,intersectionRatio:_,intersectionRect:S,oldValue:C}):a.set(d,C)}return a}function Wp(s){const e=s.trim().split(/\s+/),t=(r,i)=>r.endsWith("%")?parseFloat(r)/100*i:parseFloat(r)||0;return function(r){const i=t(e[0]||"0px",r.height),o=t(e[1]||e[0]||"0px",r.width),n=t(e[2]||e[0]||"0px",r.height),a=t(e[3]||e[1]||e[0]||"0px",r.width);return{top:i,right:o,bottom:n,left:a,width:0,height:0}}}function zp(s){return s?s.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Gp(s,e){const t=e(s);return new DOMRect(s.left-t.left,s.top-t.top,s.width+t.left+t.right,s.height+t.top+t.bottom)}function jp(s,e){const t=Math.max(s.top,e.top),r=Math.max(s.left,e.left),i=Math.min(s.bottom,e.bottom),o=Math.min(s.right,e.right),n=Math.max(0,o-r),a=Math.max(0,i-t);return{top:t,left:r,bottom:i,right:o,width:n,height:a}}function Hp(s,e){const t=s.width*s.height,r=e.width*e.height;return t>0?r/t:0}function Yp(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function Zp(s){const e=getComputedStyle(s);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class Xp{constructor(e){var u,c,h,f,g,p;w(this,"frozen",!1),w(this,"locked",!1),w(this,"pending",new Map),w(this,"mirror"),w(this,"mutationCb"),w(this,"rafId",null),w(this,"intervalId",null),w(this,"rafThrottle"),w(this,"lastFlushTime",0),w(this,"elements",new Set),w(this,"previousState",new Map),w(this,"root",null),w(this,"threshold"),w(this,"sensitivity"),w(this,"rootMargin"),w(this,"hasInitialized",!1),w(this,"mode","none"),w(this,"debounce",50),w(this,"throttle",100),w(this,"buffer",new Map),w(this,"debounceTimer",null),w(this,"lastThrottleTime",0),w(this,"disabled",!1),w(this,"notifyActivity");const{doc:t,mirror:r,sampling:i,mutationCb:o,notifyActivity:n}=e;if(this.mirror=r,this.mutationCb=o,this.notifyActivity=n,this.rootMargin="0px",i===!1){this.disabled=!0;return}const a=typeof i=="object"&&i!==null?i:{};this.mode=(u=a==null?void 0:a.mode)!=null?u:"none",this.debounce=Number((c=a==null?void 0:a.debounce)!=null?c:100),this.throttle=Number((h=a==null?void 0:a.throttle)!=null?h:100),this.threshold=Number((f=a==null?void 0:a.threshold)!=null?f:.5),this.sensitivity=Number((g=a==null?void 0:a.sensitivity)!=null?g:.05),this.rafThrottle=Number((p=a==null?void 0:a.rafThrottle)!=null?p:50),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(d=>{d.addedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&(this.observe(m),m.querySelectorAll("*").forEach(S=>this.observe(S)))}),d.removedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&this.unobserve(m)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Vp(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,r]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==r.isVisible||Math.abs(i.intersectionRatio-r.intersectionRatio)>this.sensitivity){const n=this.mirror.getId(t);n!==-1&&this.buffer.set(t,{id:n,isVisible:r.isVisible,ratio:r.intersectionRatio}),this.previousState.set(t,r)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;this.buffer.size!==0&&((e=this.notifyActivity)==null||e.call(this,this.buffer.size),this.mutationCb({mutations:Array.from(this.buffer.values())}),this.buffer.clear())}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const Jp="2.1.3-alpha.1";let Z,pt,hs,fs,qe=!1;const Or=[];let Le;function Kp(s){return new Promise(t=>{const r=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})},i=(()=>{let o=!1;return()=>{o||(o=!0,r())}})();["interactive","complete"].includes(s.document.readyState)?i():(s.addEventListener("DOMContentLoaded",i,{once:!0}),s.addEventListener("load",i,{once:!0}),setTimeout(()=>{i()},5e3))})}try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Xi=s.contentWindow)==null?void 0:Xi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const fe=fo();function ce(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,checkoutEveryNvm:i,blockClass:o="rr-block",blockSelector:n=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,excludeAttribute:u,maskTextClass:c="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,maskAllInputs:g,maskInputOptions:p,slimDOMOptions:y,maskInputFn:d,maskTextFn:m,hooks:S,packFn:v,sampling:b={},dataURLOptions:C={},mousemoveWait:E,recordDOM:_=!0,recordCanvas:A=!1,recordCrossOriginIframes:V=!1,recordAfter:z=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",flushCustomEvent:J=s.flushCustomEvent!==void 0?s.flushCustomEvent:"after",userTriggeredOnInput:Q=!1,collectFonts:te=!1,inlineImages:R=!1,plugins:ie,keepIframeSrcFn:ne=()=>!1,ignoreCSSAttributes:O=new Set([]),errorHandler:ue}=s;dp(ue);const de=V?window.parent===window:!0;let ae=!1;if(!de)try{window.parent.document&&(ae=!1)}catch(k){ae=!0}if(de&&!e)throw new Error("emit function is required");if(!de&&!ae)return()=>{};E!==void 0&&b.mousemove===void 0&&(b.mousemove=E),fe.reset();const jr=u===void 0?/.^/:u,Hr=g===!0?{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,password:!0}:p!==void 0?p:{password:!0},Yr=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all",headTitleMutations:y==="all"}:y||{};ki();let Vi,Zr=0,Xr=0;const dl=k=>{Xr+=k},Wi=k=>{for(const le of ie||[])le.eventProcessor&&(k=le.eventProcessor(k));return v&&!ae&&(k=v(k)),k};Z=(k,le)=>{var K;const re=k;if(re.timestamp=me(),(K=Pe[0])!=null&&K.isFrozen()&&re.type!==M.FullSnapshot&&!(re.type===M.IncrementalSnapshot&&re.data.source===I.Mutation)&&Pe.forEach(pe=>pe.unfreeze()),de)e==null||e(Wi(re),le);else if(ae){const pe={type:"rrweb",event:Wi(re),origin:window.location.origin,isCheckout:le};window.parent.postMessage(pe,"*")}if(re.type===M.FullSnapshot)Vi=re,Zr=0;else if(re.type===M.IncrementalSnapshot){if(re.data.source===I.Mutation&&re.data.isAttachIframe)return;Zr++;const pe=r&&Zr>=r,Ve=t&&re.timestamp-Vi.timestamp>t,W=i&&Xr>=i;(pe||Ve||W)&&(W&&(Xr=0),pt(!0))}};const kt=k=>{Z({type:M.IncrementalSnapshot,data:N({source:I.Mutation},k)})},zi=k=>Z({type:M.IncrementalSnapshot,data:N({source:I.Scroll},k)}),Gi=k=>Z({type:M.IncrementalSnapshot,data:N({source:I.CanvasMutation},k)}),ji=k=>{var le;(le=S==null?void 0:S.visibilityMutation)==null||le.call(S,k),Z({type:M.IncrementalSnapshot,data:N({source:I.VisibilityMutation},k)})},pl=k=>Z({type:M.IncrementalSnapshot,data:N({source:I.AdoptedStyleSheet},k)}),ke=new Bp({mutationCb:kt,adoptedStyleSheetCb:pl}),$e=new Rp({mirror:fe,mutationCb:kt,stylesheetManager:ke,recordCrossOriginIframes:V,wrappedEmit:Z});for(const k of ie||[])k.getMirror&&k.getMirror({nodeMirror:fe,crossOriginIframeMirror:$e.crossOriginIframeMirror,crossOriginIframeStyleMirror:$e.crossOriginIframeStyleMirror});const Jr=new Up;hs=new Fp({recordCanvas:A,mutationCb:Gi,win:window,blockClass:o,blockSelector:n,mirror:fe,sampling:b.canvas,dataURLOptions:C}),fs=new Xp({doc:window.document,mirror:fe,sampling:b.visibility,mutationCb:ji,notifyActivity:dl});const $t=new Ap({mutationCb:kt,scrollCb:zi,bypassOptions:{blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskInputOptions:Hr,dataURLOptions:C,maskTextFn:m,maskInputFn:d,recordCanvas:A,inlineImages:R,sampling:b,slimDOMOptions:Yr,iframeManager:$e,stylesheetManager:ke,canvasManager:hs,visibilityManager:fs,keepIframeSrcFn:ne,processedNodeManager:Jr},mirror:fe});pt=(k=!1)=>{if(!_)return;Z({type:M.Meta,data:{href:window.location.href,width:Ti(),height:Oi()}},k),ke.reset(),$t.init(),Pe.forEach(K=>K.lock());const le=Eu(document,{mirror:fe,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskAllInputs:Hr,maskTextFn:m,maskInputFn:d,slimDOM:Yr,dataURLOptions:C,recordCanvas:A,inlineImages:R,onSerialize:K=>{Qe(K,fe)&&$e.addIframe(K),Li(K,fe)&&ke.trackLinkElement(K),Ae(K)&&$t.addShadowRoot(T.shadowRoot(K),document)},onIframeLoad:(K,re)=>{$e.attachIframe(K,re),$t.observeAttachShadow(K)},onStylesheetLoad:(K,re)=>{ke.attachLinkElement(K,re)},keepIframeSrcFn:ne});if(!le)return console.warn("Failed to snapshot the document");Z({type:M.FullSnapshot,data:{node:le,initialOffset:Ai(window)}},k),Pe.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,fe.getId(document))},Le=()=>{for(const k of Or)Z(k);Or.length=0};try{const k=[],le=pe=>{var Ve;return L(Np)({mutationCb:kt,mousemoveCb:(W,Kr)=>Z({type:M.IncrementalSnapshot,data:{source:Kr,positions:W}}),mouseInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.MouseInteraction},W)}),scrollCb:zi,viewportResizeCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.ViewportResize},W)}),inputCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.Input},W)}),mediaInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.MediaInteraction},W)}),styleSheetRuleCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.StyleSheetRule},W)}),styleDeclarationCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.StyleDeclaration},W)}),canvasMutationCb:Gi,visibilityMutationCb:ji,fontCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.Font},W)}),selectionCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:I.Selection},W)})},customElementCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:I.CustomElement},W)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,maskInputOptions:Hr,inlineStylesheet:f,sampling:b,recordDOM:_,recordCanvas:A,inlineImages:R,userTriggeredOnInput:Q,collectFonts:te,doc:pe,maskInputFn:d,maskTextFn:m,keepIframeSrcFn:ne,blockSelector:n,slimDOMOptions:Yr,dataURLOptions:C,mirror:fe,iframeManager:$e,stylesheetManager:ke,shadowDomManager:$t,processedNodeManager:Jr,canvasManager:hs,visibilityManager:fs,ignoreCSSAttributes:O,plugins:((Ve=ie==null?void 0:ie.filter(W=>W.observer))==null?void 0:Ve.map(W=>({observer:W.observer,options:W.options,callback:Kr=>Z({type:M.Plugin,data:{plugin:W.name,payload:Kr}})})))||[]},S)};$e.addLoadListener(pe=>{try{k.push(le(pe.contentDocument))}catch(Ve){console.warn(Ve)}});const K=()=>{J==="before"&&Le(),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()},re=async()=>{J==="before"&&Le(),z==="DOMContentStabilized"&&(console.debug(`[${me()}] [rrweb:record] \u{1F7E2} Waiting for DOM stabilization...`),await Kp(window),console.debug(`[${me()}] [rrweb:record] \u2705 DOM stabilized, starting recording`)),console.debug(`[${me()}] [rrweb:record] \u2705 Init dom and takeFullSnapshot `),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()};return document.readyState==="interactive"||document.readyState==="complete"?K():(k.push(se("DOMContentLoaded",()=>{Z({type:M.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&K()})),k.push(se("load",()=>{Z({type:M.Load,data:{}}),z==="load"&&K()},window))),()=>{Le(),k.forEach(pe=>pe()),Jr.destroy(),qe=!1,pp()}}catch(k){console.warn(k)}}ce.getVersion=()=>Jp;ce.isRecording=()=>qe;ce.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${Or.length} events`),Le()};ce.addCustomEvent=(s,e)=>{const t={type:M.Custom,data:{tag:s,payload:e}};if(!qe){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${s}`),Or.push(t);return}Z(t)};ce.freezePage=()=>{Pe.forEach(s=>s.freeze())};ce.takeFullSnapshot=s=>{if(!qe)throw new Error("please take full snapshot after start recording");pt(s)};ce.mirror=fe;function al(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const Qp=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"}));function qp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(m){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(m)}const a=n(s.navigator.userAgent)?1:0;function l(m,S){this.scrollLeft=m,this.scrollTop=S}function u(m){return .5*(1-Math.cos(Math.PI*m))}function c(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(m,S){if(S==="Y")return m.clientHeight+a<m.scrollHeight;if(S==="X")return m.clientWidth+a<m.scrollWidth}function f(m,S){const v=s.getComputedStyle(m,null)["overflow"+S];return v==="auto"||v==="scroll"}function g(m){const S=h(m,"Y")&&f(m,"Y"),v=h(m,"X")&&f(m,"X");return S||v}function p(m){for(;m!==e.body&&g(m)===!1;)m=m.parentNode||m.host;return m}function y(m){const S=o();let v,b,C,E=(S-m.startTime)/r;E=E>1?1:E,v=u(E),b=m.startX+(m.x-m.startX)*v,C=m.startY+(m.y-m.startY)*v,m.method.call(m.scrollable,b,C),(b!==m.x||C!==m.y)&&s.requestAnimationFrame(y.bind(s,m))}function d(m,S,v){let b,C,E,_;const A=o();m===e.body?(b=s,C=s.scrollX||s.pageXOffset,E=s.scrollY||s.pageYOffset,_=i.scroll):(b=m,C=m.scrollLeft,E=m.scrollTop,_=l),y({scrollable:b,method:_,startTime:A,startX:C,startY:E,x:S,y:v})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const m=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof m=="undefined"?this.scrollLeft:~~m,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const m=p(this),S=m.getBoundingClientRect(),v=this.getBoundingClientRect();m!==e.body?(d.call(this,m,m.scrollLeft+v.left-S.left,m.scrollTop+v.top-S.top),s.getComputedStyle(m).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class em{constructor(e=[],t){w(this,"timeOffset",0),w(this,"speed"),w(this,"actions"),w(this,"raf",null),w(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){const i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}}function to(s,e){if(s.type===M.IncrementalSnapshot&&s.data.source===I.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
|
|
69
|
+
or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(je),-1},getNode(){return console.error(je),null},removeNodeFromMap(){console.error(je)},has(){return console.error(je),!1},reset(){console.error(je)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(s,e,t){return e==="map"&&console.error(je),Reflect.get(s,e,t)}}));function ot(s,e,t={}){let r=null,i=0;return function(...o){const n=Date.now();!i&&t.leading===!1&&(i=n);const a=e-(n-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=n,s.apply(l,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,o)},a))}}function _t(s,e,t,r,i=window){const o=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(n){setTimeout(()=>{t.set.call(this,n)},0),o&&o.set&&o.set.call(this,n)}}),()=>_t(s,e,o||{},!0)}function me(){return Math.round(performance.timeOrigin+performance.now())}function Ai(s=window){var e,t,r,i;const o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((e=T.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o==null?void 0:o.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((r=T.parentElement(o.body))==null?void 0:r.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Oi(s=window){const e=s.document;return s.innerHeight||e.documentElement&&e.documentElement.clientHeight||e.body&&e.body.clientHeight||0}function Ti(s=window){const e=s.document;return s.innerWidth||e.documentElement&&e.documentElement.clientWidth||e.body&&e.body.clientWidth||0}function Di(s){return s?s.nodeType===s.ELEMENT_NODE?s:T.parentElement(s):null}function oe(s,e,t,r){if(!s)return!1;const i=Di(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(yr(i,e,r))return!0}catch(o){}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Za(s,e){return e.getId(s)!==-1}function fr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===vt}function _i(s,e){if(gt(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=T.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?_i(r,e):!0}function Rr(s){return!!s.changedTouches}function ki(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Xa(s){const e={},t=(i,o)=>{const n={value:i,parent:o,children:[]};return e[i.node.id]=n,n},r=[];for(const i of s){const{nextId:o,parentId:n}=i;if(o&&o in e){const a=e[o];if(a.parent){const l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{const l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(n in e){const a=e[n];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function $i(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)$i(s.children[t],e)}function Qe(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Li(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Pi(s,e){var t,r;const i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),n=Pi(i,e),a=o.height/i.clientHeight;return{x:o.x*n.relativeScale+n.x,y:o.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function Ae(s){return s?s instanceof be&&"shadowRoot"in s?!!s.shadowRoot:!!T.shadowRoot(s):!1}function Xe(s,e){const t=s[e[0]];return e.length===1?t:Xe(t.cssRules[e[1]].cssRules,e.slice(2))}function Js(s){const e=[...s],t=e.pop();return{positions:e,index:t}}function Ja(s){const e=new Set,t=[];for(let r=s.length;r--;){const i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}class Fi{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Bi(s){var e;let t=null;return"getRootNode"in s&&((e=T.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(s))&&(t=T.host(T.getRootNode(s))),t}function Ka(s){let e=s,t;for(;t=Bi(e);)e=t;return e}function Qa(s){const e=s.ownerDocument;if(!e)return!1;const t=Ka(s);return T.contains(e,t)}function Ui(s){const e=s.ownerDocument;return e?T.contains(e,s)||Qa(s):!1}const lp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Fi,get _mirror(){return exports.mirror},closestElementOfNode:Di,getBaseDimension:Pi,getNestedRule:Xe,getPositionsAndIndex:Js,getRootShadowHost:Ka,getShadowHost:Bi,getWindowHeight:Oi,getWindowScroll:Ai,getWindowWidth:Ti,hasShadowRoot:Ae,hookSetter:_t,inDom:Ui,isAncestorRemoved:_i,isBlocked:oe,isIgnored:fr,isSerialized:Za,isSerializedIframe:Qe,isSerializedStylesheet:Li,iterateResolveTree:$i,legacy_isTouchEvent:Rr,nowTimestamp:me,on:se,polyfill:ki,queueToResolveTrees:Xa,shadowHostInDom:Qa,throttle:ot,uniqueTextMutations:Ja},Symbol.toStringTag,{value:"Module"}));var M=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(M||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s[s.VisibilityMutation=17]="VisibilityMutation",s))(I||{}),F=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(F||{}),Ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Ce||{}),Me=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Me||{}),Re=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Re||{}),P=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(P||{}),Ee=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Ee||{});function Gn(s){return"__ln"in s}class up{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gn(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gn(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const jn=(s,e)=>`${s}@${e}`;class cp{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"excludeAttribute"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"visibilityManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new up,i=l=>{let u=l,c=vt;for(;c===vt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=l=>{const u=T.parentNode(l);if(!u||!Ui(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){const p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=gt(u)?this.mirror.getId(Bi(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);const g=Ze(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Qe(p,this.mirror)&&this.iframeManager.addIframe(p),Li(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ae(l)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(l),this.doc)},onIframeLoad:(p,y)=>{this.iframeManager.attachIframe(p,y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,y)=>{this.stylesheetManager.attachLinkElement(p,y)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Hn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(T.parentNode(l))||o(l);for(const l of this.addedSet)!Yn(this.droppedSet,l)&&!Hn(this.removesSubTreeCache,l,this.mirror)||Yn(this.movedSet,l)?o(l):this.droppedSet.add(l);let n=null;for(;r.length;){let l=null;if(n){const u=this.mirror.getId(T.parentNode(n.value)),c=i(n.value);u!==-1&&c!==-1&&(l=n)}if(!l){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(T.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{const g=c.value,p=T.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=T.host(p);if(this.mirror.getId(y)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}n=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{const u=l.node,c=T.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:u}=l;if(typeof u.style=="string"){const c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(T.childNodes(e),i=>T.textContent(i)||"").join("");t.attributes.value=pr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:mr(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!fr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=T.textContent(e.target);!oe(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:yo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Di(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);const n=t[r],a=typeof n=="boolean",l=document.contains(t),u=ri(t),c=ys(r,this.excludeAttribute);if(i===null&&!t.hasAttribute(r)&&e.oldValue!==null&&(n===""||n===null||typeof n=="undefined")){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(ys(r,this.excludeAttribute)){console.debug(`[${me()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c});return}if(r==="value"){const g=mr(t);i=pr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:g,value:i,maskInputFn:this.maskInputFn})}if(oe(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let f=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(f||(f={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(e.target,f)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!go(t.tagName,r))if(f.attributes[r]=mo(this.doc,Te(t.tagName),Te(r),i),r!=="class"&&(e.oldValue===null||i===""||i!==e.oldValue)&&console.debug(`[${me()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[i===e.oldValue?"no change in value":null,i===n?"mirrored in DOM property":null,i===f.attributes[r]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:T.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:r,value:i,oldValue:e.oldValue,transformedValue:f.attributes[r],excludeAttribute:this.excludeAttribute,propValue:n,isBooleanAttr:a,inDOM:l,isVisible:u,isExcludeAttributeName:c}),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const p=this.unattachedDoc.createElement("span");e.oldValue&&p.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const d=t.style.getPropertyValue(y),m=t.style.getPropertyPriority(y);d!==p.style.getPropertyValue(y)||m!==p.style.getPropertyPriority(y)?m===""?f.styleDiff[y]=d:f.styleDiff[y]=[d,m]:f._unchangedStyles[y]=[d,m]}for(const y of Array.from(p.style))t.style.getPropertyValue(y)===""&&(f.styleDiff[y]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(oe(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=gt(e.target)?this.mirror.getId(T.host(e.target)):this.mirror.getId(e.target);oe(e.target,this.blockClass,this.blockSelector,!1)||fr(t,this.mirror,this.slimDOMOptions)||!Za(t,this.mirror)||(this.addedSet.has(t)?(Ks(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||_i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[jn(r,i)]?Ks(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:gt(e.target)&&yt(e.target)?!0:void 0}),hp(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(fr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[jn(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);oe(e,this.blockClass,this.blockSelector,!1)||(T.childNodes(e).forEach(r=>this.genAdds(r)),Ae(e)&&T.childNodes(T.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","visibilityManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze(),this.visibilityManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.visibilityManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock(),this.visibilityManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.visibilityManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset(),this.visibilityManager.reset()}}function Ks(s,e){s.delete(e),T.childNodes(e).forEach(t=>Ks(s,t))}function hp(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),T.childNodes(r).forEach(i=>t.push(i)))}}function Hn(s,e,t){return s.size===0?!1:fp(s,e)}function fp(s,e,t){const r=T.parentNode(e);return r?s.has(r):!1}function Yn(s,e){return s.size===0?!1:qa(s,e)}function qa(s,e){const t=T.parentNode(e);return t?s.has(t)?!0:qa(s,t):!1}let wt;function dp(s){wt=s}function pp(){wt=void 0}const L=s=>wt?(...t)=>{try{return s(...t)}catch(r){if(wt&&wt(r)===!0)return;throw r}}:s,Pe=[];function at(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch(e){}return s&&s.target}function el(s,e){const t=new cp;Pe.push(t),t.init(s);const r=new(Ya())(L(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function mp({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let n=[],a;const l=ot(L(h=>{const f=Date.now()-a;s(n.map(g=>(g.timeOffset-=f,g)),h),n=[],a=null}),o),u=L(ot(L(h=>{const f=at(h),{clientX:g,clientY:p}=Rr(h)?h.changedTouches[0]:h;a||(a=me()),n.push({x:g,y:p,id:r.getId(f),timeOffset:me()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[se("mousemove",u,t),se("touchmove",u,t),se("drag",u,t)];return L(()=>{c.forEach(h=>h())})}function gp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const n=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const u=c=>h=>{const f=at(h);if(oe(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=Ce.Mouse;break;case"touch":g=Ce.Touch;break;case"pen":g=Ce.Pen;break}g===Ce.Touch?F[c]===F.MouseDown?p="TouchStart":F[c]===F.MouseUp&&(p="TouchEnd"):Ce.Pen}else Rr(h)&&(g=Ce.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===Ce.Touch||p.startsWith("Mouse")&&g===Ce.Mouse)&&(g=null)):F[c]===F.Click&&(g=l,l=null);const y=Rr(h)?h.changedTouches[0]:h;if(!y)return;const d=t.getId(f),{clientX:m,clientY:S}=y;L(s)(N({type:F[p],id:d,x:m,y:S},g!==null&&{pointerType:g}))};return Object.keys(F).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&n[c]!==!1).forEach(c=>{let h=Te(c);const f=u(c);if(window.PointerEvent)switch(F[c]){case F.MouseDown:case F.MouseUp:h=h.replace("mouse","pointer");break;case F.TouchStart:case F.TouchEnd:return}a.push(se(h,f,e))}),L(()=>{a.forEach(c=>c())})}function tl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:o}){const n=L(ot(L(a=>{const l=at(a);if(!l||oe(l,r,i,!0))return;const u=t.getId(l);if(l===e&&e.defaultView){const c=Ai(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return se("scroll",n,e)}function yp({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=L(ot(L(()=>{const o=Oi(),n=Ti();(t!==o||r!==n)&&(s({width:Number(n),height:Number(o)}),t=o,r=n)}),200));return se("resize",i,e)}const cs=["INPUT","TEXTAREA","SELECT"],Zn=new WeakMap,bp=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],Xn=new WeakMap;function wp({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:o,ignoreSelector:n,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(v){let b=at(v);const C=v.isTrusted,E=b&&b.tagName;if(b&&E==="OPTION"&&(b=T.parentElement(b)),!b||!E||cs.indexOf(E)<0||oe(b,r,i,!0)||b.classList.contains(o)||n&&b.matches(n))return;let _=b.value,A=!1;const V=mr(b)||"";V==="radio"||V==="checkbox"?A=b.checked:(a[E.toLowerCase()]||a[V])&&(_=pr({element:b,maskInputOptions:a,tagName:E,type:V,value:_,maskInputFn:l})),f(b,c?{text:_,isChecked:A,userTriggered:C}:{text:_,isChecked:A});const z=b.name;V==="radio"&&z&&A&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(J=>{if(J!==b){const Q=J.value;f(J,c?{text:Q,isChecked:!A,userTriggered:!1}:{text:Q,isChecked:!A})}})}function f(v,b){const C=Zn.get(v),E=v,_=E.hasAttribute("placeholder"),A=E.value==="",V=typeof E.defaultValue=="string"?E.defaultValue==="":!0,z=!b.userTriggered,J=!C||C.text==="",Q=_&&A&&V&&J&&z&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),te=E.tagName==="INPUT"&&E.type==="text"&&!b.userTriggered&&b.text===E.defaultValue&&!C&&E.hasAttribute("placeholder"),R=!b.userTriggered&&E.value===E.defaultValue&&!C&&E.hasAttribute("placeholder")&&!b.isChecked&&E.type!=="hidden"&&cs.includes(E.tagName),ie=E.type==="checkbox"&&!b.userTriggered&&!b.isChecked&&!C,ne=E.type==="radio"&&!b.userTriggered&&!b.isChecked&&!C;if(Q||te||R||ie||ne){console.debug(`[${me()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:T.describeNode(E),tag:E.tagName,nodeType:E.nodeType,attribute:E.attributes,value:E.value,isLikelyPhantom:Q,isRenderDrivenTextInput:te,isValueFromDefault:R,isPhantomCheckbox:ie,isPhantomRadio:ne});return}if(!C||C.text!==b.text||C.isChecked!==b.isChecked){Zn.set(v,b);const O=t.getId(v);L(s)(q(N({},b),{id:O}))}}const p=(u.input==="last"?["change"]:["input","change"]).map(v=>se(v,L(h),e)),y=v=>{const b=at(v);if(!b||!b.tagName)return;if(u.input==="all"){h(v);return}const C=b.tagName,E=v.key,_=bp.includes(E),A=C==="TEXTAREA",V=e.activeElement===b,z=b.value,J=Xn.get(b);if(Xn.set(b,z),!V){h(v);return}if(_){if(!A){h(v);return}let Q=J!=null?J:"",te=0;const R=2,ie=()=>{const ne=b.value,O=e.activeElement===b,ue=ne!==Q;if(!O){h(v);return}if(ue)te=0,Q=ne;else if(te++,te>=R){h(v);return}requestAnimationFrame(ie)};requestAnimationFrame(ie);return}};p.push(se("keydown",L(y),e));const d=e.defaultView;if(!d)return()=>{p.forEach(v=>v())};const m=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...S.map(v=>_t(v[0],v[1],{set(){L(h)({target:this,isTrusted:!1})}},!1,d))),L(()=>{p.forEach(v=>v())})}function Ar(s){const e=[];function t(r,i){if(ir("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ir("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ir("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ir("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const n=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(n)}else if(r.parentStyleSheet){const n=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(n)}return i}return t(s,e)}function Ne(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function vp({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:L((c,h,f)=>{const[g,p]=f,{id:y,styleId:d}=Ne(h,e,t.styleMirror);return(y&&y!==-1||d&&d!==-1)&&s({id:y,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){const g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let n;r.CSSStyleSheet.prototype.replace&&(n=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(n,{apply:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:L((c,h,f)=>{const[g]=f,{id:p,styleId:y}=Ne(h,e,t.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,replaceSync:g}),c.apply(h,f)})}));const l={};nr("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(nr("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),nr("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),nr("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:L((f,g,p)=>{const[y,d]=p,{id:m,styleId:S}=Ne(g.parentStyleSheet,e,t.styleMirror);return(m&&m!==-1||S&&S!==-1)&&s({id:m,styleId:S,adds:[{rule:y,index:[...Ar(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:L((f,g,p)=>{const[y]=p,{id:d,styleId:m}=Ne(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||m&&m!==-1)&&s({id:d,styleId:m,removes:[{index:[...Ar(g),y]}]}),f.apply(g,p)})})}),L(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=o,n&&(r.CSSStyleSheet.prototype.replace=n),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function rl({mirror:s,stylesheetManager:e},t){var r,i,o;let n=null;t.nodeName==="#document"?n=s.getId(t):n=s.getId(T.host(t));const a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=l.set)==null?void 0:c.call(this,u);if(n!==null&&n!==-1)try{e.adoptStyleSheets(u,n)}catch(f){}return h}}),L(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Sp({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:L((a,l,u)=>{var c;const[h,f,g]=u;if(t.has(h))return o.apply(l,[h,f,g]);const{id:p,styleId:y}=Ne((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||y&&y!==-1)&&s({id:p,styleId:y,set:{property:h,value:f,priority:g},index:Ar(l.parentRule)}),a.apply(l,u)})});const n=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(n,{apply:L((a,l,u)=>{var c;const[h]=u;if(t.has(h))return n.apply(l,[h]);const{id:f,styleId:g}=Ne((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:Ar(l.parentRule)}),a.apply(l,u)})}),L(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=n})}function Cp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:o}){const n=L(l=>ot(L(u=>{const c=at(u);if(!c||oe(c,e,t,!0))return;const{currentTime:h,volume:f,muted:g,playbackRate:p,loop:y}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:y})}),i.media||500)),a=[se("play",n(Re.Play),o),se("pause",n(Re.Pause),o),se("seeked",n(Re.Seeked),o),se("volumechange",n(Re.VolumeChange),o),se("ratechange",n(Re.RateChange),o)];return L(()=>{a.forEach(l=>l())})}function Ep({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,o=t.FontFace;t.FontFace=function(l,u,c){const h=new o(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const n=Ue(e.fonts,"add",function(a){return function(l){return setTimeout(L(()=>{const u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=o}),r.push(n),L(()=>{r.forEach(a=>a())})}function Ip(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:o}=s;let n=!0;const a=L(()=>{const l=e.getSelection();if(!l||n&&(l!=null&&l.isCollapsed))return;n=l.isCollapsed||!1;const u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){const f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:y,endOffset:d}=f;oe(g,r,i,!0)||oe(y,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(y),endOffset:d})}o({ranges:u})});return a(),se("selectionchange",a)}function xp({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ue(t.customElements,"define",function(i){return function(o,n,a){try{e({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,n,a])}})}function Mp(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:n,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,visibilityMutationCb:f,fontCb:g,selectionCb:p,customElementCb:y}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),o(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),n(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),a(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),l(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.visibilityMutationCb=(...d)=>{e.visibilityMutation&&e.visibilityMutation(...d),f(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),g(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),p(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),y(...d)}}function Np(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Mp(s,e);let r;s.recordDOM&&(r=el(s,s.doc));const i=mp(s),o=gp(s),n=tl(s),a=yp(s,{win:t}),l=wp(s),u=Cp(s);let c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=vp(s,{win:t}),h=rl(s,s.doc),f=Sp(s,{win:t}),s.collectFonts&&(g=Ep(s)));const p=Ip(s),y=xp(s),d=[];for(const m of s.plugins)d.push(m.observer(m.callback,t,m.options));return L(()=>{Pe.forEach(m=>m.reset()),r==null||r.disconnect(),i(),o(),n(),a(),l(),u(),c(),h(),f(),g(),p(),y(),d.forEach(m=>m())})}function ir(s){return typeof window[s]!="undefined"}function nr(s){return!!(typeof window[s]!="undefined"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Jn{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const o=r||this.getIdToRemoteIdMap(e),n=i||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),n.set(a,t)),a}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=i.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Rp{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new Jn(po)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Jn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const o=this.transformCrossOriginEvent(i,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case M.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:M.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case M.Meta:case M.Load:case M.DomContentLoaded:return!1;case M.Plugin:return t;case M.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case M.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(i.node,o)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const o of i)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Ee.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Ap{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!yt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=el(q(N({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(tl(q(N({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(T.host(e))),this.restoreHandlers.push(rl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Ue(e.prototype,"attachShadow",function(i){return function(o){const n=i.call(this,o),a=T.shadowRoot(this);return a&&Ui(this)&&r.addShadowRoot(a,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var or=0;or<Je.length;or++)dt[Je.charCodeAt(or)]=or;var Op=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Je[e[t]>>2],i+=Je[(e[t]&3)<<4|e[t+1]>>4],i+=Je[(e[t+1]&15)<<2|e[t+2]>>6],i+=Je[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Tp=function(s){var e=s.length*.75,t=s.length,r,i=0,o,n,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)o=dt[s.charCodeAt(r)],n=dt[s.charCodeAt(r+1)],a=dt[s.charCodeAt(r+2)],l=dt[s.charCodeAt(r+3)],c[i++]=o<<2|n>>4,c[i++]=(n&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u};const Kn=new Map;function Dp(s,e){let t=Kn.get(s);return t||(t=new Map,Kn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const sl=(s,e,t)=>{if(!s||!(nl(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Dp(t,r);let o=i.indexOf(s);return o===-1&&(o=i.length,i.push(s)),o};function dr(s,e,t){if(s instanceof Array)return s.map(r=>dr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Op(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[dr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[dr(s.data,e,t),s.width,s.height]};if(nl(s,e)||typeof s=="object"){const r=s.constructor.name,i=sl(s,e,t);return{rr_type:r,index:i}}}}return s}const il=(s,e,t)=>s.map(r=>dr(r,e,t)),nl=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function _p(s,e,t,r){const i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const n of o)try{if(typeof e.CanvasRenderingContext2D.prototype[n]!="function")continue;const a=Ue(e.CanvasRenderingContext2D.prototype,n,function(l){return function(...u){return oe(this.canvas,t,r,!0)||setTimeout(()=>{const c=il(u,e,this);s(this.canvas,{type:Me["2D"],property:n,args:c})},0),l.apply(this,u)}});i.push(a)}catch(a){const l=_t(e.CanvasRenderingContext2D.prototype,n,{set(u){s(this.canvas,{type:Me["2D"],property:n,args:[u],setter:!0})}});i.push(l)}return()=>{i.forEach(n=>n())}}function kp(s){return s==="experimental-webgl"?"webgl":s}function Qn(s,e,t,r){const i=[];try{const o=Ue(s.HTMLCanvasElement.prototype,"getContext",function(n){return function(a,...l){if(!oe(this,e,t,!0)){const u=kp(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){const c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return n.apply(this,[a,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function qn(s,e,t,r,i,o){const n=[],a=Object.getOwnPropertyNames(s);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;const u=Ue(s,l,function(c){return function(...h){const f=c.apply(this,h);if(sl(f,o,this),"tagName"in this.canvas&&!oe(this.canvas,r,i,!0)){const g=il(h,o,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});n.push(u)}catch(u){const c=_t(s,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});n.push(c)}return n}function $p(s,e,t,r){const i=[];return i.push(...qn(e.WebGLRenderingContext.prototype,Me.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext!="undefined"&&i.push(...qn(e.WebGL2RenderingContext.prototype,Me.WebGL2,s,t,r,e)),()=>{i.forEach(o=>o())}}const ol="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Lp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),eo=typeof window!="undefined"&&window.Blob&&new Blob([Lp(ol)],{type:"text/javascript;charset=utf-8"});function Pp(s){let e;try{if(e=eo&&(window.URL||window.webkitURL).createObjectURL(eo),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+ol,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Fp{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:o,recordCanvas:n,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,n&&t==="all"&&this.initCanvasMutationObserver(r,i,o),n&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){const n=Qn(t,r,i,!0),a=new Map,l=new Pp;l.onmessage=p=>{const{id:y}=p.data;if(a.set(y,!1),!("base64"in p.data))return;const{base64:d,type:m,width:S,height:v}=p.data;this.mutationCb({id:y,type:Me["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:m}]},0,0]}]})};const u=1e3/e;let c=0,h;const f=()=>{const p=[];return t.document.querySelectorAll("canvas").forEach(y=>{oe(y,r,i,!0)||p.push(y)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async y=>{var d;const m=this.mirror.getId(y);if(a.get(m)||y.width===0||y.height===0)return;if(a.set(m,!0),["webgl","webgl2"].includes(y.__context)){const v=y.getContext(y.__context);((d=v==null?void 0:v.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=await createImageBitmap(y);l.postMessage({id:m,bitmap:S,width:y.width,height:y.height,dataURLOptions:o.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{n(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Qn(e,t,r,!1),o=_p(this.processMutation.bind(this),e,t,r),n=$p(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),o(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(n=>{const u=n,{type:a}=u;return We(u,["type"])}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:i}),this.pendingCanvasMutations.delete(e)}}class Bp{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new Fi),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const o of e){let n;this.styleMirror.has(o)?n=this.styleMirror.getId(o):(n=this.styleMirror.add(o),i.push({styleId:n,rules:Array.from(o.rules||CSSRule,(a,l)=>({rule:ho(a,o.href),index:l}))})),r.styleIds.push(n)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Up{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}function Vp(s,e,t){var c,h,f,g,p,y;const r=(c=t==null?void 0:t.root)!=null?c:null,i=(h=t==null?void 0:t.threshold)!=null?h:.5,o=(f=t==null?void 0:t.sensitivity)!=null?f:.05,n=Wp((g=t==null?void 0:t.rootMargin)!=null?g:"0px"),a=new Map,l=zp(r),u=Gp(l,n);for(const d of s){const m=d.getBoundingClientRect();let S=Yp(),v=0;m.width>0&&m.height>0&&(S=jp(m,u),v=Hp(m,S),v=Math.round(v*100)/100);const b=Zp(d),C=(p=e.get(d))!=null?p:null,E=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,_=v,A=(C==null?void 0:C.isStyleVisible)&&E>i,V=b&&_>i;!C||A!==V||A!==V&&Math.abs(_-E)>o?a.set(d,{target:d,isVisible:V,isStyleVisible:b,intersectionRatio:_,intersectionRect:S,oldValue:C}):a.set(d,C)}return a}function Wp(s){const e=s.trim().split(/\s+/),t=(r,i)=>r.endsWith("%")?parseFloat(r)/100*i:parseFloat(r)||0;return function(r){const i=t(e[0]||"0px",r.height),o=t(e[1]||e[0]||"0px",r.width),n=t(e[2]||e[0]||"0px",r.height),a=t(e[3]||e[1]||e[0]||"0px",r.width);return{top:i,right:o,bottom:n,left:a,width:0,height:0}}}function zp(s){return s?s.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Gp(s,e){const t=e(s);return new DOMRect(s.left-t.left,s.top-t.top,s.width+t.left+t.right,s.height+t.top+t.bottom)}function jp(s,e){const t=Math.max(s.top,e.top),r=Math.max(s.left,e.left),i=Math.min(s.bottom,e.bottom),o=Math.min(s.right,e.right),n=Math.max(0,o-r),a=Math.max(0,i-t);return{top:t,left:r,bottom:i,right:o,width:n,height:a}}function Hp(s,e){const t=s.width*s.height,r=e.width*e.height;return t>0?r/t:0}function Yp(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function Zp(s){const e=getComputedStyle(s);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class Xp{constructor(e){var u,c,h,f,g,p;w(this,"frozen",!1),w(this,"locked",!1),w(this,"pending",new Map),w(this,"mirror"),w(this,"mutationCb"),w(this,"rafId",null),w(this,"intervalId",null),w(this,"rafThrottle"),w(this,"lastFlushTime",0),w(this,"elements",new Set),w(this,"previousState",new Map),w(this,"root",null),w(this,"threshold"),w(this,"sensitivity"),w(this,"rootMargin"),w(this,"hasInitialized",!1),w(this,"mode","none"),w(this,"debounce",50),w(this,"throttle",100),w(this,"buffer",new Map),w(this,"debounceTimer",null),w(this,"lastThrottleTime",0),w(this,"disabled",!1),w(this,"notifyActivity");const{doc:t,mirror:r,sampling:i,mutationCb:o,notifyActivity:n}=e;if(this.mirror=r,this.mutationCb=o,this.notifyActivity=n,this.rootMargin="0px",i===!1){this.disabled=!0;return}const a=typeof i=="object"&&i!==null?i:{};this.mode=(u=a==null?void 0:a.mode)!=null?u:"none",this.debounce=Number((c=a==null?void 0:a.debounce)!=null?c:100),this.throttle=Number((h=a==null?void 0:a.throttle)!=null?h:100),this.threshold=Number((f=a==null?void 0:a.threshold)!=null?f:.5),this.sensitivity=Number((g=a==null?void 0:a.sensitivity)!=null?g:.05),this.rafThrottle=Number((p=a==null?void 0:a.rafThrottle)!=null?p:50),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(d=>{d.addedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&(this.observe(m),m.querySelectorAll("*").forEach(S=>this.observe(S)))}),d.removedNodes.forEach(m=>{m.nodeType===Node.ELEMENT_NODE&&this.unobserve(m)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Vp(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,r]of e.entries()){const i=this.previousState.get(t);if(!i||i.isVisible!==r.isVisible||Math.abs(i.intersectionRatio-r.intersectionRatio)>this.sensitivity){const n=this.mirror.getId(t);n!==-1&&this.buffer.set(t,{id:n,isVisible:r.isVisible,ratio:r.intersectionRatio}),this.previousState.set(t,r)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;this.buffer.size!==0&&((e=this.notifyActivity)==null||e.call(this,this.buffer.size),this.mutationCb({mutations:Array.from(this.buffer.values())}),this.buffer.clear())}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0}unlock(){this.locked=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const Jp="2.1.3-alpha.2";let Z,pt,hs,fs,qe=!1;const Or=[];let Le;function Kp(s){return new Promise(t=>{const r=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})},i=(()=>{let o=!1;return()=>{o||(o=!0,r())}})();["interactive","complete"].includes(s.document.readyState)?i():(s.addEventListener("DOMContentLoaded",i,{once:!0}),s.addEventListener("load",i,{once:!0}),setTimeout(()=>{i()},5e3))})}try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Xi=s.contentWindow)==null?void 0:Xi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const fe=fo();function ce(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,checkoutEveryNvm:i,blockClass:o="rr-block",blockSelector:n=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,excludeAttribute:u,maskTextClass:c="rr-mask",maskTextSelector:h=null,inlineStylesheet:f=!0,maskAllInputs:g,maskInputOptions:p,slimDOMOptions:y,maskInputFn:d,maskTextFn:m,hooks:S,packFn:v,sampling:b={},dataURLOptions:C={},mousemoveWait:E,recordDOM:_=!0,recordCanvas:A=!1,recordCrossOriginIframes:V=!1,recordAfter:z=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",flushCustomEvent:J=s.flushCustomEvent!==void 0?s.flushCustomEvent:"after",userTriggeredOnInput:Q=!1,collectFonts:te=!1,inlineImages:R=!1,plugins:ie,keepIframeSrcFn:ne=()=>!1,ignoreCSSAttributes:O=new Set([]),errorHandler:ue}=s;dp(ue);const de=V?window.parent===window:!0;let ae=!1;if(!de)try{window.parent.document&&(ae=!1)}catch(k){ae=!0}if(de&&!e)throw new Error("emit function is required");if(!de&&!ae)return()=>{};E!==void 0&&b.mousemove===void 0&&(b.mousemove=E),fe.reset();const jr=u===void 0?/.^/:u,Hr=g===!0?{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,password:!0}:p!==void 0?p:{password:!0},Yr=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all",headTitleMutations:y==="all"}:y||{};ki();let Vi,Zr=0,Xr=0;const dl=k=>{Xr+=k},Wi=k=>{for(const le of ie||[])le.eventProcessor&&(k=le.eventProcessor(k));return v&&!ae&&(k=v(k)),k};Z=(k,le)=>{var K;const re=k;if(re.timestamp=me(),(K=Pe[0])!=null&&K.isFrozen()&&re.type!==M.FullSnapshot&&!(re.type===M.IncrementalSnapshot&&re.data.source===I.Mutation)&&Pe.forEach(pe=>pe.unfreeze()),de)e==null||e(Wi(re),le);else if(ae){const pe={type:"rrweb",event:Wi(re),origin:window.location.origin,isCheckout:le};window.parent.postMessage(pe,"*")}if(re.type===M.FullSnapshot)Vi=re,Zr=0;else if(re.type===M.IncrementalSnapshot){if(re.data.source===I.Mutation&&re.data.isAttachIframe)return;Zr++;const pe=r&&Zr>=r,Ve=t&&re.timestamp-Vi.timestamp>t,W=i&&Xr>=i;(pe||Ve||W)&&(W&&(Xr=0),pt(!0))}};const kt=k=>{Z({type:M.IncrementalSnapshot,data:N({source:I.Mutation},k)})},zi=k=>Z({type:M.IncrementalSnapshot,data:N({source:I.Scroll},k)}),Gi=k=>Z({type:M.IncrementalSnapshot,data:N({source:I.CanvasMutation},k)}),ji=k=>{var le;(le=S==null?void 0:S.visibilityMutation)==null||le.call(S,k),Z({type:M.IncrementalSnapshot,data:N({source:I.VisibilityMutation},k)})},pl=k=>Z({type:M.IncrementalSnapshot,data:N({source:I.AdoptedStyleSheet},k)}),ke=new Bp({mutationCb:kt,adoptedStyleSheetCb:pl}),$e=new Rp({mirror:fe,mutationCb:kt,stylesheetManager:ke,recordCrossOriginIframes:V,wrappedEmit:Z});for(const k of ie||[])k.getMirror&&k.getMirror({nodeMirror:fe,crossOriginIframeMirror:$e.crossOriginIframeMirror,crossOriginIframeStyleMirror:$e.crossOriginIframeStyleMirror});const Jr=new Up;hs=new Fp({recordCanvas:A,mutationCb:Gi,win:window,blockClass:o,blockSelector:n,mirror:fe,sampling:b.canvas,dataURLOptions:C}),fs=new Xp({doc:window.document,mirror:fe,sampling:b.visibility,mutationCb:ji,notifyActivity:dl});const $t=new Ap({mutationCb:kt,scrollCb:zi,bypassOptions:{blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskInputOptions:Hr,dataURLOptions:C,maskTextFn:m,maskInputFn:d,recordCanvas:A,inlineImages:R,sampling:b,slimDOMOptions:Yr,iframeManager:$e,stylesheetManager:ke,canvasManager:hs,visibilityManager:fs,keepIframeSrcFn:ne,processedNodeManager:Jr},mirror:fe});pt=(k=!1)=>{if(!_)return;Z({type:M.Meta,data:{href:window.location.href,width:Ti(),height:Oi()}},k),ke.reset(),$t.init(),Pe.forEach(K=>K.lock());const le=Eu(document,{mirror:fe,blockClass:o,blockSelector:n,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,inlineStylesheet:f,maskAllInputs:Hr,maskTextFn:m,maskInputFn:d,slimDOM:Yr,dataURLOptions:C,recordCanvas:A,inlineImages:R,onSerialize:K=>{Qe(K,fe)&&$e.addIframe(K),Li(K,fe)&&ke.trackLinkElement(K),Ae(K)&&$t.addShadowRoot(T.shadowRoot(K),document)},onIframeLoad:(K,re)=>{$e.attachIframe(K,re),$t.observeAttachShadow(K)},onStylesheetLoad:(K,re)=>{ke.attachLinkElement(K,re)},keepIframeSrcFn:ne});if(!le)return console.warn("Failed to snapshot the document");Z({type:M.FullSnapshot,data:{node:le,initialOffset:Ai(window)}},k),Pe.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,fe.getId(document))},Le=()=>{for(const k of Or)Z(k);Or.length=0};try{const k=[],le=pe=>{var Ve;return L(Np)({mutationCb:kt,mousemoveCb:(W,Kr)=>Z({type:M.IncrementalSnapshot,data:{source:Kr,positions:W}}),mouseInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.MouseInteraction},W)}),scrollCb:zi,viewportResizeCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.ViewportResize},W)}),inputCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.Input},W)}),mediaInteractionCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.MediaInteraction},W)}),styleSheetRuleCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.StyleSheetRule},W)}),styleDeclarationCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.StyleDeclaration},W)}),canvasMutationCb:Gi,visibilityMutationCb:ji,fontCb:W=>Z({type:M.IncrementalSnapshot,data:N({source:I.Font},W)}),selectionCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:I.Selection},W)})},customElementCb:W=>{Z({type:M.IncrementalSnapshot,data:N({source:I.CustomElement},W)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:h,excludeAttribute:jr,maskInputOptions:Hr,inlineStylesheet:f,sampling:b,recordDOM:_,recordCanvas:A,inlineImages:R,userTriggeredOnInput:Q,collectFonts:te,doc:pe,maskInputFn:d,maskTextFn:m,keepIframeSrcFn:ne,blockSelector:n,slimDOMOptions:Yr,dataURLOptions:C,mirror:fe,iframeManager:$e,stylesheetManager:ke,shadowDomManager:$t,processedNodeManager:Jr,canvasManager:hs,visibilityManager:fs,ignoreCSSAttributes:O,plugins:((Ve=ie==null?void 0:ie.filter(W=>W.observer))==null?void 0:Ve.map(W=>({observer:W.observer,options:W.options,callback:Kr=>Z({type:M.Plugin,data:{plugin:W.name,payload:Kr}})})))||[]},S)};$e.addLoadListener(pe=>{try{k.push(le(pe.contentDocument))}catch(Ve){console.warn(Ve)}});const K=()=>{J==="before"&&Le(),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()},re=async()=>{J==="before"&&Le(),z==="DOMContentStabilized"&&(console.debug(`[${me()}] [rrweb:record] \u{1F7E2} Waiting for DOM stabilization...`),await Kp(window),console.debug(`[${me()}] [rrweb:record] \u2705 DOM stabilized, starting recording`)),console.debug(`[${me()}] [rrweb:record] \u2705 Init dom and takeFullSnapshot `),pt(),k.push(le(document)),qe=!0,J==="after"&&Le()};return document.readyState==="interactive"||document.readyState==="complete"?K():(k.push(se("DOMContentLoaded",()=>{Z({type:M.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&K()})),k.push(se("load",()=>{Z({type:M.Load,data:{}}),z==="load"&&K()},window))),()=>{Le(),k.forEach(pe=>pe()),Jr.destroy(),qe=!1,pp()}}catch(k){console.warn(k)}}ce.getVersion=()=>Jp;ce.isRecording=()=>qe;ce.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${Or.length} events`),Le()};ce.addCustomEvent=(s,e)=>{const t={type:M.Custom,data:{tag:s,payload:e}};if(!qe){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${s}`),Or.push(t);return}Z(t)};ce.freezePage=()=>{Pe.forEach(s=>s.freeze())};ce.takeFullSnapshot=s=>{if(!qe)throw new Error("please take full snapshot after start recording");pt(s)};ce.mirror=fe;function al(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}const Qp=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"}));function qp(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;const t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},o=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function n(m){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(m)}const a=n(s.navigator.userAgent)?1:0;function l(m,S){this.scrollLeft=m,this.scrollTop=S}function u(m){return .5*(1-Math.cos(Math.PI*m))}function c(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(m,S){if(S==="Y")return m.clientHeight+a<m.scrollHeight;if(S==="X")return m.clientWidth+a<m.scrollWidth}function f(m,S){const v=s.getComputedStyle(m,null)["overflow"+S];return v==="auto"||v==="scroll"}function g(m){const S=h(m,"Y")&&f(m,"Y"),v=h(m,"X")&&f(m,"X");return S||v}function p(m){for(;m!==e.body&&g(m)===!1;)m=m.parentNode||m.host;return m}function y(m){const S=o();let v,b,C,E=(S-m.startTime)/r;E=E>1?1:E,v=u(E),b=m.startX+(m.x-m.startX)*v,C=m.startY+(m.y-m.startY)*v,m.method.call(m.scrollable,b,C),(b!==m.x||C!==m.y)&&s.requestAnimationFrame(y.bind(s,m))}function d(m,S,v){let b,C,E,_;const A=o();m===e.body?(b=s,C=s.scrollX||s.pageXOffset,E=s.scrollY||s.pageYOffset,_=i.scroll):(b=m,C=m.scrollLeft,E=m.scrollTop,_=l),y({scrollable:b,method:_,startTime:A,startX:C,startY:E,x:S,y:v})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const m=arguments[0].left,S=arguments[0].top;d.call(this,this,typeof m=="undefined"?this.scrollLeft:~~m,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const m=p(this),S=m.getBoundingClientRect(),v=this.getBoundingClientRect();m!==e.body?(d.call(this,m,m.scrollLeft+v.left-S.left,m.scrollTop+v.top-S.top),s.getComputedStyle(m).position!=="fixed"&&s.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):s.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class em{constructor(e=[],t){w(this,"timeOffset",0),w(this,"speed"),w(this,"actions"),w(this,"raf",null),w(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){const i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}}function to(s,e){if(s.type===M.IncrementalSnapshot&&s.data.source===I.MouseMove&&s.data.positions&&s.data.positions.length){const t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}/*! *****************************************************************************
|
|
70
70
|
Copyright (c) Microsoft Corporation.
|
|
71
71
|
|
|
72
72
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -79,7 +79,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
79
79
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
80
80
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
81
81
|
PERFORMANCE OF THIS SOFTWARE.
|
|
82
|
-
***************************************************************************** */function ro(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)n.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return n}var Ke;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ke||(Ke={}));var ll={type:"xstate.init"};function ds(s){return s===void 0?[]:[].concat(s)}function He(s){return{type:"xstate.assign",assignment:s}}function so(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Tr(s){return function(e){return s===e}}function ul(s){return typeof s=="string"?{type:s}:s}function io(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Tr(s)}}function no(s,e,t){var r=e,i=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){i=!0;var n=Object.assign({},r);return typeof o.assignment=="function"?n=o.assignment(r,t):Object.keys(o.assignment).forEach(function(a){n[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,t):o.assignment[a]}),r=n,!1}return!0}),r,i]}function cl(s,e){e===void 0&&(e={});var t=ro(no(ds(s.states[s.initial].entry).map(function(n){return so(n,e.actions)}),s.context,ll),2),r=t[0],i=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Tr(s.initial)},transition:function(n,a){var l,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,g=ul(a),p=s.states[h];if(p.on){var y=ds(p.on[g.type]);try{for(var d=function(O){var ue=typeof Symbol=="function"&&Symbol.iterator,de=ue&&O[ue],ae=0;if(de)return de.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&ae>=O.length&&(O=void 0),{value:O&&O[ae++],done:!O}}};throw new TypeError(ue?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),m=d.next();!m.done;m=d.next()){var S=m.value;if(S===void 0)return io(h,f);var v=typeof S=="string"?{target:S}:S,b=v.target,C=v.actions,E=C===void 0?[]:C,_=v.cond,A=_===void 0?function(){return!0}:_,V=b===void 0,z=b!=null?b:h,J=s.states[z];if(A(f,g)){var Q=ro(no((V?ds(E):[].concat(p.exit,E,J.entry).filter(function(O){return O})).map(function(O){return so(O,o._options.actions)}),f,g),3),te=Q[0],R=Q[1],ie=Q[2],ne=b!=null?b:h;return{value:ne,context:R,actions:te,changed:b!==h||te.length>0||ie,matches:Tr(ne)}}}}catch(O){l={error:O}}finally{try{m&&!m.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return io(h,f)}};return o}var oo=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function hl(s){var e=s.initialState,t=Ke.NotStarted,r=new Set,i={_machine:s,send:function(o){t===Ke.Running&&(e=s.transition(e,o),oo(e,ul(o)),r.forEach(function(n){return n(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:Tr(n.value)}}return t=Ke.Running,oo(e,ll),i},stop:function(){return t=Ke.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function tm(s,e){for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.type===M.Meta&&r.timestamp<=e)return s.slice(t)}return s}function rm(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){const i=cl({id:"player",context:s,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:He({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:He((o,n)=>{let a=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),q(N({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var n;const{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=o;a.clear();for(const p of l)to(p,u);const h=tm(l,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===M.IncrementalSnapshot&&c.data.source===I.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&r.emit(P.PlayBack);const g=new Array;for(const p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{const y=e(p,!1);a.addAction({doAction:()=>{y()},delay:p.delay})}t(g),r.emit(P.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:He(o=>q(N({},o),{lastPlayedEvent:null})),startLive:He({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:He((o,n)=>{const{baselineTime:a,timer:l,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;to(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,y=0;for(;y<=h;){const d=Math.floor((y+h)/2);u[d].timestamp<=c.timestamp?y=d+1:h=d-1}p===-1&&(p=y),u.splice(p,0,c)}const f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return q(N({},o),{events:u})})}});return hl(i)}function sm(s){const e=cl({id:"speed",context: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:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:He({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return hl(e)}const im=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],ao=new Map;function fl(s,e){let t=ao.get(s);return t||(t=new Map,ao.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Oe(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await Oe(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;const{rr_type:i,index:o}=r;return fl(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,n=window[i];return new n(...await Promise.all(o.map(Oe(s,e,t))))}else{if("base64"in r)return Tp(r.base64);if("src"in r){const i=s.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,s.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(Oe(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Oe(s,e,t)));return r}}function nm(s,e){try{return e===Me.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const om=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function am(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!om.includes(t))return;const r=fl(s,t);r.includes(e)||r.push(e)}async function lm({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{const o=nm(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],a=await Promise.all(s.args.map(Oe(r,o))),l=n.apply(o,a);am(o,l);const u=!1}catch(o){i(s,o)}}async function um({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){const o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const n=e.map(async l=>Promise.all(l.args.map(Oe(r,o))));(await Promise.all(n)).forEach((l,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(o,c.args)):h.apply(o,l)}catch(h){i(c,h)}})}async function Qs({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const n=i.get(s)||e,a="commands"in n?n.commands:[n];if([Me.WebGL,Me.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const u=a[l];await lm({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await um({event:s,mutations:a,target:t,imageMap:r,errorHandler:o})}catch(n){o(e,n)}}class cm{constructor(e){w(this,"mediaMap",new Map),w(this,"warn"),w(this,"service"),w(this,"speedService"),w(this,"emitter"),w(this,"getCurrentTime"),w(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(P.Start,this.start.bind(this)),this.emitter.on(P.SkipStart,this.start.bind(this)),this.emitter.on(P.Pause,this.pause.bind(this)),this.emitter.on(P.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){const o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(a=a%n),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){var g,p,y,d,m;const i=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:o===Re.Play||o!==Re.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(g=a!=null?a:i==null?void 0:i.currentTimeAtLastInteraction)!=null?g:0,lastInteractionTimeOffset:t,playbackRate:(p=n!=null?n:i==null?void 0:i.playbackRate)!=null?p:1,volume:(y=u!=null?u:i==null?void 0:i.volume)!=null?y:1,muted:(d=l!=null?l:i==null?void 0:i.muted)!=null?d:e.getAttribute("muted")===null,loop:(m=c!=null?c:i==null?void 0:i.loop)!=null?m:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:r,loop:i,volume:o,isPlaying:n}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),n&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),a=o.attributes;let l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&n&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function ar(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",a=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),n&&(a?t.showModal():t.show())}}function hm(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const fm=5*1e3,dm=al||Qp,lo="[replayer]",ps={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function uo(s){return s.type==M.IncrementalSnapshot&&(s.data.source==I.TouchMove||s.data.source==I.MouseInteraction&&s.data.type==F.TouchStart)}class pm{constructor(e,t){if(w(this,"wrapper"),w(this,"iframe"),w(this,"service"),w(this,"speedService"),w(this,"config"),w(this,"usingVirtualDom",!1),w(this,"virtualDom",new lt),w(this,"mouse"),w(this,"mouseTail",null),w(this,"tailPositions",[]),w(this,"emitter",dm()),w(this,"nextUserInteractionEvent"),w(this,"legacy_missingNodeRetryMap",{}),w(this,"cache",Cn()),w(this,"imageMap",new Map),w(this,"canvasEventMap",new Map),w(this,"mirror",fo()),w(this,"styleMirror",new Fi),w(this,"mediaManager"),w(this,"firstFullSnapshot",null),w(this,"newDocumentQueue",[]),w(this,"mousePos",null),w(this,"touchActive",null),w(this,"lastMouseDownEvent",null),w(this,"lastHoveredRootNode"),w(this,"lastSelectionData",null),w(this,"constructedStyleMutations",[]),w(this,"adoptedStyleSheets",[]),w(this,"handleResize",a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),w(this,"applyEventsSynchronously",a=>{for(const l of a){switch(l.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),w(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:u=()=>{this.emitter.emit(P.CustomEvent,a)};break;case M.Meta:u=()=>this.emitter.emit(P.Resize,{width:a.data.width,height:a.data.height});break;case M.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case M.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/fm),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(P.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(P.Finish))};let g=50;a.type===M.IncrementalSnapshot&&a.data.source===I.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(P.EventCast,a)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ps,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(P.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(P.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Qs({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===I.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===I.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Mr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],c=Nr(u.node,this.mirror,this.virtualDom.mirror);Mr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(P.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new em([],{speed:this.config.speed});this.service=rm({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(P.StateChange,{player:a})}),this.speedService=sm({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(P.StateChange,{speed:a})}),this.mediaManager=new cm({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(a=>a.type===M.Meta),n=this.service.state.context.events.find(a=>a.type===M.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(P.Resize,{width:a,height:l})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(uo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?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"))}getMetaData(){const 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}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(P.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(P.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(P.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(P.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;uo(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Cn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(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");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qp(this.iframe.contentWindow,this.iframe.contentDocument),ki(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=new Set,o=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Ch(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);const{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),i.forEach(l=>ar(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(P.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;const i=im(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,ja(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:I.StyleSheetRule,adds:i.map((n,a)=>({rule:n,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<i.length;n++)(r=o.sheet)==null||r.insertRule(i[n],n)}}attachDocumentToIframe(e,t){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,n=(a,l)=>{a.nodeName==="DIALOG"&&o.add(a),this.collectIframeAndAttachDocument(i,a);const u=r.getMeta(a);if((u==null?void 0:u.type)===Ee.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};bt(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);o.forEach(a=>ar(a))}collectIframeAndAttachDocument(e,t){if(Qe(t,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const r=new Set;let i,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(P.Start,n),this.emitter.on(P.Pause,n);const a=()=>{this.emitter.off(P.Start,n),this.emitter.off(P.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(P.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(P.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===M.IncrementalSnapshot&&t.data.source===I.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(Oe(this.imageMap,null,r)));return q(N({},o),{args:n})}));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(Oe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{args:i}))}}}applyIncremental(e,t){var r,i,o;const{data:n}=e;switch(n.source){case I.Mutation:{try{this.applyMutation(n,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case I.Drag:case I.TouchMove:case I.MouseMove:if(t){const a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,n)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=n.positions[0])==null?void 0:r.timeOffset)});break;case I.MouseInteraction:{if(n.id===-1)break;const a=new Event(Te(F[n.type])),l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);this.emitter.emit(P.MouseInteraction,{type:n.type,target:l});const{triggerFocus:u}=this.config;switch(n.type){case F.Blur:"blur"in l&&l.blur();break;case F.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:t?(n.type===F.TouchStart?this.touchActive=!0:n.type===F.TouchEnd&&(this.touchActive=!1),n.type===F.MouseDown?this.lastMouseDownEvent=[l,a]:n.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case F.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case I.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,t);break}case I.ViewportResize:this.emitter.emit(P.Resize,{width:n.width,height:n.height});break;case I.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case I.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);const l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case I.StyleSheetRule:case I.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((i=this.virtualDom.mirror.getNode(n.id))==null||i.rules.push(n)):this.applyStyleSheetMutation(n);break}case I.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:e,mutation:n})}else{const a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);Qs({event:e,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{const a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(a)}catch(a){this.warn(a)}break}case I.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case I.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,jd(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=Ga(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Ae(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});const i=N({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===Ee.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Ae(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;const y=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(f,r)){this.attachDocumentToIframe(u,f);return}const d=(v,b)=>{if(!this.usingVirtualDom){ar(v);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(v,{id:b,replayer:this})}},m=bt(u.node,{doc:y,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:m,mutation:u};return}const S=r.getMeta(f);if(S&&S.type===Ee.Element&&u.node.type===Ee.Text){const v=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(const b of v)b.nodeType===f.TEXT_NODE&&f.removeChild(b);else if(S.tagName==="style"&&v.length===1)for(const b of v)b.nodeType===f.TEXT_NODE&&!r.hasNode(b)&&(m.textContent=b.textContent,f.removeChild(b))}else if((S==null?void 0:S.type)===Ee.Document){const v=f;u.node.type===Ee.DocumentType&&((c=v.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),m.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(m,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(m,p):f.insertBefore(m,null):f.appendChild(m),d(m,u.node.id),this.usingVirtualDom&&m.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),Qe(m,this.mirror)){const v=this.mirror.getId(m),b=this.newDocumentQueue.find(C=>C.parentId===v);b&&(this.attachDocumentToIframe(b,m),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==b))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,m,u)};e.adds.forEach(u=>{a(u)});const l=Date.now();for(;o.length;){const u=Xa(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)r.getNode(c.value.parentId)?$i(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Ja(e.texts).forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Pr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const g=h.parentNode;((c=g==null?void 0:g.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&hm(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const p=r.getMeta(h),y=bt(q(N({},p),{attributes:N(N({},p.attributes),u.attributes)}),{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);const d=h.nextSibling,m=h.parentNode;if(y&&m){m.removeChild(h),m.insertBefore(y,d),r.replace(u.id,y);break}}catch(p){}if(f==="value"&&h.nodeName==="TEXTAREA"){const p=h;p.childNodes.forEach(d=>p.removeChild(d));const y=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);y&&p.appendChild(y)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&ar(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){const p=g,y=h;for(const d in p)if(p[d]===!1)y.style.removeProperty(d);else if(p[d]instanceof Array){const m=p[d];y.style.setProperty(d,m[0],m[1])}else{const m=p[d];y.style.setProperty(d,m)}}}})}applyScroll(e,t){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===Ee.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(a){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(r){}}applySelection(e){try{const t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:n,endOffset:a})=>{const l=this.mirror.getNode(i),u=this.mirror.getNode(n);if(!l||!u)return;const c=new Range;c.setStart(l,o),c.setEnd(u,a);const h=l.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===I.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===I.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,n;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:u,index:c}=Js(l);Xe(t.cssRules,u).insertRule(a,c)}else{const u=l===void 0?void 0:Math.min(l,t.cssRules.length);t==null||t.insertRule(a,u)}}catch(u){}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:u}=Js(a);Xe(t.cssRules,l).deleteRule(u||0)}else t==null||t.deleteRule(a)}catch(l){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(a){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(a){}}applyStyleDeclaration(e,t){e.set&&Xe(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Xe(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Ae(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:I.StyleSheetRule,adds:a.rules},u)}catch(h){}});const i=10;let o=0;const n=(a,l)=>{const u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Ae(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&o<i&&(setTimeout(()=>n(a,l),0+100*o),o++)};n(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){const{previousId:o,nextId:n}=i,a=o&&e[o],l=n&&e[n];if(a){const{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){const{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,o){const n=this.mirror.getNode(r);if(!n)return this.debugNodeNotFound(o,r);const a=Pi(n,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?ps:Object.assign({},ps,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==M.IncrementalSnapshot?!1:e.data.source>I.Mutation&&e.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(P.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(lo,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(lo,...e)}}const mm="2.1.3-alpha.1",{getVersion:gm}=ce,{isRecording:ym}=ce,{flushCustomEventQueue:bm}=ce,{addCustomEvent:wm}=ce,{freezePage:vm}=ce,{takeFullSnapshot:Sm}=ce;exports.EventType=M;exports.IncrementalSource=I;exports.MouseInteractions=F;exports.Replayer=pm;exports.ReplayerEvents=P;exports.addCustomEvent=wm;exports.canvasMutation=Qs;exports.flushCustomEventQueue=bm;exports.freezePage=vm;exports.getVersion=gm;exports.isRecording=ym;exports.record=ce;exports.takeFullSnapshot=Sm;exports.utils=lp;exports.version=mm;
|
|
82
|
+
***************************************************************************** */function ro(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,o=t.call(s),n=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)n.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(i)throw i.error}}return n}var Ke;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ke||(Ke={}));var ll={type:"xstate.init"};function ds(s){return s===void 0?[]:[].concat(s)}function He(s){return{type:"xstate.assign",assignment:s}}function so(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Tr(s){return function(e){return s===e}}function ul(s){return typeof s=="string"?{type:s}:s}function io(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Tr(s)}}function no(s,e,t){var r=e,i=!1;return[s.filter(function(o){if(o.type==="xstate.assign"){i=!0;var n=Object.assign({},r);return typeof o.assignment=="function"?n=o.assignment(r,t):Object.keys(o.assignment).forEach(function(a){n[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,t):o.assignment[a]}),r=n,!1}return!0}),r,i]}function cl(s,e){e===void 0&&(e={});var t=ro(no(ds(s.states[s.initial].entry).map(function(n){return so(n,e.actions)}),s.context,ll),2),r=t[0],i=t[1],o={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Tr(s.initial)},transition:function(n,a){var l,u,c=typeof n=="string"?{value:n,context:s.context}:n,h=c.value,f=c.context,g=ul(a),p=s.states[h];if(p.on){var y=ds(p.on[g.type]);try{for(var d=function(O){var ue=typeof Symbol=="function"&&Symbol.iterator,de=ue&&O[ue],ae=0;if(de)return de.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&ae>=O.length&&(O=void 0),{value:O&&O[ae++],done:!O}}};throw new TypeError(ue?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),m=d.next();!m.done;m=d.next()){var S=m.value;if(S===void 0)return io(h,f);var v=typeof S=="string"?{target:S}:S,b=v.target,C=v.actions,E=C===void 0?[]:C,_=v.cond,A=_===void 0?function(){return!0}:_,V=b===void 0,z=b!=null?b:h,J=s.states[z];if(A(f,g)){var Q=ro(no((V?ds(E):[].concat(p.exit,E,J.entry).filter(function(O){return O})).map(function(O){return so(O,o._options.actions)}),f,g),3),te=Q[0],R=Q[1],ie=Q[2],ne=b!=null?b:h;return{value:ne,context:R,actions:te,changed:b!==h||te.length>0||ie,matches:Tr(ne)}}}}catch(O){l={error:O}}finally{try{m&&!m.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return io(h,f)}};return o}var oo=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};function hl(s){var e=s.initialState,t=Ke.NotStarted,r=new Set,i={_machine:s,send:function(o){t===Ke.Running&&(e=s.transition(e,o),oo(e,ul(o)),r.forEach(function(n){return n(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var n=typeof o=="object"?o:{context:s.config.context,value:o};e={value:n.value,actions:[],context:n.context,matches:Tr(n.value)}}return t=Ke.Running,oo(e,ll),i},stop:function(){return t=Ke.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function tm(s,e){for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.type===M.Meta&&r.timestamp<=e)return s.slice(t)}return s}function rm(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){const i=cl({id:"player",context:s,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:He({lastPlayedEvent:(o,n)=>n.type==="CAST_EVENT"?n.payload.event:o.lastPlayedEvent}),recordTimeOffset:He((o,n)=>{let a=o.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),q(N({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var n;const{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=o;a.clear();for(const p of l)to(p,u);const h=tm(l,u);let f=c==null?void 0:c.timestamp;(c==null?void 0:c.type)===M.IncrementalSnapshot&&c.data.source===I.MouseMove&&(f=c.timestamp+((n=c.data.positions[0])==null?void 0:n.timeOffset)),u<(f||0)&&r.emit(P.PlayBack);const g=new Array;for(const p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{const y=e(p,!1);a.addAction({doAction:()=>{y()},delay:p.delay})}t(g),r.emit(P.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:He(o=>q(N({},o),{lastPlayedEvent:null})),startLive:He({baselineTime:(o,n)=>(o.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:He((o,n)=>{const{baselineTime:a,timer:l,events:u}=o;if(n.type==="ADD_EVENT"){const{event:c}=n.payload;to(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,y=0;for(;y<=h;){const d=Math.floor((y+h)/2);u[d].timestamp<=c.timestamp?y=d+1:h=d-1}p===-1&&(p=y),u.splice(p,0,c)}const f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return q(N({},o),{events:u})})}});return hl(i)}function sm(s){const e=cl({id:"speed",context: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:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:He({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return hl(e)}const im=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],ao=new Map;function fl(s,e){let t=ao.get(s);return t||(t=new Map,ao.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Oe(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await Oe(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;const{rr_type:i,index:o}=r;return fl(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,n=window[i];return new n(...await Promise.all(o.map(Oe(s,e,t))))}else{if("base64"in r)return Tp(r.base64);if("src"in r){const i=s.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,s.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(Oe(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Oe(s,e,t)));return r}}function nm(s,e){try{return e===Me.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch(t){return null}}const om=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function am(s,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!om.includes(t))return;const r=fl(s,t);r.includes(e)||r.push(e)}async function lm({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{const o=nm(e,t);if(!o)return;if(s.setter){o[s.property]=s.args[0];return}const n=o[s.property],a=await Promise.all(s.args.map(Oe(r,o))),l=n.apply(o,a);am(o,l);const u=!1}catch(o){i(s,o)}}async function um({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){const o=t.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const n=e.map(async l=>Promise.all(l.args.map(Oe(r,o))));(await Promise.all(n)).forEach((l,u)=>{const c=e[u];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(o,c.args)):h.apply(o,l)}catch(h){i(c,h)}})}async function Qs({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const n=i.get(s)||e,a="commands"in n?n.commands:[n];if([Me.WebGL,Me.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const u=a[l];await lm({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:o})}return}await um({event:s,mutations:a,target:t,imageMap:r,errorHandler:o})}catch(n){o(e,n)}}class cm{constructor(e){w(this,"mediaMap",new Map),w(this,"warn"),w(this,"service"),w(this,"speedService"),w(this,"emitter"),w(this,"getCurrentTime"),w(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(P.Start,this.start.bind(this)),this.emitter.on(P.SkipStart,this.start.bind(this)),this.emitter.on(P.Pause,this.pause.bind(this)),this.emitter.on(P.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){const o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,n="duration"in t&&t.duration;if(Number.isNaN(n)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+o;t.loop&&n!==!1&&(a=a%n),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){var g,p,y,d,m;const i=this.mediaMap.get(e),{type:o,playbackRate:n,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:o===Re.Play||o!==Re.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(g=a!=null?a:i==null?void 0:i.currentTimeAtLastInteraction)!=null?g:0,lastInteractionTimeOffset:t,playbackRate:(p=n!=null?n:i==null?void 0:i.playbackRate)!=null?p:1,volume:(y=u!=null?u:i==null?void 0:i.volume)!=null?y:1,muted:(d=l!=null?l:i==null?void 0:i.muted)!=null?d:e.getAttribute("muted")===null,loop:(m=c!=null?c:i==null?void 0:i.loop)!=null?m:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:r,loop:i,volume:o,isPlaying:n}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),n&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const n=this.service.state.matches("paused"),a=o.attributes;let l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&n&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function ar(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s,r=t.open,i=r&&t.matches("dialog:modal"),o=t.getAttribute("rr_open_mode"),n=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",a=o==="modal";if(!(r&&!(i&&o==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),n&&(a?t.showModal():t.show())}}function hm(s,e){if(s.nodeName!=="DIALOG"||s instanceof be)return;const t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const fm=5*1e3,dm=al||Qp,lo="[replayer]",ps={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function uo(s){return s.type==M.IncrementalSnapshot&&(s.data.source==I.TouchMove||s.data.source==I.MouseInteraction&&s.data.type==F.TouchStart)}class pm{constructor(e,t){if(w(this,"wrapper"),w(this,"iframe"),w(this,"service"),w(this,"speedService"),w(this,"config"),w(this,"usingVirtualDom",!1),w(this,"virtualDom",new lt),w(this,"mouse"),w(this,"mouseTail",null),w(this,"tailPositions",[]),w(this,"emitter",dm()),w(this,"nextUserInteractionEvent"),w(this,"legacy_missingNodeRetryMap",{}),w(this,"cache",Cn()),w(this,"imageMap",new Map),w(this,"canvasEventMap",new Map),w(this,"mirror",fo()),w(this,"styleMirror",new Fi),w(this,"mediaManager"),w(this,"firstFullSnapshot",null),w(this,"newDocumentQueue",[]),w(this,"mousePos",null),w(this,"touchActive",null),w(this,"lastMouseDownEvent",null),w(this,"lastHoveredRootNode"),w(this,"lastSelectionData",null),w(this,"constructedStyleMutations",[]),w(this,"adoptedStyleSheets",[]),w(this,"handleResize",a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),w(this,"applyEventsSynchronously",a=>{for(const l of a){switch(l.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),w(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:u=()=>{this.emitter.emit(P.CustomEvent,a)};break;case M.Meta:u=()=>this.emitter.emit(P.Resize,{width:a.data.width,height:a.data.height});break;case M.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case M.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/fm),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(P.SkipStart,f)}}};break}return()=>{u&&u();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){const f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(P.Finish))};let g=50;a.type===M.IncrementalSnapshot&&a.data.source===I.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(P.EventCast,a)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ps,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(P.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(P.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Qs({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===I.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===I.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Mr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],c=Nr(u.node,this.mirror,this.virtualDom.mirror);Mr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(P.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new em([],{speed:this.config.speed});this.service=rm({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(P.StateChange,{player:a})}),this.speedService=sm({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(P.StateChange,{speed:a})}),this.mediaManager=new cm({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(a=>a.type===M.Meta),n=this.service.state.context.events.find(a=>a.type===M.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(P.Resize,{width:a,height:l})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(uo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?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"))}getMetaData(){const 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}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(P.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(P.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(P.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(P.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;uo(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Cn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(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");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qp(this.iframe.contentWindow,this.iframe.contentDocument),ki(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=new Set,o=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Ch(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);const{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),i.forEach(l=>ar(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(P.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;const i=im(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,ja(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:I.StyleSheetRule,adds:i.map((n,a)=>({rule:n,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let n=0;n<i.length;n++)(r=o.sheet)==null||r.insertRule(i[n],n)}}attachDocumentToIframe(e,t){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,n=(a,l)=>{a.nodeName==="DIALOG"&&o.add(a),this.collectIframeAndAttachDocument(i,a);const u=r.getMeta(a);if((u==null?void 0:u.type)===Ee.Element&&(u==null?void 0:u.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};bt(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);o.forEach(a=>ar(a))}collectIframeAndAttachDocument(e,t){if(Qe(t,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const r=new Set;let i,o=this.service.state;const n=()=>{o=this.service.state};this.emitter.on(P.Start,n),this.emitter.on(P.Pause,n);const a=()=>{this.emitter.off(P.Start,n),this.emitter.off(P.Pause,n)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(P.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(P.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===M.IncrementalSnapshot&&t.data.source===I.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const n=await Promise.all(o.args.map(Oe(this.imageMap,null,r)));return q(N({},o),{args:n})}));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(Oe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,q(N({},e),{args:i}))}}}applyIncremental(e,t){var r,i,o;const{data:n}=e;switch(n.source){case I.Mutation:{try{this.applyMutation(n,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case I.Drag:case I.TouchMove:case I.MouseMove:if(t){const a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,n)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=n.positions[0])==null?void 0:r.timeOffset)});break;case I.MouseInteraction:{if(n.id===-1)break;const a=new Event(Te(F[n.type])),l=this.mirror.getNode(n.id);if(!l)return this.debugNodeNotFound(n,n.id);this.emitter.emit(P.MouseInteraction,{type:n.type,target:l});const{triggerFocus:u}=this.config;switch(n.type){case F.Blur:"blur"in l&&l.blur();break;case F.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:t?(n.type===F.TouchStart?this.touchActive=!0:n.type===F.TouchEnd&&(this.touchActive=!1),n.type===F.MouseDown?this.lastMouseDownEvent=[l,a]:n.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case F.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case I.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,t);break}case I.ViewportResize:this.emitter.emit(P.Resize,{width:n.width,height:n.height});break;case I.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case I.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);const l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:n});break}case I.StyleSheetRule:case I.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((i=this.virtualDom.mirror.getNode(n.id))==null||i.rules.push(n)):this.applyStyleSheetMutation(n);break}case I.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:e,mutation:n})}else{const a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);Qs({event:e,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{const a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(a)}catch(a){this.warn(a)}break}case I.Selection:{if(t){this.lastSelectionData=n;break}this.applySelection(n);break}case I.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,jd(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const u in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[u],h=Ga(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Ae(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});const i=N({},this.legacy_missingNodeRetryMap),o=[],n=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===Ee.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(Ae(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),n(u))return o.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;const y=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(f,r)){this.attachDocumentToIframe(u,f);return}const d=(v,b)=>{if(!this.usingVirtualDom){ar(v);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(v,{id:b,replayer:this})}},m=bt(u.node,{doc:y,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:m,mutation:u};return}const S=r.getMeta(f);if(S&&S.type===Ee.Element&&u.node.type===Ee.Text){const v=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(S.tagName==="textarea")for(const b of v)b.nodeType===f.TEXT_NODE&&f.removeChild(b);else if(S.tagName==="style"&&v.length===1)for(const b of v)b.nodeType===f.TEXT_NODE&&!r.hasNode(b)&&(m.textContent=b.textContent,f.removeChild(b))}else if((S==null?void 0:S.type)===Ee.Document){const v=f;u.node.type===Ee.DocumentType&&((c=v.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),m.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(m,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(m,p):f.insertBefore(m,null):f.appendChild(m),d(m,u.node.id),this.usingVirtualDom&&m.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),Qe(m,this.mirror)){const v=this.mirror.getId(m),b=this.newDocumentQueue.find(C=>C.parentId===v);b&&(this.attachDocumentToIframe(b,m),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==b))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,m,u)};e.adds.forEach(u=>{a(u)});const l=Date.now();for(;o.length;){const u=Xa(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(const c of u)r.getNode(c.value.parentId)?$i(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Ja(e.texts).forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);const f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=Pr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){const g=h.parentNode;((c=g==null?void 0:g.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;const h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(const f in u.attributes)if(typeof f=="string"){const g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&hm(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const p=r.getMeta(h),y=bt(q(N({},p),{attributes:N(N({},p.attributes),u.attributes)}),{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);const d=h.nextSibling,m=h.parentNode;if(y&&m){m.removeChild(h),m.insertBefore(y,d),r.replace(u.id,y);break}}catch(p){}if(f==="value"&&h.nodeName==="TEXTAREA"){const p=h;p.childNodes.forEach(d=>p.removeChild(d));const y=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);y&&p.appendChild(y)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&ar(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){const p=g,y=h;for(const d in p)if(p[d]===!1)y.style.removeProperty(d);else if(p[d]instanceof Array){const m=p[d];y.style.setProperty(d,m[0],m[1])}else{const m=p[d];y.style.setProperty(d,m)}}}})}applyScroll(e,t){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((n==null?void 0:n.type)===Ee.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(a){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(r){}}applySelection(e){try{const t=new Set,r=e.ranges.map(({start:i,startOffset:o,end:n,endOffset:a})=>{const l=this.mirror.getNode(i),u=this.mirror.getNode(n);if(!l||!u)return;const c=new Range;c.setStart(l,o),c.setEnd(u,a);const h=l.ownerDocument,f=h==null?void 0:h.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===I.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===I.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,o,n;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:u,index:c}=Js(l);Xe(t.cssRules,u).insertRule(a,c)}else{const u=l===void 0?void 0:Math.min(l,t.cssRules.length);t==null||t.insertRule(a,u)}}catch(u){}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:u}=Js(a);Xe(t.cssRules,l).deleteRule(u||0)}else t==null||t.deleteRule(a)}catch(l){}}),e.replace)try{(o=t.replace)==null||o.call(t,e.replace)}catch(a){}if(e.replaceSync)try{(n=t.replaceSync)==null||n.call(t,e.replaceSync)}catch(a){}}applyStyleDeclaration(e,t){e.set&&Xe(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Xe(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Ae(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:I.StyleSheetRule,adds:a.rules},u)}catch(h){}});const i=10;let o=0;const n=(a,l)=>{const u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Ae(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&o<i&&(setTimeout(()=>n(a,l),0+100*o),o++)};n(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){const{previousId:o,nextId:n}=i,a=o&&e[o],l=n&&e[n];if(a){const{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){const{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,o){const n=this.mirror.getNode(r);if(!n)return this.debugNodeNotFound(o,r);const a=Pi(n,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?ps:Object.assign({},ps,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),n()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==M.IncrementalSnapshot?!1:e.data.source>I.Mutation&&e.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(P.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(lo,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(lo,...e)}}const mm="2.1.3-alpha.2",{getVersion:gm}=ce,{isRecording:ym}=ce,{flushCustomEventQueue:bm}=ce,{addCustomEvent:wm}=ce,{freezePage:vm}=ce,{takeFullSnapshot:Sm}=ce;exports.EventType=M;exports.IncrementalSource=I;exports.MouseInteractions=F;exports.Replayer=pm;exports.ReplayerEvents=P;exports.addCustomEvent=wm;exports.canvasMutation=Qs;exports.flushCustomEventQueue=bm;exports.freezePage=vm;exports.getVersion=gm;exports.isRecording=ym;exports.record=ce;exports.takeFullSnapshot=Sm;exports.utils=lp;exports.version=mm;
|
|
83
83
|
if (typeof module.exports == "object" && typeof exports == "object") {
|
|
84
84
|
var __cp = (to, from, except, desc) => {
|
|
85
85
|
if ((from && typeof from === "object") || typeof from === "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsurify-testmap/rrweb",
|
|
3
|
-
"version": "2.1.3-alpha.
|
|
3
|
+
"version": "2.1.3-alpha.2",
|
|
4
4
|
"description": "record and replay the web",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepare": "npm run prepack",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"vite-plugin-dts": "^3.9.1"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@appsurify-testmap/rrdom": "^2.1.3-alpha.
|
|
84
|
-
"@appsurify-testmap/rrweb-snapshot": "^2.1.3-alpha.
|
|
85
|
-
"@appsurify-testmap/rrweb-types": "^2.1.3-alpha.
|
|
86
|
-
"@appsurify-testmap/rrweb-utils": "^2.1.3-alpha.
|
|
83
|
+
"@appsurify-testmap/rrdom": "^2.1.3-alpha.2",
|
|
84
|
+
"@appsurify-testmap/rrweb-snapshot": "^2.1.3-alpha.2",
|
|
85
|
+
"@appsurify-testmap/rrweb-types": "^2.1.3-alpha.2",
|
|
86
|
+
"@appsurify-testmap/rrweb-utils": "^2.1.3-alpha.2",
|
|
87
87
|
"@types/css-font-loading-module": "0.0.7",
|
|
88
88
|
"@xstate/fsm": "^1.4.0",
|
|
89
89
|
"base64-arraybuffer": "^1.0.1",
|