@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-all.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var _;(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"})(_||(_={}));function nr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var gt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-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 r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.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,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function or(){return new gt}function yt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var ir="__rrweb_original__";function Xn(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=ir in i?i[ir]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function bt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Zn=1,Kn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function qn(){return Zn++}function Jn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Kn.test(t)?"div":t}function St(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Qn).join(""):null}catch{return null}}function Qn(e){var t=e.cssText;if(eo(e))try{t=St(e.styleSheet)||t}catch{}return t}function eo(e){return"styleSheet"in e}function to(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ro(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,sr,no=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oo=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,io=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(no,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!oo.test(a)||io.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(ro(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var so=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/;function lo(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(ao),!(r>=t.length);){var i=n(so);if(i.slice(-1)===",")i=nt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=nt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function co(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function wt(){var e=document.createElement("a");return e.href="",e.href}function ar(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?lo(e,n):r==="style"&&n?rt(n,wt()):t==="object"&&r==="data"&&n?nt(e,n):n}function lr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ot(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ot(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ot(e.parentNode,t,r):!1}function cr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ot(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function uo(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ur(e){return e.getAttribute("href")?e.sheet!==null:!0}function dr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function ho(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,b=t.newlyAddedElement,T=b===void 0?!1:b,C=t.enableStrictPrivacy,I=mo(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:_.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:_.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskTextClass:l,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:T,enableStrictPrivacy:C,rootId:I});case e.TEXT_NODE:return po(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:C,rootId:I});case e.CDATA_SECTION_NODE:return{type:_.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:_.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function mo(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function po(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=to(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=rt(s,wt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&cr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=bt(s))}return{type:_.Text,textContent:s||"",isStyle:u,rootId:c}}function fo(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,y=f===void 0?!1:f,v=t.enableStrictPrivacy,b=t.rootId,T=lr(e,n,o),C=lr(e,s,null),I=Jn(e),w={},R=e.attributes.length,E=0;E<R;E++){var L=e.attributes[E];w[L.name]=ar(r,I,L.name,L.value)}if(I==="link"&&i){var $=Array.from(r.styleSheets).find(function(N){return N.href===e.href}),P=null;$&&(P=St($)),P&&(delete w.rel,delete w.href,w._cssText=rt(P,$.href))}if(I==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=St(e.sheet);P&&(w._cssText=rt(P,wt()))}if(I==="input"||I==="textarea"||I==="select"){var j=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&j?w.value=yt({type:w.type,tagName:I,value:j,maskInputOptions:c,maskInputFn:a}):e.checked&&(w.checked=e.checked)}if(I==="option"&&(e.selected&&!c.select?w.selected=!0:delete w.selected),I==="canvas"&&m){if(e.__context==="2d")Xn(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),Y=document.createElement("canvas");Y.width=e.width,Y.height=e.height;var V=Y.toDataURL(d.type,d.quality);U!==V&&(w.rr_dataURL=U)}}if(I==="img"&&h&&!T&&!C){xe||(xe=r.createElement("canvas"),sr=xe.getContext("2d"));var D=e,x=D.crossOrigin;D.crossOrigin="anonymous";var F=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,sr.drawImage(D,0,0),w.rr_dataURL=xe.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(D.currentSrc,"! Error: ").concat(N))}x?w.crossOrigin=x:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?F():D.onload=F}if((I==="audio"||I==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),T||C||I==="img"&&v){var S=e.getBoundingClientRect(),g=S.width,M=S.height;w={class:w.class,rr_width:"".concat(g,"px"),rr_height:"".concat(M,"px")},v&&(T=!0)}return I==="iframe"&&!p(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:_.Element,tagName:I,attributes:w,childNodes:[],isSVG:co(e)||void 0,needBlock:T,needMask:C,rootId:b}}function Z(e){return e===void 0?"":e.toLowerCase()}function vo(e,t){return!!(t.comment&&e.type===_.Comment||e.type===_.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"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=v===void 0?{}:v,T=t.inlineImages,C=T===void 0?!1:T,I=t.recordCanvas,w=I===void 0?!1:I,R=t.onSerialize,E=t.onIframeLoad,L=t.iframeLoadTimeout,$=L===void 0?5e3:L,P=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,U=j===void 0?5e3:j,Y=t.keepIframeSrcFn,V=Y===void 0?function(){return!1}:Y,D=t.newlyAddedElement,x=D===void 0?!1:D,F=t.enableStrictPrivacy,S=t.preserveWhiteSpace,g=S===void 0?!0:S,M=ho(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:b,inlineImages:C,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:x,enableStrictPrivacy:F});if(!M)return console.warn(e,"not serialized"),null;var N;if(n.hasNode(e)?N=n.getId(e):vo(M,y)||!g&&M.type===_.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Ge:N=qn(),N===Ge)return null;var k=Object.assign(M,{id:N});n.add(e,k),R&&R(e);var z=!s,G=F;if(k.type===_.Element){if(z=z&&!k.needBlock,G=F||!!k.needBlock||!!k.needMask,G&&k.tagName==="img"){var oe=e.cloneNode();oe.src="",n.add(oe,k)}delete k.needBlock,delete k.needMask;var B=e.shadowRoot;B&&Ve(B)&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&z){y.headWhitespace&&k.type===_.Element&&k.tagName==="head"&&(g=!1);for(var X={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:G},ge=0,tt=Array.from(e.childNodes);ge<tt.length;ge++){var We=tt[ge],ye=Ee(We,X);ye&&k.childNodes.push(ye)}if(nr(e)&&e.shadowRoot)for(var rr=0,Ue=Array.from(e.shadowRoot.childNodes);rr<Ue.length;rr++){var We=Ue[rr],ye=Ee(We,X);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),k.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(k.isShadow=!0),k.type===_.Element&&k.tagName==="iframe"&&uo(e,function(){var be=e.contentDocument;if(be&&E){var Hn=Ee(be,{doc:be,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});Hn&&E(e,Hn)}},$),k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});be&&P(e,be)}},U),ur(e)===!1)||k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,enableStrictPrivacy:F,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V});be&&P(e,be)}},U),ur(e)===!1)?null:k}function go(e,t){var r=t||{},n=r.mirror,o=n===void 0?new gt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,b=v===void 0?!1:v,T=r.maskAllInputs,C=T===void 0?!1:T,I=r.maskTextFn,w=r.maskInputFn,R=r.slimDOM,E=R===void 0?!1:R,L=r.dataURLOptions,$=r.preserveWhiteSpace,P=r.onSerialize,j=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,x=D===void 0?function(){return!1}:D,F=r.enableStrictPrivacy,S=F===void 0?!1:F,g=C===!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}:C===!1?{password:!0}:C,M=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:I,maskInputFn:w,slimDOMOptions:M,dataURLOptions:L,inlineImages:y,recordCanvas:b,preserveWhiteSpace:$,onSerialize:P,onIframeLoad:j,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:V,keepIframeSrcFn:x,newlyAddedElement:!1,enableStrictPrivacy:S})}var hr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yo(e,t){t===void 0&&(t={});var r=1,n=1;function o(S){var g=S.match(/\n/g);g&&(r+=g.length);var M=S.lastIndexOf(`
|
|
1
|
+
var rrweb=function(q){"use strict";var _;(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"})(_||(_={}));function nr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var gt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-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 r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.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,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function or(){return new gt}function yt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var ir="__rrweb_original__";function Xn(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=ir in i?i[ir]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function bt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Zn=1,Kn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function qn(){return Zn++}function Jn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Kn.test(t)?"div":t}function St(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Qn).join(""):null}catch{return null}}function Qn(e){var t=e.cssText;if(eo(e))try{t=St(e.styleSheet)||t}catch{}return t}function eo(e){return"styleSheet"in e}function to(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ro(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,sr,no=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oo=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,io=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(no,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!oo.test(a)||io.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(ro(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var so=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/;function lo(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(ao),!(r>=t.length);){var i=n(so);if(i.slice(-1)===",")i=nt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=nt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function co(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function wt(){var e=document.createElement("a");return e.href="",e.href}function ar(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?lo(e,n):r==="style"&&n?rt(n,wt()):t==="object"&&r==="data"&&n?nt(e,n):n}function lr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ot(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ot(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ot(e.parentNode,t,r):!1}function cr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ot(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function uo(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ur(e){return e.getAttribute("href")?e.sheet!==null:!0}function dr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function ho(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,b=t.newlyAddedElement,T=b===void 0?!1:b,C=t.enableStrictPrivacy,I=mo(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:_.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:_.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskTextClass:l,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:T,enableStrictPrivacy:C,rootId:I});case e.TEXT_NODE:return po(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:C,rootId:I});case e.CDATA_SECTION_NODE:return{type:_.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:_.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function mo(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function po(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=to(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=rt(s,wt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&cr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=bt(s))}return{type:_.Text,textContent:s||"",isStyle:u,rootId:c}}function fo(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,y=f===void 0?!1:f,v=t.enableStrictPrivacy,b=t.rootId,T=lr(e,n,o),C=lr(e,s,null),I=Jn(e),w={},R=e.attributes.length,E=0;E<R;E++){var L=e.attributes[E];w[L.name]=ar(r,I,L.name,L.value)}if(I==="link"&&i){var $=Array.from(r.styleSheets).find(function(N){return N.href===e.href}),P=null;$&&(P=St($)),P&&(delete w.rel,delete w.href,w._cssText=rt(P,$.href))}if(I==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=St(e.sheet);P&&(w._cssText=rt(P,wt()))}if(I==="input"||I==="textarea"||I==="select"){var j=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&j?w.value=yt({type:w.type,tagName:I,value:j,maskInputOptions:c,maskInputFn:a}):e.checked&&(w.checked=e.checked)}if(I==="option"&&(e.selected&&!c.select?w.selected=!0:delete w.selected),I==="canvas"&&m){if(e.__context==="2d")Xn(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),Y=document.createElement("canvas");Y.width=e.width,Y.height=e.height;var V=Y.toDataURL(d.type,d.quality);U!==V&&(w.rr_dataURL=U)}}if(I==="img"&&h&&!T&&!C&&!v){xe||(xe=r.createElement("canvas"),sr=xe.getContext("2d"));var D=e,x=D.crossOrigin;D.crossOrigin="anonymous";var F=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,sr.drawImage(D,0,0),w.rr_dataURL=xe.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(D.currentSrc,"! Error: ").concat(N))}x?w.crossOrigin=x:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?F():D.onload=F}if((I==="audio"||I==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),T||C||I==="img"&&v){var S=e.getBoundingClientRect(),g=S.width,M=S.height;w={class:w.class,rr_width:"".concat(g,"px"),rr_height:"".concat(M,"px")},v&&(T=!0)}return I==="iframe"&&!p(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:_.Element,tagName:I,attributes:w,childNodes:[],isSVG:co(e)||void 0,needBlock:T,needMask:C,rootId:b}}function Z(e){return e===void 0?"":e.toLowerCase()}function vo(e,t){return!!(t.comment&&e.type===_.Comment||e.type===_.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"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=v===void 0?{}:v,T=t.inlineImages,C=T===void 0?!1:T,I=t.recordCanvas,w=I===void 0?!1:I,R=t.onSerialize,E=t.onIframeLoad,L=t.iframeLoadTimeout,$=L===void 0?5e3:L,P=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,U=j===void 0?5e3:j,Y=t.keepIframeSrcFn,V=Y===void 0?function(){return!1}:Y,D=t.newlyAddedElement,x=D===void 0?!1:D,F=t.enableStrictPrivacy,S=t.preserveWhiteSpace,g=S===void 0?!0:S,M=ho(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:b,inlineImages:C,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:x,enableStrictPrivacy:F});if(!M)return console.warn(e,"not serialized"),null;var N;if(n.hasNode(e)?N=n.getId(e):vo(M,y)||!g&&M.type===_.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Ge:N=qn(),N===Ge)return null;var k=Object.assign(M,{id:N});n.add(e,k),R&&R(e);var z=!s,G=F;if(k.type===_.Element){if(z=z&&!k.needBlock,G=F||!!k.needBlock||!!k.needMask,G&&k.tagName==="img"){var oe=e.cloneNode();oe.src="",n.add(oe,k)}delete k.needBlock,delete k.needMask;var B=e.shadowRoot;B&&Ve(B)&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&z){y.headWhitespace&&k.type===_.Element&&k.tagName==="head"&&(g=!1);for(var X={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:G},ge=0,tt=Array.from(e.childNodes);ge<tt.length;ge++){var We=tt[ge],ye=Ee(We,X);ye&&k.childNodes.push(ye)}if(nr(e)&&e.shadowRoot)for(var rr=0,Ue=Array.from(e.shadowRoot.childNodes);rr<Ue.length;rr++){var We=Ue[rr],ye=Ee(We,X);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),k.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(k.isShadow=!0),k.type===_.Element&&k.tagName==="iframe"&&uo(e,function(){var be=e.contentDocument;if(be&&E){var Hn=Ee(be,{doc:be,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});Hn&&E(e,Hn)}},$),k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});be&&P(e,be)}},U),ur(e)===!1)||k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,enableStrictPrivacy:F,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V});be&&P(e,be)}},U),ur(e)===!1)?null:k}function go(e,t){var r=t||{},n=r.mirror,o=n===void 0?new gt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,b=v===void 0?!1:v,T=r.maskAllInputs,C=T===void 0?!1:T,I=r.maskTextFn,w=r.maskInputFn,R=r.slimDOM,E=R===void 0?!1:R,L=r.dataURLOptions,$=r.preserveWhiteSpace,P=r.onSerialize,j=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,x=D===void 0?function(){return!1}:D,F=r.enableStrictPrivacy,S=F===void 0?!1:F,g=C===!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}:C===!1?{password:!0}:C,M=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:I,maskInputFn:w,slimDOMOptions:M,dataURLOptions:L,inlineImages:y,recordCanvas:b,preserveWhiteSpace:$,onSerialize:P,onIframeLoad:j,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:V,keepIframeSrcFn:x,newlyAddedElement:!1,enableStrictPrivacy:S})}var hr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yo(e,t){t===void 0&&(t={});var r=1,n=1;function o(S){var g=S.match(/\n/g);g&&(r+=g.length);var M=S.lastIndexOf(`
|
|
2
2
|
`);n=M===-1?n+S.length:S.length-M}function i(){var S={line:r,column:n};return function(g){return g.position=new l(S),p(),g}}var l=function(){function S(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return S}();l.prototype.content=e;var c=[];function a(S){var g=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(S));if(g.reason=S,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var S=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:c}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var S,g=[];for(p(),f(g);e.length&&e.charAt(0)!=="}"&&(S=x()||F());)S!==!1&&(g.push(S),f(g));return g}function m(S){var g=S.exec(e);if(g){var M=g[0];return o(M),e=e.slice(M.length),g}}function p(){m(/^\s*/)}function f(S){S===void 0&&(S=[]);for(var g;g=y();)g!==!1&&S.push(g),g=y();return S}function y(){var S=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var M=e.slice(2,g-2);return n+=2,o(M),e=e.slice(g),n+=2,S({type:"comment",comment:M})}}function v(){var S=m(/^([^{]+)/);if(S)return pe(S[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function b(){var S=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var M=pe(g[0]);if(!m(/^:\s*/))return a("property missing ':'");var N=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),k=S({type:"declaration",property:M.replace(hr,""),value:N?pe(N[0]).replace(hr,""):""});return m(/^[;\s]*/),k}}function T(){var S=[];if(!u())return a("missing '{'");f(S);for(var g;g=b();)g!==!1&&(S.push(g),f(S)),g=b();return d()?S:a("missing '}'")}function C(){for(var S,g=[],M=i();S=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(S[1]),m(/^,\s*/);if(g.length)return M({type:"keyframe",values:g,declarations:T()})}function I(){var S=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var M=g[1];if(g=m(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var N=g[1];if(!u())return a("@keyframes missing '{'");for(var k,z=f();k=C();)z.push(k),z=z.concat(f());return d()?S({type:"keyframes",name:N,vendor:M,keyframes:z}):a("@keyframes missing '}'")}}function w(){var S=i(),g=m(/^@supports *([^{]+)/);if(g){var M=pe(g[1]);if(!u())return a("@supports missing '{'");var N=f().concat(h());return d()?S({type:"supports",supports:M,rules:N}):a("@supports missing '}'")}}function R(){var S=i(),g=m(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var M=f().concat(h());return d()?S({type:"host",rules:M}):a("@host missing '}'")}}function E(){var S=i(),g=m(/^@media *([^{]+)/);if(g){var M=pe(g[1]);if(!u())return a("@media missing '{'");var N=f().concat(h());return d()?S({type:"media",media:M,rules:N}):a("@media missing '}'")}}function L(){var S=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return S({type:"custom-media",name:pe(g[1]),media:pe(g[2])})}function $(){var S=i(),g=m(/^@page */);if(g){var M=v()||[];if(!u())return a("@page missing '{'");for(var N=f(),k;k=b();)N.push(k),N=N.concat(f());return d()?S({type:"page",selectors:M,declarations:N}):a("@page missing '}'")}}function P(){var S=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var M=pe(g[1]),N=pe(g[2]);if(!u())return a("@document missing '{'");var k=f().concat(h());return d()?S({type:"document",document:N,vendor:M,rules:k}):a("@document missing '}'")}}function j(){var S=i(),g=m(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var M=f(),N;N=b();)M.push(N),M=M.concat(f());return d()?S({type:"font-face",declarations:M}):a("@font-face missing '}'")}}var U=D("import"),Y=D("charset"),V=D("namespace");function D(S){var g=new RegExp("^@"+S+"\\s*([^;]+);");return function(){var M=i(),N=m(g);if(N){var k={type:S};return k[S]=N[1].trim(),M(k)}}}function x(){if(e[0]==="@")return I()||E()||L()||w()||U()||Y()||V()||P()||$()||R()||j()}function F(){var S=i(),g=v();return g?(f(),S({type:"rule",selectors:g,declarations:T()})):a("selector missing")}return Tt(s())}function pe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Tt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){Tt(a,n)}):c&&typeof c=="object"&&Tt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var mr={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 bo(e){var t=mr[e.tagName]?mr[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var pr=/([^\\]):hover/,wo=new RegExp(pr.source,"g");function fr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=yo(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){pr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return So(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(wo,"$1.\\:hover");return"".concat(a,", ").concat(s)});return t?.stylesWithHoverClass.set(e,c),c}function vr(){var e=new Map;return{stylesWithHoverClass:e}}function To(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case _.Document:return r.implementation.createDocument(null,"",null);case _.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case _.Element:{var i=bo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=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 L=l.getContext("2d");L&&L.drawImage(m,0,0,m.width,m.height)},m.src=h,l.RRNodeType&&(l.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")l.style.width=h;else if(d==="rr_height")l.style.height=h;else if(d==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":l.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":l.pause();break}}else{var f=i==="textarea"&&d==="value",y=i==="style"&&d==="_cssText";if(y&&n&&(h=fr(h,o),typeof h=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,T=[],C="https://replay-cors-proxy.highlightrun.workers.dev";(b=v.exec(h))!==null;)b.index===v.lastIndex&&v.lastIndex++,b.forEach(function(L,$){if($===0){var P=L.slice(5,L.length-2);T.push({originalUrl:P,proxyUrl:P.replace(P,"".concat(C,"?url=").concat(P))})}});T.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(f||y){for(var I=r.createTextNode(h),w=0,R=Array.from(l.childNodes);w<R.length;w++){var E=R[w];E.nodeType===l.TEXT_NODE&&l.removeChild(E)}return l.appendChild(I),"continue"}try{if(e.isSVG&&d==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")l.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return l.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?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(d,h))}}catch{}}};for(var a in e.attributes)c(a);if(i==="img"){var s=l;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case _.Text:return r.createTextNode(e.isStyle&&n?fr(e.textContent,o):e.textContent);case _.CDATA:return r.createCDATASection(e.textContent);case _.Comment:return r.createComment(e.textContent);default:return null}}function it(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=To(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===_.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==_.DocumentType&&(e.childNodes[0].type===_.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===_.Document||e.type===_.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=it(m,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&nr(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function No(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function Eo(e,t){var r=t.getMeta(e);if(r?.type===_.Element){var n=e;for(var o in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function Co(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new gt:a,u=it(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return No(s,function(d){n&&n(d),Eo(d,s)}),u}function ie(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Oe=`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(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function Re(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Be(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Be(e,t,i||{},!0)}function Se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function Nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Et(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const gr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(ot(n,t,r))return!0;return!1}function yr(e,t){return t.getId(e)!==-1}function st(e,t){return t.getId(e)===Ge}function Ct(e,t){if(je(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ct(e.parentNode,t):!0:!0}function It(e){return Boolean(e.changedTouches)}function kt(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 r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function br(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function Mt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Mt(e.children[r],t)}function De(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function xt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ot(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Ot(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function Rt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Sr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Io=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Re,hookSetter:Be,patch:Se,getWindowHeight:Nt,getWindowWidth:Et,isCanvasNode:gr,isBlocked:se,isSerialized:yr,isIgnored:st,isAncestorRemoved:Ct,isTouchEvent:It,polyfill:kt,queueToResolveTrees:br,iterateResolveTree:Mt,isSerializedIframe:De,isSerializedStylesheet:xt,getBaseDimension:Ot,hasShadowRoot:ze,getNestedRule:Le,getPositionsAndIndex:Rt,uniqueTextMutations:Sr}),O=(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))(O||{}),A=(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))(A||{}),ee=(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))(ee||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),Ce=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ce||{}),H=(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))(H||{});function wr(e){return"__ln"in e}class ko{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&wr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&wr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Tr=(e,t)=>`${e}@${t}`;class Mo{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=[],r=new ko,n=c=>{let a=c,s=Ge;for(;s===Ge;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const f=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||f)return;const y=je(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),v=n(c);if(y===-1||v===-1)return r.addNode(c);const b=Ee(c,{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=>{De(T,this.mirror)&&this.iframeManager.addIframe(T),xt(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(T,C)=>{this.iframeManager.attachIframe(T,C,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,C)=>{this.stylesheetManager.attachStylesheet(T,C,this.mirror)}});b&&t.push({parentId:y,nextId:v,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Nr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Cr(this.droppedSet,c)&&!Nr(this.removes,c,this.mirror)||Cr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=bt(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!st(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:cr(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=yt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.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 l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!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]=ar(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(se(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||st(r,this.mirror)||!yr(r,this.mirror)||(this.addedSet.has(r)?(Dt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Ct(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Tr(n,o)]?Dt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(st(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Tr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}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 Dt(e,t){e.delete(t),t.childNodes.forEach(r=>Dt(e,r))}function Nr(e,t,r){return e.length===0?!1:Er(e,t,r)}function Er(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:Er(e,n,r)}function Cr(e,t){return e.size===0?!1:Ir(e,t)}function Ir(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Ir(e,r):!1}var xo=Object.defineProperty,Oo=Object.defineProperties,Ro=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Mr=(e,t,r)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xr=(e,t)=>{for(var r in t||(t={}))Do.call(t,r)&&Mr(e,r,t[r]);if(kr)for(var r of kr(t))Lo.call(t,r)&&Mr(e,r,t[r]);return e},Ao=(e,t)=>Oo(e,Ro(t));const Ie=[],Or=typeof CSSGroupingRule<"u",Rr=typeof CSSMediaRule<"u",Dr=typeof CSSSupportsRule<"u",Lr=typeof CSSConditionRule<"u";function He(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 Ar(e,t){var r,n;const o=new Mo;Ie.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Fo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Re(d=>{const h=Date.now()-c;e(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Re(d=>{const h=He(d),{clientX:m,clientY:p}=It(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:p,id:n.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Po({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=He(s);if(se(u,n,!0)||gr(u))return;const d=It(s)?s.changedTouches[0]:s;if(!d)return;const h=r.getId(u),{clientX:m,clientY:p}=d;e({type:ee[a],id:h,x:m,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Fr({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Re(l=>{const c=He(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function _o({viewportResizeCb:e}){let t=-1,r=-1;const n=Re(()=>{const o=Nt(),i=Et();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Pr(e,t){const r=xr({},e);return t||delete r.userTriggered,r}const $o=["INPUT","TEXTAREA","SELECT"],_r=new WeakMap;function Wo({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let f=He(p);const y=p.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||$o.indexOf(f.tagName)<0||se(f,n,!0))return;const v=f.type;if(f.classList.contains(o))return;let b=f.value,T=!1;v==="radio"||v==="checkbox"?T=f.checked:(i[f.tagName.toLowerCase()]||i[v])&&(b=yt({maskInputOptions:i,tagName:f.tagName,type:v,value:b,maskInputFn:l})),u(f,Pr({text:b,isChecked:T,userTriggered:y},a));const C=f.name;v==="radio"&&C&&T&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(I=>{I!==f&&u(I,Pr({text:I.value,isChecked:!T,userTriggered:!1},a))})}function u(p,f){const y=_r.get(p);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){_r.set(p,f);const v=r.getId(p);e(Ao(xr({},f),{id:v}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,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(p=>Be(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function at(e){const t=[];function r(n,o){if(Or&&n.parentRule instanceof CSSGroupingRule||Rr&&n.parentRule instanceof CSSMediaRule||Dr&&n.parentRule instanceof CSSSupportsRule||Lr&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Uo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,[c,a])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,[c])};const i={};Or?i.CSSGroupingRule=r.CSSGroupingRule:(Rr&&(i.CSSMediaRule=r.CSSMediaRule),Lr&&(i.CSSConditionRule=r.CSSConditionRule),Dr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...at(this),u||0]}]}),l[c].insertRule.apply(this,[s,u])},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...at(this),s]}]}),l[c].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function jo({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:at(this.parentRule)}),n.apply(this,[i,l,c])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:at(this.parentRule)}),o.apply(this,[i])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Vo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Re(c=>{const a=He(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Ce.Play)),ie("pause",o(Ce.Pause)),ie("seeked",o(Ce.Seeked)),ie("volumechange",o(Ce.VolumeChange))];return()=>{i.forEach(l=>l())}}function Go({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=Se(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Bo(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...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),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),a(...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 zo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Bo(e,t);const n=Ar(e,e.doc),o=Fo(e),i=Po(e),l=Fr(e),c=_o(e),a=Wo(e),s=Vo(e),u=Uo(e,{win:r}),d=jo(e,{win:r}),h=e.collectFonts?Go(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,r,p.options));return()=>{Ie.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(p=>p())}}class Ho{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Yo=Object.defineProperty,Xo=Object.defineProperties,Zo=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,Wr=(e,t,r)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ur=(e,t)=>{for(var r in t||(t={}))Ko.call(t,r)&&Wr(e,r,t[r]);if($r)for(var r of $r(t))qo.call(t,r)&&Wr(e,r,t[r]);return e},jr=(e,t)=>Xo(e,Zo(t));class Jo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(Se(HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){!Ve(t)||(Ar(jr(Ur({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Fr(jr(Ur({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(Se(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=typeof Uint8Array>"u"?[]:new Uint8Array(256),lt=0;lt<Ae.length;lt++)Ye[Ae.charCodeAt(lt)]=lt;var Qo=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ei=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Ye[e.charCodeAt(n)],l=Ye[e.charCodeAt(n+1)],c=Ye[e.charCodeAt(n+2)],a=Ye[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Vr=new Map;function ti(e,t){let r=Vr.get(e);return r||(r=new Map,Vr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Gr=(e,t,r)=>{if(!e||!(zr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=ti(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ct(e,t,r){if(e instanceof Array)return e.map(n=>ct(n,t,r));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 n=e.constructor.name,o=Qo(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ct(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ct(e.data,t,r),e.width,e.height]};if(zr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Gr(e,t,r);return{rr_type:n,index:o}}}}return e}const Br=(e,t,r)=>[...e].map(n=>ct(n,t,r)),zr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function ri(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=Se(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=Br([...s],t,this);e(this.canvas,{type:fe["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:fe["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Hr(e,t){const r=[];try{const n=Se(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Yr(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=Se(e,a,function(u){return function(...d){const h=u.apply(this,d);if(Gr(h,i,e),!se(this.canvas,n,!0)){const m=Br([...d],i,e),p={type:t,property:a,args:m};r(this.canvas,p)}return h}});l.push(s)}catch{const u=Be(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ni(e,t,r,n){const o=[];return o.push(...Yr(t.WebGLRenderingContext.prototype,fe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Yr(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function oi(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function ii(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=oi(e,o),l=i.indexOf(`
|
package/dist/rrweb-all.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var _;(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"})(_||(_={}));function nr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var gt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-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 r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.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,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function or(){return new gt}function yt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var ir="__rrweb_original__";function Xn(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=ir in i?i[ir]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function bt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Zn=1,Kn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function qn(){return Zn++}function Jn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Kn.test(t)?"div":t}function St(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Qn).join(""):null}catch{return null}}function Qn(e){var t=e.cssText;if(eo(e))try{t=St(e.styleSheet)||t}catch{}return t}function eo(e){return"styleSheet"in e}function to(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ro(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,sr,no=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oo=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,io=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(no,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!oo.test(a)||io.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(ro(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var so=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/;function lo(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(ao),!(r>=t.length);){var i=n(so);if(i.slice(-1)===",")i=nt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=nt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function co(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function wt(){var e=document.createElement("a");return e.href="",e.href}function ar(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?lo(e,n):r==="style"&&n?rt(n,wt()):t==="object"&&r==="data"&&n?nt(e,n):n}function lr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ot(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ot(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ot(e.parentNode,t,r):!1}function cr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ot(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function uo(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ur(e){return e.getAttribute("href")?e.sheet!==null:!0}function dr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function ho(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,b=t.newlyAddedElement,T=b===void 0?!1:b,C=t.enableStrictPrivacy,I=mo(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:_.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:_.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskTextClass:l,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:T,enableStrictPrivacy:C,rootId:I});case e.TEXT_NODE:return po(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:C,rootId:I});case e.CDATA_SECTION_NODE:return{type:_.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:_.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function mo(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function po(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=to(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=rt(s,wt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&cr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=bt(s))}return{type:_.Text,textContent:s||"",isStyle:u,rootId:c}}function fo(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,y=f===void 0?!1:f,v=t.enableStrictPrivacy,b=t.rootId,T=lr(e,n,o),C=lr(e,s,null),I=Jn(e),w={},R=e.attributes.length,E=0;E<R;E++){var L=e.attributes[E];w[L.name]=ar(r,I,L.name,L.value)}if(I==="link"&&i){var $=Array.from(r.styleSheets).find(function(N){return N.href===e.href}),P=null;$&&(P=St($)),P&&(delete w.rel,delete w.href,w._cssText=rt(P,$.href))}if(I==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=St(e.sheet);P&&(w._cssText=rt(P,wt()))}if(I==="input"||I==="textarea"||I==="select"){var j=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&j?w.value=yt({type:w.type,tagName:I,value:j,maskInputOptions:c,maskInputFn:a}):e.checked&&(w.checked=e.checked)}if(I==="option"&&(e.selected&&!c.select?w.selected=!0:delete w.selected),I==="canvas"&&m){if(e.__context==="2d")Xn(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),Y=document.createElement("canvas");Y.width=e.width,Y.height=e.height;var V=Y.toDataURL(d.type,d.quality);U!==V&&(w.rr_dataURL=U)}}if(I==="img"&&h&&!T&&!C){xe||(xe=r.createElement("canvas"),sr=xe.getContext("2d"));var D=e,x=D.crossOrigin;D.crossOrigin="anonymous";var F=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,sr.drawImage(D,0,0),w.rr_dataURL=xe.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(D.currentSrc,"! Error: ").concat(N))}x?w.crossOrigin=x:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?F():D.onload=F}if((I==="audio"||I==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),T||C||I==="img"&&v){var S=e.getBoundingClientRect(),g=S.width,M=S.height;w={class:w.class,rr_width:"".concat(g,"px"),rr_height:"".concat(M,"px")},v&&(T=!0)}return I==="iframe"&&!p(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:_.Element,tagName:I,attributes:w,childNodes:[],isSVG:co(e)||void 0,needBlock:T,needMask:C,rootId:b}}function Z(e){return e===void 0?"":e.toLowerCase()}function vo(e,t){return!!(t.comment&&e.type===_.Comment||e.type===_.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"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=v===void 0?{}:v,T=t.inlineImages,C=T===void 0?!1:T,I=t.recordCanvas,w=I===void 0?!1:I,R=t.onSerialize,E=t.onIframeLoad,L=t.iframeLoadTimeout,$=L===void 0?5e3:L,P=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,U=j===void 0?5e3:j,Y=t.keepIframeSrcFn,V=Y===void 0?function(){return!1}:Y,D=t.newlyAddedElement,x=D===void 0?!1:D,F=t.enableStrictPrivacy,S=t.preserveWhiteSpace,g=S===void 0?!0:S,M=ho(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:b,inlineImages:C,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:x,enableStrictPrivacy:F});if(!M)return console.warn(e,"not serialized"),null;var N;if(n.hasNode(e)?N=n.getId(e):vo(M,y)||!g&&M.type===_.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Ge:N=qn(),N===Ge)return null;var k=Object.assign(M,{id:N});n.add(e,k),R&&R(e);var z=!s,G=F;if(k.type===_.Element){if(z=z&&!k.needBlock,G=F||!!k.needBlock||!!k.needMask,G&&k.tagName==="img"){var oe=e.cloneNode();oe.src="",n.add(oe,k)}delete k.needBlock,delete k.needMask;var B=e.shadowRoot;B&&Ve(B)&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&z){y.headWhitespace&&k.type===_.Element&&k.tagName==="head"&&(g=!1);for(var X={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:G},ge=0,tt=Array.from(e.childNodes);ge<tt.length;ge++){var We=tt[ge],ye=Ee(We,X);ye&&k.childNodes.push(ye)}if(nr(e)&&e.shadowRoot)for(var rr=0,Ue=Array.from(e.shadowRoot.childNodes);rr<Ue.length;rr++){var We=Ue[rr],ye=Ee(We,X);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),k.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(k.isShadow=!0),k.type===_.Element&&k.tagName==="iframe"&&uo(e,function(){var be=e.contentDocument;if(be&&E){var Hn=Ee(be,{doc:be,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});Hn&&E(e,Hn)}},$),k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});be&&P(e,be)}},U),ur(e)===!1)||k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,enableStrictPrivacy:F,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V});be&&P(e,be)}},U),ur(e)===!1)?null:k}function go(e,t){var r=t||{},n=r.mirror,o=n===void 0?new gt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,b=v===void 0?!1:v,T=r.maskAllInputs,C=T===void 0?!1:T,I=r.maskTextFn,w=r.maskInputFn,R=r.slimDOM,E=R===void 0?!1:R,L=r.dataURLOptions,$=r.preserveWhiteSpace,P=r.onSerialize,j=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,x=D===void 0?function(){return!1}:D,F=r.enableStrictPrivacy,S=F===void 0?!1:F,g=C===!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}:C===!1?{password:!0}:C,M=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:I,maskInputFn:w,slimDOMOptions:M,dataURLOptions:L,inlineImages:y,recordCanvas:b,preserveWhiteSpace:$,onSerialize:P,onIframeLoad:j,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:V,keepIframeSrcFn:x,newlyAddedElement:!1,enableStrictPrivacy:S})}var hr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yo(e,t){t===void 0&&(t={});var r=1,n=1;function o(S){var g=S.match(/\n/g);g&&(r+=g.length);var M=S.lastIndexOf(`
|
|
1
|
+
var rrweb=function(q){"use strict";var _;(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"})(_||(_={}));function nr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Ve(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var gt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-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 r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.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,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function or(){return new gt}function yt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var ir="__rrweb_original__";function Xn(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=ir in i?i[ir]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function bt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Zn=1,Kn=new RegExp("[^a-z0-9-_:]"),Ge=-2;function qn(){return Zn++}function Jn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Kn.test(t)?"div":t}function St(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Qn).join(""):null}catch{return null}}function Qn(e){var t=e.cssText;if(eo(e))try{t=St(e.styleSheet)||t}catch{}return t}function eo(e){return"styleSheet"in e}function to(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ro(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,sr,no=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,oo=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,io=/^(data:)([^,]*),(.*)/i;function rt(e,t){return(e||"").replace(no,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!oo.test(a)||io.test(a))return"url(".concat(s).concat(a).concat(s,")");if(a[0]==="/")return"url(".concat(s).concat(ro(t)+a).concat(s,")");var u=t.split("/"),d=a.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var so=/^[^ \t\n\r\u000c]+/,ao=/^[, \t\n\r\u000c]+/;function lo(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(ao),!(r>=t.length);){var i=n(so);if(i.slice(-1)===",")i=nt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=nt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function co(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function wt(){var e=document.createElement("a");return e.href="",e.href}function ar(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?lo(e,n):r==="style"&&n?rt(n,wt()):t==="object"&&r==="data"&&n?nt(e,n):n}function lr(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function ot(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ot(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?ot(e.parentNode,t,r):!1}function cr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ot(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function uo(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function ur(e){return e.getAttribute("href")?e.sheet!==null:!0}function dr(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function ho(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,f=t.inlineImages,y=t.recordCanvas,v=t.keepIframeSrcFn,b=t.newlyAddedElement,T=b===void 0?!1:b,C=t.enableStrictPrivacy,I=mo(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:_.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:_.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskTextClass:l,dataURLOptions:p,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:T,enableStrictPrivacy:C,rootId:I});case e.TEXT_NODE:return po(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:C,rootId:I});case e.CDATA_SECTION_NODE:return{type:_.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:_.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function mo(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function po(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=to(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=rt(s,wt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):a==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&cr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!h&&a){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(a)&&s&&(s=bt(s))}return{type:_.Text,textContent:s||"",isStyle:u,rootId:c}}function fo(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.maskTextClass,u=t.dataURLOptions,d=u===void 0?{}:u,h=t.inlineImages,m=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,y=f===void 0?!1:f,v=t.enableStrictPrivacy,b=t.rootId,T=lr(e,n,o),C=lr(e,s,null),I=Jn(e),w={},R=e.attributes.length,E=0;E<R;E++){var L=e.attributes[E];w[L.name]=ar(r,I,L.name,L.value)}if(I==="link"&&i){var $=Array.from(r.styleSheets).find(function(N){return N.href===e.href}),P=null;$&&(P=St($)),P&&(delete w.rel,delete w.href,w._cssText=rt(P,$.href))}if(I==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=St(e.sheet);P&&(w._cssText=rt(P,wt()))}if(I==="input"||I==="textarea"||I==="select"){var j=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&j?w.value=yt({type:w.type,tagName:I,value:j,maskInputOptions:c,maskInputFn:a}):e.checked&&(w.checked=e.checked)}if(I==="option"&&(e.selected&&!c.select?w.selected=!0:delete w.selected),I==="canvas"&&m){if(e.__context==="2d")Xn(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),Y=document.createElement("canvas");Y.width=e.width,Y.height=e.height;var V=Y.toDataURL(d.type,d.quality);U!==V&&(w.rr_dataURL=U)}}if(I==="img"&&h&&!T&&!C&&!v){xe||(xe=r.createElement("canvas"),sr=xe.getContext("2d"));var D=e,x=D.crossOrigin;D.crossOrigin="anonymous";var F=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,sr.drawImage(D,0,0),w.rr_dataURL=xe.toDataURL(d.type,d.quality)}catch(N){console.warn("Cannot inline img src=".concat(D.currentSrc,"! Error: ").concat(N))}x?w.crossOrigin=x:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?F():D.onload=F}if((I==="audio"||I==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),T||C||I==="img"&&v){var S=e.getBoundingClientRect(),g=S.width,M=S.height;w={class:w.class,rr_width:"".concat(g,"px"),rr_height:"".concat(M,"px")},v&&(T=!0)}return I==="iframe"&&!p(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:_.Element,tagName:I,attributes:w,childNodes:[],isSVG:co(e)||void 0,needBlock:T,needMask:C,rootId:b}}function Z(e){return e===void 0?"":e.toLowerCase()}function vo(e,t){return!!(t.comment&&e.type===_.Comment||e.type===_.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"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest")||t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))))}function Ee(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=v===void 0?{}:v,T=t.inlineImages,C=T===void 0?!1:T,I=t.recordCanvas,w=I===void 0?!1:I,R=t.onSerialize,E=t.onIframeLoad,L=t.iframeLoadTimeout,$=L===void 0?5e3:L,P=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,U=j===void 0?5e3:j,Y=t.keepIframeSrcFn,V=Y===void 0?function(){return!1}:Y,D=t.newlyAddedElement,x=D===void 0?!1:D,F=t.enableStrictPrivacy,S=t.preserveWhiteSpace,g=S===void 0?!0:S,M=ho(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,dataURLOptions:b,inlineImages:C,recordCanvas:w,keepIframeSrcFn:V,newlyAddedElement:x,enableStrictPrivacy:F});if(!M)return console.warn(e,"not serialized"),null;var N;if(n.hasNode(e)?N=n.getId(e):vo(M,y)||!g&&M.type===_.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?N=Ge:N=qn(),N===Ge)return null;var k=Object.assign(M,{id:N});n.add(e,k),R&&R(e);var z=!s,G=F;if(k.type===_.Element){if(z=z&&!k.needBlock,G=F||!!k.needBlock||!!k.needMask,G&&k.tagName==="img"){var oe=e.cloneNode();oe.src="",n.add(oe,k)}delete k.needBlock,delete k.needMask;var B=e.shadowRoot;B&&Ve(B)&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&z){y.headWhitespace&&k.type===_.Element&&k.tagName==="head"&&(g=!1);for(var X={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:G},ge=0,tt=Array.from(e.childNodes);ge<tt.length;ge++){var We=tt[ge],ye=Ee(We,X);ye&&k.childNodes.push(ye)}if(nr(e)&&e.shadowRoot)for(var rr=0,Ue=Array.from(e.shadowRoot.childNodes);rr<Ue.length;rr++){var We=Ue[rr],ye=Ee(We,X);ye&&(Ve(e.shadowRoot)&&(ye.isShadow=!0),k.childNodes.push(ye))}}return e.parentNode&&je(e.parentNode)&&Ve(e.parentNode)&&(k.isShadow=!0),k.type===_.Element&&k.tagName==="iframe"&&uo(e,function(){var be=e.contentDocument;if(be&&E){var Hn=Ee(be,{doc:be,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});Hn&&E(e,Hn)}},$),k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V,enableStrictPrivacy:F});be&&P(e,be)}},U),ur(e)===!1)||k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(dr(e,function(){if(P){var be=Ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:w,preserveWhiteSpace:g,onSerialize:R,onIframeLoad:E,iframeLoadTimeout:$,enableStrictPrivacy:F,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:V});be&&P(e,be)}},U),ur(e)===!1)?null:k}function go(e,t){var r=t||{},n=r.mirror,o=n===void 0?new gt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,h=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,f=r.inlineImages,y=f===void 0?!1:f,v=r.recordCanvas,b=v===void 0?!1:v,T=r.maskAllInputs,C=T===void 0?!1:T,I=r.maskTextFn,w=r.maskInputFn,R=r.slimDOM,E=R===void 0?!1:R,L=r.dataURLOptions,$=r.preserveWhiteSpace,P=r.onSerialize,j=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,x=D===void 0?function(){return!1}:D,F=r.enableStrictPrivacy,S=F===void 0?!1:F,g=C===!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}:C===!1?{password:!0}:C,M=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return Ee(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:I,maskInputFn:w,slimDOMOptions:M,dataURLOptions:L,inlineImages:y,recordCanvas:b,preserveWhiteSpace:$,onSerialize:P,onIframeLoad:j,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:V,keepIframeSrcFn:x,newlyAddedElement:!1,enableStrictPrivacy:S})}var hr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yo(e,t){t===void 0&&(t={});var r=1,n=1;function o(S){var g=S.match(/\n/g);g&&(r+=g.length);var M=S.lastIndexOf(`
|
|
2
2
|
`);n=M===-1?n+S.length:S.length-M}function i(){var S={line:r,column:n};return function(g){return g.position=new l(S),p(),g}}var l=function(){function S(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return S}();l.prototype.content=e;var c=[];function a(S){var g=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(S));if(g.reason=S,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var S=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:c}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var S,g=[];for(p(),f(g);e.length&&e.charAt(0)!=="}"&&(S=x()||F());)S!==!1&&(g.push(S),f(g));return g}function m(S){var g=S.exec(e);if(g){var M=g[0];return o(M),e=e.slice(M.length),g}}function p(){m(/^\s*/)}function f(S){S===void 0&&(S=[]);for(var g;g=y();)g!==!1&&S.push(g),g=y();return S}function y(){var S=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var M=e.slice(2,g-2);return n+=2,o(M),e=e.slice(g),n+=2,S({type:"comment",comment:M})}}function v(){var S=m(/^([^{]+)/);if(S)return pe(S[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function b(){var S=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var M=pe(g[0]);if(!m(/^:\s*/))return a("property missing ':'");var N=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),k=S({type:"declaration",property:M.replace(hr,""),value:N?pe(N[0]).replace(hr,""):""});return m(/^[;\s]*/),k}}function T(){var S=[];if(!u())return a("missing '{'");f(S);for(var g;g=b();)g!==!1&&(S.push(g),f(S)),g=b();return d()?S:a("missing '}'")}function C(){for(var S,g=[],M=i();S=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(S[1]),m(/^,\s*/);if(g.length)return M({type:"keyframe",values:g,declarations:T()})}function I(){var S=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var M=g[1];if(g=m(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var N=g[1];if(!u())return a("@keyframes missing '{'");for(var k,z=f();k=C();)z.push(k),z=z.concat(f());return d()?S({type:"keyframes",name:N,vendor:M,keyframes:z}):a("@keyframes missing '}'")}}function w(){var S=i(),g=m(/^@supports *([^{]+)/);if(g){var M=pe(g[1]);if(!u())return a("@supports missing '{'");var N=f().concat(h());return d()?S({type:"supports",supports:M,rules:N}):a("@supports missing '}'")}}function R(){var S=i(),g=m(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var M=f().concat(h());return d()?S({type:"host",rules:M}):a("@host missing '}'")}}function E(){var S=i(),g=m(/^@media *([^{]+)/);if(g){var M=pe(g[1]);if(!u())return a("@media missing '{'");var N=f().concat(h());return d()?S({type:"media",media:M,rules:N}):a("@media missing '}'")}}function L(){var S=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return S({type:"custom-media",name:pe(g[1]),media:pe(g[2])})}function $(){var S=i(),g=m(/^@page */);if(g){var M=v()||[];if(!u())return a("@page missing '{'");for(var N=f(),k;k=b();)N.push(k),N=N.concat(f());return d()?S({type:"page",selectors:M,declarations:N}):a("@page missing '}'")}}function P(){var S=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var M=pe(g[1]),N=pe(g[2]);if(!u())return a("@document missing '{'");var k=f().concat(h());return d()?S({type:"document",document:N,vendor:M,rules:k}):a("@document missing '}'")}}function j(){var S=i(),g=m(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var M=f(),N;N=b();)M.push(N),M=M.concat(f());return d()?S({type:"font-face",declarations:M}):a("@font-face missing '}'")}}var U=D("import"),Y=D("charset"),V=D("namespace");function D(S){var g=new RegExp("^@"+S+"\\s*([^;]+);");return function(){var M=i(),N=m(g);if(N){var k={type:S};return k[S]=N[1].trim(),M(k)}}}function x(){if(e[0]==="@")return I()||E()||L()||w()||U()||Y()||V()||P()||$()||R()||j()}function F(){var S=i(),g=v();return g?(f(),S({type:"rule",selectors:g,declarations:T()})):a("selector missing")}return Tt(s())}function pe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Tt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){Tt(a,n)}):c&&typeof c=="object"&&Tt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var mr={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 bo(e){var t=mr[e.tagName]?mr[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function So(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var pr=/([^\\]):hover/,wo=new RegExp(pr.source,"g");function fr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=yo(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){pr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return So(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(wo,"$1.\\:hover");return"".concat(a,", ").concat(s)});return t?.stylesWithHoverClass.set(e,c),c}function vr(){var e=new Map;return{stylesWithHoverClass:e}}function To(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case _.Document:return r.implementation.createDocument(null,"",null);case _.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case _.Element:{var i=bo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=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 L=l.getContext("2d");L&&L.drawImage(m,0,0,m.width,m.height)},m.src=h,l.RRNodeType&&(l.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")l.style.width=h;else if(d==="rr_height")l.style.height=h;else if(d==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":l.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":l.pause();break}}else{var f=i==="textarea"&&d==="value",y=i==="style"&&d==="_cssText";if(y&&n&&(h=fr(h,o),typeof h=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,T=[],C="https://replay-cors-proxy.highlightrun.workers.dev";(b=v.exec(h))!==null;)b.index===v.lastIndex&&v.lastIndex++,b.forEach(function(L,$){if($===0){var P=L.slice(5,L.length-2);T.push({originalUrl:P,proxyUrl:P.replace(P,"".concat(C,"?url=").concat(P))})}});T.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(f||y){for(var I=r.createTextNode(h),w=0,R=Array.from(l.childNodes);w<R.length;w++){var E=R[w];E.nodeType===l.TEXT_NODE&&l.removeChild(E)}return l.appendChild(I),"continue"}try{if(e.isSVG&&d==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")l.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return l.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?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(d,h))}}catch{}}};for(var a in e.attributes)c(a);if(i==="img"){var s=l;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l}case _.Text:return r.createTextNode(e.isStyle&&n?fr(e.textContent,o):e.textContent);case _.CDATA:return r.createCDATASection(e.textContent);case _.Comment:return r.createComment(e.textContent);default:return null}}function it(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=To(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===_.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==_.DocumentType&&(e.childNodes[0].type===_.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===_.Document||e.type===_.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=it(m,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&nr(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function No(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function Eo(e,t){var r=t.getMeta(e);if(r?.type===_.Element){var n=e;for(var o in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function Co(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new gt:a,u=it(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return No(s,function(d){n&&n(d),Eo(d,s)}),u}function ie(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Oe=`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(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function Re(e,t,r={}){let n=null,o=0;return function(...i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Be(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Be(e,t,i||{},!0)}function Se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function Nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Et(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const gr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(ot(n,t,r))return!0;return!1}function yr(e,t){return t.getId(e)!==-1}function st(e,t){return t.getId(e)===Ge}function Ct(e,t){if(je(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Ct(e.parentNode,t):!0:!0}function It(e){return Boolean(e.changedTouches)}function kt(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 r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function br(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function Mt(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Mt(e.children[r],t)}function De(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function xt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ot(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Ot(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function Rt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Sr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Io=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Re,hookSetter:Be,patch:Se,getWindowHeight:Nt,getWindowWidth:Et,isCanvasNode:gr,isBlocked:se,isSerialized:yr,isIgnored:st,isAncestorRemoved:Ct,isTouchEvent:It,polyfill:kt,queueToResolveTrees:br,iterateResolveTree:Mt,isSerializedIframe:De,isSerializedStylesheet:xt,getBaseDimension:Ot,hasShadowRoot:ze,getNestedRule:Le,getPositionsAndIndex:Rt,uniqueTextMutations:Sr}),O=(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))(O||{}),A=(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))(A||{}),ee=(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))(ee||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),Ce=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ce||{}),H=(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))(H||{});function wr(e){return"__ln"in e}class ko{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&wr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&wr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Tr=(e,t)=>`${e}@${t}`;class Mo{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=[],r=new ko,n=c=>{let a=c,s=Ge;for(;s===Ge;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const f=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||f)return;const y=je(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),v=n(c);if(y===-1||v===-1)return r.addNode(c);const b=Ee(c,{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=>{De(T,this.mirror)&&this.iframeManager.addIframe(T),xt(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(T,C)=>{this.iframeManager.attachIframe(T,C,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,C)=>{this.stylesheetManager.attachStylesheet(T,C,this.mirror)}});b&&t.push({parentId:y,nextId:v,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Nr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Cr(this.droppedSet,c)&&!Nr(this.removes,c,this.mirror)||Cr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=bt(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!st(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:cr(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=yt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.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 l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!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]=ar(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(se(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||st(r,this.mirror)||!yr(r,this.mirror)||(this.addedSet.has(r)?(Dt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Ct(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Tr(n,o)]?Dt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(st(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Tr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}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 Dt(e,t){e.delete(t),t.childNodes.forEach(r=>Dt(e,r))}function Nr(e,t,r){return e.length===0?!1:Er(e,t,r)}function Er(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:Er(e,n,r)}function Cr(e,t){return e.size===0?!1:Ir(e,t)}function Ir(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Ir(e,r):!1}var xo=Object.defineProperty,Oo=Object.defineProperties,Ro=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Mr=(e,t,r)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xr=(e,t)=>{for(var r in t||(t={}))Do.call(t,r)&&Mr(e,r,t[r]);if(kr)for(var r of kr(t))Lo.call(t,r)&&Mr(e,r,t[r]);return e},Ao=(e,t)=>Oo(e,Ro(t));const Ie=[],Or=typeof CSSGroupingRule<"u",Rr=typeof CSSMediaRule<"u",Dr=typeof CSSSupportsRule<"u",Lr=typeof CSSConditionRule<"u";function He(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 Ar(e,t){var r,n;const o=new Mo;Ie.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Fo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Re(d=>{const h=Date.now()-c;e(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Re(d=>{const h=He(d),{clientX:m,clientY:p}=It(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:p,id:n.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Po({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=He(s);if(se(u,n,!0)||gr(u))return;const d=It(s)?s.changedTouches[0]:s;if(!d)return;const h=r.getId(u),{clientX:m,clientY:p}=d;e({type:ee[a],id:h,x:m,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Fr({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Re(l=>{const c=He(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function _o({viewportResizeCb:e}){let t=-1,r=-1;const n=Re(()=>{const o=Nt(),i=Et();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Pr(e,t){const r=xr({},e);return t||delete r.userTriggered,r}const $o=["INPUT","TEXTAREA","SELECT"],_r=new WeakMap;function Wo({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let f=He(p);const y=p.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||$o.indexOf(f.tagName)<0||se(f,n,!0))return;const v=f.type;if(f.classList.contains(o))return;let b=f.value,T=!1;v==="radio"||v==="checkbox"?T=f.checked:(i[f.tagName.toLowerCase()]||i[v])&&(b=yt({maskInputOptions:i,tagName:f.tagName,type:v,value:b,maskInputFn:l})),u(f,Pr({text:b,isChecked:T,userTriggered:y},a));const C=f.name;v==="radio"&&C&&T&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(I=>{I!==f&&u(I,Pr({text:I.value,isChecked:!T,userTriggered:!1},a))})}function u(p,f){const y=_r.get(p);if(!y||y.text!==f.text||y.isChecked!==f.isChecked){_r.set(p,f);const v=r.getId(p);e(Ao(xr({},f),{id:v}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,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(p=>Be(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function at(e){const t=[];function r(n,o){if(Or&&n.parentRule instanceof CSSGroupingRule||Rr&&n.parentRule instanceof CSSMediaRule||Dr&&n.parentRule instanceof CSSSupportsRule||Lr&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Uo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,[c,a])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,[c])};const i={};Or?i.CSSGroupingRule=r.CSSGroupingRule:(Rr&&(i.CSSMediaRule=r.CSSMediaRule),Lr&&(i.CSSConditionRule=r.CSSConditionRule),Dr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...at(this),u||0]}]}),l[c].insertRule.apply(this,[s,u])},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...at(this),s]}]}),l[c].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function jo({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:at(this.parentRule)}),n.apply(this,[i,l,c])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:at(this.parentRule)}),o.apply(this,[i])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Vo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Re(c=>{const a=He(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Ce.Play)),ie("pause",o(Ce.Pause)),ie("seeked",o(Ce.Seeked)),ie("volumechange",o(Ce.VolumeChange))];return()=>{i.forEach(l=>l())}}function Go({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=Se(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Bo(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...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),l(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),c(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),a(...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 zo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Bo(e,t);const n=Ar(e,e.doc),o=Fo(e),i=Po(e),l=Fr(e),c=_o(e),a=Wo(e),s=Vo(e),u=Uo(e,{win:r}),d=jo(e,{win:r}),h=e.collectFonts?Go(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,r,p.options));return()=>{Ie.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(p=>p())}}class Ho{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Yo=Object.defineProperty,Xo=Object.defineProperties,Zo=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,Wr=(e,t,r)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ur=(e,t)=>{for(var r in t||(t={}))Ko.call(t,r)&&Wr(e,r,t[r]);if($r)for(var r of $r(t))qo.call(t,r)&&Wr(e,r,t[r]);return e},jr=(e,t)=>Xo(e,Zo(t));class Jo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(Se(HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){!Ve(t)||(Ar(jr(Ur({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Fr(jr(Ur({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(Se(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=typeof Uint8Array>"u"?[]:new Uint8Array(256),lt=0;lt<Ae.length;lt++)Ye[Ae.charCodeAt(lt)]=lt;var Qo=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ei=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Ye[e.charCodeAt(n)],l=Ye[e.charCodeAt(n+1)],c=Ye[e.charCodeAt(n+2)],a=Ye[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Vr=new Map;function ti(e,t){let r=Vr.get(e);return r||(r=new Map,Vr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Gr=(e,t,r)=>{if(!e||!(zr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=ti(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ct(e,t,r){if(e instanceof Array)return e.map(n=>ct(n,t,r));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 n=e.constructor.name,o=Qo(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ct(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ct(e.data,t,r),e.width,e.height]};if(zr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Gr(e,t,r);return{rr_type:n,index:o}}}}return e}const Br=(e,t,r)=>[...e].map(n=>ct(n,t,r)),zr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function ri(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=Se(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=Br([...s],t,this);e(this.canvas,{type:fe["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:fe["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Hr(e,t){const r=[];try{const n=Se(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Yr(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=Se(e,a,function(u){return function(...d){const h=u.apply(this,d);if(Gr(h,i,e),!se(this.canvas,n,!0)){const m=Br([...d],i,e),p={type:t,property:a,args:m};r(this.canvas,p)}return h}});l.push(s)}catch{const u=Be(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ni(e,t,r,n){const o=[];return o.push(...Yr(t.WebGLRenderingContext.prototype,fe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Yr(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function oi(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function ii(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=oi(e,o),l=i.indexOf(`
|