@highlight-run/rrweb 2.1.6 → 2.1.7
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/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +1 -1
- package/dist/record/rrweb-record.min.js +1 -1
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.js +1 -1
- package/dist/rrweb-all.min.js +1 -1
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.min.js +1 -1
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +5 -1
- package/lib/record/rrweb-record.js +5 -1
- package/lib/rrweb-all.js +5 -1
- package/lib/rrweb.js +5 -1
- package/package.json +3 -3
package/dist/rrweb.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var R;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(R||(R={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function Re(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function De(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(){return new Qe}function Je(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var Mt="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=Mt in i?i[Mt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function qe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var nr=1,rr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function or(){return nr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return rr.test(t)?"div":t}function et(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(sr).join(""):null}catch{return null}}function sr(e){var t=e.cssText;if(ar(e))try{t=et(e.styleSheet)||t}catch{}return t}function ar(e){return"styleSheet"in e}function lr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function cr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Se,xt,ur=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,hr=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(ur,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!dr.test(c)||hr.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(cr(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var f=m[h];f!=="."&&(f===".."?u.pop():u.push(f))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var mr=/^[^ \t\n\r\u000c]+/,pr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(pr),!(n>=t.length);){var i=r(mr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function tt(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?fr(e,r):n==="style"&&r?Ve(r,tt()):t==="object"&&n==="data"&&r?Ue(e,r):r}function Rt(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function yr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ot(e){return e.getAttribute("href")?e.sheet!==null:!0}function Lt(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function vr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,f=m===void 0?{}:m,g=t.inlineImages,b=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,T=S===void 0?!1:S,w=t.enableStrictPrivacy,C=br(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:C}:{type:R.Document,childNodes:[],rootId:C};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Tr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,maskTextClass:a,dataURLOptions:f,inlineImages:g,recordCanvas:b,keepIframeSrcFn:p,newlyAddedElement:T,enableStrictPrivacy:w,rootId:C});case e.TEXT_NODE:return Sr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:w,rootId:C});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function br(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Sr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=lr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(f),e)}s=Ve(s,tt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=qe(s))}return{type:R.Text,textContent:s||"",isStyle:u,rootId:l}}function Tr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,b=g===void 0?!1:g,p=t.enableStrictPrivacy,S=t.rootId,T=Rt(e,r,o),w=Rt(e,s,null),C=ir(e),E={},_=e.attributes.length,A=0;A<_;A++){var P=e.attributes[A];E[P.name]=kt(n,C,P.name,P.value)}if(C==="link"&&i){var B=Array.from(n.styleSheets).find(function(N){return N.href===e.href}),L=null;B&&(L=et(B)),L&&(delete E.rel,delete E.href,E._cssText=Ve(L,B.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=et(e.sheet);L&&(E._cssText=Ve(L,tt()))}if(C==="input"||C==="textarea"||C==="select"){var Q=e.value;E.type!=="radio"&&E.type!=="checkbox"&&E.type!=="submit"&&E.type!=="button"&&Q?E.value=Je({type:E.type,tagName:C,value:Q,maskInputOptions:l,maskInputFn:c}):e.checked&&(E.checked=e.checked)}if(C==="option"&&(e.selected&&!l.select?E.selected=!0:delete E.selected),C==="canvas"&&m){if(e.__context==="2d")tr(e)||(E.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var z=e.toDataURL(d.type,d.quality),te=document.createElement("canvas");te.width=e.width,te.height=e.height;var X=te.toDataURL(d.type,d.quality);z!==X&&(E.rr_dataURL=z)}}if(C==="img"&&h&&!T&&!w){Se||(Se=n.createElement("canvas"),xt=Se.getContext("2d"));var V=e,F=V.crossOrigin;V.crossOrigin="anonymous";var U=function(){try{Se.width=V.naturalWidth,Se.height=V.naturalHeight,xt.drawImage(V,0,0),E.rr_dataURL=Se.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(N))}F?E.crossOrigin=F:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?U():V.onload=U}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),b||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),T||w||C==="img"&&p){var v=e.getBoundingClientRect(),y=v.width,M=v.height;E={class:E.class,rr_width:"".concat(y,"px"),rr_height:"".concat(M,"px")},p&&(T=!0)}return C==="iframe"&&!f(E.src)&&(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:R.Element,tagName:C,attributes:E,childNodes:[],isSVG:gr(e)||void 0,needBlock:T,needMask:w,rootId:S}}function $(e){return e===void 0?"":e.toLowerCase()}function Nr(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest")||t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/))||t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,f=t.maskTextFn,g=t.maskInputFn,b=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,T=t.inlineImages,w=T===void 0?!1:T,C=t.recordCanvas,E=C===void 0?!1:C,_=t.onSerialize,A=t.onIframeLoad,P=t.iframeLoadTimeout,B=P===void 0?5e3:P,L=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,z=Q===void 0?5e3:Q,te=t.keepIframeSrcFn,X=te===void 0?function(){return!1}:te,V=t.newlyAddedElement,F=V===void 0?!1:V,U=t.enableStrictPrivacy,v=t.preserveWhiteSpace,y=v===void 0?!0:v,M=vr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:w,recordCanvas:E,keepIframeSrcFn:X,newlyAddedElement:F,enableStrictPrivacy:U});if(!M)return console.warn(e,"not serialized"),null;var N;if(r.hasNode(e)?N=r.getId(e):Nr(M,b)||!y&&M.type===R.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Oe:N=or(),N===Oe)return null;var I=Object.assign(M,{id:N});r.add(e,I),_&&_(e);var K=!s,J=U;if(I.type===R.Element){if(K=K&&!I.needBlock,J=U||!!I.needBlock||!!I.needMask,J&&I.tagName==="img"){var le=e.cloneNode();le.src="",r.add(le,I)}delete I.needBlock,delete I.needMask;var W=e.shadowRoot;W&&De(W)&&(I.isShadowHost=!0)}if((I.type===R.Document||I.type===R.Element)&&K){b.headWhitespace&&I.type===R.Element&&I.tagName==="head"&&(y=!1);for(var j={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:J},be=0,Qn=Array.from(e.childNodes);be<Qn.length;be++){var Et=Qn[be],ke=me(Et,j);ke&&I.childNodes.push(ke)}if(Ct(e)&&e.shadowRoot)for(var wt=0,Jn=Array.from(e.shadowRoot.childNodes);wt<Jn.length;wt++){var Et=Jn[wt],ke=me(Et,j);ke&&(De(e.shadowRoot)&&(ke.isShadow=!0),I.childNodes.push(ke))}}return e.parentNode&&Re(e.parentNode)&&De(e.parentNode)&&(I.isShadow=!0),I.type===R.Element&&I.tagName==="iframe"&&yr(e,function(){var de=e.contentDocument;if(de&&A){var qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});qn&&A(e,qn)}},B),I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});de&&L(e,de)}},z),Ot(e)===!1)||I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,enableStrictPrivacy:U,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X});de&&L(e,de)}},z),Ot(e)===!1)?null:I}function Er(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,f=m===void 0?!0:m,g=n.inlineImages,b=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,T=n.maskAllInputs,w=T===void 0?!1:T,C=n.maskTextFn,E=n.maskInputFn,_=n.slimDOM,A=_===void 0?!1:_,P=n.dataURLOptions,B=n.preserveWhiteSpace,L=n.onSerialize,Q=n.onIframeLoad,z=n.iframeLoadTimeout,te=n.onStylesheetLoad,X=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,F=V===void 0?function(){return!1}:V,U=n.enableStrictPrivacy,v=U===void 0?!1:U,y=w===!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}:w===!1?{password:!0}:w,M=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:y,maskTextFn:C,maskInputFn:E,slimDOMOptions:M,dataURLOptions:P,inlineImages:b,recordCanvas:S,preserveWhiteSpace:B,onSerialize:L,onIframeLoad:Q,iframeLoadTimeout:z,onStylesheetLoad:te,stylesheetLoadTimeout:X,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:v})}var At=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wr(e,t){t===void 0&&(t={});var n=1,r=1;function o(v){var y=v.match(/\n/g);y&&(n+=y.length);var M=v.lastIndexOf(`
|
|
1
|
+
var rrweb=function(q){"use strict";var R;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(R||(R={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function Re(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function De(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(){return new Qe}function Je(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var Mt="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=Mt in i?i[Mt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function qe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var nr=1,rr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function or(){return nr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return rr.test(t)?"div":t}function et(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(sr).join(""):null}catch{return null}}function sr(e){var t=e.cssText;if(ar(e))try{t=et(e.styleSheet)||t}catch{}return t}function ar(e){return"styleSheet"in e}function lr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function cr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Se,xt,ur=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,hr=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(ur,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!dr.test(c)||hr.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(cr(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var f=m[h];f!=="."&&(f===".."?u.pop():u.push(f))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var mr=/^[^ \t\n\r\u000c]+/,pr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(pr),!(n>=t.length);){var i=r(mr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function tt(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?fr(e,r):n==="style"&&r?Ve(r,tt()):t==="object"&&n==="data"&&r?Ue(e,r):r}function Rt(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function yr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ot(e){return e.getAttribute("href")?e.sheet!==null:!0}function Lt(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function vr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,f=m===void 0?{}:m,g=t.inlineImages,b=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,T=S===void 0?!1:S,w=t.enableStrictPrivacy,C=br(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:C}:{type:R.Document,childNodes:[],rootId:C};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Tr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,maskTextClass:a,dataURLOptions:f,inlineImages:g,recordCanvas:b,keepIframeSrcFn:p,newlyAddedElement:T,enableStrictPrivacy:w,rootId:C});case e.TEXT_NODE:return Sr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:w,rootId:C});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function br(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Sr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=lr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(f),e)}s=Ve(s,tt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=qe(s))}return{type:R.Text,textContent:s||"",isStyle:u,rootId:l}}function Tr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,b=g===void 0?!1:g,p=t.enableStrictPrivacy,S=t.rootId,T=Rt(e,r,o),w=Rt(e,s,null),C=ir(e),E={},_=e.attributes.length,A=0;A<_;A++){var P=e.attributes[A];E[P.name]=kt(n,C,P.name,P.value)}if(C==="link"&&i){var B=Array.from(n.styleSheets).find(function(N){return N.href===e.href}),L=null;B&&(L=et(B)),L&&(delete E.rel,delete E.href,E._cssText=Ve(L,B.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=et(e.sheet);L&&(E._cssText=Ve(L,tt()))}if(C==="input"||C==="textarea"||C==="select"){var Q=e.value;E.type!=="radio"&&E.type!=="checkbox"&&E.type!=="submit"&&E.type!=="button"&&Q?E.value=Je({type:E.type,tagName:C,value:Q,maskInputOptions:l,maskInputFn:c}):e.checked&&(E.checked=e.checked)}if(C==="option"&&(e.selected&&!l.select?E.selected=!0:delete E.selected),C==="canvas"&&m){if(e.__context==="2d")tr(e)||(E.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var z=e.toDataURL(d.type,d.quality),te=document.createElement("canvas");te.width=e.width,te.height=e.height;var X=te.toDataURL(d.type,d.quality);z!==X&&(E.rr_dataURL=z)}}if(C==="img"&&h&&!T&&!w&&!p){Se||(Se=n.createElement("canvas"),xt=Se.getContext("2d"));var V=e,F=V.crossOrigin;V.crossOrigin="anonymous";var U=function(){try{Se.width=V.naturalWidth,Se.height=V.naturalHeight,xt.drawImage(V,0,0),E.rr_dataURL=Se.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(N))}F?E.crossOrigin=F:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?U():V.onload=U}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),b||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),T||w||C==="img"&&p){var v=e.getBoundingClientRect(),y=v.width,M=v.height;E={class:E.class,rr_width:"".concat(y,"px"),rr_height:"".concat(M,"px")},p&&(T=!0)}return C==="iframe"&&!f(E.src)&&(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:R.Element,tagName:C,attributes:E,childNodes:[],isSVG:gr(e)||void 0,needBlock:T,needMask:w,rootId:S}}function $(e){return e===void 0?"":e.toLowerCase()}function Nr(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest")||t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/))||t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,f=t.maskTextFn,g=t.maskInputFn,b=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,T=t.inlineImages,w=T===void 0?!1:T,C=t.recordCanvas,E=C===void 0?!1:C,_=t.onSerialize,A=t.onIframeLoad,P=t.iframeLoadTimeout,B=P===void 0?5e3:P,L=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,z=Q===void 0?5e3:Q,te=t.keepIframeSrcFn,X=te===void 0?function(){return!1}:te,V=t.newlyAddedElement,F=V===void 0?!1:V,U=t.enableStrictPrivacy,v=t.preserveWhiteSpace,y=v===void 0?!0:v,M=vr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:w,recordCanvas:E,keepIframeSrcFn:X,newlyAddedElement:F,enableStrictPrivacy:U});if(!M)return console.warn(e,"not serialized"),null;var N;if(r.hasNode(e)?N=r.getId(e):Nr(M,b)||!y&&M.type===R.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Oe:N=or(),N===Oe)return null;var I=Object.assign(M,{id:N});r.add(e,I),_&&_(e);var K=!s,J=U;if(I.type===R.Element){if(K=K&&!I.needBlock,J=U||!!I.needBlock||!!I.needMask,J&&I.tagName==="img"){var le=e.cloneNode();le.src="",r.add(le,I)}delete I.needBlock,delete I.needMask;var W=e.shadowRoot;W&&De(W)&&(I.isShadowHost=!0)}if((I.type===R.Document||I.type===R.Element)&&K){b.headWhitespace&&I.type===R.Element&&I.tagName==="head"&&(y=!1);for(var j={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:J},be=0,Qn=Array.from(e.childNodes);be<Qn.length;be++){var Et=Qn[be],ke=me(Et,j);ke&&I.childNodes.push(ke)}if(Ct(e)&&e.shadowRoot)for(var wt=0,Jn=Array.from(e.shadowRoot.childNodes);wt<Jn.length;wt++){var Et=Jn[wt],ke=me(Et,j);ke&&(De(e.shadowRoot)&&(ke.isShadow=!0),I.childNodes.push(ke))}}return e.parentNode&&Re(e.parentNode)&&De(e.parentNode)&&(I.isShadow=!0),I.type===R.Element&&I.tagName==="iframe"&&yr(e,function(){var de=e.contentDocument;if(de&&A){var qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});qn&&A(e,qn)}},B),I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});de&&L(e,de)}},z),Ot(e)===!1)||I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,enableStrictPrivacy:U,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X});de&&L(e,de)}},z),Ot(e)===!1)?null:I}function Er(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,f=m===void 0?!0:m,g=n.inlineImages,b=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,T=n.maskAllInputs,w=T===void 0?!1:T,C=n.maskTextFn,E=n.maskInputFn,_=n.slimDOM,A=_===void 0?!1:_,P=n.dataURLOptions,B=n.preserveWhiteSpace,L=n.onSerialize,Q=n.onIframeLoad,z=n.iframeLoadTimeout,te=n.onStylesheetLoad,X=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,F=V===void 0?function(){return!1}:V,U=n.enableStrictPrivacy,v=U===void 0?!1:U,y=w===!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}:w===!1?{password:!0}:w,M=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:y,maskTextFn:C,maskInputFn:E,slimDOMOptions:M,dataURLOptions:P,inlineImages:b,recordCanvas:S,preserveWhiteSpace:B,onSerialize:L,onIframeLoad:Q,iframeLoadTimeout:z,onStylesheetLoad:te,stylesheetLoadTimeout:X,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:v})}var At=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wr(e,t){t===void 0&&(t={});var n=1,r=1;function o(v){var y=v.match(/\n/g);y&&(n+=y.length);var M=v.lastIndexOf(`
|
|
2
2
|
`);r=M===-1?r+v.length:v.length-M}function i(){var v={line:n,column:r};return function(y){return y.position=new a(v),f(),y}}var a=function(){function v(y){this.start=y,this.end={line:n,column:r},this.source=t.source}return v}();a.prototype.content=e;var l=[];function c(v){var y=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(v));if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,t.silent)l.push(y);else throw y}function s(){var v=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:v,parsingErrors:l}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var v,y=[];for(f(),g(y);e.length&&e.charAt(0)!=="}"&&(v=F()||U());)v!==!1&&(y.push(v),g(y));return y}function m(v){var y=v.exec(e);if(y){var M=y[0];return o(M),e=e.slice(M.length),y}}function f(){m(/^\s*/)}function g(v){v===void 0&&(v=[]);for(var y;y=b();)y!==!1&&v.push(y),y=b();return v}function b(){var v=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var y=2;e.charAt(y)!==""&&(e.charAt(y)!=="*"||e.charAt(y+1)!=="/");)++y;if(y+=2,e.charAt(y-1)==="")return c("End of comment missing");var M=e.slice(2,y-2);return r+=2,o(M),e=e.slice(y),r+=2,v({type:"comment",comment:M})}}function p(){var v=m(/^([^{]+)/);if(v)return ce(v[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(y){return y.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(y){return y.replace(/\u200C/g,",")})}function S(){var v=i(),y=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(y){var M=ce(y[0]);if(!m(/^:\s*/))return c("property missing ':'");var N=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),I=v({type:"declaration",property:M.replace(At,""),value:N?ce(N[0]).replace(At,""):""});return m(/^[;\s]*/),I}}function T(){var v=[];if(!u())return c("missing '{'");g(v);for(var y;y=S();)y!==!1&&(v.push(y),g(v)),y=S();return d()?v:c("missing '}'")}function w(){for(var v,y=[],M=i();v=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)y.push(v[1]),m(/^,\s*/);if(y.length)return M({type:"keyframe",values:y,declarations:T()})}function C(){var v=i(),y=m(/^@([-\w]+)?keyframes\s*/);if(y){var M=y[1];if(y=m(/^([-\w]+)\s*/),!y)return c("@keyframes missing name");var N=y[1];if(!u())return c("@keyframes missing '{'");for(var I,K=g();I=w();)K.push(I),K=K.concat(g());return d()?v({type:"keyframes",name:N,vendor:M,keyframes:K}):c("@keyframes missing '}'")}}function E(){var v=i(),y=m(/^@supports *([^{]+)/);if(y){var M=ce(y[1]);if(!u())return c("@supports missing '{'");var N=g().concat(h());return d()?v({type:"supports",supports:M,rules:N}):c("@supports missing '}'")}}function _(){var v=i(),y=m(/^@host\s*/);if(y){if(!u())return c("@host missing '{'");var M=g().concat(h());return d()?v({type:"host",rules:M}):c("@host missing '}'")}}function A(){var v=i(),y=m(/^@media *([^{]+)/);if(y){var M=ce(y[1]);if(!u())return c("@media missing '{'");var N=g().concat(h());return d()?v({type:"media",media:M,rules:N}):c("@media missing '}'")}}function P(){var v=i(),y=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(y)return v({type:"custom-media",name:ce(y[1]),media:ce(y[2])})}function B(){var v=i(),y=m(/^@page */);if(y){var M=p()||[];if(!u())return c("@page missing '{'");for(var N=g(),I;I=S();)N.push(I),N=N.concat(g());return d()?v({type:"page",selectors:M,declarations:N}):c("@page missing '}'")}}function L(){var v=i(),y=m(/^@([-\w]+)?document *([^{]+)/);if(y){var M=ce(y[1]),N=ce(y[2]);if(!u())return c("@document missing '{'");var I=g().concat(h());return d()?v({type:"document",document:N,vendor:M,rules:I}):c("@document missing '}'")}}function Q(){var v=i(),y=m(/^@font-face\s*/);if(y){if(!u())return c("@font-face missing '{'");for(var M=g(),N;N=S();)M.push(N),M=M.concat(g());return d()?v({type:"font-face",declarations:M}):c("@font-face missing '}'")}}var z=V("import"),te=V("charset"),X=V("namespace");function V(v){var y=new RegExp("^@"+v+"\\s*([^;]+);");return function(){var M=i(),N=m(y);if(N){var I={type:v};return I[v]=N[1].trim(),M(I)}}}function F(){if(e[0]==="@")return C()||A()||P()||E()||z()||te()||X()||L()||B()||_()||Q()}function U(){var v=i(),y=p();return y?(g(),v({type:"rule",selectors:y,declarations:T()})):c("selector missing")}return nt(s())}function ce(e){return e?e.replace(/^\s+|\s+$/g,""):""}function nt(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];Array.isArray(l)?l.forEach(function(c){nt(c,r)}):l&&typeof l=="object"&&nt(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Pt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Cr(e){var t=Pt[e.tagName]?Pt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ft=/([^\\]):hover/,Mr=new RegExp(Ft.source,"g");function _t(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=wr(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(s){Ft.test(s)&&i.push(s)})}),i.length===0)return e;var a=new RegExp(i.filter(function(c,s){return i.indexOf(c)===s}).sort(function(c,s){return s.length-c.length}).map(function(c){return Ir(c)}).join("|"),"g"),l=e.replace(a,function(c){var s=c.replace(Mr,"$1.\\:hover");return"".concat(c,", ").concat(s)});return t?.stylesWithHoverClass.set(e,l),l}function Wt(){var e=new Map;return{stylesWithHoverClass:e}}function xr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case R.Document:return n.implementation.createDocument(null,"",null);case R.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case R.Element:{var i=Cr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):a=n.createElement(i);var l=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var P=a.getContext("2d");P&&P.drawImage(m,0,0,m.width,m.height)},m.src=h,a.RRNodeType&&(a.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var f=a;f.currentSrc.startsWith("data:")||(f.setAttribute("rrweb-original-src",e.attributes.src),f.src=h,f.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(P){return console.warn("media playback error",P)});break;case"paused":a.pause();break}}else{var g=i==="textarea"&&d==="value",b=i==="style"&&d==="_cssText";if(b&&r&&(h=_t(h,o),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,T=[],w="https://replay-cors-proxy.highlightrun.workers.dev";(S=p.exec(h))!==null;)S.index===p.lastIndex&&p.lastIndex++,S.forEach(function(P,B){if(B===0){var L=P.slice(5,P.length-2);T.push({originalUrl:L,proxyUrl:L.replace(L,"".concat(w,"?url=").concat(L))})}});T.forEach(function(P){h=h.replace(P.originalUrl,P.proxyUrl)})}if(g||b){for(var C=n.createTextNode(h),E=0,_=Array.from(a.childNodes);E<_.length;E++){var A=_[E];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(C),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(i==="img"){var s=a;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case R.Text:return n.createTextNode(e.isStyle&&r?_t(e.textContent,o):e.textContent);case R.CDATA:return n.createCDATASection(e.textContent);case R.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,s=t.cache,u=xr(e,{doc:n,hackCss:l,cache:s});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===R.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==R.DocumentType&&(e.childNodes[0].type===R.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===R.Document||e.type===R.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],f=je(m,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:s});if(!f){console.warn("Failed to rebuild",m);continue}m.isShadow&&Ct(u)&&u.shadowRoot?u.shadowRoot.appendChild(f):u.appendChild(f),c&&c(f)}return u}function kr(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function Rr(e,t){var n=t.getMeta(e);if(n?.type===R.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function Dr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,s=c===void 0?new Qe:c,u=je(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:l});return kr(s,function(d){r&&r(d),Rr(d,s)}),u}function ee(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Te=`Please stop import mirror directly. Instead of that,\r
|
|
3
3
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
4
|
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Te),-1},getNode(){return console.error(Te),null},removeNodeFromMap(){console.error(Te)},has(){return console.error(Te),!1},reset(){console.error(Te)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,n){return t==="map"&&console.error(Te),Reflect.get(e,t,n)}}));function Ne(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Le(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Le(e,t,i||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function rt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const $t=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ge(r,t,n))return!0;return!1}function Vt(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Oe}function it(e,t){if(Re(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?it(e.parentNode,t):!0:!0}function st(e){return Boolean(e.changedTouches)}function at(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ut(e){const t={},n=(o,i)=>{const a={value:o,parent:i,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:i,parentId:a}=o;if(i&&i in t){const l=t[i];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function lt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)lt(e.children[n],t)}function Ee(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ct(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ut(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=ut(o,t),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function we(e,t){const n=e[t[0]];return t.length===1?n:we(n.cssRules[t[1]].cssRules,t.slice(2))}function dt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Gt(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var Or=Object.freeze({__proto__:null,on:ee,get _mirror(){return q.mirror},throttle:Ne,hookSetter:Le,patch:pe,getWindowHeight:rt,getWindowWidth:ot,isCanvasNode:$t,isBlocked:ne,isSerialized:Vt,isIgnored:Be,isAncestorRemoved:it,isTouchEvent:st,polyfill:at,queueToResolveTrees:Ut,iterateResolveTree:lt,isSerializedIframe:Ee,isSerializedStylesheet:ct,getBaseDimension:ut,hasShadowRoot:Ae,getNestedRule:we,getPositionsAndIndex:dt,uniqueTextMutations:Gt}),x=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(x||{}),k=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(k||{}),H=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(H||{}),ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ue||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function jt(e){return"__ln"in e}class Lr{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&jt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&jt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Bt=(e,t)=>`${e}@${t}`;class Ar{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Lr,r=l=>{let c=l,s=Oe;for(;s===Oe;)c=c&&c.nextSibling,s=c&&this.mirror.getId(c);return s},o=l=>{var c,s,u,d,h;const m=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let f=m;for(;(u=(s=f?.getRootNode)==null?void 0:s.call(f))!=null&&u.host;)f=((h=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:h.host)||null;const g=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||g)return;const b=Re(l.parentNode)?this.mirror.getId(m):this.mirror.getId(l.parentNode),p=r(l);if(b===-1||p===-1)return n.addNode(l);const S=me(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{Ee(T,this.mirror)&&this.iframeManager.addIframe(T),ct(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(T,w)=>{this.iframeManager.attachIframe(T,w,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,w)=>{this.stylesheetManager.attachStylesheet(T,w,this.mirror)}});S&&t.push({parentId:b,nextId:p,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))zt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!Ht(this.droppedSet,l)&&!zt(this.removes,l,this.mirror)||Ht(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const c=this.mirror.getId(i.value.parentNode),s=r(i.value);c!==-1&&s!==-1&&(l=i)}if(!l)for(let c=n.length-1;c>=0;c--){const s=n.get(c);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){l=s;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=qe(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:Dt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Je({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),s=n.style.getPropertyPriority(l);(c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l))&&(s===""?a[l]=c:a[l]=[c,s])}for(const l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=kt(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=Re(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!Vt(n,this.mirror)||(this.addedSet.has(n)?(ht(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||it(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Bt(r,o)]?ht(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Re(t.target)&&De(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ht(e,t){e.delete(t),t.childNodes.forEach(n=>ht(e,n))}function zt(e,t,n){return e.length===0?!1:Yt(e,t,n)}function Yt(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(i=>i.id===o)?!0:Yt(e,r,n)}function Ht(e,t){return e.size===0?!1:Xt(e,t)}function Xt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Xt(e,n):!1}var Pr=Object.defineProperty,Fr=Object.defineProperties,_r=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Kt=(e,t,n)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qt=(e,t)=>{for(var n in t||(t={}))Wr.call(t,n)&&Kt(e,n,t[n]);if(Zt)for(var n of Zt(t))$r.call(t,n)&&Kt(e,n,t[n]);return e},Vr=(e,t)=>Fr(e,_r(t));const ge=[],Jt=typeof CSSGroupingRule<"u",qt=typeof CSSMediaRule<"u",en=typeof CSSSupportsRule<"u",tn=typeof CSSConditionRule<"u";function Pe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function nn(e,t){var n,r;const o=new Ar;ge.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Ur({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Ne(d=>{const h=Date.now()-l;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],l=null},i),s=Ne(d=>{const h=Pe(d),{clientX:m,clientY:f}=st(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:m,y:f,id:r.getId(h),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?k.Drag:d instanceof MouseEvent?k.MouseMove:k.TouchMove)},o,{trailing:!1}),u=[ee("mousemove",s,n),ee("touchmove",s,n),ee("drag",s,n)];return()=>{u.forEach(d=>d())}}function Gr({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>s=>{const u=Pe(s);if(ne(u,r,!0)||$t(u))return;const d=st(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:f}=d;e({type:H[c],id:h,x:m,y:f})};return Object.keys(H).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{const s=c.toLowerCase(),u=l(c);a.push(ee(s,u,t))}),()=>{a.forEach(c=>c())}}function rn({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const i=Ne(a=>{const l=Pe(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const s=t.scrollingElement||t.documentElement;e({id:c,x:s.scrollLeft,y:s.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return ee("scroll",i,t)}function jr({viewportResizeCb:e}){let t=-1,n=-1;const r=Ne(()=>{const o=rt(),i=ot();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return ee("resize",r,window)}function on(e,t){const n=Qt({},e);return t||delete n.userTriggered,n}const Br=["INPUT","TEXTAREA","SELECT"],sn=new WeakMap;function zr({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function s(f){let g=Pe(f);const b=f.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||Br.indexOf(g.tagName)<0||ne(g,r,!0))return;const p=g.type;if(g.classList.contains(o))return;let S=g.value,T=!1;p==="radio"||p==="checkbox"?T=g.checked:(i[g.tagName.toLowerCase()]||i[p])&&(S=Je({maskInputOptions:i,tagName:g.tagName,type:p,value:S,maskInputFn:a})),u(g,on({text:S,isChecked:T,userTriggered:b},c));const w=g.name;p==="radio"&&w&&T&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(C=>{C!==g&&u(C,on({text:C.value,isChecked:!T,userTriggered:!1},c))})}function u(f,g){const b=sn.get(f);if(!b||b.text!==g.text||b.isChecked!==g.isChecked){sn.set(f,g);const p=n.getId(f);e(Vr(Qt({},g),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(f=>ee(f,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(f=>Le(f[0],f[1],{set(){s({target:this})}}))),()=>{d.forEach(f=>f())}}function ze(e){const t=[];function n(r,o){if(Jt&&r.parentRule instanceof CSSGroupingRule||qt&&r.parentRule instanceof CSSMediaRule||en&&r.parentRule instanceof CSSSupportsRule||tn&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Yr({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:l,index:c}]}),r.apply(this,[l,c])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,[l])};const i={};Jt?i.CSSGroupingRule=n.CSSGroupingRule:(qt&&(i.CSSMediaRule=n.CSSMediaRule),tn&&(i.CSSConditionRule=n.CSSConditionRule),en&&(i.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(i).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ze(this),u||0]}]}),a[l].insertRule.apply(this,[s,u])},c.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ze(this),s]}]}),a[l].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Hr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,a,l){var c,s;const u=t.getId((s=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:a,priority:l},index:ze(this.parentRule)}),r.apply(this,[i,a,l])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:i},index:ze(this.parentRule)}),o.apply(this,[i])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Xr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Ne(l=>{const c=Pe(l);if(!c||ne(c,t,!0))return;const{currentTime:s,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:s,volume:u,muted:d})},r.media||500),i=[ee("play",o(fe.Play)),ee("pause",o(fe.Pause)),ee("seeked",o(fe.Seeked)),ee("volumechange",o(fe.VolumeChange))];return()=>{i.forEach(a=>a())}}function Zr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,s){const u=new i(l,c,s);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:s,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const s=o.get(c);s&&(e(s),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(l=>l())}}function Kr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),c(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Qr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Kr(e,t);const r=nn(e,e.doc),o=Ur(e),i=Gr(e),a=rn(e),l=jr(e),c=zr(e),s=Xr(e),u=Yr(e,{win:n}),d=Hr(e,{win:n}),h=e.collectFonts?Zr(e):()=>{},m=[];for(const f of e.plugins)m.push(f.observer(f.callback,n,f.options));return()=>{ge.forEach(f=>f.reset()),r.disconnect(),o(),i(),a(),l(),c(),s(),u(),d(),h(),m.forEach(f=>f())}}class Jr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var qr=Object.defineProperty,eo=Object.defineProperties,to=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,ln=(e,t,n)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cn=(e,t)=>{for(var n in t||(t={}))no.call(t,n)&&ln(e,n,t[n]);if(an)for(var n of an(t))ro.call(t,n)&&ln(e,n,t[n]);return e},un=(e,t)=>eo(e,to(t));class oo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){!De(t)||(nn(un(cn({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),rn(un(cn({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fe=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ye=0;Ye<Ce.length;Ye++)Fe[Ce.charCodeAt(Ye)]=Ye;var io=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Ce[t[n]>>2],o+=Ce[(t[n]&3)<<4|t[n+1]>>4],o+=Ce[(t[n+1]&15)<<2|t[n+2]>>6],o+=Ce[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},so=function(e){var t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=Fe[e.charCodeAt(r)],a=Fe[e.charCodeAt(r+1)],l=Fe[e.charCodeAt(r+2)],c=Fe[e.charCodeAt(r+3)],u[o++]=i<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return s};const dn=new Map;function ao(e,t){let n=dn.get(e);return n||(n=new Map,dn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const hn=(e,t,n)=>{if(!e||!(pn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=ao(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function He(e,t,n){if(e instanceof Array)return e.map(r=>He(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=io(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]};if(pn(e,t)||typeof e=="object"){const r=e.constructor.name,o=hn(e,t,n);return{rr_type:r,index:o}}}}return e}const mn=(e,t,n)=>[...e].map(r=>He(r,t,n)),pn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function lo(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=mn([...s],t,this);e(this.canvas,{type:ue["2D"],property:a,args:u})},0),c.apply(this,s)}});o.push(l)}catch{const c=Le(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:ue["2D"],property:a,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function fn(e,t){const n=[];try{const r=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...a){return ne(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function gn(e,t,n,r,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const s=pe(e,c,function(u){return function(...d){const h=u.apply(this,d);if(hn(h,i,e),!ne(this.canvas,r,!0)){const m=mn([...d],i,e),f={type:t,property:c,args:m};n(this.canvas,f)}return h}});a.push(s)}catch{const u=Le(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function co(e,t,n,r){const o=[];return o.push(...gn(t.WebGLRenderingContext.prototype,ue.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...gn(t.WebGL2RenderingContext.prototype,ue.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}function uo(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function ho(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=uo(e,o),a=i.indexOf(`
|
package/dist/rrweb.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var R;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(R||(R={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function Re(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function De(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(){return new Qe}function Je(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var Mt="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=Mt in i?i[Mt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function qe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var nr=1,rr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function or(){return nr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return rr.test(t)?"div":t}function et(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(sr).join(""):null}catch{return null}}function sr(e){var t=e.cssText;if(ar(e))try{t=et(e.styleSheet)||t}catch{}return t}function ar(e){return"styleSheet"in e}function lr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function cr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Se,xt,ur=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,hr=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(ur,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!dr.test(c)||hr.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(cr(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var f=m[h];f!=="."&&(f===".."?u.pop():u.push(f))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var mr=/^[^ \t\n\r\u000c]+/,pr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(pr),!(n>=t.length);){var i=r(mr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function tt(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?fr(e,r):n==="style"&&r?Ve(r,tt()):t==="object"&&n==="data"&&r?Ue(e,r):r}function Rt(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function yr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ot(e){return e.getAttribute("href")?e.sheet!==null:!0}function Lt(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function vr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,f=m===void 0?{}:m,g=t.inlineImages,b=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,T=S===void 0?!1:S,w=t.enableStrictPrivacy,C=br(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:C}:{type:R.Document,childNodes:[],rootId:C};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Tr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,maskTextClass:a,dataURLOptions:f,inlineImages:g,recordCanvas:b,keepIframeSrcFn:p,newlyAddedElement:T,enableStrictPrivacy:w,rootId:C});case e.TEXT_NODE:return Sr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:w,rootId:C});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function br(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Sr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=lr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(f),e)}s=Ve(s,tt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=qe(s))}return{type:R.Text,textContent:s||"",isStyle:u,rootId:l}}function Tr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,b=g===void 0?!1:g,p=t.enableStrictPrivacy,S=t.rootId,T=Rt(e,r,o),w=Rt(e,s,null),C=ir(e),E={},_=e.attributes.length,A=0;A<_;A++){var P=e.attributes[A];E[P.name]=kt(n,C,P.name,P.value)}if(C==="link"&&i){var B=Array.from(n.styleSheets).find(function(N){return N.href===e.href}),L=null;B&&(L=et(B)),L&&(delete E.rel,delete E.href,E._cssText=Ve(L,B.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=et(e.sheet);L&&(E._cssText=Ve(L,tt()))}if(C==="input"||C==="textarea"||C==="select"){var Q=e.value;E.type!=="radio"&&E.type!=="checkbox"&&E.type!=="submit"&&E.type!=="button"&&Q?E.value=Je({type:E.type,tagName:C,value:Q,maskInputOptions:l,maskInputFn:c}):e.checked&&(E.checked=e.checked)}if(C==="option"&&(e.selected&&!l.select?E.selected=!0:delete E.selected),C==="canvas"&&m){if(e.__context==="2d")tr(e)||(E.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var z=e.toDataURL(d.type,d.quality),te=document.createElement("canvas");te.width=e.width,te.height=e.height;var X=te.toDataURL(d.type,d.quality);z!==X&&(E.rr_dataURL=z)}}if(C==="img"&&h&&!T&&!w){Se||(Se=n.createElement("canvas"),xt=Se.getContext("2d"));var V=e,F=V.crossOrigin;V.crossOrigin="anonymous";var U=function(){try{Se.width=V.naturalWidth,Se.height=V.naturalHeight,xt.drawImage(V,0,0),E.rr_dataURL=Se.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(N))}F?E.crossOrigin=F:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?U():V.onload=U}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),b||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),T||w||C==="img"&&p){var v=e.getBoundingClientRect(),y=v.width,M=v.height;E={class:E.class,rr_width:"".concat(y,"px"),rr_height:"".concat(M,"px")},p&&(T=!0)}return C==="iframe"&&!f(E.src)&&(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:R.Element,tagName:C,attributes:E,childNodes:[],isSVG:gr(e)||void 0,needBlock:T,needMask:w,rootId:S}}function $(e){return e===void 0?"":e.toLowerCase()}function Nr(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest")||t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/))||t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,f=t.maskTextFn,g=t.maskInputFn,b=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,T=t.inlineImages,w=T===void 0?!1:T,C=t.recordCanvas,E=C===void 0?!1:C,_=t.onSerialize,A=t.onIframeLoad,P=t.iframeLoadTimeout,B=P===void 0?5e3:P,L=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,z=Q===void 0?5e3:Q,te=t.keepIframeSrcFn,X=te===void 0?function(){return!1}:te,V=t.newlyAddedElement,F=V===void 0?!1:V,U=t.enableStrictPrivacy,v=t.preserveWhiteSpace,y=v===void 0?!0:v,M=vr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:w,recordCanvas:E,keepIframeSrcFn:X,newlyAddedElement:F,enableStrictPrivacy:U});if(!M)return console.warn(e,"not serialized"),null;var N;if(r.hasNode(e)?N=r.getId(e):Nr(M,b)||!y&&M.type===R.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Oe:N=or(),N===Oe)return null;var I=Object.assign(M,{id:N});r.add(e,I),_&&_(e);var K=!s,J=U;if(I.type===R.Element){if(K=K&&!I.needBlock,J=U||!!I.needBlock||!!I.needMask,J&&I.tagName==="img"){var le=e.cloneNode();le.src="",r.add(le,I)}delete I.needBlock,delete I.needMask;var W=e.shadowRoot;W&&De(W)&&(I.isShadowHost=!0)}if((I.type===R.Document||I.type===R.Element)&&K){b.headWhitespace&&I.type===R.Element&&I.tagName==="head"&&(y=!1);for(var j={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:J},be=0,Qn=Array.from(e.childNodes);be<Qn.length;be++){var Et=Qn[be],ke=me(Et,j);ke&&I.childNodes.push(ke)}if(Ct(e)&&e.shadowRoot)for(var wt=0,Jn=Array.from(e.shadowRoot.childNodes);wt<Jn.length;wt++){var Et=Jn[wt],ke=me(Et,j);ke&&(De(e.shadowRoot)&&(ke.isShadow=!0),I.childNodes.push(ke))}}return e.parentNode&&Re(e.parentNode)&&De(e.parentNode)&&(I.isShadow=!0),I.type===R.Element&&I.tagName==="iframe"&&yr(e,function(){var de=e.contentDocument;if(de&&A){var qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});qn&&A(e,qn)}},B),I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});de&&L(e,de)}},z),Ot(e)===!1)||I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,enableStrictPrivacy:U,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X});de&&L(e,de)}},z),Ot(e)===!1)?null:I}function Er(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,f=m===void 0?!0:m,g=n.inlineImages,b=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,T=n.maskAllInputs,w=T===void 0?!1:T,C=n.maskTextFn,E=n.maskInputFn,_=n.slimDOM,A=_===void 0?!1:_,P=n.dataURLOptions,B=n.preserveWhiteSpace,L=n.onSerialize,Q=n.onIframeLoad,z=n.iframeLoadTimeout,te=n.onStylesheetLoad,X=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,F=V===void 0?function(){return!1}:V,U=n.enableStrictPrivacy,v=U===void 0?!1:U,y=w===!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}:w===!1?{password:!0}:w,M=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:y,maskTextFn:C,maskInputFn:E,slimDOMOptions:M,dataURLOptions:P,inlineImages:b,recordCanvas:S,preserveWhiteSpace:B,onSerialize:L,onIframeLoad:Q,iframeLoadTimeout:z,onStylesheetLoad:te,stylesheetLoadTimeout:X,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:v})}var At=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wr(e,t){t===void 0&&(t={});var n=1,r=1;function o(v){var y=v.match(/\n/g);y&&(n+=y.length);var M=v.lastIndexOf(`
|
|
1
|
+
var rrweb=function(q){"use strict";var R;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(R||(R={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function Re(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function De(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(){return new Qe}function Je(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var Mt="__rrweb_original__";function tr(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=Mt in i?i[Mt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function qe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var nr=1,rr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function or(){return nr++}function ir(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return rr.test(t)?"div":t}function et(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(sr).join(""):null}catch{return null}}function sr(e){var t=e.cssText;if(ar(e))try{t=et(e.styleSheet)||t}catch{}return t}function ar(e){return"styleSheet"in e}function lr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function cr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Se,xt,ur=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,hr=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(ur,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!dr.test(c)||hr.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(cr(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var f=m[h];f!=="."&&(f===".."?u.pop():u.push(f))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var mr=/^[^ \t\n\r\u000c]+/,pr=/^[, \t\n\r\u000c]+/;function fr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(pr),!(n>=t.length);){var i=r(mr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function gr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function tt(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?fr(e,r):n==="style"&&r?Ve(r,tt()):t==="object"&&n==="data"&&r?Ue(e,r):r}function Rt(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function yr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ot(e){return e.getAttribute("href")?e.sheet!==null:!0}function Lt(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function vr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,f=m===void 0?{}:m,g=t.inlineImages,b=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,T=S===void 0?!1:S,w=t.enableStrictPrivacy,C=br(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:C}:{type:R.Document,childNodes:[],rootId:C};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Tr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,maskTextClass:a,dataURLOptions:f,inlineImages:g,recordCanvas:b,keepIframeSrcFn:p,newlyAddedElement:T,enableStrictPrivacy:w,rootId:C});case e.TEXT_NODE:return Sr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:w,rootId:C});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function br(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Sr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=lr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(f),e)}s=Ve(s,tt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=qe(s))}return{type:R.Text,textContent:s||"",isStyle:u,rootId:l}}function Tr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,b=g===void 0?!1:g,p=t.enableStrictPrivacy,S=t.rootId,T=Rt(e,r,o),w=Rt(e,s,null),C=ir(e),E={},_=e.attributes.length,A=0;A<_;A++){var P=e.attributes[A];E[P.name]=kt(n,C,P.name,P.value)}if(C==="link"&&i){var B=Array.from(n.styleSheets).find(function(N){return N.href===e.href}),L=null;B&&(L=et(B)),L&&(delete E.rel,delete E.href,E._cssText=Ve(L,B.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=et(e.sheet);L&&(E._cssText=Ve(L,tt()))}if(C==="input"||C==="textarea"||C==="select"){var Q=e.value;E.type!=="radio"&&E.type!=="checkbox"&&E.type!=="submit"&&E.type!=="button"&&Q?E.value=Je({type:E.type,tagName:C,value:Q,maskInputOptions:l,maskInputFn:c}):e.checked&&(E.checked=e.checked)}if(C==="option"&&(e.selected&&!l.select?E.selected=!0:delete E.selected),C==="canvas"&&m){if(e.__context==="2d")tr(e)||(E.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var z=e.toDataURL(d.type,d.quality),te=document.createElement("canvas");te.width=e.width,te.height=e.height;var X=te.toDataURL(d.type,d.quality);z!==X&&(E.rr_dataURL=z)}}if(C==="img"&&h&&!T&&!w&&!p){Se||(Se=n.createElement("canvas"),xt=Se.getContext("2d"));var V=e,F=V.crossOrigin;V.crossOrigin="anonymous";var U=function(){try{Se.width=V.naturalWidth,Se.height=V.naturalHeight,xt.drawImage(V,0,0),E.rr_dataURL=Se.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(N))}F?E.crossOrigin=F:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?U():V.onload=U}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),b||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop)),T||w||C==="img"&&p){var v=e.getBoundingClientRect(),y=v.width,M=v.height;E={class:E.class,rr_width:"".concat(y,"px"),rr_height:"".concat(M,"px")},p&&(T=!0)}return C==="iframe"&&!f(E.src)&&(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:R.Element,tagName:C,attributes:E,childNodes:[],isSVG:gr(e)||void 0,needBlock:T,needMask:w,rootId:S}}function $(e){return e===void 0?"":e.toLowerCase()}function Nr(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest")||t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/))||t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,f=t.maskTextFn,g=t.maskInputFn,b=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,T=t.inlineImages,w=T===void 0?!1:T,C=t.recordCanvas,E=C===void 0?!1:C,_=t.onSerialize,A=t.onIframeLoad,P=t.iframeLoadTimeout,B=P===void 0?5e3:P,L=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,z=Q===void 0?5e3:Q,te=t.keepIframeSrcFn,X=te===void 0?function(){return!1}:te,V=t.newlyAddedElement,F=V===void 0?!1:V,U=t.enableStrictPrivacy,v=t.preserveWhiteSpace,y=v===void 0?!0:v,M=vr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:w,recordCanvas:E,keepIframeSrcFn:X,newlyAddedElement:F,enableStrictPrivacy:U});if(!M)return console.warn(e,"not serialized"),null;var N;if(r.hasNode(e)?N=r.getId(e):Nr(M,b)||!y&&M.type===R.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Oe:N=or(),N===Oe)return null;var I=Object.assign(M,{id:N});r.add(e,I),_&&_(e);var K=!s,J=U;if(I.type===R.Element){if(K=K&&!I.needBlock,J=U||!!I.needBlock||!!I.needMask,J&&I.tagName==="img"){var le=e.cloneNode();le.src="",r.add(le,I)}delete I.needBlock,delete I.needMask;var W=e.shadowRoot;W&&De(W)&&(I.isShadowHost=!0)}if((I.type===R.Document||I.type===R.Element)&&K){b.headWhitespace&&I.type===R.Element&&I.tagName==="head"&&(y=!1);for(var j={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:J},be=0,Qn=Array.from(e.childNodes);be<Qn.length;be++){var Et=Qn[be],ke=me(Et,j);ke&&I.childNodes.push(ke)}if(Ct(e)&&e.shadowRoot)for(var wt=0,Jn=Array.from(e.shadowRoot.childNodes);wt<Jn.length;wt++){var Et=Jn[wt],ke=me(Et,j);ke&&(De(e.shadowRoot)&&(ke.isShadow=!0),I.childNodes.push(ke))}}return e.parentNode&&Re(e.parentNode)&&De(e.parentNode)&&(I.isShadow=!0),I.type===R.Element&&I.tagName==="iframe"&&yr(e,function(){var de=e.contentDocument;if(de&&A){var qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});qn&&A(e,qn)}},B),I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X,enableStrictPrivacy:U});de&&L(e,de)}},z),Ot(e)===!1)||I.type===R.Element&&I.tagName==="link"&&I.attributes.rel==="stylesheet"&&(Lt(e,function(){if(L){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:f,maskInputFn:g,slimDOMOptions:b,dataURLOptions:S,inlineImages:w,recordCanvas:E,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:B,enableStrictPrivacy:U,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:X});de&&L(e,de)}},z),Ot(e)===!1)?null:I}function Er(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,f=m===void 0?!0:m,g=n.inlineImages,b=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,T=n.maskAllInputs,w=T===void 0?!1:T,C=n.maskTextFn,E=n.maskInputFn,_=n.slimDOM,A=_===void 0?!1:_,P=n.dataURLOptions,B=n.preserveWhiteSpace,L=n.onSerialize,Q=n.onIframeLoad,z=n.iframeLoadTimeout,te=n.onStylesheetLoad,X=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,F=V===void 0?function(){return!1}:V,U=n.enableStrictPrivacy,v=U===void 0?!1:U,y=w===!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}:w===!1?{password:!0}:w,M=A===!0||A==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:A==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:A===!1?{}:A;return me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:y,maskTextFn:C,maskInputFn:E,slimDOMOptions:M,dataURLOptions:P,inlineImages:b,recordCanvas:S,preserveWhiteSpace:B,onSerialize:L,onIframeLoad:Q,iframeLoadTimeout:z,onStylesheetLoad:te,stylesheetLoadTimeout:X,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:v})}var At=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wr(e,t){t===void 0&&(t={});var n=1,r=1;function o(v){var y=v.match(/\n/g);y&&(n+=y.length);var M=v.lastIndexOf(`
|
|
2
2
|
`);r=M===-1?r+v.length:v.length-M}function i(){var v={line:n,column:r};return function(y){return y.position=new a(v),f(),y}}var a=function(){function v(y){this.start=y,this.end={line:n,column:r},this.source=t.source}return v}();a.prototype.content=e;var l=[];function c(v){var y=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(v));if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,t.silent)l.push(y);else throw y}function s(){var v=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:v,parsingErrors:l}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var v,y=[];for(f(),g(y);e.length&&e.charAt(0)!=="}"&&(v=F()||U());)v!==!1&&(y.push(v),g(y));return y}function m(v){var y=v.exec(e);if(y){var M=y[0];return o(M),e=e.slice(M.length),y}}function f(){m(/^\s*/)}function g(v){v===void 0&&(v=[]);for(var y;y=b();)y!==!1&&v.push(y),y=b();return v}function b(){var v=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var y=2;e.charAt(y)!==""&&(e.charAt(y)!=="*"||e.charAt(y+1)!=="/");)++y;if(y+=2,e.charAt(y-1)==="")return c("End of comment missing");var M=e.slice(2,y-2);return r+=2,o(M),e=e.slice(y),r+=2,v({type:"comment",comment:M})}}function p(){var v=m(/^([^{]+)/);if(v)return ce(v[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(y){return y.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(y){return y.replace(/\u200C/g,",")})}function S(){var v=i(),y=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(y){var M=ce(y[0]);if(!m(/^:\s*/))return c("property missing ':'");var N=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),I=v({type:"declaration",property:M.replace(At,""),value:N?ce(N[0]).replace(At,""):""});return m(/^[;\s]*/),I}}function T(){var v=[];if(!u())return c("missing '{'");g(v);for(var y;y=S();)y!==!1&&(v.push(y),g(v)),y=S();return d()?v:c("missing '}'")}function w(){for(var v,y=[],M=i();v=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)y.push(v[1]),m(/^,\s*/);if(y.length)return M({type:"keyframe",values:y,declarations:T()})}function C(){var v=i(),y=m(/^@([-\w]+)?keyframes\s*/);if(y){var M=y[1];if(y=m(/^([-\w]+)\s*/),!y)return c("@keyframes missing name");var N=y[1];if(!u())return c("@keyframes missing '{'");for(var I,K=g();I=w();)K.push(I),K=K.concat(g());return d()?v({type:"keyframes",name:N,vendor:M,keyframes:K}):c("@keyframes missing '}'")}}function E(){var v=i(),y=m(/^@supports *([^{]+)/);if(y){var M=ce(y[1]);if(!u())return c("@supports missing '{'");var N=g().concat(h());return d()?v({type:"supports",supports:M,rules:N}):c("@supports missing '}'")}}function _(){var v=i(),y=m(/^@host\s*/);if(y){if(!u())return c("@host missing '{'");var M=g().concat(h());return d()?v({type:"host",rules:M}):c("@host missing '}'")}}function A(){var v=i(),y=m(/^@media *([^{]+)/);if(y){var M=ce(y[1]);if(!u())return c("@media missing '{'");var N=g().concat(h());return d()?v({type:"media",media:M,rules:N}):c("@media missing '}'")}}function P(){var v=i(),y=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(y)return v({type:"custom-media",name:ce(y[1]),media:ce(y[2])})}function B(){var v=i(),y=m(/^@page */);if(y){var M=p()||[];if(!u())return c("@page missing '{'");for(var N=g(),I;I=S();)N.push(I),N=N.concat(g());return d()?v({type:"page",selectors:M,declarations:N}):c("@page missing '}'")}}function L(){var v=i(),y=m(/^@([-\w]+)?document *([^{]+)/);if(y){var M=ce(y[1]),N=ce(y[2]);if(!u())return c("@document missing '{'");var I=g().concat(h());return d()?v({type:"document",document:N,vendor:M,rules:I}):c("@document missing '}'")}}function Q(){var v=i(),y=m(/^@font-face\s*/);if(y){if(!u())return c("@font-face missing '{'");for(var M=g(),N;N=S();)M.push(N),M=M.concat(g());return d()?v({type:"font-face",declarations:M}):c("@font-face missing '}'")}}var z=V("import"),te=V("charset"),X=V("namespace");function V(v){var y=new RegExp("^@"+v+"\\s*([^;]+);");return function(){var M=i(),N=m(y);if(N){var I={type:v};return I[v]=N[1].trim(),M(I)}}}function F(){if(e[0]==="@")return C()||A()||P()||E()||z()||te()||X()||L()||B()||_()||Q()}function U(){var v=i(),y=p();return y?(g(),v({type:"rule",selectors:y,declarations:T()})):c("selector missing")}return nt(s())}function ce(e){return e?e.replace(/^\s+|\s+$/g,""):""}function nt(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];Array.isArray(l)?l.forEach(function(c){nt(c,r)}):l&&typeof l=="object"&&nt(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Pt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Cr(e){var t=Pt[e.tagName]?Pt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ft=/([^\\]):hover/,Mr=new RegExp(Ft.source,"g");function _t(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=wr(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(s){Ft.test(s)&&i.push(s)})}),i.length===0)return e;var a=new RegExp(i.filter(function(c,s){return i.indexOf(c)===s}).sort(function(c,s){return s.length-c.length}).map(function(c){return Ir(c)}).join("|"),"g"),l=e.replace(a,function(c){var s=c.replace(Mr,"$1.\\:hover");return"".concat(c,", ").concat(s)});return t?.stylesWithHoverClass.set(e,l),l}function Wt(){var e=new Map;return{stylesWithHoverClass:e}}function xr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case R.Document:return n.implementation.createDocument(null,"",null);case R.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case R.Element:{var i=Cr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):a=n.createElement(i);var l=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var P=a.getContext("2d");P&&P.drawImage(m,0,0,m.width,m.height)},m.src=h,a.RRNodeType&&(a.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var f=a;f.currentSrc.startsWith("data:")||(f.setAttribute("rrweb-original-src",e.attributes.src),f.src=h,f.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(P){return console.warn("media playback error",P)});break;case"paused":a.pause();break}}else{var g=i==="textarea"&&d==="value",b=i==="style"&&d==="_cssText";if(b&&r&&(h=_t(h,o),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,T=[],w="https://replay-cors-proxy.highlightrun.workers.dev";(S=p.exec(h))!==null;)S.index===p.lastIndex&&p.lastIndex++,S.forEach(function(P,B){if(B===0){var L=P.slice(5,P.length-2);T.push({originalUrl:L,proxyUrl:L.replace(L,"".concat(w,"?url=").concat(L))})}});T.forEach(function(P){h=h.replace(P.originalUrl,P.proxyUrl)})}if(g||b){for(var C=n.createTextNode(h),E=0,_=Array.from(a.childNodes);E<_.length;E++){var A=_[E];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(C),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(i==="img"){var s=a;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case R.Text:return n.createTextNode(e.isStyle&&r?_t(e.textContent,o):e.textContent);case R.CDATA:return n.createCDATASection(e.textContent);case R.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,s=t.cache,u=xr(e,{doc:n,hackCss:l,cache:s});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===R.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==R.DocumentType&&(e.childNodes[0].type===R.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===R.Document||e.type===R.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],f=je(m,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:s});if(!f){console.warn("Failed to rebuild",m);continue}m.isShadow&&Ct(u)&&u.shadowRoot?u.shadowRoot.appendChild(f):u.appendChild(f),c&&c(f)}return u}function kr(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function Rr(e,t){var n=t.getMeta(e);if(n?.type===R.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function Dr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,s=c===void 0?new Qe:c,u=je(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:l});return kr(s,function(d){r&&r(d),Rr(d,s)}),u}function ee(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Te=`Please stop import mirror directly. Instead of that,\r
|
|
3
3
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
4
|
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Te),-1},getNode(){return console.error(Te),null},removeNodeFromMap(){console.error(Te)},has(){return console.error(Te),!1},reset(){console.error(Te)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,n){return t==="map"&&console.error(Te),Reflect.get(e,t,n)}}));function Ne(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Le(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Le(e,t,i||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function rt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const $t=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ge(r,t,n))return!0;return!1}function Vt(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Oe}function it(e,t){if(Re(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?it(e.parentNode,t):!0:!0}function st(e){return Boolean(e.changedTouches)}function at(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ut(e){const t={},n=(o,i)=>{const a={value:o,parent:i,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:i,parentId:a}=o;if(i&&i in t){const l=t[i];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function lt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)lt(e.children[n],t)}function Ee(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ct(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ut(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=ut(o,t),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function we(e,t){const n=e[t[0]];return t.length===1?n:we(n.cssRules[t[1]].cssRules,t.slice(2))}function dt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Gt(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var Or=Object.freeze({__proto__:null,on:ee,get _mirror(){return q.mirror},throttle:Ne,hookSetter:Le,patch:pe,getWindowHeight:rt,getWindowWidth:ot,isCanvasNode:$t,isBlocked:ne,isSerialized:Vt,isIgnored:Be,isAncestorRemoved:it,isTouchEvent:st,polyfill:at,queueToResolveTrees:Ut,iterateResolveTree:lt,isSerializedIframe:Ee,isSerializedStylesheet:ct,getBaseDimension:ut,hasShadowRoot:Ae,getNestedRule:we,getPositionsAndIndex:dt,uniqueTextMutations:Gt}),x=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(x||{}),k=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(k||{}),H=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(H||{}),ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ue||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function jt(e){return"__ln"in e}class Lr{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&jt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&jt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Bt=(e,t)=>`${e}@${t}`;class Ar{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Lr,r=l=>{let c=l,s=Oe;for(;s===Oe;)c=c&&c.nextSibling,s=c&&this.mirror.getId(c);return s},o=l=>{var c,s,u,d,h;const m=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let f=m;for(;(u=(s=f?.getRootNode)==null?void 0:s.call(f))!=null&&u.host;)f=((h=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:h.host)||null;const g=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||g)return;const b=Re(l.parentNode)?this.mirror.getId(m):this.mirror.getId(l.parentNode),p=r(l);if(b===-1||p===-1)return n.addNode(l);const S=me(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{Ee(T,this.mirror)&&this.iframeManager.addIframe(T),ct(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(T,w)=>{this.iframeManager.attachIframe(T,w,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,w)=>{this.stylesheetManager.attachStylesheet(T,w,this.mirror)}});S&&t.push({parentId:b,nextId:p,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))zt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!Ht(this.droppedSet,l)&&!zt(this.removes,l,this.mirror)||Ht(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const c=this.mirror.getId(i.value.parentNode),s=r(i.value);c!==-1&&s!==-1&&(l=i)}if(!l)for(let c=n.length-1;c>=0;c--){const s=n.get(c);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){l=s;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=qe(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:Dt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Je({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),s=n.style.getPropertyPriority(l);(c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l))&&(s===""?a[l]=c:a[l]=[c,s])}for(const l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=kt(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=Re(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!Vt(n,this.mirror)||(this.addedSet.has(n)?(ht(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||it(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Bt(r,o)]?ht(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Re(t.target)&&De(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ht(e,t){e.delete(t),t.childNodes.forEach(n=>ht(e,n))}function zt(e,t,n){return e.length===0?!1:Yt(e,t,n)}function Yt(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(i=>i.id===o)?!0:Yt(e,r,n)}function Ht(e,t){return e.size===0?!1:Xt(e,t)}function Xt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Xt(e,n):!1}var Pr=Object.defineProperty,Fr=Object.defineProperties,_r=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Kt=(e,t,n)=>t in e?Pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qt=(e,t)=>{for(var n in t||(t={}))Wr.call(t,n)&&Kt(e,n,t[n]);if(Zt)for(var n of Zt(t))$r.call(t,n)&&Kt(e,n,t[n]);return e},Vr=(e,t)=>Fr(e,_r(t));const ge=[],Jt=typeof CSSGroupingRule<"u",qt=typeof CSSMediaRule<"u",en=typeof CSSSupportsRule<"u",tn=typeof CSSConditionRule<"u";function Pe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function nn(e,t){var n,r;const o=new Ar;ge.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Ur({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Ne(d=>{const h=Date.now()-l;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],l=null},i),s=Ne(d=>{const h=Pe(d),{clientX:m,clientY:f}=st(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:m,y:f,id:r.getId(h),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?k.Drag:d instanceof MouseEvent?k.MouseMove:k.TouchMove)},o,{trailing:!1}),u=[ee("mousemove",s,n),ee("touchmove",s,n),ee("drag",s,n)];return()=>{u.forEach(d=>d())}}function Gr({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>s=>{const u=Pe(s);if(ne(u,r,!0)||$t(u))return;const d=st(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:f}=d;e({type:H[c],id:h,x:m,y:f})};return Object.keys(H).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{const s=c.toLowerCase(),u=l(c);a.push(ee(s,u,t))}),()=>{a.forEach(c=>c())}}function rn({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const i=Ne(a=>{const l=Pe(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const s=t.scrollingElement||t.documentElement;e({id:c,x:s.scrollLeft,y:s.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return ee("scroll",i,t)}function jr({viewportResizeCb:e}){let t=-1,n=-1;const r=Ne(()=>{const o=rt(),i=ot();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return ee("resize",r,window)}function on(e,t){const n=Qt({},e);return t||delete n.userTriggered,n}const Br=["INPUT","TEXTAREA","SELECT"],sn=new WeakMap;function zr({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function s(f){let g=Pe(f);const b=f.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||Br.indexOf(g.tagName)<0||ne(g,r,!0))return;const p=g.type;if(g.classList.contains(o))return;let S=g.value,T=!1;p==="radio"||p==="checkbox"?T=g.checked:(i[g.tagName.toLowerCase()]||i[p])&&(S=Je({maskInputOptions:i,tagName:g.tagName,type:p,value:S,maskInputFn:a})),u(g,on({text:S,isChecked:T,userTriggered:b},c));const w=g.name;p==="radio"&&w&&T&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(C=>{C!==g&&u(C,on({text:C.value,isChecked:!T,userTriggered:!1},c))})}function u(f,g){const b=sn.get(f);if(!b||b.text!==g.text||b.isChecked!==g.isChecked){sn.set(f,g);const p=n.getId(f);e(Vr(Qt({},g),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(f=>ee(f,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(f=>Le(f[0],f[1],{set(){s({target:this})}}))),()=>{d.forEach(f=>f())}}function ze(e){const t=[];function n(r,o){if(Jt&&r.parentRule instanceof CSSGroupingRule||qt&&r.parentRule instanceof CSSMediaRule||en&&r.parentRule instanceof CSSSupportsRule||tn&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Yr({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:l,index:c}]}),r.apply(this,[l,c])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,[l])};const i={};Jt?i.CSSGroupingRule=n.CSSGroupingRule:(qt&&(i.CSSMediaRule=n.CSSMediaRule),tn&&(i.CSSConditionRule=n.CSSConditionRule),en&&(i.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(i).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ze(this),u||0]}]}),a[l].insertRule.apply(this,[s,u])},c.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ze(this),s]}]}),a[l].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Hr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,a,l){var c,s;const u=t.getId((s=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:a,priority:l},index:ze(this.parentRule)}),r.apply(this,[i,a,l])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:i},index:ze(this.parentRule)}),o.apply(this,[i])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Xr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Ne(l=>{const c=Pe(l);if(!c||ne(c,t,!0))return;const{currentTime:s,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:s,volume:u,muted:d})},r.media||500),i=[ee("play",o(fe.Play)),ee("pause",o(fe.Pause)),ee("seeked",o(fe.Seeked)),ee("volumechange",o(fe.VolumeChange))];return()=>{i.forEach(a=>a())}}function Zr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,s){const u=new i(l,c,s);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:s,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const s=o.get(c);s&&(e(s),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(l=>l())}}function Kr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),c(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Qr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Kr(e,t);const r=nn(e,e.doc),o=Ur(e),i=Gr(e),a=rn(e),l=jr(e),c=zr(e),s=Xr(e),u=Yr(e,{win:n}),d=Hr(e,{win:n}),h=e.collectFonts?Zr(e):()=>{},m=[];for(const f of e.plugins)m.push(f.observer(f.callback,n,f.options));return()=>{ge.forEach(f=>f.reset()),r.disconnect(),o(),i(),a(),l(),c(),s(),u(),d(),h(),m.forEach(f=>f())}}class Jr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var qr=Object.defineProperty,eo=Object.defineProperties,to=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable,ln=(e,t,n)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cn=(e,t)=>{for(var n in t||(t={}))no.call(t,n)&&ln(e,n,t[n]);if(an)for(var n of an(t))ro.call(t,n)&&ln(e,n,t[n]);return e},un=(e,t)=>eo(e,to(t));class oo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){!De(t)||(nn(un(cn({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),rn(un(cn({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fe=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ye=0;Ye<Ce.length;Ye++)Fe[Ce.charCodeAt(Ye)]=Ye;var io=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Ce[t[n]>>2],o+=Ce[(t[n]&3)<<4|t[n+1]>>4],o+=Ce[(t[n+1]&15)<<2|t[n+2]>>6],o+=Ce[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},so=function(e){var t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=Fe[e.charCodeAt(r)],a=Fe[e.charCodeAt(r+1)],l=Fe[e.charCodeAt(r+2)],c=Fe[e.charCodeAt(r+3)],u[o++]=i<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return s};const dn=new Map;function ao(e,t){let n=dn.get(e);return n||(n=new Map,dn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const hn=(e,t,n)=>{if(!e||!(pn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=ao(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function He(e,t,n){if(e instanceof Array)return e.map(r=>He(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=io(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]};if(pn(e,t)||typeof e=="object"){const r=e.constructor.name,o=hn(e,t,n);return{rr_type:r,index:o}}}}return e}const mn=(e,t,n)=>[...e].map(r=>He(r,t,n)),pn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function lo(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=mn([...s],t,this);e(this.canvas,{type:ue["2D"],property:a,args:u})},0),c.apply(this,s)}});o.push(l)}catch{const c=Le(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:ue["2D"],property:a,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function fn(e,t){const n=[];try{const r=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...a){return ne(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function gn(e,t,n,r,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const s=pe(e,c,function(u){return function(...d){const h=u.apply(this,d);if(hn(h,i,e),!ne(this.canvas,r,!0)){const m=mn([...d],i,e),f={type:t,property:c,args:m};n(this.canvas,f)}return h}});a.push(s)}catch{const u=Le(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function co(e,t,n,r){const o=[];return o.push(...gn(t.WebGLRenderingContext.prototype,ue.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...gn(t.WebGL2RenderingContext.prototype,ue.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}function uo(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function ho(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=uo(e,o),a=i.indexOf(`
|