@lucida-analytics/browser 0.1.10 → 0.1.12
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/CHANGELOG.md +15 -0
- package/README.md +7 -2
- package/dist/autocapture.d.ts +1 -1
- package/dist/autocapture.js +1 -1
- package/dist/{client-DTogLMYz.d.ts → client-C9F2fWI4.d.ts} +2 -2
- package/dist/consent.d.ts +2 -2
- package/dist/core.d.ts +3 -3
- package/dist/core.js +3 -3
- package/dist/correlate.d.ts +1 -1
- package/dist/early-access.d.ts +1 -1
- package/dist/experiments.d.ts +1 -1
- package/dist/flags.d.ts +1 -1
- package/dist/forms.d.ts +1 -1
- package/dist/guides.d.ts +1 -1
- package/dist/heatmaps.d.ts +1 -1
- package/dist/heatmaps.js +1 -1
- package/dist/host-headers.d.ts +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +2 -2
- package/dist/inspector.d.ts +1 -1
- package/dist/lucida.js +2 -2
- package/dist/recommendations.d.ts +1 -1
- package/dist/{static/v0/recorder-TZCDQIZN.js → recorder-AJ7XX7OZ.js} +4 -4
- package/dist/replay.d.ts +2 -2
- package/dist/replay.js +1 -1
- package/dist/static/v0/autocapture.js +1 -1
- package/dist/static/v0/core.js +3 -3
- package/dist/static/v0/heatmaps.js +1 -1
- package/dist/static/v0/index.js +2 -2
- package/dist/static/v0/lucida.js +2 -2
- package/dist/static/v0/manifest.json +8 -8
- package/dist/static/{v0.1.10/recorder-TZCDQIZN.js → v0/recorder-AJ7XX7OZ.js} +4 -4
- package/dist/static/v0/replay.js +1 -1
- package/dist/static/v0.1.12/autocapture.js +1 -0
- package/dist/static/v0.1.12/core.js +3 -0
- package/dist/static/v0.1.12/heatmaps.js +1 -0
- package/dist/static/v0.1.12/index.js +3 -0
- package/dist/static/v0.1.12/lucida.js +3 -0
- package/dist/static/{v0.1.10 → v0.1.12}/manifest.json +8 -8
- package/dist/{recorder-TZCDQIZN.js → static/v0.1.12/recorder-AJ7XX7OZ.js} +4 -4
- package/dist/static/{v0.1.10 → v0.1.12}/replay.js +1 -1
- package/dist/toolbar.d.ts +1 -1
- package/dist/{types-B_CVJeLI.d.ts → types-Chfj1wdu.d.ts} +9 -2
- package/dist/webmcp.d.ts +1 -1
- package/package.json +1 -1
- package/storage.json +2 -2
- package/dist/static/v0.1.10/autocapture.js +0 -1
- package/dist/static/v0.1.10/core.js +0 -3
- package/dist/static/v0.1.10/heatmaps.js +0 -1
- package/dist/static/v0.1.10/index.js +0 -3
- package/dist/static/v0.1.10/lucida.js +0 -3
- /package/dist/static/{v0.1.10 → v0.1.12}/banner-TXLAMTQM.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-AWIQCFGN.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-B722OERZ.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-EFNCQJI3.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-IXDYCBAD.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/chunk-UPPUYIIH.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/consent.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/correlate.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/early-access.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/experiments.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/flags.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/forms.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/guides.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/host-headers.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/inspector.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/modules-FANMZRDJ.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/persistent-G2OR2L2N.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/recommendations.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/toolbar.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/validation-S6TYVWAI.js +0 -0
- /package/dist/static/{v0.1.10 → v0.1.12}/webmcp.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as rr,d as nr,h as sr,i as ar,j as kt}from"./chunk-UPPUYIIH.js";import{b as or,c as ir}from"./chunk-EFNCQJI3.js";var $n=Object.defineProperty,Hn=(e,t,r)=>t in e?$n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t,r)=>Hn(e,typeof t!="symbol"?t+"":t,r),lr,L=(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[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),A=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(A||{}),ce=(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))(ce||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ue||{}),Ae=(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))(Ae||{}),ee=(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))(ee||{}),ur={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Et={},dr=0,Wn=()=>!!globalThis.Zone;function Ht(e){if(Ge[e])return Ge[e];let t=globalThis[e],r=t.prototype,n=e in ur?ur[e]:void 0,o=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in cr?cr[e]:void 0,s=!!(i&&i.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(o&&s&&!Wn())return Ge[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;if(!c)return a.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Et[e]=()=>a.remove()):a.remove(),Ge[e]=c}catch{return r}}var Mt={};function he(e,t,r){var n,o;let i=(n=Mt[e])==null?void 0:n[r];if(i)return i.call(t);let s=Ht(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?((Mt[e]||(Mt[e]={}))[r]=a,a.call(t)):t[r]}var xt={};function kr(e,t,r){let n=`${e}.${String(r)}`;if(xt[n])return xt[n].bind(t);let i=Ht(e)[r];return typeof i!="function"?t[r]:(xt[n]=i,i.bind(t))}function Gn(e){return he("Node",e,"ownerDocument")}function jn(e){return he("Node",e,"childNodes")}function qn(e){return he("Node",e,"parentNode")}function Vn(e){return he("Node",e,"parentElement")}function Xn(e){return he("Node",e,"textContent")}function Zn(e){return he("Node",e,"firstChild")}function Kn(e){return he("Node",e,"lastChild")}function Yn(e){return he("Node",e,"nextSibling")}function Jn(e){return he("Node",e,"previousSibling")}function Qn(e,t){return kr("Node",e,"contains")(t)}function eo(e){return kr("Node",e,"getRootNode")()}function to(e){return!e||!("host"in e)?null:he("ShadowRoot",e,"host")}function ro(e){return e.styleSheets}function no(e){return!e||!("shadowRoot"in e)?null:he("Element",e,"shadowRoot")}function oo(e,t){return he("Element",e,"querySelector")(t)}function io(e,t){return he("Element",e,"querySelectorAll")(t)}function Mr(){let e=Ht("MutationObserver");dr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--dr!==0))return;let r=Et.MutationObserver;if(r)try{r()}finally{delete Ge.MutationObserver,delete Et.MutationObserver}}]}var Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Te(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()=>{}}}var M={ownerDocument:Gn,childNodes:jn,parentNode:qn,parentElement:Vn,textContent:Xn,firstChild:Zn,lastChild:Kn,nextSibling:Yn,previousSibling:Jn,contains:Qn,getRootNode:eo,host:to,styleSheets:ro,shadowRoot:no,querySelector:oo,querySelectorAll:io,nowTimestamp:Xe,mutationObserverCtor:Mr,patch:Te};function xr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function so(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 ao(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 Tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,o=>Rr(o,r)).join("");return so(n)}catch{return null}}function Rr(e,t){if(uo(e)){let r;try{r=Tt(e.styleSheet)||ao(e)}catch{r=e.cssText}return e.styleSheet.href?pt(r,e.styleSheet.href):r}else{let r=e.cssText;return co(e)&&e.selectorText.includes(":")&&(r=lo(r)),t?pt(r,t):r}}function lo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function uo(e){return"styleSheet"in e}function co(e){return"selectorText"in e}var dt=class{constructor(){v(this,"idNodeMap",new Map),v(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.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(o=>this.removeNodeFromMap(o));let n=M.shadowRoot(t);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 fo(){return new dt}function ft({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"",a=n&&Ee(n);return(t[r.toLowerCase()]||a&&t[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function Ee(e){return e.toLowerCase()}var fr="__rrweb_original__";function ho(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 i=t.getImageData,s=fr in i?i[fr]:i;if(new Uint32Array(s.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ht(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ee(t):null}function Ir(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(n);return o?.[1]??null}function po(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,go=/^(?:[a-z+]+:)?\/\//i,yo=/^www\..*/i,vo=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(mo,(r,n,o,i,s,a)=>{let l=o||s||a,c=n||i||"";if(!l)return r;if(go.test(l)||yo.test(l))return`url(${c}${l}${c})`;if(vo.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${po(t)+l}${c})`;let u=l.split("#")[0],p=l.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${c}${f.join("/")}${p}${c})`})}var Er="(?:/\\*[^*]*\\*/)|[\\s;]",wo=new RegExp(`${Er}|\\b(0)px?`,"g"),bo=new RegExp(Er,"g");function st(e,t=!1){return t?e.replace(bo,""):e.replace(wo,"$1")}function So(e,t,r=!1){let n=Array.from(t.childNodes),o=[],i=0;if(n.length>1&&e&&typeof e=="string"){let s=st(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=st(n[l].textContent,r),u=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let f=c.substring(0,p),h=s.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")m=s.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=s.split(f),h.length<=1)return o.push(e),o;p=u+1}else p===c.length-1&&(m=s.indexOf(f));if(h.length>=2&&p>u){let d=n[l-1].textContent;if(d&&typeof d=="string"){let y=st(d).length;m=s.indexOf(f,y)}m===-1&&(m=h[0].length)}if(m!==-1){let d=Math.floor(m/a);for(;d>0&&d<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;let y=st(e.substring(0,d),r);if(y.length===m){o.push(e.substring(0,d)),e=e.substring(d),s=s.substring(m);break}else y.length<m?d+=Math.max(1,Math.floor((m-y.length)/a)):d-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return o.push(e),o}function Co(e,t){return So(e,t).join("/* rr_split */")}var ko=1,Mo=new RegExp("[^a-z0-9-_:]"),mt=-2;function Tr(){return ko++}function xo(e){if(e instanceof HTMLFormElement)return"form";let t=Ee(e.tagName);return Mo.test(t)?"div":t}var Le,hr,Ro=/^[^ \t\n\r\u000c]+/,Io=/^[, \t\n\r\u000c]+/;function Eo(e,t){if(t.trim()==="")return t;let r=0;function n(i){let s,a=i.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let o=[];for(;n(Io),!(r>=t.length);){let i=n(Ro);if(i.slice(-1)===",")i=_e(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=_e(e,i);let a=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return o.join(", ")}var pr=new WeakMap;function _e(e,t){return!t||t.trim()===""?t:Wt(e,t)}function To(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Wt(e,t){let r=pr.get(e);if(r||(r=e.createElement("a"),pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Or(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?_e(e,n):r==="srcset"?Eo(e,n):r==="style"?pt(n,Wt(e)):t==="object"&&r==="data"?_e(e,n):n)}function Nr(e,t,r){return["video","audio"].includes(e)&&Ee(t)==="autoplay"}function Oo(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function gt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?gt(M.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}return r?gt(M.parentNode(e),t,r):!1}function Lr(e,t,r,n){let o;if(xr(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(gt(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function No(e,t,r){let n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Lo(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Ao(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d=!1,cssCaptured:y=!1}=t,S=Do(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ee.Document,childNodes:[],compatMode:e.compatMode}:{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d,rootId:S});case e.TEXT_NODE:return _o(e,{doc:r,needsMask:s,maskTextFn:c,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ee.Comment,textContent:M.textContent(e)||"",rootId:S};default:return!1}}function Do(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function _o(e,t){let{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=M.textContent(e),c&&l&&(l=pt(l,Wt(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M.parentElement(e)):l.replace(/[\S]/g,"*")),{type:ee.Text,textContent:l||"",rootId:o}}function Fo(e,t){let{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:h}=t,m=Oo(e,n,o),d=xo(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let b=e.attributes[g];Nr(d,b.name,b.value)||(y[b.name]=Or(r,d,Ee(b.name),b.value))}if(d==="link"&&i){let g=Array.from(r.styleSheets).find(k=>k.href===e.href),b=null;g&&(b=Tt(g)),b&&(delete y.rel,delete y.href,y._cssText=b)}if(d==="style"&&e.sheet){let g=Tt(e.sheet);g&&(e.childNodes.length>1&&(g=Co(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(d)){let g=e.value,b=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ft({element:e,type:ht(e),tagName:d,value:g,maskInputOptions:s,maskInputFn:a}):b&&(y.checked=b)}if(d==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),d==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&u){if(e.__context==="2d")ho(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),b=r.createElement("canvas");b.width=e.width,b.height=e.height;let k=b.toDataURL(l.type,l.quality);g!==k&&(y.rr_dataURL=g)}}if(d==="img"&&c){Le||(Le=r.createElement("canvas"),hr=Le.getContext("2d"));let g=e,b=g.currentSrc||g.getAttribute("src")||"<unknown-src>",k=g.crossOrigin,x=()=>{g.removeEventListener("load",x);try{Le.width=g.naturalWidth,Le.height=g.naturalHeight,hr.drawImage(g,0,0),y.rr_dataURL=Le.toDataURL(l.type,l.quality)}catch(E){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${b}! Error: ${E}`)}g.crossOrigin==="anonymous"&&(k?y.crossOrigin=k:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x)}if(["audio","video"].includes(d)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:g,height:b}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${b}px`}}d==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(d)&&(w=!0)}catch{}return{type:ee.Element,tagName:d,attributes:y,childNodes:[],isSVG:To(e)||void 0,needBlock:m,rootId:h,isCustom:w}}function $(e){return e==null?"":e.toLowerCase()}function Ar(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function zo(e,t){if(t.comment&&e.type===ee.Comment)return!0;if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ir(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&($(e.attributes.name).match(/^msapplication-tile(image|color)$/)||$(e.attributes.name)==="application-name"||$(e.attributes.rel)==="icon"||$(e.attributes.rel)==="apple-touch-icon"||$(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&$(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&($(e.attributes.property).match(/^(og|twitter|fb):/)||$(e.attributes.name).match(/^(og|twitter):/)||$(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&($(e.attributes.name)==="robots"||$(e.attributes.name)==="googlebot"||$(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&($(e.attributes.name)==="author"||$(e.attributes.name)==="generator"||$(e.attributes.name)==="framework"||$(e.attributes.name)==="publisher"||$(e.attributes.name)==="progid"||$(e.attributes.property).match(/^article:/)||$(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&($(e.attributes.name)==="google-site-verification"||$(e.attributes.name)==="yandex-verification"||$(e.attributes.name)==="csrf-token"||$(e.attributes.name)==="p:domain_verify"||$(e.attributes.name)==="verify-v1"||$(e.attributes.name)==="verification"||$(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Fe(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:d=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:P=!0}=t;R||(R=Lr(e,s,a,R===void 0));let H=Ao(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,dataURLOptions:m,inlineImages:d,recordCanvas:y,keepIframeSrcFn:x,newlyAddedElement:E,cssCaptured:I});if(!H)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):zo(H,h)||!P&&H.type===ee.Text&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?U=mt:U=Tr();let T=Object.assign(H,{id:U});if(n.add(e,T),U===mt)return null;S&&S(e);let X=!l;if(T.type===ee.Element){X=X&&!T.needBlock,delete T.needBlock;let N=M.shadowRoot(e);N&&qe(N)&&(T.isShadowHost=!0)}if((T.type===ee.Document||T.type===ee.Element)&&X){h.headWhitespace&&T.type===ee.Element&&T.tagName==="head"&&(P=!1);let N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(!(T.type===ee.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===ee.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(N.cssCaptured=!0);for(let W of Array.from(M.childNodes(e))){let G=Fe(W,N);G&&T.childNodes.push(G)}}let F=null;if(xr(e)&&(F=M.shadowRoot(e)))for(let W of Array.from(M.childNodes(F))){let G=Fe(W,N);G&&(qe(F)&&(G.isShadow=!0),T.childNodes.push(G))}}let K=M.parentNode(e);return K&&je(K)&&qe(K)&&(T.isShadow=!0),T.type===ee.Element&&T.tagName==="iframe"&&No(e,()=>{let N=e.contentDocument;if(N&&w){let F=Fe(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:k,keepIframeSrcFn:x});F&&w(e,F)}},g),T.type===ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Ir(T.attributes.href)==="css")&&Lo(e,()=>{if(b){let N=Fe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:k,keepIframeSrcFn:x});N&&b(e,N)}},k),T}function Po(e,t){let{mirror:r=new dt,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:f,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:b,keepIframeSrcFn:k=()=>!1}=t,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}:u===!1?{password:!0}:u,E=Ar(h);return Fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:p,maskInputFn:f,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:b,keepIframeSrcFn:k,newlyAddedElement:!1})}var Ot=class e{constructor(...t){v(this,"parentElement",null),v(this,"parentNode",null),v(this,"ownerDocument"),v(this,"firstChild",null),v(this,"lastChild",null),v(this,"previousSibling",null),v(this,"nextSibling",null),v(this,"ELEMENT_NODE",1),v(this,"TEXT_NODE",3),v(this,"nodeType"),v(this,"nodeName"),v(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}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 re(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var De=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
import{b as rr,d as nr,h as sr,i as ar,j as kt}from"./chunk-UPPUYIIH.js";import{b as or,c as ir}from"./chunk-EFNCQJI3.js";var Bn=Object.defineProperty,Hn=(e,t,r)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t,r)=>Hn(e,typeof t!="symbol"?t+"":t,r),lr,L=(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[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),A=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(A||{}),ce=(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))(ce||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ue||{}),Ae=(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))(Ae||{}),ee=(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))(ee||{}),ur={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Et={},fr=0,Wn=()=>!!globalThis.Zone;function Ht(e){if(Ge[e])return Ge[e];let t=globalThis[e],r=t.prototype,n=e in ur?ur[e]:void 0,o=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in cr?cr[e]:void 0,s=!!(i&&i.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(o&&s&&!Wn())return Ge[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;if(!c)return a.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Et[e]=()=>a.remove()):a.remove(),Ge[e]=c}catch{return r}}var Mt={};function he(e,t,r){var n,o;let i=(n=Mt[e])==null?void 0:n[r];if(i)return i.call(t);let s=Ht(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?((Mt[e]||(Mt[e]={}))[r]=a,a.call(t)):t[r]}var Rt={};function kr(e,t,r){let n=`${e}.${String(r)}`;if(Rt[n])return Rt[n].bind(t);let i=Ht(e)[r];return typeof i!="function"?t[r]:(Rt[n]=i,i.bind(t))}function Gn(e){return he("Node",e,"ownerDocument")}function jn(e){return he("Node",e,"childNodes")}function qn(e){return he("Node",e,"parentNode")}function Vn(e){return he("Node",e,"parentElement")}function Xn(e){return he("Node",e,"textContent")}function Zn(e){return he("Node",e,"firstChild")}function Kn(e){return he("Node",e,"lastChild")}function Yn(e){return he("Node",e,"nextSibling")}function Jn(e){return he("Node",e,"previousSibling")}function Qn(e,t){return kr("Node",e,"contains")(t)}function eo(e){return kr("Node",e,"getRootNode")()}function to(e){return!e||!("host"in e)?null:he("ShadowRoot",e,"host")}function ro(e){return e.styleSheets}function no(e){return!e||!("shadowRoot"in e)?null:he("Element",e,"shadowRoot")}function oo(e,t){return he("Element",e,"querySelector")(t)}function io(e,t){return he("Element",e,"querySelectorAll")(t)}function Mr(){let e=Ht("MutationObserver");fr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--fr!==0))return;let r=Et.MutationObserver;if(r)try{r()}finally{delete Ge.MutationObserver,delete Et.MutationObserver}}]}var Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Te(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()=>{}}}var M={ownerDocument:Gn,childNodes:jn,parentNode:qn,parentElement:Vn,textContent:Xn,firstChild:Zn,lastChild:Kn,nextSibling:Yn,previousSibling:Jn,contains:Qn,getRootNode:eo,host:to,styleSheets:ro,shadowRoot:no,querySelector:oo,querySelectorAll:io,nowTimestamp:Xe,mutationObserverCtor:Mr,patch:Te};function Rr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function so(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 ao(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 Tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,o=>xr(o,r)).join("");return so(n)}catch{return null}}function xr(e,t){if(uo(e)){let r;try{r=Tt(e.styleSheet)||ao(e)}catch{r=e.cssText}return e.styleSheet.href?pt(r,e.styleSheet.href):r}else{let r=e.cssText;return co(e)&&e.selectorText.includes(":")&&(r=lo(r)),t?pt(r,t):r}}function lo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function uo(e){return"styleSheet"in e}function co(e){return"selectorText"in e}var ft=class{constructor(){v(this,"idNodeMap",new Map),v(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.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(o=>this.removeNodeFromMap(o));let n=M.shadowRoot(t);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 fo(){return new ft}function dt({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"",a=n&&Ee(n);return(t[r.toLowerCase()]||a&&t[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function Ee(e){return e.toLowerCase()}var dr="__rrweb_original__";function ho(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 i=t.getImageData,s=dr in i?i[dr]:i;if(new Uint32Array(s.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ht(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ee(t):null}function Ir(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(n);return o?.[1]??null}function po(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,go=/^(?:[a-z+]+:)?\/\//i,yo=/^www\..*/i,vo=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(mo,(r,n,o,i,s,a)=>{let l=o||s||a,c=n||i||"";if(!l)return r;if(go.test(l)||yo.test(l))return`url(${c}${l}${c})`;if(vo.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${po(t)+l}${c})`;let u=l.split("#")[0],p=l.substring(u.length),d=t.split("#")[0].split("/"),h=u.split("/");d.pop();for(let m of h)m!=="."&&(m===".."?d.pop():d.push(m));return`url(${c}${d.join("/")}${p}${c})`})}var Er="(?:/\\*[^*]*\\*/)|[\\s;]",wo=new RegExp(`${Er}|\\b(0)px?`,"g"),bo=new RegExp(Er,"g");function st(e,t=!1){return t?e.replace(bo,""):e.replace(wo,"$1")}function So(e,t,r=!1){let n=Array.from(t.childNodes),o=[],i=0;if(n.length>1&&e&&typeof e=="string"){let s=st(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=st(n[l].textContent,r),u=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let d=c.substring(0,p),h=s.split(d),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")m=s.indexOf(d,1);else if(h.length===1){if(d=d.substring(0,d.length-1),h=s.split(d),h.length<=1)return o.push(e),o;p=u+1}else p===c.length-1&&(m=s.indexOf(d));if(h.length>=2&&p>u){let f=n[l-1].textContent;if(f&&typeof f=="string"){let y=st(f).length;m=s.indexOf(d,y)}m===-1&&(m=h[0].length)}if(m!==-1){let f=Math.floor(m/a);for(;f>0&&f<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;let y=st(e.substring(0,f),r);if(y.length===m){o.push(e.substring(0,f)),e=e.substring(f),s=s.substring(m);break}else y.length<m?f+=Math.max(1,Math.floor((m-y.length)/a)):f-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return o.push(e),o}function Co(e,t){return So(e,t).join("/* rr_split */")}var ko=1,Mo=new RegExp("[^a-z0-9-_:]"),mt=-2;function Tr(){return ko++}function Ro(e){if(e instanceof HTMLFormElement)return"form";let t=Ee(e.tagName);return Mo.test(t)?"div":t}var Le,hr,xo=/^[^ \t\n\r\u000c]+/,Io=/^[, \t\n\r\u000c]+/;function Eo(e,t){if(t.trim()==="")return t;let r=0;function n(i){let s,a=i.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let o=[];for(;n(Io),!(r>=t.length);){let i=n(xo);if(i.slice(-1)===",")i=_e(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=_e(e,i);let a=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return o.join(", ")}var pr=new WeakMap;function _e(e,t){return!t||t.trim()===""?t:Wt(e,t)}function To(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Wt(e,t){let r=pr.get(e);if(r||(r=e.createElement("a"),pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Or(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?_e(e,n):r==="srcset"?Eo(e,n):r==="style"?pt(n,Wt(e)):t==="object"&&r==="data"?_e(e,n):n)}function Nr(e,t,r){return["video","audio"].includes(e)&&Ee(t)==="autoplay"}function Oo(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function gt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?gt(M.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}return r?gt(M.parentNode(e),t,r):!1}function Lr(e,t,r,n){let o;if(Rr(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(gt(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function No(e,t,r){let n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Lo(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Ao(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f=!1,cssCaptured:y=!1}=t,S=Do(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ee.Document,childNodes:[],compatMode:e.compatMode}:{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:d,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f,rootId:S});case e.TEXT_NODE:return _o(e,{doc:r,needsMask:s,maskTextFn:c,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ee.Comment,textContent:M.textContent(e)||"",rootId:S};default:return!1}}function Do(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function _o(e,t){let{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=M.textContent(e),c&&l&&(l=pt(l,Wt(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M.parentElement(e)):l.replace(/[\S]/g,"*")),{type:ee.Text,textContent:l||"",rootId:o}}function Fo(e,t){let{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:d=!1,rootId:h}=t,m=Oo(e,n,o),f=Ro(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let b=e.attributes[g];Nr(f,b.name,b.value)||(y[b.name]=Or(r,f,Ee(b.name),b.value))}if(f==="link"&&i){let g=Array.from(r.styleSheets).find(k=>k.href===e.href),b=null;g&&(b=Tt(g)),b&&(delete y.rel,delete y.href,y._cssText=b)}if(f==="style"&&e.sheet){let g=Tt(e.sheet);g&&(e.childNodes.length>1&&(g=Co(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(f)){let g=e.value,b=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=dt({element:e,type:ht(e),tagName:f,value:g,maskInputOptions:s,maskInputFn:a}):b&&(y.checked=b)}if(f==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),f==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),f==="canvas"&&u){if(e.__context==="2d")ho(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),b=r.createElement("canvas");b.width=e.width,b.height=e.height;let k=b.toDataURL(l.type,l.quality);g!==k&&(y.rr_dataURL=g)}}if(f==="img"&&c){Le||(Le=r.createElement("canvas"),hr=Le.getContext("2d"));let g=e,b=g.currentSrc||g.getAttribute("src")||"<unknown-src>",k=g.crossOrigin,R=()=>{g.removeEventListener("load",R);try{Le.width=g.naturalWidth,Le.height=g.naturalHeight,hr.drawImage(g,0,0),y.rr_dataURL=Le.toDataURL(l.type,l.quality)}catch(E){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?R():g.addEventListener("load",R);return}else console.warn(`Cannot inline img src=${b}! Error: ${E}`)}g.crossOrigin==="anonymous"&&(k?y.crossOrigin=k:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?R():g.addEventListener("load",R)}if(["audio","video"].includes(f)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(d||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:g,height:b}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${b}px`}}f==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(f)&&(w=!0)}catch{}return{type:ee.Element,tagName:f,attributes:y,childNodes:[],isSVG:To(e)||void 0,needBlock:m,rootId:h,isCustom:w}}function B(e){return e==null?"":e.toLowerCase()}function Ar(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function zo(e,t){if(t.comment&&e.type===ee.Comment)return!0;if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ir(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||B(e.attributes.name)==="application-name"||B(e.attributes.rel)==="icon"||B(e.attributes.rel)==="apple-touch-icon"||B(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||B(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(B(e.attributes.name)==="robots"||B(e.attributes.name)==="googlebot"||B(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(B(e.attributes.name)==="author"||B(e.attributes.name)==="generator"||B(e.attributes.name)==="framework"||B(e.attributes.name)==="publisher"||B(e.attributes.name)==="progid"||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(B(e.attributes.name)==="google-site-verification"||B(e.attributes.name)==="yandex-verification"||B(e.attributes.name)==="csrf-token"||B(e.attributes.name)==="p:domain_verify"||B(e.attributes.name)==="verify-v1"||B(e.attributes.name)==="verification"||B(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Fe(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1}=t,{needsMask:x}=t,{preserveWhiteSpace:P=!0}=t;x||(x=Lr(e,s,a,x===void 0));let H=Ao(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,dataURLOptions:m,inlineImages:f,recordCanvas:y,keepIframeSrcFn:R,newlyAddedElement:E,cssCaptured:I});if(!H)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):zo(H,h)||!P&&H.type===ee.Text&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?U=mt:U=Tr();let T=Object.assign(H,{id:U});if(n.add(e,T),U===mt)return null;S&&S(e);let X=!l;if(T.type===ee.Element){X=X&&!T.needBlock,delete T.needBlock;let N=M.shadowRoot(e);N&&qe(N)&&(T.isShadowHost=!0)}if((T.type===ee.Document||T.type===ee.Element)&&X){h.headWhitespace&&T.type===ee.Element&&T.tagName==="head"&&(P=!1);let N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:x,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:k,keepIframeSrcFn:R,cssCaptured:!1};if(!(T.type===ee.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===ee.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(N.cssCaptured=!0);for(let W of Array.from(M.childNodes(e))){let G=Fe(W,N);G&&T.childNodes.push(G)}}let F=null;if(Rr(e)&&(F=M.shadowRoot(e)))for(let W of Array.from(M.childNodes(F))){let G=Fe(W,N);G&&(qe(F)&&(G.isShadow=!0),T.childNodes.push(G))}}let K=M.parentNode(e);return K&&je(K)&&qe(K)&&(T.isShadow=!0),T.type===ee.Element&&T.tagName==="iframe"&&No(e,()=>{let N=e.contentDocument;if(N&&w){let F=Fe(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:x,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:k,keepIframeSrcFn:R});F&&w(e,F)}},g),T.type===ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Ir(T.attributes.href)==="css")&&Lo(e,()=>{if(b){let N=Fe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:x,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:b,stylesheetLoadTimeout:k,keepIframeSrcFn:R});N&&b(e,N)}},k),T}function Po(e,t){let{mirror:r=new ft,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:d,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:b,keepIframeSrcFn:k=()=>!1}=t,R=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}:u===!1?{password:!0}:u,E=Ar(h);return Fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:R,maskTextFn:p,maskInputFn:d,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:b,keepIframeSrcFn:k,newlyAddedElement:!1})}var Ot=class e{constructor(...t){v(this,"parentElement",null),v(this,"parentNode",null),v(this,"ownerDocument"),v(this,"firstChild",null),v(this,"lastChild",null),v(this,"previousSibling",null),v(this,"nextSibling",null),v(this,"ELEMENT_NODE",1),v(this,"TEXT_NODE",3),v(this,"nodeType"),v(this,"nodeName"),v(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}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 re(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var De=`Please stop import mirror directly. Instead of that,\r
|
|
2
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
|
-
or you can use record.mirror to access the mirror instance during recording.`,mr={map:{},getId(){return console.error(De),-1},getNode(){return console.error(De),null},removeNodeFromMap(){console.error(De)},has(){return console.error(De),!1},reset(){console.error(De)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mr=new Proxy(mr,{get(e,t,r){return t==="map"&&console.error(De),Reflect.get(e,t,r)}}));function Ze(e,t,r={}){let n=null,o=0;return function(...i){let s=Date.now();!o&&r.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=s,e.apply(l,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},a))}}function wt(e,t,r,n,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>wt(e,t,i||{},!0)}function Dr(e){var t,r,n,o;let i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||i?.body&&((t=M.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i?.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||i?.body&&((n=M.parentElement(i.body))==null?void 0:n.scrollTop)||((o=i?.body)==null?void 0:o.scrollTop)||0}}function _r(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zr(e){return e?e.nodeType===e.ELEMENT_NODE?e:M.parentElement(e):null}function le(e,t,r,n){if(!e)return!1;let o=zr(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(gt(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Uo(e,t){return t.getId(e)!==-1}function Rt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===mt}function Pr(e,t){if(je(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=M.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?Pr(n,t):!0}function Nt(e){return!!e.changedTouches}function Bo(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)}function Ur(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Br(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Lt(e){return e?e instanceof Ot&&"shadowRoot"in e?!!e.shadowRoot:!!M.shadowRoot(e):!1}var At=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(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 $r(e){var t;let r=null;return"getRootNode"in e&&((t=M.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(e))&&(r=M.host(M.getRootNode(e))),r}function $o(e){let t=e,r;for(;r=$r(t);)t=r;return t}function Ho(e){let t=M.ownerDocument(e);if(!t)return!1;let r=$o(e);return M.contains(t,r)}function Dt(e){let t=M.ownerDocument(e);return t?M.contains(t,e)||Ho(e):!1}var gr=(e,t)=>`${e}@${t}`,_t=class{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet){let h=M.parentNode(f);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(f)}let n=null,o=null,i=-1,s=null,a=!1,l=new Set,c=this.addedSet.values(),u=c.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(M.previousSibling(n)))s=n,n=M.previousSibling(n);else{for(this.addedSet.has(u.value)||(u=c.next()),n=u.value;;){if(o=M.parentNode(n),this.addedSet.has(o)){n=o;continue}break}if(l.has(o))o=null;else if(o){if(Dt(o)?(a=yr(this.droppedSet,o)||this.removesSubTreeCache.has(o),a&&yr(this.movedSet,n)&&(a=!1)):a=!0,this.addedSet.has(M.lastChild(o)))n=M.lastChild(o),s=null;else for(;;){if(s=M.nextSibling(n),this.addedSet.has(s)){n=s;continue}break}if(i=je(o)?this.mirror.getId($r(n)):this.mirror.getId(o),i===-1&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=M.host(o);i=this.mirror.getId(d)}}}if(this.addedSet.delete(n),!o||i===-1){l.add(n);continue}else if(a){this.droppedSet.add(n);continue}let f=!1;if(n.nodeType===Node.TEXT_NODE){let d=o.tagName;if(d==="TEXTAREA")continue;d==="STYLE"&&r.has(i)&&(f=!0)}let h=s?this.mirror.getId(s):null;for(;h===mt;)s=s&&M.nextSibling(s),h=s&&this.mirror.getId(s);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",s),n=null;continue}let m=Fe(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{Ur(d,this.mirror)&&this.iframeManager.addIframe(d),Br(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Lt(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(d,y)=>{this.iframeManager.attachIframe(d,y),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,y)=>{this.stylesheetManager.attachLinkElement(d,y)},cssCaptured:f});m&&(t.push({parentId:i,nextId:h,node:m}),r.add(m.id))}let p={texts:this.texts.map(f=>{let h=f.node,m=M.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:f.value}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:h}=f;if(typeof h.style=="string"){let m=JSON.stringify(f.styleDiff),d=JSON.stringify(f._unchangedStyles);m.length<h.style.length&&(m+d).split("var(").length===h.style.split("var(").length&&(h.style=f.styleDiff)}return{id:this.mirror.getId(f.node),attributes:h}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:t};!p.texts.length&&!p.attributes.length&&!p.removes.length&&!p.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(p))}),v(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(M.childNodes(t),o=>M.textContent(o)||"").join("");r.attributes.value=ft({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ht(t),value:n,maskInputFn:this.maskInputFn})}),v(this,"processMutation",t=>{if(!Rt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=M.textContent(t.target);!le(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Lr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,zr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=Ee(r.tagName),o=t.attributeName,i=t.target.getAttribute(o);if(o==="value"){let a=ht(r);i=ft({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(le(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n==="iframe"&&o==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)o="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),o==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Nr(n,o))if(s.attributes[o]=Or(this.doc,n,Ee(o),i),o==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(let l of Array.from(r.style)){let c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?u===""?s.styleDiff[l]=c:s.styleDiff[l]=[c,u]:s._unchangedStyles[l]=[c,u]}for(let l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}else o==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":{if(le(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{Dt(r)||this.shadowDomManager.removeShadowRootsIn(r);let n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);le(t.target,this.blockClass,this.blockSelector,!1)||Rt(r,this.mirror,this.slimDOMOptions)||!Uo(r,this.mirror)||(this.addedSet.has(r)?(Ft(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Pr(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Ft(this.movedSet,r):(this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&qe(t.target)?!0:void 0}),Wo(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),v(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Rt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);le(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach(n=>this.genAdds(n)),Lt(t)&&M.childNodes(M.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function Ft(e,t){e.delete(t),M.childNodes(t).forEach(r=>Ft(e,r))}function Wo(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),M.childNodes(n).forEach(o=>r.push(o)))}}function yr(e,t){return e.size===0?!1:Hr(e,t)}function Hr(e,t){if(e.has(t))return!0;let r=M.parentNode(t);return r?Hr(e,r):!1}var Ve;function Go(e){Ve=e}function jo(){Ve=void 0}var _=e=>Ve?(...r)=>{try{return e(...r)}catch(n){if(Ve&&Ve(n)===!0)return;throw n}}:e,Pe=new Set;function Ye(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Wr(e,t){let r=new _t;Pe.add(r),r.init(e);let[n,o]=Mr(),i=new n(_(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{i.disconnect(),Pe.delete(r),o()}}function qo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Ze(_(p=>{let f=Date.now()-a;e(s.map(h=>(h.timeOffset-=f,h)),p),s=[],a=null}),i),c=_(Ze(_(p=>{let f=Ye(p),{clientX:h,clientY:m}=Nt(p)?p.changedTouches[0]:p;a||(a=Xe()),s.push({x:h,y:m,id:n.getId(f),timeOffset:Xe()-a}),l(typeof DragEvent<"u"&&p instanceof DragEvent?A.Drag:p instanceof MouseEvent?A.MouseMove:A.TouchMove)}),o,{trailing:!1})),u=[re("mousemove",c,r),re("touchmove",c,r),re("drag",c,r)];return _(()=>{u.forEach(p=>p())})}function Vo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,a=[],l=null,c=u=>p=>{let f=Ye(p);if(le(f,n,o,!0))return;let h=null,m=u;if("pointerType"in p){switch(p.pointerType){case"mouse":h=Ce.Mouse;break;case"touch":h=Ce.Touch;break;case"pen":h=Ce.Pen;break}h===Ce.Touch?ce[u]===ce.MouseDown?m="TouchStart":ce[u]===ce.MouseUp&&(m="TouchEnd"):Ce.Pen}else Nt(p)&&(h=Ce.Touch);h!==null?(l=h,(m.startsWith("Touch")&&h===Ce.Touch||m.startsWith("Mouse")&&h===Ce.Mouse)&&(h=null)):ce[u]===ce.Click&&(h=l,l=null);let d=Nt(p)?p.changedTouches[0]:p;if(!d)return;let y=r.getId(f),{clientX:S,clientY:w}=d;_(e)({type:ce[m],id:y,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(ce).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let p=Ee(u),f=c(u);if(window.PointerEvent)switch(ce[u]){case ce.MouseDown:case ce.MouseUp:p=p.replace("mouse","pointer");break;case ce.TouchStart:case ce.TouchEnd:return}a.push(re(p,f,t))}),_(()=>{a.forEach(u=>u())})}function Gr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let s=_(Ze(_(a=>{let l=Ye(a);if(!l||le(l,n,o,!0))return;let c=r.getId(l);if(l===t&&t.defaultView){let u=Dr(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100));return re("scroll",s,t)}function Xo({viewportResizeCb:e},{win:t}){let r=-1,n=-1,o=_(Ze(_(()=>{let i=_r(),s=Fr();(r!==i||n!==s)&&(e({width:Number(s),height:Number(i)}),r=i,n=s)}),200));return re("resize",o,t)}var Zo=["INPUT","TEXTAREA","SELECT"],vr=new WeakMap;function Ko({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function p(w){let g=Ye(w),b=w.isTrusted,k=g&&g.tagName;if(g&&k==="OPTION"&&(g=M.parentElement(g)),!g||!k||Zo.indexOf(k)<0||le(g,n,o,!0)||g.classList.contains(i)||s&&g.matches(s))return;let x=g.value,E=!1,I=ht(g)||"";I==="radio"||I==="checkbox"?E=g.checked:(a[k.toLowerCase()]||a[I])&&(x=ft({element:g,maskInputOptions:a,tagName:k,type:I,value:x,maskInputFn:l})),f(g,u?{text:x,isChecked:E,userTriggered:b}:{text:x,isChecked:E});let R=g.name;I==="radio"&&R&&E&&t.querySelectorAll(`input[type="radio"][name="${R}"]`).forEach(P=>{if(P!==g){let H=P.value;f(P,u?{text:H,isChecked:!E,userTriggered:!1}:{text:H,isChecked:!E})}})}function f(w,g){let b=vr.get(w);if(!b||b.text!==g.text||b.isChecked!==g.isChecked){vr.set(w,g);let k=r.getId(w);_(e)({...g,id:k})}}let m=(c.input==="last"?["change"]:["input","change"]).map(w=>re(w,_(p),t)),d=t.defaultView;if(!d)return()=>{m.forEach(w=>w())};let y=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&m.push(...S.map(w=>wt(w[0],w[1],{set(){_(p)({target:this,isTrusted:!1})}},!1,d))),_(()=>{m.forEach(w=>w())})}function yt(e){let t=[];function r(n,o){if(at("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||at("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||at("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||at("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);return o.unshift(s),r(n.parentRule,o)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function Ie(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Yo({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:_((u,p,f)=>{let[h,m]=f,{id:d,styleId:y}=Ie(p,t,r.styleMirror);return(d&&d!==-1||y&&y!==-1)&&e({id:d,styleId:y,adds:[{rule:h,index:m}]}),u.apply(p,f)})}),n.CSSStyleSheet.prototype.addRule=function(u,p,f=this.cssRules.length){let h=`${u} { ${p} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,f])};let i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,removes:[{index:h}]}),u.apply(p,f)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,replace:h}),u.apply(p,f)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,replaceSync:h}),u.apply(p,f)})}));let l={};lt("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(lt("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),lt("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),lt("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,p])=>{c[u]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[u].insertRule,{apply:_((f,h,m)=>{let[d,y]=m,{id:S,styleId:w}=Ie(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:d,index:[...yt(h),y||0]}]}),f.apply(h,m)})}),p.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:_((f,h,m)=>{let[d]=m,{id:y,styleId:S}=Ie(h.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...yt(h),d]}]}),f.apply(h,m)})})}),_(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,p])=>{p.prototype.insertRule=c[u].insertRule,p.prototype.deleteRule=c[u].deleteRule})})}function jr({mirror:e,stylesheetManager:t},r){var n,o,i;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(M.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:i.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;let p=(u=l.set)==null?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return p}}),_(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Jo({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:_((a,l,c)=>{var u;let[p,f,h]=c;if(r.has(p))return i.apply(l,[p,f,h]);let{id:m,styleId:d}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,set:{property:p,value:f,priority:h},index:yt(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:_((a,l,c)=>{var u;let[p]=c;if(r.has(p))return s.apply(l,[p]);let{id:f,styleId:h}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,remove:{property:p},index:yt(l.parentRule)}),a.apply(l,c)})}),_(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Qo({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){let s=_(l=>Ze(_(c=>{let u=Ye(c);if(!u||le(u,t,r,!0))return;let{currentTime:p,volume:f,muted:h,playbackRate:m,loop:d}=u;e({type:l,id:n.getId(u),currentTime:p,volume:f,muted:h,playbackRate:m,loop:d})}),o.media||500)),a=[re("play",s(Ae.Play),i),re("pause",s(Ae.Pause),i),re("seeked",s(Ae.Seeked),i),re("volumechange",s(Ae.VolumeChange),i),re("ratechange",s(Ae.RateChange),i)];return _(()=>{a.forEach(l=>l())})}function ei({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(l,c,u){let p=new i(l,c,u);return o.set(p,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};let s=Te(t.fonts,"add",function(a){return function(l){return setTimeout(_(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=i}),n.push(s),_(()=>{n.forEach(a=>a())})}function ti(e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e,s=!0,a=_(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let p=0;p<u;p++){let f=l.getRangeAt(p),{startContainer:h,startOffset:m,endContainer:d,endOffset:y}=f;le(h,n,o,!0)||le(d,n,o,!0)||c.push({start:r.getId(h),startOffset:m,end:r.getId(d),endOffset:y})}i({ranges:c})});return a(),re("selectionchange",a)}function ri({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Te(r.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{console.warn(`Custom element callback failed for ${i}`)}return o.apply(this,[i,s,a])}})}function ni(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:p,fontCb:f,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...d)=>{t.mutation&&t.mutation(...d),r(...d)},e.mousemoveCb=(...d)=>{t.mousemove&&t.mousemove(...d),n(...d)},e.mouseInteractionCb=(...d)=>{t.mouseInteraction&&t.mouseInteraction(...d),o(...d)},e.scrollCb=(...d)=>{t.scroll&&t.scroll(...d),i(...d)},e.viewportResizeCb=(...d)=>{t.viewportResize&&t.viewportResize(...d),s(...d)},e.inputCb=(...d)=>{t.input&&t.input(...d),a(...d)},e.mediaInteractionCb=(...d)=>{t.mediaInteaction&&t.mediaInteaction(...d),l(...d)},e.styleSheetRuleCb=(...d)=>{t.styleSheetRule&&t.styleSheetRule(...d),c(...d)},e.styleDeclarationCb=(...d)=>{t.styleDeclaration&&t.styleDeclaration(...d),u(...d)},e.canvasMutationCb=(...d)=>{t.canvasMutation&&t.canvasMutation(...d),p(...d)},e.fontCb=(...d)=>{t.font&&t.font(...d),f(...d)},e.selectionCb=(...d)=>{t.selection&&t.selection(...d),h(...d)},e.customElementCb=(...d)=>{t.customElement&&t.customElement(...d),m(...d)}}function oi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ni(e,t);let n;e.recordDOM&&(n=Wr(e,e.doc));let o=qo(e),i=Vo(e),s=Gr(e),a=Xo(e,{win:r}),l=Ko(e),c=Qo(e),u=()=>{},p=()=>{},f=()=>{},h=()=>{};e.recordDOM&&(u=Yo(e,{win:r}),p=jr(e,e.doc),f=Jo(e,{win:r}),e.collectFonts&&(h=ei(e)));let m=ti(e),d=ri(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,r,S.options));return _(()=>{n?.(),o(),i(),s(),a(),l(),c(),u(),p(),f(),h(),m(),d(),y.forEach(S=>S())})}function at(e){return typeof window[e]<"u"}function lt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var vt=class{constructor(t){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,o){let i=n||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(r);return a||(a=this.generateIdFn(),i.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,o))}getRemoteId(t,r,n){let o=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=o.get(r);return i||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},zt=class{constructor(t){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new vt(Tr)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"unloadListener"),v(this,"attachedWindows",new Map),v(this,"messageHandler",r=>this.handleMessage(r)),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(n=this.loadListener)==null||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let r=t.contentWindow;if(!r||this.attachedWindows.has(r))return;let n=[],o=()=>{this.attachedWindows.delete(r),n.forEach(i=>{try{i()}catch{}})};this.attachedWindows.set(r,o),this.recordCrossOriginIframes&&n.push(re("message",this.messageHandler,r)),n.push(re("pagehide",i=>{var s;if(i.persisted)return;let a=r.document;o(),(s=this.unloadListener)==null||s.call(this,a)},r))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:L.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Annotation:case L.Plugin:return r;case L.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case L.IncrementalSnapshot:switch(r.data.source){case A.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);let i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(o.node,i)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.Drag:case A.TouchMove:case A.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(r.data,t,["id"]),r;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case A.Font:return r;case A.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case A.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(let i of o)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==ee.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Pt=class{constructor(t){v(this,"shadowDoms",new Map),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!qe(t)||this.shadowDoms.has(t))return;let n=[];this.shadowDoms.set(t,n);let o=Wr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);n.push(o),n.push(Gr({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===n&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),n.push(jr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let r=M.shadowRoot(t);r&&(this.shadowDoms.has(r)&&this.removeShadowRoot(r),this.removeShadowRootsIn(r)),M.childNodes(t).forEach(n=>this.removeShadowRootsIn(n))}removeShadowRoot(t){let r=this.shadowDoms.get(t);this.shadowDoms.delete(t),r?.forEach(It)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Te(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i),a=M.shadowRoot(this);return a&&Dt(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(It),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(r=>r.forEach(It))}};function It(e){try{e()}catch{}}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ii=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(We=0;We<ze.length;We++)ii[ze.charCodeAt(We)]=We;var We,si=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ze[t[r]>>2],o+=ze[(t[r]&3)<<4|t[r+1]>>4],o+=ze[(t[r+1]&15)<<2|t[r+2]>>6],o+=ze[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},wr=new Map;function ai(e,t){let r=wr.get(e);return r||(r=new Map,wr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var qr=(e,t,r)=>{if(!e||!(Xr(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=ai(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ut(e,t,r){if(e instanceof Array)return e.map(n=>ut(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=si(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ut(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:[ut(e.data,t,r),e.width,e.height]};if(Xr(e,t)||typeof e=="object"){let n=e.constructor.name,o=qr(e,t,r);return{rr_type:n,index:o}}}}return e}var Vr=(e,t,r)=>e.map(n=>ut(n,t,r)),Xr=(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 li(e,t,r,n){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Te(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return le(this.canvas,r,n,!0)||setTimeout(()=>{let u=Vr(c,t,this);e(this.canvas,{type:Ue["2D"],property:s,args:u})},0),l.apply(this,c)}});o.push(a)}catch{let a=wt(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Ue["2D"],property:s,args:[l],setter:!0})}});o.push(a)}return()=>{o.forEach(s=>s())}}function ui(e){return e==="experimental-webgl"?"webgl":e}function br(e,t,r,n){let o=[];try{let i=Te(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!le(this,t,r,!0)){let c=ui(a);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){let u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Sr(e,t,r,n,o,i){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let c=Te(e,l,function(u){return function(...p){let f=u.apply(this,p);if(qr(f,i,this),"tagName"in this.canvas&&!le(this.canvas,n,o,!0)){let h=Vr(p,i,this),m={type:t,property:l,args:h};r(this.canvas,m)}return f}});s.push(c)}catch{let c=wt(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});s.push(c)}return s}function ci(e,t,r,n){let o=[];return typeof t.WebGLRenderingContext<"u"&&o.push(...Sr(t.WebGLRenderingContext.prototype,Ue.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Sr(t.WebGL2RenderingContext.prototype,Ue.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}var Zr=`(function() {
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`,mr={map:{},getId(){return console.error(De),-1},getNode(){return console.error(De),null},removeNodeFromMap(){console.error(De)},has(){return console.error(De),!1},reset(){console.error(De)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mr=new Proxy(mr,{get(e,t,r){return t==="map"&&console.error(De),Reflect.get(e,t,r)}}));function Ze(e,t,r={}){let n=null,o=0;return function(...i){let s=Date.now();!o&&r.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=s,e.apply(l,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},a))}}function wt(e,t,r,n,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>wt(e,t,i||{},!0)}function Dr(e){var t,r,n,o;let i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||i?.body&&((t=M.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i?.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||i?.body&&((n=M.parentElement(i.body))==null?void 0:n.scrollTop)||((o=i?.body)==null?void 0:o.scrollTop)||0}}function _r(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zr(e){return e?e.nodeType===e.ELEMENT_NODE?e:M.parentElement(e):null}function le(e,t,r,n){if(!e)return!1;let o=zr(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(gt(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Uo(e,t){return t.getId(e)!==-1}function xt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===mt}function Pr(e,t){if(je(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=M.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?Pr(n,t):!0}function Nt(e){return!!e.changedTouches}function $o(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)}function Ur(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function $r(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Lt(e){return e?e instanceof Ot&&"shadowRoot"in e?!!e.shadowRoot:!!M.shadowRoot(e):!1}var At=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(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 Br(e){var t;let r=null;return"getRootNode"in e&&((t=M.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(e))&&(r=M.host(M.getRootNode(e))),r}function Bo(e){let t=e,r;for(;r=Br(t);)t=r;return t}function Ho(e){let t=M.ownerDocument(e);if(!t)return!1;let r=Bo(e);return M.contains(t,r)}function Dt(e){let t=M.ownerDocument(e);return t?M.contains(t,e)||Ho(e):!1}var gr=(e,t)=>`${e}@${t}`,_t=class{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let d of this.movedSet){let h=M.parentNode(d);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(d)}let n=null,o=null,i=-1,s=null,a=!1,l=new Set,c=this.addedSet.values(),u=c.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(M.previousSibling(n)))s=n,n=M.previousSibling(n);else{for(this.addedSet.has(u.value)||(u=c.next()),n=u.value;;){if(o=M.parentNode(n),this.addedSet.has(o)){n=o;continue}break}if(l.has(o))o=null;else if(o){if(Dt(o)?(a=yr(this.droppedSet,o)||this.removesSubTreeCache.has(o),a&&yr(this.movedSet,n)&&(a=!1)):a=!0,this.addedSet.has(M.lastChild(o)))n=M.lastChild(o),s=null;else for(;;){if(s=M.nextSibling(n),this.addedSet.has(s)){n=s;continue}break}if(i=je(o)?this.mirror.getId(Br(n)):this.mirror.getId(o),i===-1&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=M.host(o);i=this.mirror.getId(f)}}}if(this.addedSet.delete(n),!o||i===-1){l.add(n);continue}else if(a){this.droppedSet.add(n);continue}let d=!1;if(n.nodeType===Node.TEXT_NODE){let f=o.tagName;if(f==="TEXTAREA")continue;f==="STYLE"&&r.has(i)&&(d=!0)}let h=s?this.mirror.getId(s):null;for(;h===mt;)s=s&&M.nextSibling(s),h=s&&this.mirror.getId(s);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",s),n=null;continue}let m=Fe(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Ur(f,this.mirror)&&this.iframeManager.addIframe(f),$r(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Lt(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(f,y)=>{this.iframeManager.attachIframe(f,y),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,y)=>{this.stylesheetManager.attachLinkElement(f,y)},cssCaptured:d});m&&(t.push({parentId:i,nextId:h,node:m}),r.add(m.id))}let p={texts:this.texts.map(d=>{let h=d.node,m=M.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:d.value}}).filter(d=>!r.has(d.id)).filter(d=>this.mirror.has(d.id)),attributes:this.attributes.map(d=>{let{attributes:h}=d;if(typeof h.style=="string"){let m=JSON.stringify(d.styleDiff),f=JSON.stringify(d._unchangedStyles);m.length<h.style.length&&(m+f).split("var(").length===h.style.split("var(").length&&(h.style=d.styleDiff)}return{id:this.mirror.getId(d.node),attributes:h}}).filter(d=>!r.has(d.id)).filter(d=>this.mirror.has(d.id)),removes:this.removes,adds:t};!p.texts.length&&!p.attributes.length&&!p.removes.length&&!p.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(p))}),v(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(M.childNodes(t),o=>M.textContent(o)||"").join("");r.attributes.value=dt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ht(t),value:n,maskInputFn:this.maskInputFn})}),v(this,"processMutation",t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=M.textContent(t.target);!le(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Lr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,zr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=Ee(r.tagName),o=t.attributeName,i=t.target.getAttribute(o);if(o==="value"){let a=ht(r);i=dt({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(le(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n==="iframe"&&o==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)o="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),o==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Nr(n,o))if(s.attributes[o]=Or(this.doc,n,Ee(o),i),o==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(let l of Array.from(r.style)){let c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?u===""?s.styleDiff[l]=c:s.styleDiff[l]=[c,u]:s._unchangedStyles[l]=[c,u]}for(let l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}else o==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":{if(le(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{Dt(r)||this.shadowDomManager.removeShadowRootsIn(r);let n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);le(t.target,this.blockClass,this.blockSelector,!1)||xt(r,this.mirror,this.slimDOMOptions)||!Uo(r,this.mirror)||(this.addedSet.has(r)?(Ft(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Pr(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Ft(this.movedSet,r):(this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&qe(t.target)?!0:void 0}),Wo(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),v(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);le(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach(n=>this.genAdds(n)),Lt(t)&&M.childNodes(M.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function Ft(e,t){e.delete(t),M.childNodes(t).forEach(r=>Ft(e,r))}function Wo(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),M.childNodes(n).forEach(o=>r.push(o)))}}function yr(e,t){return e.size===0?!1:Hr(e,t)}function Hr(e,t){if(e.has(t))return!0;let r=M.parentNode(t);return r?Hr(e,r):!1}var Ve;function Go(e){Ve=e}function jo(){Ve=void 0}var _=e=>Ve?(...r)=>{try{return e(...r)}catch(n){if(Ve&&Ve(n)===!0)return;throw n}}:e,Pe=new Set;function Ye(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Wr(e,t){let r=new _t;Pe.add(r),r.init(e);let[n,o]=Mr(),i=new n(_(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{i.disconnect(),Pe.delete(r),o()}}function qo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Ze(_(p=>{let d=Date.now()-a;e(s.map(h=>(h.timeOffset-=d,h)),p),s=[],a=null}),i),c=_(Ze(_(p=>{let d=Ye(p),{clientX:h,clientY:m}=Nt(p)?p.changedTouches[0]:p;a||(a=Xe()),s.push({x:h,y:m,id:n.getId(d),timeOffset:Xe()-a}),l(typeof DragEvent<"u"&&p instanceof DragEvent?A.Drag:p instanceof MouseEvent?A.MouseMove:A.TouchMove)}),o,{trailing:!1})),u=[re("mousemove",c,r),re("touchmove",c,r),re("drag",c,r)];return _(()=>{u.forEach(p=>p())})}function Vo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,a=[],l=null,c=u=>p=>{let d=Ye(p);if(le(d,n,o,!0))return;let h=null,m=u;if("pointerType"in p){switch(p.pointerType){case"mouse":h=Ce.Mouse;break;case"touch":h=Ce.Touch;break;case"pen":h=Ce.Pen;break}h===Ce.Touch?ce[u]===ce.MouseDown?m="TouchStart":ce[u]===ce.MouseUp&&(m="TouchEnd"):Ce.Pen}else Nt(p)&&(h=Ce.Touch);h!==null?(l=h,(m.startsWith("Touch")&&h===Ce.Touch||m.startsWith("Mouse")&&h===Ce.Mouse)&&(h=null)):ce[u]===ce.Click&&(h=l,l=null);let f=Nt(p)?p.changedTouches[0]:p;if(!f)return;let y=r.getId(d),{clientX:S,clientY:w}=f;_(e)({type:ce[m],id:y,x:S,y:w,...h!==null&&{pointerType:h}})};return Object.keys(ce).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let p=Ee(u),d=c(u);if(window.PointerEvent)switch(ce[u]){case ce.MouseDown:case ce.MouseUp:p=p.replace("mouse","pointer");break;case ce.TouchStart:case ce.TouchEnd:return}a.push(re(p,d,t))}),_(()=>{a.forEach(u=>u())})}function Gr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let s=_(Ze(_(a=>{let l=Ye(a);if(!l||le(l,n,o,!0))return;let c=r.getId(l);if(l===t&&t.defaultView){let u=Dr(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100));return re("scroll",s,t)}function Xo({viewportResizeCb:e},{win:t}){let r=-1,n=-1,o=_(Ze(_(()=>{let i=_r(),s=Fr();(r!==i||n!==s)&&(e({width:Number(s),height:Number(i)}),r=i,n=s)}),200));return re("resize",o,t)}var Zo=["INPUT","TEXTAREA","SELECT"],vr=new WeakMap;function Ko({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function p(w){let g=Ye(w),b=w.isTrusted,k=g&&g.tagName;if(g&&k==="OPTION"&&(g=M.parentElement(g)),!g||!k||Zo.indexOf(k)<0||le(g,n,o,!0)||g.classList.contains(i)||s&&g.matches(s))return;let R=g.value,E=!1,I=ht(g)||"";I==="radio"||I==="checkbox"?E=g.checked:(a[k.toLowerCase()]||a[I])&&(R=dt({element:g,maskInputOptions:a,tagName:k,type:I,value:R,maskInputFn:l})),d(g,u?{text:R,isChecked:E,userTriggered:b}:{text:R,isChecked:E});let x=g.name;I==="radio"&&x&&E&&t.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(P=>{if(P!==g){let H=P.value;d(P,u?{text:H,isChecked:!E,userTriggered:!1}:{text:H,isChecked:!E})}})}function d(w,g){let b=vr.get(w);if(!b||b.text!==g.text||b.isChecked!==g.isChecked){vr.set(w,g);let k=r.getId(w);_(e)({...g,id:k})}}let m=(c.input==="last"?["change"]:["input","change"]).map(w=>re(w,_(p),t)),f=t.defaultView;if(!f)return()=>{m.forEach(w=>w())};let y=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),S=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&m.push(...S.map(w=>wt(w[0],w[1],{set(){_(p)({target:this,isTrusted:!1})}},!1,f))),_(()=>{m.forEach(w=>w())})}function yt(e){let t=[];function r(n,o){if(at("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||at("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||at("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||at("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);return o.unshift(s),r(n.parentRule,o)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function Ie(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Yo({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:_((u,p,d)=>{let[h,m]=d,{id:f,styleId:y}=Ie(p,t,r.styleMirror);return(f&&f!==-1||y&&y!==-1)&&e({id:f,styleId:y,adds:[{rule:h,index:m}]}),u.apply(p,d)})}),n.CSSStyleSheet.prototype.addRule=function(u,p,d=this.cssRules.length){let h=`${u} { ${p} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,d])};let i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:_((u,p,d)=>{let[h]=d,{id:m,styleId:f}=Ie(p,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,removes:[{index:h}]}),u.apply(p,d)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:_((u,p,d)=>{let[h]=d,{id:m,styleId:f}=Ie(p,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,replace:h}),u.apply(p,d)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_((u,p,d)=>{let[h]=d,{id:m,styleId:f}=Ie(p,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,replaceSync:h}),u.apply(p,d)})}));let l={};lt("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(lt("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),lt("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),lt("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,p])=>{c[u]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[u].insertRule,{apply:_((d,h,m)=>{let[f,y]=m,{id:S,styleId:w}=Ie(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||w&&w!==-1)&&e({id:S,styleId:w,adds:[{rule:f,index:[...yt(h),y||0]}]}),d.apply(h,m)})}),p.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:_((d,h,m)=>{let[f]=m,{id:y,styleId:S}=Ie(h.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...yt(h),f]}]}),d.apply(h,m)})})}),_(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,p])=>{p.prototype.insertRule=c[u].insertRule,p.prototype.deleteRule=c[u].deleteRule})})}function jr({mirror:e,stylesheetManager:t},r){var n,o,i;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(M.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:i.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;let p=(u=l.set)==null?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return p}}),_(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Jo({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:_((a,l,c)=>{var u;let[p,d,h]=c;if(r.has(p))return i.apply(l,[p,d,h]);let{id:m,styleId:f}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,set:{property:p,value:d,priority:h},index:yt(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:_((a,l,c)=>{var u;let[p]=c;if(r.has(p))return s.apply(l,[p]);let{id:d,styleId:h}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||h&&h!==-1)&&e({id:d,styleId:h,remove:{property:p},index:yt(l.parentRule)}),a.apply(l,c)})}),_(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Qo({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){let s=_(l=>Ze(_(c=>{let u=Ye(c);if(!u||le(u,t,r,!0))return;let{currentTime:p,volume:d,muted:h,playbackRate:m,loop:f}=u;e({type:l,id:n.getId(u),currentTime:p,volume:d,muted:h,playbackRate:m,loop:f})}),o.media||500)),a=[re("play",s(Ae.Play),i),re("pause",s(Ae.Pause),i),re("seeked",s(Ae.Seeked),i),re("volumechange",s(Ae.VolumeChange),i),re("ratechange",s(Ae.RateChange),i)];return _(()=>{a.forEach(l=>l())})}function ei({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(l,c,u){let p=new i(l,c,u);return o.set(p,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};let s=Te(t.fonts,"add",function(a){return function(l){return setTimeout(_(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=i}),n.push(s),_(()=>{n.forEach(a=>a())})}function ti(e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e,s=!0,a=_(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let p=0;p<u;p++){let d=l.getRangeAt(p),{startContainer:h,startOffset:m,endContainer:f,endOffset:y}=d;le(h,n,o,!0)||le(f,n,o,!0)||c.push({start:r.getId(h),startOffset:m,end:r.getId(f),endOffset:y})}i({ranges:c})});return a(),re("selectionchange",a)}function ri({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Te(r.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{console.warn(`Custom element callback failed for ${i}`)}return o.apply(this,[i,s,a])}})}function ni(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:p,fontCb:d,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),r(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),n(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),o(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),i(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),s(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),a(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),l(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),c(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),u(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),p(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),d(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),h(...f)},e.customElementCb=(...f)=>{t.customElement&&t.customElement(...f),m(...f)}}function oi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ni(e,t);let n;e.recordDOM&&(n=Wr(e,e.doc));let o=qo(e),i=Vo(e),s=Gr(e),a=Xo(e,{win:r}),l=Ko(e),c=Qo(e),u=()=>{},p=()=>{},d=()=>{},h=()=>{};e.recordDOM&&(u=Yo(e,{win:r}),p=jr(e,e.doc),d=Jo(e,{win:r}),e.collectFonts&&(h=ei(e)));let m=ti(e),f=ri(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,r,S.options));return _(()=>{n?.(),o(),i(),s(),a(),l(),c(),u(),p(),d(),h(),m(),f(),y.forEach(S=>S())})}function at(e){return typeof window[e]<"u"}function lt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var vt=class{constructor(t){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,o){let i=n||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(r);return a||(a=this.generateIdFn(),i.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,o))}getRemoteId(t,r,n){let o=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=o.get(r);return i||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},zt=class{constructor(t){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new vt(Tr)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"unloadListener"),v(this,"attachedWindows",new Map),v(this,"messageHandler",r=>this.handleMessage(r)),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(n=this.loadListener)==null||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let r=t.contentWindow;if(!r||this.attachedWindows.has(r))return;let n=[],o=()=>{this.attachedWindows.delete(r),n.forEach(i=>{try{i()}catch{}})};this.attachedWindows.set(r,o),this.recordCrossOriginIframes&&n.push(re("message",this.messageHandler,r)),n.push(re("pagehide",i=>{var s;if(i.persisted)return;let a=r.document;o(),(s=this.unloadListener)==null||s.call(this,a)},r))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:L.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Annotation:case L.Plugin:return r;case L.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case L.IncrementalSnapshot:switch(r.data.source){case A.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);let i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(o.node,i)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.Drag:case A.TouchMove:case A.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(r.data,t,["id"]),r;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case A.Font:return r;case A.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case A.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(let i of o)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==ee.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Pt=class{constructor(t){v(this,"shadowDoms",new Map),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!qe(t)||this.shadowDoms.has(t))return;let n=[];this.shadowDoms.set(t,n);let o=Wr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);n.push(o),n.push(Gr({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===n&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),n.push(jr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let r=M.shadowRoot(t);r&&(this.shadowDoms.has(r)&&this.removeShadowRoot(r),this.removeShadowRootsIn(r)),M.childNodes(t).forEach(n=>this.removeShadowRootsIn(n))}removeShadowRoot(t){let r=this.shadowDoms.get(t);this.shadowDoms.delete(t),r?.forEach(It)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Te(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i),a=M.shadowRoot(this);return a&&Dt(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(It),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(r=>r.forEach(It))}};function It(e){try{e()}catch{}}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ii=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(We=0;We<ze.length;We++)ii[ze.charCodeAt(We)]=We;var We,si=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ze[t[r]>>2],o+=ze[(t[r]&3)<<4|t[r+1]>>4],o+=ze[(t[r+1]&15)<<2|t[r+2]>>6],o+=ze[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},wr=new Map;function ai(e,t){let r=wr.get(e);return r||(r=new Map,wr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var qr=(e,t,r)=>{if(!e||!(Xr(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=ai(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ut(e,t,r){if(e instanceof Array)return e.map(n=>ut(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=si(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ut(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:[ut(e.data,t,r),e.width,e.height]};if(Xr(e,t)||typeof e=="object"){let n=e.constructor.name,o=qr(e,t,r);return{rr_type:n,index:o}}}}return e}var Vr=(e,t,r)=>e.map(n=>ut(n,t,r)),Xr=(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 li(e,t,r,n){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Te(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return le(this.canvas,r,n,!0)||setTimeout(()=>{let u=Vr(c,t,this);e(this.canvas,{type:Ue["2D"],property:s,args:u})},0),l.apply(this,c)}});o.push(a)}catch{let a=wt(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Ue["2D"],property:s,args:[l],setter:!0})}});o.push(a)}return()=>{o.forEach(s=>s())}}function ui(e){return e==="experimental-webgl"?"webgl":e}function br(e,t,r,n){let o=[];try{let i=Te(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!le(this,t,r,!0)){let c=ui(a);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){let u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Sr(e,t,r,n,o,i){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let c=Te(e,l,function(u){return function(...p){let d=u.apply(this,p);if(qr(d,i,this),"tagName"in this.canvas&&!le(this.canvas,n,o,!0)){let h=Vr(p,i,this),m={type:t,property:l,args:h};r(this.canvas,m)}return d}});s.push(c)}catch{let c=wt(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});s.push(c)}return s}function ci(e,t,r,n){let o=[];return typeof t.WebGLRenderingContext<"u"&&o.push(...Sr(t.WebGLRenderingContext.prototype,Ue.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Sr(t.WebGL2RenderingContext.prototype,Ue.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}var Zr=`(function() {
|
|
4
4
|
"use strict";
|
|
5
5
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
6
|
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
@@ -75,5 +75,5 @@ or you can use record.mirror to access the mirror instance during recording.`,mr
|
|
|
75
75
|
};
|
|
76
76
|
})();
|
|
77
77
|
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
78
|
-
`,Cr=typeof self<"u"&&self.Blob&&new Blob([Zr],{type:"text/javascript;charset=utf-8"});function di(e){let t;try{if(t=Cr&&(self.URL||self.webkitURL).createObjectURL(Cr),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ut=class{constructor(t){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o,i),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:a})}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,o,i){let s=br(r,n,o,!0),a=new Map,l=new di;l.onmessage=m=>{let{id:d}=m.data;if(a.set(d,!1),!("base64"in m.data))return;let{base64:y,type:S,width:w,height:g}=m.data;this.mutationCb({id:d,type:Ue["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let c=1e3/t,u=0,p,f=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(d=>{le(d,n,o,!0)||m.push(d)}),m},h=m=>{if(u&&m-u<c){p=requestAnimationFrame(h);return}u=m,f().forEach(async d=>{var y;let S=this.mirror.getId(d);if(a.get(S)||d.width===0||d.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(d.__context)){let g=d.getContext(d.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(d);l.postMessage({id:S,bitmap:w,width:d.width,height:d.height,dataURLOptions:i.dataURLOptions},[w])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=br(t,r,n,!1),i=li(this.processMutation.bind(this),t,r,n),s=ci(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(s=>{let{type:a,...l}=s;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}},Bt=class{constructor(t){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:Rr(a,i.href),index:l}))})),n.styleIds.push(s)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},$t=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},q,ct,Re,Ke=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((lr=e.contentWindow)==null?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ge=fo();function ue(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:f,slimDOMOptions:h,maskInputFn:m,maskTextFn:d,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:b,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:R=!1,collectFonts:P=!1,inlineImages:H=!1,plugins:U,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:K}=e;Go(K);let N=E?window.parent===window:!0,F=!1;if(!N)try{window.parent.document&&(F=!1)}catch{F=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!F)return()=>{};b!==void 0&&w.mousemove===void 0&&(w.mousemove=b),ge.reset();let W=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},G=Ar(h);Bo();let fe,ne=0,ye=D=>{for(let Y of U||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!F&&(D=S(D)),D};q=(D,Y)=>{let O=D;if(O.timestamp=Xe(),O.type!==L.FullSnapshot&&!(O.type===L.IncrementalSnapshot&&O.data.source===A.Mutation)){Re.unfreeze();for(let V of Pe)if(V.isFrozen())V.unfreeze();else break}if(N)t?.(ye(O),Y);else if(F){let V={type:"rrweb",event:ye(O),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(V,"*")}if(O.type===L.FullSnapshot)fe=O,ne=0;else if(O.type===L.IncrementalSnapshot){if(O.data.source===A.Mutation&&O.data.isAttachIframe)return;ne++;let V=n&&ne>=n,ae=r&&O.timestamp-fe.timestamp>r;(V||ae)&&ct(!0)}};let te=D=>{q({type:L.IncrementalSnapshot,data:{source:A.Mutation,...D}})},oe=D=>q({type:L.IncrementalSnapshot,data:{source:A.Scroll,...D}}),j=D=>q({type:L.IncrementalSnapshot,data:{source:A.CanvasMutation,...D}}),ve=D=>q({type:L.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...D}}),me=new Bt({mutationCb:te,adoptedStyleSheetCb:ve}),ie=new zt({mirror:ge,mutationCb:te,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:q});for(let D of U||[])D.getMirror&&D.getMirror({nodeMirror:ge,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});let we=new $t;Re=new Ut({recordCanvas:x,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:ge,sampling:w.canvas,dataURLOptions:g});let se=new Pt({mutationCb:te,scrollCb:oe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:g,maskTextFn:d,maskInputFn:m,recordCanvas:x,inlineImages:H,sampling:w,slimDOMOptions:G,iframeManager:ie,stylesheetManager:me,canvasManager:Re,keepIframeSrcFn:T,processedNodeManager:we},mirror:ge});ct=(D=!1)=>{if(!k)return;q({type:L.Meta,data:{href:window.location.href,width:Fr(),height:_r()}},D),me.reset(),se.init(),Re.lock(),Pe.forEach(O=>O.lock());let Y=Po(document,{mirror:ge,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:W,maskTextFn:d,maskInputFn:m,slimDOM:G,dataURLOptions:g,recordCanvas:x,inlineImages:H,onSerialize:O=>{Ur(O,ge)&&ie.addIframe(O),Br(O,ge)&&me.trackLinkElement(O),Lt(O)&&se.addShadowRoot(M.shadowRoot(O),document)},onIframeLoad:(O,V)=>{ie.attachIframe(O,V),se.observeAttachShadow(O)},onStylesheetLoad:(O,V)=>{me.attachLinkElement(O,V)},keepIframeSrcFn:T});if(!Y)return console.warn("Failed to snapshot the document");q({type:L.FullSnapshot,data:{node:Y,initialOffset:Dr(window)}},D),Re.unlock(),Pe.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{let D=[],Y=ae=>{var J;return _(oi)({mutationCb:te,mousemoveCb:(B,be)=>q({type:L.IncrementalSnapshot,data:{source:be,positions:B}}),mouseInteractionCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.MouseInteraction,...B}}),scrollCb:oe,viewportResizeCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.ViewportResize,...B}}),inputCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.Input,...B}}),mediaInteractionCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.MediaInteraction,...B}}),styleSheetRuleCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.StyleSheetRule,...B}}),styleDeclarationCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.StyleDeclaration,...B}}),canvasMutationCb:j,fontCb:B=>q({type:L.IncrementalSnapshot,data:{source:A.Font,...B}}),selectionCb:B=>{q({type:L.IncrementalSnapshot,data:{source:A.Selection,...B}})},customElementCb:B=>{q({type:L.IncrementalSnapshot,data:{source:A.CustomElement,...B}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:u,sampling:w,recordDOM:k,recordCanvas:x,inlineImages:H,userTriggeredOnInput:R,collectFonts:P,doc:ae,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:G,dataURLOptions:g,mirror:ge,iframeManager:ie,stylesheetManager:me,shadowDomManager:se,processedNodeManager:we,canvasManager:Re,ignoreCSSAttributes:X,plugins:((J=U?.filter(B=>B.observer))==null?void 0:J.map(B=>({observer:B.observer,options:B.options,callback:be=>q({type:L.Plugin,data:{plugin:B.name,payload:be}})})))||[]},y)},O=new Map;ie.addLoadListener(ae=>{try{let J=ae.contentDocument;if(O.has(J))return;O.set(J,Y(J))}catch(J){console.warn(J)}}),ie.addUnloadListener(ae=>{let J=O.get(ae);J&&(O.delete(ae),J(),se.removeShadowRootsIn(ae),ge.removeNodeFromMap(ae))});let V=()=>{ct(),D.push(Y(document)),Ke=!0};return["interactive","complete"].includes(document.readyState)?V():(D.push(re("DOMContentLoaded",()=>{q({type:L.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&V()})),D.push(re("load",()=>{q({type:L.Load,data:{}}),I==="load"&&V()},window))),()=>{[...D,...O.values()].forEach(ae=>{try{ae()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),O.clear(),ie.destroy(),we.destroy(),se.reset(),Re.reset(),Ke=!1,jo()}}catch(D){console.warn(D)}}ue.addCustomEvent=(e,t)=>{if(!Ke)throw new Error("please add custom event after start recording");q({type:L.Custom,data:{tag:e,payload:t}})};ue.addAnnotation=e=>{if(!Ke)throw new Error("please add annotation after recording started");q({type:L.Annotation,data:e})};ue.freezePage=()=>{Re.freeze(),Pe.forEach(e=>e.freeze())};ue.takeFullSnapshot=e=>{if(!Ke)throw new Error("please take full snapshot after start recording");ct(e)};ue.mirror=ge;var Kr=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"];var Yr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];var fi="<masked>",hi=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"];var pi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function Jr(e,t){let r=e,n=[...hi,...t.maskParams??[],...t.maskCampaignParams?[...Yr,...Kr]:[]];if(n.length){let o=r.indexOf("#"),i=o<0?r:r.slice(0,o),s=o<0?"":r.slice(o);r=i.replace(new RegExp(`([?&])(${n.map(pi).join("|")})=[^&]*`,"gi"),`$1$2=${fi}`)+s}return t.stripHash&&(r=r.replace(/#.*$/,"")),r}var de=Uint8Array,pe=Uint16Array,Zt=Int32Array,Kt=new de([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Yt=new de([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Qr=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(e,t){for(var r=new pe(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Zt(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},sn=on(Kt,2),mi=sn.b,jt=sn.r;mi[28]=258,jt[258]=28;var an=on(Yt,0),Qi=an.b,en=an.r,qt=new pe(32768);for(z=0;z<32768;++z)ke=(z&43690)>>1|(z&21845)<<1,ke=(ke&52428)>>2|(ke&13107)<<2,ke=(ke&61680)>>4|(ke&3855)<<4,qt[z]=((ke&65280)>>8|(ke&255)<<8)>>1;var ke,z,et=(function(e,t,r){for(var n=e.length,o=0,i=new pe(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new pe(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new pe(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],p=s[e[o]-1]++<<u,f=p|(1<<u)-1;p<=f;++p)a[qt[p]>>l]=c}else for(a=new pe(n),o=0;o<n;++o)e[o]&&(a[o]=qt[s[e[o]-1]++]>>15-e[o]);return a}),Oe=new de(288);for(z=0;z<144;++z)Oe[z]=8;var z;for(z=144;z<256;++z)Oe[z]=9;var z;for(z=256;z<280;++z)Oe[z]=7;var z;for(z=280;z<288;++z)Oe[z]=8;var z,bt=new de(32);for(z=0;z<32;++z)bt[z]=5;var z,gi=et(Oe,9,0);var yi=et(bt,5,0);var ln=function(e){return(e+7)/8|0},un=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new de(e.subarray(t,r))};var Me=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Je=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Gt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:dn,l:0};if(o==1){var s=new de(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(k,x){return k.f-x.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[c].f<r[p].f?c++:p++],l=r[c!=u&&r[c].f<r[p].f?c++:p++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=i[0].s,n=1;n<o;++n)i[n].s>f&&(f=i[n].s);var h=new pe(f+1),m=Vt(r[u-1],h,0);if(m>t){var n=0,d=0,y=m-t,S=1<<y;for(i.sort(function(x,E){return h[E.s]-h[x.s]||x.f-E.f});n<o;++n){var w=i[n].s;if(h[w]>t)d+=S-(1<<m-h[w]),h[w]=t;else break}for(d>>=y;d>0;){var g=i[n].s;h[g]<t?d-=1<<t-h[g]++-1:++n}for(;n>=0&&d;--n){var b=i[n].s;h[b]==t&&(--h[b],++d)}m=t}return{t:new de(h),l:m}},Vt=function(e,t,r){return e.s==-1?Math.max(Vt(e.l,t,r+1),Vt(e.r,t,r+1)):t[e.s]=r},tn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new pe(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},cn=function(e,t,r){var n=r.length,o=ln(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},rn=function(e,t,r,n,o,i,s,a,l,c,u){Me(t,u++,r),++o[256];for(var p=Gt(o,15),f=p.t,h=p.l,m=Gt(i,15),d=m.t,y=m.l,S=tn(f),w=S.c,g=S.n,b=tn(d),k=b.c,x=b.n,E=new pe(19),I=0;I<w.length;++I)++E[w[I]&31];for(var I=0;I<k.length;++I)++E[k[I]&31];for(var R=Gt(E,7),P=R.t,H=R.l,U=19;U>4&&!P[Qr[U-1]];--U);var T=c+5<<3,X=Qe(o,Oe)+Qe(i,bt)+s,K=Qe(o,f)+Qe(i,d)+s+14+3*U+Qe(E,P)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&T<=X&&T<=K)return cn(t,u,e.subarray(l,l+c));var N,F,W,G;if(Me(t,u,1+(K<X)),u+=2,K<X){N=et(f,h,0),F=f,W=et(d,y,0),G=d;var fe=et(P,H,0);Me(t,u,g-257),Me(t,u+5,x-1),Me(t,u+10,U-4),u+=14;for(var I=0;I<U;++I)Me(t,u+3*I,P[Qr[I]]);u+=3*U;for(var ne=[w,k],ye=0;ye<2;++ye)for(var te=ne[ye],I=0;I<te.length;++I){var oe=te[I]&31;Me(t,u,fe[oe]),u+=P[oe],oe>15&&(Me(t,u,te[I]>>5&127),u+=te[I]>>12)}}else N=gi,F=Oe,W=yi,G=bt;for(var I=0;I<a;++I){var j=n[I];if(j>255){var oe=j>>18&31;Je(t,u,N[oe+257]),u+=F[oe+257],oe>7&&(Me(t,u,j>>23&31),u+=Kt[oe]);var ve=j&31;Je(t,u,W[ve]),u+=G[ve],ve>3&&(Je(t,u,j>>5&8191),u+=Yt[ve])}else Je(t,u,N[j]),u+=F[j]}return Je(t,u,N[256]),u+F[256]},vi=new Zt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dn=new de(0),wi=function(e,t,r,n,o,i){var s=i.z||e.length,a=new de(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var p=vi[t-1],f=p>>13,h=p&8191,m=(1<<r)-1,d=i.p||new pe(32768),y=i.h||new pe(m+1),S=Math.ceil(r/3),w=2*S,g=function(V){return(e[V]^e[V+1]<<S^e[V+2]<<w)&m},b=new Zt(25e3),k=new pe(288),x=new pe(32),E=0,I=0,R=i.i||0,P=0,H=i.w||0,U=0;R+2<s;++R){var T=g(R),X=R&32767,K=y[T];if(d[X]=K,y[T]=X,H<=R){var N=s-R;if((E>7e3||P>24576)&&(N>423||!c)){u=rn(e,l,0,b,k,x,I,P,U,R-U,u),P=E=I=0,U=R;for(var F=0;F<286;++F)k[F]=0;for(var F=0;F<30;++F)x[F]=0}var W=2,G=0,fe=h,ne=X-K&32767;if(N>2&&T==g(R-ne))for(var ye=Math.min(f,N)-1,te=Math.min(32767,R),oe=Math.min(258,N);ne<=te&&--fe&&X!=K;){if(e[R+W]==e[R+W-ne]){for(var j=0;j<oe&&e[R+j]==e[R+j-ne];++j);if(j>W){if(W=j,G=ne,j>ye)break;for(var ve=Math.min(ne,j-2),me=0,F=0;F<ve;++F){var ie=R-ne+F&32767,we=d[ie],se=ie-we&32767;se>me&&(me=se,K=ie)}}}X=K,K=d[X],ne+=X-K&32767}if(G){b[P++]=268435456|jt[W]<<18|en[G];var D=jt[W]&31,Y=en[G]&31;I+=Kt[D]+Yt[Y],++k[257+D],++x[Y],H=R+W,++E}else b[P++]=e[R],++k[e[R]]}}for(R=Math.max(R,H);R<s;++R)b[P++]=e[R],++k[e[R]];u=rn(e,l,c,b,k,x,I,P,U,R-U,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=y,i.p=d,i.i=R,i.w=H)}else{for(var R=i.w||0;R<s+c;R+=65535){var O=R+65535;O>=s&&(l[u/8|0]=c,O=s),u=cn(l,u+1,e.subarray(R,O))}i.i=s}return un(a,0,n+ln(u)+o)},bi=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),Si=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=bi[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var Ci=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new de(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return wi(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)};var Xt=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},ki=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Xt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}};var Mi=function(e){return 10+(e.filename?e.filename.length+1:0)};function fn(e,t){t||(t={});var r=Si(),n=e.length;r.p(e);var o=Ci(e,t,Mi(t),8),i=o.length;return ki(o,t),Xt(o,i-8,r.d()),Xt(o,i-4,n),o}var nn=typeof TextEncoder<"u"&&new TextEncoder,xi=typeof TextDecoder<"u"&&new TextDecoder,Ri=0;try{xi.decode(dn,{stream:!0}),Ri=1}catch{}function hn(e,t){if(t){for(var r=new de(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(nn)return nn.encode(e);for(var o=e.length,i=new de(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new de(s+8+(o-n<<1));l.set(i),i=l}var c=e.charCodeAt(n);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return un(i,0,s)}async function pn(e){if(typeof CompressionStream<"u"&&typeof Response<"u")try{let t=new Response(e).body?.pipeThrough(new CompressionStream("gzip"));if(t)return new Uint8Array(await new Response(t).arrayBuffer())}catch{}return Jt(e)}function Jt(e){return fn(hn(e))}var Ii=8e6,mn=6e4;function gn(e){let t=[],r=0,n=0,o,i=!!e.hold,s=!1,a,l,c=[],u=()=>c.reduce((w,g)=>w+g.json.length,0),p=()=>{if(!t.length)return;let{sessionId:w,windowId:g}=e.ids();o&&o!==w&&(n=0,e.onSessionChange?.()),o=w,c.push({json:f(w,g,n,t),parts:t,window:g,session:w,seq:n++,tries:0}),t=[],r=0},f=(w,g,b,k)=>`{"api_key":${JSON.stringify(e.apiKey)},"session_id":${JSON.stringify(w)},"window_id":${JSON.stringify(g)},"seq":${b},"events":[${k.join(",")}]}`,h=0,m=async w=>{try{let g=await pn(w.json),b=await e.fetch(`${e.url}?compression=gzip`,{method:"POST",body:g,headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:g.length<mn}),k=b.headers?.get?.("Retry-After")?.trim()??"";return h=/^\d+$/.test(k)?Math.min(Number(k),300)*1e3:0,b.status}catch{return 0}},d=()=>i||s?Promise.resolve():(l??=(async()=>{for(;c.length&&!i&&!s;){let w=c[0],g=await m(w);g>=200&&g<300?(c.shift(),e.onSent?.(w.session,w.json.length)):!ir(g)||++w.tries>(e.maxRetries??5)?(e.log?.("replay chunk dropped",w.seq,g),c.shift(),e.onGap?.()):await new Promise(b=>setTimeout(b,Math.max(h,or(w.tries-1,e.backoff))))}})().finally(()=>{l=void 0}),l),y=()=>{a??=setTimeout(()=>{a=void 0,S()},e.flushMs)},S=()=>(a!==void 0&&clearTimeout(a),a=void 0,p(),i&&u()>Ii&&(i=!1),d());return{add(w){if(s)return;let g=JSON.stringify(w);if(g.length>rr-4096)return e.log?.("replay event too large",g.length);r&&r+g.length>e.chunkBytes&&S(),t.push(g),r+=g.length+1,r>=e.chunkBytes?S():y()},flush:S,beacon(){if(i||s)return;p();let w=c[0]?.seq??0,g=c[0]?.session;for(let b of c.splice(0)){b.session!==g&&([g,w]=[b.session,b.seq]);let k=x=>{let E=Jt(f(b.session,b.window,w,x));if(E.length>mn&&x.length>1){k(x.slice(0,x.length>>1)),k(x.slice(x.length>>1));return}w++,navigator.sendBeacon?.(`${e.url}?compression=gzip`,new Blob([E],{type:"text/plain"}))};k(b.parts)}n=Math.max(n,w)},release(){i=!1,S()},discard(){s=!0,t=[],c.length=0,a!==void 0&&clearTimeout(a)},get unsent(){return r+u()},get seq(){return n},get held(){return i}}}var yn=(e,t)=>{let r=e(t);return r&&r.nodeType===1?r:null};function Be(e,t,r){let n=o=>{o&&(o.type===2&&o.attributes&&r(o.attributes,(o.tagName??"").toLowerCase(),yn(t,o.id)),o.childNodes?.forEach(n))};if(e.type===2&&n(e.data?.node),!(e.type!==3||e.data?.source!==0)){e.data.adds?.forEach(o=>n(o.node));for(let o of e.data.attributes??[]){let i=yn(t,o.id);r(o.attributes,i?.tagName.toLowerCase()??"",i)}}}var Ei=["title","alt","placeholder","aria-label","aria-description","aria-placeholder","aria-roledescription","aria-valuetext"],Ti=new Set(["input","textarea","select"]),vn=e=>e.replace(/\S/g,"*");function wn(e,t){let r=o=>{try{return!!o?.closest(t)&&!o.closest(e)}catch{return!1}},n=(o,i,s)=>{if(!r(s))for(let a of Object.keys(o)){let l=o[a];(Ei.includes(a)||a==="value"&&!Ti.has(i))&&typeof l=="string"&&(o[a]=vn(l))}};return{maskTextFn:(o,i)=>r(i)?o:vn(o),scrub:(o,i)=>Be(o,i,n)}}var bn="data-lc-fixed";function Sn(e,t){Be(e,t,(r,n,o)=>{if(!(!o||bn in r))try{let i=getComputedStyle(o).position;(i==="fixed"||i==="sticky")&&(r[bn]="")}catch{}})}var Cn=()=>window.parent!==window;function Oi(){let e=location.ancestorOrigins;if(e?.length)return e[0];try{return document.referrer?new URL(document.referrer).origin:void 0}catch{return}}var kn=e=>{let t=Oi();return!!t&&e.includes(t)};function Mn(e){let t=r=>{let n=r.data;n&&typeof n=="object"&&n.type==="rrweb"&&!e.includes(r.origin)&&r.stopImmediatePropagation()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}var Ni=new Set(["Shift","Control","Alt","Meta","CapsLock","AltGraph"]);function xn(e,t,r=1e3){let n=0,o,i=()=>{o=void 0,n>0&&e(n)&&(n=0)},s=l=>{if(!(l instanceof Element))return!1;if(l instanceof HTMLInputElement&&l.type==="password")return!0;let c=t();try{return!!c&&!!l.closest(c)}catch{return!1}},a=l=>{l.repeat||Ni.has(l.key)||s(l.target)||(n++,o??=setTimeout(i,r))};return document.addEventListener("keydown",a,{capture:!0,passive:!0}),{flush:i,stop(){document.removeEventListener("keydown",a,{capture:!0}),o!==void 0&&clearTimeout(o),i()}}}function Rn(e,t=1e3){let r=0,n,o=()=>{n=void 0;let s=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);s>0&&s!==r&&(r=s,e(s))},i=()=>{n??=setTimeout(o,t)};return window.addEventListener("load",i),window.addEventListener("resize",i),{schedule:i,reset(){r=0,n!==void 0&&clearTimeout(n),o()},stop(){window.removeEventListener("load",i),window.removeEventListener("resize",i),n!==void 0&&clearTimeout(n)}}}function In(){let e=[[]];return{push(t,r){r&&(e=[e[e.length-1],[]]),e[e.length-1].push(t)},drain(){let t=e.flat();return e=[[]],t},get size(){return e.reduce((t,r)=>t+r.length,0)}}}function En(e,t,r){if(!e)return null;let n=null;try{let o=e.proxy&&new URL(e.proxy.url,location.href);o&&/^https?:$/.test(o.protocol)&&r.includes(o.origin)&&e.proxy?.origins.length&&(n={url:o.toString(),origins:[...e.proxy.origins]})}catch{}return{inlineImages:!!e.inlineImages&&!t,maxInlineBytes:e.maxInlineBytes??256*1024,collectFonts:!!e.collectFonts,proxy:n}}var Li=new Set(["img","source","video","audio","track","image","input"]),Ai=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g;function Tn(e){let t=i=>{if(!e.proxy||i.startsWith("data:"))return i;try{let s=new URL(i,location.href);return e.proxy.origins.includes(s.origin)?`${e.proxy.url}${e.proxy.url.includes("?")?"&":"?"}url=${encodeURIComponent(s.toString())}`:i}catch{return i}},r=i=>i.replace(Ai,(s,a,l)=>{let c=t(l.trim());return c===l.trim()?s:`url(${a}${c}${a})`}),n=i=>i.split(",").map(s=>{let[a,...l]=s.trim().split(/\s+/);return a?[t(a),...l].join(" "):s}).join(", "),o=(i,s)=>{if(s==="img"&&typeof i.rr_dataURL=="string"&&i.rr_dataURL.length>e.maxInlineBytes&&delete i.rr_dataURL,!!e.proxy)for(let[a,l]of Object.entries(i))typeof l=="string"&&(a==="_cssText"||a==="style"?i[a]=r(l):a==="srcset"?i[a]=n(l):(a==="poster"||a==="src"&&Li.has(s)||a==="href"&&s==="link"||a==="xlink:href"&&s==="image")&&(i[a]=t(l)))};return{scrub(i,s){if(Be(i,s,o),e.proxy&&i.type===3&&i.data?.source===8)for(let a of i.data.adds??[])typeof a.rule=="string"&&(a.rule=r(a.rule))}}}function Di(e,t,r){let n={x:0,y:0,width:e.width,height:e.height},o=[];try{o=r?.(e)??[]}catch{o=[n]}let i=t.flatMap(s=>{try{return e.matches(s.selector)?s.regions??[n]:[]}catch{return[n]}});return[...o,...i]}function On(e){let t=new Map,r=document.createElement("canvas"),n=()=>{for(let i of Array.from(document.querySelectorAll("canvas"))){let s=e.idOf(i);if(!(s<=0||!i.width||!i.height||i.closest(e.skip)))try{r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)return;a.drawImage(i,0,0),a.fillStyle="#000";for(let p of Di(i,e.rules,e.regionsFn))a.fillRect(p.x,p.y,p.width,p.height);let l=r.toDataURL("image/jpeg",e.quality),c=l.slice(l.indexOf(",")+1);if(!c||t.get(s)===c)continue;t.set(s,c);let u={rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:c}],type:"image/jpeg"};e.emit({type:3,timestamp:Date.now(),data:{source:9,id:s,type:0,commands:[{property:"clearRect",args:[0,0,i.width,i.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[u]},0,0]}]}})}catch{}}},o=setInterval(n,Math.round(1e3/e.fps));return{reset:()=>t.clear(),tick:n,stop:()=>clearInterval(o)}}function Nn(e,t=Date.now){let r=e.eventsPerSecond??10,n=e.burst??100,o=n,i=t();return()=>{let s=t();return o=Math.min(n,o+(s-i)/1e3*r),i=s,o<1?!1:(o-=1,!0)}}var _i=1e4;function Ln(e,t=Date.now){let r=new Map,n=0;return{allow(o){let i=o.data;return o.type!==3||i?.source!==0||!i.attributes?.length?!0:(r.size>_i&&r.clear(),i.attributes=i.attributes.filter(s=>{let a=r.get(s.id);return a||r.set(s.id,a=Nn({burst:e.burst??100,eventsPerSecond:e.perSecond??10},t)),a()?!0:(n++,!1)}),!!(i.attributes.length||i.adds?.length||i.removes?.length||i.texts?.length))},get dropped(){return n}}}var Fi=new Set([1,2,3,4,5,6,7,12]);function An(e){let t,r=!1,n=0;return{check(o){if(e<=0)return{keep:!0,resumed:!1};let i=o.timestamp??Date.now();if(t??=i,o.type===3&&Fi.has(o.data?.source??-1)){t=i;let s=r&&n>0;return r=!1,n=0,{keep:!0,resumed:s}}return!r&&i-t>e&&(r=!0),r?(n++,{keep:!1,resumed:!1}):{keep:!0,resumed:!1}}}}function Dn(e,t,r){let n=[],o;switch(t.mode){case"on_event":e.onCapture(i=>t.events.includes(i.event)&&r());break;case"on_flag":{let i=e.flags?.onChange(s=>s[t.flag]&&r());i&&n.push(i);break}case"on_url":try{o=new RegExp(t.pattern)}catch{e.log("bad on_url pattern",t.pattern)}break;case"on_frustration":{let i=[],s=a=>{let l=Date.now();for(i.push({t:l,x:a.clientX,y:a.clientY});i.length&&l-i[0].t>1e3;)i.shift();i.filter(u=>Math.hypot(u.x-a.clientX,u.y-a.clientY)<=30).length>=3&&r()};document.addEventListener("click",s,!0),n.push(()=>document.removeEventListener("click",s,!0));break}default:}return{checkUrl:i=>o?.test(i)&&r(),stop:()=>n.forEach(i=>i())}}var St="[redacted]",zi=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token)$/i,er=/pass(word|wd|phrase)?|secret|token|api[-_]?key|card|cvv|cvc|ssn|authorization/i;var xe=(e,t=4096)=>e.length>t?`${e.slice(0,t)}...[truncated ${e.length-t}]`:e;function tt(e){let t={};for(let r of Object.keys(e))t[r]=zi.test(r)?St:xe(e[r]??"",512);return t}function Qt(e,t){if(t>6||e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Qt(n,t+1));let r={};for(let[n,o]of Object.entries(e))r[n]=er.test(n)?St:Qt(o,t+1);return r}function $e(e){if(e==null)return;if(typeof e!="string")return typeof URLSearchParams<"u"&&e instanceof URLSearchParams?$e(e.toString()):"[binary]";let t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return xe(JSON.stringify(Qt(JSON.parse(t),0)))}catch{}if(/^[^\s=&]+=[^\s]*$/.test(t)){let r=new URLSearchParams(t);for(let n of[...r.keys()])er.test(n)&&r.set(n,St);return xe(r.toString())}return xe(e)}function _n(e,t=1e3){try{if(typeof e=="string")return xe(e,t);if(e instanceof Error)return xe(`${e.name}: ${e.message}${e.stack?`
|
|
79
|
-
${e.stack}`:""}`,t);if(typeof Node<"u"&&e instanceof Node)return`<${e.nodeName.toLowerCase()}>`;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(e===null||typeof e!="object")return String(e);let r=new WeakSet;return xe(JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return String(o);if(typeof Node<"u"&&o instanceof Node)return`<${o.nodeName.toLowerCase()}>`;if(o!==null&&typeof o=="object"){if(r.has(o))return"[Circular]";r.add(o)}return er.test(n)?St:o}),t)}catch{return"[unserializable]"}}var rt=(e,t)=>!!e?.some(r=>typeof r=="string"?t.includes(r):(r.lastIndex=0,r.test(t)));var Fn=["log","info","warn","error","debug"],Pi=1e3,Ui=10;function zn(e,t){let r=0,n=!1,o=(c,u)=>{if(!(n||r>=Pi)){n=!0;try{r++,e({level:c,args:t()?["[masked]"]:u.slice(0,Ui).map(p=>_n(p))})}catch{}finally{n=!1}}},i={},s={};for(let c of Fn){let u=console[c];i[c]=u,s[c]=function(...p){u.apply(this,p),o(c,p)},console[c]=s[c]}let a=c=>o("error",[c.error??c.message]),l=c=>o("error",["Unhandled rejection:",c.reason]);return window.addEventListener("error",a),window.addEventListener("unhandledrejection",l),()=>{for(let c of Fn)console[c]===s[c]&&(console[c]=i[c]);window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",l)}}var Pn=e=>{let t={};return e.forEach((r,n)=>t[n]=r),t},Bi=e=>{let t={};for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&(t[r.slice(0,n).trim().toLowerCase()]=r.slice(n+1).trim())}return t},nt=e=>{try{return new URL(e,location.href).href}catch{return e}};function Un(e,t,r){let n=f=>{try{if(r(f.url)||rt(t.deny,f.url)||t.allow&&!rt(t.allow,f.url))return;t.headers||(delete f.req?.headers,delete f.res?.headers),t.body||(delete f.req?.body,delete f.res?.body),f.req&&!f.req.headers&&!f.req.body&&delete f.req,f.res&&!f.res.headers&&!f.res.body&&delete f.res;let h=t.redact?t.redact(f):f;h&&e(h)}catch{}},o=f=>r(nt(f))||rt(t.deny,nt(f))||!!t.allow&&!rt(t.allow,nt(f)),i=window.fetch;window.fetch=function(f,h){let m=i.call(this,f,h);try{let d=nt(f instanceof Request?f.url:String(f));if(o(d))return m;let y=Date.now(),S=performance.now(),w=(h?.method??(f instanceof Request?f.method:"GET")).toUpperCase(),g=t.headers||t.body?{headers:tt(Pn(new Headers(h?.headers??(f instanceof Request?f.headers:void 0)))),body:$e(h?.body)}:void 0,b=k=>n({method:w,url:d,status:0,start:y,duration:Math.round(performance.now()-S),type:"fetch",req:g,...k});m.then(k=>{let x=Number(k.headers.get("content-length"))||void 0,E={status:k.status,size:x,res:t.headers?{headers:tt(Pn(k.headers))}:void 0};if(!t.body)return b(E);k.clone().text().then(I=>b({...E,size:x??I.length,res:{...E.res,body:$e(I)}}),()=>b(E))},k=>b({error:xe(String(k?.message??k),200)}))}catch{}return m};let s=window.fetch,a=XMLHttpRequest.prototype,{open:l,send:c,setRequestHeader:u}=a,p=new WeakMap;return a.open=function(f,h,...m){return p.set(this,{method:f.toUpperCase(),url:nt(String(h)),headers:{}}),l.call(this,f,h,...m)},a.setRequestHeader=function(f,h){let m=p.get(this);return m&&(m.headers[f.toLowerCase()]=h),u.call(this,f,h)},a.send=function(f){let h=p.get(this);if(h&&!o(h.url)){let m=Date.now(),d=performance.now();this.addEventListener("loadend",()=>{try{let y=t.body&&(this.responseType===""||this.responseType==="text")?this.responseText:void 0;n({method:h.method,url:h.url,status:this.status,start:m,duration:Math.round(performance.now()-d),size:Number(this.getResponseHeader("content-length"))||y?.length||void 0,type:"xhr",...this.status===0&&{error:"network error"},req:{headers:tt(h.headers),body:$e(f)},res:{headers:tt(Bi(this.getAllResponseHeaders())),body:y===void 0?void 0:$e(y)}})}catch{}})}return c.call(this,f)},()=>{window.fetch===s&&(window.fetch=i),a.open=l,a.send=c,a.setRequestHeader=u}}var $i={on_event:"event_trigger_matched",on_url:"url_trigger_matched",on_flag:"linked_flag_matched",on_frustration:"frustration_detected"};function Hi(e){let t=parseInt(e.replace(/-/g,"").slice(0,12),16);return Number.isFinite(t)&&t>0?t:Date.now()}var Wi=5*6e4,Gi={$pageview:e=>({url:e.$current_url}),$pageleave:()=>({}),$form_start:e=>({form:e.form}),$form_submit:e=>({form:e.form}),$replay_tag:e=>({name:e.name})},ji="********";function Xs(e,t,r,n){let{core:o}=e,i=e.config.apiHost,s=t.trigger_groups,a=t.trigger.mode,l=a==="on_url"&&n?.url_trigger||a==="on_event"&&n?.event_trigger||a==="on_flag"&&n?.linked_flag,u=!(s.length>0||a!=="always"&&!l),p=t.min_duration_ms,f=!!(n?.url_trigger||n?.event_trigger||n?.linked_flag);r.startReason=u?f?"trigger_overridden":n?.sampling?"sampling_overridden":"recording_initialized":void 0;let h=!1,m=!1,d=!1,y,S=!1,w=In(),g=t.min_duration_mode==="session"?Hi(o.sessionId):Date.now();r.bufferLength=()=>w.size;let b=()=>{r.status=S?"disabled":h?m?"excluded":"paused":u?"active":"buffering"},k=()=>{try{ue.takeFullSnapshot(!0)}catch{}},x=gn({url:`${i}/v1/replay`,apiKey:e.apiKey,fetch:e.fetch,ids:()=>({sessionId:o.sessionId,windowId:o.session.touch().windowId}),chunkBytes:t.chunk_bytes,flushMs:t.flush_interval_ms,hold:p>0||s.some(C=>(C.min_duration_ms??0)>0),onSent:(C,Z)=>{r.flushedBytes+=Z,r.ack(C)},onSessionChange:()=>k(),onGap:()=>k(),log:e.log}),E=Rn(C=>{try{ue.addCustomEvent("page_height",{height:C})}catch{}}),I=ar(t.url_privacy_rules),R=kt(I,location.href),P="",H="",U,T=()=>{P=["[data-lc-mask]",...t.mask_selectors,...R.mask].join(","),H=["[data-lc-block]",...t.block_selectors,...R.block].join(","),U=t.mask_all_text||R.maskAllText?wn(P,["[data-lc-unmask]",...t.unmask_selectors].join(",")):void 0};T(),r.bufferBytes=()=>x.unsent;let X=t.mutationThrottle?Ln(t.mutationThrottle):void 0;r.throttled=()=>X?.dropped??0;let K=C=>{try{return C?[new URL(C).origin]:[]}catch{return[]}},N=En(t.assets,t.mask_all_text||I.some(C=>C.mask_all_text),[location.origin,...K(i),...K(e.config.uiHost)]),F=N&&(N.proxy||N.inlineImages)?Tn(N):void 0,W=!!t.canvas&&(t.canvasMask.length>0||!!t.canvasMaskRegions),G,fe=t.maskUrlFn??(C=>Jr(C,e.config.urlPrivacy??{})),ne=An(t.idle_threshold_ms),ye=(C,Z)=>{if(h||S)return;let Q=ne.check(C);if(!Q.keep||(Q.resumed&&k(),X&&!X.allow(C)))return;C.type===2&&G?.reset();let Se=it=>ue.mirror.getNode(it);if(U?.scrub(C,Se),F?.scrub(C,Se),Sn(C,Se),fe&&C.type===4&&typeof C.data?.href=="string"){let it=C.data;it.href=fe(it.href)}C.type===3&&C.data?.source===0&&E.schedule(),u?x.add(C):w.push(C,!!Z)},te=t.crossOriginIframes,oe=!!te&&Cn(),j=oe&&!kn(te),ve=te&&!oe?Mn(te):void 0,me=j?void 0:xn(C=>{try{return ue.addCustomEvent("keys",{n:C}),!0}catch{return!1}},()=>[P,H,"[data-lc-ignore]"].filter(Boolean).join(",")),ie=(C,Z)=>{if(!(h||S||!y))try{ue.addCustomEvent(C,Z)}catch{}},we=[];if(!j){let C=()=>t.mask_all_text||R.maskAllText;if(t.console&&we.push(zn(Z=>ie("console",Z),C)),t.network){let Z=`${(i??"").replace(/\/+$/,"")}/v1/`;we.push(Un(Q=>ie("network",{...Q,url:fe?fe(Q.url):Q.url}),t.network,Q=>Q.startsWith(Z)))}}let se=()=>{if(!(y||S||j)){try{y=D()}catch(C){r.status="rrweb_error",r.rrwebError=String(C).slice(0,200);return}W&&t.canvas&&(G=On({...t.canvas,skip:`${H},[data-lc-ignore]`,rules:t.canvasMask,regionsFn:t.canvasMaskRegions,idOf:C=>ue.mirror.getId(C),emit:C=>ye(C)})),E.reset(),b()}},D=()=>ue({emit:ye,checkoutEveryNms:u?Wi:t.buffer_ms/2,maskAllInputs:t.mask_all_inputs,maskInputOptions:{...t.maskInputOptions,password:!0},maskInputFn:t.maskInputFn??(()=>ji),maskTextSelector:U?"*":P,...U?{maskTextFn:U.maskTextFn}:t.maskTextFn&&{maskTextFn:t.maskTextFn},blockSelector:H,ignoreSelector:"[data-lc-ignore]",sampling:{mousemove:50,scroll:150,input:"last",...t.canvas&&!W&&{canvas:t.canvas.fps}},...t.canvas&&!W&&{dataURLOptions:{type:"image/jpeg",quality:t.canvas.quality}},...N?.inlineImages&&{inlineImages:!0},...N?.collectFonts&&{collectFonts:!0},errorHandler:C=>(r.rrwebErrors++,r.rrwebError=String(C).slice(0,200),!0),recordCrossOriginIframes:!!te,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0},recordCanvas:!!t.canvas&&!W})??void 0,Y=()=>{y?.(),y=void 0,G?.stop(),G=void 0},O=(C,Z)=>{if(!(u||S)){u=!0,r.startReason=C??$i[a]??"recording_initialized",Z?.min_duration_ms!==void 0&&(p=Z.min_duration_ms),r.minDurationMs=p;for(let Q of w.drain())x.add(Q);Y(),h||se(),ae(),b()}},V,ae=()=>{!x.held||V!==void 0||(V=setTimeout(()=>x.release(),Math.max(0,p-(Date.now()-g))))},J=s.length?sr(e,s,()=>o.sessionId,C=>O("trigger_group_matched",C),{url:n?.url_trigger,event:n?.event_trigger,flag:n?.linked_flag,sampling:n?.sampling}):void 0,B=J??Dn(e,t.trigger,()=>O());J&&(r.triggers=J.states,r.matchedGroups=J.matched);let be="",He=()=>{if(location.href===be)return;be=location.href;let C=kt(I,be),Z=C.key!==R.key;Z&&(R=C,T());let Q=!!y,Se=nr(be,t.include_urls,t.exclude_urls);!Se&&!m?(m=h=!0,Y(),w.drain(),x.flush(),b()):Se&&m&&(m=!1,h=d,h||se(),b()),Se&&B.checkUrl(be),Z&&Q&&y&&(Y(),se())},Bn=setInterval(He,1e3),Ct=window.navigation,ot=[],Ne=()=>He();if(Ct)Ct.addEventListener("currententrychange",Ne),ot.push(()=>Ct.removeEventListener("currententrychange",Ne));else for(let C of["pushState","replaceState"]){let Z=history[C],Q=function(...Se){Z.apply(this,Se),He()};history[C]=Q,ot.push(()=>{history[C]===Q&&(history[C]=Z)})}window.addEventListener("popstate",Ne),window.addEventListener("hashchange",Ne),ot.push(()=>(window.removeEventListener("popstate",Ne),window.removeEventListener("hashchange",Ne))),e.onCapture(C=>{C.event==="$pageview"&&He();let Z=Gi[C.event];if(!(!Z||h||S||!y))try{let Q=Z(C.properties);fe&&typeof Q.url=="string"&&(Q.url=fe(Q.url)),ue.addCustomEvent(C.event,Q)}catch{}});let tr=()=>{document.visibilityState==="visible"?u&&y&&ue.takeFullSnapshot(!0):x.beacon()};return document.addEventListener("visibilitychange",tr),e.onUnload(()=>{x.held?x.discard():x.beacon()}),He(),J?.check(),h||se(),u&&ae(),b(),{stop:()=>{S=!0,Y(),clearInterval(Bn);for(let C of ot)C();clearTimeout(V),document.removeEventListener("visibilitychange",tr),ve?.(),E.stop(),me?.stop();for(let C of we)C();B.stop(),w.drain(),x.discard(),b()},paused:()=>h,pause(){d||S||(d=h=!0,Y(),w.drain(),x.flush(),b())},resume(){!d||S||(d=!1,h=m,h||se(),b())}}}export{Xs as startRecorder};
|
|
78
|
+
`,Cr=typeof self<"u"&&self.Blob&&new Blob([Zr],{type:"text/javascript;charset=utf-8"});function fi(e){let t;try{if(t=Cr&&(self.URL||self.webkitURL).createObjectURL(Cr),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ut=class{constructor(t){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o,i),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:a})}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,o,i){let s=br(r,n,o,!0),a=new Map,l=new fi;l.onmessage=m=>{let{id:f}=m.data;if(a.set(f,!1),!("base64"in m.data))return;let{base64:y,type:S,width:w,height:g}=m.data;this.mutationCb({id:f,type:Ue["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let c=1e3/t,u=0,p,d=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{le(f,n,o,!0)||m.push(f)}),m},h=m=>{if(u&&m-u<c){p=requestAnimationFrame(h);return}u=m,d().forEach(async f=>{var y;let S=this.mirror.getId(f);if(a.get(S)||f.width===0||f.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(f.__context)){let g=f.getContext(f.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(f);l.postMessage({id:S,bitmap:w,width:f.width,height:f.height,dataURLOptions:i.dataURLOptions},[w])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=br(t,r,n,!1),i=li(this.processMutation.bind(this),t,r,n),s=ci(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(s=>{let{type:a,...l}=s;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}},$t=class{constructor(t){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:xr(a,i.href),index:l}))})),n.styleIds.push(s)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Bt=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},q,ct,xe,Ke=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((lr=e.contentWindow)==null?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ge=fo();function ue(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:b,recordDOM:k=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:x=!1,collectFonts:P=!1,inlineImages:H=!1,plugins:U,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:K}=e;Go(K);let N=E?window.parent===window:!0,F=!1;if(!N)try{window.parent.document&&(F=!1)}catch{F=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!F)return()=>{};b!==void 0&&w.mousemove===void 0&&(w.mousemove=b),ge.reset();let W=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=Ar(h);$o();let de,ne=0,ye=D=>{for(let Y of U||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!F&&(D=S(D)),D};q=(D,Y)=>{let O=D;if(O.timestamp=Xe(),O.type!==L.FullSnapshot&&!(O.type===L.IncrementalSnapshot&&O.data.source===A.Mutation)){xe.unfreeze();for(let V of Pe)if(V.isFrozen())V.unfreeze();else break}if(N)t?.(ye(O),Y);else if(F){let V={type:"rrweb",event:ye(O),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(V,"*")}if(O.type===L.FullSnapshot)de=O,ne=0;else if(O.type===L.IncrementalSnapshot){if(O.data.source===A.Mutation&&O.data.isAttachIframe)return;ne++;let V=n&&ne>=n,ae=r&&O.timestamp-de.timestamp>r;(V||ae)&&ct(!0)}};let te=D=>{q({type:L.IncrementalSnapshot,data:{source:A.Mutation,...D}})},oe=D=>q({type:L.IncrementalSnapshot,data:{source:A.Scroll,...D}}),j=D=>q({type:L.IncrementalSnapshot,data:{source:A.CanvasMutation,...D}}),ve=D=>q({type:L.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...D}}),me=new $t({mutationCb:te,adoptedStyleSheetCb:ve}),ie=new zt({mirror:ge,mutationCb:te,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:q});for(let D of U||[])D.getMirror&&D.getMirror({nodeMirror:ge,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});let we=new Bt;xe=new Ut({recordCanvas:R,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:ge,sampling:w.canvas,dataURLOptions:g});let se=new Pt({mutationCb:te,scrollCb:oe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:g,maskTextFn:f,maskInputFn:m,recordCanvas:R,inlineImages:H,sampling:w,slimDOMOptions:G,iframeManager:ie,stylesheetManager:me,canvasManager:xe,keepIframeSrcFn:T,processedNodeManager:we},mirror:ge});ct=(D=!1)=>{if(!k)return;q({type:L.Meta,data:{href:window.location.href,width:Fr(),height:_r()}},D),me.reset(),se.init(),xe.lock(),Pe.forEach(O=>O.lock());let Y=Po(document,{mirror:ge,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:W,maskTextFn:f,maskInputFn:m,slimDOM:G,dataURLOptions:g,recordCanvas:R,inlineImages:H,onSerialize:O=>{Ur(O,ge)&&ie.addIframe(O),$r(O,ge)&&me.trackLinkElement(O),Lt(O)&&se.addShadowRoot(M.shadowRoot(O),document)},onIframeLoad:(O,V)=>{ie.attachIframe(O,V),se.observeAttachShadow(O)},onStylesheetLoad:(O,V)=>{me.attachLinkElement(O,V)},keepIframeSrcFn:T});if(!Y)return console.warn("Failed to snapshot the document");q({type:L.FullSnapshot,data:{node:Y,initialOffset:Dr(window)}},D),xe.unlock(),Pe.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{let D=[],Y=ae=>{var J;return _(oi)({mutationCb:te,mousemoveCb:($,be)=>q({type:L.IncrementalSnapshot,data:{source:be,positions:$}}),mouseInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MouseInteraction,...$}}),scrollCb:oe,viewportResizeCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.ViewportResize,...$}}),inputCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Input,...$}}),mediaInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MediaInteraction,...$}}),styleSheetRuleCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleSheetRule,...$}}),styleDeclarationCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleDeclaration,...$}}),canvasMutationCb:j,fontCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Font,...$}}),selectionCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.Selection,...$}})},customElementCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.CustomElement,...$}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:u,sampling:w,recordDOM:k,recordCanvas:R,inlineImages:H,userTriggeredOnInput:x,collectFonts:P,doc:ae,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:G,dataURLOptions:g,mirror:ge,iframeManager:ie,stylesheetManager:me,shadowDomManager:se,processedNodeManager:we,canvasManager:xe,ignoreCSSAttributes:X,plugins:((J=U?.filter($=>$.observer))==null?void 0:J.map($=>({observer:$.observer,options:$.options,callback:be=>q({type:L.Plugin,data:{plugin:$.name,payload:be}})})))||[]},y)},O=new Map;ie.addLoadListener(ae=>{try{let J=ae.contentDocument;if(O.has(J))return;O.set(J,Y(J))}catch(J){console.warn(J)}}),ie.addUnloadListener(ae=>{let J=O.get(ae);J&&(O.delete(ae),J(),se.removeShadowRootsIn(ae),ge.removeNodeFromMap(ae))});let V=()=>{ct(),D.push(Y(document)),Ke=!0};return["interactive","complete"].includes(document.readyState)?V():(D.push(re("DOMContentLoaded",()=>{q({type:L.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&V()})),D.push(re("load",()=>{q({type:L.Load,data:{}}),I==="load"&&V()},window))),()=>{[...D,...O.values()].forEach(ae=>{try{ae()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),O.clear(),ie.destroy(),we.destroy(),se.reset(),xe.reset(),Ke=!1,jo()}}catch(D){console.warn(D)}}ue.addCustomEvent=(e,t)=>{if(!Ke)throw new Error("please add custom event after start recording");q({type:L.Custom,data:{tag:e,payload:t}})};ue.addAnnotation=e=>{if(!Ke)throw new Error("please add annotation after recording started");q({type:L.Annotation,data:e})};ue.freezePage=()=>{xe.freeze(),Pe.forEach(e=>e.freeze())};ue.takeFullSnapshot=e=>{if(!Ke)throw new Error("please take full snapshot after start recording");ct(e)};ue.mirror=ge;var Kr=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"];var Yr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];var di="<masked>",hi=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"];var pi=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],mi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function gi(e,t){let r=e;for(let n of t.pathRules??[])try{r=r.replace(typeof n.match=="string"?new RegExp(n.match):n.match,n.replace)}catch{}return t.maskPathIds?r.split("/").map(n=>pi.some(o=>o.test(n))?":id":n).join("/"):r}function Jr(e,t){let r=e;if(t.pathRules?.length||t.maskPathIds){let o=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(r);o&&(r=(o[1]??"")+gi(o[2],t)+o[3])}let n=[...hi,...t.maskParams??[],...t.maskCampaignParams?[...Yr,...Kr]:[]];if(n.length){let o=r.indexOf("#"),i=o<0?r:r.slice(0,o),s=o<0?"":r.slice(o);r=i.replace(new RegExp(`([?&])(${n.map(mi).join("|")})=[^&]*`,"gi"),`$1$2=${di}`)+s}return t.stripHash&&(r=r.replace(/#.*$/,"")),r}var fe=Uint8Array,pe=Uint16Array,Zt=Int32Array,Kt=new fe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Yt=new fe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Qr=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(e,t){for(var r=new pe(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Zt(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},sn=on(Kt,2),yi=sn.b,jt=sn.r;yi[28]=258,jt[258]=28;var an=on(Yt,0),ts=an.b,en=an.r,qt=new pe(32768);for(z=0;z<32768;++z)ke=(z&43690)>>1|(z&21845)<<1,ke=(ke&52428)>>2|(ke&13107)<<2,ke=(ke&61680)>>4|(ke&3855)<<4,qt[z]=((ke&65280)>>8|(ke&255)<<8)>>1;var ke,z,et=(function(e,t,r){for(var n=e.length,o=0,i=new pe(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new pe(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new pe(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],p=s[e[o]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)a[qt[p]>>l]=c}else for(a=new pe(n),o=0;o<n;++o)e[o]&&(a[o]=qt[s[e[o]-1]++]>>15-e[o]);return a}),Oe=new fe(288);for(z=0;z<144;++z)Oe[z]=8;var z;for(z=144;z<256;++z)Oe[z]=9;var z;for(z=256;z<280;++z)Oe[z]=7;var z;for(z=280;z<288;++z)Oe[z]=8;var z,bt=new fe(32);for(z=0;z<32;++z)bt[z]=5;var z,vi=et(Oe,9,0);var wi=et(bt,5,0);var ln=function(e){return(e+7)/8|0},un=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new fe(e.subarray(t,r))};var Me=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Je=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Gt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:fn,l:0};if(o==1){var s=new fe(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(k,R){return k.f-R.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[c].f<r[p].f?c++:p++],l=r[c!=u&&r[c].f<r[p].f?c++:p++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=i[0].s,n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var h=new pe(d+1),m=Vt(r[u-1],h,0);if(m>t){var n=0,f=0,y=m-t,S=1<<y;for(i.sort(function(R,E){return h[E.s]-h[R.s]||R.f-E.f});n<o;++n){var w=i[n].s;if(h[w]>t)f+=S-(1<<m-h[w]),h[w]=t;else break}for(f>>=y;f>0;){var g=i[n].s;h[g]<t?f-=1<<t-h[g]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;h[b]==t&&(--h[b],++f)}m=t}return{t:new fe(h),l:m}},Vt=function(e,t,r){return e.s==-1?Math.max(Vt(e.l,t,r+1),Vt(e.r,t,r+1)):t[e.s]=r},tn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new pe(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},cn=function(e,t,r){var n=r.length,o=ln(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},rn=function(e,t,r,n,o,i,s,a,l,c,u){Me(t,u++,r),++o[256];for(var p=Gt(o,15),d=p.t,h=p.l,m=Gt(i,15),f=m.t,y=m.l,S=tn(d),w=S.c,g=S.n,b=tn(f),k=b.c,R=b.n,E=new pe(19),I=0;I<w.length;++I)++E[w[I]&31];for(var I=0;I<k.length;++I)++E[k[I]&31];for(var x=Gt(E,7),P=x.t,H=x.l,U=19;U>4&&!P[Qr[U-1]];--U);var T=c+5<<3,X=Qe(o,Oe)+Qe(i,bt)+s,K=Qe(o,d)+Qe(i,f)+s+14+3*U+Qe(E,P)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&T<=X&&T<=K)return cn(t,u,e.subarray(l,l+c));var N,F,W,G;if(Me(t,u,1+(K<X)),u+=2,K<X){N=et(d,h,0),F=d,W=et(f,y,0),G=f;var de=et(P,H,0);Me(t,u,g-257),Me(t,u+5,R-1),Me(t,u+10,U-4),u+=14;for(var I=0;I<U;++I)Me(t,u+3*I,P[Qr[I]]);u+=3*U;for(var ne=[w,k],ye=0;ye<2;++ye)for(var te=ne[ye],I=0;I<te.length;++I){var oe=te[I]&31;Me(t,u,de[oe]),u+=P[oe],oe>15&&(Me(t,u,te[I]>>5&127),u+=te[I]>>12)}}else N=vi,F=Oe,W=wi,G=bt;for(var I=0;I<a;++I){var j=n[I];if(j>255){var oe=j>>18&31;Je(t,u,N[oe+257]),u+=F[oe+257],oe>7&&(Me(t,u,j>>23&31),u+=Kt[oe]);var ve=j&31;Je(t,u,W[ve]),u+=G[ve],ve>3&&(Je(t,u,j>>5&8191),u+=Yt[ve])}else Je(t,u,N[j]),u+=F[j]}return Je(t,u,N[256]),u+F[256]},bi=new Zt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn=new fe(0),Si=function(e,t,r,n,o,i){var s=i.z||e.length,a=new fe(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var p=bi[t-1],d=p>>13,h=p&8191,m=(1<<r)-1,f=i.p||new pe(32768),y=i.h||new pe(m+1),S=Math.ceil(r/3),w=2*S,g=function(V){return(e[V]^e[V+1]<<S^e[V+2]<<w)&m},b=new Zt(25e3),k=new pe(288),R=new pe(32),E=0,I=0,x=i.i||0,P=0,H=i.w||0,U=0;x+2<s;++x){var T=g(x),X=x&32767,K=y[T];if(f[X]=K,y[T]=X,H<=x){var N=s-x;if((E>7e3||P>24576)&&(N>423||!c)){u=rn(e,l,0,b,k,R,I,P,U,x-U,u),P=E=I=0,U=x;for(var F=0;F<286;++F)k[F]=0;for(var F=0;F<30;++F)R[F]=0}var W=2,G=0,de=h,ne=X-K&32767;if(N>2&&T==g(x-ne))for(var ye=Math.min(d,N)-1,te=Math.min(32767,x),oe=Math.min(258,N);ne<=te&&--de&&X!=K;){if(e[x+W]==e[x+W-ne]){for(var j=0;j<oe&&e[x+j]==e[x+j-ne];++j);if(j>W){if(W=j,G=ne,j>ye)break;for(var ve=Math.min(ne,j-2),me=0,F=0;F<ve;++F){var ie=x-ne+F&32767,we=f[ie],se=ie-we&32767;se>me&&(me=se,K=ie)}}}X=K,K=f[X],ne+=X-K&32767}if(G){b[P++]=268435456|jt[W]<<18|en[G];var D=jt[W]&31,Y=en[G]&31;I+=Kt[D]+Yt[Y],++k[257+D],++R[Y],H=x+W,++E}else b[P++]=e[x],++k[e[x]]}}for(x=Math.max(x,H);x<s;++x)b[P++]=e[x],++k[e[x]];u=rn(e,l,c,b,k,R,I,P,U,x-U,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=y,i.p=f,i.i=x,i.w=H)}else{for(var x=i.w||0;x<s+c;x+=65535){var O=x+65535;O>=s&&(l[u/8|0]=c,O=s),u=cn(l,u+1,e.subarray(x,O))}i.i=s}return un(a,0,n+ln(u)+o)},Ci=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),ki=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=Ci[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var Mi=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new fe(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return Si(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)};var Xt=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ri=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Xt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}};var xi=function(e){return 10+(e.filename?e.filename.length+1:0)};function dn(e,t){t||(t={});var r=ki(),n=e.length;r.p(e);var o=Mi(e,t,xi(t),8),i=o.length;return Ri(o,t),Xt(o,i-8,r.d()),Xt(o,i-4,n),o}var nn=typeof TextEncoder<"u"&&new TextEncoder,Ii=typeof TextDecoder<"u"&&new TextDecoder,Ei=0;try{Ii.decode(fn,{stream:!0}),Ei=1}catch{}function hn(e,t){if(t){for(var r=new fe(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(nn)return nn.encode(e);for(var o=e.length,i=new fe(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new fe(s+8+(o-n<<1));l.set(i),i=l}var c=e.charCodeAt(n);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return un(i,0,s)}async function pn(e){if(typeof CompressionStream<"u"&&typeof Response<"u")try{let t=new Response(e).body?.pipeThrough(new CompressionStream("gzip"));if(t)return new Uint8Array(await new Response(t).arrayBuffer())}catch{}return Jt(e)}function Jt(e){return dn(hn(e))}var Ti=8e6,mn=6e4;function gn(e){let t=[],r=0,n=0,o,i=!!e.hold,s=!1,a,l,c=[],u=()=>c.reduce((w,g)=>w+g.json.length,0),p=()=>{if(!t.length)return;let{sessionId:w,windowId:g}=e.ids();o&&o!==w&&(n=0,e.onSessionChange?.()),o=w,c.push({json:d(w,g,n,t),parts:t,window:g,session:w,seq:n++,tries:0}),t=[],r=0},d=(w,g,b,k)=>`{"api_key":${JSON.stringify(e.apiKey)},"session_id":${JSON.stringify(w)},"window_id":${JSON.stringify(g)},"seq":${b},"events":[${k.join(",")}]}`,h=0,m=async w=>{try{let g=await pn(w.json),b=await e.fetch(`${e.url}?compression=gzip`,{method:"POST",body:g,headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:g.length<mn}),k=b.headers?.get?.("Retry-After")?.trim()??"";return h=/^\d+$/.test(k)?Math.min(Number(k),300)*1e3:0,b.status}catch{return 0}},f=()=>i||s?Promise.resolve():(l??=(async()=>{for(;c.length&&!i&&!s;){let w=c[0],g=await m(w);g>=200&&g<300?(c.shift(),e.onSent?.(w.session,w.json.length)):!ir(g)||++w.tries>(e.maxRetries??5)?(e.log?.("replay chunk dropped",w.seq,g),c.shift(),e.onGap?.()):await new Promise(b=>setTimeout(b,Math.max(h,or(w.tries-1,e.backoff))))}})().finally(()=>{l=void 0}),l),y=()=>{a??=setTimeout(()=>{a=void 0,S()},e.flushMs)},S=()=>(a!==void 0&&clearTimeout(a),a=void 0,p(),i&&u()>Ti&&(i=!1),f());return{add(w){if(s)return;let g=JSON.stringify(w);if(g.length>rr-4096)return e.log?.("replay event too large",g.length);r&&r+g.length>e.chunkBytes&&S(),t.push(g),r+=g.length+1,r>=e.chunkBytes?S():y()},flush:S,beacon(){if(i||s)return;p();let w=c[0]?.seq??0,g=c[0]?.session;for(let b of c.splice(0)){b.session!==g&&([g,w]=[b.session,b.seq]);let k=R=>{let E=Jt(d(b.session,b.window,w,R));if(E.length>mn&&R.length>1){k(R.slice(0,R.length>>1)),k(R.slice(R.length>>1));return}w++,navigator.sendBeacon?.(`${e.url}?compression=gzip`,new Blob([E],{type:"text/plain"}))};k(b.parts)}n=Math.max(n,w)},release(){i=!1,S()},discard(){s=!0,t=[],c.length=0,a!==void 0&&clearTimeout(a)},get unsent(){return r+u()},get seq(){return n},get held(){return i}}}var yn=(e,t)=>{let r=e(t);return r&&r.nodeType===1?r:null};function $e(e,t,r){let n=o=>{o&&(o.type===2&&o.attributes&&r(o.attributes,(o.tagName??"").toLowerCase(),yn(t,o.id)),o.childNodes?.forEach(n))};if(e.type===2&&n(e.data?.node),!(e.type!==3||e.data?.source!==0)){e.data.adds?.forEach(o=>n(o.node));for(let o of e.data.attributes??[]){let i=yn(t,o.id);r(o.attributes,i?.tagName.toLowerCase()??"",i)}}}var Oi=["title","alt","placeholder","aria-label","aria-description","aria-placeholder","aria-roledescription","aria-valuetext"],Ni=new Set(["input","textarea","select"]),vn=e=>e.replace(/\S/g,"*");function wn(e,t){let r=o=>{try{return!!o?.closest(t)&&!o.closest(e)}catch{return!1}},n=(o,i,s)=>{if(!r(s))for(let a of Object.keys(o)){let l=o[a];(Oi.includes(a)||a==="value"&&!Ni.has(i))&&typeof l=="string"&&(o[a]=vn(l))}};return{maskTextFn:(o,i)=>r(i)?o:vn(o),scrub:(o,i)=>$e(o,i,n)}}var bn="data-lc-fixed";function Sn(e,t){$e(e,t,(r,n,o)=>{if(!(!o||bn in r))try{let i=getComputedStyle(o).position;(i==="fixed"||i==="sticky")&&(r[bn]="")}catch{}})}var Cn=()=>window.parent!==window;function Li(){let e=location.ancestorOrigins;if(e?.length)return e[0];try{return document.referrer?new URL(document.referrer).origin:void 0}catch{return}}var kn=e=>{let t=Li();return!!t&&e.includes(t)};function Mn(e){let t=r=>{let n=r.data;n&&typeof n=="object"&&n.type==="rrweb"&&!e.includes(r.origin)&&r.stopImmediatePropagation()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}var Ai=new Set(["Shift","Control","Alt","Meta","CapsLock","AltGraph"]);function Rn(e,t,r=1e3){let n=0,o,i=()=>{o=void 0,n>0&&e(n)&&(n=0)},s=l=>{if(!(l instanceof Element))return!1;if(l instanceof HTMLInputElement&&l.type==="password")return!0;let c=t();try{return!!c&&!!l.closest(c)}catch{return!1}},a=l=>{l.repeat||Ai.has(l.key)||s(l.target)||(n++,o??=setTimeout(i,r))};return document.addEventListener("keydown",a,{capture:!0,passive:!0}),{flush:i,stop(){document.removeEventListener("keydown",a,{capture:!0}),o!==void 0&&clearTimeout(o),i()}}}function xn(e,t=1e3){let r=0,n,o=()=>{n=void 0;let s=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);s>0&&s!==r&&(r=s,e(s))},i=()=>{n??=setTimeout(o,t)};return window.addEventListener("load",i),window.addEventListener("resize",i),{schedule:i,reset(){r=0,n!==void 0&&clearTimeout(n),o()},stop(){window.removeEventListener("load",i),window.removeEventListener("resize",i),n!==void 0&&clearTimeout(n)}}}function In(){let e=[[]];return{push(t,r){r&&(e=[e[e.length-1],[]]),e[e.length-1].push(t)},drain(){let t=e.flat();return e=[[]],t},get size(){return e.reduce((t,r)=>t+r.length,0)}}}function En(e,t,r){if(!e)return null;let n=null;try{let o=e.proxy&&new URL(e.proxy.url,location.href);o&&/^https?:$/.test(o.protocol)&&r.includes(o.origin)&&e.proxy?.origins.length&&(n={url:o.toString(),origins:[...e.proxy.origins]})}catch{}return{inlineImages:!!e.inlineImages&&!t,maxInlineBytes:e.maxInlineBytes??256*1024,collectFonts:!!e.collectFonts,proxy:n}}var Di=new Set(["img","source","video","audio","track","image","input"]),_i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g;function Tn(e){let t=i=>{if(!e.proxy||i.startsWith("data:"))return i;try{let s=new URL(i,location.href);return e.proxy.origins.includes(s.origin)?`${e.proxy.url}${e.proxy.url.includes("?")?"&":"?"}url=${encodeURIComponent(s.toString())}`:i}catch{return i}},r=i=>i.replace(_i,(s,a,l)=>{let c=t(l.trim());return c===l.trim()?s:`url(${a}${c}${a})`}),n=i=>i.split(",").map(s=>{let[a,...l]=s.trim().split(/\s+/);return a?[t(a),...l].join(" "):s}).join(", "),o=(i,s)=>{if(s==="img"&&typeof i.rr_dataURL=="string"&&i.rr_dataURL.length>e.maxInlineBytes&&delete i.rr_dataURL,!!e.proxy)for(let[a,l]of Object.entries(i))typeof l=="string"&&(a==="_cssText"||a==="style"?i[a]=r(l):a==="srcset"?i[a]=n(l):(a==="poster"||a==="src"&&Di.has(s)||a==="href"&&s==="link"||a==="xlink:href"&&s==="image")&&(i[a]=t(l)))};return{scrub(i,s){if($e(i,s,o),e.proxy&&i.type===3&&i.data?.source===8)for(let a of i.data.adds??[])typeof a.rule=="string"&&(a.rule=r(a.rule))}}}function Fi(e,t,r){let n={x:0,y:0,width:e.width,height:e.height},o=[];try{o=r?.(e)??[]}catch{o=[n]}let i=t.flatMap(s=>{try{return e.matches(s.selector)?s.regions??[n]:[]}catch{return[n]}});return[...o,...i]}function On(e){let t=new Map,r=document.createElement("canvas"),n=()=>{for(let i of Array.from(document.querySelectorAll("canvas"))){let s=e.idOf(i);if(!(s<=0||!i.width||!i.height||i.closest(e.skip)))try{r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)return;a.drawImage(i,0,0),a.fillStyle="#000";for(let p of Fi(i,e.rules,e.regionsFn))a.fillRect(p.x,p.y,p.width,p.height);let l=r.toDataURL("image/jpeg",e.quality),c=l.slice(l.indexOf(",")+1);if(!c||t.get(s)===c)continue;t.set(s,c);let u={rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:c}],type:"image/jpeg"};e.emit({type:3,timestamp:Date.now(),data:{source:9,id:s,type:0,commands:[{property:"clearRect",args:[0,0,i.width,i.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[u]},0,0]}]}})}catch{}}},o=setInterval(n,Math.round(1e3/e.fps));return{reset:()=>t.clear(),tick:n,stop:()=>clearInterval(o)}}function Nn(e,t=Date.now){let r=e.eventsPerSecond??10,n=e.burst??100,o=n,i=t();return()=>{let s=t();return o=Math.min(n,o+(s-i)/1e3*r),i=s,o<1?!1:(o-=1,!0)}}var zi=1e4;function Ln(e,t=Date.now){let r=new Map,n=0;return{allow(o){let i=o.data;return o.type!==3||i?.source!==0||!i.attributes?.length?!0:(r.size>zi&&r.clear(),i.attributes=i.attributes.filter(s=>{let a=r.get(s.id);return a||r.set(s.id,a=Nn({burst:e.burst??100,eventsPerSecond:e.perSecond??10},t)),a()?!0:(n++,!1)}),!!(i.attributes.length||i.adds?.length||i.removes?.length||i.texts?.length))},get dropped(){return n}}}var Pi=new Set([1,2,3,4,5,6,7,12]);function An(e){let t,r=!1,n=0;return{check(o){if(e<=0)return{keep:!0,resumed:!1};let i=o.timestamp??Date.now();if(t??=i,o.type===3&&Pi.has(o.data?.source??-1)){t=i;let s=r&&n>0;return r=!1,n=0,{keep:!0,resumed:s}}return!r&&i-t>e&&(r=!0),r?(n++,{keep:!1,resumed:!1}):{keep:!0,resumed:!1}}}}function Dn(e,t,r){let n=[],o;switch(t.mode){case"on_event":e.onCapture(i=>t.events.includes(i.event)&&r());break;case"on_flag":{let i=e.flags?.onChange(s=>s[t.flag]&&r());i&&n.push(i);break}case"on_url":try{o=new RegExp(t.pattern)}catch{e.log("bad on_url pattern",t.pattern)}break;case"on_frustration":{let i=[],s=a=>{let l=Date.now();for(i.push({t:l,x:a.clientX,y:a.clientY});i.length&&l-i[0].t>1e3;)i.shift();i.filter(u=>Math.hypot(u.x-a.clientX,u.y-a.clientY)<=30).length>=3&&r()};document.addEventListener("click",s,!0),n.push(()=>document.removeEventListener("click",s,!0));break}default:}return{checkUrl:i=>o?.test(i)&&r(),stop:()=>n.forEach(i=>i())}}var St="[redacted]",Ui=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token)$/i,er=/pass(word|wd|phrase)?|secret|token|api[-_]?key|card|cvv|cvc|ssn|authorization/i;var Re=(e,t=4096)=>e.length>t?`${e.slice(0,t)}...[truncated ${e.length-t}]`:e;function tt(e){let t={};for(let r of Object.keys(e))t[r]=Ui.test(r)?St:Re(e[r]??"",512);return t}function Qt(e,t){if(t>6||e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Qt(n,t+1));let r={};for(let[n,o]of Object.entries(e))r[n]=er.test(n)?St:Qt(o,t+1);return r}function Be(e){if(e==null)return;if(typeof e!="string")return typeof URLSearchParams<"u"&&e instanceof URLSearchParams?Be(e.toString()):"[binary]";let t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return Re(JSON.stringify(Qt(JSON.parse(t),0)))}catch{}if(/^[^\s=&]+=[^\s]*$/.test(t)){let r=new URLSearchParams(t);for(let n of[...r.keys()])er.test(n)&&r.set(n,St);return Re(r.toString())}return Re(e)}function _n(e,t=1e3){try{if(typeof e=="string")return Re(e,t);if(e instanceof Error)return Re(`${e.name}: ${e.message}${e.stack?`
|
|
79
|
+
${e.stack}`:""}`,t);if(typeof Node<"u"&&e instanceof Node)return`<${e.nodeName.toLowerCase()}>`;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(e===null||typeof e!="object")return String(e);let r=new WeakSet;return Re(JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return String(o);if(typeof Node<"u"&&o instanceof Node)return`<${o.nodeName.toLowerCase()}>`;if(o!==null&&typeof o=="object"){if(r.has(o))return"[Circular]";r.add(o)}return er.test(n)?St:o}),t)}catch{return"[unserializable]"}}var rt=(e,t)=>!!e?.some(r=>typeof r=="string"?t.includes(r):(r.lastIndex=0,r.test(t)));var Fn=["log","info","warn","error","debug"],$i=1e3,Bi=10;function zn(e,t){let r=0,n=!1,o=(c,u)=>{if(!(n||r>=$i)){n=!0;try{r++,e({level:c,args:t()?["[masked]"]:u.slice(0,Bi).map(p=>_n(p))})}catch{}finally{n=!1}}},i={},s={};for(let c of Fn){let u=console[c];i[c]=u,s[c]=function(...p){u.apply(this,p),o(c,p)},console[c]=s[c]}let a=c=>o("error",[c.error??c.message]),l=c=>o("error",["Unhandled rejection:",c.reason]);return window.addEventListener("error",a),window.addEventListener("unhandledrejection",l),()=>{for(let c of Fn)console[c]===s[c]&&(console[c]=i[c]);window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",l)}}var Pn=e=>{let t={};return e.forEach((r,n)=>t[n]=r),t},Hi=e=>{let t={};for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&(t[r.slice(0,n).trim().toLowerCase()]=r.slice(n+1).trim())}return t},nt=e=>{try{return new URL(e,location.href).href}catch{return e}};function Un(e,t,r){let n=d=>{try{if(r(d.url)||rt(t.deny,d.url)||t.allow&&!rt(t.allow,d.url))return;t.headers||(delete d.req?.headers,delete d.res?.headers),t.body||(delete d.req?.body,delete d.res?.body),d.req&&!d.req.headers&&!d.req.body&&delete d.req,d.res&&!d.res.headers&&!d.res.body&&delete d.res;let h=t.redact?t.redact(d):d;h&&e(h)}catch{}},o=d=>r(nt(d))||rt(t.deny,nt(d))||!!t.allow&&!rt(t.allow,nt(d)),i=window.fetch;window.fetch=function(d,h){let m=i.call(this,d,h);try{let f=nt(d instanceof Request?d.url:String(d));if(o(f))return m;let y=Date.now(),S=performance.now(),w=(h?.method??(d instanceof Request?d.method:"GET")).toUpperCase(),g=t.headers||t.body?{headers:tt(Pn(new Headers(h?.headers??(d instanceof Request?d.headers:void 0)))),body:Be(h?.body)}:void 0,b=k=>n({method:w,url:f,status:0,start:y,duration:Math.round(performance.now()-S),type:"fetch",req:g,...k});m.then(k=>{let R=Number(k.headers.get("content-length"))||void 0,E={status:k.status,size:R,res:t.headers?{headers:tt(Pn(k.headers))}:void 0};if(!t.body)return b(E);k.clone().text().then(I=>b({...E,size:R??I.length,res:{...E.res,body:Be(I)}}),()=>b(E))},k=>b({error:Re(String(k?.message??k),200)}))}catch{}return m};let s=window.fetch,a=XMLHttpRequest.prototype,{open:l,send:c,setRequestHeader:u}=a,p=new WeakMap;return a.open=function(d,h,...m){return p.set(this,{method:d.toUpperCase(),url:nt(String(h)),headers:{}}),l.call(this,d,h,...m)},a.setRequestHeader=function(d,h){let m=p.get(this);return m&&(m.headers[d.toLowerCase()]=h),u.call(this,d,h)},a.send=function(d){let h=p.get(this);if(h&&!o(h.url)){let m=Date.now(),f=performance.now();this.addEventListener("loadend",()=>{try{let y=t.body&&(this.responseType===""||this.responseType==="text")?this.responseText:void 0;n({method:h.method,url:h.url,status:this.status,start:m,duration:Math.round(performance.now()-f),size:Number(this.getResponseHeader("content-length"))||y?.length||void 0,type:"xhr",...this.status===0&&{error:"network error"},req:{headers:tt(h.headers),body:Be(d)},res:{headers:tt(Hi(this.getAllResponseHeaders())),body:y===void 0?void 0:Be(y)}})}catch{}})}return c.call(this,d)},()=>{window.fetch===s&&(window.fetch=i),a.open=l,a.send=c,a.setRequestHeader=u}}var Wi={on_event:"event_trigger_matched",on_url:"url_trigger_matched",on_flag:"linked_flag_matched",on_frustration:"frustration_detected"};function Gi(e){let t=parseInt(e.replace(/-/g,"").slice(0,12),16);return Number.isFinite(t)&&t>0?t:Date.now()}var ji=5*6e4,qi={$pageview:e=>({url:e.$current_url}),$pageleave:()=>({}),$form_start:e=>({form:e.form}),$form_submit:e=>({form:e.form}),$replay_tag:e=>({name:e.name})},Vi="********";function Ks(e,t,r,n){let{core:o}=e,i=e.config.apiHost,s=t.trigger_groups,a=t.trigger.mode,l=a==="on_url"&&n?.url_trigger||a==="on_event"&&n?.event_trigger||a==="on_flag"&&n?.linked_flag,u=!(s.length>0||a!=="always"&&!l),p=t.min_duration_ms,d=!!(n?.url_trigger||n?.event_trigger||n?.linked_flag);r.startReason=u?d?"trigger_overridden":n?.sampling?"sampling_overridden":"recording_initialized":void 0;let h=!1,m=!1,f=!1,y,S=!1,w=In(),g=t.min_duration_mode==="session"?Gi(o.sessionId):Date.now();r.bufferLength=()=>w.size;let b=()=>{r.status=S?"disabled":h?m?"excluded":"paused":u?"active":"buffering"},k=()=>{try{ue.takeFullSnapshot(!0)}catch{}},R=gn({url:`${i}/v1/replay`,apiKey:e.apiKey,fetch:e.fetch,ids:()=>({sessionId:o.sessionId,windowId:o.session.touch().windowId}),chunkBytes:t.chunk_bytes,flushMs:t.flush_interval_ms,hold:p>0||s.some(C=>(C.min_duration_ms??0)>0),onSent:(C,Z)=>{r.flushedBytes+=Z,r.ack(C)},onSessionChange:()=>k(),onGap:()=>k(),log:e.log}),E=xn(C=>{try{ue.addCustomEvent("page_height",{height:C})}catch{}}),I=ar(t.url_privacy_rules),x=kt(I,location.href),P="",H="",U,T=()=>{P=["[data-lc-mask]",...t.mask_selectors,...x.mask].join(","),H=["[data-lc-block]",...t.block_selectors,...x.block].join(","),U=t.mask_all_text||x.maskAllText?wn(P,["[data-lc-unmask]",...t.unmask_selectors].join(",")):void 0};T(),r.bufferBytes=()=>R.unsent;let X=t.mutationThrottle?Ln(t.mutationThrottle):void 0;r.throttled=()=>X?.dropped??0;let K=C=>{try{return C?[new URL(C).origin]:[]}catch{return[]}},N=En(t.assets,t.mask_all_text||I.some(C=>C.mask_all_text),[location.origin,...K(i),...K(e.config.uiHost)]),F=N&&(N.proxy||N.inlineImages)?Tn(N):void 0,W=!!t.canvas&&(t.canvasMask.length>0||!!t.canvasMaskRegions),G,de=t.maskUrlFn??(C=>Jr(C,e.config.urlPrivacy??{})),ne=An(t.idle_threshold_ms),ye=(C,Z)=>{if(h||S)return;let Q=ne.check(C);if(!Q.keep||(Q.resumed&&k(),X&&!X.allow(C)))return;C.type===2&&G?.reset();let Se=it=>ue.mirror.getNode(it);if(U?.scrub(C,Se),F?.scrub(C,Se),Sn(C,Se),de&&C.type===4&&typeof C.data?.href=="string"){let it=C.data;it.href=de(it.href)}C.type===3&&C.data?.source===0&&E.schedule(),u?R.add(C):w.push(C,!!Z)},te=t.crossOriginIframes,oe=!!te&&Cn(),j=oe&&!kn(te),ve=te&&!oe?Mn(te):void 0,me=j?void 0:Rn(C=>{try{return ue.addCustomEvent("keys",{n:C}),!0}catch{return!1}},()=>[P,H,"[data-lc-ignore]"].filter(Boolean).join(",")),ie=(C,Z)=>{if(!(h||S||!y))try{ue.addCustomEvent(C,Z)}catch{}},we=[];if(!j){let C=()=>t.mask_all_text||x.maskAllText;if(t.console&&we.push(zn(Z=>ie("console",Z),C)),t.network){let Z=`${(i??"").replace(/\/+$/,"")}/v1/`;we.push(Un(Q=>ie("network",{...Q,url:de?de(Q.url):Q.url}),t.network,Q=>Q.startsWith(Z)))}}let se=()=>{if(!(y||S||j)){try{y=D()}catch(C){r.status="rrweb_error",r.rrwebError=String(C).slice(0,200);return}W&&t.canvas&&(G=On({...t.canvas,skip:`${H},[data-lc-ignore]`,rules:t.canvasMask,regionsFn:t.canvasMaskRegions,idOf:C=>ue.mirror.getId(C),emit:C=>ye(C)})),E.reset(),b()}},D=()=>ue({emit:ye,checkoutEveryNms:u?ji:t.buffer_ms/2,maskAllInputs:t.mask_all_inputs,maskInputOptions:{...t.maskInputOptions,password:!0},maskInputFn:t.maskInputFn??(()=>Vi),maskTextSelector:U?"*":P,...U?{maskTextFn:U.maskTextFn}:t.maskTextFn&&{maskTextFn:t.maskTextFn},blockSelector:H,ignoreSelector:"[data-lc-ignore]",sampling:{mousemove:50,scroll:150,input:"last",...t.canvas&&!W&&{canvas:t.canvas.fps}},...t.canvas&&!W&&{dataURLOptions:{type:"image/jpeg",quality:t.canvas.quality}},...N?.inlineImages&&{inlineImages:!0},...N?.collectFonts&&{collectFonts:!0},errorHandler:C=>(r.rrwebErrors++,r.rrwebError=String(C).slice(0,200),!0),recordCrossOriginIframes:!!te,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0},recordCanvas:!!t.canvas&&!W})??void 0,Y=()=>{y?.(),y=void 0,G?.stop(),G=void 0},O=(C,Z)=>{if(!(u||S)){u=!0,r.startReason=C??Wi[a]??"recording_initialized",Z?.min_duration_ms!==void 0&&(p=Z.min_duration_ms),r.minDurationMs=p;for(let Q of w.drain())R.add(Q);Y(),h||se(),ae(),b()}},V,ae=()=>{!R.held||V!==void 0||(V=setTimeout(()=>R.release(),Math.max(0,p-(Date.now()-g))))},J=s.length?sr(e,s,()=>o.sessionId,C=>O("trigger_group_matched",C),{url:n?.url_trigger,event:n?.event_trigger,flag:n?.linked_flag,sampling:n?.sampling}):void 0,$=J??Dn(e,t.trigger,()=>O());J&&(r.triggers=J.states,r.matchedGroups=J.matched);let be="",He=()=>{if(location.href===be)return;be=location.href;let C=kt(I,be),Z=C.key!==x.key;Z&&(x=C,T());let Q=!!y,Se=nr(be,t.include_urls,t.exclude_urls);!Se&&!m?(m=h=!0,Y(),w.drain(),R.flush(),b()):Se&&m&&(m=!1,h=f,h||se(),b()),Se&&$.checkUrl(be),Z&&Q&&y&&(Y(),se())},$n=setInterval(He,1e3),Ct=window.navigation,ot=[],Ne=()=>He();if(Ct)Ct.addEventListener("currententrychange",Ne),ot.push(()=>Ct.removeEventListener("currententrychange",Ne));else for(let C of["pushState","replaceState"]){let Z=history[C],Q=function(...Se){Z.apply(this,Se),He()};history[C]=Q,ot.push(()=>{history[C]===Q&&(history[C]=Z)})}window.addEventListener("popstate",Ne),window.addEventListener("hashchange",Ne),ot.push(()=>(window.removeEventListener("popstate",Ne),window.removeEventListener("hashchange",Ne))),e.onCapture(C=>{C.event==="$pageview"&&He();let Z=qi[C.event];if(!(!Z||h||S||!y))try{let Q=Z(C.properties);de&&typeof Q.url=="string"&&(Q.url=de(Q.url)),ue.addCustomEvent(C.event,Q)}catch{}});let tr=()=>{document.visibilityState==="visible"?u&&y&&ue.takeFullSnapshot(!0):R.beacon()};return document.addEventListener("visibilitychange",tr),e.onUnload(()=>{R.held?R.discard():R.beacon()}),He(),J?.check(),h||se(),u&&ae(),b(),{stop:()=>{S=!0,Y(),clearInterval($n);for(let C of ot)C();clearTimeout(V),document.removeEventListener("visibilitychange",tr),ve?.(),E.stop(),me?.stop();for(let C of we)C();$.stop(),w.drain(),R.discard(),b()},paused:()=>h,pause(){f||S||(f=h=!0,Y(),w.drain(),R.flush(),b())},resume(){!f||S||(f=!1,h=m,h||se(),b())}}}export{Ks as startRecorder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,c as v,d as b,e as R,f as W,g as h,i as D,j as U}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var k="lc_replay_ack",z=()=>{try{let e=sessionStorage.getItem(k);return e?[e]:[]}catch{return[]}};function j(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(z()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(k,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let c=e.bufferBytes?.();c&&(r.$replay_buffer_size=c);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var C="lucida_replay_url";function E(e,t,i,r=2e3){let d={},c=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[C]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[C,s]]]]),d.crisp=s)}catch{}};c();let a=setInterval(c,r);return()=>clearInterval(a)}var Y=e=>{let t=j();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!R(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),e.loadConfig(),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",o,s=0,g=!1,M=location.href,w=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async(n,_=!1)=>{if(a!=="idle")return;if(!w())return r("no_consent");a="starting",t.status="awaiting_config";let p=++s,u=await e.loadConfig(),x=f(u?.replay_never_record,M)||(!!n||_)&&f(u?.replay_never_record,location.href),l=x?null:v(i,u);if(p!==s)return void(a="idle");if(!l)return r(x?"never_record_page":"remote_disabled"),void(a="idle");let I=e.core.sessionId,$=l.trigger_groups.length>0,O=!!n?.sampling||$||h(I,"",l.sample_rate);if(t.sampleRate=$?void 0:l.sample_rate,t.minDurationMs=l.min_duration_ms,!O)return t.status=b(location.href,l.include_urls,l.exclude_urls)?"sampled":"excluded",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:P}=await import("./recorder-
|
|
1
|
+
import{a as f,c as v,d as b,e as R,f as W,g as h,i as D,j as U}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var k="lc_replay_ack",z=()=>{try{let e=sessionStorage.getItem(k);return e?[e]:[]}catch{return[]}};function j(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(z()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(k,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let c=e.bufferBytes?.();c&&(r.$replay_buffer_size=c);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var C="lucida_replay_url";function E(e,t,i,r=2e3){let d={},c=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[C]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[C,s]]]]),d.crisp=s)}catch{}};c();let a=setInterval(c,r);return()=>clearInterval(a)}var Y=e=>{let t=j();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!R(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),e.loadConfig(),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",o,s=0,g=!1,M=location.href,w=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async(n,_=!1)=>{if(a!=="idle")return;if(!w())return r("no_consent");a="starting",t.status="awaiting_config";let p=++s,u=await e.loadConfig(),x=f(u?.replay_never_record,M)||(!!n||_)&&f(u?.replay_never_record,location.href),l=x?null:v(i,u);if(p!==s)return void(a="idle");if(!l)return r(x?"never_record_page":"remote_disabled"),void(a="idle");let I=e.core.sessionId,$=l.trigger_groups.length>0,O=!!n?.sampling||$||h(I,"",l.sample_rate);if(t.sampleRate=$?void 0:l.sample_rate,t.minDurationMs=l.min_duration_ms,!O)return t.status=b(location.href,l.include_urls,l.exclude_urls)?"sampled":"excluded",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:P}=await import("./recorder-AJ7XX7OZ.js");if(p!==s)return void(a="idle");o=P(e,l,t,n),a="on"},S=()=>{s++,o?.stop(),o=void 0,a="idle"};e.replay={start:async n=>{g=!1;let _=n===!0,p=u=>_||typeof n=="object"&&!!n[u];await m({sampling:n===void 0||p("sampling"),url_trigger:p("url_trigger"),event_trigger:p("event_trigger"),linked_flag:p("linked_flag")})},stop:()=>{g=!0,S(),r("stopped_manually")},pause:()=>o?.pause(),resume:()=>o?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!o?.paused()},e.core.onChange(n=>{n==="consent"&&(w()?g||m(void 0,!0):(S(),r("no_consent")))}),m();let y=i.supportWidgets,T=y?.intercom||y?.crisp?E(y,()=>e.client.getReplayUrl(),()=>a==="on"&&!o?.paused()):void 0;return()=>{s++,o?.stop(),T?.()}};export{W as fnv1a32,R as lucidaRecords,U as pagePrivacy,f as policyMatches,Y as replay,v as resolveReplay,h as sampled,b as urlAllowed,D as urlRules};
|
package/dist/toolbar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as Guide, G as GuideStep, H as Host, M as Module } from './types-
|
|
1
|
+
import { g as Guide, G as GuideStep, H as Host, M as Module } from './types-Chfj1wdu.js';
|
|
2
2
|
import '@lucida-analytics/sdk-core';
|
|
3
3
|
|
|
4
4
|
/** Session derived from the POST /v1/toolbar/exchange response (contract: sdks/browser/README.md). */
|