@highlight-run/rrweb 2.1.4 → 2.1.5
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 +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- 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.js +3 -3
- package/dist/replay/rrweb-replay.min.js +3 -3
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.js +5 -5
- package/dist/rrweb-all.min.js +5 -5
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +0 -1
- package/lib/record/rrweb-record.js +0 -1
- package/lib/rrweb-all.js +0 -1
- package/lib/rrweb.js +0 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rrwebRecord=function(){"use strict";var E;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(E||(E={}));function Et(e){return e.nodeType===e.ELEMENT_NODE}function de(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function he(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Pe=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 Nt(){return new Pe}function Te(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(s?l=s(l):l="*".repeat(l.length)),l}var Ae="__rrweb_original__";function Rt(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 s=t.getImageData,l=Ae in s?s[Ae]:s,a=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(a.some(function(i){return i!==0}))return!1}return!0}function Oe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Dt=1,Ft=new RegExp("[^a-z0-9-_:]"),pe=-2;function Pt(){return Dt++}function At(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Ft.test(t)?"div":t}function xe(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(_t).join(""):null}catch{return null}}function _t(e){var t=e.cssText;if(Wt(e))try{t=xe(e.styleSheet)||t}catch{}return t}function Wt(e){return"styleSheet"in e}function Gt(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function zt(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ae,_e,Vt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,jt=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zt=/^(data:)([^,]*),(.*)/i;function be(e,t){return(e||"").replace(Vt,function(r,n,o,s,l,a){var i=o||l||a,c=n||s||"";if(!i)return r;if(!jt.test(i)||Zt.test(i))return"url(".concat(c).concat(i).concat(c,")");if(i[0]==="/")return"url(".concat(c).concat(zt(t)+i).concat(c,")");var h=t.split("/"),d=i.split("/");h.pop();for(var m=0,u=d;m<u.length;m++){var p=u[m];p!=="."&&(p===".."?h.pop():h.push(p))}return"url(".concat(c).concat(h.join("/")).concat(c,")")})}var Ut=/^[^ \t\n\r\u000c]+/,Yt=/^[, \t\n\r\u000c]+/;function Ht(e,t){if(t.trim()==="")return t;var r=0;function n(c){var h,d=c.exec(t.substring(r));return d?(h=d[0],r+=h.length,h):""}for(var o=[];n(Yt),!(r>=t.length);){var s=n(Ut);if(s.slice(-1)===",")s=Se(e,s.substring(0,s.length-1)),o.push(s);else{var l="";s=Se(e,s);for(var a=!1;;){var i=t.charAt(r);if(i===""){o.push((s+l).trim());break}else if(a)i===")"&&(a=!1);else if(i===","){r+=1,o.push((s+l).trim());break}else i==="("&&(a=!0);l+=i,r+=1}}}return o.join(", ")}function Se(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Xt(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Le(){var e=document.createElement("a");return e.href="",e.href}function We(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")?Se(e,n):r==="srcset"&&n?Ht(e,n):r==="style"&&n?be(n,Le()):t==="object"&&r==="data"&&n?Se(e,n):n}function Ge(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 Ce(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Ce(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?Ce(e.parentNode,t,r):!1}function ze(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(Ce(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Bt(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ve(e){return e.getAttribute("href")?e.sheet!==null:!0}function je(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function Kt(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.inlineStylesheet,c=t.maskInputOptions,h=c===void 0?{}:c,d=t.maskTextFn,m=t.maskInputFn,u=t.dataURLOptions,p=u===void 0?{}:u,v=t.inlineImages,C=t.recordCanvas,w=t.keepIframeSrcFn,O=t.newlyAddedElement,S=O===void 0?!1:O,y=t.enableStrictPrivacy,f=$t(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:E.Document,childNodes:[],compatMode:e.compatMode,rootId:f}:{type:E.Document,childNodes:[],rootId:f};case e.DOCUMENT_TYPE_NODE:return{type:E.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return Qt(e,{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:i,maskInputOptions:h,maskInputFn:m,maskTextClass:l,dataURLOptions:p,inlineImages:v,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:S,enableStrictPrivacy:y,rootId:f});case e.TEXT_NODE:return Jt(e,{maskTextClass:l,maskTextSelector:a,maskTextFn:d,enableStrictPrivacy:y,rootId:f});case e.CDATA_SECTION_NODE:return{type:E.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:E.Comment,textContent:e.textContent||"",rootId:f};default:return!1}}function $t(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function Jt(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,l=t.enableStrictPrivacy,a=t.rootId,i=e.parentNode&&e.parentNode.tagName,c=e.textContent,h=i==="STYLE"?!0:void 0,d=i==="SCRIPT"?!0:void 0,m=!1;if(h&&c){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(c=Gt(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}c=be(c,Le()),m=!0}if(d?(c="SCRIPT_PLACEHOLDER",m=!0):i==="NOSCRIPT"&&(c="",m=!0),!h&&!d&&c&&ze(e,n,o)&&(c=s?s(c):c.replace(/[\S]/g,"*")),l&&!m&&i){var u=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!u.has(i)&&c&&(c=Oe(c))}return{type:E.Text,textContent:c||"",isStyle:h,rootId:a}}function Qt(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,l=t.maskInputOptions,a=l===void 0?{}:l,i=t.maskInputFn,c=t.maskTextClass,h=t.dataURLOptions,d=h===void 0?{}:h,m=t.inlineImages,u=t.recordCanvas,p=t.keepIframeSrcFn,v=t.newlyAddedElement,C=v===void 0?!1:v,w=t.enableStrictPrivacy,O=t.rootId,S=Ge(e,n,o)||Ge(e,c,null),y=At(e),f={},j=e.attributes.length,P=0;P<j;P++){var L=e.attributes[P];f[L.name]=We(r,y,L.name,L.value)}if(y==="link"&&s){var Y=Array.from(r.styleSheets).find(function(z){return z.href===e.href}),R=null;Y&&(R=xe(Y)),R&&(delete f.rel,delete f.href,f._cssText=be(R,Y.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var R=xe(e.sheet);R&&(f._cssText=be(R,Le()))}if(y==="input"||y==="textarea"||y==="select"){var A=e.value;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&A?f.value=Te({type:f.type,tagName:y,value:A,maskInputOptions:a,maskInputFn:i}):e.checked&&(f.checked=e.checked)}if(y==="option"&&(e.selected&&!a.select?f.selected=!0:delete f.selected),y==="canvas"&&u){if(e.__context==="2d")Rt(e)||(f.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var J=e.toDataURL(d.type,d.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height;var te=G.toDataURL(d.type,d.quality);J!==te&&(f.rr_dataURL=J)}}if(y==="img"&&m&&!S){ae||(ae=r.createElement("canvas"),_e=ae.getContext("2d"));var M=e,B=M.crossOrigin;M.crossOrigin="anonymous";var q=function(){try{ae.width=M.naturalWidth,ae.height=M.naturalHeight,_e.drawImage(M,0,0),f.rr_dataURL=ae.toDataURL(d.type,d.quality)}catch(z){console.warn("Cannot inline img src=".concat(M.currentSrc,"! Error: ").concat(z))}B?f.crossOrigin=B:M.removeAttribute("crossorigin")};M.complete&&M.naturalWidth!==0?q():M.onload=q}if((y==="audio"||y==="video")&&(f.rr_mediaState=e.paused?"paused":"played",f.rr_mediaCurrentTime=e.currentTime),C||(e.scrollLeft&&(f.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(f.rr_scrollTop=e.scrollTop)),S||y==="img"&&w){var D=e.getBoundingClientRect(),K=D.width,Z=D.height;f={class:f.class,rr_width:"".concat(K,"px"),rr_height:"".concat(Z,"px")},S=!0}return y==="iframe"&&!p(f.src)&&(e.contentDocument||(f.rr_src=f.src),delete f.src),S&&y==="img"&&delete f.src,{type:E.Element,tagName:y,attributes:f,childNodes:[],isSVG:Xt(e)||void 0,needBlock:S,rootId:O}}function I(e){return e===void 0?"":e.toLowerCase()}function qt(e,t){return!!(t.comment&&e.type===E.Comment||e.type===E.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"&&(I(e.attributes.name).match(/^msapplication-tile(image|color)$/)||I(e.attributes.name)==="application-name"||I(e.attributes.rel)==="icon"||I(e.attributes.rel)==="apple-touch-icon"||I(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&I(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(I(e.attributes.property).match(/^(og|twitter|fb):/)||I(e.attributes.name).match(/^(og|twitter):/)||I(e.attributes.name)==="pinterest")||t.headMetaRobots&&(I(e.attributes.name)==="robots"||I(e.attributes.name)==="googlebot"||I(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(I(e.attributes.name)==="author"||I(e.attributes.name)==="generator"||I(e.attributes.name)==="framework"||I(e.attributes.name)==="publisher"||I(e.attributes.name)==="progid"||I(e.attributes.property).match(/^article:/)||I(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(I(e.attributes.name)==="google-site-verification"||I(e.attributes.name)==="yandex-verification"||I(e.attributes.name)==="csrf-token"||I(e.attributes.name)==="p:domain_verify"||I(e.attributes.name)==="verify-v1"||I(e.attributes.name)==="verification"||I(e.attributes.name)==="shopify-checkout-api-token"))))}function re(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.skipChild,c=i===void 0?!1:i,h=t.inlineStylesheet,d=h===void 0?!0:h,m=t.maskInputOptions,u=m===void 0?{}:m,p=t.maskTextFn,v=t.maskInputFn,C=t.slimDOMOptions,w=t.dataURLOptions,O=w===void 0?{}:w,S=t.inlineImages,y=S===void 0?!1:S,f=t.recordCanvas,j=f===void 0?!1:f,P=t.onSerialize,L=t.onIframeLoad,Y=t.iframeLoadTimeout,R=Y===void 0?5e3:Y,A=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,G=J===void 0?5e3:J,te=t.keepIframeSrcFn,M=te===void 0?function(){return!1}:te,B=t.newlyAddedElement,q=B===void 0?!1:B,D=t.enableStrictPrivacy,K=t.preserveWhiteSpace,Z=K===void 0?!0:K,z=Kt(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,dataURLOptions:O,inlineImages:y,recordCanvas:j,keepIframeSrcFn:M,newlyAddedElement:q,enableStrictPrivacy:D});if(!z)return console.warn(e,"not serialized"),null;var g;if(n.hasNode(e)?g=n.getId(e):qt(z,C)||!Z&&z.type===E.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?g=pe:g=Pt(),g===pe)return null;var b=Object.assign(z,{id:g});n.add(e,b),P&&P(e);var H=!c,_=D;if(b.type===E.Element){if(H=H&&!b.needBlock,_=!!b.needBlock,console.log("vadim strictPrivacy",{strictPrivacy:_,enableStrictPrivacy:D}),_&&b.tagName==="img"){var Q=e.cloneNode();Q.src="",n.add(Q,b)}delete b.needBlock;var k=e.shadowRoot;k&&he(k)&&(b.isShadowHost=!0)}if((b.type===E.Document||b.type===E.Element)&&H){C.headWhitespace&&b.type===E.Element&&b.tagName==="head"&&(Z=!1);for(var x={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M,enableStrictPrivacy:_},oe=0,Ot=Array.from(e.childNodes);oe<Ot.length;oe++){var De=Ot[oe],ue=re(De,x);ue&&b.childNodes.push(ue)}if(Et(e)&&e.shadowRoot)for(var Fe=0,xt=Array.from(e.shadowRoot.childNodes);Fe<xt.length;Fe++){var De=xt[Fe],ue=re(De,x);ue&&(he(e.shadowRoot)&&(ue.isShadow=!0),b.childNodes.push(ue))}}return e.parentNode&&de(e.parentNode)&&he(e.parentNode)&&(b.isShadow=!0),b.type===E.Element&&b.tagName==="iframe"&&Bt(e,function(){var ee=e.contentDocument;if(ee&&L){var Lt=re(ee,{doc:ee,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M,enableStrictPrivacy:D});Lt&&L(e,Lt)}},R),b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(A){var ee=re(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M,enableStrictPrivacy:D});ee&&A(e,ee)}},G),Ve(e)===!1)||b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(A){var ee=re(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,enableStrictPrivacy:D,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M});ee&&A(e,ee)}},G),Ve(e)===!1)?null:b}function er(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Pe:n,s=r.blockClass,l=s===void 0?"highlight-block":s,a=r.blockSelector,i=a===void 0?null:a,c=r.maskTextClass,h=c===void 0?"highlight-mask":c,d=r.maskTextSelector,m=d===void 0?null:d,u=r.inlineStylesheet,p=u===void 0?!0:u,v=r.inlineImages,C=v===void 0?!1:v,w=r.recordCanvas,O=w===void 0?!1:w,S=r.maskAllInputs,y=S===void 0?!1:S,f=r.maskTextFn,j=r.maskInputFn,P=r.slimDOM,L=P===void 0?!1:P,Y=r.dataURLOptions,R=r.preserveWhiteSpace,A=r.onSerialize,J=r.onIframeLoad,G=r.iframeLoadTimeout,te=r.onStylesheetLoad,M=r.stylesheetLoadTimeout,B=r.keepIframeSrcFn,q=B===void 0?function(){return!1}:B,D=r.enableStrictPrivacy,K=D===void 0?!1:D,Z=y===!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}:y===!1?{password:!0}:y,z=L===!0||L==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:L==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:L===!1?{}:L;return re(e,{doc:e,mirror:o,blockClass:l,blockSelector:i,maskTextClass:h,maskTextSelector:m,skipChild:!1,inlineStylesheet:p,maskInputOptions:Z,maskTextFn:f,maskInputFn:j,slimDOMOptions:z,dataURLOptions:Y,inlineImages:C,recordCanvas:O,preserveWhiteSpace:R,onSerialize:A,onIframeLoad:J,iframeLoadTimeout:G,onStylesheetLoad:te,stylesheetLoadTimeout:M,keepIframeSrcFn:q,newlyAddedElement:!1,enableStrictPrivacy:K})}function V(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const se=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
var rrwebRecord=function(){"use strict";var E;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(E||(E={}));function Et(e){return e.nodeType===e.ELEMENT_NODE}function de(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function he(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Pe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Nt(){return new Pe}function Te(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,l=o||"";return(t[n.toLowerCase()]||t[r])&&(s?l=s(l):l="*".repeat(l.length)),l}var Ae="__rrweb_original__";function Rt(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var s=t.getImageData,l=Ae in s?s[Ae]:s,a=new Uint32Array(l.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(a.some(function(i){return i!==0}))return!1}return!0}function Oe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Dt=1,Ft=new RegExp("[^a-z0-9-_:]"),pe=-2;function Pt(){return Dt++}function At(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Ft.test(t)?"div":t}function xe(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(_t).join(""):null}catch{return null}}function _t(e){var t=e.cssText;if(Wt(e))try{t=xe(e.styleSheet)||t}catch{}return t}function Wt(e){return"styleSheet"in e}function Gt(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function zt(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ae,_e,Vt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,jt=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zt=/^(data:)([^,]*),(.*)/i;function be(e,t){return(e||"").replace(Vt,function(n,r,o,s,l,a){var i=o||l||a,c=r||s||"";if(!i)return n;if(!jt.test(i)||Zt.test(i))return"url(".concat(c).concat(i).concat(c,")");if(i[0]==="/")return"url(".concat(c).concat(zt(t)+i).concat(c,")");var h=t.split("/"),d=i.split("/");h.pop();for(var m=0,u=d;m<u.length;m++){var p=u[m];p!=="."&&(p===".."?h.pop():h.push(p))}return"url(".concat(c).concat(h.join("/")).concat(c,")")})}var Ut=/^[^ \t\n\r\u000c]+/,Yt=/^[, \t\n\r\u000c]+/;function Ht(e,t){if(t.trim()==="")return t;var n=0;function r(c){var h,d=c.exec(t.substring(n));return d?(h=d[0],n+=h.length,h):""}for(var o=[];r(Yt),!(n>=t.length);){var s=r(Ut);if(s.slice(-1)===",")s=Se(e,s.substring(0,s.length-1)),o.push(s);else{var l="";s=Se(e,s);for(var a=!1;;){var i=t.charAt(n);if(i===""){o.push((s+l).trim());break}else if(a)i===")"&&(a=!1);else if(i===","){n+=1,o.push((s+l).trim());break}else i==="("&&(a=!0);l+=i,n+=1}}}return o.join(", ")}function Se(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function Xt(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Le(){var e=document.createElement("a");return e.href="",e.href}function We(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Se(e,r):n==="srcset"&&r?Ht(e,r):n==="style"&&r?be(r,Le()):t==="object"&&n==="data"&&r?Se(e,r):r}function Ge(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ce(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ce(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ce(e.parentNode,t,n):!1}function ze(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ce(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function Bt(e,t,n){var r=e.contentWindow;if(r){var o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var a="about:blank";if(r.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ve(e){return e.getAttribute("href")?e.sheet!==null:!0}function je(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(s),r=!0,t()})}}function Kt(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.inlineStylesheet,c=t.maskInputOptions,h=c===void 0?{}:c,d=t.maskTextFn,m=t.maskInputFn,u=t.dataURLOptions,p=u===void 0?{}:u,y=t.inlineImages,C=t.recordCanvas,w=t.keepIframeSrcFn,O=t.newlyAddedElement,S=O===void 0?!1:O,v=t.enableStrictPrivacy,f=$t(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:E.Document,childNodes:[],compatMode:e.compatMode,rootId:f}:{type:E.Document,childNodes:[],rootId:f};case e.DOCUMENT_TYPE_NODE:return{type:E.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return Qt(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:i,maskInputOptions:h,maskInputFn:m,maskTextClass:l,dataURLOptions:p,inlineImages:y,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:S,enableStrictPrivacy:v,rootId:f});case e.TEXT_NODE:return Jt(e,{maskTextClass:l,maskTextSelector:a,maskTextFn:d,enableStrictPrivacy:v,rootId:f});case e.CDATA_SECTION_NODE:return{type:E.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:E.Comment,textContent:e.textContent||"",rootId:f};default:return!1}}function $t(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Jt(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,l=t.enableStrictPrivacy,a=t.rootId,i=e.parentNode&&e.parentNode.tagName,c=e.textContent,h=i==="STYLE"?!0:void 0,d=i==="SCRIPT"?!0:void 0,m=!1;if(h&&c){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(c=Gt(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}c=be(c,Le()),m=!0}if(d?(c="SCRIPT_PLACEHOLDER",m=!0):i==="NOSCRIPT"&&(c="",m=!0),!h&&!d&&c&&ze(e,r,o)&&(c=s?s(c):c.replace(/[\S]/g,"*")),l&&!m&&i){var u=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!u.has(i)&&c&&(c=Oe(c))}return{type:E.Text,textContent:c||"",isStyle:h,rootId:a}}function Qt(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,l=t.maskInputOptions,a=l===void 0?{}:l,i=t.maskInputFn,c=t.maskTextClass,h=t.dataURLOptions,d=h===void 0?{}:h,m=t.inlineImages,u=t.recordCanvas,p=t.keepIframeSrcFn,y=t.newlyAddedElement,C=y===void 0?!1:y,w=t.enableStrictPrivacy,O=t.rootId,S=Ge(e,r,o)||Ge(e,c,null),v=At(e),f={},j=e.attributes.length,F=0;F<j;F++){var L=e.attributes[F];f[L.name]=We(n,v,L.name,L.value)}if(v==="link"&&s){var Y=Array.from(n.styleSheets).find(function(G){return G.href===e.href}),R=null;Y&&(R=xe(Y)),R&&(delete f.rel,delete f.href,f._cssText=be(R,Y.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var R=xe(e.sheet);R&&(f._cssText=be(R,Le()))}if(v==="input"||v==="textarea"||v==="select"){var P=e.value;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&P?f.value=Te({type:f.type,tagName:v,value:P,maskInputOptions:a,maskInputFn:i}):e.checked&&(f.checked=e.checked)}if(v==="option"&&(e.selected&&!a.select?f.selected=!0:delete f.selected),v==="canvas"&&u){if(e.__context==="2d")Rt(e)||(f.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var J=e.toDataURL(d.type,d.quality),W=document.createElement("canvas");W.width=e.width,W.height=e.height;var te=W.toDataURL(d.type,d.quality);J!==te&&(f.rr_dataURL=J)}}if(v==="img"&&m&&!S){ae||(ae=n.createElement("canvas"),_e=ae.getContext("2d"));var M=e,B=M.crossOrigin;M.crossOrigin="anonymous";var q=function(){try{ae.width=M.naturalWidth,ae.height=M.naturalHeight,_e.drawImage(M,0,0),f.rr_dataURL=ae.toDataURL(d.type,d.quality)}catch(G){console.warn("Cannot inline img src=".concat(M.currentSrc,"! Error: ").concat(G))}B?f.crossOrigin=B:M.removeAttribute("crossorigin")};M.complete&&M.naturalWidth!==0?q():M.onload=q}if((v==="audio"||v==="video")&&(f.rr_mediaState=e.paused?"paused":"played",f.rr_mediaCurrentTime=e.currentTime),C||(e.scrollLeft&&(f.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(f.rr_scrollTop=e.scrollTop)),S||v==="img"&&w){var A=e.getBoundingClientRect(),K=A.width,Z=A.height;f={class:f.class,rr_width:"".concat(K,"px"),rr_height:"".concat(Z,"px")},S=!0}return v==="iframe"&&!p(f.src)&&(e.contentDocument||(f.rr_src=f.src),delete f.src),S&&v==="img"&&delete f.src,{type:E.Element,tagName:v,attributes:f,childNodes:[],isSVG:Xt(e)||void 0,needBlock:S,rootId:O}}function I(e){return e===void 0?"":e.toLowerCase()}function qt(e,t){return!!(t.comment&&e.type===E.Comment||e.type===E.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"&&(I(e.attributes.name).match(/^msapplication-tile(image|color)$/)||I(e.attributes.name)==="application-name"||I(e.attributes.rel)==="icon"||I(e.attributes.rel)==="apple-touch-icon"||I(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&I(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(I(e.attributes.property).match(/^(og|twitter|fb):/)||I(e.attributes.name).match(/^(og|twitter):/)||I(e.attributes.name)==="pinterest")||t.headMetaRobots&&(I(e.attributes.name)==="robots"||I(e.attributes.name)==="googlebot"||I(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(I(e.attributes.name)==="author"||I(e.attributes.name)==="generator"||I(e.attributes.name)==="framework"||I(e.attributes.name)==="publisher"||I(e.attributes.name)==="progid"||I(e.attributes.property).match(/^article:/)||I(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(I(e.attributes.name)==="google-site-verification"||I(e.attributes.name)==="yandex-verification"||I(e.attributes.name)==="csrf-token"||I(e.attributes.name)==="p:domain_verify"||I(e.attributes.name)==="verify-v1"||I(e.attributes.name)==="verification"||I(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.skipChild,c=i===void 0?!1:i,h=t.inlineStylesheet,d=h===void 0?!0:h,m=t.maskInputOptions,u=m===void 0?{}:m,p=t.maskTextFn,y=t.maskInputFn,C=t.slimDOMOptions,w=t.dataURLOptions,O=w===void 0?{}:w,S=t.inlineImages,v=S===void 0?!1:S,f=t.recordCanvas,j=f===void 0?!1:f,F=t.onSerialize,L=t.onIframeLoad,Y=t.iframeLoadTimeout,R=Y===void 0?5e3:Y,P=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,W=J===void 0?5e3:J,te=t.keepIframeSrcFn,M=te===void 0?function(){return!1}:te,B=t.newlyAddedElement,q=B===void 0?!1:B,A=t.enableStrictPrivacy,K=t.preserveWhiteSpace,Z=K===void 0?!0:K,G=Kt(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,dataURLOptions:O,inlineImages:v,recordCanvas:j,keepIframeSrcFn:M,newlyAddedElement:q,enableStrictPrivacy:A});if(!G)return console.warn(e,"not serialized"),null;var g;if(r.hasNode(e)?g=r.getId(e):qt(G,C)||!Z&&G.type===E.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?g=pe:g=Pt(),g===pe)return null;var b=Object.assign(G,{id:g});r.add(e,b),F&&F(e);var H=!c,z=A;if(b.type===E.Element){if(H=H&&!b.needBlock,z=!!b.needBlock,z&&b.tagName==="img"){var Q=e.cloneNode();Q.src="",r.add(Q,b)}delete b.needBlock;var k=e.shadowRoot;k&&he(k)&&(b.isShadowHost=!0)}if((b.type===E.Document||b.type===E.Element)&&H){C.headWhitespace&&b.type===E.Element&&b.tagName==="head"&&(Z=!1);for(var x={doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M,enableStrictPrivacy:z},oe=0,Ot=Array.from(e.childNodes);oe<Ot.length;oe++){var De=Ot[oe],ue=ne(De,x);ue&&b.childNodes.push(ue)}if(Et(e)&&e.shadowRoot)for(var Fe=0,xt=Array.from(e.shadowRoot.childNodes);Fe<xt.length;Fe++){var De=xt[Fe],ue=ne(De,x);ue&&(he(e.shadowRoot)&&(ue.isShadow=!0),b.childNodes.push(ue))}}return e.parentNode&&de(e.parentNode)&&he(e.parentNode)&&(b.isShadow=!0),b.type===E.Element&&b.tagName==="iframe"&&Bt(e,function(){var ee=e.contentDocument;if(ee&&L){var Lt=ne(ee,{doc:ee,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M,enableStrictPrivacy:A});Lt&&L(e,Lt)}},R),b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(P){var ee=ne(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M,enableStrictPrivacy:A});ee&&P(e,ee)}},W),Ve(e)===!1)||b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(P){var ee=ne(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,enableStrictPrivacy:A,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M});ee&&P(e,ee)}},W),Ve(e)===!1)?null:b}function en(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Pe:r,s=n.blockClass,l=s===void 0?"highlight-block":s,a=n.blockSelector,i=a===void 0?null:a,c=n.maskTextClass,h=c===void 0?"highlight-mask":c,d=n.maskTextSelector,m=d===void 0?null:d,u=n.inlineStylesheet,p=u===void 0?!0:u,y=n.inlineImages,C=y===void 0?!1:y,w=n.recordCanvas,O=w===void 0?!1:w,S=n.maskAllInputs,v=S===void 0?!1:S,f=n.maskTextFn,j=n.maskInputFn,F=n.slimDOM,L=F===void 0?!1:F,Y=n.dataURLOptions,R=n.preserveWhiteSpace,P=n.onSerialize,J=n.onIframeLoad,W=n.iframeLoadTimeout,te=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,B=n.keepIframeSrcFn,q=B===void 0?function(){return!1}:B,A=n.enableStrictPrivacy,K=A===void 0?!1:A,Z=v===!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}:v===!1?{password:!0}:v,G=L===!0||L==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:L==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:L===!1?{}:L;return ne(e,{doc:e,mirror:o,blockClass:l,blockSelector:i,maskTextClass:h,maskTextSelector:m,skipChild:!1,inlineStylesheet:p,maskInputOptions:Z,maskTextFn:f,maskInputFn:j,slimDOMOptions:G,dataURLOptions:Y,inlineImages:C,recordCanvas:O,preserveWhiteSpace:R,onSerialize:P,onIframeLoad:J,iframeLoadTimeout:W,onStylesheetLoad:te,stylesheetLoadTimeout:M,keepIframeSrcFn:q,newlyAddedElement:!1,enableStrictPrivacy:K})}function V(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const se=`Please stop import mirror directly. Instead of that,\r
|
|
2
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
|
-
or you can use record.mirror to access the mirror instance during recording.`;let Ze={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ze=new Proxy(Ze,{get(e,t,r){return t==="map"&&console.error(se),Reflect.get(e,t,r)}}));function me(e,t,r={}){let n=null,o=0;return function(...s){const l=Date.now();!o&&r.leading===!1&&(o=l);const a=t-(l-o),i=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(i,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(i,s)},a))}}function ke(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),s&&s.set&&s.set.call(this,l)}}),()=>ke(e,t,s||{},!0)}function ie(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 Ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ye(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const tr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function U(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(Ce(n,t,r))return!0;return!1}function rr(e,t){return t.getId(e)!==-1}function Ee(e,t){return t.getId(e)===pe}function He(e,t){if(de(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?He(e.parentNode,t):!0:!0}function Xe(e){return Boolean(e.changedTouches)}function nr(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 Be(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ke(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $e(e){return Boolean(e?.shadowRoot)}var T=(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))(T||{}),W=(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))(W||{}),Ne=(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))(Ne||{}),le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(le||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),or=(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))(or||{});function Je(e){return"__ln"in e}class ar{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&&Je(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&&Je(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 Qe=(e,t)=>`${e}@${t}`;class sr{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 ar,n=a=>{let i=a,c=pe;for(;c===pe;)i=i&&i.nextSibling,c=i&&this.mirror.getId(i);return c},o=a=>{var i,c,h,d,m;const u=a.getRootNode?(i=a.getRootNode())==null?void 0:i.host:null;let p=u;for(;(h=(c=p?.getRootNode)==null?void 0:c.call(p))!=null&&h.host;)p=((m=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:m.host)||null;const v=!this.doc.contains(a)&&(!p||!this.doc.contains(p));if(!a.parentNode||v)return;const C=de(a.parentNode)?this.mirror.getId(u):this.mirror.getId(a.parentNode),w=n(a);if(C===-1||w===-1)return r.addNode(a);const O=re(a,{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:S=>{Be(S,this.mirror)&&this.iframeManager.addIframe(S),Ke(S,this.mirror)&&this.stylesheetManager.addStylesheet(S),$e(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(S,y)=>{this.iframeManager.attachIframe(S,y,this.mirror),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,y)=>{this.stylesheetManager.attachStylesheet(S,y,this.mirror)}});O&&t.push({parentId:C,nextId:w,node:O})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))qe(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of Array.from(this.addedSet.values()))!tt(this.droppedSet,a)&&!qe(this.removes,a,this.mirror)||tt(this.movedSet,a)?o(a):this.droppedSet.add(a);let s=null;for(;r.length;){let a=null;if(s){const i=this.mirror.getId(s.value.parentNode),c=n(s.value);i!==-1&&c!==-1&&(a=s)}if(!a)for(let i=r.length-1;i>=0;i--){const c=r.get(i);if(c){const h=this.mirror.getId(c.value.parentNode),d=n(c.value);if(h!==-1&&d!==-1){a=c;break}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}s=a.previous,r.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>{let i=a.value;return this.enableStrictPrivacy&&i&&(i=Oe(i)),{id:this.mirror.getId(a.node),value:i}}).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.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(!Ee(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!U(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:ze(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=Te({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),U(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(s=>s.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 s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const a of Array.from(r.style)){const i=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(i!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a))&&(c===""?l[a]=i:l[a]=[i,c])}for(const a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(l[a]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=We(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(U(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=de(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);U(t.target,this.blockClass,!1)||Ee(r,this.mirror)||!rr(r,this.mirror)||(this.addedSet.has(r)?(Re(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||He(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Qe(n,o)]?Re(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:de(t.target)&&he(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(Ee(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[Qe(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);U(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 Re(e,t){e.delete(t),t.childNodes.forEach(r=>Re(e,r))}function qe(e,t,r){return e.length===0?!1:et(e,t,r)}function et(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:et(e,n,r)}function tt(e,t){return e.size===0?!1:rt(e,t)}function rt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:rt(e,r):!1}var ir=Object.defineProperty,lr=Object.defineProperties,cr=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,ur=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,ot=(e,t,r)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,at=(e,t)=>{for(var r in t||(t={}))ur.call(t,r)&&ot(e,r,t[r]);if(nt)for(var r of nt(t))dr.call(t,r)&&ot(e,r,t[r]);return e},hr=(e,t)=>lr(e,cr(t));const ne=[],st=typeof CSSGroupingRule<"u",it=typeof CSSMediaRule<"u",lt=typeof CSSSupportsRule<"u",ct=typeof CSSConditionRule<"u";function ve(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 ut(e,t){var r,n;const o=new sr;ne.push(o),o.init(e);let s=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]&&(s=window[l]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function pr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],a;const i=me(d=>{const m=Date.now()-a;e(l.map(u=>(u.timeOffset-=m,u)),d),l=[],a=null},s),c=me(d=>{const m=ve(d),{clientX:u,clientY:p}=Xe(d)?d.changedTouches[0]:d;a||(a=Date.now()),l.push({x:u,y:p,id:n.getId(m),timeOffset:Date.now()-a}),i(typeof DragEvent<"u"&&d instanceof DragEvent?W.Drag:d instanceof MouseEvent?W.MouseMove:W.TouchMove)},o,{trailing:!1}),h=[V("mousemove",c,r),V("touchmove",c,r),V("drag",c,r)];return()=>{h.forEach(d=>d())}}function mr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=i=>c=>{const h=ve(c);if(U(h,n,!0)||tr(h))return;const d=Xe(c)?c.changedTouches[0]:c;if(!d)return;const m=r.getId(h),{clientX:u,clientY:p}=d;e({type:Ne[i],id:m,x:u,y:p})};return Object.keys(Ne).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&s[i]!==!1).forEach(i=>{const c=i.toLowerCase(),h=a(i);l.push(V(c,h,t))}),()=>{l.forEach(i=>i())}}function dt({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=me(l=>{const a=ve(l);if(!a||U(a,n,!0))return;const i=r.getId(a);if(a===t){const c=t.scrollingElement||t.documentElement;e({id:i,x:c.scrollLeft,y:c.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})},o.scroll||100);return V("scroll",s,t)}function fr({viewportResizeCb:e}){let t=-1,r=-1;const n=me(()=>{const o=Ue(),s=Ye();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return V("resize",n,window)}function ht(e,t){const r=at({},e);return t||delete r.userTriggered,r}const vr=["INPUT","TEXTAREA","SELECT"],pt=new WeakMap;function yr({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:i}){function c(p){let v=ve(p);const C=p.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||vr.indexOf(v.tagName)<0||U(v,n,!0))return;const w=v.type;if(v.classList.contains(o))return;let O=v.value,S=!1;w==="radio"||w==="checkbox"?S=v.checked:(s[v.tagName.toLowerCase()]||s[w])&&(O=Te({maskInputOptions:s,tagName:v.tagName,type:w,value:O,maskInputFn:l})),h(v,ht({text:O,isChecked:S,userTriggered:C},i));const y=v.name;w==="radio"&&y&&S&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach(f=>{f!==v&&h(f,ht({text:f.value,isChecked:!S,userTriggered:!1},i))})}function h(p,v){const C=pt.get(p);if(!C||C.text!==v.text||C.isChecked!==v.isChecked){pt.set(p,v);const w=r.getId(p);e(hr(at({},v),{id:w}))}}const d=(a.input==="last"?["change"]:["input","change"]).map(p=>V(p,c,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...u.map(p=>ke(p[0],p[1],{set(){c({target:this})}}))),()=>{d.forEach(p=>p())}}function Ie(e){const t=[];function r(n,o){if(st&&n.parentRule instanceof CSSGroupingRule||it&&n.parentRule instanceof CSSMediaRule||lt&&n.parentRule instanceof CSSSupportsRule||ct&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function gr({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(a,i){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,adds:[{rule:a,index:i}]}),n.apply(this,[a,i])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(a){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,removes:[{index:a}]}),o.apply(this,[a])};const s={};st?s.CSSGroupingRule=r.CSSGroupingRule:(it&&(s.CSSMediaRule=r.CSSMediaRule),ct&&(s.CSSConditionRule=r.CSSConditionRule),lt&&(s.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(s).forEach(([a,i])=>{l[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(c,h){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:c,index:[...Ie(this),h||0]}]}),l[a].insertRule.apply(this,[c,h])},i.prototype.deleteRule=function(c){const h=t.getId(this.parentStyleSheet.ownerNode);return h!==-1&&e({id:h,removes:[{index:[...Ie(this),c]}]}),l[a].deleteRule.apply(this,[c])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([a,i])=>{i.prototype.insertRule=l[a].insertRule,i.prototype.deleteRule=l[a].deleteRule})}}function br({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,l,a){var i,c;const h=t.getId((c=(i=this.parentRule)==null?void 0:i.parentStyleSheet)==null?void 0:c.ownerNode);return h!==-1&&e({id:h,set:{property:s,value:l,priority:a},index:Ie(this.parentRule)}),n.apply(this,[s,l,a])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var l,a;const i=t.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return i!==-1&&e({id:i,remove:{property:s},index:Ie(this.parentRule)}),o.apply(this,[s])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Sr({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>me(a=>{const i=ve(a);if(!i||U(i,t,!0))return;const{currentTime:c,volume:h,muted:d}=i;e({type:l,id:r.getId(i),currentTime:c,volume:h,muted:d})},n.media||500),s=[V("play",o(fe.Play)),V("pause",o(fe.Pause)),V("seeked",o(fe.Seeked)),V("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(l=>l())}}function Cr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(a,i,c){const h=new s(a,i,c);return o.set(h,{family:a,buffer:typeof i!="string",descriptors:c,fontSource:typeof i=="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),h};const l=ie(t.fonts,"add",function(a){return function(i){return setTimeout(()=>{const c=o.get(i);c&&(e(c),o.delete(i))},0),a.apply(this,[i])}});return n.push(()=>{r.FontFace=s}),n.push(l),()=>{n.forEach(a=>a())}}function kr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:l,inputCb:a,mediaInteractionCb:i,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),s(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),a(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),i(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),h(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),d(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),m(...u)}}function Ir(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};kr(e,t);const n=ut(e,e.doc),o=pr(e),s=mr(e),l=dt(e),a=fr(e),i=yr(e),c=Sr(e),h=gr(e,{win:r}),d=br(e,{win:r}),m=e.collectFonts?Cr(e):()=>{},u=[];for(const p of e.plugins)u.push(p.observer(p.callback,r,p.options));return()=>{ne.forEach(p=>p.reset()),n.disconnect(),o(),s(),l(),a(),i(),c(),h(),d(),m(),u.forEach(p=>p())}}class wr{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 Mr=Object.defineProperty,Tr=Object.defineProperties,Or=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,ft=(e,t,r)=>t in e?Mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vt=(e,t)=>{for(var r in t||(t={}))xr.call(t,r)&&ft(e,r,t[r]);if(mt)for(var r of mt(t))Lr.call(t,r)&&ft(e,r,t[r]);return e},yt=(e,t)=>Tr(e,Or(t));class Er{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(ie(HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(t,r){!he(t)||(ut(yt(vt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),dt(yt(vt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(ie(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),s}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nr=typeof Uint8Array>"u"?[]:new Uint8Array(256),we=0;we<ce.length;we++)Nr[ce.charCodeAt(we)]=we;var Rr=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ce[t[r]>>2],o+=ce[(t[r]&3)<<4|t[r+1]>>4],o+=ce[(t[r+1]&15)<<2|t[r+2]>>6],o+=ce[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};const gt=new Map;function Dr(e,t){let r=gt.get(e);return r||(r=new Map,gt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const bt=(e,t,r)=>{if(!e||!(Ct(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Dr(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Me(e,t,r){if(e instanceof Array)return e.map(n=>Me(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=Rr(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Me(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:[Me(e.data,t,r),e.width,e.height]};if(Ct(e,t)||typeof e=="object"){const n=e.constructor.name,o=bt(e,t,r);return{rr_type:n,index:o}}}}return e}const St=(e,t,r)=>[...e].map(n=>Me(n,t,r)),Ct=(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 Fr(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of s)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=ie(t.CanvasRenderingContext2D.prototype,l,function(i){return function(...c){return U(this.canvas,r,!0)||setTimeout(()=>{const h=St([...c],t,this);e(this.canvas,{type:le["2D"],property:l,args:h})},0),i.apply(this,c)}});o.push(a)}catch{const i=ke(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:le["2D"],property:l,args:[c],setter:!0})}});o.push(i)}return()=>{o.forEach(l=>l())}}function kt(e,t){const r=[];try{const n=ie(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...l){return U(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function It(e,t,r,n,o,s){const l=[],a=Object.getOwnPropertyNames(e);for(const i of a)try{if(typeof e[i]!="function")continue;const c=ie(e,i,function(h){return function(...d){const m=h.apply(this,d);if(bt(m,s,e),!U(this.canvas,n,!0)){const u=St([...d],s,e),p={type:t,property:i,args:u};r(this.canvas,p)}return m}});l.push(c)}catch{const h=ke(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:!0})}});l.push(h)}return l}function Pr(e,t,r,n){const o=[];return o.push(...It(t.WebGLRenderingContext.prototype,le.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...It(t.WebGL2RenderingContext.prototype,le.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function Ar(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function _r(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=Ar(e,o),l=s.indexOf(`
|
|
4
|
-
`,10)+1,a=s.substring(l)+(n?"//# sourceMappingURL="+n:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}function Wr(e,t,r){var n;return function(s){return n=n||_r(e,t,r),new Worker(n,s)}}var Gr=Wr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),wt=Object.getOwnPropertySymbols,zr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable,jr=(e,t)=>{var r={};for(var n in e)zr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wt)for(var n of wt(e))t.indexOf(n)<0&&Vr.call(e,n)&&(r[n]=e[n]);return r},Zr=(e,t,r)=>new Promise((n,o)=>{var s=i=>{try{a(r.next(i))}catch(c){o(c)}},l=i=>{try{a(r.throw(i))}catch(c){o(c)}},a=i=>i.done?n(i.value):Promise.resolve(i.value).then(s,l);a((r=r.apply(e,t)).next())});class Ur{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=kt(r,n),s=new Map,l=new Gr;l.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:u,type:p,width:v,height:C}=d.data;this.mutationCb({id:m,type:le["2D"],commands:[{property:"clearRect",args:[0,0,v,C]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:p}]},0,0]}]})};const a=1e3/t;let i=0,c;const h=d=>{if(i&&d-i<a){c=requestAnimationFrame(h);return}i=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>Zr(this,null,function*(){var u;const p=this.mirror.getId(m);if(s.get(p))return;if(s.set(p,!0),["webgl","webgl2"].includes(m.__context)){const C=m.getContext(m.__context);((u=C?.getContextAttributes())==null?void 0:u.preserveDrawingBuffer)===!1&&C?.clear(C.COLOR_BUFFER_BIT)}if(m.width===0||m.height===0)return;const v=yield createImageBitmap(m);l.postMessage({id:p,bitmap:v,width:m.width,height:m.height},[v])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=kt(t,r),o=Fr(this.processMutation.bind(this),t,r,this.mirror),s=Pr(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>jr(l,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class Yr{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var Hr=Object.defineProperty,Xr=Object.defineProperties,Br=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Tt=(e,t,r)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X=(e,t)=>{for(var r in t||(t={}))Kr.call(t,r)&&Tt(e,r,t[r]);if(Mt)for(var r of Mt(t))$r.call(t,r)&&Tt(e,r,t[r]);return e},Jr=(e,t)=>Xr(e,Br(t));function F(e){return Jr(X({},e),{timestamp:Date.now()})}let N,ye;const $=Nt();function ge(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:l="highlight-ignore",maskTextClass:a="highlight-mask",maskTextSelector:i=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:m,maskInputFn:u,maskTextFn:p=Oe,hooks:v,packFn:C,sampling:w={},mousemoveWait:O,recordCanvas:S=!1,userTriggeredOnInput:y=!1,collectFonts:f=!1,inlineImages:j=!1,plugins:P,keepIframeSrcFn:L=()=>!1,enableStrictPrivacy:Y=!1}=e;if(!t)throw new Error("emit function is required");O!==void 0&&w.mousemove===void 0&&(w.mousemove=O),$.reset();const R=h===!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}:d!==void 0?d:{password:!0},A=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};nr();let J,G=0;const te=g=>{for(const b of P||[])b.eventProcessor&&(g=b.eventProcessor(g));return C&&(g=C(g)),g};N=(g,b)=>{var H;if(((H=ne[0])==null?void 0:H.isFrozen())&&g.type!==T.FullSnapshot&&!(g.type===T.IncrementalSnapshot&&g.data.source===W.Mutation)&&ne.forEach(_=>_.unfreeze()),t(te(g),b),g.type===T.FullSnapshot)J=g,G=0;else if(g.type===T.IncrementalSnapshot){if(g.data.source===W.Mutation&&g.data.isAttachIframe)return;G++;const _=n&&G>=n,Q=r&&g.timestamp-J.timestamp>r;(_||Q)&&ye(!0)}};const M=g=>{N(F({type:T.IncrementalSnapshot,data:X({source:W.Mutation},g)}))},B=g=>N(F({type:T.IncrementalSnapshot,data:X({source:W.Scroll},g)})),q=g=>N(F({type:T.IncrementalSnapshot,data:X({source:W.CanvasMutation},g)})),D=new wr({mutationCb:M}),K=new Yr({mutationCb:M}),Z=new Ur({recordCanvas:S,mutationCb:q,win:window,blockClass:o,mirror:$,sampling:w.canvas}),z=new Er({mutationCb:M,scrollCb:B,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskInputOptions:R,maskTextFn:p,maskInputFn:u,recordCanvas:S,inlineImages:j,sampling:w,slimDOMOptions:A,iframeManager:D,stylesheetManager:K,canvasManager:Z,keepIframeSrcFn:L,enableStrictPrivacy:Y},mirror:$});ye=(g=!1)=>{var b,H,_,Q;N(F({type:T.Meta,data:{href:window.location.href,width:Ye(),height:Ue()}}),g),ne.forEach(x=>x.lock());const k=er(document,{mirror:$,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskAllInputs:R,maskTextFn:p,slimDOM:A,recordCanvas:S,inlineImages:j,enableStrictPrivacy:Y,onSerialize:x=>{Be(x,$)&&D.addIframe(x),Ke(x,$)&&K.addStylesheet(x),$e(x)&&z.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,oe)=>{D.attachIframe(x,oe,$),z.observeAttachShadow(x)},onStylesheetLoad:(x,oe)=>{K.attachStylesheet(x,oe,$)},keepIframeSrcFn:L});if(!k)return console.warn("Failed to snapshot the document");N(F({type:T.FullSnapshot,data:{node:k,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((H=(b=document?.body)==null?void 0:b.parentElement)==null?void 0:H.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Q=(_=document?.body)==null?void 0:_.parentElement)==null?void 0:Q.scrollTop)||document?.body.scrollTop||0}}})),ne.forEach(x=>x.unlock())};try{const g=[];g.push(V("DOMContentLoaded",()=>{N(F({type:T.DomContentLoaded,data:{}}))}));const b=_=>{var Q;return Ir({mutationCb:M,mousemoveCb:(k,x)=>N(F({type:T.IncrementalSnapshot,data:{source:x,positions:k}})),mouseInteractionCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.MouseInteraction},k)})),scrollCb:B,viewportResizeCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.ViewportResize},k)})),inputCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.Input},k)})),mediaInteractionCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.MediaInteraction},k)})),styleSheetRuleCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.StyleSheetRule},k)})),styleDeclarationCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.StyleDeclaration},k)})),canvasMutationCb:q,fontCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.Font},k)})),blockClass:o,ignoreClass:l,maskTextClass:a,maskTextSelector:i,maskInputOptions:R,inlineStylesheet:c,sampling:w,recordCanvas:S,inlineImages:j,userTriggeredOnInput:y,collectFonts:f,doc:_,maskInputFn:u,maskTextFn:p,keepIframeSrcFn:L,blockSelector:s,slimDOMOptions:A,mirror:$,iframeManager:D,stylesheetManager:K,shadowDomManager:z,canvasManager:Z,enableStrictPrivacy:Y,plugins:((Q=P?.filter(k=>k.observer))==null?void 0:Q.map(k=>({observer:k.observer,options:k.options,callback:x=>N(F({type:T.Plugin,data:{plugin:k.name,payload:x}}))})))||[]},v)};D.addLoadListener(_=>{g.push(b(_.contentDocument))});const H=()=>{ye(),g.push(b(document))};return document.readyState==="interactive"||document.readyState==="complete"?H():g.push(V("load",()=>{N(F({type:T.Load,data:{}})),H()},window)),()=>{g.forEach(_=>_())}}catch(g){console.warn(g)}}return ge.addCustomEvent=(e,t)=>{!N||N(F({type:T.Custom,data:{tag:e,payload:t}}))},ge.freezePage=()=>{ne.forEach(e=>e.freeze())},ge.takeFullSnapshot=e=>{if(!ye)throw new Error("please take full snapshot after start recording");ye(e)},ge.mirror=$,ge}();
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`;let Ze={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ze=new Proxy(Ze,{get(e,t,n){return t==="map"&&console.error(se),Reflect.get(e,t,n)}}));function me(e,t,n={}){let r=null,o=0;return function(...s){const l=Date.now();!o&&n.leading===!1&&(o=l);const a=t-(l-o),i=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(i,s)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(i,s)},a))}}function ke(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(l){setTimeout(()=>{n.set.call(this,l)},0),s&&s.set&&s.set.call(this,l)}}),()=>ke(e,t,s||{},!0)}function ie(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ye(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const tn=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function U(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ce(r,t,n))return!0;return!1}function nn(e,t){return t.getId(e)!==-1}function Ee(e,t){return t.getId(e)===pe}function He(e,t){if(de(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?He(e.parentNode,t):!0:!0}function Xe(e){return Boolean(e.changedTouches)}function rn(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Be(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ke(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $e(e){return Boolean(e?.shadowRoot)}var T=(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))(T||{}),_=(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))(_||{}),Ne=(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))(Ne||{}),le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(le||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),on=(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))(on||{});function Je(e){return"__ln"in e}class an{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Je(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Je(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Qe=(e,t)=>`${e}@${t}`;class sn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new an,r=a=>{let i=a,c=pe;for(;c===pe;)i=i&&i.nextSibling,c=i&&this.mirror.getId(i);return c},o=a=>{var i,c,h,d,m;const u=a.getRootNode?(i=a.getRootNode())==null?void 0:i.host:null;let p=u;for(;(h=(c=p?.getRootNode)==null?void 0:c.call(p))!=null&&h.host;)p=((m=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:m.host)||null;const y=!this.doc.contains(a)&&(!p||!this.doc.contains(p));if(!a.parentNode||y)return;const C=de(a.parentNode)?this.mirror.getId(u):this.mirror.getId(a.parentNode),w=r(a);if(C===-1||w===-1)return n.addNode(a);const O=ne(a,{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:S=>{Be(S,this.mirror)&&this.iframeManager.addIframe(S),Ke(S,this.mirror)&&this.stylesheetManager.addStylesheet(S),$e(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(S,v)=>{this.iframeManager.attachIframe(S,v,this.mirror),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,v)=>{this.stylesheetManager.attachStylesheet(S,v,this.mirror)}});O&&t.push({parentId:C,nextId:w,node:O})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))qe(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of Array.from(this.addedSet.values()))!tt(this.droppedSet,a)&&!qe(this.removes,a,this.mirror)||tt(this.movedSet,a)?o(a):this.droppedSet.add(a);let s=null;for(;n.length;){let a=null;if(s){const i=this.mirror.getId(s.value.parentNode),c=r(s.value);i!==-1&&c!==-1&&(a=s)}if(!a)for(let i=n.length-1;i>=0;i--){const c=n.get(i);if(c){const h=this.mirror.getId(c.value.parentNode),d=r(c.value);if(h!==-1&&d!==-1){a=c;break}}}if(!a){for(;n.head;)n.removeNode(n.head.value);break}s=a.previous,n.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>{let i=a.value;return this.enableStrictPrivacy&&i&&(i=Oe(i)),{id:this.mirror.getId(a.node),value:i}}).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.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(!Ee(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!U(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:ze(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Te({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),U(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const a of Array.from(n.style)){const i=n.style.getPropertyValue(a),c=n.style.getPropertyPriority(a);(i!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a))&&(c===""?l[a]=i:l[a]=[i,c])}for(const a of Array.from(s.style))n.style.getPropertyValue(a)===""&&(l[a]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=We(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(U(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=de(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);U(t.target,this.blockClass,!1)||Ee(n,this.mirror)||!nn(n,this.mirror)||(this.addedSet.has(n)?(Re(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||He(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Qe(r,o)]?Re(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:de(t.target)&&he(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Ee(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Qe(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);U(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Re(e,t){e.delete(t),t.childNodes.forEach(n=>Re(e,n))}function qe(e,t,n){return e.length===0?!1:et(e,t,n)}function et(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(s=>s.id===o)?!0:et(e,r,n)}function tt(e,t){return e.size===0?!1:nt(e,t)}function nt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:nt(e,n):!1}var ln=Object.defineProperty,cn=Object.defineProperties,un=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,ot=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,at=(e,t)=>{for(var n in t||(t={}))dn.call(t,n)&&ot(e,n,t[n]);if(rt)for(var n of rt(t))hn.call(t,n)&&ot(e,n,t[n]);return e},pn=(e,t)=>cn(e,un(t));const re=[],st=typeof CSSGroupingRule<"u",it=typeof CSSMediaRule<"u",lt=typeof CSSSupportsRule<"u",ct=typeof CSSConditionRule<"u";function ye(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 ut(e,t){var n,r;const o=new sn;re.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const l=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");l&&window[l]&&(s=window[l]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function mn({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],a;const i=me(d=>{const m=Date.now()-a;e(l.map(u=>(u.timeOffset-=m,u)),d),l=[],a=null},s),c=me(d=>{const m=ye(d),{clientX:u,clientY:p}=Xe(d)?d.changedTouches[0]:d;a||(a=Date.now()),l.push({x:u,y:p,id:r.getId(m),timeOffset:Date.now()-a}),i(typeof DragEvent<"u"&&d instanceof DragEvent?_.Drag:d instanceof MouseEvent?_.MouseMove:_.TouchMove)},o,{trailing:!1}),h=[V("mousemove",c,n),V("touchmove",c,n),V("drag",c,n)];return()=>{h.forEach(d=>d())}}function fn({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=i=>c=>{const h=ye(c);if(U(h,r,!0)||tn(h))return;const d=Xe(c)?c.changedTouches[0]:c;if(!d)return;const m=n.getId(h),{clientX:u,clientY:p}=d;e({type:Ne[i],id:m,x:u,y:p})};return Object.keys(Ne).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&s[i]!==!1).forEach(i=>{const c=i.toLowerCase(),h=a(i);l.push(V(c,h,t))}),()=>{l.forEach(i=>i())}}function dt({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const s=me(l=>{const a=ye(l);if(!a||U(a,r,!0))return;const i=n.getId(a);if(a===t){const c=t.scrollingElement||t.documentElement;e({id:i,x:c.scrollLeft,y:c.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})},o.scroll||100);return V("scroll",s,t)}function yn({viewportResizeCb:e}){let t=-1,n=-1;const r=me(()=>{const o=Ue(),s=Ye();(t!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),t=o,n=s)},200);return V("resize",r,window)}function ht(e,t){const n=at({},e);return t||delete n.userTriggered,n}const vn=["INPUT","TEXTAREA","SELECT"],pt=new WeakMap;function gn({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:i}){function c(p){let y=ye(p);const C=p.isTrusted;if(y&&y.tagName==="OPTION"&&(y=y.parentElement),!y||!y.tagName||vn.indexOf(y.tagName)<0||U(y,r,!0))return;const w=y.type;if(y.classList.contains(o))return;let O=y.value,S=!1;w==="radio"||w==="checkbox"?S=y.checked:(s[y.tagName.toLowerCase()]||s[w])&&(O=Te({maskInputOptions:s,tagName:y.tagName,type:w,value:O,maskInputFn:l})),h(y,ht({text:O,isChecked:S,userTriggered:C},i));const v=y.name;w==="radio"&&v&&S&&t.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach(f=>{f!==y&&h(f,ht({text:f.value,isChecked:!S,userTriggered:!1},i))})}function h(p,y){const C=pt.get(p);if(!C||C.text!==y.text||C.isChecked!==y.isChecked){pt.set(p,y);const w=n.getId(p);e(pn(at({},y),{id:w}))}}const d=(a.input==="last"?["change"]:["input","change"]).map(p=>V(p,c,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...u.map(p=>ke(p[0],p[1],{set(){c({target:this})}}))),()=>{d.forEach(p=>p())}}function Ie(e){const t=[];function n(r,o){if(st&&r.parentRule instanceof CSSGroupingRule||it&&r.parentRule instanceof CSSMediaRule||lt&&r.parentRule instanceof CSSSupportsRule||ct&&r.parentRule instanceof CSSConditionRule){const s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else{const s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function bn({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(a,i){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,adds:[{rule:a,index:i}]}),r.apply(this,[a,i])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(a){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,removes:[{index:a}]}),o.apply(this,[a])};const s={};st?s.CSSGroupingRule=n.CSSGroupingRule:(it&&(s.CSSMediaRule=n.CSSMediaRule),ct&&(s.CSSConditionRule=n.CSSConditionRule),lt&&(s.CSSSupportsRule=n.CSSSupportsRule));const l={};return Object.entries(s).forEach(([a,i])=>{l[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(c,h){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:c,index:[...Ie(this),h||0]}]}),l[a].insertRule.apply(this,[c,h])},i.prototype.deleteRule=function(c){const h=t.getId(this.parentStyleSheet.ownerNode);return h!==-1&&e({id:h,removes:[{index:[...Ie(this),c]}]}),l[a].deleteRule.apply(this,[c])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([a,i])=>{i.prototype.insertRule=l[a].insertRule,i.prototype.deleteRule=l[a].deleteRule})}}function Sn({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(s,l,a){var i,c;const h=t.getId((c=(i=this.parentRule)==null?void 0:i.parentStyleSheet)==null?void 0:c.ownerNode);return h!==-1&&e({id:h,set:{property:s,value:l,priority:a},index:Ie(this.parentRule)}),r.apply(this,[s,l,a])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(s){var l,a;const i=t.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return i!==-1&&e({id:i,remove:{property:s},index:Ie(this.parentRule)}),o.apply(this,[s])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Cn({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=l=>me(a=>{const i=ye(a);if(!i||U(i,t,!0))return;const{currentTime:c,volume:h,muted:d}=i;e({type:l,id:n.getId(i),currentTime:c,volume:h,muted:d})},r.media||500),s=[V("play",o(fe.Play)),V("pause",o(fe.Pause)),V("seeked",o(fe.Seeked)),V("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(l=>l())}}function kn({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(a,i,c){const h=new s(a,i,c);return o.set(h,{family:a,buffer:typeof i!="string",descriptors:c,fontSource:typeof i=="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),h};const l=ie(t.fonts,"add",function(a){return function(i){return setTimeout(()=>{const c=o.get(i);c&&(e(c),o.delete(i))},0),a.apply(this,[i])}});return r.push(()=>{n.FontFace=s}),r.push(l),()=>{r.forEach(a=>a())}}function In(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:l,inputCb:a,mediaInteractionCb:i,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),n(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),r(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),s(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),a(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),i(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),h(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),d(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),m(...u)}}function wn(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};In(e,t);const r=ut(e,e.doc),o=mn(e),s=fn(e),l=dt(e),a=yn(e),i=gn(e),c=Cn(e),h=bn(e,{win:n}),d=Sn(e,{win:n}),m=e.collectFonts?kn(e):()=>{},u=[];for(const p of e.plugins)u.push(p.observer(p.callback,n,p.options));return()=>{re.forEach(p=>p.reset()),r.disconnect(),o(),s(),l(),a(),i(),c(),h(),d(),m(),u.forEach(p=>p())}}class Mn{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Tn=Object.defineProperty,On=Object.defineProperties,xn=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,Ln=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,ft=(e,t,n)=>t in e?Tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yt=(e,t)=>{for(var n in t||(t={}))Ln.call(t,n)&&ft(e,n,t[n]);if(mt)for(var n of mt(t))En.call(t,n)&&ft(e,n,t[n]);return e},vt=(e,t)=>On(e,xn(t));class Nn{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(ie(HTMLElement.prototype,"attachShadow",function(r){return function(o){const s=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(t,n){!he(t)||(ut(vt(yt({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),dt(vt(yt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(ie(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const s=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),s}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rn=typeof Uint8Array>"u"?[]:new Uint8Array(256),we=0;we<ce.length;we++)Rn[ce.charCodeAt(we)]=we;var Dn=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=ce[t[n]>>2],o+=ce[(t[n]&3)<<4|t[n+1]>>4],o+=ce[(t[n+1]&15)<<2|t[n+2]>>6],o+=ce[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const gt=new Map;function Fn(e,t){let n=gt.get(e);return n||(n=new Map,gt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const bt=(e,t,n)=>{if(!e||!(Ct(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=Fn(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Me(e,t,n){if(e instanceof Array)return e.map(r=>Me(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=Dn(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Me(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Me(e.data,t,n),e.width,e.height]};if(Ct(e,t)||typeof e=="object"){const r=e.constructor.name,o=bt(e,t,n);return{rr_type:r,index:o}}}}return e}const St=(e,t,n)=>[...e].map(r=>Me(r,t,n)),Ct=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function Pn(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of s)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=ie(t.CanvasRenderingContext2D.prototype,l,function(i){return function(...c){return U(this.canvas,n,!0)||setTimeout(()=>{const h=St([...c],t,this);e(this.canvas,{type:le["2D"],property:l,args:h})},0),i.apply(this,c)}});o.push(a)}catch{const i=ke(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:le["2D"],property:l,args:[c],setter:!0})}});o.push(i)}return()=>{o.forEach(l=>l())}}function kt(e,t){const n=[];try{const r=ie(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...l){return U(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...l])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function It(e,t,n,r,o,s){const l=[],a=Object.getOwnPropertyNames(e);for(const i of a)try{if(typeof e[i]!="function")continue;const c=ie(e,i,function(h){return function(...d){const m=h.apply(this,d);if(bt(m,s,e),!U(this.canvas,r,!0)){const u=St([...d],s,e),p={type:t,property:i,args:u};n(this.canvas,p)}return m}});l.push(c)}catch{const h=ke(e,i,{set(d){n(this.canvas,{type:t,property:i,args:[d],setter:!0})}});l.push(h)}return l}function An(e,t,n,r){const o=[];return o.push(...It(t.WebGLRenderingContext.prototype,le.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...It(t.WebGL2RenderingContext.prototype,le.WebGL2,e,n,r,t)),()=>{o.forEach(s=>s())}}function _n(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function Wn(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,s=_n(e,o),l=s.indexOf(`
|
|
4
|
+
`,10)+1,a=s.substring(l)+(r?"//# sourceMappingURL="+r:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}function Gn(e,t,n){var r;return function(s){return r=r||Wn(e,t,n),new Worker(r,s)}}var zn=Gn("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),wt=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,Zn=(e,t)=>{var n={};for(var r in e)Vn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wt)for(var r of wt(e))t.indexOf(r)<0&&jn.call(e,r)&&(n[r]=e[r]);return n},Un=(e,t,n)=>new Promise((r,o)=>{var s=i=>{try{a(n.next(i))}catch(c){o(c)}},l=i=>{try{a(n.throw(i))}catch(c){o(c)}},a=i=>i.done?r(i.value):Promise.resolve(i.value).then(s,l);a((n=n.apply(e,t)).next())});class Yn{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r){const o=kt(n,r),s=new Map,l=new zn;l.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:u,type:p,width:y,height:C}=d.data;this.mutationCb({id:m,type:le["2D"],commands:[{property:"clearRect",args:[0,0,y,C]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:p}]},0,0]}]})};const a=1e3/t;let i=0,c;const h=d=>{if(i&&d-i<a){c=requestAnimationFrame(h);return}i=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(m=>Un(this,null,function*(){var u;const p=this.mirror.getId(m);if(s.get(p))return;if(s.set(p,!0),["webgl","webgl2"].includes(m.__context)){const C=m.getContext(m.__context);((u=C?.getContextAttributes())==null?void 0:u.preserveDrawingBuffer)===!1&&C?.clear(C.COLOR_BUFFER_BIT)}if(m.width===0||m.height===0)return;const y=yield createImageBitmap(m);l.postMessage({id:p,bitmap:y,width:m.width,height:m.height},[y])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=kt(t,n),o=Pn(this.processMutation.bind(this),t,n,this.mirror),s=An(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(l=>Zn(l,["type"])),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class Hn{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var Xn=Object.defineProperty,Bn=Object.defineProperties,Kn=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertySymbols,$n=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Tt=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X=(e,t)=>{for(var n in t||(t={}))$n.call(t,n)&&Tt(e,n,t[n]);if(Mt)for(var n of Mt(t))Jn.call(t,n)&&Tt(e,n,t[n]);return e},Qn=(e,t)=>Bn(e,Kn(t));function D(e){return Qn(X({},e),{timestamp:Date.now()})}let N,ve;const $=Nt();function ge(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:l="highlight-ignore",maskTextClass:a="highlight-mask",maskTextSelector:i=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:m,maskInputFn:u,maskTextFn:p=Oe,hooks:y,packFn:C,sampling:w={},mousemoveWait:O,recordCanvas:S=!1,userTriggeredOnInput:v=!1,collectFonts:f=!1,inlineImages:j=!1,plugins:F,keepIframeSrcFn:L=()=>!1,enableStrictPrivacy:Y=!1}=e;if(!t)throw new Error("emit function is required");O!==void 0&&w.mousemove===void 0&&(w.mousemove=O),$.reset();const R=h===!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}:d!==void 0?d:{password:!0},P=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};rn();let J,W=0;const te=g=>{for(const b of F||[])b.eventProcessor&&(g=b.eventProcessor(g));return C&&(g=C(g)),g};N=(g,b)=>{var H;if(((H=re[0])==null?void 0:H.isFrozen())&&g.type!==T.FullSnapshot&&!(g.type===T.IncrementalSnapshot&&g.data.source===_.Mutation)&&re.forEach(z=>z.unfreeze()),t(te(g),b),g.type===T.FullSnapshot)J=g,W=0;else if(g.type===T.IncrementalSnapshot){if(g.data.source===_.Mutation&&g.data.isAttachIframe)return;W++;const z=r&&W>=r,Q=n&&g.timestamp-J.timestamp>n;(z||Q)&&ve(!0)}};const M=g=>{N(D({type:T.IncrementalSnapshot,data:X({source:_.Mutation},g)}))},B=g=>N(D({type:T.IncrementalSnapshot,data:X({source:_.Scroll},g)})),q=g=>N(D({type:T.IncrementalSnapshot,data:X({source:_.CanvasMutation},g)})),A=new Mn({mutationCb:M}),K=new Hn({mutationCb:M}),Z=new Yn({recordCanvas:S,mutationCb:q,win:window,blockClass:o,mirror:$,sampling:w.canvas}),G=new Nn({mutationCb:M,scrollCb:B,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskInputOptions:R,maskTextFn:p,maskInputFn:u,recordCanvas:S,inlineImages:j,sampling:w,slimDOMOptions:P,iframeManager:A,stylesheetManager:K,canvasManager:Z,keepIframeSrcFn:L,enableStrictPrivacy:Y},mirror:$});ve=(g=!1)=>{var b,H,z,Q;N(D({type:T.Meta,data:{href:window.location.href,width:Ye(),height:Ue()}}),g),re.forEach(x=>x.lock());const k=en(document,{mirror:$,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskAllInputs:R,maskTextFn:p,slimDOM:P,recordCanvas:S,inlineImages:j,enableStrictPrivacy:Y,onSerialize:x=>{Be(x,$)&&A.addIframe(x),Ke(x,$)&&K.addStylesheet(x),$e(x)&&G.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,oe)=>{A.attachIframe(x,oe,$),G.observeAttachShadow(x)},onStylesheetLoad:(x,oe)=>{K.attachStylesheet(x,oe,$)},keepIframeSrcFn:L});if(!k)return console.warn("Failed to snapshot the document");N(D({type:T.FullSnapshot,data:{node:k,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((H=(b=document?.body)==null?void 0:b.parentElement)==null?void 0:H.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Q=(z=document?.body)==null?void 0:z.parentElement)==null?void 0:Q.scrollTop)||document?.body.scrollTop||0}}})),re.forEach(x=>x.unlock())};try{const g=[];g.push(V("DOMContentLoaded",()=>{N(D({type:T.DomContentLoaded,data:{}}))}));const b=z=>{var Q;return wn({mutationCb:M,mousemoveCb:(k,x)=>N(D({type:T.IncrementalSnapshot,data:{source:x,positions:k}})),mouseInteractionCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.MouseInteraction},k)})),scrollCb:B,viewportResizeCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.ViewportResize},k)})),inputCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.Input},k)})),mediaInteractionCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.MediaInteraction},k)})),styleSheetRuleCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.StyleSheetRule},k)})),styleDeclarationCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.StyleDeclaration},k)})),canvasMutationCb:q,fontCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.Font},k)})),blockClass:o,ignoreClass:l,maskTextClass:a,maskTextSelector:i,maskInputOptions:R,inlineStylesheet:c,sampling:w,recordCanvas:S,inlineImages:j,userTriggeredOnInput:v,collectFonts:f,doc:z,maskInputFn:u,maskTextFn:p,keepIframeSrcFn:L,blockSelector:s,slimDOMOptions:P,mirror:$,iframeManager:A,stylesheetManager:K,shadowDomManager:G,canvasManager:Z,enableStrictPrivacy:Y,plugins:((Q=F?.filter(k=>k.observer))==null?void 0:Q.map(k=>({observer:k.observer,options:k.options,callback:x=>N(D({type:T.Plugin,data:{plugin:k.name,payload:x}}))})))||[]},y)};A.addLoadListener(z=>{g.push(b(z.contentDocument))});const H=()=>{ve(),g.push(b(document))};return document.readyState==="interactive"||document.readyState==="complete"?H():g.push(V("load",()=>{N(D({type:T.Load,data:{}})),H()},window)),()=>{g.forEach(z=>z())}}catch(g){console.warn(g)}}return ge.addCustomEvent=(e,t)=>{!N||N(D({type:T.Custom,data:{tag:e,payload:t}}))},ge.freezePage=()=>{re.forEach(e=>e.freeze())},ge.takeFullSnapshot=e=>{if(!ve)throw new Error("please take full snapshot after start recording");ve(e)},ge.mirror=$,ge}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var rrwebRecord=function(){"use strict";var E;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(E||(E={}));function Et(e){return e.nodeType===e.ELEMENT_NODE}function de(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function he(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Pe=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 Nt(){return new Pe}function Te(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(s?l=s(l):l="*".repeat(l.length)),l}var Ae="__rrweb_original__";function Rt(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 s=t.getImageData,l=Ae in s?s[Ae]:s,a=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(a.some(function(i){return i!==0}))return!1}return!0}function Oe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Dt=1,Ft=new RegExp("[^a-z0-9-_:]"),pe=-2;function Pt(){return Dt++}function At(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Ft.test(t)?"div":t}function xe(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(_t).join(""):null}catch{return null}}function _t(e){var t=e.cssText;if(Wt(e))try{t=xe(e.styleSheet)||t}catch{}return t}function Wt(e){return"styleSheet"in e}function Gt(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function zt(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ae,_e,Vt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,jt=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zt=/^(data:)([^,]*),(.*)/i;function be(e,t){return(e||"").replace(Vt,function(r,n,o,s,l,a){var i=o||l||a,c=n||s||"";if(!i)return r;if(!jt.test(i)||Zt.test(i))return"url(".concat(c).concat(i).concat(c,")");if(i[0]==="/")return"url(".concat(c).concat(zt(t)+i).concat(c,")");var h=t.split("/"),d=i.split("/");h.pop();for(var m=0,u=d;m<u.length;m++){var p=u[m];p!=="."&&(p===".."?h.pop():h.push(p))}return"url(".concat(c).concat(h.join("/")).concat(c,")")})}var Ut=/^[^ \t\n\r\u000c]+/,Yt=/^[, \t\n\r\u000c]+/;function Ht(e,t){if(t.trim()==="")return t;var r=0;function n(c){var h,d=c.exec(t.substring(r));return d?(h=d[0],r+=h.length,h):""}for(var o=[];n(Yt),!(r>=t.length);){var s=n(Ut);if(s.slice(-1)===",")s=Se(e,s.substring(0,s.length-1)),o.push(s);else{var l="";s=Se(e,s);for(var a=!1;;){var i=t.charAt(r);if(i===""){o.push((s+l).trim());break}else if(a)i===")"&&(a=!1);else if(i===","){r+=1,o.push((s+l).trim());break}else i==="("&&(a=!0);l+=i,r+=1}}}return o.join(", ")}function Se(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Xt(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Le(){var e=document.createElement("a");return e.href="",e.href}function We(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")?Se(e,n):r==="srcset"&&n?Ht(e,n):r==="style"&&n?be(n,Le()):t==="object"&&r==="data"&&n?Se(e,n):n}function Ge(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 Ce(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Ce(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?Ce(e.parentNode,t,r):!1}function ze(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(Ce(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Bt(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ve(e){return e.getAttribute("href")?e.sheet!==null:!0}function je(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function Kt(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.inlineStylesheet,c=t.maskInputOptions,h=c===void 0?{}:c,d=t.maskTextFn,m=t.maskInputFn,u=t.dataURLOptions,p=u===void 0?{}:u,v=t.inlineImages,C=t.recordCanvas,w=t.keepIframeSrcFn,O=t.newlyAddedElement,S=O===void 0?!1:O,y=t.enableStrictPrivacy,f=$t(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:E.Document,childNodes:[],compatMode:e.compatMode,rootId:f}:{type:E.Document,childNodes:[],rootId:f};case e.DOCUMENT_TYPE_NODE:return{type:E.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return Qt(e,{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:i,maskInputOptions:h,maskInputFn:m,maskTextClass:l,dataURLOptions:p,inlineImages:v,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:S,enableStrictPrivacy:y,rootId:f});case e.TEXT_NODE:return Jt(e,{maskTextClass:l,maskTextSelector:a,maskTextFn:d,enableStrictPrivacy:y,rootId:f});case e.CDATA_SECTION_NODE:return{type:E.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:E.Comment,textContent:e.textContent||"",rootId:f};default:return!1}}function $t(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function Jt(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,l=t.enableStrictPrivacy,a=t.rootId,i=e.parentNode&&e.parentNode.tagName,c=e.textContent,h=i==="STYLE"?!0:void 0,d=i==="SCRIPT"?!0:void 0,m=!1;if(h&&c){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(c=Gt(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}c=be(c,Le()),m=!0}if(d?(c="SCRIPT_PLACEHOLDER",m=!0):i==="NOSCRIPT"&&(c="",m=!0),!h&&!d&&c&&ze(e,n,o)&&(c=s?s(c):c.replace(/[\S]/g,"*")),l&&!m&&i){var u=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!u.has(i)&&c&&(c=Oe(c))}return{type:E.Text,textContent:c||"",isStyle:h,rootId:a}}function Qt(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,l=t.maskInputOptions,a=l===void 0?{}:l,i=t.maskInputFn,c=t.maskTextClass,h=t.dataURLOptions,d=h===void 0?{}:h,m=t.inlineImages,u=t.recordCanvas,p=t.keepIframeSrcFn,v=t.newlyAddedElement,C=v===void 0?!1:v,w=t.enableStrictPrivacy,O=t.rootId,S=Ge(e,n,o)||Ge(e,c,null),y=At(e),f={},j=e.attributes.length,P=0;P<j;P++){var L=e.attributes[P];f[L.name]=We(r,y,L.name,L.value)}if(y==="link"&&s){var Y=Array.from(r.styleSheets).find(function(z){return z.href===e.href}),R=null;Y&&(R=xe(Y)),R&&(delete f.rel,delete f.href,f._cssText=be(R,Y.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var R=xe(e.sheet);R&&(f._cssText=be(R,Le()))}if(y==="input"||y==="textarea"||y==="select"){var A=e.value;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&A?f.value=Te({type:f.type,tagName:y,value:A,maskInputOptions:a,maskInputFn:i}):e.checked&&(f.checked=e.checked)}if(y==="option"&&(e.selected&&!a.select?f.selected=!0:delete f.selected),y==="canvas"&&u){if(e.__context==="2d")Rt(e)||(f.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var J=e.toDataURL(d.type,d.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height;var te=G.toDataURL(d.type,d.quality);J!==te&&(f.rr_dataURL=J)}}if(y==="img"&&m&&!S){ae||(ae=r.createElement("canvas"),_e=ae.getContext("2d"));var M=e,B=M.crossOrigin;M.crossOrigin="anonymous";var q=function(){try{ae.width=M.naturalWidth,ae.height=M.naturalHeight,_e.drawImage(M,0,0),f.rr_dataURL=ae.toDataURL(d.type,d.quality)}catch(z){console.warn("Cannot inline img src=".concat(M.currentSrc,"! Error: ").concat(z))}B?f.crossOrigin=B:M.removeAttribute("crossorigin")};M.complete&&M.naturalWidth!==0?q():M.onload=q}if((y==="audio"||y==="video")&&(f.rr_mediaState=e.paused?"paused":"played",f.rr_mediaCurrentTime=e.currentTime),C||(e.scrollLeft&&(f.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(f.rr_scrollTop=e.scrollTop)),S||y==="img"&&w){var D=e.getBoundingClientRect(),K=D.width,Z=D.height;f={class:f.class,rr_width:"".concat(K,"px"),rr_height:"".concat(Z,"px")},S=!0}return y==="iframe"&&!p(f.src)&&(e.contentDocument||(f.rr_src=f.src),delete f.src),S&&y==="img"&&delete f.src,{type:E.Element,tagName:y,attributes:f,childNodes:[],isSVG:Xt(e)||void 0,needBlock:S,rootId:O}}function I(e){return e===void 0?"":e.toLowerCase()}function qt(e,t){return!!(t.comment&&e.type===E.Comment||e.type===E.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"&&(I(e.attributes.name).match(/^msapplication-tile(image|color)$/)||I(e.attributes.name)==="application-name"||I(e.attributes.rel)==="icon"||I(e.attributes.rel)==="apple-touch-icon"||I(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&I(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(I(e.attributes.property).match(/^(og|twitter|fb):/)||I(e.attributes.name).match(/^(og|twitter):/)||I(e.attributes.name)==="pinterest")||t.headMetaRobots&&(I(e.attributes.name)==="robots"||I(e.attributes.name)==="googlebot"||I(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(I(e.attributes.name)==="author"||I(e.attributes.name)==="generator"||I(e.attributes.name)==="framework"||I(e.attributes.name)==="publisher"||I(e.attributes.name)==="progid"||I(e.attributes.property).match(/^article:/)||I(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(I(e.attributes.name)==="google-site-verification"||I(e.attributes.name)==="yandex-verification"||I(e.attributes.name)==="csrf-token"||I(e.attributes.name)==="p:domain_verify"||I(e.attributes.name)==="verify-v1"||I(e.attributes.name)==="verification"||I(e.attributes.name)==="shopify-checkout-api-token"))))}function re(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.skipChild,c=i===void 0?!1:i,h=t.inlineStylesheet,d=h===void 0?!0:h,m=t.maskInputOptions,u=m===void 0?{}:m,p=t.maskTextFn,v=t.maskInputFn,C=t.slimDOMOptions,w=t.dataURLOptions,O=w===void 0?{}:w,S=t.inlineImages,y=S===void 0?!1:S,f=t.recordCanvas,j=f===void 0?!1:f,P=t.onSerialize,L=t.onIframeLoad,Y=t.iframeLoadTimeout,R=Y===void 0?5e3:Y,A=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,G=J===void 0?5e3:J,te=t.keepIframeSrcFn,M=te===void 0?function(){return!1}:te,B=t.newlyAddedElement,q=B===void 0?!1:B,D=t.enableStrictPrivacy,K=t.preserveWhiteSpace,Z=K===void 0?!0:K,z=Kt(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,dataURLOptions:O,inlineImages:y,recordCanvas:j,keepIframeSrcFn:M,newlyAddedElement:q,enableStrictPrivacy:D});if(!z)return console.warn(e,"not serialized"),null;var g;if(n.hasNode(e)?g=n.getId(e):qt(z,C)||!Z&&z.type===E.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?g=pe:g=Pt(),g===pe)return null;var b=Object.assign(z,{id:g});n.add(e,b),P&&P(e);var H=!c,_=D;if(b.type===E.Element){if(H=H&&!b.needBlock,_=!!b.needBlock,console.log("vadim strictPrivacy",{strictPrivacy:_,enableStrictPrivacy:D}),_&&b.tagName==="img"){var Q=e.cloneNode();Q.src="",n.add(Q,b)}delete b.needBlock;var k=e.shadowRoot;k&&he(k)&&(b.isShadowHost=!0)}if((b.type===E.Document||b.type===E.Element)&&H){C.headWhitespace&&b.type===E.Element&&b.tagName==="head"&&(Z=!1);for(var x={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M,enableStrictPrivacy:_},oe=0,Ot=Array.from(e.childNodes);oe<Ot.length;oe++){var De=Ot[oe],ue=re(De,x);ue&&b.childNodes.push(ue)}if(Et(e)&&e.shadowRoot)for(var Fe=0,xt=Array.from(e.shadowRoot.childNodes);Fe<xt.length;Fe++){var De=xt[Fe],ue=re(De,x);ue&&(he(e.shadowRoot)&&(ue.isShadow=!0),b.childNodes.push(ue))}}return e.parentNode&&de(e.parentNode)&&he(e.parentNode)&&(b.isShadow=!0),b.type===E.Element&&b.tagName==="iframe"&&Bt(e,function(){var ee=e.contentDocument;if(ee&&L){var Lt=re(ee,{doc:ee,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M,enableStrictPrivacy:D});Lt&&L(e,Lt)}},R),b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(A){var ee=re(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M,enableStrictPrivacy:D});ee&&A(e,ee)}},G),Ve(e)===!1)||b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(A){var ee=re(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:v,slimDOMOptions:C,dataURLOptions:O,inlineImages:y,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:P,onIframeLoad:L,iframeLoadTimeout:R,enableStrictPrivacy:D,onStylesheetLoad:A,stylesheetLoadTimeout:G,keepIframeSrcFn:M});ee&&A(e,ee)}},G),Ve(e)===!1)?null:b}function er(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Pe:n,s=r.blockClass,l=s===void 0?"highlight-block":s,a=r.blockSelector,i=a===void 0?null:a,c=r.maskTextClass,h=c===void 0?"highlight-mask":c,d=r.maskTextSelector,m=d===void 0?null:d,u=r.inlineStylesheet,p=u===void 0?!0:u,v=r.inlineImages,C=v===void 0?!1:v,w=r.recordCanvas,O=w===void 0?!1:w,S=r.maskAllInputs,y=S===void 0?!1:S,f=r.maskTextFn,j=r.maskInputFn,P=r.slimDOM,L=P===void 0?!1:P,Y=r.dataURLOptions,R=r.preserveWhiteSpace,A=r.onSerialize,J=r.onIframeLoad,G=r.iframeLoadTimeout,te=r.onStylesheetLoad,M=r.stylesheetLoadTimeout,B=r.keepIframeSrcFn,q=B===void 0?function(){return!1}:B,D=r.enableStrictPrivacy,K=D===void 0?!1:D,Z=y===!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}:y===!1?{password:!0}:y,z=L===!0||L==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:L==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:L===!1?{}:L;return re(e,{doc:e,mirror:o,blockClass:l,blockSelector:i,maskTextClass:h,maskTextSelector:m,skipChild:!1,inlineStylesheet:p,maskInputOptions:Z,maskTextFn:f,maskInputFn:j,slimDOMOptions:z,dataURLOptions:Y,inlineImages:C,recordCanvas:O,preserveWhiteSpace:R,onSerialize:A,onIframeLoad:J,iframeLoadTimeout:G,onStylesheetLoad:te,stylesheetLoadTimeout:M,keepIframeSrcFn:q,newlyAddedElement:!1,enableStrictPrivacy:K})}function V(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const se=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
var rrwebRecord=function(){"use strict";var E;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(E||(E={}));function Et(e){return e.nodeType===e.ELEMENT_NODE}function de(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function he(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Pe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Nt(){return new Pe}function Te(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,l=o||"";return(t[n.toLowerCase()]||t[r])&&(s?l=s(l):l="*".repeat(l.length)),l}var Ae="__rrweb_original__";function Rt(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var s=t.getImageData,l=Ae in s?s[Ae]:s,a=new Uint32Array(l.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(a.some(function(i){return i!==0}))return!1}return!0}function Oe(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Dt=1,Ft=new RegExp("[^a-z0-9-_:]"),pe=-2;function Pt(){return Dt++}function At(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Ft.test(t)?"div":t}function xe(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(_t).join(""):null}catch{return null}}function _t(e){var t=e.cssText;if(Wt(e))try{t=xe(e.styleSheet)||t}catch{}return t}function Wt(e){return"styleSheet"in e}function Gt(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function zt(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ae,_e,Vt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,jt=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zt=/^(data:)([^,]*),(.*)/i;function be(e,t){return(e||"").replace(Vt,function(n,r,o,s,l,a){var i=o||l||a,c=r||s||"";if(!i)return n;if(!jt.test(i)||Zt.test(i))return"url(".concat(c).concat(i).concat(c,")");if(i[0]==="/")return"url(".concat(c).concat(zt(t)+i).concat(c,")");var h=t.split("/"),d=i.split("/");h.pop();for(var m=0,u=d;m<u.length;m++){var p=u[m];p!=="."&&(p===".."?h.pop():h.push(p))}return"url(".concat(c).concat(h.join("/")).concat(c,")")})}var Ut=/^[^ \t\n\r\u000c]+/,Yt=/^[, \t\n\r\u000c]+/;function Ht(e,t){if(t.trim()==="")return t;var n=0;function r(c){var h,d=c.exec(t.substring(n));return d?(h=d[0],n+=h.length,h):""}for(var o=[];r(Yt),!(n>=t.length);){var s=r(Ut);if(s.slice(-1)===",")s=Se(e,s.substring(0,s.length-1)),o.push(s);else{var l="";s=Se(e,s);for(var a=!1;;){var i=t.charAt(n);if(i===""){o.push((s+l).trim());break}else if(a)i===")"&&(a=!1);else if(i===","){n+=1,o.push((s+l).trim());break}else i==="("&&(a=!0);l+=i,n+=1}}}return o.join(", ")}function Se(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function Xt(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function Le(){var e=document.createElement("a");return e.href="",e.href}function We(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Se(e,r):n==="srcset"&&r?Ht(e,r):n==="style"&&r?be(r,Le()):t==="object"&&n==="data"&&r?Se(e,r):r}function Ge(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ce(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ce(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ce(e.parentNode,t,n):!1}function ze(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ce(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function Bt(e,t,n){var r=e.contentWindow;if(r){var o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var a="about:blank";if(r.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ve(e){return e.getAttribute("href")?e.sheet!==null:!0}function je(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(s),r=!0,t()})}}function Kt(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.inlineStylesheet,c=t.maskInputOptions,h=c===void 0?{}:c,d=t.maskTextFn,m=t.maskInputFn,u=t.dataURLOptions,p=u===void 0?{}:u,y=t.inlineImages,C=t.recordCanvas,w=t.keepIframeSrcFn,O=t.newlyAddedElement,S=O===void 0?!1:O,v=t.enableStrictPrivacy,f=$t(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:E.Document,childNodes:[],compatMode:e.compatMode,rootId:f}:{type:E.Document,childNodes:[],rootId:f};case e.DOCUMENT_TYPE_NODE:return{type:E.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return Qt(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:i,maskInputOptions:h,maskInputFn:m,maskTextClass:l,dataURLOptions:p,inlineImages:y,recordCanvas:C,keepIframeSrcFn:w,newlyAddedElement:S,enableStrictPrivacy:v,rootId:f});case e.TEXT_NODE:return Jt(e,{maskTextClass:l,maskTextSelector:a,maskTextFn:d,enableStrictPrivacy:v,rootId:f});case e.CDATA_SECTION_NODE:return{type:E.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:E.Comment,textContent:e.textContent||"",rootId:f};default:return!1}}function $t(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function Jt(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,l=t.enableStrictPrivacy,a=t.rootId,i=e.parentNode&&e.parentNode.tagName,c=e.textContent,h=i==="STYLE"?!0:void 0,d=i==="SCRIPT"?!0:void 0,m=!1;if(h&&c){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(c=Gt(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}c=be(c,Le()),m=!0}if(d?(c="SCRIPT_PLACEHOLDER",m=!0):i==="NOSCRIPT"&&(c="",m=!0),!h&&!d&&c&&ze(e,r,o)&&(c=s?s(c):c.replace(/[\S]/g,"*")),l&&!m&&i){var u=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!u.has(i)&&c&&(c=Oe(c))}return{type:E.Text,textContent:c||"",isStyle:h,rootId:a}}function Qt(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,l=t.maskInputOptions,a=l===void 0?{}:l,i=t.maskInputFn,c=t.maskTextClass,h=t.dataURLOptions,d=h===void 0?{}:h,m=t.inlineImages,u=t.recordCanvas,p=t.keepIframeSrcFn,y=t.newlyAddedElement,C=y===void 0?!1:y,w=t.enableStrictPrivacy,O=t.rootId,S=Ge(e,r,o)||Ge(e,c,null),v=At(e),f={},j=e.attributes.length,F=0;F<j;F++){var L=e.attributes[F];f[L.name]=We(n,v,L.name,L.value)}if(v==="link"&&s){var Y=Array.from(n.styleSheets).find(function(G){return G.href===e.href}),R=null;Y&&(R=xe(Y)),R&&(delete f.rel,delete f.href,f._cssText=be(R,Y.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var R=xe(e.sheet);R&&(f._cssText=be(R,Le()))}if(v==="input"||v==="textarea"||v==="select"){var P=e.value;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&P?f.value=Te({type:f.type,tagName:v,value:P,maskInputOptions:a,maskInputFn:i}):e.checked&&(f.checked=e.checked)}if(v==="option"&&(e.selected&&!a.select?f.selected=!0:delete f.selected),v==="canvas"&&u){if(e.__context==="2d")Rt(e)||(f.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var J=e.toDataURL(d.type,d.quality),W=document.createElement("canvas");W.width=e.width,W.height=e.height;var te=W.toDataURL(d.type,d.quality);J!==te&&(f.rr_dataURL=J)}}if(v==="img"&&m&&!S){ae||(ae=n.createElement("canvas"),_e=ae.getContext("2d"));var M=e,B=M.crossOrigin;M.crossOrigin="anonymous";var q=function(){try{ae.width=M.naturalWidth,ae.height=M.naturalHeight,_e.drawImage(M,0,0),f.rr_dataURL=ae.toDataURL(d.type,d.quality)}catch(G){console.warn("Cannot inline img src=".concat(M.currentSrc,"! Error: ").concat(G))}B?f.crossOrigin=B:M.removeAttribute("crossorigin")};M.complete&&M.naturalWidth!==0?q():M.onload=q}if((v==="audio"||v==="video")&&(f.rr_mediaState=e.paused?"paused":"played",f.rr_mediaCurrentTime=e.currentTime),C||(e.scrollLeft&&(f.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(f.rr_scrollTop=e.scrollTop)),S||v==="img"&&w){var A=e.getBoundingClientRect(),K=A.width,Z=A.height;f={class:f.class,rr_width:"".concat(K,"px"),rr_height:"".concat(Z,"px")},S=!0}return v==="iframe"&&!p(f.src)&&(e.contentDocument||(f.rr_src=f.src),delete f.src),S&&v==="img"&&delete f.src,{type:E.Element,tagName:v,attributes:f,childNodes:[],isSVG:Xt(e)||void 0,needBlock:S,rootId:O}}function I(e){return e===void 0?"":e.toLowerCase()}function qt(e,t){return!!(t.comment&&e.type===E.Comment||e.type===E.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"&&(I(e.attributes.name).match(/^msapplication-tile(image|color)$/)||I(e.attributes.name)==="application-name"||I(e.attributes.rel)==="icon"||I(e.attributes.rel)==="apple-touch-icon"||I(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&I(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(I(e.attributes.property).match(/^(og|twitter|fb):/)||I(e.attributes.name).match(/^(og|twitter):/)||I(e.attributes.name)==="pinterest")||t.headMetaRobots&&(I(e.attributes.name)==="robots"||I(e.attributes.name)==="googlebot"||I(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(I(e.attributes.name)==="author"||I(e.attributes.name)==="generator"||I(e.attributes.name)==="framework"||I(e.attributes.name)==="publisher"||I(e.attributes.name)==="progid"||I(e.attributes.property).match(/^article:/)||I(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(I(e.attributes.name)==="google-site-verification"||I(e.attributes.name)==="yandex-verification"||I(e.attributes.name)==="csrf-token"||I(e.attributes.name)==="p:domain_verify"||I(e.attributes.name)==="verify-v1"||I(e.attributes.name)==="verification"||I(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,l=t.maskTextClass,a=t.maskTextSelector,i=t.skipChild,c=i===void 0?!1:i,h=t.inlineStylesheet,d=h===void 0?!0:h,m=t.maskInputOptions,u=m===void 0?{}:m,p=t.maskTextFn,y=t.maskInputFn,C=t.slimDOMOptions,w=t.dataURLOptions,O=w===void 0?{}:w,S=t.inlineImages,v=S===void 0?!1:S,f=t.recordCanvas,j=f===void 0?!1:f,F=t.onSerialize,L=t.onIframeLoad,Y=t.iframeLoadTimeout,R=Y===void 0?5e3:Y,P=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,W=J===void 0?5e3:J,te=t.keepIframeSrcFn,M=te===void 0?function(){return!1}:te,B=t.newlyAddedElement,q=B===void 0?!1:B,A=t.enableStrictPrivacy,K=t.preserveWhiteSpace,Z=K===void 0?!0:K,G=Kt(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,dataURLOptions:O,inlineImages:v,recordCanvas:j,keepIframeSrcFn:M,newlyAddedElement:q,enableStrictPrivacy:A});if(!G)return console.warn(e,"not serialized"),null;var g;if(r.hasNode(e)?g=r.getId(e):qt(G,C)||!Z&&G.type===E.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?g=pe:g=Pt(),g===pe)return null;var b=Object.assign(G,{id:g});r.add(e,b),F&&F(e);var H=!c,z=A;if(b.type===E.Element){if(H=H&&!b.needBlock,z=!!b.needBlock,z&&b.tagName==="img"){var Q=e.cloneNode();Q.src="",r.add(Q,b)}delete b.needBlock;var k=e.shadowRoot;k&&he(k)&&(b.isShadowHost=!0)}if((b.type===E.Document||b.type===E.Element)&&H){C.headWhitespace&&b.type===E.Element&&b.tagName==="head"&&(Z=!1);for(var x={doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M,enableStrictPrivacy:z},oe=0,Ot=Array.from(e.childNodes);oe<Ot.length;oe++){var De=Ot[oe],ue=ne(De,x);ue&&b.childNodes.push(ue)}if(Et(e)&&e.shadowRoot)for(var Fe=0,xt=Array.from(e.shadowRoot.childNodes);Fe<xt.length;Fe++){var De=xt[Fe],ue=ne(De,x);ue&&(he(e.shadowRoot)&&(ue.isShadow=!0),b.childNodes.push(ue))}}return e.parentNode&&de(e.parentNode)&&he(e.parentNode)&&(b.isShadow=!0),b.type===E.Element&&b.tagName==="iframe"&&Bt(e,function(){var ee=e.contentDocument;if(ee&&L){var Lt=ne(ee,{doc:ee,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M,enableStrictPrivacy:A});Lt&&L(e,Lt)}},R),b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(P){var ee=ne(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M,enableStrictPrivacy:A});ee&&P(e,ee)}},W),Ve(e)===!1)||b.type===E.Element&&b.tagName==="link"&&b.attributes.rel==="stylesheet"&&(je(e,function(){if(P){var ee=ne(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:u,maskTextFn:p,maskInputFn:y,slimDOMOptions:C,dataURLOptions:O,inlineImages:v,recordCanvas:j,preserveWhiteSpace:Z,onSerialize:F,onIframeLoad:L,iframeLoadTimeout:R,enableStrictPrivacy:A,onStylesheetLoad:P,stylesheetLoadTimeout:W,keepIframeSrcFn:M});ee&&P(e,ee)}},W),Ve(e)===!1)?null:b}function en(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Pe:r,s=n.blockClass,l=s===void 0?"highlight-block":s,a=n.blockSelector,i=a===void 0?null:a,c=n.maskTextClass,h=c===void 0?"highlight-mask":c,d=n.maskTextSelector,m=d===void 0?null:d,u=n.inlineStylesheet,p=u===void 0?!0:u,y=n.inlineImages,C=y===void 0?!1:y,w=n.recordCanvas,O=w===void 0?!1:w,S=n.maskAllInputs,v=S===void 0?!1:S,f=n.maskTextFn,j=n.maskInputFn,F=n.slimDOM,L=F===void 0?!1:F,Y=n.dataURLOptions,R=n.preserveWhiteSpace,P=n.onSerialize,J=n.onIframeLoad,W=n.iframeLoadTimeout,te=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,B=n.keepIframeSrcFn,q=B===void 0?function(){return!1}:B,A=n.enableStrictPrivacy,K=A===void 0?!1:A,Z=v===!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}:v===!1?{password:!0}:v,G=L===!0||L==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:L==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:L===!1?{}:L;return ne(e,{doc:e,mirror:o,blockClass:l,blockSelector:i,maskTextClass:h,maskTextSelector:m,skipChild:!1,inlineStylesheet:p,maskInputOptions:Z,maskTextFn:f,maskInputFn:j,slimDOMOptions:G,dataURLOptions:Y,inlineImages:C,recordCanvas:O,preserveWhiteSpace:R,onSerialize:P,onIframeLoad:J,iframeLoadTimeout:W,onStylesheetLoad:te,stylesheetLoadTimeout:M,keepIframeSrcFn:q,newlyAddedElement:!1,enableStrictPrivacy:K})}function V(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const se=`Please stop import mirror directly. Instead of that,\r
|
|
2
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
|
-
or you can use record.mirror to access the mirror instance during recording.`;let Ze={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ze=new Proxy(Ze,{get(e,t,r){return t==="map"&&console.error(se),Reflect.get(e,t,r)}}));function me(e,t,r={}){let n=null,o=0;return function(...s){const l=Date.now();!o&&r.leading===!1&&(o=l);const a=t-(l-o),i=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(i,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(i,s)},a))}}function ke(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),s&&s.set&&s.set.call(this,l)}}),()=>ke(e,t,s||{},!0)}function ie(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 Ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ye(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const tr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function U(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(Ce(n,t,r))return!0;return!1}function rr(e,t){return t.getId(e)!==-1}function Ee(e,t){return t.getId(e)===pe}function He(e,t){if(de(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?He(e.parentNode,t):!0:!0}function Xe(e){return Boolean(e.changedTouches)}function nr(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 Be(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ke(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $e(e){return Boolean(e?.shadowRoot)}var T=(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))(T||{}),W=(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))(W||{}),Ne=(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))(Ne||{}),le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(le||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),or=(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))(or||{});function Je(e){return"__ln"in e}class ar{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&&Je(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&&Je(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 Qe=(e,t)=>`${e}@${t}`;class sr{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 ar,n=a=>{let i=a,c=pe;for(;c===pe;)i=i&&i.nextSibling,c=i&&this.mirror.getId(i);return c},o=a=>{var i,c,h,d,m;const u=a.getRootNode?(i=a.getRootNode())==null?void 0:i.host:null;let p=u;for(;(h=(c=p?.getRootNode)==null?void 0:c.call(p))!=null&&h.host;)p=((m=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:m.host)||null;const v=!this.doc.contains(a)&&(!p||!this.doc.contains(p));if(!a.parentNode||v)return;const C=de(a.parentNode)?this.mirror.getId(u):this.mirror.getId(a.parentNode),w=n(a);if(C===-1||w===-1)return r.addNode(a);const O=re(a,{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:S=>{Be(S,this.mirror)&&this.iframeManager.addIframe(S),Ke(S,this.mirror)&&this.stylesheetManager.addStylesheet(S),$e(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(S,y)=>{this.iframeManager.attachIframe(S,y,this.mirror),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,y)=>{this.stylesheetManager.attachStylesheet(S,y,this.mirror)}});O&&t.push({parentId:C,nextId:w,node:O})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))qe(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of Array.from(this.addedSet.values()))!tt(this.droppedSet,a)&&!qe(this.removes,a,this.mirror)||tt(this.movedSet,a)?o(a):this.droppedSet.add(a);let s=null;for(;r.length;){let a=null;if(s){const i=this.mirror.getId(s.value.parentNode),c=n(s.value);i!==-1&&c!==-1&&(a=s)}if(!a)for(let i=r.length-1;i>=0;i--){const c=r.get(i);if(c){const h=this.mirror.getId(c.value.parentNode),d=n(c.value);if(h!==-1&&d!==-1){a=c;break}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}s=a.previous,r.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>{let i=a.value;return this.enableStrictPrivacy&&i&&(i=Oe(i)),{id:this.mirror.getId(a.node),value:i}}).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.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(!Ee(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!U(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:ze(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=Te({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),U(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(s=>s.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 s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const a of Array.from(r.style)){const i=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(i!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a))&&(c===""?l[a]=i:l[a]=[i,c])}for(const a of Array.from(s.style))r.style.getPropertyValue(a)===""&&(l[a]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=We(this.doc,r.tagName,t.attributeName,n)}break}case"childList":{if(U(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=de(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);U(t.target,this.blockClass,!1)||Ee(r,this.mirror)||!rr(r,this.mirror)||(this.addedSet.has(r)?(Re(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||He(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Qe(n,o)]?Re(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:de(t.target)&&he(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(Ee(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[Qe(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);U(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 Re(e,t){e.delete(t),t.childNodes.forEach(r=>Re(e,r))}function qe(e,t,r){return e.length===0?!1:et(e,t,r)}function et(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:et(e,n,r)}function tt(e,t){return e.size===0?!1:rt(e,t)}function rt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:rt(e,r):!1}var ir=Object.defineProperty,lr=Object.defineProperties,cr=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,ur=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,ot=(e,t,r)=>t in e?ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,at=(e,t)=>{for(var r in t||(t={}))ur.call(t,r)&&ot(e,r,t[r]);if(nt)for(var r of nt(t))dr.call(t,r)&&ot(e,r,t[r]);return e},hr=(e,t)=>lr(e,cr(t));const ne=[],st=typeof CSSGroupingRule<"u",it=typeof CSSMediaRule<"u",lt=typeof CSSSupportsRule<"u",ct=typeof CSSConditionRule<"u";function ve(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 ut(e,t){var r,n;const o=new sr;ne.push(o),o.init(e);let s=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]&&(s=window[l]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function pr({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],a;const i=me(d=>{const m=Date.now()-a;e(l.map(u=>(u.timeOffset-=m,u)),d),l=[],a=null},s),c=me(d=>{const m=ve(d),{clientX:u,clientY:p}=Xe(d)?d.changedTouches[0]:d;a||(a=Date.now()),l.push({x:u,y:p,id:n.getId(m),timeOffset:Date.now()-a}),i(typeof DragEvent<"u"&&d instanceof DragEvent?W.Drag:d instanceof MouseEvent?W.MouseMove:W.TouchMove)},o,{trailing:!1}),h=[V("mousemove",c,r),V("touchmove",c,r),V("drag",c,r)];return()=>{h.forEach(d=>d())}}function mr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=i=>c=>{const h=ve(c);if(U(h,n,!0)||tr(h))return;const d=Xe(c)?c.changedTouches[0]:c;if(!d)return;const m=r.getId(h),{clientX:u,clientY:p}=d;e({type:Ne[i],id:m,x:u,y:p})};return Object.keys(Ne).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&s[i]!==!1).forEach(i=>{const c=i.toLowerCase(),h=a(i);l.push(V(c,h,t))}),()=>{l.forEach(i=>i())}}function dt({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=me(l=>{const a=ve(l);if(!a||U(a,n,!0))return;const i=r.getId(a);if(a===t){const c=t.scrollingElement||t.documentElement;e({id:i,x:c.scrollLeft,y:c.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})},o.scroll||100);return V("scroll",s,t)}function fr({viewportResizeCb:e}){let t=-1,r=-1;const n=me(()=>{const o=Ue(),s=Ye();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return V("resize",n,window)}function ht(e,t){const r=at({},e);return t||delete r.userTriggered,r}const vr=["INPUT","TEXTAREA","SELECT"],pt=new WeakMap;function yr({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:i}){function c(p){let v=ve(p);const C=p.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||vr.indexOf(v.tagName)<0||U(v,n,!0))return;const w=v.type;if(v.classList.contains(o))return;let O=v.value,S=!1;w==="radio"||w==="checkbox"?S=v.checked:(s[v.tagName.toLowerCase()]||s[w])&&(O=Te({maskInputOptions:s,tagName:v.tagName,type:w,value:O,maskInputFn:l})),h(v,ht({text:O,isChecked:S,userTriggered:C},i));const y=v.name;w==="radio"&&y&&S&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach(f=>{f!==v&&h(f,ht({text:f.value,isChecked:!S,userTriggered:!1},i))})}function h(p,v){const C=pt.get(p);if(!C||C.text!==v.text||C.isChecked!==v.isChecked){pt.set(p,v);const w=r.getId(p);e(hr(at({},v),{id:w}))}}const d=(a.input==="last"?["change"]:["input","change"]).map(p=>V(p,c,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...u.map(p=>ke(p[0],p[1],{set(){c({target:this})}}))),()=>{d.forEach(p=>p())}}function Ie(e){const t=[];function r(n,o){if(st&&n.parentRule instanceof CSSGroupingRule||it&&n.parentRule instanceof CSSMediaRule||lt&&n.parentRule instanceof CSSSupportsRule||ct&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function gr({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(a,i){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,adds:[{rule:a,index:i}]}),n.apply(this,[a,i])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(a){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,removes:[{index:a}]}),o.apply(this,[a])};const s={};st?s.CSSGroupingRule=r.CSSGroupingRule:(it&&(s.CSSMediaRule=r.CSSMediaRule),ct&&(s.CSSConditionRule=r.CSSConditionRule),lt&&(s.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(s).forEach(([a,i])=>{l[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(c,h){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:c,index:[...Ie(this),h||0]}]}),l[a].insertRule.apply(this,[c,h])},i.prototype.deleteRule=function(c){const h=t.getId(this.parentStyleSheet.ownerNode);return h!==-1&&e({id:h,removes:[{index:[...Ie(this),c]}]}),l[a].deleteRule.apply(this,[c])}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([a,i])=>{i.prototype.insertRule=l[a].insertRule,i.prototype.deleteRule=l[a].deleteRule})}}function br({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,l,a){var i,c;const h=t.getId((c=(i=this.parentRule)==null?void 0:i.parentStyleSheet)==null?void 0:c.ownerNode);return h!==-1&&e({id:h,set:{property:s,value:l,priority:a},index:Ie(this.parentRule)}),n.apply(this,[s,l,a])};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var l,a;const i=t.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return i!==-1&&e({id:i,remove:{property:s},index:Ie(this.parentRule)}),o.apply(this,[s])},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Sr({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>me(a=>{const i=ve(a);if(!i||U(i,t,!0))return;const{currentTime:c,volume:h,muted:d}=i;e({type:l,id:r.getId(i),currentTime:c,volume:h,muted:d})},n.media||500),s=[V("play",o(fe.Play)),V("pause",o(fe.Pause)),V("seeked",o(fe.Seeked)),V("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(l=>l())}}function Cr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(a,i,c){const h=new s(a,i,c);return o.set(h,{family:a,buffer:typeof i!="string",descriptors:c,fontSource:typeof i=="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),h};const l=ie(t.fonts,"add",function(a){return function(i){return setTimeout(()=>{const c=o.get(i);c&&(e(c),o.delete(i))},0),a.apply(this,[i])}});return n.push(()=>{r.FontFace=s}),n.push(l),()=>{n.forEach(a=>a())}}function kr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:l,inputCb:a,mediaInteractionCb:i,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),s(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),a(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),i(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),h(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),d(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),m(...u)}}function Ir(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};kr(e,t);const n=ut(e,e.doc),o=pr(e),s=mr(e),l=dt(e),a=fr(e),i=yr(e),c=Sr(e),h=gr(e,{win:r}),d=br(e,{win:r}),m=e.collectFonts?Cr(e):()=>{},u=[];for(const p of e.plugins)u.push(p.observer(p.callback,r,p.options));return()=>{ne.forEach(p=>p.reset()),n.disconnect(),o(),s(),l(),a(),i(),c(),h(),d(),m(),u.forEach(p=>p())}}class wr{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 Mr=Object.defineProperty,Tr=Object.defineProperties,Or=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,ft=(e,t,r)=>t in e?Mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vt=(e,t)=>{for(var r in t||(t={}))xr.call(t,r)&&ft(e,r,t[r]);if(mt)for(var r of mt(t))Lr.call(t,r)&&ft(e,r,t[r]);return e},yt=(e,t)=>Tr(e,Or(t));class Er{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(ie(HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(t,r){!he(t)||(ut(yt(vt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),dt(yt(vt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(ie(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const s=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),s}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nr=typeof Uint8Array>"u"?[]:new Uint8Array(256),we=0;we<ce.length;we++)Nr[ce.charCodeAt(we)]=we;var Rr=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ce[t[r]>>2],o+=ce[(t[r]&3)<<4|t[r+1]>>4],o+=ce[(t[r+1]&15)<<2|t[r+2]>>6],o+=ce[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};const gt=new Map;function Dr(e,t){let r=gt.get(e);return r||(r=new Map,gt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const bt=(e,t,r)=>{if(!e||!(Ct(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Dr(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Me(e,t,r){if(e instanceof Array)return e.map(n=>Me(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=Rr(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Me(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:[Me(e.data,t,r),e.width,e.height]};if(Ct(e,t)||typeof e=="object"){const n=e.constructor.name,o=bt(e,t,r);return{rr_type:n,index:o}}}}return e}const St=(e,t,r)=>[...e].map(n=>Me(n,t,r)),Ct=(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 Fr(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of s)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=ie(t.CanvasRenderingContext2D.prototype,l,function(i){return function(...c){return U(this.canvas,r,!0)||setTimeout(()=>{const h=St([...c],t,this);e(this.canvas,{type:le["2D"],property:l,args:h})},0),i.apply(this,c)}});o.push(a)}catch{const i=ke(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:le["2D"],property:l,args:[c],setter:!0})}});o.push(i)}return()=>{o.forEach(l=>l())}}function kt(e,t){const r=[];try{const n=ie(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...l){return U(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function It(e,t,r,n,o,s){const l=[],a=Object.getOwnPropertyNames(e);for(const i of a)try{if(typeof e[i]!="function")continue;const c=ie(e,i,function(h){return function(...d){const m=h.apply(this,d);if(bt(m,s,e),!U(this.canvas,n,!0)){const u=St([...d],s,e),p={type:t,property:i,args:u};r(this.canvas,p)}return m}});l.push(c)}catch{const h=ke(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:!0})}});l.push(h)}return l}function Pr(e,t,r,n){const o=[];return o.push(...It(t.WebGLRenderingContext.prototype,le.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...It(t.WebGL2RenderingContext.prototype,le.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function Ar(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function _r(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=Ar(e,o),l=s.indexOf(`
|
|
4
|
-
`,10)+1,a=s.substring(l)+(n?"//# sourceMappingURL="+n:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}function Wr(e,t,r){var n;return function(s){return n=n||_r(e,t,r),new Worker(n,s)}}var Gr=Wr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),wt=Object.getOwnPropertySymbols,zr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable,jr=(e,t)=>{var r={};for(var n in e)zr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wt)for(var n of wt(e))t.indexOf(n)<0&&Vr.call(e,n)&&(r[n]=e[n]);return r},Zr=(e,t,r)=>new Promise((n,o)=>{var s=i=>{try{a(r.next(i))}catch(c){o(c)}},l=i=>{try{a(r.throw(i))}catch(c){o(c)}},a=i=>i.done?n(i.value):Promise.resolve(i.value).then(s,l);a((r=r.apply(e,t)).next())});class Ur{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=kt(r,n),s=new Map,l=new Gr;l.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:u,type:p,width:v,height:C}=d.data;this.mutationCb({id:m,type:le["2D"],commands:[{property:"clearRect",args:[0,0,v,C]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:p}]},0,0]}]})};const a=1e3/t;let i=0,c;const h=d=>{if(i&&d-i<a){c=requestAnimationFrame(h);return}i=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>Zr(this,null,function*(){var u;const p=this.mirror.getId(m);if(s.get(p))return;if(s.set(p,!0),["webgl","webgl2"].includes(m.__context)){const C=m.getContext(m.__context);((u=C?.getContextAttributes())==null?void 0:u.preserveDrawingBuffer)===!1&&C?.clear(C.COLOR_BUFFER_BIT)}if(m.width===0||m.height===0)return;const v=yield createImageBitmap(m);l.postMessage({id:p,bitmap:v,width:m.width,height:m.height},[v])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=kt(t,r),o=Fr(this.processMutation.bind(this),t,r,this.mirror),s=Pr(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>jr(l,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class Yr{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var Hr=Object.defineProperty,Xr=Object.defineProperties,Br=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Tt=(e,t,r)=>t in e?Hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X=(e,t)=>{for(var r in t||(t={}))Kr.call(t,r)&&Tt(e,r,t[r]);if(Mt)for(var r of Mt(t))$r.call(t,r)&&Tt(e,r,t[r]);return e},Jr=(e,t)=>Xr(e,Br(t));function F(e){return Jr(X({},e),{timestamp:Date.now()})}let N,ye;const $=Nt();function ge(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:l="highlight-ignore",maskTextClass:a="highlight-mask",maskTextSelector:i=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:m,maskInputFn:u,maskTextFn:p=Oe,hooks:v,packFn:C,sampling:w={},mousemoveWait:O,recordCanvas:S=!1,userTriggeredOnInput:y=!1,collectFonts:f=!1,inlineImages:j=!1,plugins:P,keepIframeSrcFn:L=()=>!1,enableStrictPrivacy:Y=!1}=e;if(!t)throw new Error("emit function is required");O!==void 0&&w.mousemove===void 0&&(w.mousemove=O),$.reset();const R=h===!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}:d!==void 0?d:{password:!0},A=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};nr();let J,G=0;const te=g=>{for(const b of P||[])b.eventProcessor&&(g=b.eventProcessor(g));return C&&(g=C(g)),g};N=(g,b)=>{var H;if(((H=ne[0])==null?void 0:H.isFrozen())&&g.type!==T.FullSnapshot&&!(g.type===T.IncrementalSnapshot&&g.data.source===W.Mutation)&&ne.forEach(_=>_.unfreeze()),t(te(g),b),g.type===T.FullSnapshot)J=g,G=0;else if(g.type===T.IncrementalSnapshot){if(g.data.source===W.Mutation&&g.data.isAttachIframe)return;G++;const _=n&&G>=n,Q=r&&g.timestamp-J.timestamp>r;(_||Q)&&ye(!0)}};const M=g=>{N(F({type:T.IncrementalSnapshot,data:X({source:W.Mutation},g)}))},B=g=>N(F({type:T.IncrementalSnapshot,data:X({source:W.Scroll},g)})),q=g=>N(F({type:T.IncrementalSnapshot,data:X({source:W.CanvasMutation},g)})),D=new wr({mutationCb:M}),K=new Yr({mutationCb:M}),Z=new Ur({recordCanvas:S,mutationCb:q,win:window,blockClass:o,mirror:$,sampling:w.canvas}),z=new Er({mutationCb:M,scrollCb:B,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskInputOptions:R,maskTextFn:p,maskInputFn:u,recordCanvas:S,inlineImages:j,sampling:w,slimDOMOptions:A,iframeManager:D,stylesheetManager:K,canvasManager:Z,keepIframeSrcFn:L,enableStrictPrivacy:Y},mirror:$});ye=(g=!1)=>{var b,H,_,Q;N(F({type:T.Meta,data:{href:window.location.href,width:Ye(),height:Ue()}}),g),ne.forEach(x=>x.lock());const k=er(document,{mirror:$,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskAllInputs:R,maskTextFn:p,slimDOM:A,recordCanvas:S,inlineImages:j,enableStrictPrivacy:Y,onSerialize:x=>{Be(x,$)&&D.addIframe(x),Ke(x,$)&&K.addStylesheet(x),$e(x)&&z.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,oe)=>{D.attachIframe(x,oe,$),z.observeAttachShadow(x)},onStylesheetLoad:(x,oe)=>{K.attachStylesheet(x,oe,$)},keepIframeSrcFn:L});if(!k)return console.warn("Failed to snapshot the document");N(F({type:T.FullSnapshot,data:{node:k,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((H=(b=document?.body)==null?void 0:b.parentElement)==null?void 0:H.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Q=(_=document?.body)==null?void 0:_.parentElement)==null?void 0:Q.scrollTop)||document?.body.scrollTop||0}}})),ne.forEach(x=>x.unlock())};try{const g=[];g.push(V("DOMContentLoaded",()=>{N(F({type:T.DomContentLoaded,data:{}}))}));const b=_=>{var Q;return Ir({mutationCb:M,mousemoveCb:(k,x)=>N(F({type:T.IncrementalSnapshot,data:{source:x,positions:k}})),mouseInteractionCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.MouseInteraction},k)})),scrollCb:B,viewportResizeCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.ViewportResize},k)})),inputCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.Input},k)})),mediaInteractionCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.MediaInteraction},k)})),styleSheetRuleCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.StyleSheetRule},k)})),styleDeclarationCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.StyleDeclaration},k)})),canvasMutationCb:q,fontCb:k=>N(F({type:T.IncrementalSnapshot,data:X({source:W.Font},k)})),blockClass:o,ignoreClass:l,maskTextClass:a,maskTextSelector:i,maskInputOptions:R,inlineStylesheet:c,sampling:w,recordCanvas:S,inlineImages:j,userTriggeredOnInput:y,collectFonts:f,doc:_,maskInputFn:u,maskTextFn:p,keepIframeSrcFn:L,blockSelector:s,slimDOMOptions:A,mirror:$,iframeManager:D,stylesheetManager:K,shadowDomManager:z,canvasManager:Z,enableStrictPrivacy:Y,plugins:((Q=P?.filter(k=>k.observer))==null?void 0:Q.map(k=>({observer:k.observer,options:k.options,callback:x=>N(F({type:T.Plugin,data:{plugin:k.name,payload:x}}))})))||[]},v)};D.addLoadListener(_=>{g.push(b(_.contentDocument))});const H=()=>{ye(),g.push(b(document))};return document.readyState==="interactive"||document.readyState==="complete"?H():g.push(V("load",()=>{N(F({type:T.Load,data:{}})),H()},window)),()=>{g.forEach(_=>_())}}catch(g){console.warn(g)}}return ge.addCustomEvent=(e,t)=>{!N||N(F({type:T.Custom,data:{tag:e,payload:t}}))},ge.freezePage=()=>{ne.forEach(e=>e.freeze())},ge.takeFullSnapshot=e=>{if(!ye)throw new Error("please take full snapshot after start recording");ye(e)},ge.mirror=$,ge}();
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`;let Ze={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ze=new Proxy(Ze,{get(e,t,n){return t==="map"&&console.error(se),Reflect.get(e,t,n)}}));function me(e,t,n={}){let r=null,o=0;return function(...s){const l=Date.now();!o&&n.leading===!1&&(o=l);const a=t-(l-o),i=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(i,s)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(i,s)},a))}}function ke(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(l){setTimeout(()=>{n.set.call(this,l)},0),s&&s.set&&s.set.call(this,l)}}),()=>ke(e,t,s||{},!0)}function ie(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function Ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ye(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const tn=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function U(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ce(r,t,n))return!0;return!1}function nn(e,t){return t.getId(e)!==-1}function Ee(e,t){return t.getId(e)===pe}function He(e,t){if(de(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?He(e.parentNode,t):!0:!0}function Xe(e){return Boolean(e.changedTouches)}function rn(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Be(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ke(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function $e(e){return Boolean(e?.shadowRoot)}var T=(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))(T||{}),_=(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))(_||{}),Ne=(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))(Ne||{}),le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(le||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),on=(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))(on||{});function Je(e){return"__ln"in e}class an{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Je(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Je(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const Qe=(e,t)=>`${e}@${t}`;class sn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new an,r=a=>{let i=a,c=pe;for(;c===pe;)i=i&&i.nextSibling,c=i&&this.mirror.getId(i);return c},o=a=>{var i,c,h,d,m;const u=a.getRootNode?(i=a.getRootNode())==null?void 0:i.host:null;let p=u;for(;(h=(c=p?.getRootNode)==null?void 0:c.call(p))!=null&&h.host;)p=((m=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:m.host)||null;const y=!this.doc.contains(a)&&(!p||!this.doc.contains(p));if(!a.parentNode||y)return;const C=de(a.parentNode)?this.mirror.getId(u):this.mirror.getId(a.parentNode),w=r(a);if(C===-1||w===-1)return n.addNode(a);const O=ne(a,{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:S=>{Be(S,this.mirror)&&this.iframeManager.addIframe(S),Ke(S,this.mirror)&&this.stylesheetManager.addStylesheet(S),$e(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,document)},onIframeLoad:(S,v)=>{this.iframeManager.attachIframe(S,v,this.mirror),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,v)=>{this.stylesheetManager.attachStylesheet(S,v,this.mirror)}});O&&t.push({parentId:C,nextId:w,node:O})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of Array.from(this.movedSet.values()))qe(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||o(a);for(const a of Array.from(this.addedSet.values()))!tt(this.droppedSet,a)&&!qe(this.removes,a,this.mirror)||tt(this.movedSet,a)?o(a):this.droppedSet.add(a);let s=null;for(;n.length;){let a=null;if(s){const i=this.mirror.getId(s.value.parentNode),c=r(s.value);i!==-1&&c!==-1&&(a=s)}if(!a)for(let i=n.length-1;i>=0;i--){const c=n.get(i);if(c){const h=this.mirror.getId(c.value.parentNode),d=r(c.value);if(h!==-1&&d!==-1){a=c;break}}}if(!a){for(;n.head;)n.removeNode(n.head.value);break}s=a.previous,n.removeNode(a.value),o(a.value)}const l={texts:this.texts.map(a=>{let i=a.value;return this.enableStrictPrivacy&&i&&(i=Oe(i)),{id:this.mirror.getId(a.node),value:i}}).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.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(!Ee(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!U(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:ze(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Te({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),U(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const a of Array.from(n.style)){const i=n.style.getPropertyValue(a),c=n.style.getPropertyPriority(a);(i!==s.style.getPropertyValue(a)||c!==s.style.getPropertyPriority(a))&&(c===""?l[a]=i:l[a]=[i,c])}for(const a of Array.from(s.style))n.style.getPropertyValue(a)===""&&(l[a]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=We(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(U(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=de(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);U(t.target,this.blockClass,!1)||Ee(n,this.mirror)||!nn(n,this.mirror)||(this.addedSet.has(n)?(Re(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||He(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Qe(r,o)]?Re(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:de(t.target)&&he(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Ee(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Qe(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);U(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Re(e,t){e.delete(t),t.childNodes.forEach(n=>Re(e,n))}function qe(e,t,n){return e.length===0?!1:et(e,t,n)}function et(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(s=>s.id===o)?!0:et(e,r,n)}function tt(e,t){return e.size===0?!1:nt(e,t)}function nt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:nt(e,n):!1}var ln=Object.defineProperty,cn=Object.defineProperties,un=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable,ot=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,at=(e,t)=>{for(var n in t||(t={}))dn.call(t,n)&&ot(e,n,t[n]);if(rt)for(var n of rt(t))hn.call(t,n)&&ot(e,n,t[n]);return e},pn=(e,t)=>cn(e,un(t));const re=[],st=typeof CSSGroupingRule<"u",it=typeof CSSMediaRule<"u",lt=typeof CSSSupportsRule<"u",ct=typeof CSSConditionRule<"u";function ye(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 ut(e,t){var n,r;const o=new sn;re.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const l=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");l&&window[l]&&(s=window[l]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function mn({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],a;const i=me(d=>{const m=Date.now()-a;e(l.map(u=>(u.timeOffset-=m,u)),d),l=[],a=null},s),c=me(d=>{const m=ye(d),{clientX:u,clientY:p}=Xe(d)?d.changedTouches[0]:d;a||(a=Date.now()),l.push({x:u,y:p,id:r.getId(m),timeOffset:Date.now()-a}),i(typeof DragEvent<"u"&&d instanceof DragEvent?_.Drag:d instanceof MouseEvent?_.MouseMove:_.TouchMove)},o,{trailing:!1}),h=[V("mousemove",c,n),V("touchmove",c,n),V("drag",c,n)];return()=>{h.forEach(d=>d())}}function fn({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=i=>c=>{const h=ye(c);if(U(h,r,!0)||tn(h))return;const d=Xe(c)?c.changedTouches[0]:c;if(!d)return;const m=n.getId(h),{clientX:u,clientY:p}=d;e({type:Ne[i],id:m,x:u,y:p})};return Object.keys(Ne).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&s[i]!==!1).forEach(i=>{const c=i.toLowerCase(),h=a(i);l.push(V(c,h,t))}),()=>{l.forEach(i=>i())}}function dt({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const s=me(l=>{const a=ye(l);if(!a||U(a,r,!0))return;const i=n.getId(a);if(a===t){const c=t.scrollingElement||t.documentElement;e({id:i,x:c.scrollLeft,y:c.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})},o.scroll||100);return V("scroll",s,t)}function yn({viewportResizeCb:e}){let t=-1,n=-1;const r=me(()=>{const o=Ue(),s=Ye();(t!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),t=o,n=s)},200);return V("resize",r,window)}function ht(e,t){const n=at({},e);return t||delete n.userTriggered,n}const vn=["INPUT","TEXTAREA","SELECT"],pt=new WeakMap;function gn({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:s,maskInputFn:l,sampling:a,userTriggeredOnInput:i}){function c(p){let y=ye(p);const C=p.isTrusted;if(y&&y.tagName==="OPTION"&&(y=y.parentElement),!y||!y.tagName||vn.indexOf(y.tagName)<0||U(y,r,!0))return;const w=y.type;if(y.classList.contains(o))return;let O=y.value,S=!1;w==="radio"||w==="checkbox"?S=y.checked:(s[y.tagName.toLowerCase()]||s[w])&&(O=Te({maskInputOptions:s,tagName:y.tagName,type:w,value:O,maskInputFn:l})),h(y,ht({text:O,isChecked:S,userTriggered:C},i));const v=y.name;w==="radio"&&v&&S&&t.querySelectorAll(`input[type="radio"][name="${v}"]`).forEach(f=>{f!==y&&h(f,ht({text:f.value,isChecked:!S,userTriggered:!1},i))})}function h(p,y){const C=pt.get(p);if(!C||C.text!==y.text||C.isChecked!==y.isChecked){pt.set(p,y);const w=n.getId(p);e(pn(at({},y),{id:w}))}}const d=(a.input==="last"?["change"]:["input","change"]).map(p=>V(p,c,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...u.map(p=>ke(p[0],p[1],{set(){c({target:this})}}))),()=>{d.forEach(p=>p())}}function Ie(e){const t=[];function n(r,o){if(st&&r.parentRule instanceof CSSGroupingRule||it&&r.parentRule instanceof CSSMediaRule||lt&&r.parentRule instanceof CSSSupportsRule||ct&&r.parentRule instanceof CSSConditionRule){const s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else{const s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function bn({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(a,i){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,adds:[{rule:a,index:i}]}),r.apply(this,[a,i])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(a){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,removes:[{index:a}]}),o.apply(this,[a])};const s={};st?s.CSSGroupingRule=n.CSSGroupingRule:(it&&(s.CSSMediaRule=n.CSSMediaRule),ct&&(s.CSSConditionRule=n.CSSConditionRule),lt&&(s.CSSSupportsRule=n.CSSSupportsRule));const l={};return Object.entries(s).forEach(([a,i])=>{l[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(c,h){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:c,index:[...Ie(this),h||0]}]}),l[a].insertRule.apply(this,[c,h])},i.prototype.deleteRule=function(c){const h=t.getId(this.parentStyleSheet.ownerNode);return h!==-1&&e({id:h,removes:[{index:[...Ie(this),c]}]}),l[a].deleteRule.apply(this,[c])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([a,i])=>{i.prototype.insertRule=l[a].insertRule,i.prototype.deleteRule=l[a].deleteRule})}}function Sn({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(s,l,a){var i,c;const h=t.getId((c=(i=this.parentRule)==null?void 0:i.parentStyleSheet)==null?void 0:c.ownerNode);return h!==-1&&e({id:h,set:{property:s,value:l,priority:a},index:Ie(this.parentRule)}),r.apply(this,[s,l,a])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(s){var l,a;const i=t.getId((a=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:a.ownerNode);return i!==-1&&e({id:i,remove:{property:s},index:Ie(this.parentRule)}),o.apply(this,[s])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Cn({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=l=>me(a=>{const i=ye(a);if(!i||U(i,t,!0))return;const{currentTime:c,volume:h,muted:d}=i;e({type:l,id:n.getId(i),currentTime:c,volume:h,muted:d})},r.media||500),s=[V("play",o(fe.Play)),V("pause",o(fe.Pause)),V("seeked",o(fe.Seeked)),V("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(l=>l())}}function kn({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(a,i,c){const h=new s(a,i,c);return o.set(h,{family:a,buffer:typeof i!="string",descriptors:c,fontSource:typeof i=="string"?i:JSON.stringify(Array.from(new Uint8Array(i)))}),h};const l=ie(t.fonts,"add",function(a){return function(i){return setTimeout(()=>{const c=o.get(i);c&&(e(c),o.delete(i))},0),a.apply(this,[i])}});return r.push(()=>{n.FontFace=s}),r.push(l),()=>{r.forEach(a=>a())}}function In(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:l,inputCb:a,mediaInteractionCb:i,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),n(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),r(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),s(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),a(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),i(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),h(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),d(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),m(...u)}}function wn(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};In(e,t);const r=ut(e,e.doc),o=mn(e),s=fn(e),l=dt(e),a=yn(e),i=gn(e),c=Cn(e),h=bn(e,{win:n}),d=Sn(e,{win:n}),m=e.collectFonts?kn(e):()=>{},u=[];for(const p of e.plugins)u.push(p.observer(p.callback,n,p.options));return()=>{re.forEach(p=>p.reset()),r.disconnect(),o(),s(),l(),a(),i(),c(),h(),d(),m(),u.forEach(p=>p())}}class Mn{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Tn=Object.defineProperty,On=Object.defineProperties,xn=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,Ln=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,ft=(e,t,n)=>t in e?Tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yt=(e,t)=>{for(var n in t||(t={}))Ln.call(t,n)&&ft(e,n,t[n]);if(mt)for(var n of mt(t))En.call(t,n)&&ft(e,n,t[n]);return e},vt=(e,t)=>On(e,xn(t));class Nn{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(ie(HTMLElement.prototype,"attachShadow",function(r){return function(o){const s=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(t,n){!he(t)||(ut(vt(yt({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),dt(vt(yt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(ie(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const s=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),s}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rn=typeof Uint8Array>"u"?[]:new Uint8Array(256),we=0;we<ce.length;we++)Rn[ce.charCodeAt(we)]=we;var Dn=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=ce[t[n]>>2],o+=ce[(t[n]&3)<<4|t[n+1]>>4],o+=ce[(t[n+1]&15)<<2|t[n+2]>>6],o+=ce[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const gt=new Map;function Fn(e,t){let n=gt.get(e);return n||(n=new Map,gt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const bt=(e,t,n)=>{if(!e||!(Ct(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=Fn(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Me(e,t,n){if(e instanceof Array)return e.map(r=>Me(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=Dn(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Me(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Me(e.data,t,n),e.width,e.height]};if(Ct(e,t)||typeof e=="object"){const r=e.constructor.name,o=bt(e,t,n);return{rr_type:r,index:o}}}}return e}const St=(e,t,n)=>[...e].map(r=>Me(r,t,n)),Ct=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function Pn(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of s)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const a=ie(t.CanvasRenderingContext2D.prototype,l,function(i){return function(...c){return U(this.canvas,n,!0)||setTimeout(()=>{const h=St([...c],t,this);e(this.canvas,{type:le["2D"],property:l,args:h})},0),i.apply(this,c)}});o.push(a)}catch{const i=ke(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:le["2D"],property:l,args:[c],setter:!0})}});o.push(i)}return()=>{o.forEach(l=>l())}}function kt(e,t){const n=[];try{const r=ie(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...l){return U(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...l])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function It(e,t,n,r,o,s){const l=[],a=Object.getOwnPropertyNames(e);for(const i of a)try{if(typeof e[i]!="function")continue;const c=ie(e,i,function(h){return function(...d){const m=h.apply(this,d);if(bt(m,s,e),!U(this.canvas,r,!0)){const u=St([...d],s,e),p={type:t,property:i,args:u};n(this.canvas,p)}return m}});l.push(c)}catch{const h=ke(e,i,{set(d){n(this.canvas,{type:t,property:i,args:[d],setter:!0})}});l.push(h)}return l}function An(e,t,n,r){const o=[];return o.push(...It(t.WebGLRenderingContext.prototype,le.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...It(t.WebGL2RenderingContext.prototype,le.WebGL2,e,n,r,t)),()=>{o.forEach(s=>s())}}function _n(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function Wn(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,s=_n(e,o),l=s.indexOf(`
|
|
4
|
+
`,10)+1,a=s.substring(l)+(r?"//# sourceMappingURL="+r:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}function Gn(e,t,n){var r;return function(s){return r=r||Wn(e,t,n),new Worker(r,s)}}var zn=Gn("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),wt=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,Zn=(e,t)=>{var n={};for(var r in e)Vn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wt)for(var r of wt(e))t.indexOf(r)<0&&jn.call(e,r)&&(n[r]=e[r]);return n},Un=(e,t,n)=>new Promise((r,o)=>{var s=i=>{try{a(n.next(i))}catch(c){o(c)}},l=i=>{try{a(n.throw(i))}catch(c){o(c)}},a=i=>i.done?r(i.value):Promise.resolve(i.value).then(s,l);a((n=n.apply(e,t)).next())});class Yn{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(a)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r){const o=kt(n,r),s=new Map,l=new zn;l.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:u,type:p,width:y,height:C}=d.data;this.mutationCb({id:m,type:le["2D"],commands:[{property:"clearRect",args:[0,0,y,C]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:p}]},0,0]}]})};const a=1e3/t;let i=0,c;const h=d=>{if(i&&d-i<a){c=requestAnimationFrame(h);return}i=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(m=>Un(this,null,function*(){var u;const p=this.mirror.getId(m);if(s.get(p))return;if(s.set(p,!0),["webgl","webgl2"].includes(m.__context)){const C=m.getContext(m.__context);((u=C?.getContextAttributes())==null?void 0:u.preserveDrawingBuffer)===!1&&C?.clear(C.COLOR_BUFFER_BIT)}if(m.width===0||m.height===0)return;const y=yield createImageBitmap(m);l.postMessage({id:p,bitmap:y,width:m.width,height:m.height},[y])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=kt(t,n),o=Pn(this.processMutation.bind(this),t,n,this.mirror),s=An(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(l=>Zn(l,["type"])),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class Hn{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var Xn=Object.defineProperty,Bn=Object.defineProperties,Kn=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertySymbols,$n=Object.prototype.hasOwnProperty,Jn=Object.prototype.propertyIsEnumerable,Tt=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X=(e,t)=>{for(var n in t||(t={}))$n.call(t,n)&&Tt(e,n,t[n]);if(Mt)for(var n of Mt(t))Jn.call(t,n)&&Tt(e,n,t[n]);return e},Qn=(e,t)=>Bn(e,Kn(t));function D(e){return Qn(X({},e),{timestamp:Date.now()})}let N,ve;const $=Nt();function ge(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:l="highlight-ignore",maskTextClass:a="highlight-mask",maskTextSelector:i=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:m,maskInputFn:u,maskTextFn:p=Oe,hooks:y,packFn:C,sampling:w={},mousemoveWait:O,recordCanvas:S=!1,userTriggeredOnInput:v=!1,collectFonts:f=!1,inlineImages:j=!1,plugins:F,keepIframeSrcFn:L=()=>!1,enableStrictPrivacy:Y=!1}=e;if(!t)throw new Error("emit function is required");O!==void 0&&w.mousemove===void 0&&(w.mousemove=O),$.reset();const R=h===!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}:d!==void 0?d:{password:!0},P=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};rn();let J,W=0;const te=g=>{for(const b of F||[])b.eventProcessor&&(g=b.eventProcessor(g));return C&&(g=C(g)),g};N=(g,b)=>{var H;if(((H=re[0])==null?void 0:H.isFrozen())&&g.type!==T.FullSnapshot&&!(g.type===T.IncrementalSnapshot&&g.data.source===_.Mutation)&&re.forEach(z=>z.unfreeze()),t(te(g),b),g.type===T.FullSnapshot)J=g,W=0;else if(g.type===T.IncrementalSnapshot){if(g.data.source===_.Mutation&&g.data.isAttachIframe)return;W++;const z=r&&W>=r,Q=n&&g.timestamp-J.timestamp>n;(z||Q)&&ve(!0)}};const M=g=>{N(D({type:T.IncrementalSnapshot,data:X({source:_.Mutation},g)}))},B=g=>N(D({type:T.IncrementalSnapshot,data:X({source:_.Scroll},g)})),q=g=>N(D({type:T.IncrementalSnapshot,data:X({source:_.CanvasMutation},g)})),A=new Mn({mutationCb:M}),K=new Hn({mutationCb:M}),Z=new Yn({recordCanvas:S,mutationCb:q,win:window,blockClass:o,mirror:$,sampling:w.canvas}),G=new Nn({mutationCb:M,scrollCb:B,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskInputOptions:R,maskTextFn:p,maskInputFn:u,recordCanvas:S,inlineImages:j,sampling:w,slimDOMOptions:P,iframeManager:A,stylesheetManager:K,canvasManager:Z,keepIframeSrcFn:L,enableStrictPrivacy:Y},mirror:$});ve=(g=!1)=>{var b,H,z,Q;N(D({type:T.Meta,data:{href:window.location.href,width:Ye(),height:Ue()}}),g),re.forEach(x=>x.lock());const k=en(document,{mirror:$,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:i,inlineStylesheet:c,maskAllInputs:R,maskTextFn:p,slimDOM:P,recordCanvas:S,inlineImages:j,enableStrictPrivacy:Y,onSerialize:x=>{Be(x,$)&&A.addIframe(x),Ke(x,$)&&K.addStylesheet(x),$e(x)&&G.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,oe)=>{A.attachIframe(x,oe,$),G.observeAttachShadow(x)},onStylesheetLoad:(x,oe)=>{K.attachStylesheet(x,oe,$)},keepIframeSrcFn:L});if(!k)return console.warn("Failed to snapshot the document");N(D({type:T.FullSnapshot,data:{node:k,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((H=(b=document?.body)==null?void 0:b.parentElement)==null?void 0:H.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((Q=(z=document?.body)==null?void 0:z.parentElement)==null?void 0:Q.scrollTop)||document?.body.scrollTop||0}}})),re.forEach(x=>x.unlock())};try{const g=[];g.push(V("DOMContentLoaded",()=>{N(D({type:T.DomContentLoaded,data:{}}))}));const b=z=>{var Q;return wn({mutationCb:M,mousemoveCb:(k,x)=>N(D({type:T.IncrementalSnapshot,data:{source:x,positions:k}})),mouseInteractionCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.MouseInteraction},k)})),scrollCb:B,viewportResizeCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.ViewportResize},k)})),inputCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.Input},k)})),mediaInteractionCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.MediaInteraction},k)})),styleSheetRuleCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.StyleSheetRule},k)})),styleDeclarationCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.StyleDeclaration},k)})),canvasMutationCb:q,fontCb:k=>N(D({type:T.IncrementalSnapshot,data:X({source:_.Font},k)})),blockClass:o,ignoreClass:l,maskTextClass:a,maskTextSelector:i,maskInputOptions:R,inlineStylesheet:c,sampling:w,recordCanvas:S,inlineImages:j,userTriggeredOnInput:v,collectFonts:f,doc:z,maskInputFn:u,maskTextFn:p,keepIframeSrcFn:L,blockSelector:s,slimDOMOptions:P,mirror:$,iframeManager:A,stylesheetManager:K,shadowDomManager:G,canvasManager:Z,enableStrictPrivacy:Y,plugins:((Q=F?.filter(k=>k.observer))==null?void 0:Q.map(k=>({observer:k.observer,options:k.options,callback:x=>N(D({type:T.Plugin,data:{plugin:k.name,payload:x}}))})))||[]},y)};A.addLoadListener(z=>{g.push(b(z.contentDocument))});const H=()=>{ve(),g.push(b(document))};return document.readyState==="interactive"||document.readyState==="complete"?H():g.push(V("load",()=>{N(D({type:T.Load,data:{}})),H()},window)),()=>{g.forEach(z=>z())}}catch(g){console.warn(g)}}return ge.addCustomEvent=(e,t)=>{!N||N(D({type:T.Custom,data:{tag:e,payload:t}}))},ge.freezePage=()=>{re.forEach(e=>e.freeze())},ge.takeFullSnapshot=e=>{if(!ve)throw new Error("please take full snapshot after start recording");ve(e)},ge.mirror=$,ge}();
|
|
5
5
|
//# sourceMappingURL=rrweb-record.min.js.map
|