@sentry-internal/rrweb
Version:
record and replay the web
5 lines • 53.9 kB
JavaScript
(function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrwebCanvasManager", [], f);} else if ("object" == typeof exports) {exports["rrwebCanvasManager"] = f();} else {g["rrwebCanvasManager"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
"use strict";var Gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ht=Gt(h=>{"use strict";var $t=Object.defineProperty,jt=(e,t,r)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q=(e,t,r)=>jt(e,typeof t!="symbol"?t+"":t,r),S=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(S||{});function tt(e){return e.nodeType===e.ELEMENT_NODE}function De(e){return e?.host?.shadowRoot===e}function de(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Vt(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function qt(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function me(e){try{let t=e.rules||e.cssRules;return t?Vt(Array.from(t,rt).join("")):null}catch{return null}}function Xt(e){let t="";for(let r=0;r<e.style.length;r++){let n=e.style,o=n[r],s=n.getPropertyPriority(o);t+=`${o}:${n.getPropertyValue(o)}${s?" !important":""};`}return`${e.selectorText} { ${t} }`}function rt(e){let t;if(Jt(e))try{t=me(e.styleSheet)||qt(e)}catch{}else if(Kt(e)){let r=e.cssText,n=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(r=Xt(e)),n&&(r=Yt(r)),n||o)return r}return t||e.cssText}function Yt(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Jt(e){return"styleSheet"in e}function Kt(e){return"selectorText"in e}var ae=class{constructor(){q(this,"idNodeMap",new Map),q(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-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){let 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){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qt(){return new ae}function Ae({maskInputOptions:e,tagName:t,type:r}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||r&&e[r]||r==="password"||t==="INPUT"&&!r&&e.text)}function ve({isMasked:e,element:t,value:r,maskInputFn:n}){let o=r||"";return e?(n&&(o=n(o,t)),"*".repeat(o.length)):o}function Ce(e){return e.toLowerCase()}function Te(e){return e.toUpperCase()}var $e="__rrweb_original__";function Zt(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){let s=t.getImageData,i=$e in s?s[$e]:s;if(new Uint32Array(i.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(a=>a!==0))return!1}return!0}function er(e,t){return!e||!t||e.type!==t.type?!1:e.type===S.Document?e.compatMode===t.compatMode:e.type===S.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===S.Comment||e.type===S.Text||e.type===S.CDATA?e.textContent===t.textContent:e.type===S.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function nt(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ce(t):null}function ot(e,t,r){return t==="INPUT"&&(r==="radio"||r==="checkbox")?e.getAttribute("value")||"":e.value}function Re(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i;return r.pathname.match(n)?.[1]??null}var je={};function st(e){let t=je[e];if(t)return t;let r=window.document,n=window[e];if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let s=o.contentWindow;s&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch{}return je[e]=n.bind(window)}function Me(...e){return st("setTimeout")(...e)}function it(...e){return st("clearTimeout")(...e)}function at(e){try{return e.contentDocument}catch{}}function tr(e){try{return e.contentWindow}catch{}}var rr=1,nr=new RegExp("[^a-z0-9-_:]"),ge=-2;function ct(){return rr++}function or(e){if(e instanceof HTMLFormElement)return"form";let t=Ce(e.tagName);return nr.test(t)?"div":t}function sr(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var J,Ve,ir=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ar=/^(?:[a-z+]+:)?\/\//i,cr=/^www\..*/i,lr=/^(data:)([^,]*),(.*)/i;function ur(e,t){if(!e||t.size===0)return e;try{let r=e.split(";"),n=[];for(let o of r){if(o=o.trim(),!o)continue;let s=o.indexOf(":");if(s===-1){n.push(o);continue}let i=o.slice(0,s).trim();t.has(i)||n.push(o)}return n.join("; ")+(n.length>0&&e.endsWith(";")?";":"")}catch(r){return console.warn("Error filtering CSS properties:",r),e}}function ye(e,t){return(e||"").replace(ir,(r,n,o,s,i,c)=>{let a=o||i||c,l=n||s||"";if(!a)return r;if(ar.test(a)||cr.test(a))return`url(${l}${a}${l})`;if(lr.test(a))return`url(${l}${a}${l})`;if(a[0]==="/")return`url(${l}${sr(t)+a}${l})`;let d=t.split("/"),w=a.split("/");d.pop();for(let p of w)p!=="."&&(p===".."?d.pop():d.push(p));return`url(${l}${d.join("/")}${l})`})}var fr=/^[^ \t\n\r\u000c]+/,dr=/^[, \t\n\r\u000c]+/;function hr(e,t){if(t.trim()==="")return t;let r=0;function n(s){let i,c=s.exec(t.substring(r));return c?(i=c[0],r+=i.length,i):""}let o=[];for(;n(dr),!(r>=t.length);){let s=n(fr);if(s.slice(-1)===",")s=Q(e,s.substring(0,s.length-1)),o.push(s);else{let i="";s=Q(e,s);let c=!1;for(;;){let a=t.charAt(r);if(a===""){o.push((s+i).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((s+i).trim());break}else a==="("&&(c=!0);i+=a,r+=1}}}return o.join(", ")}var qe=new WeakMap;function Q(e,t){return!t||t.trim()===""?t:Se(e,t)}function pr(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Se(e,t){let r=qe.get(e);if(r||(r=e.createElement("a"),qe.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function lt(e,t,r,n,o,s,i){if(!n)return n;if(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#"))return Q(e,n);if(r==="xlink:href"&&n[0]!=="#")return Q(e,n);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return Q(e,n);if(r==="srcset")return hr(e,n);if(r==="style"){let c=ye(n,Se(e));return i&&i.size>0&&(c=ur(c,i)),c}else if(t==="object"&&r==="data")return Q(e,n);return typeof s=="function"?s(r,n,o):n}function ut(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function mr(e,t,r,n){try{if(n&&e.matches(n))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let s=e.classList[o];if(t.test(s))return!0}if(r)return e.matches(r)}catch{}return!1}function gr(e,t){for(let r=e.classList.length;r--;){let n=e.classList[r];if(t.test(n))return!0}return!1}function X(e,t,r=1/0,n=0){return!e||e.nodeType!==e.ELEMENT_NODE||n>r?-1:t(e)?n:X(e.parentNode,t,r,n+1)}function Z(e,t){return r=>{let n=r;if(n===null)return!1;try{if(e){if(typeof e=="string"){if(n.matches(`.${e}`))return!0}else if(gr(n,e))return!0}return!!(t&&n.matches(t))}catch{return!1}}}function we(e,t,r,n,o,s){try{let i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){let l=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(l))return!0}let c=-1,a=-1;if(s){if(a=X(i,Z(n,o)),a<0)return!0;c=X(i,Z(t,r),a>=0?a:1/0)}else{if(c=X(i,Z(t,r)),c<0)return!1;a=X(i,Z(n,o),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!s}catch{}return!!s}function yr(e,t,r){let n=tr(e);if(!n)return;let o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){let c=Me(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{it(c),o=!0,t()});return}let i="about:blank";if(n.location.href!==i||e.src===i||e.src==="")return Me(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wr(e,t,r){let n=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let s=Me(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{it(s),n=!0,t()})}function br(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:c,maskAttributeFn:a,maskTextClass:l,unmaskTextClass:d,maskTextSelector:w,unmaskTextSelector:p,inlineStylesheet:M,maskInputOptions:m={},maskTextFn:L,maskInputFn:b,dataURLOptions:v={},inlineImages:D,recordCanvas:_,keepIframeSrcFn:O,newlyAddedElement:I=!1,ignoreCSSAttributes:N}=t,C=Cr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:S.Document,childNodes:[],compatMode:e.compatMode}:{type:S.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:S.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return kr(e,{doc:r,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:M,maskAttributeFn:a,maskInputOptions:m,maskInputFn:b,dataURLOptions:v,inlineImages:D,recordCanvas:_,keepIframeSrcFn:O,newlyAddedElement:I,rootId:C,maskTextClass:l,unmaskTextClass:d,maskTextSelector:w,unmaskTextSelector:p,ignoreCSSAttributes:N});case e.TEXT_NODE:return Sr(e,{doc:r,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:w,unmaskTextSelector:p,maskTextFn:L,maskInputOptions:m,maskInputFn:b,rootId:C});case e.CDATA_SECTION_NODE:return{type:S.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:S.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function Cr(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Sr(e,t){let{maskAllText:r,maskTextClass:n,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:c,maskInputOptions:a,maskInputFn:l,rootId:d}=t,w=e.parentNode&&e.parentNode.tagName,p=e.textContent,M=w==="STYLE"?!0:void 0,m=w==="SCRIPT"?!0:void 0,L=w==="TEXTAREA"?!0:void 0;if(M&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=me(e.parentNode.sheet))}catch(v){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${v}`,e)}p=ye(p,Se(t.doc))}m&&(p="SCRIPT_PLACEHOLDER");let b=we(e,n,s,o,i,r);if(!M&&!m&&!L&&p&&b&&(p=c?c(p,e.parentElement):p.replace(/[\S]/g,"*")),L&&p&&(a.textarea||b)&&(p=l?l(p,e.parentNode):p.replace(/[\S]/g,"*")),w==="OPTION"&&p){let v=Ae({type:null,tagName:w,maskInputOptions:a});p=ve({isMasked:we(e,n,s,o,i,v),element:e,value:p,maskInputFn:l})}return{type:S.Text,textContent:p||"",isStyle:M,rootId:d}}function kr(e,t){let{doc:r,blockClass:n,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:l,dataURLOptions:d={},inlineImages:w,recordCanvas:p,keepIframeSrcFn:M,newlyAddedElement:m=!1,rootId:L,maskTextClass:b,unmaskTextClass:v,maskTextSelector:D,unmaskTextSelector:_,ignoreCSSAttributes:O}=t,I=mr(e,n,o,s),N=or(e),C={},F=e.attributes.length;for(let y=0;y<F;y++){let T=e.attributes[y];T.name&&!ut(N,T.name,T.value)&&(C[T.name]=lt(r,N,Ce(T.name),T.value,e,a,O))}if(N==="link"&&i){let y=Array.from(r.styleSheets).find(A=>A.href===e.href),T=null;y&&(T=me(y)),T&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=ye(T,y.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let y=me(e.sheet);y&&(C._cssText=ye(y,Se(r)))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){let y=e,T=nt(y),A=ot(y,Te(N),T),W=y.checked;if(T!=="submit"&&T!=="button"&&A){let P=we(y,b,D,v,_,Ae({type:T,tagName:Te(N),maskInputOptions:c}));C.value=ve({isMasked:P,element:y,value:A,maskInputFn:l})}W&&(C.checked=W)}if(N==="option"&&(e.selected&&!c.select?C.selected=!0:delete C.selected),N==="canvas"&&p){if(e.__context==="2d")Zt(e)||(C.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){let y=e.toDataURL(d.type,d.quality),T=r.createElement("canvas");T.width=e.width,T.height=e.height;let A=T.toDataURL(d.type,d.quality);y!==A&&(C.rr_dataURL=y)}}if(N==="img"&&w){J||(J=r.createElement("canvas"),Ve=J.getContext("2d"));let y=e,T=y.currentSrc||y.getAttribute("src")||"<unknown-src>",A=y.crossOrigin,W=()=>{y.removeEventListener("load",W);try{J.width=y.naturalWidth,J.height=y.naturalHeight,Ve.drawImage(y,0,0),C.rr_dataURL=J.toDataURL(d.type,d.quality)}catch(P){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?W():y.addEventListener("load",W);return}else console.warn(`Cannot inline img src=${T}! Error: ${P}`)}y.crossOrigin==="anonymous"&&(A?C.crossOrigin=A:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?W():y.addEventListener("load",W)}if((N==="audio"||N==="video")&&(C.rr_mediaState=e.paused?"paused":"played",C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),I){let{width:y,height:T}=e.getBoundingClientRect();C={class:C.class,rr_width:`${y}px`,rr_height:`${T}px`}}N==="iframe"&&!M(C.src)&&(!I&&!at(e)&&(C.rr_src=C.src),delete C.src);let B;try{customElements.get(N)&&(B=!0)}catch{}return{type:S.Element,tagName:N,attributes:C,childNodes:[],isSVG:pr(e)||void 0,needBlock:I,rootId:L,isCustom:B}}function x(e){return e==null?"":e.toLowerCase()}function Tr(e,t){if(t.comment&&e.type===S.Comment)return!0;if(e.type===S.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Re(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(x(e.attributes.name).match(/^msapplication-tile(image|color)$/)||x(e.attributes.name)==="application-name"||x(e.attributes.rel)==="icon"||x(e.attributes.rel)==="apple-touch-icon"||x(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&x(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(x(e.attributes.property).match(/^(og|twitter|fb):/)||x(e.attributes.name).match(/^(og|twitter):/)||x(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(x(e.attributes.name)==="robots"||x(e.attributes.name)==="googlebot"||x(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(x(e.attributes.name)==="author"||x(e.attributes.name)==="generator"||x(e.attributes.name)==="framework"||x(e.attributes.name)==="publisher"||x(e.attributes.name)==="progid"||x(e.attributes.property).match(/^article:/)||x(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(x(e.attributes.name)==="google-site-verification"||x(e.attributes.name)==="yandex-verification"||x(e.attributes.name)==="csrf-token"||x(e.attributes.name)==="p:domain_verify"||x(e.attributes.name)==="verify-v1"||x(e.attributes.name)==="verification"||x(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ee(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:w,skipChild:p=!1,inlineStylesheet:M=!0,maskInputOptions:m={},maskAttributeFn:L,maskTextFn:b,maskInputFn:v,slimDOMOptions:D,dataURLOptions:_={},inlineImages:O=!1,recordCanvas:I=!1,onSerialize:N,onIframeLoad:C,iframeLoadTimeout:F=5e3,onBlockedImageLoad:B,onStylesheetLoad:y,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:A=()=>!1,newlyAddedElement:W=!1,ignoreCSSAttributes:P}=t,{preserveWhiteSpace:j=!0}=t,$=br(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskAllText:c,unblockSelector:i,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:w,inlineStylesheet:M,maskInputOptions:m,maskAttributeFn:L,maskTextFn:b,maskInputFn:v,dataURLOptions:_,inlineImages:O,recordCanvas:I,keepIframeSrcFn:A,newlyAddedElement:W,ignoreCSSAttributes:P});if(!$)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):Tr($,D)||!j&&$.type===S.Text&&!$.isStyle&&!$.textContent.trim().length?U=ge:U=ct();let E=Object.assign($,{id:U});if(n.add(e,E),U===ge)return null;N&&N(e);let ne=!p;if(E.type===S.Element){ne=ne&&!E.needBlock;let f=e.shadowRoot;f&&de(f)&&(E.isShadowHost=!0)}if((E.type===S.Document||E.type===S.Element)&&ne){D.headWhitespace&&E.type===S.Element&&E.tagName==="head"&&(j=!1);let f={doc:r,mirror:n,blockClass:o,blockSelector:s,maskAllText:c,unblockSelector:i,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:w,skipChild:p,inlineStylesheet:M,maskInputOptions:m,maskAttributeFn:L,maskTextFn:b,maskInputFn:v,slimDOMOptions:D,dataURLOptions:_,inlineImages:O,recordCanvas:I,preserveWhiteSpace:j,onSerialize:N,onIframeLoad:C,iframeLoadTimeout:F,onBlockedImageLoad:B,onStylesheetLoad:y,stylesheetLoadTimeout:T,keepIframeSrcFn:A,ignoreCSSAttributes:P},u=e.childNodes?Array.from(e.childNodes):[];for(let g of u){let k=ee(g,f);k&&E.childNodes.push(k)}if(tt(e)&&e.shadowRoot)for(let g of Array.from(e.shadowRoot.childNodes)){let k=ee(g,f);k&&(de(e.shadowRoot)&&(k.isShadow=!0),E.childNodes.push(k))}}if(e.parentNode&&De(e.parentNode)&&de(e.parentNode)&&(E.isShadow=!0),E.type===S.Element&&E.tagName==="iframe"&&!E.needBlock&&yr(e,()=>{let f=at(e);if(f&&C){let u=ee(f,{doc:f,mirror:n,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:w,skipChild:!1,inlineStylesheet:M,maskInputOptions:m,maskAttributeFn:L,maskTextFn:b,maskInputFn:v,slimDOMOptions:D,dataURLOptions:_,inlineImages:O,recordCanvas:I,preserveWhiteSpace:j,onSerialize:N,onIframeLoad:C,iframeLoadTimeout:F,onStylesheetLoad:y,stylesheetLoadTimeout:T,keepIframeSrcFn:A,ignoreCSSAttributes:P});u&&C(e,u)}},F),E.type===S.Element&&E.tagName==="img"&&!e.complete&&E.needBlock){let f=e,u=()=>{if(f.isConnected&&!f.complete&&B)try{let g=f.getBoundingClientRect();g.width>0&&g.height>0&&B(f,E,g)}catch{}f.removeEventListener("load",u)};f.isConnected&&f.addEventListener("load",u)}return E.type===S.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Re(E.attributes.href)==="css")&&wr(e,()=>{if(y){let f=ee(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:w,skipChild:!1,inlineStylesheet:M,maskInputOptions:m,maskAttributeFn:L,maskTextFn:b,maskInputFn:v,slimDOMOptions:D,dataURLOptions:_,inlineImages:O,recordCanvas:I,preserveWhiteSpace:j,onSerialize:N,onIframeLoad:C,iframeLoadTimeout:F,onStylesheetLoad:y,stylesheetLoadTimeout:T,keepIframeSrcFn:A,ignoreCSSAttributes:P});f&&y(e,f)}},T),E.type===S.Element&&delete E.needBlock,E}function Mr(e,t){let{mirror:r=new ae,blockClass:n="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:l=null,unmaskTextSelector:d=null,inlineStylesheet:w=!0,inlineImages:p=!1,recordCanvas:M=!1,maskAllInputs:m=!1,maskAttributeFn:L,maskTextFn:b,maskInputFn:v,slimDOM:D=!1,dataURLOptions:_,preserveWhiteSpace:O,onSerialize:I,onIframeLoad:N,iframeLoadTimeout:C,onBlockedImageLoad:F,onStylesheetLoad:B,stylesheetLoadTimeout:y,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:A=new Set([])}=t||{};return ee(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:c,unmaskTextClass:a,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:w,maskInputOptions:m===!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}:m===!1?{}:m,maskAttributeFn:L,maskTextFn:b,maskInputFn:v,slimDOMOptions:D===!0||D==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:D==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:D===!1?{}:D,dataURLOptions:_,inlineImages:p,recordCanvas:M,preserveWhiteSpace:O,onSerialize:I,onIframeLoad:N,iframeLoadTimeout:C,onBlockedImageLoad:F,onStylesheetLoad:B,stylesheetLoadTimeout:y,keepIframeSrcFn:T,newlyAddedElement:!1,ignoreCSSAttributes:A})}var Xe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Nr(e,t={}){let r=1,n=1;function o(f){let u=f.match(/\n/g);u&&(r+=u.length);let g=f.lastIndexOf(`
`);n=g===-1?n+f.length:f.length-g}function s(){let f={line:r,column:n};return u=>(u.position=new c(f),L(),u)}let i=class ft{constructor(u){q(this,"content"),q(this,"start"),q(this,"end"),q(this,"source"),this.start=u,this.end={line:r,column:n},this.source=t.source,this.content=ft.content}};q(i,"content");let c=i;c.content=e;let a=[];function l(f){let u=new Error(`${t.source||""}:${r}:${n}: ${f}`);if(u.reason=f,u.filename=t.source,u.line=r,u.column=n,u.source=e,t.silent)a.push(u);else throw u}function d(){let f=M();return{type:"stylesheet",stylesheet:{source:t.source,rules:f,parsingErrors:a}}}function w(){return m(/^{\s*/)}function p(){return m(/^}/)}function M(){let f,u=[];for(L(),b(u);e.length&&e.charAt(0)!=="}"&&(f=E()||ne());)f&&(u.push(f),b(u));return u}function m(f){let u=f.exec(e);if(!u)return;let g=u[0];return o(g),e=e.slice(g.length),u}function L(){m(/^\s*/)}function b(f=[]){let u;for(;u=v();)u&&f.push(u),u=v();return f}function v(){let f=s();if(e.charAt(0)!=="/"||e.charAt(1)!=="*")return;let u=2;for(;e.charAt(u)!==""&&(e.charAt(u)!=="*"||e.charAt(u+1)!=="/");)++u;if(u+=2,e.charAt(u-1)==="")return l("End of comment missing");let g=e.slice(2,u-2);return n+=2,o(g),e=e.slice(u),n+=2,f({type:"comment",comment:g})}function D(){let f=m(/^([^{]+)/);if(!f)return;let u=z(f[0]).replace(/\/\*[\s\S]*?\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,V=>V.replace(/,/g,"\u200C")).split(/\s*(?![^(]*\)),\s*/);if(u.length<=1)return u.map(V=>V.replace(/\u200C/g,","));let g=0,k=0,R=u.length,H=[];for(;g<R;){let V=(u[g].match(/\(/g)||[]).length,zt=(u[g].match(/\)/g)||[]).length,ke=V-zt;if(ke>=1){let ze=!1;for(k=g+1;k<R;){let fe=(u[k].match(/\(/g)||[]).length,Ge=(u[k].match(/\)/g)||[]).length-fe;if(Ge===ke){H.push(u.slice(g,k+1).join(",")),g=k+1,ze=!0;break}k++,ke-=Ge}if(ze)continue;u.slice(g,R).forEach(fe=>fe&&H.push(fe));break}u[g]&&H.push(u[g]),g++}return H.map(V=>V.replace(/\u200C/g,","))}function _(){let f=s(),u=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!u)return;let g=z(u[0]);if(!m(/^:\s*/))return l("property missing ':'");let k=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),R=f({type:"declaration",property:g.replace(Xe,""),value:k?z(k[0]).replace(Xe,""):""});return m(/^[;\s]*/),R}function O(){let f=[];if(!w())return l("missing '{'");b(f);let u;for(;u=_();)u!==!1&&(f.push(u),b(f)),u=_();return p()?f:l("missing '}'")}function I(){let f,u=[],g=s();for(;f=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)u.push(f[1]),m(/^,\s*/);if(u.length)return g({type:"keyframe",values:u,declarations:O()})}function N(){let f=s(),u=m(/^@([-\w]+)?keyframes\s*/);if(!u)return;let g=u[1];if(u=m(/^([-\w]+)\s*/),!u)return l("@keyframes missing name");let k=u[1];if(!w())return l("@keyframes missing '{'");let R,H=b();for(;R=I();)H.push(R),H=H.concat(b());return p()?f({type:"keyframes",name:k,vendor:g,keyframes:H}):l("@keyframes missing '}'")}function C(){let f=s(),u=m(/^@supports *([^{]+)/);if(!u)return;let g=z(u[1]);if(!w())return l("@supports missing '{'");let k=b().concat(M());return p()?f({type:"supports",supports:g,rules:k}):l("@supports missing '}'")}function F(){let f=s();if(!m(/^@host\s*/))return;if(!w())return l("@host missing '{'");let g=b().concat(M());return p()?f({type:"host",rules:g}):l("@host missing '}'")}function B(){let f=s(),u=m(/^@media *([^{]+)/);if(!u)return;let g=z(u[1]);if(!w())return l("@media missing '{'");let k=b().concat(M());return p()?f({type:"media",media:g,rules:k}):l("@media missing '}'")}function y(){let f=s(),u=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(u)return f({type:"custom-media",name:z(u[1]),media:z(u[2])})}function T(){let f=s();if(!m(/^@page */))return;let g=D()||[];if(!w())return l("@page missing '{'");let k=b(),R;for(;R=_();)k.push(R),k=k.concat(b());return p()?f({type:"page",selectors:g,declarations:k}):l("@page missing '}'")}function A(){let f=s(),u=m(/^@([-\w]+)?document *([^{]+)/);if(!u)return;let g=z(u[1]),k=z(u[2]);if(!w())return l("@document missing '{'");let R=b().concat(M());return p()?f({type:"document",document:k,vendor:g,rules:R}):l("@document missing '}'")}function W(){let f=s();if(!m(/^@font-face\s*/))return;if(!w())return l("@font-face missing '{'");let g=b(),k;for(;k=_();)g.push(k),g=g.concat(b());return p()?f({type:"font-face",declarations:g}):l("@font-face missing '}'")}let P=U("import"),j=U("charset"),$=U("namespace");function U(f){let u=new RegExp("^@"+f+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{let g=s(),k=m(u);if(!k)return;let R={type:f};return R[f]=k[1].trim(),g(R)}}function E(){if(e[0]==="@")return N()||B()||y()||C()||P()||j()||$()||A()||T()||F()||W()}function ne(){let f=s(),u=D();return u?(b(),f({type:"rule",selectors:u,declarations:O()})):l("selector missing")}return Ne(d())}function z(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Ne(e,t){let r=e&&typeof e.type=="string",n=r?e:t;for(let o of Object.keys(e)){let s=e[o];Array.isArray(s)?s.forEach(i=>{Ne(i,n)}):s&&typeof s=="object"&&Ne(s,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ye={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 Er(e){let t=Ye[e.tagName]?Ye[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function xr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var dt=/([^\\]):hover/,Lr=new RegExp(dt.source,"g");function Je(e,t){let r=t?.stylesWithHoverClass.get(e);if(r)return r;if(e.length>=1e6)return e;let n=Nr(e,{silent:!0});if(!n.stylesheet)return e;let o=[];if(n.stylesheet.rules.forEach(c=>{"selectors"in c&&(c.selectors||[]).forEach(a=>{dt.test(a)&&o.push(a)})}),o.length===0)return e;let s=new RegExp(o.filter((c,a)=>o.indexOf(c)===a).sort((c,a)=>a.length-c.length).map(c=>xr(c)).join("|"),"g"),i=e.replace(s,c=>{let a=c.replace(Lr,"$1.\\:hover");return`${c}, ${a}`});return t?.stylesWithHoverClass.set(e,i),i}function Dr(){return{stylesWithHoverClass:new Map}}function Ar(e,t){let{doc:r,hackCss:n,cache:o}=t;switch(e.type){case S.Document:return r.implementation.createDocument(null,"",null);case S.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case S.Element:{let s=Er(e),i;if(e.isSVG)i=r.createElementNS("http://www.w3.org/2000/svg",s);else{if(e.isCustom&&r.defaultView?.customElements&&!r.defaultView.customElements.get(e.tagName))try{r.defaultView.customElements.define(e.tagName,class extends r.defaultView.HTMLElement{})}catch(a){console.warn("Cannot define custom element",a)}i=r.createElement(s)}let c={};for(let a in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,a))continue;let l=e.attributes[a];if(s==="option"&&a==="selected"&&l===!1||l===null)continue;if(l===!0&&(l=""),a.startsWith("rr_")){c[a]=l;continue}let d=s==="textarea"&&a==="value",w=s==="style"&&a==="_cssText";if(w&&n&&typeof l=="string"&&(l=Je(l,o)),(d||w)&&typeof l=="string"){let p=r.createTextNode(l);for(let M of Array.from(i.childNodes))M.nodeType===i.TEXT_NODE&&i.removeChild(M);i.appendChild(p);continue}try{if(e.isSVG&&a==="xlink:href")i.setAttributeNS("http://www.w3.org/1999/xlink",a,l.toString());else if(a==="onload"||a==="onclick"||a.substring(0,7)==="onmouse")i.setAttribute("_"+a,l.toString());else if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&a==="content"){i.setAttribute("csp-content",l.toString());continue}else s==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Re(e.attributes.href)==="js"||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",e.attributes.srcset):i.setAttribute(a,l.toString()))}catch{}}for(let a in c){let l=c[a];if(s==="canvas"&&a==="rr_dataURL"){let d=r.createElement("img");d.onload=()=>{let w=i.getContext("2d");w&&w.drawImage(d,0,0,d.width,d.height)},d.src=l.toString(),i.RRNodeType&&(i.rr_dataURL=l.toString())}else if(s==="img"&&a==="rr_dataURL"){let d=i;d.currentSrc.startsWith("data:")||(d.setAttribute("rrweb-original-src",e.attributes.src),d.src=l.toString())}if(a==="rr_width")i.style.setProperty("width",l.toString());else if(a==="rr_height")i.style.setProperty("height",l.toString());else if(a==="rr_mediaCurrentTime"&&typeof l=="number")i.currentTime=l;else if(a==="rr_mediaState")switch(l){case"played":i.play().catch(d=>console.warn("media playback error",d));break;case"paused":i.pause();break}}if(e.isShadowHost)if(!i.shadowRoot)i.attachShadow({mode:"open"});else for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);return i}case S.Text:return r.createTextNode(e.isStyle&&n?Je(e.textContent,o):e.textContent);case S.CDATA:return r instanceof XMLDocument?r.createCDATASection(e.textContent):null;case S.Comment:return r.createComment(e.textContent);default:return null}}function _e(e,t){let{doc:r,mirror:n,skipChild:o=!1,hackCss:s=!0,afterAppend:i,cache:c}=t;if(n.has(e.id)){let l=n.getNode(e.id),d=n.getMeta(l);if(er(d,e))return n.getNode(e.id)}let a=Ar(e,{doc:r,hackCss:s,cache:c});if(!a)return null;if(e.rootId&&n.getNode(e.rootId)!==r&&n.replace(e.rootId,r),e.type===S.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==S.DocumentType&&(e.childNodes[0].type===S.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" "">')),a=r),n.add(a,e),(e.type===S.Document||e.type===S.Element)&&!o)for(let l of e.childNodes){let d=_e(l,{doc:r,mirror:n,skipChild:!1,hackCss:s,afterAppend:i,cache:c});if(!d){console.warn("Failed to rebuild",l);continue}if(l.isShadow&&tt(a)&&a.shadowRoot)a.shadowRoot.appendChild(d);else if(e.type===S.Document&&l.type==S.Element){let w=d,p=null;w.childNodes.forEach(M=>{M.nodeName==="BODY"&&(p=M)}),p?(w.removeChild(p),a.appendChild(d),w.appendChild(p)):a.appendChild(d)}else a.appendChild(d);i&&i(d,l.id)}return a}function vr(e,t){function r(n){t(n)}for(let n of e.getIds())e.has(n)&&r(e.getNode(n))}function Rr(e,t){let r=t.getMeta(e);if(r?.type!==S.Element)return;let n=e;for(let o in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,o)&&o.startsWith("rr_")))continue;let s=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=s),o==="rr_scrollTop"&&(n.scrollTop=s)}}function _r(e,t){let{doc:r,onVisit:n,hackCss:o=!0,afterAppend:s,cache:i,mirror:c=new ae}=t,a=_e(e,{doc:r,mirror:c,skipChild:!1,hackCss:o,afterAppend:s,cache:i});return vr(c,l=>{n&&n(l),Rr(l,c)}),a}function ht(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var K=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`,Ee={map:{},getId(){return console.error(K),-1},getNode(){return console.error(K),null},removeNodeFromMap(){console.error(K)},has(){return console.error(K),!1},reset(){console.error(K)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get(e,t,r){return t==="map"&&console.error(K),Reflect.get(e,t,r)}}));function pt(e,t,r={}){let n=null,o=0;return function(...s){let i=Date.now();!o&&r.leading===!1&&(o=i);let c=t-(i-o),a=this;c<=0||c>t?(n&&(He(n),n=null),o=i,e.apply(a,s)):!n&&r.trailing!==!1&&(n=ue(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,s)},c))}}function ce(e,t,r,n,o=window){let s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(i){ue(()=>{r.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>ce(e,t,s||{},!0)}function le(e,t,r){try{if(!(t in e))return()=>{};let 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()=>{}}}h.nowTimestamp=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(h.nowTimestamp=()=>new Date().getTime());function mt(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function gt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function yt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function re(e,t,r,n,o){if(!e)return!1;let s=Ie(e);if(!s)return!1;let i=Z(t,r);if(!o){let l=n&&s.matches(n);return i(s)&&!l}let c=X(s,i),a=-1;return c<0?!1:(n&&(a=X(s,Z(null,n))),c>-1&&a<0?!0:c<a)}function wt(e,t){return t.getId(e)!==-1}function bt(e,t){return t.getId(e)===ge}function Oe(e,t){if(De(e))return!1;let r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Oe(e.parentNode,t):!0:!0}function Ct(e){return!!e.changedTouches}function St(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function kt(e){let t={},r=(o,s)=>{let i={value:o,parent:s,children:[]};return t[o.node.id]=i,i},n=[];for(let o of e){let{nextId:s,parentId:i}=o;if(s&&s in t){let c=t[s];if(c.parent){let a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{let a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(i in t){let c=t[i];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function We(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)We(e.children[r],t)}function Tt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Mt(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Pe(e,t){let r=e.ownerDocument?.defaultView?.frameElement;if(!r||r===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let n=r.getBoundingClientRect(),o=Pe(r,t),s=n.height/r.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:s,absoluteScale:o.absoluteScale*s}}function Nt(e){return!!e?.shadowRoot}function Fe(e,t){let r=e[t[0]];return t.length===1?r:Fe(r.cssRules[t[1]].cssRules,t.slice(2))}function Et(e){let t=[...e],r=t.pop();return{positions:t,index:r}}function xt(e){let t=new Set,r=[];for(let n=e.length;n--;){let o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var be=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Be(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Lt(e){let t=e,r;for(;r=Be(t);)t=r;return t}function Dt(e){let t=e.ownerDocument;if(!t)return!1;let r=Lt(e);return t.contains(r)}function At(e){let t=e.ownerDocument;return t?t.contains(e)||Dt(e):!1}var Ke={};function Ue(e){let t=Ke[e];if(t)return t;let r=window.document,n=window[e];if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let s=o.contentWindow;s&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch{}return Ke[e]=n.bind(window)}function G(...e){return Ue("requestAnimationFrame")(...e)}function ue(...e){return Ue("setTimeout")(...e)}function He(...e){return Ue("clearTimeout")(...e)}var Ir=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:be,get _mirror(){return Ee},clearTimeout:He,closestElementOfNode:Ie,getBaseDimension:Pe,getNestedRule:Fe,getPositionsAndIndex:Et,getRootShadowHost:Lt,getShadowHost:Be,getWindowHeight:gt,getWindowScroll:mt,getWindowWidth:yt,hasShadowRoot:Nt,hookSetter:ce,inDom:At,isAncestorRemoved:Oe,isBlocked:re,isIgnored:bt,isSerialized:wt,isSerializedIframe:Tt,isSerializedStylesheet:Mt,iterateResolveTree:We,legacy_isTouchEvent:Ct,get nowTimestamp(){return h.nowTimestamp},on:ht,onRequestAnimationFrame:G,patch:le,polyfill:St,queueToResolveTrees:kt,setTimeout:ue,shadowHostInDom:Dt,throttle:pt,uniqueTextMutations:xt},Symbol.toStringTag,{value:"Module"})),vt=(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))(vt||{}),Rt=(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[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Rt||{}),_t=(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))(_t||{}),It=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(It||{}),Y=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Y||{}),Ot=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ot||{}),Wt=(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.Destroy="destroy",e))(Wt||{}),ie;function Pt(e){ie=e}function Or(){ie=void 0}var he=e=>ie?((...r)=>{try{return e(...r)}catch(n){if(ie&&ie(n)===!0)return()=>{};throw n}}):e,te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",se=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(oe=0;oe<te.length;oe++)se[te.charCodeAt(oe)]=oe;var oe,Wr=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=te[t[r]>>2],o+=te[(t[r]&3)<<4|t[r+1]>>4],o+=te[(t[r+1]&15)<<2|t[r+2]>>6],o+=te[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},Pr=function(e){var t=e.length*.75,r=e.length,n,o=0,s,i,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var l=new ArrayBuffer(t),d=new Uint8Array(l);for(n=0;n<r;n+=4)s=se[e.charCodeAt(n)],i=se[e.charCodeAt(n+1)],c=se[e.charCodeAt(n+2)],a=se[e.charCodeAt(n+3)],d[o++]=s<<2|i>>4,d[o++]=(i&15)<<4|c>>2,d[o++]=(c&3)<<6|a&63;return l},Qe=new Map;function Fr(e,t){let r=Qe.get(e);return r||(r=new Map,Qe.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Ft=(e,t,r)=>{if(!e||!(Ut(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=Fr(r,n),s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function pe(e,t,r){if(e instanceof Array)return e.map(n=>pe(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){let n=e.constructor.name,o=Wr(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[pe(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[pe(e.data,t,r),e.width,e.height]};if(Ut(e,t)||typeof e=="object"){let n=e.constructor.name,o=Ft(e,t,r);return{rr_type:n,index:o}}}}return e}var Bt=(e,t,r)=>e.map(n=>pe(n,t,r)),Ut=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function Br(e,t,r,n,o){let s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let c of i)try{if(typeof t.CanvasRenderingContext2D.prototype[c]!="function")continue;let a=le(t.CanvasRenderingContext2D.prototype,c,function(l){return function(...d){return re(this.canvas,r,n,o,!0)||ue(()=>{let w=Bt(d,t,this);e(this.canvas,{type:Y["2D"],property:c,args:w})},0),l.apply(this,d)}});s.push(a)}catch{let a=ce(t.CanvasRenderingContext2D.prototype,c,{set(l){e(this.canvas,{type:Y["2D"],property:c,args:[l],setter:!0})}});s.push(a)}return()=>{s.forEach(c=>c())}}function Ur(e){return e==="experimental-webgl"?"webgl":e}function Ze(e,t,r,n,o){let s=[];try{let i=le(e.HTMLCanvasElement.prototype,"getContext",function(c){return function(a,...l){if(!re(this,t,r,n,!0)){let d=Ur(a);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(l[0]&&typeof l[0]=="object"){let w=l[0];w.preserveDrawingBuffer||(w.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return c.apply(this,[a,...l])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function et(e,t,r,n,o,s,i,c){let a=[],l=Object.getOwnPropertyNames(e);for(let d of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;let w=le(e,d,function(p){return function(...M){let m=p.apply(this,M);if(Ft(m,c,this),"tagName"in this.canvas&&!re(this.canvas,n,o,s,!0)){let L=Bt(M,c,this),b={type:t,property:d,args:L};r(this.canvas,b)}return m}});a.push(w)}catch{let w=ce(e,d,{set(p){r(this.canvas,{type:t,property:d,args:[p],setter:!0})}});a.push(w)}return a}function Hr(e,t,r,n,o,s){let i=[];return i.push(...et(t.WebGLRenderingContext.prototype,Y.WebGL,e,r,n,o,s,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...et(t.WebGL2RenderingContext.prototype,Y.WebGL2,e,r,n,o,s,t)),()=>{i.forEach(c=>c())}}var zr='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function Gr(){let e=new Blob([zr]);return URL.createObjectURL(e)}var xe=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}},Le=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(c,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(a)};let{enableManualSnapshot:r,sampling:n="all",win:o,recordCanvas:s,errorHandler:i}=t;t.sampling=n,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,i&&Pt(i),(s&&typeof n=="number"||r)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!r&&he(()=>{s&&n==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&typeof n=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){let{sampling:r="all",blockClass:n,blockSelector:o,unblockSelector:s,recordCanvas:i,enableManualSnapshot:c}=this.options;if(!this.windowsSet.has(t)){if(c){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}he(()=>{if(i&&r==="all"&&this.initCanvasMutationObserver(t,n,o,s),i&&typeof r=="number"){let a=Ze(t,n,o,s,!0);this.restoreHandlers.push(()=>{a()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,r){if(r?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}G(n=>this.takeSnapshot(n,!0,t))}initFPSWorker(){let t=new Worker(Gr());return t.onmessage=r=>{let n=r.data,{id:o}=n;if(this.snapshotInProgressMap.set(o,!1),!("base64"in n))return;let{base64:s,type:i,width:c,height:a}=n;this.mutationCb({id:o,type:Y["2D"],commands:[{property:"clearRect",args:[0,0,c,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:i}]},0,0,c,a]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;let r=n=>{this.takeSnapshot(n,!1),t=G(r)};t=G(r),this.restoreHandlers.push(()=>{t&&cancelAn