@highlight-run/rrweb 2.0.1 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/console-record.js +12 -655
- package/dist/plugins/console-record.min.js +12 -15
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +4 -293
- package/dist/plugins/console-replay.min.js +4 -15
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/plugins/sequential-id-record.js +1 -33
- package/dist/plugins/sequential-id-record.min.js +1 -1
- package/dist/plugins/sequential-id-record.min.js.map +1 -1
- package/dist/plugins/sequential-id-replay.js +1 -37
- package/dist/plugins/sequential-id-replay.min.js +1 -1
- package/dist/plugins/sequential-id-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.js +3 -747
- package/dist/record/rrweb-record-pack.min.js +3 -15
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +4 -3318
- package/dist/record/rrweb-record.min.js +4 -15
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.css +1 -0
- package/dist/replay/rrweb-replay-unpack.js +5 -4614
- package/dist/replay/rrweb-replay-unpack.min.js +5 -17
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.css +1 -0
- package/dist/replay/rrweb-replay.js +5 -4204
- package/dist/replay/rrweb-replay.min.js +5 -17
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +1 -0
- package/dist/rrweb-all.js +16 -8696
- package/dist/rrweb-all.min.js +16 -17
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +1 -0
- package/dist/rrweb.js +6 -7282
- package/dist/rrweb.min.js +6 -17
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
- package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +6 -0
- package/es/rrweb/all.css +1 -0
- package/es/rrweb/ext/mitt/dist/mitt.es.js +1 -1
- package/es/rrweb/ext/tslib/tslib.es6.js +38 -0
- package/es/rrweb/packages/rrdom/es/virtual-dom.js +1099 -0
- package/es/rrweb/packages/rrweb/src/index.js +6 -4
- package/es/rrweb/packages/rrweb/src/packer/base.js +1 -1
- package/es/rrweb/packages/rrweb/src/packer/pack.js +4 -5
- package/es/rrweb/packages/rrweb/src/packer/unpack.js +24 -24
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +175 -176
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +109 -128
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +125 -138
- package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +88 -105
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +19 -20
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +25 -25
- package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +29 -30
- package/es/rrweb/packages/rrweb/src/record/index.js +348 -373
- package/es/rrweb/packages/rrweb/src/record/mutation.js +487 -528
- package/es/rrweb/packages/rrweb/src/record/observer.js +584 -659
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +44 -73
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +166 -87
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +21 -26
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +119 -112
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +53 -72
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +38 -40
- package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +31 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +27 -23
- package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +67 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +37 -29
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +58 -120
- package/es/rrweb/packages/rrweb/src/replay/index.js +1545 -1854
- package/es/rrweb/packages/rrweb/src/replay/machine.js +275 -315
- package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +216 -218
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +7 -7
- package/es/rrweb/packages/rrweb/src/replay/timer.js +87 -91
- package/es/rrweb/packages/rrweb/src/types.js +72 -72
- package/es/rrweb/packages/rrweb/src/utils.js +312 -506
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +190 -72
- package/lib/plugins/console-record.js +469 -627
- package/lib/plugins/console-replay.js +198 -268
- package/lib/plugins/sequential-id-record.js +19 -20
- package/lib/plugins/sequential-id-replay.js +25 -25
- package/lib/record/rrweb-record-pack.js +184 -139
- package/lib/record/rrweb-record.js +2467 -2425
- package/lib/replay/rrweb-replay-unpack.css +1 -0
- package/lib/replay/rrweb-replay-unpack.js +3798 -3344
- package/lib/replay/rrweb-replay.css +1 -0
- package/lib/replay/rrweb-replay.js +3743 -3289
- package/lib/rrweb-all.css +1 -0
- package/lib/rrweb-all.js +6721 -6249
- package/lib/rrweb.css +1 -0
- package/lib/rrweb.js +6151 -5632
- package/package.json +14 -13
- package/typings/packer/base.d.ts +1 -1
- package/typings/plugins/console/record/index.d.ts +1 -1
- package/typings/plugins/console/record/stringify.d.ts +1 -1
- package/typings/plugins/sequential-id/record/index.d.ts +1 -1
- package/typings/plugins/sequential-id/replay/index.d.ts +1 -1
- package/typings/record/iframe-manager.d.ts +3 -3
- package/typings/record/index.d.ts +1 -1
- package/typings/record/mutation.d.ts +2 -1
- package/typings/record/observers/canvas/2d.d.ts +2 -1
- package/typings/record/observers/canvas/canvas-manager.d.ts +5 -2
- package/typings/record/observers/canvas/canvas.d.ts +1 -1
- package/typings/record/observers/canvas/serialize-args.d.ts +5 -5
- package/typings/record/observers/canvas/webgl.d.ts +2 -1
- package/typings/record/shadow-dom-manager.d.ts +2 -1
- package/typings/record/stylesheet-manager.d.ts +12 -0
- package/typings/record/workers/image-bitmap-data-url-worker.d.ts +5 -0
- package/typings/replay/canvas/2d.d.ts +3 -3
- package/typings/replay/canvas/deserialize-args.d.ts +7 -0
- package/typings/replay/canvas/index.d.ts +4 -3
- package/typings/replay/canvas/webgl.d.ts +3 -5
- package/typings/replay/index.d.ts +7 -10
- package/typings/types.d.ts +45 -17
- package/typings/utils.d.ts +17 -44
- package/es/rrweb/packages/rrweb/ext/tslib/tslib.es6.js +0 -78
- package/es/rrweb/packages/rrweb/src/replay/virtual-styles.js +0 -121
- package/typings/replay/virtual-styles.d.ts +0 -43
package/dist/rrweb.min.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
var rrweb=function(e){"use strict";
|
|
2
|
-
/*! *****************************************************************************
|
|
1
|
+
var rrweb=function(q){"use strict";var k;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(k||(k={}));function Nt(e){return e.nodeType===e.ELEMENT_NODE}function ke(e){var t,r=(t=e)===null||t===void 0?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}var Ke=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function wt(){return new Ke}function Qe(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(s?a=s(a):a="*".repeat(a.length)),a}var Et="__rrweb_original__";function Gr(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var s=t.getImageData,a=Et in s?s[Et]:s,c=new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(l){return l!==0}))return!1}return!0}function Ct(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Br=1,zr=new RegExp("[^a-z0-9-_:]"),Re=-2;function Hr(){return Br++}function Yr(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return zr.test(t)?"div":t}function Je(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Xr).join(""):null}catch{return null}}function Xr(e){var t=e.cssText;if(Zr(e))try{t=Je(e.styleSheet)||t}catch{}return t}function Zr(e){return"styleSheet"in e}function Kr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Qr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var be,It,Jr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,en=/^(data:)([^,]*),(.*)/i;function $e(e,t){return(e||"").replace(Jr,function(r,n,o,s,a,c){var l=o||a||c,i=n||s||"";if(!l)return r;if(!qr.test(l)||en.test(l))return"url("+i+l+i+")";if(l[0]==="/")return"url("+i+(Qr(t)+l)+i+")";var u=t.split("/"),d=l.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var g=h[m];g!=="."&&(g===".."?u.pop():u.push(g))}return"url("+i+u.join("/")+i+")"})}var tn=/^[^ \t\n\r\u000c]+/,rn=/^[, \t\n\r\u000c]+/;function nn(e,t){if(t.trim()==="")return t;var r=0;function n(i){var u,d=i.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(rn),!(r>=t.length);){var s=n(tn);if(s.slice(-1)===",")s=Ve(e,s.substring(0,s.length-1)),o.push(s);else{var a="";s=Ve(e,s);for(var c=!1;;){var l=t.charAt(r);if(l===""){o.push((s+a).trim());break}else if(c)l===")"&&(c=!1);else if(l===","){r+=1,o.push((s+a).trim());break}else l==="("&&(c=!0);a+=l,r+=1}}}return o.join(", ")}function Ve(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function on(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function qe(){var e=document.createElement("a");return e.href="",e.href}function Mt(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?Ve(e,n):r==="srcset"&&n?nn(e,n):r==="style"&&n?$e(n,qe()):t==="object"&&r==="data"&&n?Ve(e,n):n}function sn(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function Ue(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r&&e.matches(r)?!0:Ue(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,Ue(e.parentNode,t,r)}function an(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function cn(e){return e.getAttribute("href")?e.sheet!==null:!0}function ln(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function un(e,t){var r,n=t.doc,o=t.mirror,s=t.blockClass,a=t.blockSelector,c=t.maskTextClass,l=t.maskTextSelector,i=t.inlineStylesheet,u=t.maskInputOptions,d=u===void 0?{}:u,m=t.maskTextFn,h=t.maskInputFn,g=t.dataURLOptions,f=g===void 0?{}:g,S=t.inlineImages,p=t.recordCanvas,b=t.keepIframeSrcFn,T=t.enableStrictPrivacy,I;if(o.getMeta(n)){var F=o.getId(n);I=F===1?void 0:F}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:k.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:k.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:k.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:for(var O=sn(e,s,a),C=Yr(e),E={},H=e.attributes.length,X=0;X<H;X++){var Z=e.attributes[X];E[Z.name]=Mt(n,C,Z.name,Z.value)}if(C==="link"&&i){var J=Array.from(n.styleSheets).find(function(me){return me.href===e.href}),B=null;J&&(B=Je(J)),B&&(delete E.rel,delete E.href,E._cssText=$e(B,J.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var B=Je(e.sheet);B&&(E._cssText=$e(B,qe()))}if(C==="input"||C==="textarea"||C==="select"){var ne=e.value;E.type!=="radio"&&E.type!=="checkbox"&&E.type!=="submit"&&E.type!=="button"&&ne?E.value=Qe({type:E.type,tagName:C,value:ne,maskInputOptions:d,maskInputFn:h}):e.checked&&(E.checked=e.checked)}if(C==="option"&&(e.selected&&!d.select?E.selected=!0:delete E.selected),C==="canvas"&&p){if(e.__context==="2d")Gr(e)||(E.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var K=e.toDataURL(f.type,f.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height;var W=G.toDataURL(f.type,f.quality);K!==W&&(E.rr_dataURL=K)}}if(C==="img"&&S){be||(be=n.createElement("canvas"),It=be.getContext("2d"));var A=e,v=A.crossOrigin;A.crossOrigin="anonymous";var y=function(){try{be.width=A.naturalWidth,be.height=A.naturalHeight,It.drawImage(A,0,0),E.rr_dataURL=be.toDataURL(f.type,f.quality)}catch(me){console.warn("Cannot inline img src="+A.currentSrc+"! Error: "+me)}v?E.crossOrigin=v:A.removeAttribute("crossorigin")};A.complete&&A.naturalWidth!==0?y():A.onload=y}if((C==="audio"||C==="video")&&(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop),O||C==="img"&&T){var N=e.getBoundingClientRect(),w=N.width,$=N.height;E={class:E.class,rr_width:w+"px",rr_height:$+"px"},O=!0}return C==="iframe"&&!b(E.src)&&(e.contentDocument||(E.rr_src=E.src),delete E.src),{type:k.Element,tagName:C,attributes:E,childNodes:[],isSVG:on(e)||void 0,needBlock:O,rootId:I};case e.TEXT_NODE:var j=e.parentNode&&e.parentNode.tagName,L=e.textContent,re=j==="STYLE"?!0:void 0,_=j==="SCRIPT"?!0:void 0,P=!1;if(re&&L){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(L=Kr(e.parentNode.sheet))}catch(me){console.warn("Cannot get CSS styles from text's parentNode. Error: "+me,e)}L=$e(L,qe()),P=!0}if(_?(L="SCRIPT_PLACEHOLDER",P=!0):j==="NOSCRIPT"&&(L="",P=!0),!re&&!_&&Ue(e,c,l)&&L&&(L=m?m(L):L.replace(/[\S]/g,"*")),T&&!P&&j){var ue=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!ue.has(j)&&L&&(L=Ct(L))}return{type:k.Text,textContent:L||"",isStyle:re,rootId:I};case e.CDATA_SECTION_NODE:return{type:k.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:k.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function V(e){return e===void 0?"":e.toLowerCase()}function dn(e,t){return!!(t.comment&&e.type===k.Comment||e.type===k.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(V(e.attributes.name).match(/^msapplication-tile(image|color)$/)||V(e.attributes.name)==="application-name"||V(e.attributes.rel)==="icon"||V(e.attributes.rel)==="apple-touch-icon"||V(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&V(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(V(e.attributes.property).match(/^(og|twitter|fb):/)||V(e.attributes.name).match(/^(og|twitter):/)||V(e.attributes.name)==="pinterest")||t.headMetaRobots&&(V(e.attributes.name)==="robots"||V(e.attributes.name)==="googlebot"||V(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(V(e.attributes.name)==="author"||V(e.attributes.name)==="generator"||V(e.attributes.name)==="framework"||V(e.attributes.name)==="publisher"||V(e.attributes.name)==="progid"||V(e.attributes.property).match(/^article:/)||V(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(V(e.attributes.name)==="google-site-verification"||V(e.attributes.name)==="yandex-verification"||V(e.attributes.name)==="csrf-token"||V(e.attributes.name)==="p:domain_verify"||V(e.attributes.name)==="verify-v1"||V(e.attributes.name)==="verification"||V(e.attributes.name)==="shopify-checkout-api-token"))))}function Se(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,c=t.maskTextSelector,l=t.skipChild,i=l===void 0?!1:l,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,g=t.maskTextFn,f=t.maskInputFn,S=t.slimDOMOptions,p=t.dataURLOptions,b=p===void 0?{}:p,T=t.inlineImages,I=T===void 0?!1:T,F=t.recordCanvas,O=F===void 0?!1:F,C=t.onSerialize,E=t.onIframeLoad,H=t.iframeLoadTimeout,X=H===void 0?5e3:H,Z=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,B=J===void 0?5e3:J,ne=t.keepIframeSrcFn,K=ne===void 0?function(){return!1}:ne,G=t.enableStrictPrivacy,W=t.preserveWhiteSpace,A=W===void 0?!0:W,v=un(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,dataURLOptions:b,inlineImages:I,recordCanvas:O,keepIframeSrcFn:K,enableStrictPrivacy:G});if(!v)return console.warn(e,"not serialized"),null;var y;if(n.hasNode(e)?y=n.getId(e):dn(v,S)||!A&&v.type===k.Text&&!v.isStyle&&!v.textContent.replace(/^\s+|\s+$/gm,"").length?y=Re:y=Hr(),y===Re)return null;var N=Object.assign(v,{id:y});n.add(e,N),C&&C(e);var w=!i;if(N.type===k.Element){if(w=w&&!N.needBlock,N.needBlock&&N.tagName==="img"){var $=e.cloneNode();$.src="",n.add($,N)}delete N.needBlock,e.shadowRoot&&(N.isShadowHost=!0)}if((N.type===k.Document||N.type===k.Element)&&w){S.headWhitespace&&N.type===k.Element&&N.tagName==="head"&&(A=!1);for(var j={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:O,preserveWhiteSpace:A,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:X,onStylesheetLoad:Z,stylesheetLoadTimeout:B,keepIframeSrcFn:K,enableStrictPrivacy:G},L=0,re=Array.from(e.childNodes);L<re.length;L++){var _=re[L],P=Se(_,j);P&&N.childNodes.push(P)}if(Nt(e)&&e.shadowRoot)for(var ue=0,me=Array.from(e.shadowRoot.childNodes);ue<me.length;ue++){var _=me[ue],P=Se(_,j);P&&(P.isShadow=!0,N.childNodes.push(P))}}return e.parentNode&&ke(e.parentNode)&&(N.isShadow=!0),N.type===k.Element&&N.tagName==="iframe"&&an(e,function(){var De=e.contentDocument;if(De&&E){var Ur=Se(De,{doc:De,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:O,preserveWhiteSpace:A,onSerialize:C,onIframeLoad:E,iframeLoadTimeout:X,keepIframeSrcFn:K,enableStrictPrivacy:G});Ur&&E(e,Ur)}},X),N.type===k.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&(ln(e,function(){if(Z){var De=Se(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:O,preserveWhiteSpace:A,onSerialize:C,onIframeLoad:E,onStylesheetLoad:Z,iframeLoadTimeout:X,keepIframeSrcFn:K,enableStrictPrivacy:G});De&&Z(e,De)}},B),cn(e)===!1)?null:N}function hn(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Ke:n,s=r.blockClass,a=s===void 0?"highlight-block":s,c=r.blockSelector,l=c===void 0?null:c,i=r.maskTextClass,u=i===void 0?"highlight-mask":i,d=r.maskTextSelector,m=d===void 0?null:d,h=r.inlineStylesheet,g=h===void 0?!0:h,f=r.inlineImages,S=f===void 0?!1:f,p=r.recordCanvas,b=p===void 0?!1:p,T=r.maskAllInputs,I=T===void 0?!1:T,F=r.maskTextFn,O=r.maskInputFn,C=r.slimDOM,E=C===void 0?!1:C,H=r.dataURLOptions,X=r.preserveWhiteSpace,Z=r.onSerialize,J=r.onIframeLoad,B=r.iframeLoadTimeout,ne=r.onStylesheetLoad,K=r.stylesheetLoadTimeout,G=r.keepIframeSrcFn,W=G===void 0?function(){return!1}:G,A=r.enableStrictPrivacy,v=A===void 0?!1:A,y=I===!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}:I===!1?{password:!0}:I,N=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 Se(e,{doc:e,mirror:o,blockClass:a,blockSelector:l,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:g,maskInputOptions:y,maskTextFn:F,maskInputFn:O,slimDOMOptions:N,dataURLOptions:H,inlineImages:S,recordCanvas:b,preserveWhiteSpace:X,onSerialize:Z,onIframeLoad:J,iframeLoadTimeout:B,onStylesheetLoad:ne,stylesheetLoadTimeout:K,keepIframeSrcFn:W,enableStrictPrivacy:v})}var xt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function mn(e,t){t===void 0&&(t={});var r=1,n=1;function o(v){var y=v.match(/\n/g);y&&(r+=y.length);var N=v.lastIndexOf(`
|
|
2
|
+
`);n=N===-1?n+v.length:v.length-N}function s(){var v={line:r,column:n};return function(y){return y.position=new a(v),g(),y}}var a=function(){function v(y){this.start=y,this.end={line:r,column:n},this.source=t.source}return v}();a.prototype.content=e;var c=[];function l(v){var y=new Error(t.source+":"+r+":"+n+": "+v);if(y.reason=v,y.filename=t.source,y.line=r,y.column=n,y.source=e,t.silent)c.push(y);else throw y}function i(){var v=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:v,parsingErrors:c}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var v,y=[];for(g(),f(y);e.length&&e.charAt(0)!=="}"&&(v=W()||A());)v!==!1&&(y.push(v),f(y));return y}function h(v){var y=v.exec(e);if(y){var N=y[0];return o(N),e=e.slice(N.length),y}}function g(){h(/^\s*/)}function f(v){v===void 0&&(v=[]);for(var y;y=S();)y!==!1&&v.push(y),y=S();return v}function S(){var v=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var y=2;e.charAt(y)!==""&&(e.charAt(y)!=="*"||e.charAt(y+1)!=="/");)++y;if(y+=2,e.charAt(y-1)==="")return l("End of comment missing");var N=e.slice(2,y-2);return n+=2,o(N),e=e.slice(y),n+=2,v({type:"comment",comment:N})}}function p(){var v=h(/^([^{]+)/);if(v)return ce(v[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(y){return y.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(y){return y.replace(/\u200C/g,",")})}function b(){var v=s(),y=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(y){var N=ce(y[0]);if(!h(/^:\s*/))return l("property missing ':'");var w=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),$=v({type:"declaration",property:N.replace(xt,""),value:w?ce(w[0]).replace(xt,""):""});return h(/^[;\s]*/),$}}function T(){var v=[];if(!u())return l("missing '{'");f(v);for(var y;y=b();)y!==!1&&(v.push(y),f(v)),y=b();return d()?v:l("missing '}'")}function I(){for(var v,y=[],N=s();v=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)y.push(v[1]),h(/^,\s*/);if(y.length)return N({type:"keyframe",values:y,declarations:T()})}function F(){var v=s(),y=h(/^@([-\w]+)?keyframes\s*/);if(y){var N=y[1];if(y=h(/^([-\w]+)\s*/),!y)return l("@keyframes missing name");var w=y[1];if(!u())return l("@keyframes missing '{'");for(var $,j=f();$=I();)j.push($),j=j.concat(f());return d()?v({type:"keyframes",name:w,vendor:N,keyframes:j}):l("@keyframes missing '}'")}}function O(){var v=s(),y=h(/^@supports *([^{]+)/);if(y){var N=ce(y[1]);if(!u())return l("@supports missing '{'");var w=f().concat(m());return d()?v({type:"supports",supports:N,rules:w}):l("@supports missing '}'")}}function C(){var v=s(),y=h(/^@host\s*/);if(y){if(!u())return l("@host missing '{'");var N=f().concat(m());return d()?v({type:"host",rules:N}):l("@host missing '}'")}}function E(){var v=s(),y=h(/^@media *([^{]+)/);if(y){var N=ce(y[1]);if(!u())return l("@media missing '{'");var w=f().concat(m());return d()?v({type:"media",media:N,rules:w}):l("@media missing '}'")}}function H(){var v=s(),y=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(y)return v({type:"custom-media",name:ce(y[1]),media:ce(y[2])})}function X(){var v=s(),y=h(/^@page */);if(y){var N=p()||[];if(!u())return l("@page missing '{'");for(var w=f(),$;$=b();)w.push($),w=w.concat(f());return d()?v({type:"page",selectors:N,declarations:w}):l("@page missing '}'")}}function Z(){var v=s(),y=h(/^@([-\w]+)?document *([^{]+)/);if(y){var N=ce(y[1]),w=ce(y[2]);if(!u())return l("@document missing '{'");var $=f().concat(m());return d()?v({type:"document",document:w,vendor:N,rules:$}):l("@document missing '}'")}}function J(){var v=s(),y=h(/^@font-face\s*/);if(y){if(!u())return l("@font-face missing '{'");for(var N=f(),w;w=b();)N.push(w),N=N.concat(f());return d()?v({type:"font-face",declarations:N}):l("@font-face missing '}'")}}var B=G("import"),ne=G("charset"),K=G("namespace");function G(v){var y=new RegExp("^@"+v+"\\s*([^;]+);");return function(){var N=s(),w=h(y);if(w){var $={type:v};return $[v]=w[1].trim(),N($)}}}function W(){if(e[0]==="@")return F()||E()||H()||O()||B()||ne()||K()||Z()||X()||C()||J()}function A(){var v=s(),y=p();return y?(f(),v({type:"rule",selectors:y,declarations:T()})):l("selector missing")}return et(i())}function ce(e){return e?e.replace(/^\s+|\s+$/g,""):""}function et(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],c=e[a];Array.isArray(c)?c.forEach(function(l){et(l,n)}):c&&typeof c=="object"&&et(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Dt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function pn(e){var t=Dt[e.tagName]?Dt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var kt=/([^\\]):hover/,gn=new RegExp(kt.source,"g");function Rt(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=mn(e,{silent:!0});if(!o.stylesheet)return e;var s=[];if(o.stylesheet.rules.forEach(function(l){"selectors"in l&&(l.selectors||[]).forEach(function(i){kt.test(i)&&s.push(i)})}),s.length===0)return e;var a=new RegExp(s.filter(function(l,i){return s.indexOf(l)===i}).sort(function(l,i){return i.length-l.length}).map(function(l){return fn(l)}).join("|"),"g"),c=e.replace(a,function(l){var i=l.replace(gn,"$1.\\:hover");return l+", "+i});return t?.stylesWithHoverClass.set(e,c),c}function Ot(){var e=new Map;return{stylesWithHoverClass:e}}function yn(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case k.Document:return r.implementation.createDocument(null,"",null);case k.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case k.Element:var s=pn(e),a;e.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",s):a=r.createElement(s);var c=function(i){if(!e.attributes.hasOwnProperty(i))return"continue";var u=e.attributes[i];if(s==="option"&&i==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,i.startsWith("rr_")){if(s==="canvas"&&i==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var C=a.getContext("2d");C&&C.drawImage(d,0,0,d.width,d.height)}}else if(s==="img"&&i==="rr_dataURL"){var m=a;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(i==="rr_width")a.style.width=u;else if(i==="rr_height")a.style.height=u;else if(i==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(i==="rr_mediaState")switch(u){case"played":a.play().catch(function(C){return console.warn("media playback error",C)});break;case"paused":a.pause();break}}else{var h=s==="textarea"&&i==="value",g=s==="style"&&i==="_cssText";if(g&&n&&(u=Rt(u,o),typeof u=="string")){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,p=[],b="https://replay-cors-proxy.highlightrun.workers.dev";(S=f.exec(u))!==null;)S.index===f.lastIndex&&f.lastIndex++,S.forEach(function(C,E){if(E===0){var H=C.slice(5,C.length-2);p.push({originalUrl:H,proxyUrl:H.replace(H,b+"?url="+H)})}});p.forEach(function(C){u=u.replace(C.originalUrl,C.proxyUrl)})}if(h||g){for(var T=r.createTextNode(u),I=0,F=Array.from(a.childNodes);I<F.length;I++){var O=F[I];O.nodeType===a.TEXT_NODE&&a.removeChild(O)}return a.appendChild(T),"continue"}try{if(e.isSVG&&i==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",i,u);else if(i==="onload"||i==="onclick"||i.substring(0,7)==="onmouse")a.setAttribute("_"+i,u);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&i==="content")return a.setAttribute("csp-content",u),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(i,u))}}catch{}}};for(var l in e.attributes)c(l);if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case k.Text:return r.createTextNode(e.isStyle&&n?Rt(e.textContent,o):e.textContent);case k.CDATA:return r.createCDATASection(e.textContent);case k.Comment:return r.createComment(e.textContent);default:return null}}function je(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,s=o===void 0?!1:o,a=t.hackCss,c=a===void 0?!0:a,l=t.afterAppend,i=t.cache,u=yn(e,{doc:r,hackCss:c,cache:i});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===k.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==k.DocumentType&&(e.childNodes[0].type===k.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===k.Document||e.type===k.Element)&&!s)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],g=je(h,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:l,cache:i});if(!g){console.warn("Failed to rebuild",h);continue}h.isShadow&&Nt(u)&&u.shadowRoot?u.shadowRoot.appendChild(g):u.appendChild(g),l&&l(g)}return u}function vn(e,t){function r(a){t(a)}for(var n=0,o=e.getIds();n<o.length;n++){var s=o[n];e.has(s)&&r(e.getNode(s))}}function bn(e,t){var r=t.getMeta(e);if(r?.type===k.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var s=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=s),o==="rr_scrollTop"&&(n.scrollTop=s)}}}function Sn(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,s=o===void 0?!0:o,a=t.afterAppend,c=t.cache,l=t.mirror,i=l===void 0?new Ke:l,u=je(e,{doc:r,mirror:i,skipChild:!1,hackCss:s,afterAppend:a,cache:c});return vn(i,function(d){n&&n(d),bn(d,i)}),u}function te(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Te=`Please stop import mirror directly. Instead of that,\r
|
|
3
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
|
+
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Te),-1},getNode(){return console.error(Te),null},removeNodeFromMap(){console.error(Te)},has(){return console.error(Te),!1},reset(){console.error(Te)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Te),Reflect.get(e,t,r)}}));function Ne(e,t,r={}){let n=null,o=0;return function(s){const a=Date.now();!o&&r.leading===!1&&(o=a);const c=t-(a-o),l=this,i=arguments;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(l,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},c))}}function Oe(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>Oe(e,t,s||{},!0)}function pe(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function tt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const At=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ee(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let r=!1;if(typeof t=="string"){if(e.closest!==void 0)return e.closest("."+t)!==null;r=e.classList.contains(t)}else e.classList.forEach(n=>{t.test(n)&&(r=!0)});return r||ee(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ee(e.parentNode,t)}function Lt(e,t){return t.getId(e)!==-1}function Ge(e,t){return t.getId(e)===Re}function nt(e,t){if(ke(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?nt(e.parentNode,t):!0:!0}function ot(e){return Boolean(e.changedTouches)}function it(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function _t(e){const t={},r=(o,s)=>{const a={value:o,parent:s,children:[]};return t[o.node.id]=a,a},n=[];for(const o of e){const{nextId:s,parentId:a}=o;if(s&&s in t){const c=t[s];if(c.parent){const l=c.parent.children.indexOf(c);c.parent.children.splice(l,0,r(o,c.parent))}else{const l=n.indexOf(c);n.splice(l,0,r(o,null))}continue}if(a in t){const c=t[a];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function st(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)st(e.children[r],t)}function we(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ft(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function at(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=at(o,t),c=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:c,absoluteScale:a.absoluteScale*c}}function Ae(e){return Boolean(e?.shadowRoot)}function Ee(e,t){const r=e[t[0]];return t.length===1?r:Ee(r.cssRules[t[1]].cssRules,t.slice(2))}function ct(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Pt(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Tn=Object.freeze({__proto__:null,on:te,get _mirror(){return q.mirror},throttle:Ne,hookSetter:Oe,patch:pe,getWindowHeight:tt,getWindowWidth:rt,isCanvasNode:At,isBlocked:ee,isSerialized:Lt,isIgnored:Ge,isAncestorRemoved:nt,isTouchEvent:ot,polyfill:it,queueToResolveTrees:_t,iterateResolveTree:st,isSerializedIframe:we,isSerializedStylesheet:Ft,getBaseDimension:at,hasShadowRoot:Ae,getNestedRule:Ee,getPositionsAndIndex:ct,uniqueTextMutations:Pt}),M=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(M||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(x||{}),Y=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Y||{}),le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(le||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),R=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(R||{});function Wt(e){return"__ln"in e}class Nn{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Wt(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Wt(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const $t=(e,t)=>`${e}@${t}`;class wn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Nn,n=c=>{let l=c,i=Re;for(;i===Re;)l=l&&l.nextSibling,i=l&&this.mirror.getId(l);return i},o=c=>{var l,i,u,d,m;const h=c.getRootNode?(l=c.getRootNode())==null?void 0:l.host:null;let g=h;for(;(u=(i=g?.getRootNode)==null?void 0:i.call(g))!=null&&u.host;)g=((m=(d=g?.getRootNode)==null?void 0:d.call(g))==null?void 0:m.host)||null;const f=!this.doc.contains(c)&&(!g||!this.doc.contains(g));if(!c.parentNode||f)return;const S=ke(c.parentNode)?this.mirror.getId(h):this.mirror.getId(c.parentNode),p=n(c);if(S===-1||p===-1)return r.addNode(c);const b=Se(c,{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:T=>{we(T,this.mirror)&&this.iframeManager.addIframe(T),Ft(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),Ae(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(T,I)=>{this.iframeManager.attachIframe(T,I,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,I)=>{this.stylesheetManager.attachStylesheet(T,I,this.mirror)}});b&&t.push({parentId:S,nextId:p,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))ut(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!dt(this.droppedSet,c)&&!ut(this.removes,c,this.mirror)||dt(this.movedSet,c)?o(c):this.droppedSet.add(c);let s=null;for(;r.length;){let c=null;if(s){const l=this.mirror.getId(s.value.parentNode),i=n(s.value);l!==-1&&i!==-1&&(c=s)}if(!c)for(let l=r.length-1;l>=0;l--){const i=r.get(l);if(i){const u=this.mirror.getId(i.value.parentNode),d=n(i.value);if(u!==-1&&d!==-1){c=i;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}s=c.previous,r.removeNode(c.value),o(c.value)}const a={texts:this.texts.map(c=>{let l=c.value;return this.enableStrictPrivacy&&l&&(l=Ct(l)),{id:this.mirror.getId(c.node),value:l}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Ge(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!ee(t.target,this.blockClass)&&r!==t.oldValue&&this.texts.push({value:Ue(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),ee(t.target,this.blockClass)||n===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const c of Array.from(r.style)){const l=r.style.getPropertyValue(c),i=r.style.getPropertyPriority(c);(l!==s.style.getPropertyValue(c)||i!==s.style.getPropertyPriority(c))&&(i===""?a[c]=l:a[c]=[l,i])}for(const c of Array.from(s.style))r.style.getPropertyValue(c)===""&&(a[c]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=Mt(this.doc,t.target.tagName,t.attributeName,n)}break}case"childList":{t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=ke(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ee(t.target,this.blockClass)||Ge(r,this.mirror)||!Lt(r,this.mirror)||(this.addedSet.has(r)?(lt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||nt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[$t(n,o)]?lt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ke(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!(r&&ee(r,this.blockClass))){if(this.mirror.getMeta(t)){if(Ge(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.getMeta(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[$t(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass)||t.childNodes.forEach(n=>this.genAdds(n))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function lt(e,t){e.delete(t),t.childNodes.forEach(r=>lt(e,r))}function ut(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:ut(e,n,r)}function dt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:dt(e,r):!1}var En=Object.defineProperty,Cn=Object.defineProperties,In=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Ut=(e,t,r)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Mn.call(t,r)&&Ut(e,r,t[r]);if(Vt)for(var r of Vt(t))xn.call(t,r)&&Ut(e,r,t[r]);return e},Dn=(e,t)=>Cn(e,In(t));const ge=[],Gt=typeof CSSGroupingRule<"u",Bt=typeof CSSMediaRule<"u",zt=typeof CSSSupportsRule<"u",Ht=typeof CSSConditionRule<"u";function Le(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Yt(e,t){var r,n;const o=new wn;ge.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");a&&window[a]&&(s=window[a]);const c=new s(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function kn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],c;const l=Ne(d=>{const m=Date.now()-c;e(a.map(h=>(h.timeOffset-=m,h)),d),a=[],c=null},s),i=Ne(d=>{const m=Le(d),{clientX:h,clientY:g}=ot(d)?d.changedTouches[0]:d;c||(c=Date.now()),a.push({x:h,y:g,id:n.getId(m),timeOffset:Date.now()-c}),l(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",i,r),te("touchmove",i,r),te("drag",i,r)];return()=>{u.forEach(d=>d())}}function Rn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],c=l=>i=>{const u=Le(i);if(ee(u,n)||At(u))return;const d=ot(i)?i.changedTouches[0]:i;if(!d)return;const m=r.getId(u),{clientX:h,clientY:g}=d;e({type:Y[l],id:m,x:h,y:g})};return Object.keys(Y).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&s[l]!==!1).forEach(l=>{const i=l.toLowerCase(),u=c(l);a.push(te(i,u,t))}),()=>{a.forEach(l=>l())}}function Xt({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=Ne(a=>{const c=Le(a);if(!c||ee(c,n))return;const l=r.getId(c);if(c===t){const i=t.scrollingElement||t.documentElement;e({id:l,x:i.scrollLeft,y:i.scrollTop})}else e({id:l,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return te("scroll",s,t)}function On({viewportResizeCb:e}){let t=-1,r=-1;const n=Ne(()=>{const o=tt(),s=rt();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return te("resize",n,window)}function Zt(e,t){const r=jt({},e);return t||delete r.userTriggered,r}const An=["INPUT","TEXTAREA","SELECT"],Kt=new WeakMap;function Ln({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:c,userTriggeredOnInput:l}){function i(g){let f=Le(g);const S=g.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||An.indexOf(f.tagName)<0||ee(f,n))return;const p=f.type;if(f.classList.contains(o))return;let b=f.value,T=!1;p==="radio"||p==="checkbox"?T=f.checked:(s[f.tagName.toLowerCase()]||s[p])&&(b=Qe({maskInputOptions:s,tagName:f.tagName,type:p,value:b,maskInputFn:a})),u(f,Zt({text:b,isChecked:T,userTriggered:S},l));const I=f.name;p==="radio"&&I&&T&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(F=>{F!==f&&u(F,Zt({text:F.value,isChecked:!T,userTriggered:!1},l))})}function u(g,f){const S=Kt.get(g);if(!S||S.text!==f.text||S.isChecked!==f.isChecked){Kt.set(g,f);const p=r.getId(g);e(Dn(jt({},f),{id:p}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(g=>te(g,i,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(g=>Oe(g[0],g[1],{set(){i({target:this})}}))),()=>{d.forEach(g=>g())}}function Be(e){const t=[];function r(n,o){if(Gt&&n.parentRule instanceof CSSGroupingRule||Bt&&n.parentRule instanceof CSSMediaRule||zt&&n.parentRule instanceof CSSSupportsRule||Ht&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function _n({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,l){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,adds:[{rule:c,index:l}]}),n.apply(this,arguments)};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const l=t.getId(this.ownerNode);return l!==-1&&e({id:l,removes:[{index:c}]}),o.apply(this,arguments)};const s={};Gt?s.CSSGroupingRule=r.CSSGroupingRule:(Bt&&(s.CSSMediaRule=r.CSSMediaRule),Ht&&(s.CSSConditionRule=r.CSSConditionRule),zt&&(s.CSSSupportsRule=r.CSSSupportsRule));const a={};return Object.entries(s).forEach(([c,l])=>{a[c]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=function(i,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:i,index:[...Be(this),u||0]}]}),a[c].insertRule.apply(this,arguments)},l.prototype.deleteRule=function(i){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...Be(this),i]}]}),a[c].deleteRule.apply(this,arguments)}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([c,l])=>{l.prototype.insertRule=a[c].insertRule,l.prototype.deleteRule=a[c].deleteRule})}}function Fn({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,a,c){var l,i;const u=t.getId((i=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:i.ownerNode);return u!==-1&&e({id:u,set:{property:s,value:a,priority:c},index:Be(this.parentRule)}),n.apply(this,arguments)};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var a,c;const l=t.getId((c=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:c.ownerNode);return l!==-1&&e({id:l,remove:{property:s},index:Be(this.parentRule)}),o.apply(this,arguments)},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Pn({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=a=>Ne(c=>{const l=Le(c);if(!l||ee(l,t))return;const{currentTime:i,volume:u,muted:d}=l;e({type:a,id:r.getId(l),currentTime:i,volume:u,muted:d})},n.media||500),s=[te("play",o(fe.Play)),te("pause",o(fe.Pause)),te("seeked",o(fe.Seeked)),te("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(a=>a())}}function Wn({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(c,l,i){const u=new s(c,l,i);return o.set(u,{family:c,buffer:typeof l!="string",descriptors:i,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};const a=pe(t.fonts,"add",function(c){return function(l){return setTimeout(()=>{const i=o.get(l);i&&(e(i),o.delete(l))},0),c.apply(this,[l])}});return n.push(()=>{r.FontFace=s}),n.push(a),()=>{n.forEach(c=>c())}}function $n(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:c,mediaInteractionCb:l,styleSheetRuleCb:i,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),s(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),c(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),l(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),i(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Vn(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};$n(e,t);const n=Yt(e,e.doc),o=kn(e),s=Rn(e),a=Xt(e),c=On(e),l=Ln(e),i=Pn(e),u=_n(e,{win:r}),d=Fn(e,{win:r}),m=e.collectFonts?Wn(e):()=>{},h=[];for(const g of e.plugins)h.push(g.observer(g.callback,r,g.options));return()=>{ge.forEach(g=>g.reset()),n.disconnect(),o(),s(),a(),c(),l(),i(),u(),d(),m(),h.forEach(g=>g())}}class Un{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var jn=Object.defineProperty,Gn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Jt=(e,t,r)=>t in e?jn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qt=(e,t)=>{for(var r in t||(t={}))zn.call(t,r)&&Jt(e,r,t[r]);if(Qt)for(var r of Qt(t))Hn.call(t,r)&&Jt(e,r,t[r]);return e},er=(e,t)=>Gn(e,Bn(t));class Yn{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){Yt(er(qt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Xt(er(qt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_e=typeof Uint8Array>"u"?[]:new Uint8Array(256),ze=0;ze<Ce.length;ze++)_e[Ce.charCodeAt(ze)]=ze;var Xn=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ce[t[r]>>2],o+=Ce[(t[r]&3)<<4|t[r+1]>>4],o+=Ce[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ce[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Zn=function(e){var t=e.length*.75,r=e.length,n,o=0,s,a,c,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var i=new ArrayBuffer(t),u=new Uint8Array(i);for(n=0;n<r;n+=4)s=_e[e.charCodeAt(n)],a=_e[e.charCodeAt(n+1)],c=_e[e.charCodeAt(n+2)],l=_e[e.charCodeAt(n+3)],u[o++]=s<<2|a>>4,u[o++]=(a&15)<<4|c>>2,u[o++]=(c&3)<<6|l&63;return i};const tr=new Map;function Kn(e,t){let r=tr.get(e);return r||(r=new Map,tr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const rr=(e,t,r)=>{if(!e||!(or(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Kn(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function He(e,t,r){if(e instanceof Array)return e.map(n=>He(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Xn(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,r),e.width,e.height]};if(or(e,t)||typeof e=="object"){const n=e.constructor.name,o=rr(e,t,r);return{rr_type:n,index:o}}}}return e}const nr=(e,t,r)=>[...e].map(n=>He(n,t,r)),or=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Qn(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=pe(t.CanvasRenderingContext2D.prototype,a,function(l){return function(...i){return ee(this.canvas,r)||setTimeout(()=>{const u=nr([...i],t,this);e(this.canvas,{type:le["2D"],property:a,args:u})},0),l.apply(this,i)}});o.push(c)}catch{const l=Oe(t.CanvasRenderingContext2D.prototype,a,{set(i){e(this.canvas,{type:le["2D"],property:a,args:[i],setter:!0})}});o.push(l)}return()=>{o.forEach(a=>a())}}function ir(e,t){const r=[];try{const n=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ee(this,t)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function sr(e,t,r,n,o,s){const a=[],c=Object.getOwnPropertyNames(e);for(const l of c)try{if(typeof e[l]!="function")continue;const i=pe(e,l,function(u){return function(...d){const m=u.apply(this,d);if(rr(m,s,e),!ee(this.canvas,n)){const h=o.getId(this.canvas),g=nr([...d],s,e),f={type:t,property:l,args:g};r(this.canvas,f)}return m}});a.push(i)}catch{const u=Oe(e,l,{set(d){r(this.canvas,{type:t,property:l,args:[d],setter:!0})}});a.push(u)}return a}function Jn(e,t,r,n){const o=[];return o.push(...sr(t.WebGLRenderingContext.prototype,le.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...sr(t.WebGL2RenderingContext.prototype,le.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function qn(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function eo(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=qn(e,o),a=s.indexOf(`
|
|
5
|
+
`,10)+1,c=s.substring(a)+(n?"//# sourceMappingURL="+n:""),l=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(l)}function to(e,t,r){var n;return function(s){return n=n||eo(e,t,r),new Worker(n,s)}}var ro=to("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),ar=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,io=(e,t)=>{var r={};for(var n in e)no.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ar)for(var n of ar(e))t.indexOf(n)<0&&oo.call(e,n)&&(r[n]=e[n]);return r},so=(e,t,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(i){o(i)}},a=l=>{try{c(r.throw(l))}catch(i){o(i)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);c((r=r.apply(e,t)).next())});class ao{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(a,c){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=ir(r,n),s=new Map,a=new ro;a.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:h,type:g,width:f,height:S}=d.data;this.mutationCb({id:m,type:le["2D"],commands:[{property:"clearRect",args:[0,0,f,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:g}]},0,0]}]})};const c=1e3/t;let l=0,i;const u=d=>{if(l&&d-l<c){i=requestAnimationFrame(u);return}l=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>so(this,null,function*(){var h;const g=this.mirror.getId(m);if(s.get(g))return;if(s.set(g,!0),["webgl","webgl2"].includes(m.__context)){const S=m.getContext(m.__context);((h=S?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&S?.clear(S.COLOR_BUFFER_BIT)}const f=yield createImageBitmap(m);a.postMessage({id:g,bitmap:f,width:m.width,height:m.height},[f])})),i=requestAnimationFrame(u)};i=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(i)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=ir(t,r),o=Qn(this.processMutation.bind(this),t,r,this.mirror),s=Jn(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(a=>io(a,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class co{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var lo=Object.defineProperty,uo=Object.defineProperties,ho=Object.getOwnPropertyDescriptors,cr=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,lr=(e,t,r)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oe=(e,t)=>{for(var r in t||(t={}))mo.call(t,r)&&lr(e,r,t[r]);if(cr)for(var r of cr(t))po.call(t,r)&&lr(e,r,t[r]);return e},fo=(e,t)=>uo(e,ho(t));function Q(e){return fo(oe({},e),{timestamp:Date.now()})}let z,Fe;const de=wt();function ye(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:a="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:l=null,inlineStylesheet:i=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:g,hooks:f,packFn:S,sampling:p={},mousemoveWait:b,recordCanvas:T=!1,userTriggeredOnInput:I=!1,collectFonts:F=!1,inlineImages:O=!1,plugins:C,keepIframeSrcFn:E=()=>!1,enableStrictPrivacy:H=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&p.mousemove===void 0&&(p.mousemove=b),de.reset();const X=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},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||{};it();let J,B=0;const ne=w=>{for(const $ of C||[])$.eventProcessor&&(w=$.eventProcessor(w));return S&&(w=S(w)),w};z=(w,$)=>{var j;if(((j=ge[0])==null?void 0:j.isFrozen())&&w.type!==M.FullSnapshot&&!(w.type===M.IncrementalSnapshot&&w.data.source===x.Mutation)&&ge.forEach(L=>L.unfreeze()),t(ne(w),$),w.type===M.FullSnapshot)J=w,B=0;else if(w.type===M.IncrementalSnapshot){if(w.data.source===x.Mutation&&w.data.isAttachIframe)return;B++;const L=n&&B>=n,re=r&&w.timestamp-J.timestamp>r;(L||re)&&Fe(!0)}};const K=w=>{z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Mutation},w)}))},G=w=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Scroll},w)})),W=w=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.CanvasMutation},w)})),A=new Un({mutationCb:K}),v=new co({mutationCb:K}),y=new ao({recordCanvas:T,mutationCb:W,win:window,blockClass:o,mirror:de,sampling:p.canvas}),N=new Yn({mutationCb:K,scrollCb:G,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:l,inlineStylesheet:i,maskInputOptions:X,maskTextFn:g,maskInputFn:h,recordCanvas:T,inlineImages:O,sampling:p,slimDOMOptions:Z,iframeManager:A,stylesheetManager:v,canvasManager:y,enableStrictPrivacy:H},mirror:de});Fe=(w=!1)=>{var $,j,L,re;z(Q({type:M.Meta,data:{href:window.location.href,width:rt(),height:tt()}}),w),ge.forEach(P=>P.lock());const _=hn(document,{mirror:de,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:l,inlineStylesheet:i,maskAllInputs:X,maskTextFn:g,slimDOM:Z,recordCanvas:T,inlineImages:O,enableStrictPrivacy:H,onSerialize:P=>{we(P,de)&&A.addIframe(P),Ae(P)&&N.addShadowRoot(P.shadowRoot,document)},onIframeLoad:(P,ue)=>{A.attachIframe(P,ue,de),N.observeAttachShadow(P)},onStylesheetLoad:(P,ue)=>{this.stylesheetManager.attachStylesheet(P,ue,this.mirror)},keepIframeSrcFn:E});if(!_)return console.warn("Failed to snapshot the document");z(Q({type:M.FullSnapshot,data:{node:_,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((j=($=document?.body)==null?void 0:$.parentElement)==null?void 0:j.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((re=(L=document?.body)==null?void 0:L.parentElement)==null?void 0:re.scrollTop)||document?.body.scrollTop||0}}})),ge.forEach(P=>P.unlock())};try{const w=[];w.push(te("DOMContentLoaded",()=>{z(Q({type:M.DomContentLoaded,data:{}}))}));const $=L=>{var re;return Vn({mutationCb:K,mousemoveCb:(_,P)=>z(Q({type:M.IncrementalSnapshot,data:{source:P,positions:_}})),mouseInteractionCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.MouseInteraction},_)})),scrollCb:G,viewportResizeCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.ViewportResize},_)})),inputCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Input},_)})),mediaInteractionCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.MediaInteraction},_)})),styleSheetRuleCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.StyleSheetRule},_)})),styleDeclarationCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.StyleDeclaration},_)})),canvasMutationCb:W,fontCb:_=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Font},_)})),blockClass:o,ignoreClass:a,maskTextClass:c,maskTextSelector:l,maskInputOptions:X,inlineStylesheet:i,sampling:p,recordCanvas:T,inlineImages:O,userTriggeredOnInput:I,collectFonts:F,doc:L,maskInputFn:h,maskTextFn:g,blockSelector:s,slimDOMOptions:Z,mirror:de,iframeManager:A,stylesheetManager:v,shadowDomManager:N,canvasManager:y,enableStrictPrivacy:H,plugins:((re=C?.filter(_=>_.observer))==null?void 0:re.map(_=>({observer:_.observer,options:_.options,callback:P=>z(Q({type:M.Plugin,data:{plugin:_.name,payload:P}}))})))||[]},f)};A.addLoadListener(L=>{w.push($(L.contentDocument))});const j=()=>{Fe(),w.push($(document))};return document.readyState==="interactive"||document.readyState==="complete"?j():w.push(te("load",()=>{z(Q({type:M.Load,data:{}})),j()},window)),()=>{w.forEach(L=>L())}}catch(w){console.warn(w)}}ye.addCustomEvent=(e,t)=>{!z||z(Q({type:M.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{ge.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Fe(e)},ye.mirror=de;var D;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(D||(D={}));var go=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function yo(){return new go}function vo(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(s){if(s){const a=s.split(n);a.length>1&&(t[ht(a[0].trim())]=a[1].trim())}}),t}function ur(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=No(r);t.push(`${o}: ${n};`)}return t.join(" ")}const bo=/-([a-z])/g,So=/^--[a-zA-Z0-9-]+$/,ht=e=>So.test(e)?e:e.replace(bo,(t,r)=>r?r.toUpperCase():""),To=/\B([A-Z])/g,No=e=>e.replace(To,"-$1").toLowerCase();class ie{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=U.ELEMENT_NODE,this.TEXT_NODE=U.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function wo(e){return class jr extends e{constructor(){super(...arguments),this.nodeType=U.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=D.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===D.Element||n===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===D.Element||o===D.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const s=this.childNodes.indexOf(n);if(s==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(s,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new jr}createDocumentType(r,n,o){const s=new(dr(ie))(r,n,o);return s.ownerDocument=this,s}createElement(r){const n=new(hr(ie))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(mr(ie))(r);return n.ownerDocument=this,n}createComment(r){const n=new(pr(ie))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(fr(ie))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function dr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=U.DOCUMENT_TYPE_NODE,this.RRNodeType=D.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function hr(e){return class extends e{constructor(t){super(),this.nodeType=U.ELEMENT_NODE,this.RRNodeType=D.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Co(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?vo(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,s)=>{if(r.test(n))return;const a=ht(n);o?t[a]=o:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=ur(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=ht(n),s=t[o]||"";return delete t[o],this.attributes.style=ur(t),s},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function Eo(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function mr(e){return class extends e{constructor(t){super(),this.nodeType=U.TEXT_NODE,this.nodeName="#text",this.RRNodeType=D.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function pr(e){return class extends e{constructor(t){super(),this.nodeType=U.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=D.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function fr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=U.CDATA_SECTION_NODE,this.RRNodeType=D.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Co{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const s=String(o);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var U;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(U||(U={}));const mt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function ae(e,t,r,n){const o=e.childNodes,s=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||s.length>0)&&gr(Array.from(o),s,e,r,n);let a=null,c=null;switch(t.RRNodeType){case D.Document:{c=t.scrollData;break}case D.Element:{const l=e,i=t;switch(Io(l,i,n),c=i.scrollData,a=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const u=e,d=i;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Mo(l,t.rules);break}if(i.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});const u=l.shadowRoot.childNodes,d=i.shadowRoot.childNodes;(u.length>0||d.length>0)&&gr(Array.from(u),d,l.shadowRoot,r,n)}break}case D.Text:case D.Comment:case D.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),a&&r.applyInput(a),t.nodeName==="IFRAME"){const l=e.contentDocument,i=t;if(l){const u=n.getMeta(i.contentDocument);u&&r.mirror.add(l,Object.assign({},u)),ae(l,i.contentDocument,r,n)}}}function Io(e,t,r){const n=e.attributes,o=t.attributes;for(const s in o){const a=o[s],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&mt[s])e.setAttributeNS(mt[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const i=e.getContext("2d");i&&i.drawImage(l,0,0,l.width,l.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(n))s in o||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function gr(e,t,r,n,o){var s,a;let c=0,l=e.length-1,i=0,u=t.length-1,d=e[c],m=e[l],h=t[i],g=t[u],f,S;for(;c<=l&&i<=u;)if(d===void 0)d=e[++c];else if(m===void 0)m=e[--l];else if(n.mirror.getId(d)===o.getId(h))ae(d,h,n,o),d=e[++c],h=t[++i];else if(n.mirror.getId(m)===o.getId(g))ae(m,g,n,o),m=e[--l],g=t[--u];else if(n.mirror.getId(d)===o.getId(g))r.insertBefore(d,m.nextSibling),ae(d,g,n,o),d=e[++c],g=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),ae(m,h,n,o),m=e[--l],h=t[++i];else{if(!f){f={};for(let p=c;p<=l;p++){const b=e[p];b&&n.mirror.hasNode(b)&&(f[n.mirror.getId(b)]=p)}}if(S=f[o.getId(h)],S){const p=e[S];r.insertBefore(p,d),ae(p,h,n,o),e[S]=void 0}else{const p=pt(h,n.mirror,o);((s=n.mirror.getMeta(r))===null||s===void 0?void 0:s.type)===D.Document&&((a=n.mirror.getMeta(p))===null||a===void 0?void 0:a.type)===D.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[c]=void 0,d=void 0),r.insertBefore(p,d||null),ae(p,h,n,o)}h=t[++i]}if(c>l){const p=t[u+1];let b=null;for(p&&r.childNodes.forEach(T=>{n.mirror.getId(T)===o.getId(p)&&(b=T)});i<=u;++i){const T=pt(t[i],n.mirror,o);r.insertBefore(T,b),ae(T,t[i],n,o)}}else if(i>u)for(;c<=l;c++){const p=e[c];p&&(r.removeChild(p),n.mirror.removeNodeFromMap(p))}}function pt(e,t,r){let n=t.getNode(r.getId(e));const o=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case D.Document:n=new Document;break;case D.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case D.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?n=document.createElementNS(mt.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case D.Text:n=document.createTextNode(e.data);break;case D.Comment:n=document.createComment(e.data);break;case D.CDATA:n=document.createCDATASection(e.data);break}return o&&t.add(n,Object.assign({},o)),n}function Pe(e,t){const r=e[t[0]];return t.length===1?r:Pe(r.cssRules[t[1]].cssRules,t.slice(2))}var se;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(se||(se={}));function yr(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Mo(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===se.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:s}=yr(n.index);Pe(r.cssRules,o).insertRule(n.cssText,s)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===se.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:s}=yr(n.index);Pe(r.cssRules,o).deleteRule(s||0)}else r.deleteRule(n.index)}catch{}else n.type===se.SetProperty?Pe(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===se.RemoveProperty&&Pe(r.cssRules,n.index).style.removeProperty(n.property)})}class Ie extends wo(ie){constructor(t){super(),this._unserializedId=-1,this.mirror=Wo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Ie}createDocumentType(t,r,n){const o=new xo(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Do(r);break;case"IFRAME":n=new Oo(r,this.mirror);break;case"CANVAS":n=new ko(r);break;case"STYLE":n=new Ro(r);break;default:n=new We(r);break}return n.ownerDocument=this,n}createComment(t){const r=new Lo(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new _o(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Ao(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const xo=dr(ie);class We extends hr(ie){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Do extends Eo(We){}class ko extends We{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Ro extends We{constructor(){super(...arguments),this.rules=[]}}class Oo extends We{constructor(t,r){super(t),this.contentDocument=new Ie,this.contentDocument.mirror=r}}const Ao=mr(ie),Lo=pr(ie),_o=fr(ie);function Fo(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function vr(e,t,r,n){let o;switch(e.nodeType){case U.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case U.DOCUMENT_TYPE_NODE:const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break;case U.ELEMENT_NODE:const c=e,l=Fo(c);o=t.createElement(l);const i=o;for(const{name:u,value:d}of Array.from(c.attributes))i.attributes[u]=d;c.scrollLeft&&(i.scrollLeft=c.scrollLeft),c.scrollTop&&(i.scrollTop=c.scrollTop);break;case U.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case U.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case U.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let s=r.getMeta(e);return t instanceof Ie&&(s||(s=br(o,t.unserializedId),r.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function Po(e,t=yo(),r=new Ie){function n(o,s){const a=vr(o,r,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&o.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),o.nodeName==="IFRAME"?n(o.contentDocument,a):(o.nodeType===U.DOCUMENT_NODE||o.nodeType===U.ELEMENT_NODE||o.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===U.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,a),o.childNodes.forEach(c=>n(c,a))))}return n(e,null),r}function Wo(){return new $o}class $o{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function br(e,t){switch(e.RRNodeType){case D.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case D.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case D.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Sr(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(o){o(n)}),(e["*"]||[]).slice().map(function(o){o(r,n)})}}}var Vo=Object.freeze({__proto__:null,default:Sr});function Uo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(p)}const c=a(e.navigator.userAgent)?1:0;function l(p,b){this.scrollLeft=p,this.scrollTop=b}function i(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,b){if(b==="Y")return p.clientHeight+c<p.scrollHeight;if(b==="X")return p.clientWidth+c<p.scrollWidth}function m(p,b){const T=e.getComputedStyle(p,null)["overflow"+b];return T==="auto"||T==="scroll"}function h(p){const b=d(p,"Y")&&m(p,"Y"),T=d(p,"X")&&m(p,"X");return b||T}function g(p){for(;p!==t.body&&h(p)===!1;)p=p.parentNode||p.host;return p}function f(p){const b=s();let T,I,F,O=(b-p.startTime)/n;O=O>1?1:O,T=i(O),I=p.startX+(p.x-p.startX)*T,F=p.startY+(p.y-p.startY)*T,p.method.call(p.scrollable,I,F),(I!==p.x||F!==p.y)&&e.requestAnimationFrame(f.bind(e,p))}function S(p,b,T){let I,F,O,C;const E=s();p===t.body?(I=e,F=e.scrollX||e.pageXOffset,O=e.scrollY||e.pageYOffset,C=o.scroll):(I=p,F=p.scrollLeft,O=p.scrollTop,C=l),f({scrollable:I,method:C,startTime:E,startX:F,startY:O,x:b,y:T})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}S.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,b=arguments[0].top;S.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof b>"u"?this.scrollTop:~~b)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=g(this),b=p.getBoundingClientRect(),T=this.getBoundingClientRect();p!==t.body?(S.call(this,p,p.scrollLeft+T.left-b.left,p.scrollTop+T.top-b.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}class jo{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=this;function o(){const s=performance.now();for(n.timeOffset+=(s-t)*n.speed,t=s;r.length;){const a=r[0];if(n.timeOffset>=a.delay)r.shift(),a.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function ft(e,t){if(e.type===M.IncrementalSnapshot&&e.data.source===x.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
3
6
|
Copyright (c) Microsoft Corporation.
|
|
4
7
|
|
|
5
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,19 +15,5 @@ var rrweb=function(e){"use strict";
|
|
|
12
15
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function a(e){return e.nodeType===e.ELEMENT_NODE}function s(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function l(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(a=i?i(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var c="__rrweb_original__";function u(e){return e=(null==(e=e.replace(/[^ -~]+/g,""))?void 0:e.split(" ").map((function(e){return Math.random().toString(20).substr(2,e.length)})).join(" "))||""}var d,p,f=1,h=new RegExp("[^a-z0-9-_:]");function m(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(v).join(""):null}catch(e){return null}}function v(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=m(e.styleSheet)||t}catch(e){}return t}var y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,g=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,b=/^(data:)([^,]*),(.*)/i;function S(e,t){return(e||"").replace(y,(function(e,n,r,o,i,a){var s,l=r||i||a,c=n||o||"";if(!l)return e;if(!g.test(l))return"url("+c+l+c+")";if(b.test(l))return"url("+c+l+c+")";if("/"===l[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+c+")";var u=t.split("/"),d=l.split("/");u.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?u.pop():u.push(h))}return"url("+c+u.join("/")+c+")"}))}var T=/^[^ \t\n\r\u000c]+/,w=/^[, \t\n\r\u000c]+/;function x(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function E(){var e=document.createElement("a");return e.href="",e.href}function I(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?x(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(w),!(n>=t.length);){var i=r(T);if(","===i.slice(-1))i=x(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=x(e,i);for(var s=!1;;){var l=t.charAt(n);if(""===l){o.push((i+a).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){n+=1,o.push((i+a).trim());break}"("===l&&(s=!0)}a+=l,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?S(r,E()):"object"===t&&"data"===n&&r?x(e,r):r:x(e,r)}function C(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!(!n||!e.matches(n))||C(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,C(e.parentNode,t,n)}function M(e,n){var r,o,i,a,s=n.doc,f=n.blockClass,v=n.blockSelector,y=n.maskTextClass,g=n.maskTextSelector,b=n.inlineStylesheet,T=n.maskInputOptions,w=void 0===T?{}:T,x=n.maskTextFn,M=n.maskInputFn,k=n.dataURLOptions,N=void 0===k?{}:k,R=n.inlineImages,_=n.recordCanvas,A=n.keepIframeSrcFn,O=n.enableStrictPrivacy;if(s.__sn){var D=s.__sn.id;o=1===D?void 0:D}switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:t.Document,childNodes:[],compatMode:e.compatMode,rootId:o}:{type:t.Document,childNodes:[],rootId:o};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:o};case e.ELEMENT_NODE:for(var L=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(e,f,v),P=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return h.test(t)?"div":t}(e),F={},W=0,j=Array.from(e.attributes);W<j.length;W++){var U=j[W],z=U.name,B=U.value;F[z]=I(s,P,z,B)}if("link"===P&&b){var V=Array.from(s.styleSheets).find((function(t){return t.href===e.href})),H=null;V&&(H=m(V)),H&&(delete F.rel,delete F.href,F._cssText=S(H,V.href))}if("style"===P&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(H=m(e.sheet))&&(F._cssText=S(H,E()));if("input"===P||"textarea"===P||"select"===P){B=e.value;"radio"!==F.type&&"checkbox"!==F.type&&"submit"!==F.type&&"button"!==F.type&&B?F.value=l({type:F.type,tagName:P,value:B,maskInputOptions:w,maskInputFn:M}):e.checked&&(F.checked=e.checked)}if("option"===P&&(e.selected&&!w.select?F.selected=!0:delete F.selected),"canvas"===P&&_)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=c in o?o.__rrweb_original__:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(F.rr_dataURL=e.toDataURL(N.type,N.quality));else if(!("__context"in e)){var G=e.toDataURL(N.type,N.quality),Y=document.createElement("canvas");Y.width=e.width,Y.height=e.height,G!==Y.toDataURL(N.type,N.quality)&&(F.rr_dataURL=G)}if("img"===P&&R){d||(d=s.createElement("canvas"),p=d.getContext("2d"));var X=e,q=X.crossOrigin;X.crossOrigin="anonymous";var Q=function(){try{d.width=X.naturalWidth,d.height=X.naturalHeight,p.drawImage(X,0,0),F.rr_dataURL=d.toDataURL(N.type,N.quality)}catch(e){console.warn("Cannot inline img src="+X.currentSrc+"! Error: "+e)}q?F.crossOrigin=q:delete F.crossOrigin};X.complete&&0!==X.naturalWidth?Q():X.onload=Q}if("audio"!==P&&"video"!==P||(F.rr_mediaState=e.paused?"paused":"played",F.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(F.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(F.rr_scrollTop=e.scrollTop),L||"img"===P&&O){var $=e.getBoundingClientRect(),K=$.width,J=$.height;F={class:F.class,rr_width:K+"px",rr_height:J+"px"},L=!0}return"iframe"!==P||A(F.src)||(e.contentDocument||(F.rr_src=F.src),delete F.src),{type:t.Element,tagName:P,attributes:F,childNodes:[],isSVG:(a=e,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:L,rootId:o};case e.TEXT_NODE:var Z=e.parentNode&&e.parentNode.tagName,ee=e.textContent,te="STYLE"===Z||void 0,ne="SCRIPT"===Z||void 0,re=!1;if(te&&ee){try{e.nextSibling||e.previousSibling||(null===(r=e.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(ee=(i=e.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}ee=S(ee,E()),re=!0}if(ne?(ee="SCRIPT_PLACEHOLDER",re=!0):"NOSCRIPT"===Z&&(ee="",re=!0),!te&&!ne&&C(e,y,g)&&ee&&(ee=x?x(ee):ee.replace(/[\S]/g,"*")),O&&!re&&Z)!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(Z)&&ee&&(ee=u(ee));return{type:t.Text,textContent:ee||"",isStyle:te,rootId:o};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:"",rootId:o};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||"",rootId:o};default:return!1}}function k(e){return void 0===e?"":e.toLowerCase()}function N(e,n){var r,o=n.doc,i=n.map,l=n.blockClass,c=n.blockSelector,u=n.maskTextClass,d=n.maskTextSelector,p=n.skipChild,h=void 0!==p&&p,m=n.inlineStylesheet,v=void 0===m||m,y=n.maskInputOptions,g=void 0===y?{}:y,b=n.maskTextFn,S=n.maskInputFn,T=n.slimDOMOptions,w=n.dataURLOptions,x=void 0===w?{}:w,E=n.inlineImages,I=void 0!==E&&E,C=n.recordCanvas,R=void 0!==C&&C,_=n.onSerialize,A=n.onIframeLoad,O=n.iframeLoadTimeout,D=void 0===O?5e3:O,L=n.keepIframeSrcFn,P=void 0===L?function(){return!1}:L,F=n.enableStrictPrivacy,W=n.preserveWhiteSpace,j=void 0===W||W,U=M(e,{doc:o,blockClass:l,blockSelector:c,maskTextClass:u,maskTextSelector:d,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:S,dataURLOptions:x,inlineImages:I,recordCanvas:R,keepIframeSrcFn:P,enableStrictPrivacy:F});if(!U)return console.warn(e,"not serialized"),null;r="__sn"in e?e.__sn.id:!function(e,n){if(n.comment&&e.type===t.Comment)return!0;if(e.type===t.Element){if(n.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(k(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===k(e.attributes.name)||"icon"===k(e.attributes.rel)||"apple-touch-icon"===k(e.attributes.rel)||"shortcut icon"===k(e.attributes.rel))))return!0;if("meta"===e.tagName){if(n.headMetaDescKeywords&&k(e.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(k(e.attributes.property).match(/^(og|twitter|fb):/)||k(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===k(e.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===k(e.attributes.name)||"googlebot"===k(e.attributes.name)||"bingbot"===k(e.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===k(e.attributes.name)||"generator"===k(e.attributes.name)||"framework"===k(e.attributes.name)||"publisher"===k(e.attributes.name)||"progid"===k(e.attributes.name)||k(e.attributes.property).match(/^article:/)||k(e.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===k(e.attributes.name)||"yandex-verification"===k(e.attributes.name)||"csrf-token"===k(e.attributes.name)||"p:domain_verify"===k(e.attributes.name)||"verify-v1"===k(e.attributes.name)||"verification"===k(e.attributes.name)||"shopify-checkout-api-token"===k(e.attributes.name)))return!0}}return!1}(U,T)&&(j||U.type!==t.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?f++:-2;var z=Object.assign(U,{id:r});if(e.__sn=z,-2===r)return null;i[r]=e,_&&_(e);var B=!h;if(z.type===t.Element){if(B=B&&!z.needBlock,z.needBlock&&"img"===z.tagName){var V=e.cloneNode();V.src="",i[r]=V}delete z.needBlock,e.shadowRoot&&(z.isShadowHost=!0)}if((z.type===t.Document||z.type===t.Element)&&B){T.headWhitespace&&U.type===t.Element&&"head"===U.tagName&&(j=!1);for(var H={doc:o,map:i,blockClass:l,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:h,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:S,slimDOMOptions:T,dataURLOptions:x,inlineImages:I,recordCanvas:R,preserveWhiteSpace:j,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:D,keepIframeSrcFn:P,enableStrictPrivacy:F},G=0,Y=Array.from(e.childNodes);G<Y.length;G++){(Q=N(Y[G],H))&&z.childNodes.push(Q)}if(a(e)&&e.shadowRoot)for(var X=0,q=Array.from(e.shadowRoot.childNodes);X<q.length;X++){var Q;(Q=N(q[X],H))&&(Q.isShadow=!0,z.childNodes.push(Q))}}return e.parentNode&&s(e.parentNode)&&(z.isShadow=!0),z.type===t.Element&&"iframe"===z.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&A){var n=N(t,{doc:t,map:i,blockClass:l,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:S,slimDOMOptions:T,dataURLOptions:x,inlineImages:I,recordCanvas:R,preserveWhiteSpace:j,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:D,keepIframeSrcFn:P,enableStrictPrivacy:F});n&&A(e,n)}}),D),z}var R=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function _(e,t){void 0===t&&(t={});var n=1,r=1;function o(e){var t=e.match(/\n/g);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function i(){var e={line:n,column:r};return function(t){return t.position=new a(e),f(),t}}var a=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};a.prototype.content=e;var s=[];function l(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;s.push(i)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){var t,n=[];for(f(),h(n);e.length&&"}"!==e.charAt(0)&&(t=I()||C());)!1!==t&&(n.push(t),h(n));return n}function p(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function f(){p(/^\s*/)}function h(e){var t;for(void 0===e&&(e=[]);t=m();)!1!==t&&e.push(t),t=m();return e}function m(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");var a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function v(){var e=p(/^([^{]+)/);if(e)return A(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function y(){var e=i(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=A(t[0]);if(!p(/^:\s*/))return l("property missing ':'");var r=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(R,""),value:r?A(r[0]).replace(R,""):""});return p(/^[;\s]*/),o}}function g(){var e,t=[];if(!c())return l("missing '{'");for(h(t);e=y();)!1!==e&&(t.push(e),h(t)),e=y();return u()?t:l("missing '}'")}function b(){for(var e,t=[],n=i();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:g()})}var S,T=E("import"),w=E("charset"),x=E("namespace");function E(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=i(),r=p(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function I(){if("@"===e[0])return function(){var e=i(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=p(/^([-\w]+)\s*/)))return l("@keyframes missing name");var r,o=t[1];if(!c())return l("@keyframes missing '{'");for(var a=h();r=b();)a.push(r),a=a.concat(h());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:a}):l("@keyframes missing '}'")}}()||function(){var e=i(),t=p(/^@media *([^{]+)/);if(t){var n=A(t[1]);if(!c())return l("@media missing '{'");var r=h().concat(d());return u()?e({type:"media",media:n,rules:r}):l("@media missing '}'")}}()||function(){var e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:A(t[1]),media:A(t[2])})}()||function(){var e=i(),t=p(/^@supports *([^{]+)/);if(t){var n=A(t[1]);if(!c())return l("@supports missing '{'");var r=h().concat(d());return u()?e({type:"supports",supports:n,rules:r}):l("@supports missing '}'")}}()||T()||w()||x()||function(){var e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var n=A(t[1]),r=A(t[2]);if(!c())return l("@document missing '{'");var o=h().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):l("@document missing '}'")}}()||function(){var e=i();if(p(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var n,r=h();n=y();)r.push(n),r=r.concat(h());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}}()||function(){var e=i();if(p(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=h().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=i();if(p(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,n=h();t=y();)n.push(t),n=n.concat(h());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}}()}function C(){var e=i(),t=v();return t?(h(),e({type:"rule",selectors:t,declarations:g()})):l("selector missing")}return O((S=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:s}}))}function A(e){return e?e.replace(/^\s+|\s+$/g,""):""}function O(e,t){for(var n=e&&"string"==typeof e.type,r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=e[i[o]];Array.isArray(a)?a.forEach((function(e){O(e,r)})):a&&"object"==typeof a&&O(a,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var D={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var L,P,F,W,j,U,z=/([^\\]):hover/,B=new RegExp(z.source,"g");function V(e,t){var n;if(!(null===(n=window.HIG_CONFIGURATION)||void 0===n?void 0:n.enableOnHoverClass))return e;var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var o=_(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){z.test(e)&&i.push(e)}))})),0===i.length)return e;var a=new RegExp(i.filter((function(e,t){return i.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),s=e.replace(a,(function(e){var t=e.replace(B,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,s),s}function H(){return{stylesWithHoverClass:new Map}}function G(e,n){var r=n.doc,o=n.hackCss,i=n.cache;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var a,s=function(e){var t=D[e.tagName]?D[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);a=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",s):r.createElement(s);var l=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if("option"===s&&"selected"===t&&!1===n)return"continue";if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===t){var l=document.createElement("img");l.src=n,l.onload=function(){var e=a.getContext("2d");e&&e.drawImage(l,0,0,l.width,l.height)}}else if("img"===s&&"rr_dataURL"===t){var c=a;c.currentSrc.startsWith("data:")||(c.setAttribute("rrweb-original-src",e.attributes.src),c.src=n)}if("rr_width"===t)a.style.width=n;else if("rr_height"===t)a.style.height=n;else if("rr_mediaCurrentTime"===t)a.currentTime=e.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===t)switch(n){case"played":a.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":a.pause()}}else{var u="textarea"===s&&"value"===t,d="style"===s&&"_cssText"===t;if(d&&o&&"string"==typeof(n=V(n,i))){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,f=void 0,h=[];null!==(f=p.exec(n));)f.index===p.lastIndex&&p.lastIndex++,f.forEach((function(e,t){if(0===t){var n=e.slice(5,e.length-2);h.push({originalUrl:n,proxyUrl:n.replace(n,"https://replay-cors-proxy.highlightrun.workers.dev?url="+n)})}}));h.forEach((function(e){n=n.replace(e.originalUrl,e.proxyUrl)}))}if(u||d){for(var m=r.createTextNode(n),v=0,y=Array.from(a.childNodes);v<y.length;v++){var g=y[v];g.nodeType===a.TEXT_NODE&&a.removeChild(g)}return a.appendChild(m),"continue"}try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,n);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,n);else{if("meta"===s&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return a.setAttribute("csp-content",n),"continue";"link"===s&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===s&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===s&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(t,n))}}catch(e){}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case t.Text:return r.createTextNode(e.isStyle&&o?V(e.textContent,i):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function Y(e,n){var r=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,l=n.hackCss,c=void 0===l||l,u=n.afterAppend,d=n.cache,p=G(e,{doc:r,hackCss:c,cache:d});if(!p)return null;if(e.rootId&&console.assert(o[e.rootId]===r,"Target document should has the same root id."),e.type===t.Document&&(r.close(),r.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==t.DocumentType&&(e.childNodes[0].type===t.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),p=r),p.__sn=e,o[e.id]=p,(e.type===t.Document||e.type===t.Element)&&!s)for(var f=0,h=e.childNodes;f<h.length;f++){var m=h[f],v=Y(m,{doc:r,map:o,skipChild:!1,hackCss:c,afterAppend:u,cache:d});v?(m.isShadow&&a(p)&&p.shadowRoot?p.shadowRoot.appendChild(v):p.appendChild(v),u&&u(v)):console.warn("Failed to rebuild",m)}return p}function X(e,n){var r=n.doc,o=n.onVisit,i=n.hackCss,a={},s=Y(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:n.afterAppend,cache:n.cache});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){o&&o(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var o in n.attributes)if(n.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(r.scrollLeft=i),"rr_scrollTop"===o&&(r.scrollTop=i)}}}(e)})),[s,a]}function q(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function Q(){return{map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}e.EventType=void 0,(L=e.EventType||(e.EventType={}))[L.DomContentLoaded=0]="DomContentLoaded",L[L.Load=1]="Load",L[L.FullSnapshot=2]="FullSnapshot",L[L.IncrementalSnapshot=3]="IncrementalSnapshot",L[L.Meta=4]="Meta",L[L.Custom=5]="Custom",L[L.Plugin=6]="Plugin",e.IncrementalSource=void 0,(P=e.IncrementalSource||(e.IncrementalSource={}))[P.Mutation=0]="Mutation",P[P.MouseMove=1]="MouseMove",P[P.MouseInteraction=2]="MouseInteraction",P[P.Scroll=3]="Scroll",P[P.ViewportResize=4]="ViewportResize",P[P.Input=5]="Input",P[P.TouchMove=6]="TouchMove",P[P.MediaInteraction=7]="MediaInteraction",P[P.StyleSheetRule=8]="StyleSheetRule",P[P.CanvasMutation=9]="CanvasMutation",P[P.Font=10]="Font",P[P.Log=11]="Log",P[P.Drag=12]="Drag",P[P.StyleDeclaration=13]="StyleDeclaration",e.MouseInteractions=void 0,(F=e.MouseInteractions||(e.MouseInteractions={}))[F.MouseUp=0]="MouseUp",F[F.MouseDown=1]="MouseDown",F[F.Click=2]="Click",F[F.ContextMenu=3]="ContextMenu",F[F.DblClick=4]="DblClick",F[F.Focus=5]="Focus",F[F.Blur=6]="Blur",F[F.TouchStart=7]="TouchStart",F[F.TouchMove_Departed=8]="TouchMove_Departed",F[F.TouchEnd=9]="TouchEnd",F[F.TouchCancel=10]="TouchCancel",function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(W||(W={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(j||(j={})),e.ReplayerEvents=void 0,(U=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",U.Pause="pause",U.Resume="resume",U.Resize="resize",U.Finish="finish",U.FullsnapshotRebuilded="fullsnapshot-rebuilded",U.LoadStylesheetStart="load-stylesheet-start",U.LoadStylesheetEnd="load-stylesheet-end",U.SkipStart="skip-start",U.SkipEnd="skip-end",U.MouseInteraction="mouse-interaction",U.EventCast="event-cast",U.CustomEvent="custom-event",U.Flush="flush",U.StateChange="state-change",U.PlayBack="play-back";var $="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";function K(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),l=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(l,c)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,c)}),s))}}function J(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return J(e,t,i||{},!0)}}function Z(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function ee(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function te(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}e.mirror={map:{},getId:function(){return console.error($),-1},getNode:function(){return console.error($),null},removeNodeFromMap:function(){console.error($)},has:function(){return console.error($),!1},reset:function(){console.error($)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(e.mirror=new Proxy(e.mirror,{get:function(e,t,n){return"map"===t&&console.error($),Reflect.get(e,t,n)}}));var ne=function(e){try{if(e instanceof HTMLElement)return"CANVAS"===e.tagName}catch(e){return!1}return!1};function re(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||re(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,re(e.parentNode,t)}function oe(e){return"__sn"in e&&-2===e.__sn.id}function ie(e,t){if(s(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ie(e.parentNode,t))}function ae(e){return Boolean(e.changedTouches)}function se(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=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})}var le=function(){function t(){this.reset()}return t.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},t.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){n.removeIdSet.add(e);var r=t.getNode(e);null==r||r.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var r=n.indexes.get(t.id);if(r){var o=r.parent;o&&(delete r.parent,delete o.children[r.id],n.indexes.delete(e.id))}};o?r?(delete o.parent,delete r.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},t.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},t.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},t.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},t.prototype.input=function(e){this.inputMap.set(e.id,e)},t.prototype.flush=function(){var t,n,o,i,a=this,s=this,l=s.tree,c=s.removeNodeMutations,u=s.textMutations,d=s.attributeMutations,p={source:e.IncrementalSource.Mutation,removes:c,texts:u,attributes:d,adds:[]},f=function(e,t){t&&a.removeIdSet.add(e.id),p.texts=p.texts.concat(t?[]:e.texts).filter((function(e){return!a.removeIdSet.has(e.id)})),p.attributes=p.attributes.concat(t?[]:e.attributes).filter((function(e){return!a.removeIdSet.has(e.id)})),a.removeIdSet.has(e.id)||a.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(p.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(l).forEach((function(e){return f(e,!1)}));try{for(var h=r(this.scrollMap.keys()),m=h.next();!m.done;m=h.next()){var v=m.value;this.removeIdSet.has(v)&&this.scrollMap.delete(v)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}try{for(var y=r(this.inputMap.keys()),g=y.next();!g.done;g=y.next()){v=g.value;this.removeIdSet.has(v)&&this.inputMap.delete(v)}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}var b=new Map(this.scrollMap),S=new Map(this.inputMap);return this.reset(),{mutationData:p,scrollMap:b,inputMap:S}},t.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},t.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},t}();function ce(e){var t,n,o={},i=function(e,t){var n={value:e,parent:t,children:[]};return o[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in o){var p=o[u];if(p.parent){var f=p.parent.children.indexOf(p);p.parent.children.splice(f,0,i(c,p.parent))}else{f=a.indexOf(p);a.splice(f,0,i(c,null))}}else if(d in o){var h=o[d];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function ue(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)ue(e.children[n],t)}function de(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function pe(e,t){var n,r,o=null===(r=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var i=o.getBoundingClientRect(),a=pe(o,t),s=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function fe(e){return Boolean(null==e?void 0:e.shadowRoot)}var he=Object.freeze({__proto__:null,on:q,createMirror:Q,get _mirror(){return e.mirror},throttle:K,hookSetter:J,patch:Z,getWindowHeight:ee,getWindowWidth:te,isCanvasNode:ne,isBlocked:re,isIgnored:oe,isAncestorRemoved:ie,isTouchEvent:ae,polyfill:se,TreeIndex:le,queueToResolveTrees:ce,iterateResolveTree:ue,isIframeINode:de,getBaseDimension:pe,hasShadowRoot:fe});function me(e){return"__ln"in e}var ve=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&me(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&me(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),ye=function(e,t){return"".concat(e,"@").concat(t)};function ge(e){return"__sn"in e}var be=function(){function e(){var e=this;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=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,n,o,i;if(!e.frozen&&!e.locked){for(var a=[],l=new ve,c=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},d=function(t){for(var n,r,o,i,u,d=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,p=d;null===(o=null===(r=null==p?void 0:p.getRootNode)||void 0===r?void 0:r.call(p))||void 0===o?void 0:o.host;)p=(null===(u=null===(i=null==p?void 0:p.getRootNode)||void 0===i?void 0:i.call(p))||void 0===u?void 0:u.host)||null;var f=!(e.doc.contains(t)||null!==p&&e.doc.contains(p));if(t.parentNode&&!f){var h=s(t.parentNode)?e.mirror.getId(d):e.mirror.getId(t.parentNode),m=c(t);if(-1===h||-1===m)return l.addNode(t);var v=N(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,enableStrictPrivacy:e.enableStrictPrivacy,onSerialize:function(n){de(n)&&e.iframeManager.addIframe(n),fe(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:h,nextId:m,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var p=r(e.movedSet),f=p.next();!f.done;f=p.next()){var h=f.value;Te(e.removes,h,e.mirror)&&!e.movedSet.has(h.parentNode)||d(h)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{for(var m=r(e.addedSet),v=m.next();!v.done;v=m.next()){h=v.value;we(e.droppedSet,h)||Te(e.removes,h,e.mirror)?we(e.movedSet,h)?d(h):e.droppedSet.add(h):d(h)}}catch(e){o={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}for(var y=null;l.length;){var g=null;if(y){var b=e.mirror.getId(y.value.parentNode),S=c(y.value);-1!==b&&-1!==S&&(g=y)}if(!g)for(var T=l.length-1;T>=0;T--){var w=l.get(T);if(w){b=e.mirror.getId(w.value.parentNode),S=c(w.value);if(-1!==b&&-1!==S){g=w;break}}}if(!g){for(;l.head;)l.removeNode(l.head.value);break}y=g.previous,l.removeNode(g.value),d(g.value)}var x={texts:e.texts.map((function(t){var n=t.value;return e.enableStrictPrivacy&&n&&(n=u(n)),{id:e.mirror.getId(t.node),value:n}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(x.texts.length||x.attributes.length||x.removes.length||x.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(x))}},this.processMutation=function(t){var n,o,i,a;if(!oe(t.target))switch(t.type){case"characterData":var c=t.target.textContent;re(t.target,e.blockClass)||c===t.oldValue||e.texts.push({value:C(t.target,e.maskTextClass,e.maskTextSelector)&&c?e.maskTextFn?e.maskTextFn(c):c.replace(/[\S]/g,"*"):c,node:t.target});break;case"attributes":var u=t.target;c=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(c=l({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:c,maskInputFn:e.maskInputFn})),re(t.target,e.blockClass)||c===t.oldValue)return;var d=e.attributes.find((function(e){return e.node===t.target}));if(d||(d={node:t.target,attributes:{}},e.attributes.push(d)),"style"===t.attributeName){var p=e.doc.createElement("span");t.oldValue&&p.setAttribute("style",t.oldValue),void 0!==d.attributes.style&&null!==d.attributes.style||(d.attributes.style={});var f=d.attributes.style;try{for(var h=r(Array.from(u.style)),m=h.next();!m.done;m=h.next()){var v=m.value,y=u.style.getPropertyValue(v),g=u.style.getPropertyPriority(v);y===p.style.getPropertyValue(v)&&g===p.style.getPropertyPriority(v)||(f[v]=""===g?y:[y,g])}}catch(e){n={error:e}}finally{try{m&&!m.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}try{for(var b=r(Array.from(p.style)),S=b.next();!S.done;S=b.next()){v=S.value;""===u.style.getPropertyValue(v)&&(f[v]=!1)}}catch(e){i={error:e}}finally{try{S&&!S.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}}else{if("INPUT"===t.target.tagName){var T=t.target;if("password"===T.type){d.attributes.value="*".repeat(T.value.length);break}}d.attributes[t.attributeName]=I(e.doc,t.target.tagName,t.attributeName,c)}break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=s(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);re(t.target,e.blockClass)||oe(n)||(e.addedSet.has(n)?(Se(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ie(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[ye(r,o)]?Se(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!s(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!re(n,e.blockClass)){if(ge(t)){if(oe(t))return;e.movedSet.add(t);var r=null;n&&ge(n)&&(r=n.__sn.id),r&&(e.movedMap[ye(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);re(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function Se(e,t){e.delete(t),t.childNodes.forEach((function(t){return Se(e,t)}))}function Te(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Te(e,r,n)}function we(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||we(e,n))}var xe=[],Ee="undefined"!=typeof CSSGroupingRule,Ie="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Me="undefined"!=typeof CSSConditionRule;function ke(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Ne(e,t){var n,r,o=new be;xe.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Re(t){var n=t.mouseInteractionCb,r=t.doc,o=t.mirror,i=t.blockClass,a=t.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[];return Object.keys(e.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(t){var a=t.toLowerCase(),s=function(t){return function(r){var a=ke(r);if(!re(a,i)&&!ne(a)){var s=ae(r)?r.changedTouches[0]:r;if(s){var l=o.getId(a),c=s.clientX,u=s.clientY;n({type:e.MouseInteractions[t],id:l,x:c,y:u})}}}}(t);l.push(q(a,s,r))})),function(){l.forEach((function(e){return e()}))}}function _e(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass;return q("scroll",K((function(e){var i=ke(e);if(i&&!re(i,o)){var a=r.getId(i);if(i===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),n)}function Ae(e,t){var r=n({},e);return t||delete r.userTriggered,r}var Oe=["INPUT","TEXTAREA","SELECT"],De=new WeakMap;function Le(e){return function(e,t){if(Ee&&e.parentRule instanceof CSSGroupingRule||Ie&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Me&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Pe(t,a){var s,c;void 0===a&&(a={});var u=t.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,l=e.viewportResizeCb,c=e.inputCb,u=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,i([],o(e),!1)),n.apply(void 0,i([],o(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i([],o(e),!1)),r.apply(void 0,i([],o(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],o(e),!1)),a.apply(void 0,i([],o(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i([],o(e),!1)),s.apply(void 0,i([],o(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i([],o(e),!1)),l.apply(void 0,i([],o(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i([],o(e),!1)),c.apply(void 0,i([],o(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],o(e),!1)),u.apply(void 0,i([],o(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],o(e),!1)),d.apply(void 0,i([],o(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],o(e),!1)),p.apply(void 0,i([],o(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i([],o(e),!1)),f.apply(void 0,i([],o(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i([],o(e),!1)),h.apply(void 0,i([],o(e),!1))}}(t,a);var d=Ne(t,t.doc),p=function(t){var n=t.mousemoveCb,r=t.sampling,o=t.doc,i=t.mirror;if(!1===r.mousemove)return function(){};var a,s="number"==typeof r.mousemove?r.mousemove:50,l="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,c=[],u=K((function(e){var t=Date.now()-a;n(c.map((function(e){return e.timeOffset-=t,e})),e),c=[],a=null}),l),d=K((function(t){var n=ke(t),r=ae(t)?t.changedTouches[0]:t,o=r.clientX,s=r.clientY;a||(a=Date.now()),c.push({x:o,y:s,id:i.getId(n),timeOffset:Date.now()-a}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?e.IncrementalSource.Drag:t instanceof MouseEvent?e.IncrementalSource.MouseMove:e.IncrementalSource.TouchMove)}),s,{trailing:!1}),p=[q("mousemove",d,o),q("touchmove",d,o),q("drag",d,o)];return function(){p.forEach((function(e){return e()}))}}(t),f=Re(t),h=_e(t),m=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return q("resize",K((function(){var e=ee(),o=te();n===e&&r===o||(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}(t),v=function(e){var t=e.inputCb,r=e.doc,a=e.mirror,s=e.blockClass,c=e.ignoreClass,u=e.maskInputOptions,d=e.maskInputFn,p=e.sampling,f=e.userTriggeredOnInput;function h(e){var t=ke(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Oe.indexOf(t.tagName)<0)&&!re(t,s)){var o=t.type;if(!t.classList.contains(c)){var i=t.value,a=!1;"radio"===o||"checkbox"===o?a=t.checked:(u[t.tagName.toLowerCase()]||u[o])&&(i=l({maskInputOptions:u,tagName:t.tagName,type:o,value:i,maskInputFn:d})),m(t,Ae({text:i,isChecked:a,userTriggered:n},f));var p=t.name;"radio"===o&&p&&a&&r.querySelectorAll('input[type="radio"][name="'.concat(p,'"]')).forEach((function(e){e!==t&&m(e,Ae({text:e.value,isChecked:!a,userTriggered:!1},f))}))}}}function m(e,r){var o=De.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){De.set(e,r);var i=a.getId(e);t(n(n({},r),{id:i}))}}var v=("last"===p.input?["change"]:["input","change"]).map((function(e){return q(e,h,r)})),y=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),g=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return y&&y.set&&v.push.apply(v,i([],o(g.map((function(e){return J(e[0],e[1],{set:function(){h({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(t),y=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,o=e.sampling,i=function(e){return K((function(o){var i=ke(o);if(i&&!re(i,n)){var a=i,s=a.currentTime,l=a.volume,c=a.muted;t({type:e,id:r.getId(i),currentTime:s,volume:l,muted:c})}}),o.media||500)},a=[q("play",i(0)),q("pause",i(1)),q("seeked",i(2)),q("volumechange",i(3))];return function(){a.forEach((function(e){return e()}))}}(t),g=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var o=r.getId(this.ownerNode);return-1!==o&&n({id:o,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var l=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=r.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),l.apply(this,arguments)};var c={};Ee?c.CSSGroupingRule=a.CSSGroupingRule:(Ie&&(c.CSSMediaRule=a.CSSMediaRule),Me&&(c.CSSConditionRule=a.CSSConditionRule),Ce&&(c.CSSSupportsRule=a.CSSSupportsRule));var u={};return Object.entries(c).forEach((function(e){var t=o(e,2),a=t[0],s=t[1];u[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=r.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:i(i([],o(Le(this)),!1),[t||0],!1)}]}),u[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=r.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:i(i([],o(Le(this)),!1),[e],!1)}]}),u[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=l,Object.entries(c).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];r.prototype.insertRule=u[n].insertRule,r.prototype.deleteRule=u[n].deleteRule}))}}(t,{win:u}),b=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=t.win,i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(e,t,o){var a,s,l=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==l&&n({id:l,set:{property:e,value:t,priority:o},index:Le(this.parentRule)}),i.apply(this,arguments)};var a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,o,i=r.getId(null===(o=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==i&&n({id:i,remove:{property:e},index:Le(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(t,{win:u}),S=t.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Z(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),function(){o.forEach((function(e){return e()}))}}(t):function(){},T=[];try{for(var w=r(t.plugins),x=w.next();!x.done;x=w.next()){var E=x.value;T.push(E.observer(E.callback,u,E.options))}}catch(e){s={error:e}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}return function(){xe.forEach((function(e){return e.reset()})),d.disconnect(),p(),f(),h(),m(),v(),y(),g(),b(),S(),T.forEach((function(e){return e()}))}}var Fe=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),We=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Z(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,t){Ne(n(n({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),_e(n(n({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Z(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ue="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ze=0;ze<je.length;ze++)Ue[je.charCodeAt(ze)]=ze;var Be=new Map;var Ve=function(e,t,n){if(e&&(Ye(e,t)||"object"==typeof e)){var r=function(e,t){var n=Be.get(e);return n||(n=new Map,Be.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function He(e,t,n){return e instanceof Array?e.map((function(e){return He(e,t,n)})):null===e?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=je[n[t]>>2],o+=je[(3&n[t])<<4|n[t+1]>>4],o+=je[(15&n[t+1])<<2|n[t+2]>>6],o+=je[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]}:Ye(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:Ve(e,t,n)}:e}var Ge=function(e,t,n){return i([],o(e),!1).map((function(e){return He(e,t,n)}))},Ye=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function Xe(e,t,n,a,s,l){var c,u,d=[],p=Object.getOwnPropertyNames(e),f=function(r){try{if("function"!=typeof e[r])return"continue";var c=Z(e,r,(function(c){return function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];var p=c.apply(this,u);if(Ve(p,l,e),!re(this.canvas,a)){s.getId(this.canvas);var f=Ge(i([],o(u),!1),l,e),h={type:t,property:r,args:f};n(this.canvas,h)}return p}}));d.push(c)}catch(o){var u=J(e,r,{set:function(e){n(this.canvas,{type:t,property:r,args:[e],setter:!0})}});d.push(u)}};try{for(var h=r(p),m=h.next();!m.done;m=h.next()){f(m.value)}}catch(e){c={error:e}}finally{try{m&&!m.done&&(u=h.return)&&u.call(h)}finally{if(c)throw c.error}}return d}var qe,Qe,$e=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=function(e,t){var n=[];try{var r=Z(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return re(this,t)||"__context"in this||(this.__context=n),e.apply(this,i([n],o(r),!1))}}));n.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,n,a){var s,l,c=[],u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(r){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[r])return"continue";var a=Z(t.CanvasRenderingContext2D.prototype,r,(function(t){return function(){for(var a=this,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return re(this.canvas,n)||setTimeout((function(){var t=i([],o(s),!1);if("drawImage"===r&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],l=n.getContext("2d"),c=null==l?void 0:l.getImageData(0,0,n.width,n.height),u=null==c?void 0:c.data;t[0]=JSON.stringify(u)}e(a.canvas,{type:W["2D"],property:r,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(n){var s=J(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:W["2D"],property:r,args:[t],setter:!0})}});c.push(s)}};try{for(var p=r(u),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,r){var a=[];return a.push.apply(a,i([],o(Xe(t.WebGLRenderingContext.prototype,W.WebGL,e,n,r,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],o(Xe(t.WebGL2RenderingContext.prototype,W.WebGL2,e,n,r,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){return e.type,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"])})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Ke(e){return n(n({},e),{timestamp:Date.now()})}var Je={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ze(t){void 0===t&&(t={});var i=t.emit,a=t.checkoutEveryNms,s=t.checkoutEveryNth,l=t.blockClass,c=void 0===l?"highlight-block":l,u=t.blockSelector,d=void 0===u?null:u,p=t.ignoreClass,f=void 0===p?"highlight-ignore":p,h=t.maskTextClass,m=void 0===h?"highlight-mask":h,v=t.maskTextSelector,y=void 0===v?null:v,g=t.inlineStylesheet,b=void 0===g||g,S=t.maskAllInputs,T=t.maskInputOptions,w=t.slimDOMOptions,x=t.maskInputFn,E=t.maskTextFn,I=t.hooks,C=t.packFn,M=t.sampling,k=void 0===M?{}:M,R=t.mousemoveWait,_=t.recordCanvas,A=void 0!==_&&_,O=t.userTriggeredOnInput,D=void 0!==O&&O,L=t.collectFonts,P=void 0!==L&&L,F=t.inlineImages,W=void 0!==F&&F,j=t.plugins,U=t.keepIframeSrcFn,z=void 0===U?function(){return!1}:U,B=t.enableStrictPrivacy,V=void 0!==B&&B;if(!i)throw new Error("emit function is required");void 0!==R&&void 0===k.mousemove&&(k.mousemove=R);var H,G=!0===S?{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}:void 0!==T?T:{password:!0},Y=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};se();var X=0;qe=function(t,n){var o;if(!(null===(o=xe[0])||void 0===o?void 0:o.isFrozen())||t.type===e.EventType.FullSnapshot||t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.Mutation||xe.forEach((function(e){return e.unfreeze()})),i(function(e){var t,n;try{for(var o=r(j||[]),i=o.next();!i.done;i=o.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return C&&(e=C(e)),e}(t),n),t.type===e.EventType.FullSnapshot)H=t,X=0;else if(t.type===e.EventType.IncrementalSnapshot){if(t.data.source===e.IncrementalSource.Mutation&&t.data.isAttachIframe)return;X++;var l=s&&X>=s,c=a&&t.timestamp-H.timestamp>a;(l||c)&&Qe(!0)}};var Q=function(t){qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Mutation},t)}))},$=function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Scroll},t)}))},K=function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.CanvasMutation},t)}))},J=new Fe({mutationCb:Q}),Z=new $e({recordCanvas:A,mutationCb:K,win:window,blockClass:c,mirror:Je}),ne=new We({mutationCb:Q,scrollCb:$,bypassOptions:{blockClass:c,blockSelector:d,maskTextClass:m,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:G,maskTextFn:E,maskInputFn:x,recordCanvas:A,inlineImages:W,sampling:k,slimDOMOptions:Y,iframeManager:J,canvasManager:Z,enableStrictPrivacy:V},mirror:Je});Qe=function(t){var n,r,i,a;void 0===t&&(t=!1),qe(Ke({type:e.EventType.Meta,data:{href:window.location.href,width:te(),height:ee()}}),t),xe.forEach((function(e){return e.lock()}));var s=o(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"highlight-block":r,i=n.blockSelector,a=void 0===i?null:i,s=n.maskTextClass,l=void 0===s?"highlight-mask":s,c=n.maskTextSelector,u=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,m=n.recordCanvas,v=void 0!==m&&m,y=n.maskAllInputs,g=void 0!==y&&y,b=n.maskTextFn,S=n.maskInputFn,T=n.slimDOM,w=void 0!==T&&T,x=n.dataURLOptions,E=n.preserveWhiteSpace,I=n.onSerialize,C=n.onIframeLoad,M=n.iframeLoadTimeout,k=n.keepIframeSrcFn,R=void 0===k?function(){return!1}:k,_=n.enableStrictPrivacy,A={};return[N(e,{doc:e,map:A,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===g?{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}:!1===g?{password:!0}:g,maskTextFn:b,maskInputFn:S,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:x,inlineImages:h,recordCanvas:v,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R,enableStrictPrivacy:void 0!==_&&_}),A]}(document,{blockClass:c,blockSelector:d,maskTextClass:m,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:G,maskTextFn:E,slimDOM:Y,recordCanvas:A,inlineImages:W,enableStrictPrivacy:V,onSerialize:function(e){de(e)&&J.addIframe(e),fe(e)&&ne.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),ne.observeAttachShadow(e)},keepIframeSrcFn:z}),2),l=s[0],u=s[1];if(!l)return console.warn("Failed to snapshot the document");Je.map=u,qe(Ke({type:e.EventType.FullSnapshot,data:{node:l,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(r=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),xe.forEach((function(e){return e.unlock()}))};try{var re=[];re.push(q("DOMContentLoaded",(function(){qe(Ke({type:e.EventType.DomContentLoaded,data:{}}))})));var oe=function(t){var r;return Pe({mutationCb:Q,mousemoveCb:function(t,n){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:{source:n,positions:t}}))},mouseInteractionCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:$,viewportResizeCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Input},t)}))},mediaInteractionCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MediaInteraction},t)}))},styleSheetRuleCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.StyleSheetRule},t)}))},styleDeclarationCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.StyleDeclaration},t)}))},canvasMutationCb:K,fontCb:function(t){return qe(Ke({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Font},t)}))},blockClass:c,ignoreClass:f,maskTextClass:m,maskTextSelector:y,maskInputOptions:G,inlineStylesheet:b,sampling:k,recordCanvas:A,inlineImages:W,userTriggeredOnInput:D,collectFonts:P,doc:t,maskInputFn:x,maskTextFn:E,blockSelector:d,slimDOMOptions:Y,mirror:Je,iframeManager:J,shadowDomManager:ne,canvasManager:Z,enableStrictPrivacy:V,plugins:(null===(r=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===r?void 0:r.map((function(t){return{observer:t.observer,options:t.options,callback:function(n){return qe(Ke({type:e.EventType.Plugin,data:{plugin:t.name,payload:n}}))}}})))||[]},I)};J.addLoadListener((function(e){re.push(oe(e.contentDocument))}));var ie=function(){Qe(),re.push(oe(document))};return"interactive"===document.readyState||"complete"===document.readyState?ie():re.push(q("load",(function(){qe(Ke({type:e.EventType.Load,data:{}})),ie()}),window)),function(){re.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}function et(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}Ze.addCustomEvent=function(t,n){qe&&qe(Ke({type:e.EventType.Custom,data:{tag:t,payload:n}}))},Ze.freezePage=function(){xe.forEach((function(e){return e.freeze()}))},Ze.takeFullSnapshot=function(e){if(!Qe)throw new Error("please take full snapshot after start recording");Qe(e)},Ze.mirror=Je;var tt=Object.freeze({__proto__:null,default:et});function nt(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=p(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function p(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function f(t){var n,r,o,a,s=(i()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,o=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,o),r===t.x&&o===t.y||e.requestAnimationFrame(f.bind(e,t))}function h(n,r,a){var l,c,u,d,p=i();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),f({scrollable:l,method:d,startTime:p,startX:c,startY:u,x:r,y:a})}}var rt,ot=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.replaceActions=function(e){var t;this.actions.length=0,(t=this.actions).splice.apply(t,i([0,0],o(e),!1))},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var o=performance.now();for(n.timeOffset+=(o-e)*n.speed,e=o;t.length;){var i=t[0];if(!(n.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r+1;n=r-1}}return t},e}();function it(t,n){if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove){var r=t.data.positions[0].timeOffset,o=t.timestamp+r;return t.delay=o-n,o-n}return t.delay=t.timestamp-n,t.delay}
|
|
16
|
-
/*! *****************************************************************************
|
|
17
|
-
Copyright (c) Microsoft Corporation.
|
|
18
|
-
|
|
19
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
-
purpose with or without fee is hereby granted.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */function at(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(rt||(rt={}));var st={type:"xstate.init"};function lt(e){return void 0===e?[]:[].concat(e)}function ct(e){return{type:"xstate.assign",assignment:e}}function ut(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function dt(e){return function(t){return e===t}}function pt(e){return"string"==typeof e?{type:e}:e}function ft(e,t){return{value:e,context:t,actions:[],changed:!1,matches:dt(e)}}function ht(e,t,n){var r=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},r);return"function"==typeof e.assignment?t=e.assignment(r,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](r,n):e.assignment[o]})),r=t,!1}return!0})),r,o]}function mt(e,t){void 0===t&&(t={});var n=at(ht(lt(e.states[e.initial].entry).map((function(e){return ut(e,t.actions)})),e.context,st),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:dt(e.initial)},transition:function(t,n){var r,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=pt(n),u=e.states[s];if(u.on){var d=lt(u.on[c.type]);try{for(var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=p.next();!f.done;f=p.next()){var h=f.value;if(void 0===h)return ft(s,l);var m="string"==typeof h?{target:h}:h,v=m.target,y=m.actions,g=void 0===y?[]:y,b=m.cond,S=void 0===b?function(){return!0}:b,T=void 0===v,w=null!=v?v:s,x=e.states[w];if(S(l,c)){var E=at(ht((T?lt(g):[].concat(u.exit,g,x.entry).filter((function(e){return e}))).map((function(e){return ut(e,i._options.actions)})),l,c),3),I=E[0],C=E[1],M=E[2],k=null!=v?v:s;return{value:k,context:C,actions:I,changed:v!==s||I.length>0||M,matches:dt(k)}}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}return ft(s,l)}};return i}var vt=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function yt(e){var t=e.initialState,n=rt.NotStarted,r=new Set,o={_machine:e,send:function(o){n===rt.Running&&(t=e.transition(t,o),vt(t,pt(o)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var i="object"==typeof r?r:{context:e.config.context,value:r};t={value:i.value,actions:[],context:i.context,matches:dt(i.value)}}return n=rt.Running,vt(t,st),o},stop:function(){return n=rt.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}function gt(t,o){var i=o.getCastFn,a=o.applyEventsSynchronously,s=o.emitter;return yt(mt({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ct({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:ct((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(t){var n,o,l,c,u,d=t.timer,p=t.events,f=t.baselineTime,h=t.lastPlayedEvent;d.clear();try{for(var m=r(p),v=m.next();!v.done;v=m.next()){it(v.value,f)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}var y=function(t,n){for(var r=t.length-1;r>=0;r--){var o=t[r];if(o.type===e.EventType.Meta&&o.timestamp<=n)return t.slice(r)}return t}(p,f),g=null==h?void 0:h.timestamp;(null==h?void 0:h.type)===e.EventType.IncrementalSnapshot&&h.data.source===e.IncrementalSource.MouseMove&&(g=h.timestamp+(null===(u=h.data.positions[0])||void 0===u?void 0:u.timeOffset)),f<(g||0)&&s.emit(e.ReplayerEvents.PlayBack);var b=new Array,S=new Array,T=function(e){if(g&&g<f&&(e.timestamp<=g||e===h))return"continue";if(e.timestamp<f)b.push(e);else{var t=i(e,!1);S.push({doAction:function(){t()},delay:e.delay})}};try{for(var w=r(y),x=w.next();!x.done;x=w.next()){T(x.value)}}catch(e){l={error:e}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}a(b),s.emit(e.ReplayerEvents.Flush),d.addActions(S),d.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:ct((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:ct({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),replaceEvents:ct((function(e,t){var o,a,s=e.events,l=e.timer,c=e.baselineTime;if("REPLACE_EVENTS"===t.type){var u=t.payload.events;s.length=0;var d=[],p=function(e){if(it(e,c),s.push(e),e.timestamp>=l.timeOffset+c){var t=i(e,!1);d.push({doAction:function(){t()},delay:e.delay})}};try{for(var f=r(u),h=f.next();!h.done;h=f.next()){p(h.value)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}l.isActive()&&l.replaceActions(d)}return n(n({},e),{events:s})})),addEvent:ct((function(e,t){var r=e.baselineTime,o=e.timer,a=e.events;if("ADD_EVENT"===t.type){var s=t.payload.event;it(s,r);var l=a.length-1;if(!a[l]||a[l].timestamp<=s.timestamp)a.push(s);else{for(var c=-1,u=0;u<=l;){var d=Math.floor((u+l)/2);a[d].timestamp<=s.timestamp?u=d+1:l=d-1}-1===c&&(c=u),a.splice(c,0,s)}var p=s.timestamp<r,f=i(s,p);p?f():o.isActive()&&o.addAction({doAction:function(){f()},delay:s.delay})}return n(n({},e),{events:a})}))}}))}var bt;function St(e,t){var n=e[t[0]];return 1===t.length?n:St(n.cssRules[t[1]].cssRules,t.slice(2))}function Tt(e){var t=i([],o(e),!1),n=t.pop();return{positions:t,index:n}}function wt(e,t){var n=t.sheet;n&&e.forEach((function(e){if(e.type===bt.Insert)try{if(Array.isArray(e.index)){var r=Tt(e.index),i=r.positions,a=r.index;St(n.cssRules,i).insertRule(e.cssText,a)}else n.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===bt.Remove)try{if(Array.isArray(e.index)){var s=Tt(e.index);i=s.positions,a=s.index;St(n.cssRules,i).deleteRule(a||0)}else n.deleteRule(e.index)}catch(e){}else if(e.type===bt.Snapshot)!function(e,t){var n;try{var r=Array.from((null===(n=t.sheet)||void 0===n?void 0:n.cssRules)||[]).map((function(e){return e.cssText})),i=Object.entries(r).reverse(),a=r.length;i.forEach((function(n){var r,i=o(n,2),s=i[0],l=i[1],c=e.indexOf(l);if(-1===c||c>a)try{null===(r=t.sheet)||void 0===r||r.deleteRule(Number(s))}catch(e){}a=c})),e.forEach((function(e,n){var r,o,i;try{(null===(o=null===(r=t.sheet)||void 0===r?void 0:r.cssRules[n])||void 0===o?void 0:o.cssText)!==e&&(null===(i=t.sheet)||void 0===i||i.insertRule(e,n))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===bt.SetProperty){St(n.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===bt.RemoveProperty){St(n.cssRules,e.index).style.removeProperty(e.property)}}))}!function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"}(bt||(bt={}));var xt=new Map;function Et(e,t){var n=xt.get(e);return n||(n=new Map,xt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var It=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ct(e,t){return function(n){if(n&&"object"==typeof n&&"rr_type"in n){if("index"in n){var r=n.rr_type,a=n.index;return Et(t,r)[a]}if("args"in n){var s=n.rr_type,l=n.args,c=window[s];return new(c.bind.apply(c,i([void 0],o(l.map(Ct(e,t))),!1)))}if("base64"in n)return function(e){var t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)n=Ue[e.charCodeAt(t)],r=Ue[e.charCodeAt(t+1)],o=Ue[e.charCodeAt(t+2)],i=Ue[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c}(n.base64);if("src"in n){var u=e.get(n.src);if(u)return u;var d=new Image;return d.src=n.src,e.set(n.src,d),d}}else if(Array.isArray(n))return n.map(Ct(e,t));return n}}function Mt(e){var t=e.mutation,n=e.target,r=e.type,o=e.imageMap,i=e.errorHandler;try{var a=function(e,t){try{return t===W.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(n,r);if(!a)return;if(t.setter)return void(a[t.property]=t.args[0]);var s=a[t.property],l=t.args.map(Ct(o,a));!function(e,t){if(null==t?void 0:t.constructor){var n=t.constructor.name;if(It.includes(n)){var r=Et(e,n);r.includes(t)||r.push(t)}}}(a,s.apply(a,l))}catch(e){i(t,e)}}var kt=36e5,Nt=et||tt,Rt="[replayer]",_t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function At(t){return t.type==e.EventType.IncrementalSnapshot&&(t.data.source==e.IncrementalSource.TouchMove||t.data.source==e.IncrementalSource.MouseInteraction&&t.data.type==e.MouseInteractions.TouchStart)}var Ot=function(){function a(t,n){var o=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Nt(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=H(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(null==n?void 0:n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");var i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:_t,inactiveThreshold:.02,inactiveSkipTime:2e3};this.config=Object.assign({},i,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(e.ReplayerEvents.Resize,this.handleResize),this.setupDom(),this.treeIndex=new le,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(e.ReplayerEvents.Flush,(function(){var e,t,n,i,a,s,l,c,u=o.treeIndex.flush(),d=u.scrollMap,p=u.inputMap,f=u.mutationData;o.fragmentParentMap.forEach((function(e,t){return o.restoreRealParent(t,e)}));try{for(var h=r(f.texts),m=h.next();!m.done;m=h.next()){var v=m.value;o.applyText(v,f)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var y=r(o.virtualStyleRulesMap.keys()),g=y.next();!g.done;g=y.next()){var b=g.value;o.restoreNodeSheet(b)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=y.return)&&i.call(y)}finally{if(n)throw n.error}}o.fragmentParentMap.clear(),o.elementStateMap.clear(),o.virtualStyleRulesMap.clear();try{for(var S=r(d.values()),T=S.next();!T.done;T=S.next()){v=T.value;o.applyScroll(v,!0)}}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}try{for(var w=r(p.values()),x=w.next();!x.done;x=w.next()){v=x.value;o.applyInput(v)}}catch(e){l={error:e}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}})),this.emitter.on(e.ReplayerEvents.PlayBack,(function(){o.firstFullSnapshot=null,o.mirror.reset()}));var a=new ot([],(null==n?void 0:n.speed)||i.speed);this.service=gt({events:t.map((function(e){return n&&n.unpackFn?n.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:a,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(t){o.emitter.emit(e.ReplayerEvents.StateChange,{player:t})})),this.speedService=yt(mt({id:"speed",context:{normalSpeed:-1,timer:a},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:ct({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(t){o.emitter.emit(e.ReplayerEvents.StateChange,{speed:t})}));var s=this.service.state.context.events.find((function(t){return t.type===e.EventType.Meta})),l=this.service.state.context.events.find((function(t){return t.type===e.EventType.FullSnapshot}));if(s){var c=s.data,u=c.width,d=c.height;setTimeout((function(){o.emitter.emit(e.ReplayerEvents.Resize,{width:u,height:d})}),0)}l&&setTimeout((function(){o.firstFullSnapshot||(o.firstFullSnapshot=l,o.rebuildFullSnapshot(l),o.iframe.contentWindow.scrollTo(l.data.initialOffset))}),1),this.service.state.context.events.find(At)&&this.mouse.classList.add("touch-device")}return Object.defineProperty(a.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),a.prototype.on=function(e,t){return this.emitter.on(e,t),this},a.prototype.off=function(e,t){return this.emitter.off(e,t),this},a.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},a.prototype.getActivityIntervals=function(){var e=this;if(0==this.activityIntervals.length){for(var t=[],n=this.getMetaData(),r=i(i([{timestamp:n.startTime}],o(this.service.state.context.events.filter((function(t){return e.isUserInteraction(t)}))),!1),[{timestamp:n.endTime}],!1),a=1;a<r.length;a++){var s=r[a-1],l=r[a];l.timestamp-s.timestamp>1e4?t.push({startTime:s.timestamp,endTime:l.timestamp,duration:l.timestamp-s.timestamp,active:!1}):t.push({startTime:s.timestamp,endTime:l.timestamp,duration:l.timestamp-s.timestamp,active:!0})}var c=[],u=t[0];for(a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(c.push({startTime:u.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-u.startTime,active:t[a-1].active}),u=t[a]);u&&t.length>0&&c.push({startTime:u.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-u.startTime,active:t[t.length-1].active}),u=c[0];for(a=1;a<c.length;a++)(!c[a].active&&c[a].duration>this.config.inactiveThreshold*n.totalTime||!c[a-1].active&&c[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:u.startTime,endTime:c[a-1].endTime,duration:c[a-1].endTime-u.startTime,active:c[a-1].active}),u=c[a]);u&&c.length>0&&this.activityIntervals.push({startTime:u.startTime,endTime:c[c.length-1].endTime,duration:c[c.length-1].endTime-u.startTime,active:c[c.length-1].active})}return this.activityIntervals},a.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},a.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},a.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},a.prototype.getMirror=function(){return this.mirror},a.prototype.play=function(t){var n;void 0===t&&(t=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}}),null===(n=this.iframe.contentDocument)||void 0===n||n.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)},a.prototype.pause=function(t){var n;void 0===t&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof t&&(this.play(t),this.service.send({type:"PAUSE"})),null===(n=this.iframe.contentDocument)||void 0===n||n.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.Pause)},a.prototype.resume=function(t){void 0===t&&(t=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(e.ReplayerEvents.Resume)},a.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},a.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;At(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},a.prototype.replaceEvents=function(e){var t,n;try{for(var o=r(e),i=o.next();!i.done;i=o.next()){if(At(i.value)){this.mouse.classList.add("touch-device");break}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})},a.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},a.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},a.prototype.resetCache=function(){this.cache=H()},a.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(nt(this.iframe.contentWindow,this.iframe.contentDocument),se(this.iframe.contentWindow))},a.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var o=r([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},a.prototype.applyEventsSynchronously=function(t){var n,o;try{for(var i=r(t),a=i.next();!a.done;a=i.next()){var s=a.value;switch(s.type){case e.EventType.DomContentLoaded:case e.EventType.Load:case e.EventType.Custom:continue;case e.EventType.FullSnapshot:case e.EventType.Meta:case e.EventType.Plugin:break;case e.EventType.IncrementalSnapshot:switch(s.data.source){case e.IncrementalSource.MediaInteraction:continue}}this.getCastFn(s,!0)()}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},a.prototype.getCastFn=function(t,n){var o,i=this;switch(void 0===n&&(n=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Custom:o=function(){i.emitter.emit(e.ReplayerEvents.CustomEvent,t)};break;case e.EventType.Meta:o=function(){return i.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:o=function(){if(i.firstFullSnapshot){if(i.firstFullSnapshot===t)return void(i.firstFullSnapshot=!0)}else i.firstFullSnapshot=!0;i.rebuildFullSnapshot(t,n),i.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:o=function(){var o,a;if(i.applyIncremental(t,n),!n&&(i.handleInactivity(t.timestamp),t===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var s=r(i.service.state.context.events),l=s.next();!l.done;l=s.next()){var c=l.value;if(!(c.timestamp<=t.timestamp)&&i.isUserInteraction(c)){c.delay-t.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=c);break}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}if(i.nextUserInteractionEvent){var u=i.nextUserInteractionEvent.delay-t.delay,d={speed:Math.min(Math.round(u/2e3),i.config.maxSpeed)};i.speedService.send({type:"FAST_FORWARD",payload:d}),i.emitter.emit(e.ReplayerEvents.SkipStart,d)}}}}return function(){var a,s;o&&o();try{for(var l=r(i.config.plugins||[]),c=l.next();!c.done;c=l.next()){c.value.handler(t,n,{replayer:i})}}catch(e){a={error:e}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}i.service.send({type:"CAST_EVENT",payload:{event:t}});var u=i.service.state.context.events.length-1;if(t===i.service.state.context.events[u]){var d=function(){u<i.service.state.context.events.length-1||(i.backToNormal(),i.service.send("END"),i.emitter.emit(e.ReplayerEvents.Finish))};t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove&&t.data.positions.length?setTimeout((function(){d()}),Math.max(0,50-t.data.positions[0].timeOffset)):d()}i.emitter.emit(e.ReplayerEvents.EventCast,t)}},a.prototype.handleInactivity=function(t,n){var o,i;if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){try{for(var a=r(this.getActivityIntervals()),s=a.next();!s.done;s=a.next()){var l=s.value;if(t>=l.startTime&&t<l.endTime&&!l.active){this.inactiveEndTimestamp=l.endTime;break}}}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}if(this.inactiveEndTimestamp){var c=this.inactiveEndTimestamp-t,u={speed:c/kt*this.config.inactiveSkipTime<1e3?c/1e3:Math.round(Math.max(c,kt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:u}),this.emitter.emit(e.ReplayerEvents.SkipStart,u)}}},a.prototype.rebuildFullSnapshot=function(t,n){var o,i,a=this;if(void 0===n&&(n=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var s=[];this.mirror.map=X(t.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){a.collectIframeAndAttachDocument(s,e)},cache:this.cache})[1];var l=function(e,t){c.attachDocumentToIframe(e,t),c.newDocumentQueue=c.newDocumentQueue.filter((function(t){return t!==e}))},c=this;try{for(var u=r(s),d=u.next();!d.done;d=u.next()){var p=d.value;l(p.mutationInQueue,p.builtNode)}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}var f=this.iframe.contentDocument,h=f.documentElement,m=f.head;this.insertStyleRules(h,m),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},a.prototype.insertStyleRules=function(e,t){var n=document.createElement("style");e.insertBefore(n,t);var r,o=(r=this.config.blockClass,[".".concat(r," { background: currentColor }"),"noscript { display: none !important; }",".".concat(r," { background: currentColor; border-radius: 5px; }"),".".concat(r,":hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}")]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)n.sheet.insertRule(o[i],i)},a.prototype.attachDocumentToIframe=function(e,n){var o,i,a=this,s=[];if(!n.contentDocument)for(var l=n.parentNode;l;){if(this.fragmentParentMap.has(l)){var c=l,u=this.fragmentParentMap.get(c);this.restoreRealParent(c,u);break}l=l.parentNode}Y(e.node,{doc:n.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){if(a.collectIframeAndAttachDocument(s,e),e.__sn.type===t.Element&&"HTML"===e.__sn.tagName.toUpperCase()){var r=n.contentDocument,o=r.documentElement,i=r.head;a.insertStyleRules(o,i)}},cache:this.cache});var d=function(e,t){p.attachDocumentToIframe(e,t),p.newDocumentQueue=p.newDocumentQueue.filter((function(t){return t!==e}))},p=this;try{for(var f=r(s),h=f.next();!h.done;h=f.next()){var m=h.value;d(m.mutationInQueue,m.builtNode)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}},a.prototype.collectIframeAndAttachDocument=function(e,t){if(de(t)){var n=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));n&&e.push({mutationInQueue:n,builtNode:t})}},a.prototype.waitForStylesheetLoad=function(){var t,n=this,r=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.head;if(r){var o,i=new Set,a=this.service.state,s=function(){a=n.service.state};this.emitter.on(e.ReplayerEvents.Start,s),this.emitter.on(e.ReplayerEvents.Pause,s);var l=function(){n.emitter.off(e.ReplayerEvents.Start,s),n.emitter.off(e.ReplayerEvents.Pause,s)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(t){t.sheet||(i.add(t),t.addEventListener("load",(function(){i.delete(t),0===i.size&&-1!==o&&(a.matches("playing")&&n.play(n.getCurrentTime()),n.emitter.emit(e.ReplayerEvents.LoadStylesheetEnd),o&&clearTimeout(o),l())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(e.ReplayerEvents.LoadStylesheetStart),o=setTimeout((function(){a.matches("playing")&&n.play(n.getCurrentTime()),o=-1,l()}),this.config.loadTimeout))}},a.prototype.hasImageArg=function(e){var t,n;try{for(var o=r(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(a&&"object"==typeof a)if("rr_type"in a&&"args"in a){if(this.hasImageArg(a.args))return!0}else{if("rr_type"in a&&"HTMLImageElement"===a.rr_type)return!0;if(a instanceof Array&&this.hasImageArg(a))return!0}else;}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!1},a.prototype.getImageArgs=function(e){var t,n,a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value;c&&"object"==typeof c&&("rr_type"in c&&"args"in c?a.push.apply(a,i([],o(this.getImageArgs(c.args)),!1)):"rr_type"in c&&"HTMLImageElement"===c.rr_type?a.push(c.src):c instanceof Array&&a.push.apply(a,i([],o(this.getImageArgs(c)),!1)))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},a.prototype.preloadAllImages=function(){var t,n,o=this;this.service.state;var i=function(){o.service.state};this.emitter.on(e.ReplayerEvents.Start,i),this.emitter.on(e.ReplayerEvents.Pause,i);var a=function(t){t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.CanvasMutation&&("commands"in t.data?t.data.commands.forEach((function(e){return o.preloadImages(e,t)})):s.preloadImages(t.data,t))},s=this;try{for(var l=r(this.service.state.context.events),c=l.next();!c.done;c=l.next()){a(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}},a.prototype.preloadImages=function(e,t){var n=this;if("drawImage"!==e.property||"string"!=typeof e.args[0]||this.imageMap.has(t))this.hasImageArg(e.args)&&this.getImageArgs(e.args).forEach((function(e){var t=new Image;t.src=e,n.imageMap.set(e,t)}));else{var r=document.createElement("canvas"),o=r.getContext("2d"),i=null==o?void 0:o.createImageData(r.width,r.height);null==i||i.data,JSON.parse(e.args[0]),null==o||o.putImageData(i,0,0)}},a.prototype.applyIncremental=function(t,r){var o,i,a=this,s=t.data;switch(s.source){case e.IncrementalSource.Mutation:r&&(s.adds.forEach((function(e){return a.treeIndex.add(e)})),s.texts.forEach((function(e){var t=a.mirror.getNode(e.id),n=null==t?void 0:t.parentNode;n&&a.virtualStyleRulesMap.has(n)&&a.virtualStyleRulesMap.delete(n),a.treeIndex.text(e)})),s.attributes.forEach((function(e){return a.treeIndex.attribute(e)})),s.removes.forEach((function(e){return a.treeIndex.remove(e,a.mirror)})));try{this.applyMutation(s,r)}catch(e){this.warn("Exception in mutation ".concat(e.message||e),s)}break;case e.IncrementalSource.Drag:case e.IncrementalSource.TouchMove:case e.IncrementalSource.MouseMove:if(r){var l=s.positions[s.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:s}}else s.positions.forEach((function(e){var n={doAction:function(){a.moveAndHover(e.x,e.y,e.id,r,s)},delay:e.timeOffset+t.timestamp-a.service.state.context.baselineTime};a.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:t.delay-(null===(o=s.positions[0])||void 0===o?void 0:o.timeOffset)});break;case e.IncrementalSource.MouseInteraction:if(-1===s.id)break;var c=new Event(e.MouseInteractions[s.type].toLowerCase());if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:s.type,target:S});var u=this.config.triggerFocus;switch(s.type){case e.MouseInteractions.Blur:"blur"in S&&S.blur();break;case e.MouseInteractions.Focus:u&&S.focus&&S.focus({preventScroll:!0});break;case e.MouseInteractions.Click:case e.MouseInteractions.TouchStart:case e.MouseInteractions.TouchEnd:r?(s.type===e.MouseInteractions.TouchStart?this.touchActive=!0:s.type===e.MouseInteractions.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===e.MouseInteractions.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===e.MouseInteractions.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===e.MouseInteractions.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===e.MouseInteractions.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case e.MouseInteractions.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:S.dispatchEvent(c)}break;case e.IncrementalSource.Scroll:if(-1===s.id)break;if(r){this.treeIndex.scroll(s);break}this.applyScroll(s,!1);break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:s.width,height:s.height});break;case e.IncrementalSource.Input:if(-1===s.id)break;if(r){this.treeIndex.input(s);break}this.applyInput(s);break;case e.IncrementalSource.MediaInteraction:if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);var d=S;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),1===s.type&&d.pause(),0===s.type&&d.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: ".concat(e.message||e))}break;case e.IncrementalSource.StyleSheetRule:if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);var p,f=S,h=S.parentNode,m=this.fragmentParentMap.has(h),v=m?null:f.sheet;v||(this.virtualStyleRulesMap.has(S)?p=this.virtualStyleRulesMap.get(S):(p=[],this.virtualStyleRulesMap.set(S,p))),s.adds&&s.adds.forEach((function(e){var t=e.rule,n=e.index;if(v)try{if(Array.isArray(n)){var r=Tt(n),o=r.positions,i=r.index;St(v.cssRules,o).insertRule(t,i)}else{i=void 0===n?void 0:Math.min(n,v.cssRules.length);v.insertRule(t,i)}}catch(e){}else null==p||p.push({cssText:t,index:n,type:bt.Insert})})),s.removes&&s.removes.forEach((function(e){var t=e.index;if(m)null==p||p.push({index:t,type:bt.Remove});else try{if(Array.isArray(t)){var n=Tt(t),r=n.positions,o=n.index;St(v.cssRules,r).deleteRule(o||0)}else null==v||v.deleteRule(t)}catch(e){}}));break;case e.IncrementalSource.StyleDeclaration:if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);f=S;var y=S.parentNode,g=this.fragmentParentMap.has(y)?null:f.sheet,b=[];if(g||(this.virtualStyleRulesMap.has(S)?b=this.virtualStyleRulesMap.get(S):(b=[],this.virtualStyleRulesMap.set(S,b))),s.set)if(g)St(g.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority);else b.push(n({type:bt.SetProperty,index:s.index},s.set));if(s.remove)if(g)St(g.rules,s.index).style.removeProperty(s.remove.property);else b.push(n({type:bt.RemoveProperty,index:s.index},s.remove));break;case e.IncrementalSource.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var S;if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);!function(e){var t=e.event,n=e.mutation,r=e.target,o=e.imageMap,i=e.errorHandler;try{var a="commands"in n?n.commands:[n];[W.WebGL,W.WebGL2].includes(n.type)?a.forEach((function(e){Mt({mutation:e,type:n.type,target:r,imageMap:o,errorHandler:i})})):a.forEach((function(e){!function(e){var t=e.event,n=e.mutation,r=e.target,o=e.imageMap,i=e.errorHandler;try{var a=r.getContext("2d");if(n.setter)return void(a[n.property]=n.args[0]);var s=a[n.property];if("drawImage"===n.property&&"string"==typeof n.args[0]){var l=o.get(t);n.args[0]=l,s.apply(a,n.args)}else s.apply(a,n.args)}catch(e){i(n,e)}}({event:t,mutation:e,target:r,imageMap:o,errorHandler:i})}))}catch(e){i(n,e)}}({event:t,mutation:s,target:S,imageMap:this.imageMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case e.IncrementalSource.Font:try{var T=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}}},a.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n){if(e.removes.find((function(e){return e.id===t.parentId})))return;return s.warnNodeNotFound(e,t.id)}s.virtualStyleRulesMap.has(n)&&s.virtualStyleRulesMap.delete(n);var r=s.mirror.getNode(t.parentId);if(!r)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&fe(r)&&(r=r.shadowRoot),s.mirror.removeNodeFromMap(n),r){var o=null,i="__sn"in r?s.fragmentParentMap.get(r):void 0;i&&i.contains(n)?r=i:s.fragmentParentMap.has(n)&&(o=s.fragmentParentMap.get(n),s.fragmentParentMap.delete(n),n=o);try{r.removeChild(n)}catch(t){if(!(t instanceof DOMException))throw t;s.warn("parent could not remove child in mutation",r,i,n,o,e)}}}));var l=n({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var n,i,a,u;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var d=s.mirror.getNode(e.parentId);if(!d)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var p=null;s.iframe.contentDocument.contains?p=s.iframe.contentDocument.contains(d):s.iframe.contentDocument.body.contains&&(p=s.iframe.contentDocument.body.contains(d));var f=(null===(u=(a=d).getElementsByTagName)||void 0===u?void 0:u.call(a,"iframe").length)>0;if(o&&p&&!de(d)&&!f){var h=document.createDocumentFragment();for(s.mirror.map[e.parentId]=h,s.fragmentParentMap.set(h,d),s.storeState(d);d.firstChild;)h.appendChild(d.firstChild);d=h}e.node.isShadow&&(fe(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);var m=null,v=null;if(e.previousId&&(m=s.mirror.getNode(e.previousId)),e.nextId&&(v=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var y=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(de(d))s.attachDocumentToIframe(e,d);else{var g=Y(e.node,{doc:y,map:s.mirror.map,skipChild:!0,hackCss:!0,cache:s.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in d&&d.__sn.type===t.Element&&"textarea"===d.__sn.tagName&&e.node.type===t.Text)try{for(var b=r(Array.from(d.childNodes)),S=b.next();!S.done;S=b.next()){var T=S.value;T.nodeType===d.TEXT_NODE&&d.removeChild(T)}}catch(e){n={error:e}}finally{try{S&&!S.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(g,m.nextSibling);else if(v&&v.parentNode)d.contains(v)?d.insertBefore(g,v):d.insertBefore(g,null);else{if(d===y)for(;y.firstChild;)y.removeChild(y.firstChild);d.appendChild(g)}if(de(g)){var w=s.newDocumentQueue.find((function(e){return e.parentId===g.__sn.id}));w&&(s.attachDocumentToIframe(w,g),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==w})))}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,d,g,e)}else l[e.node.id]={node:g,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var p=ce(c);if(c.length=0,Date.now()-d>500){this.warn("Timeout in the loop, please check the resolve tree data:",p);break}try{for(var f=(i=void 0,r(p)),h=f.next();!h.done;h=f.next()){var m=h.value;this.mirror.getNode(m.value.parentId)?ue(m,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n){if(e.removes.find((function(e){return e.id===t.id})))return;return s.warnNodeNotFound(e,t.id)}s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n){if(e.removes.find((function(e){return e.id===t.id})))return;return s.warnNodeNotFound(e,t.id)}for(var r in s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var o=t.attributes[r];if(null===o)n.removeAttribute(r);else if("string"==typeof o)try{n.setAttribute(r,o)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===r){var i=o,a=n;for(var l in i)if(!1===i[l])a.style.removeProperty(l);else if(i[l]instanceof Array){var c=i[l];a.style.setProperty(l,c[0],c[1])}else{var u=i[l];a.style.setProperty(l,u)}}}}))},a.prototype.applyScroll=function(e,n){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else if(r.__sn.type===t.Document)r.defaultView.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=e.y,r.scrollLeft=e.x}catch(e){}},a.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},a.prototype.applyText=function(e,t){var n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(t,e.id);try{n.textContent=e.value}catch(e){}},a.prototype.legacy_resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},a.prototype.moveAndHover=function(e,t,n,r,o){var i=this.mirror.getNode(n);if(!i)return this.debugNodeNotFound(o,n);var a=pe(i,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left="".concat(s,"px"),this.mouse.style.top="".concat(l,"px"),r||this.drawMouseTail({x:s,y:l}),this.hoverElements(i)},a.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?_t:Object.assign({},_t,this.config.mouseTail),r=n.lineCap,o=n.lineWidth,i=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=r,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},a.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},a.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},a.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(e.ReplayerEvents.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},a.prototype.restoreRealParent=function(e,n){this.mirror.map[n.__sn.id]=n,n.__sn.type===t.Element&&"textarea"===n.__sn.tagName&&e.textContent&&(n.value=e.textContent),n.appendChild(e),this.restoreState(n)},a.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]}),"STYLE"===o.tagName&&function(e,t){var n;try{var r=Array.from((null===(n=e.sheet)||void 0===n?void 0:n.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:bt.Snapshot,cssTexts:r}])}catch(e){}}(o,this.virtualStyleRulesMap);var i=o.children;try{for(var a=r(Array.from(i)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},a.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},a.prototype.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&wt(t,e))},a.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '".concat(t,"' was previously removed. "),e):this.warn("Node with id '".concat(t,"' not found. "),e)},a.prototype.warnCanvasMutationFailed=function(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)},a.prototype.debugNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.debug(Rt,"Node with id '".concat(t,"' was previously removed. "),e):this.debug(Rt,"Node with id '".concat(t,"' not found. "),e)},a.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i([Rt],o(e),!1))},a.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i([Rt],o(e),!1))},a}(),Dt=Ze.addCustomEvent,Lt=Ze.freezePage;return e.Replayer=Ot,e.addCustomEvent=Dt,e.freezePage=Lt,e.record=Ze,e.utils=he,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
18
|
+
***************************************************************************** */function Tr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return a}var Me;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Me||(Me={}));var Nr={type:"xstate.init"};function gt(e){return e===void 0?[]:[].concat(e)}function ve(e){return{type:"xstate.assign",assignment:e}}function wr(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Ye(e){return function(t){return e===t}}function Er(e){return typeof e=="string"?{type:e}:e}function Cr(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Ye(e)}}function Ir(e,t,r){var n=t,o=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){o=!0;var a=Object.assign({},n);return typeof s.assignment=="function"?a=s.assignment(n,r):Object.keys(s.assignment).forEach(function(c){a[c]=typeof s.assignment[c]=="function"?s.assignment[c](n,r):s.assignment[c]}),n=a,!1}return!0}),n,o]}function Mr(e,t){t===void 0&&(t={});var r=Tr(Ir(gt(e.states[e.initial].entry).map(function(a){return wr(a,t.actions)}),e.context,Nr),2),n=r[0],o=r[1],s={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:Ye(e.initial)},transition:function(a,c){var l,i,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,m=u.context,h=Er(c),g=e.states[d];if(g.on){var f=gt(g.on[h.type]);try{for(var S=function(W){var A=typeof Symbol=="function"&&Symbol.iterator,v=A&&W[A],y=0;if(v)return v.call(W);if(W&&typeof W.length=="number")return{next:function(){return W&&y>=W.length&&(W=void 0),{value:W&&W[y++],done:!W}}};throw new TypeError(A?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),p=S.next();!p.done;p=S.next()){var b=p.value;if(b===void 0)return Cr(d,m);var T=typeof b=="string"?{target:b}:b,I=T.target,F=T.actions,O=F===void 0?[]:F,C=T.cond,E=C===void 0?function(){return!0}:C,H=I===void 0,X=I??d,Z=e.states[X];if(E(m,h)){var J=Tr(Ir((H?gt(O):[].concat(g.exit,O,Z.entry).filter(function(W){return W})).map(function(W){return wr(W,s._options.actions)}),m,h),3),B=J[0],ne=J[1],K=J[2],G=I??d;return{value:G,context:ne,actions:B,changed:I!==d||B.length>0||K,matches:Ye(G)}}}}catch(W){l={error:W}}finally{try{p&&!p.done&&(i=S.return)&&i.call(S)}finally{if(l)throw l.error}}}return Cr(d,m)}};return s}var xr=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function Dr(e){var t=e.initialState,r=Me.NotStarted,n=new Set,o={_machine:e,send:function(s){r===Me.Running&&(t=e.transition(t,s),xr(t,Er(s)),n.forEach(function(a){return a(t)}))},subscribe:function(s){return n.add(s),s(t),{unsubscribe:function(){return n.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:Ye(a.value)}}return r=Me.Running,xr(t,Nr),o},stop:function(){return r=Me.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Go=Object.defineProperty,Bo=Object.defineProperties,zo=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Ho=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Rr=(e,t,r)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t)=>{for(var r in t||(t={}))Ho.call(t,r)&&Rr(e,r,t[r]);if(kr)for(var r of kr(t))Yo.call(t,r)&&Rr(e,r,t[r]);return e},Ze=(e,t)=>Bo(e,zo(t));function Xo(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===M.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Zo(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=Mr({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ve({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:ve((s,a)=>{let c=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(c=a.payload.timeOffset),Ze(Xe({},s),{timeOffset:c,baselineTime:s.events[0].timestamp+c})}),play(s){var a;const{timer:c,events:l,baselineTime:i,lastPlayedEvent:u}=s;c.clear();for(const f of l)ft(f,i);const d=Xo(l,i);let m=u?.timestamp;u?.type===M.IncrementalSnapshot&&u.data.source===x.MouseMove&&(m=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),i<(m||0)&&n.emit(R.PlayBack);const h=new Array,g=new Array;for(const f of d)if(!(m&&m<i&&(f.timestamp<=m||f===u)))if(f.timestamp<i)h.push(f);else{const S=t(f,!1);g.push({doAction:()=>{S()},delay:f.delay})}r(h),n.emit(R.Flush),c.addActions(g),c.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:ve(s=>Ze(Xe({},s),{lastPlayedEvent:null})),startLive:ve({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ve((s,a)=>{const{events:c,timer:l,baselineTime:i}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;c.length=0;const d=[];for(const m of u)if(ft(m,i),c.push(m),m.timestamp>=l.timeOffset+i){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}l.isActive()&&l.replaceActions(d)}return Ze(Xe({},s),{events:c})}),addEvent:ve((s,a)=>{const{baselineTime:c,timer:l,events:i}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;ft(u,c);let d=i.length-1;if(!i[d]||i[d].timestamp<=u.timestamp)i.push(u);else{let g=-1,f=0;for(;f<=d;){const S=Math.floor((f+d)/2);i[S].timestamp<=u.timestamp?f=S+1:d=S-1}g===-1&&(g=f),i.splice(g,0,u)}const m=u.timestamp<c,h=t(u,m);m?h():l.isActive()&&l.addAction({doAction:()=>{h()},delay:u.delay})}return Ze(Xe({},s),{events:i})})}});return Dr(o)}function Ko(e){const t=Mr({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:ve({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Dr(t)}const Qo=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Jo=(e,t,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(i){o(i)}},a=l=>{try{c(r.throw(l))}catch(i){o(i)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);c((r=r.apply(e,t)).next())});const Or=new Map;function Ar(e,t){let r=Or.get(e);return r||(r=new Map,Or.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function he(e,t,r){return n=>Jo(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield he(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:s}=n;return Ar(t,o)[s]}else if("args"in n){const{rr_type:o,args:s}=n,a=window[o];return new a(...yield Promise.all(s.map(he(e,t,r))))}else{if("base64"in n)return Zn(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const s=new Image;return s.src=n.src,e.set(n.src,s),s}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(he(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(he(e,t,r)));return n})}var qo=(e,t,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(i){o(i)}},a=l=>{try{c(r.throw(l))}catch(i){o(i)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);c((r=r.apply(e,t)).next())});function ei(e,t){try{return t===le.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ti=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ri(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!ti.includes(r))return;const n=Ar(e,r);n.includes(t)||n.push(t)}function ni(e){return qo(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:s}){try{const a=ei(r,n);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const c=a[t.property],l=yield Promise.all(t.args.map(he(o,a))),i=c.apply(a,l);ri(a,i)}catch(a){s(t,a)}})}var oi=(e,t,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(i){o(i)}},a=l=>{try{c(r.throw(l))}catch(i){o(i)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);c((r=r.apply(e,t)).next())});function ii(e){return oi(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:s}){try{const a=n.getContext("2d");if(r.setter){a[r.property]=r.args[0];return}const c=a[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const l=o.get(t);c.apply(a,r.args)}else{const l=yield Promise.all(r.args.map(he(o,a)));c.apply(a,l)}}catch(a){s(r,a)}})}var si=(e,t,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(i){o(i)}},a=l=>{try{c(r.throw(l))}catch(i){o(i)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);c((r=r.apply(e,t)).next())});function Lr(e){return si(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:s,errorHandler:a}){try{const c=s.get(t)||r,l="commands"in c?c.commands:[c];if([le.WebGL,le.WebGL2].includes(r.type)){for(let i=0;i<l.length;i++){const u=l[i];yield ni({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:a})}return}for(let i=0;i<l.length;i++){const u=l[i];yield ii({event:t,mutation:u,target:n,imageMap:o,errorHandler:a})}}catch(c){a(r,c)}})}var ai=Object.defineProperty,ci=Object.defineProperties,li=Object.getOwnPropertyDescriptors,_r=Object.getOwnPropertySymbols,ui=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,Fr=(e,t,r)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xe=(e,t)=>{for(var r in t||(t={}))ui.call(t,r)&&Fr(e,r,t[r]);if(_r)for(var r of _r(t))di.call(t,r)&&Fr(e,r,t[r]);return e},yt=(e,t)=>ci(e,li(t)),vt=(e,t,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(i){o(i)}},a=l=>{try{c(r.throw(l))}catch(i){o(i)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);c((r=r.apply(e,t)).next())});const Pr=10*1e3,Wr=2*1e3,$r=1*1e3,Vr=60*60*1e3,hi=Sr||Vo,bt="[replayer]",St={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Tt(e){return e.type==M.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==Y.TouchStart)}class mi{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Ie,this.mouseTail=null,this.tailPositions=[],this.emitter=hi(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=Ot(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=wt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:St,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Wr};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(R.Resize,this.handleResize),this.setupDom(),this.emitter.on(R.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(l,i,u)=>{Lr({event:l,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ae(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const i=this.legacy_missingNodeRetryMap[l],u=pt(i.node,this.mirror,this.virtualDom.mirror);ae(u,i.node,c,this.virtualDom.mirror),i.node=u}catch(i){this.config.showWarning&&console.warn(i)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(R.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new jo([],r?.speed||n.speed);this.service=Zo({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,l)=>c.timestamp-l.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(R.StateChange,{player:c})}),this.speedService=Ko({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(R.StateChange,{speed:c})});const s=this.service.state.context.events.find(c=>c.type===M.Meta),a=this.service.state.context.events.find(c=>c.type===M.FullSnapshot);if(s){const{width:c,height:l}=s.data;setTimeout(()=>{this.emitter.emit(R.Resize,{width:c,height:l})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Tt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:r.endTime}];for(let a=1;a<n.length;a++){const c=n[a-1],l=n[a];l.timestamp-c.timestamp>Pr?t.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.timestamp,active:!0})}const o=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&o.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*r.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-s.startTime,active:o[a-1].active}),s=o[a]);s&&o.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-s.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(R.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(R.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(R.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Tt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Tt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Ot()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Uo(this.iframe.contentWindow,this.iframe.contentDocument),it(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:n=()=>{this.emitter.emit(R.CustomEvent,t)};break;case M.Meta:n=()=>this.emitter.emit(R.Resize,{width:t.data.width,height:t.data.height});break;case M.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case M.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>Pr*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(o/Wr),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(R.SkipStart,s)}}};break}return()=>{n&&n();for(const s of this.config.plugins||[])s.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const s=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(R.Finish))};t.type===M.IncrementalSnapshot&&t.data.source===x.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(R.EventCast,t)}}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Vr*this.config.inactiveSkipTime<$r?n/$r:Math.round(Math.max(n,Vr)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(R.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Sn(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(n,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:c}of n)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(R.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=Qo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,br(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let s=0;s<n.length;s++)o.rules.push({cssText:n[s],type:se.Insert,index:s})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let s=0;s<n.length;s++)o.sheet.insertRule(n[s],s)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(o,s);const a=n.getMeta(s);if(a?.type===k.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:l}=r.contentDocument;this.insertStyleRules(c,l)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of o)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==s)}collectIframeAndAttachDocument(t,r){if(we(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(R.Start,a),this.emitter.on(R.Pause,a);const c=()=>{this.emitter.off(R.Start,a),this.emitter.off(R.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(n.add(l),l.addEventListener("load",()=>{n.delete(l),n.size===0&&o!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(R.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(R.LoadStylesheetStart),o=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return vt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(R.Start,t),this.emitter.on(R.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===M.IncrementalSnapshot&&n.data.source===x.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),s=o?.createImageData(n.width,n.height);s?.data,JSON.parse(t.args[0]),o?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return vt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(s=>vt(this,null,function*(){const a=yield Promise.all(s.args.map(he(this.imageMap,null,n)));return yt(xe({},s),{args:a})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,yt(xe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(he(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,yt(xe({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,s,a,c,l;const{data:i}=t;switch(i.source){case x.Mutation:{try{this.applyMutation(i,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,i)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(r){const u=i.positions[i.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:i}}else i.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,i)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=i.positions[0])==null?void 0:n.timeOffset)});break;case x.MouseInteraction:{if(i.id===-1||r)break;const u=new Event(Y[i.type].toLowerCase()),d=this.mirror.getNode(i.id);if(!d)return this.debugNodeNotFound(i,i.id);this.emitter.emit(R.MouseInteraction,{type:i.type,target:d});const{triggerFocus:m}=this.config;switch(i.type){case Y.Blur:"blur"in d&&d.blur();break;case Y.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case Y.Click:case Y.TouchStart:case Y.TouchEnd:r?(i.type===Y.TouchStart?this.touchActive=!0:i.type===Y.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===Y.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,r,i),i.type===Y.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===Y.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===Y.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case Y.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.scrollData=i;break}this.applyScroll(i,r);break}case x.ViewportResize:this.emitter.emit(R.Resize,{width:i.width,height:i.height});break;case x.Input:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.inputData=i;break}this.applyInput(i);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u;try{i.currentTime&&(d.currentTime=i.currentTime),i.volume&&(d.volume=i.volume),i.muted&&(d.muted=i.muted),i.type===fe.Pause&&d.pause(),i.type===fe.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;(o=i.adds)==null||o.forEach(({rule:m,index:h})=>d?.push({cssText:m,index:h,type:se.Insert})),(s=i.removes)==null||s.forEach(({index:m})=>d?.push({index:m,type:se.Remove}))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;(a=i.adds)==null||a.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:g,index:f}=ct(h);Ee(d.cssRules,g).insertRule(m,f)}else{const g=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,g)}}catch{}}),(c=i.removes)==null||c.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:g}=ct(m);Ee(d.cssRules,h).deleteRule(g||0)}else d?.deleteRule(m)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;i.set&&d.push(xe({type:se.SetProperty,index:i.index},i.set)),i.remove&&d.push(xe({type:se.RemoveProperty,index:i.index},i.remove))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;i.set&&Ee(d.rules,i.index).style.setProperty(i.set.property,i.set.value,i.set.priority),i.remove&&Ee(d.rules,i.index).style.removeProperty(i.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.canvasMutations.push({event:t,mutation:i})}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);Lr({event:t,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(l=this.iframe.contentDocument)==null||l.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Po(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const i in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[i],d=vr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(i=>{var u;const d=n.getNode(i.id);if(!d)return t.removes.find(h=>h.id===i.parentId)?void 0:this.warnNodeNotFound(t,i.id);let m=n.getNode(i.parentId);if(!m)return this.warnNodeNotFound(t,i.parentId);if(i.isShadow&&Ae(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=xe({},this.legacy_missingNodeRetryMap),s=[],a=i=>{let u=null;return i.nextId&&(u=n.getNode(i.nextId)),i.nextId!==null&&i.nextId!==void 0&&i.nextId!==-1&&!u},c=i=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(i.parentId);if(!d)return i.node.type===k.Document?this.newDocumentQueue.push(i):s.push(i);i.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(i.previousId&&(m=n.getNode(i.previousId)),i.nextId&&(h=n.getNode(i.nextId)),a(i))return s.push(i);if(i.node.rootId&&!n.getNode(i.node.rootId))return;const g=i.node.rootId?n.getNode(i.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(we(d,n)){this.attachDocumentToIframe(i,d);return}const f=je(i.node,{doc:g,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(i.previousId===-1||i.nextId===-1){o[i.node.id]={node:f,mutation:i};return}const S=n.getMeta(d);if(S&&S.type===k.Element&&S.tagName==="textarea"&&i.node.type===k.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of p)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(f,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(f,h):d.insertBefore(f,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),we(f,this.mirror)){const p=this.mirror.getId(f),b=this.newDocumentQueue.find(T=>T.parentId===p);b&&(this.attachDocumentToIframe(b,f),this.newDocumentQueue=this.newDocumentQueue.filter(T=>T!==b))}(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(o,d,f,i)};t.adds.forEach(i=>{c(i)});const l=Date.now();for(;s.length;){const i=_t(s);if(s.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",i);break}for(const u of i)n.getNode(u.value.parentId)?st(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Pt(t.texts).forEach(i=>{var u;const d=n.getNode(i.id);if(!d)return t.removes.find(m=>m.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);if(d.textContent=i.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(i=>{const u=n.getNode(i.id);if(!u)return t.removes.find(d=>d.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);for(const d in i.attributes)if(typeof d=="string"){const m=i.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,g=u;for(const f in h)if(h[f]===!1)g.style.removeProperty(f);else if(h[f]instanceof Array){const S=h[f];g.style.setProperty(f,S[0],S[1])}else{const S=h[f];g.style.setProperty(f,S)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===k.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:s,nextId:a}=o,c=s&&t[s],l=a&&t[a];if(c){const{node:i,mutation:u}=c;r.insertBefore(i,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,i,u)}if(l){const{node:i,mutation:u}=l;r.insertBefore(i,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,i,u)}}moveAndHover(t,r,n,o,s){const a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(s,n);const c=at(a,this.iframe),l=t*c.absoluteScale+c.x,i=r*c.absoluteScale+c.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${i}px`,o||this.drawMouseTail({x:l,y:i}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:s}=this.config.mouseTail===!0?St:Object.assign({},St,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>c.lineTo(l.x,l.y)),c.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==M.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(R.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(bt,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(bt,...t)}debug(...t){!this.config.showDebug||console.log(bt,...t)}}const{addCustomEvent:pi}=ye,{freezePage:fi}=ye;return q.EventType=M,q.IncrementalSource=x,q.MouseInteractions=Y,q.Replayer=mi,q.ReplayerEvents=R,q.addCustomEvent=pi,q.freezePage=fi,q.record=ye,q.utils=Tn,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
|
|
30
19
|
//# sourceMappingURL=rrweb.min.js.map
|