@highlight-run/rrweb 2.0.8 → 2.0.11

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