import{r as V,j as gt}from"./jsx-runtime-C0aJtAVo.js";import{i as wr,S as vr,_ as yt,a as Er,b as br,c as kr,d as Rr,e as Ir,f as Mr,g as Cr,u as xr,h as Tr,j as bn,k as Ar,l as Or,m as Dr,n as kn,o as Nr,p as Lr,s as Pr,q as Br}from"./performance-Dr5PfnCf.js";import{G as Et,g as ae,d as Rn,a as bt,b as st,e as Xt,l as F,c as In,h as Mn,f as Fr,i as Hr,n as Cn,j as zr,k as Ur,u as Wr,p as $r,m as jr,o as qr}from"./hub-TbXGv0_Z.js";import{N as Kr}from"./module-CJf6psvM.js";import{r as Vr}from"./index-C3Zz7VP3.js";import"./_index-CwxhOuXA.js";import{E as Yr,r as Gr,t as Xr,v as Jr,w as Qr,u as Zr}from"./index-BhMM157g.js";import{R as es}from"./index-CCV9ZY_r.js";import{e as ts,i as ns,f as rs,g as ss,s as is,h as os,j as as,k as cs,R as ls,l as us,m as ds}from"./components--pwyld6Q.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2fb7fc20-c07a-4c59-8524-6de3749896f7",e._sentryDebugIdIdentifier="sentry-dbid-2fb7fc20-c07a-4c59-8524-6de3749896f7")}catch{}})();/**
 * @remix-run/react v2.12.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function fs(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Yr(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack=s.stack,n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack=s.stack,n[r]=i}}else n[r]=s;return n}/**
 * @remix-run/react v2.12.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */let le,Q,_t=!1;let kt,sc=new Promise(e=>{kt=e}).catch(()=>{});function hs(e){if(!Q){if(window.__remixContext.future.unstable_singleFetch){if(!le){let c=window.__remixContext.stream;ns(c,"No stream found for single fetch decoding"),window.__remixContext.stream=void 0,le=rs(c,window).then(a=>{window.__remixContext.state=a.value,le.value=!0}).catch(a=>{le.error=a})}if(le.error)throw le.error;if(!le.value)throw le}let i=ss(window.__remixManifest.routes,window.__remixRouteModules,window.__remixContext.state,window.__remixContext.future,window.__remixContext.isSpaMode),o;if(!window.__remixContext.isSpaMode){o={...window.__remixContext.state,loaderData:{...window.__remixContext.state.loaderData}};let c=Gr(i,window.location,window.__remixContext.basename);if(c)for(let a of c){let l=a.route.id,d=window.__remixRouteModules[l],u=window.__remixManifest.routes[l];d&&is(u,d,window.__remixContext.isSpaMode)&&(d.HydrateFallback||!u.hasLoader)?o.loaderData[l]=void 0:u&&!u.hasLoader&&(o.loaderData[l]=null)}o&&o.errors&&(o.errors=fs(o.errors))}Q=Xr({routes:i,history:Jr(),basename:window.__remixContext.basename,future:{v7_normalizeFormMethod:!0,v7_fetcherPersist:window.__remixContext.future.v3_fetcherPersist,v7_partialHydration:!0,v7_prependBasename:!0,v7_relativeSplatPath:window.__remixContext.future.v3_relativeSplatPath,v7_skipActionErrorRevalidation:window.__remixContext.future.unstable_singleFetch===!0},hydrationData:o,mapRouteProperties:Qr,unstable_dataStrategy:window.__remixContext.future.unstable_singleFetch?os(window.__remixManifest,window.__remixRouteModules,()=>Q):void 0,unstable_patchRoutesOnNavigation:as(window.__remixManifest,window.__remixRouteModules,window.__remixContext.future,window.__remixContext.isSpaMode,window.__remixContext.basename)}),Q.state.initialized&&(_t=!0,Q.initialize()),Q.createRoutesForHMR=ts,window.__remixRouter=Q,kt&&kt(Q)}let[t,n]=V.useState(void 0),[r,s]=V.useState(Q.state.location);return V.useLayoutEffect(()=>{_t||(_t=!0,Q.initialize())},[]),V.useLayoutEffect(()=>Q.subscribe(i=>{i.location!==r&&s(i.location)}),[r]),cs(Q,window.__remixManifest,window.__remixRouteModules,window.__remixContext.future,window.__remixContext.isSpaMode),V.createElement(V.Fragment,null,V.createElement(ls.Provider,{value:{manifest:window.__remixManifest,routeModules:window.__remixRouteModules,future:window.__remixContext.future,criticalCss:t,isSpaMode:window.__remixContext.isSpaMode}},V.createElement(us,{location:r},V.createElement(es,{router:Q,fallbackElement:null,future:{v7_startTransition:!0}}))),window.__remixContext.future.unstable_singleFetch?V.createElement(V.Fragment,null):null)}function Jt(){return typeof window<"u"&&(!wr()||ps())}function ps(){return Et.process!==void 0&&Et.process.type==="renderer"}function ms(e,t){return e??t()}function gs(e,t){const n=t&&Ss(t)?t.getClient():t,r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return _s(e,r)||ys(e,s)}function ys(e,t){return t?Qt(e)===Qt(t):!1}function _s(e,t){return t?e.includes(t.host):!1}function Qt(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Ss(e){return e.getClient!==void 0}const L=Et,Dt="sentryReplaySession",ws="replay_event",Nt="Unable to send Replay",vs=3e5,Es=9e5,bs=5e3,ks=5500,Rs=6e4,Is=5e3,Ms=3,Zt=15e4,qe=5e3,Cs=3e3,xs=300,Lt=2e7,Ts=4999,As=15e3,en=36e5;function Os(e,t){return e??t()}function Ye(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}var q;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(q||(q={}));function Ds(e){return e.nodeType===e.ELEMENT_NODE}function Ne(e){const t=Ye([e,"optionalAccess",n=>n.host]);return Ye([t,"optionalAccess",n=>n.shadowRoot])===e}function Le(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ns(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function Ls(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Ge(e){try{const t=e.rules||e.cssRules;return t?Ns(Array.from(t,xn).join("")):null}catch{return null}}function xn(e){let t;if(Bs(e))try{t=Ge(e.styleSheet)||Ls(e)}catch{}else if(Fs(e)&&e.selectorText.includes(":"))return Ps(e.cssText);return t||e.cssText}function Ps(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Bs(e){return"styleSheet"in e}function Fs(e){return"selectorText"in e}class Tn{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){if(!t)return-1;const n=Ye([this,"access",r=>r.getMeta,"call",r=>r(t),"optionalAccess",r=>r.id]);return Os(n,()=>-1)}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Hs(){return new Tn}function it({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function Be({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function xe(e){return e.toLowerCase()}function Rt(e){return e.toUpperCase()}const tn="__rrweb_original__";function zs(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=tn in i?i[tn]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Pt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?xe(t):null}function Xe(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}let Us=1;const Ws=new RegExp("[^a-z0-9-_:]"),Fe=-2;function Bt(){return Us++}function $s(e){if(e instanceof HTMLFormElement)return"form";const t=xe(e.tagName);return Ws.test(t)?"div":t}function js(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Ee,nn;const qs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ks=/^(?:[a-z+]+:)?\/\//i,Vs=/^www\..*/i,Ys=/^(data:)([^,]*),(.*)/i;function Je(e,t){return(e||"").replace(qs,(n,r,s,i,o,c)=>{const a=s||o||c,l=r||i||"";if(!a)return n;if(Ks.test(a)||Vs.test(a))return`url(${l}${a}${l})`;if(Ys.test(a))return`url(${l}${a}${l})`;if(a[0]==="/")return`url(${l}${js(t)+a}${l})`;const d=t.split("/"),u=a.split("/");d.pop();for(const f of u)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${l}${d.join("/")}${l})`})}const Gs=/^[^ \t\n\r\u000c]+/,Xs=/^[, \t\n\r\u000c]+/;function Js(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(Xs),!(n>=t.length);){let i=r(Gs);if(i.slice(-1)===",")i=ke(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=ke(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}function ke(e,t){if(!t||t.trim()==="")return t;const n=e.createElement("a");return n.href=t,n.href}function Qs(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ft(){const e=document.createElement("a");return e.href="",e.href}function An(e,t,n,r,s,i){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?ke(e,r):n==="srcset"?Js(e,r):n==="style"?Je(r,Ft()):t==="object"&&n==="data"?ke(e,r):typeof i=="function"?i(n,r,s):r)}function On(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function Zs(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function ei(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Se(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Se(e.parentNode,t,n,r+1)}function Re(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(ei(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Te(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const l=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(l))return!0}let c=-1,a=-1;if(i){if(a=Se(o,Re(r,s)),a<0)return!0;c=Se(o,Re(t,n),a>=0?a:1/0)}else{if(c=Se(o,Re(t,n)),c<0)return!1;a=Se(o,Re(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function ti(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=setTimeout(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{clearTimeout(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ni(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=setTimeout(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),r=!0,t()})}function ri(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:p={},maskTextFn:m,maskInputFn:S,dataURLOptions:y={},inlineImages:v,recordCanvas:A,keepIframeSrcFn:M,newlyAddedElement:B=!1}=t,w=si(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:q.Document,childNodes:[],compatMode:e.compatMode}:{type:q.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:q.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return oi(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:h,maskAttributeFn:a,maskInputOptions:p,maskInputFn:S,dataURLOptions:y,inlineImages:v,recordCanvas:A,keepIframeSrcFn:M,newlyAddedElement:B,rootId:w,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:f});case e.TEXT_NODE:return ii(e,{maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:p,maskInputFn:S,rootId:w});case e.CDATA_SECTION_NODE:return{type:q.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:q.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function si(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function ii(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:l,rootId:d}=t,u=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const h=u==="STYLE"?!0:void 0,p=u==="SCRIPT"?!0:void 0,m=u==="TEXTAREA"?!0:void 0;if(h&&f){try{e.nextSibling||e.previousSibling||Ye([e,"access",y=>y.parentNode,"access",y=>y.sheet,"optionalAccess",y=>y.cssRules])&&(f=Ge(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}f=Je(f,Ft())}p&&(f="SCRIPT_PLACEHOLDER");const S=Te(e,r,i,s,o,n);if(!h&&!p&&!m&&f&&S&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||S)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,"*")),u==="OPTION"&&f){const y=it({type:null,tagName:u,maskInputOptions:a});f=Be({isMasked:Te(e,r,i,s,o,y),element:e,value:f,maskInputFn:l})}return{type:q.Text,textContent:f||"",isStyle:h,rootId:d}}function oi(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:l,dataURLOptions:d={},inlineImages:u,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:m,maskAllText:S,maskTextClass:y,unmaskTextClass:v,maskTextSelector:A,unmaskTextSelector:M}=t,B=Zs(e,r,s,i),w=$s(e);let g={};const R=e.attributes.length;for(let _=0;_<R;_++){const E=e.attributes[_];E.name&&!On(w,E.name,E.value)&&(g[E.name]=An(n,w,xe(E.name),E.value,e,a))}if(w==="link"&&o){const _=Array.from(n.styleSheets).find(P=>P.href===e.href);let E=null;_&&(E=Ge(_)),E&&(delete g.rel,delete g.href,g._cssText=Je(E,_.href))}if(w==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const _=Ge(e.sheet);_&&(g._cssText=Je(_,Ft()))}if(w==="input"||w==="textarea"||w==="select"||w==="option"){const _=e,E=Pt(_),P=Xe(_,Rt(w),E),$=_.checked;if(E!=="submit"&&E!=="button"&&P){const j=Te(_,y,A,v,M,it({type:E,tagName:Rt(w),maskInputOptions:c}));g.value=Be({isMasked:j,element:_,value:P,maskInputFn:l})}$&&(g.checked=$)}if(w==="option"&&(e.selected&&!c.select?g.selected=!0:delete g.selected),w==="canvas"&&f){if(e.__context==="2d")zs(e)||(g.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const _=e.toDataURL(d.type,d.quality),E=document.createElement("canvas");E.width=e.width,E.height=e.height;const P=E.toDataURL(d.type,d.quality);_!==P&&(g.rr_dataURL=_)}}if(w==="img"&&u){Ee||(Ee=n.createElement("canvas"),nn=Ee.getContext("2d"));const _=e,E=_.crossOrigin;_.crossOrigin="anonymous";const P=()=>{_.removeEventListener("load",P);try{Ee.width=_.naturalWidth,Ee.height=_.naturalHeight,nn.drawImage(_,0,0),g.rr_dataURL=Ee.toDataURL(d.type,d.quality)}catch($){console.warn(`Cannot inline img src=${_.currentSrc}! Error: ${$}`)}E?g.crossOrigin=E:_.removeAttribute("crossorigin")};_.complete&&_.naturalWidth!==0?P():_.addEventListener("load",P)}if((w==="audio"||w==="video")&&(g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime),p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),B){const{width:_,height:E}=e.getBoundingClientRect();g={class:g.class,rr_width:`${_}px`,rr_height:`${E}px`}}w==="iframe"&&!h(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let U;try{customElements.get(w)&&(U=!0)}catch{}return{type:q.Element,tagName:w,attributes:g,childNodes:[],isSVG:Qs(e)||void 0,needBlock:B,rootId:m,isCustom:U}}function N(e){return e==null?"":e.toLowerCase()}function ai(e,t){if(t.comment&&e.type===q.Comment)return!0;if(e.type===q.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||N(e.attributes.name)==="application-name"||N(e.attributes.rel)==="icon"||N(e.attributes.rel)==="apple-touch-icon"||N(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||N(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(N(e.attributes.name)==="robots"||N(e.attributes.name)==="googlebot"||N(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(N(e.attributes.name)==="author"||N(e.attributes.name)==="generator"||N(e.attributes.name)==="framework"||N(e.attributes.name)==="publisher"||N(e.attributes.name)==="progid"||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(N(e.attributes.name)==="google-site-verification"||N(e.attributes.name)==="yandex-verification"||N(e.attributes.name)==="csrf-token"||N(e.attributes.name)==="p:domain_verify"||N(e.attributes.name)==="verify-v1"||N(e.attributes.name)==="verification"||N(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ie(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:f=!1,inlineStylesheet:h=!0,maskInputOptions:p={},maskAttributeFn:m,maskTextFn:S,maskInputFn:y,slimDOMOptions:v,dataURLOptions:A={},inlineImages:M=!1,recordCanvas:B=!1,onSerialize:w,onIframeLoad:g,iframeLoadTimeout:R=5e3,onStylesheetLoad:U,stylesheetLoadTimeout:_=5e3,keepIframeSrcFn:E=()=>!1,newlyAddedElement:P=!1}=t;let{preserveWhiteSpace:$=!0}=t;const j=ri(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:S,maskInputFn:y,dataURLOptions:A,inlineImages:M,recordCanvas:B,keepIframeSrcFn:E,newlyAddedElement:P});if(!j)return console.warn(e,"not serialized"),null;let J;r.hasNode(e)?J=r.getId(e):ai(j,v)||!$&&j.type===q.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?J=Fe:J=Bt();const O=Object.assign(j,{id:J});if(r.add(e,O),J===Fe)return null;w&&w(e);let Z=!f;if(O.type===q.Element){Z=Z&&!O.needBlock,delete O.needBlock;const W=e.shadowRoot;W&&Le(W)&&(O.isShadowHost=!0)}if((O.type===q.Document||O.type===q.Element)&&Z){v.headWhitespace&&O.type===q.Element&&O.tagName==="head"&&($=!1);const W={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:f,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:S,maskInputFn:y,slimDOMOptions:v,dataURLOptions:A,inlineImages:M,recordCanvas:B,preserveWhiteSpace:$,onSerialize:w,onIframeLoad:g,iframeLoadTimeout:R,onStylesheetLoad:U,stylesheetLoadTimeout:_,keepIframeSrcFn:E};for(const X of Array.from(e.childNodes)){const ee=Ie(X,W);ee&&O.childNodes.push(ee)}if(Ds(e)&&e.shadowRoot)for(const X of Array.from(e.shadowRoot.childNodes)){const ee=Ie(X,W);ee&&(Le(e.shadowRoot)&&(ee.isShadow=!0),O.childNodes.push(ee))}}return e.parentNode&&Ne(e.parentNode)&&Le(e.parentNode)&&(O.isShadow=!0),O.type===q.Element&&O.tagName==="iframe"&&ti(e,()=>{const W=e.contentDocument;if(W&&g){const X=Ie(W,{doc:W,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:S,maskInputFn:y,slimDOMOptions:v,dataURLOptions:A,inlineImages:M,recordCanvas:B,preserveWhiteSpace:$,onSerialize:w,onIframeLoad:g,iframeLoadTimeout:R,onStylesheetLoad:U,stylesheetLoadTimeout:_,keepIframeSrcFn:E});X&&g(e,X)}},R),O.type===q.Element&&O.tagName==="link"&&O.attributes.rel==="stylesheet"&&ni(e,()=>{if(U){const W=Ie(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:p,maskAttributeFn:m,maskTextFn:S,maskInputFn:y,slimDOMOptions:v,dataURLOptions:A,inlineImages:M,recordCanvas:B,preserveWhiteSpace:$,onSerialize:w,onIframeLoad:g,iframeLoadTimeout:R,onStylesheetLoad:U,stylesheetLoadTimeout:_,keepIframeSrcFn:E});W&&U(e,W)}},_),O}function ci(e,t){const{mirror:n=new Tn,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:l=null,unmaskTextSelector:d=null,inlineStylesheet:u=!0,inlineImages:f=!1,recordCanvas:h=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:S,maskInputFn:y,slimDOM:v=!1,dataURLOptions:A,preserveWhiteSpace:M,onSerialize:B,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:R,stylesheetLoadTimeout:U,keepIframeSrcFn:_=()=>!1}=t||{};return Ie(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:u,maskInputOptions: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}:p===!1?{}:p,maskAttributeFn:m,maskTextFn:S,maskInputFn:y,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:A,inlineImages:f,recordCanvas:h,preserveWhiteSpace:M,onSerialize:B,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:R,stylesheetLoadTimeout:U,keepIframeSrcFn:_,newlyAddedElement:!1})}function ue(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}function G(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const be=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let rn={map:{},getId(){return console.error(be),-1},getNode(){return console.error(be),null},removeNodeFromMap(){console.error(be)},has(){return console.error(be),!1},reset(){console.error(be)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(rn=new Proxy(rn,{get(e,t,n){return t==="map"&&console.error(be),Reflect.get(e,t,n)}}));function He(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(mi(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=ot(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function Dn(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){ot(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Dn(e,t,i||{},!0)}function Ht(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let Qe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qe=()=>new Date().getTime());function Nn(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:ue([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||ue([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||ue([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:ue([t,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||ue([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||ue([t,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function Ln(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Pn(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Bn(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function re(e,t,n,r,s){if(!e)return!1;const i=Bn(e);if(!i)return!1;const o=Re(t,n);if(!s){const l=r&&i.matches(r);return o(i)&&!l}const c=Se(i,o);let a=-1;return c<0?!1:(r&&(a=Se(i,Re(null,r))),c>-1&&a<0?!0:c<a)}function li(e,t){return t.getId(e)!==-1}function St(e,t){return t.getId(e)===Fe}function Fn(e,t){if(Ne(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Fn(e.parentNode,t):!0:!0}function It(e){return!!e.changedTouches}function ui(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Hn(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function zn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Mt(e){return!!ue([e,"optionalAccess",t=>t.shadowRoot])}class di{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return ms(this.styleIDMap.get(t),()=>-1)}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}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 Un(e){let t=null;return ue([e,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function fi(e){let t=e,n;for(;n=Un(t);)t=n;return t}function hi(e){const t=e.ownerDocument;if(!t)return!1;const n=fi(e);return t.contains(n)}function Wn(e){const t=e.ownerDocument;return t?t.contains(e)||hi(e):!1}const sn={};function zt(e){const t=sn[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return sn[e]=r.bind(window)}function pi(...e){return zt("requestAnimationFrame")(...e)}function ot(...e){return zt("setTimeout")(...e)}function mi(...e){return zt("clearTimeout")(...e)}var b=(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))(b||{}),k=(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))(k||{}),K=(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))(K||{}),oe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(oe||{});function gi(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}function on(e){return"__ln"in e}class yi{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=gi([n,"optionalAccess",s=>s.next])||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&on(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&on(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const an=(e,t)=>`${e}@${t}`;class _i{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new yi,s=a=>{let l=a,d=Fe;for(;d===Fe;)l=l&&l.nextSibling,d=l&&this.mirror.getId(l);return d},i=a=>{if(!a.parentNode||!Wn(a))return;const l=Ne(a.parentNode)?this.mirror.getId(Un(a)):this.mirror.getId(a.parentNode),d=s(a);if(l===-1||d===-1)return r.addNode(a);const u=Ie(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Hn(f,this.mirror)&&this.iframeManager.addIframe(f),zn(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Mt(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,h)=>{this.iframeManager.attachIframe(f,h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,h)=>{this.stylesheetManager.attachLinkElement(f,h)}});u&&(t.push({parentId:l,nextId:d,node:u}),n.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)cn(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!ln(this.droppedSet,a)&&!cn(this.removes,a,this.mirror)||ln(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const l=this.mirror.getId(o.value.parentNode),d=s(o.value);l!==-1&&d!==-1&&(a=o)}if(!a){let l=r.tail;for(;l;){const d=l;if(l=l.previous,d){const u=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(u!==-1){a=d;break}else{const h=d.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=h.parentNode.host;if(this.mirror.getId(p)!==-1){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:l}=a;if(typeof l.style=="string"){const d=JSON.stringify(a.styleDiff),u=JSON.stringify(a._unchangedStyles);d.length<l.style.length&&(d+u).split("var(").length===l.style.split("var(").length&&(l.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:l}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!St(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!re(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Te(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Bn(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=Pt(n),c=n.tagName;s=Xe(n,c,o);const a=it({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),l=Te(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Be({isMasked:l,element:n,value:s,maskInputFn:this.maskInputFn})}if(re(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!On(n.tagName,r)&&(i.attributes[r]=An(this.doc,xe(n.tagName),xe(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),l=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||l!==o.style.getPropertyPriority(c)?l===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,l]:i._unchangedStyles[c]=[a,l]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(re(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=Ne(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);re(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||St(n,this.mirror)||!li(n,this.mirror)||(this.addedSet.has(n)?(Ct(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Fn(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[an(r,s)]?Ct(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Ne(t.target)&&Le(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(St(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[an(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);re(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach(r=>this.genAdds(r)),Mt(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ct(e,t){e.delete(t),t.childNodes.forEach(n=>Ct(e,n))}function cn(e,t,n){return e.length===0?!1:$n(e,t,n)}function $n(e,t,n){const{parentNode:r}=t;if(!r)return!1;const s=n.getId(r);return e.some(i=>i.id===s)?!0:$n(e,r,n)}function ln(e,t){return e.size===0?!1:jn(e,t)}function jn(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:jn(e,n):!1}let Pe;function Si(e){Pe=e}function wi(){Pe=void 0}const I=e=>Pe?(...n)=>{try{return e(...n)}catch(r){if(Pe&&Pe(r)===!0)return()=>{};throw r}}:e;function se(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}const Me=[];function Ue(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function qn(e,t){const n=new _i;Me.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=se([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);s&&window[s]&&(r=window[s]);const i=new r(I(o=>{e.onMutation&&e.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function vi({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=He(I(u=>{const f=Date.now()-c;e(o.map(h=>(h.timeOffset-=f,h)),u),o=[],c=null}),i),l=I(He(I(u=>{const f=Ue(u),{clientX:h,clientY:p}=It(u)?u.changedTouches[0]:u;c||(c=Qe()),o.push({x:h,y:p,id:r.getId(f),timeOffset:Qe()-c}),a(typeof DragEvent<"u"&&u instanceof DragEvent?k.Drag:u instanceof MouseEvent?k.MouseMove:k.TouchMove)}),s,{trailing:!1})),d=[G("mousemove",l,n),G("touchmove",l,n),G("drag",l,n)];return I(()=>{d.forEach(u=>u())})}function Ei({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const d=u=>f=>{const h=Ue(f);if(re(h,r,s,i,!0))return;let p=null,m=u;if("pointerType"in f){switch(f.pointerType){case"mouse":p=oe.Mouse;break;case"touch":p=oe.Touch;break;case"pen":p=oe.Pen;break}p===oe.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):oe.Pen}else It(f)&&(p=oe.Touch);p!==null?(l=p,(m.startsWith("Touch")&&p===oe.Touch||m.startsWith("Mouse")&&p===oe.Mouse)&&(p=null)):K[u]===K.Click&&(p=l,l=null);const S=It(f)?f.changedTouches[0]:f;if(!S)return;const y=n.getId(h),{clientX:v,clientY:A}=S;I(e)({type:K[m],id:y,x:v,y:A,...p!==null&&{pointerType:p}})};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&c[u]!==!1).forEach(u=>{let f=xe(u);const h=d(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:f=f.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}a.push(G(f,h,t))}),I(()=>{a.forEach(u=>u())})}function Kn({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=I(He(I(a=>{const l=Ue(a);if(!l||re(l,r,s,i,!0))return;const d=n.getId(l);if(l===t&&t.defaultView){const u=Nn(t.defaultView);e({id:d,x:u.left,y:u.top})}else e({id:d,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return G("scroll",c,t)}function bi({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=I(He(I(()=>{const i=Ln(),o=Pn();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return G("resize",s,t)}const ki=["INPUT","TEXTAREA","SELECT"],un=new WeakMap;function Ri({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:l,sampling:d,userTriggeredOnInput:u,maskTextClass:f,unmaskTextClass:h,maskTextSelector:p,unmaskTextSelector:m}){function S(g){let R=Ue(g);const U=g.isTrusted,_=R&&Rt(R.tagName);if(_==="OPTION"&&(R=R.parentElement),!R||!_||ki.indexOf(_)<0||re(R,r,s,i,!0))return;const E=R;if(E.classList.contains(o)||c&&E.matches(c))return;const P=Pt(R);let $=Xe(E,_,P),j=!1;const J=it({maskInputOptions:a,tagName:_,type:P}),O=Te(R,f,p,h,m,J);(P==="radio"||P==="checkbox")&&(j=R.checked),$=Be({isMasked:O,element:R,value:$,maskInputFn:l}),y(R,u?{text:$,isChecked:j,userTriggered:U}:{text:$,isChecked:j});const Z=R.name;P==="radio"&&Z&&j&&t.querySelectorAll(`input[type="radio"][name="${Z}"]`).forEach(W=>{if(W!==R){const X=Be({isMasked:O,element:W,value:Xe(W,_,P),maskInputFn:l});y(W,u?{text:X,isChecked:!j,userTriggered:!1}:{text:X,isChecked:!j})}})}function y(g,R){const U=un.get(g);if(!U||U.text!==R.text||U.isChecked!==R.isChecked){un.set(g,R);const _=n.getId(g);I(e)({...R,id:_})}}const A=(d.input==="last"?["change"]:["input","change"]).map(g=>G(g,I(S),t)),M=t.defaultView;if(!M)return()=>{A.forEach(g=>g())};const B=M.Object.getOwnPropertyDescriptor(M.HTMLInputElement.prototype,"value"),w=[[M.HTMLInputElement.prototype,"value"],[M.HTMLInputElement.prototype,"checked"],[M.HTMLSelectElement.prototype,"value"],[M.HTMLTextAreaElement.prototype,"value"],[M.HTMLSelectElement.prototype,"selectedIndex"],[M.HTMLOptionElement.prototype,"selected"]];return B&&B.set&&A.push(...w.map(g=>Dn(g[0],g[1],{set(){I(S)({target:this,isTrusted:!1})}},!1,M))),I(()=>{A.forEach(g=>g())})}function Ze(e){const t=[];function n(r,s){if(Ke("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function de(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Ii({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:I((d,u,f)=>{const[h,p]=f,{id:m,styleId:S}=de(u,t,n.styleMirror);return(m&&m!==-1||S&&S!==-1)&&e({id:m,styleId:S,adds:[{rule:h,index:p}]}),d.apply(u,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:I((d,u,f)=>{const[h]=f,{id:p,styleId:m}=de(u,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,removes:[{index:h}]}),d.apply(u,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((d,u,f)=>{const[h]=f,{id:p,styleId:m}=de(u,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,replace:h}),d.apply(u,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:I((d,u,f)=>{const[h]=f,{id:p,styleId:m}=de(u,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,replaceSync:h}),d.apply(u,f)})}));const a={};Ve("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Ve("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Ve("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Ve("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(a).forEach(([d,u])=>{l[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(l[d].insertRule,{apply:I((f,h,p)=>{const[m,S]=p,{id:y,styleId:v}=de(h.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||v&&v!==-1)&&e({id:y,styleId:v,adds:[{rule:m,index:[...Ze(h),S||0]}]}),f.apply(h,p)})}),u.prototype.deleteRule=new Proxy(l[d].deleteRule,{apply:I((f,h,p)=>{const[m]=p,{id:S,styleId:y}=de(h.parentStyleSheet,t,n.styleMirror);return(S&&S!==-1||y&&y!==-1)&&e({id:S,styleId:y,removes:[{index:[...Ze(h),m]}]}),f.apply(h,p)})})}),I(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,u])=>{u.prototype.insertRule=l[d].insertRule,u.prototype.deleteRule=l[d].deleteRule})})}function Vn({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?se([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):se([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),i=se([s,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(se([s,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return se([i,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const c=se([i,"access",a=>a.set,"optionalAccess",a=>a.call,"call",a=>a(this,o)]);if(r!==null&&r!==-1)try{t.adoptStyleSheets(o,r)}catch{}return c}}),I(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Mi({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:I((c,a,l)=>{const[d,u,f]=l;if(n.has(d))return i.apply(a,[d,u,f]);const{id:h,styleId:p}=de(se([a,"access",m=>m.parentRule,"optionalAccess",m=>m.parentStyleSheet]),t,r.styleMirror);return(h&&h!==-1||p&&p!==-1)&&e({id:h,styleId:p,set:{property:d,value:u,priority:f},index:Ze(a.parentRule)}),c.apply(a,l)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((c,a,l)=>{const[d]=l;if(n.has(d))return o.apply(a,[d]);const{id:u,styleId:f}=de(se([a,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),t,r.styleMirror);return(u&&u!==-1||f&&f!==-1)&&e({id:u,styleId:f,remove:{property:d},index:Ze(a.parentRule)}),c.apply(a,l)})}),I(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Ci({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=I(l=>He(I(d=>{const u=Ue(d);if(!u||re(u,t,n,r,!0))return;const{currentTime:f,volume:h,muted:p,playbackRate:m}=u;e({type:l,id:s.getId(u),currentTime:f,volume:h,muted:p,playbackRate:m})}),i.media||500)),a=[G("play",c(0),o),G("pause",c(1),o),G("seeked",c(2),o),G("volumechange",c(3),o),G("ratechange",c(4),o)];return I(()=>{a.forEach(l=>l())})}function xi({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,l,d){const u=new i(a,l,d);return s.set(u,{family:a,buffer:typeof l!="string",descriptors:d,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};const o=Ht(t.fonts,"add",function(c){return function(a){return ot(I(()=>{const l=s.get(a);l&&(e(l),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),I(()=>{r.forEach(c=>c())})}function Ti(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=I(()=>{const l=t.getSelection();if(!l||c&&se([l,"optionalAccess",f=>f.isCollapsed]))return;c=l.isCollapsed||!1;const d=[],u=l.rangeCount||0;for(let f=0;f<u;f++){const h=l.getRangeAt(f),{startContainer:p,startOffset:m,endContainer:S,endOffset:y}=h;re(p,r,s,i,!0)||re(S,r,s,i,!0)||d.push({start:n.getId(p),startOffset:m,end:n.getId(S),endOffset:y})}o({ranges:d})});return a(),G("selectionchange",a)}function Ai({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Ht(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function Oi(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};const r=qn(e,e.doc),s=vi(e),i=Ei(e),o=Kn(e),c=bi(e,{win:n}),a=Ri(e),l=Ci(e),d=Ii(e,{win:n}),u=Vn(e,e.doc),f=Mi(e,{win:n}),h=e.collectFonts?xi(e):()=>{},p=Ti(e),m=Ai(e),S=[];for(const y of e.plugins)S.push(y.observer(y.callback,n,y.options));return I(()=>{Me.forEach(y=>y.reset()),r.disconnect(),s(),i(),o(),c(),a(),l(),d(),u(),f(),h(),p(),m(),S.forEach(y=>y())})}function Ke(e){return typeof window[e]<"u"}function Ve(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class xt{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}function dn(e){let t,n=e[0],r=1;for(;r<e.length;){const s=e[r],i=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(t,...o)),t=void 0)}return n}class Di{constructor(){this.crossOriginIframeMirror=new xt(Bt),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Ni{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new xt(Bt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new xt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),dn([this,"access",r=>r.loadListener,"optionalCall",r=>r(t)]),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case b.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:b.IncrementalSnapshot,data:{source:k.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case b.Meta:case b.Load:case b.DomContentLoaded:return!1;case b.Plugin:return n;case b.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case b.IncrementalSnapshot:switch(n.data.source){case k.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(r.node,s)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case k.Drag:case k.TouchMove:case k.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case k.ViewportResize:return!1;case k.MediaInteraction:case k.MouseInteraction:case k.Scroll:case k.CanvasMutation:case k.Input:return this.replaceIds(n.data,t,["id"]),n;case k.StyleSheetRule:case k.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case k.Font:return n;case k.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case k.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),dn([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(s=>{this.replaceStyleIds(s,t,["styleId"])})]),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==q.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Li{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Pi{constructor(t){this.shadowDoms=new WeakSet,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,n){if(!Le(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=qn({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Kn({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),ot(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Vn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Ht(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Wn(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class fn{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class Bi{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new di,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:xn(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fi{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){pi(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let z,et;const ne=Hs();function pe(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:l=!1,maskTextClass:d="rr-mask",unmaskTextClass:u=null,maskTextSelector:f=null,unmaskTextSelector:h=null,inlineStylesheet:p=!0,maskAllInputs:m,maskInputOptions:S,slimDOMOptions:y,maskAttributeFn:v,maskInputFn:A,maskTextFn:M,maxCanvasSize:B=null,packFn:w,sampling:g={},dataURLOptions:R={},mousemoveWait:U,recordCanvas:_=!1,recordCrossOriginIframes:E=!1,recordAfter:P=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:$=!1,collectFonts:j=!1,inlineImages:J=!1,plugins:O,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:W=new Set([]),errorHandler:X,onMutation:ee,getCanvasManager:dt}=e;Si(X);const we=E?window.parent===window:!0;let ce=!1;if(!we)try{window.parent.document&&(ce=!1)}catch{ce=!0}if(we&&!t)throw new Error("emit function is required");U!==void 0&&g.mousemove===void 0&&(g.mousemove=U),ne.reset();const ve=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:S!==void 0?S:{},Oe=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};ui();let ft,ht=0;const Vt=x=>{for(const te of O||[])te.eventProcessor&&(x=te.eventProcessor(x));return w&&!ce&&(x=w(x)),x};z=(x,te)=>{const C=x;if(C.timestamp=Qe(),yt([Me,"access",H=>H[0],"optionalAccess",H=>H.isFrozen,"call",H=>H()])&&C.type!==b.FullSnapshot&&!(C.type===b.IncrementalSnapshot&&C.data.source===k.Mutation)&&Me.forEach(H=>H.unfreeze()),we)yt([t,"optionalCall",H=>H(Vt(C),te)]);else if(ce){const H={type:"rrweb",event:Vt(C),origin:window.location.origin,isCheckout:te};window.parent.postMessage(H,"*")}if(C.type===b.FullSnapshot)ft=C,ht=0;else if(C.type===b.IncrementalSnapshot){if(C.data.source===k.Mutation&&C.data.isAttachIframe)return;ht++;const H=r&&ht>=r,T=n&&ft&&C.timestamp-ft.timestamp>n;(H||T)&&mt(!0)}};const $e=x=>{z({type:b.IncrementalSnapshot,data:{source:k.Mutation,...x}})},Yt=x=>z({type:b.IncrementalSnapshot,data:{source:k.Scroll,...x}}),yr=x=>z({type:b.IncrementalSnapshot,data:{source:k.CanvasMutation,...x}}),_r=x=>z({type:b.IncrementalSnapshot,data:{source:k.AdoptedStyleSheet,...x}}),ge=new Bi({mutationCb:$e,adoptedStyleSheetCb:_r}),ye=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Di:new Ni({mirror:ne,mutationCb:$e,stylesheetManager:ge,recordCrossOriginIframes:E,wrappedEmit:z});for(const x of O||[])x.getMirror&&x.getMirror({nodeMirror:ne,crossOriginIframeMirror:ye.crossOriginIframeMirror,crossOriginIframeStyleMirror:ye.crossOriginIframeStyleMirror});const pt=new Fi,Gt=zi(dt,{mirror:ne,win:window,mutationCb:x=>z({type:b.IncrementalSnapshot,data:{source:k.CanvasMutation,...x}}),recordCanvas:_,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:B,sampling:g.canvas,dataURLOptions:R,errorHandler:X}),je=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Li:new Pi({mutationCb:$e,scrollCb:Yt,bypassOptions:{onMutation:ee,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:ve,dataURLOptions:R,maskAttributeFn:v,maskTextFn:M,maskInputFn:A,recordCanvas:_,inlineImages:J,sampling:g,slimDOMOptions:Oe,iframeManager:ye,stylesheetManager:ge,canvasManager:Gt,keepIframeSrcFn:Z,processedNodeManager:pt},mirror:ne}),mt=(x=!1)=>{z({type:b.Meta,data:{href:window.location.href,width:Pn(),height:Ln()}},x),ge.reset(),je.init(),Me.forEach(C=>C.lock());const te=ci(document,{mirror:ne,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:h,inlineStylesheet:p,maskAllInputs:ve,maskAttributeFn:v,maskInputFn:A,maskTextFn:M,slimDOM:Oe,dataURLOptions:R,recordCanvas:_,inlineImages:J,onSerialize:C=>{Hn(C,ne)&&ye.addIframe(C),zn(C,ne)&&ge.trackLinkElement(C),Mt(C)&&je.addShadowRoot(C.shadowRoot,document)},onIframeLoad:(C,H)=>{ye.attachIframe(C,H),je.observeAttachShadow(C)},onStylesheetLoad:(C,H)=>{ge.attachLinkElement(C,H)},keepIframeSrcFn:Z});if(!te)return console.warn("Failed to snapshot the document");z({type:b.FullSnapshot,data:{node:te,initialOffset:Nn(window)}}),Me.forEach(C=>C.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ge.adoptStyleSheets(document.adoptedStyleSheets,ne.getId(document))};et=mt;try{const x=[],te=H=>I(Oi)({onMutation:ee,mutationCb:$e,mousemoveCb:(T,_e)=>z({type:b.IncrementalSnapshot,data:{source:_e,positions:T}}),mouseInteractionCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.MouseInteraction,...T}}),scrollCb:Yt,viewportResizeCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.ViewportResize,...T}}),inputCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.Input,...T}}),mediaInteractionCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.MediaInteraction,...T}}),styleSheetRuleCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.StyleSheetRule,...T}}),styleDeclarationCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.StyleDeclaration,...T}}),canvasMutationCb:yr,fontCb:T=>z({type:b.IncrementalSnapshot,data:{source:k.Font,...T}}),selectionCb:T=>{z({type:b.IncrementalSnapshot,data:{source:k.Selection,...T}})},customElementCb:T=>{z({type:b.IncrementalSnapshot,data:{source:k.CustomElement,...T}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:h,maskInputOptions:ve,inlineStylesheet:p,sampling:g,recordCanvas:_,inlineImages:J,userTriggeredOnInput:$,collectFonts:j,doc:H,maskAttributeFn:v,maskInputFn:A,maskTextFn:M,keepIframeSrcFn:Z,blockSelector:i,unblockSelector:o,slimDOMOptions:Oe,dataURLOptions:R,mirror:ne,iframeManager:ye,stylesheetManager:ge,shadowDomManager:je,processedNodeManager:pt,canvasManager:Gt,ignoreCSSAttributes:W,plugins:yt([O,"optionalAccess",T=>T.filter,"call",T=>T(_e=>_e.observer),"optionalAccess",T=>T.map,"call",T=>T(_e=>({observer:_e.observer,options:_e.options,callback:Sr=>z({type:b.Plugin,data:{plugin:_e.name,payload:Sr}})}))])||[]},{});ye.addLoadListener(H=>{try{x.push(te(H.contentDocument))}catch(T){console.warn(T)}});const C=()=>{mt(),x.push(te(document))};return document.readyState==="interactive"||document.readyState==="complete"?C():(x.push(G("DOMContentLoaded",()=>{z({type:b.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&C()})),x.push(G("load",()=>{z({type:b.Load,data:{}}),P==="load"&&C()},window))),()=>{x.forEach(H=>H()),pt.destroy(),et=void 0,wi()}}catch(x){console.warn(x)}}function Hi(e){if(!et)throw new Error("please take full snapshot after start recording");et(e)}pe.mirror=ne;pe.takeFullSnapshot=Hi;function zi(e,t){try{return e?e(t):new fn}catch{return console.warn("Unable to initialize CanvasManager"),new fn}}const Ui=3,Wi=5;function Ut(e){return e>9999999999?e:e*1e3}function wt(e){return e>9999999999?e/1e3:e}function We(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:b.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Cn(t,10,1e3)}}),t.category==="console")))}const $i="button,a";function Yn(e){return e.closest($i)||e}function Gn(e){const t=Xn(e);return!t||!(t instanceof Element)?t:Yn(t)}function Xn(e){return ji(e)?e.target:e}function ji(e){return typeof e=="object"&&!!e&&"target"in e}let fe;function qi(e){return fe||(fe=[],Ki()),fe.push(e),()=>{const t=fe?fe.indexOf(e):-1;t>-1&&fe.splice(t,1)}}function Ki(){zr(L,"open",function(e){return function(...t){if(fe)try{fe.forEach(n=>n())}catch{}return e.apply(L,t)}})}function Vi(e,t,n){e.handleClick(t,n)}class Yi{constructor(t,n,r=We){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=qi(()=>{this._lastMutation=hn()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(Xi(n,this._ignoreSelector)||!Ji(t))return;const r={timestamp:wt(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=wt(t)}registerScroll(t=Date.now()){this._lastScroll=wt(t)}registerClick(t){const n=Yn(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=hn();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,l=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:L.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:l,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:L.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const Gi=["A","BUTTON","INPUT"];function Xi(e,t){return!!(!Gi.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function Ji(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function hn(){return Date.now()/1e3}function Qi(e,t){try{if(!Zi(t))return;const{source:n}=t.data;if(n===k.Mutation&&e.registerMutation(t.timestamp),n===k.Scroll&&e.registerScroll(t.timestamp),eo(t)){const{type:r,id:s}=t.data,i=pe.mirror.getNode(s);i instanceof HTMLElement&&r===K.Click&&e.registerClick(i)}}catch{}}function Zi(e){return e.type===Ui}function eo(e){return e.data.source===k.MouseInteraction}function ie(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var tt;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(tt||(tt={}));const to=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function no(e){const t={};for(const n in e)if(to.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const ro=e=>t=>{if(!e.isEnabled())return;const n=so(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&s&&s.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&Vi(e.clickDetector,n,Gn(t.event)),We(e,n)};function Jn(e,t){const n=pe.mirror.getId(e),r=n&&pe.mirror.getNode(n),s=r&&pe.mirror.getMeta(r),i=s&&oo(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===tt.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:no(i.attributes)}}:{}}}function so(e){const{target:t,message:n}=io(e);return ie({category:`ui.${e.name}`,...Jn(t,n)})}function io(e){const t=e.name==="click";let n,r=null;try{r=t?Gn(e.event):Xn(e.event),n=Mn(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function oo(e){return e.type===tt.Element}function ao(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=co(t);n&&We(e,n)}function co(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||lo(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const l=Mn(o,{maxStringLength:200})||"<unknown>",d=Jn(o,l);return ie({category:"ui.keyDown",message:l,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function lo(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const pn={resource:mo,paint:ho,navigation:po};function uo(e){return e.map(fo).filter(Boolean)}function fo(e){return pn[e.entryType]?pn[e.entryType](e):null}function Ae(e){return((Ur||L.performance.timeOrigin)+e)/1e3}function ho(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Ae(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function po(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:l,loadEventStart:d,loadEventEnd:u,redirectCount:f,startTime:h,transferSize:p,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:Ae(h),end:Ae(i),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:l,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:u,domComplete:i,redirectCount:f}}}function mo(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:l}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ae(i),end:Ae(s),name:r,data:{size:l,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function go(e){const t=e.entries,n=t[t.length-1],r=n?n.element:void 0,s=e.value,i=Ae(s);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:i,end:i,data:{value:s,size:s,nodeId:r?pe.mirror.getId(r):void 0}}}function yo(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(Er(s,n))}),r.push(br(({metric:s})=>{e.replayPerformanceEntries.push(go(s))})),()=>{r.forEach(s=>s())}}const D=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_o='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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]),i=new t([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]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function So(){const e=new Blob([_o]);return URL.createObjectURL(e)}function Y(e,t){D&&(F.info(e),t&&Qn(e))}function Ce(e,t){D&&(F.info(e),t&&setTimeout(()=>{Qn(e)},0))}function Qn(e){Fr({category:"console",data:{logger:"replay"},level:"info",message:e},{level:"info"})}class Wt extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Lt}.`)}}class Zn{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>Lt)throw new Wt;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map(n=>n.timestamp).sort()[0];return t?Ut(t):null}}class wo{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){Y("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){D&&F.error("[Replay]",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class vo{constructor(t){this._worker=new wo(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=Ut(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Lt?Promise.reject(new Wt):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{D&&F.warn('[Replay] Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class Eo{constructor(t){this._fallback=new Zn,this._compression=new vo(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{Y("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n}=this._fallback,r=[];for(const s of t)r.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(s){D&&F.warn("[Replay] Failed to add events when switching buffers.",s)}}}function bo({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=ko(t);if(n)return n}return Y("[Replay] Using simple buffer"),new Zn}function ko(e){try{const t=e||Ro();if(!t)return;Y(`[Replay] Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Eo(n)}catch{Y("[Replay] Failed to create compression worker")}}function Ro(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?So():""}function $t(){try{return"sessionStorage"in L&&!!L.sessionStorage}catch{return!1}}function Io(e){Mo(),e.session=void 0}function Mo(){if($t())try{L.sessionStorage.removeItem(Dt)}catch{}}function er(e){return e===void 0?!1:Math.random()<e}function tr(e){const t=Date.now(),n=e.id||Wr(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c}}function jt(e){if($t())try{L.sessionStorage.setItem(Dt,JSON.stringify(e))}catch{}}function Co(e,t){return er(e)?"session":t?"buffer":!1}function mn({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=Co(e,t),i=tr({sampled:s,previousSessionId:r});return n&&jt(i),i}function xo(e){if(!$t())return null;try{const t=L.sessionStorage.getItem(Dt);if(!t)return null;const n=JSON.parse(t);return Ce("[Replay] Loading existing session",e),tr(n)}catch{return null}}function Tt(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function nr(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Tt(e.started,t,r)||Tt(e.lastActivity,n,r)}function rr(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!nr(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function vt({traceInternals:e,sessionIdleExpire:t,maxReplayDuration:n,previousSessionId:r},s){const i=s.stickySession&&xo(e);return i?rr(i,{sessionIdleExpire:t,maxReplayDuration:n})?(Ce("[Replay] Session in sessionStorage is expired, creating new one..."),mn(s,{previousSessionId:i.id})):i:(Ce("[Replay] Creating new session",e),mn(s,{previousSessionId:r}))}function To(e){return e.type===b.Custom}function qt(e,t,n){return ir(e,t)?(sr(e,t,n),!0):!1}function Ao(e,t,n){return ir(e,t)?sr(e,t,n):Promise.resolve(null)}async function sr(e,t,n){if(!e.eventBuffer)return null;try{n&&e.recordingMode==="buffer"&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);const r=e.getOptions(),s=Oo(t,r.beforeAddRecordingEvent);return s?await e.eventBuffer.addEvent(s):void 0}catch(r){const s=r&&r instanceof Wt?"addEventSizeExceeded":"addEvent";D&&F.error(r),await e.stop({reason:s});const i=ae();i&&i.recordDroppedEvent("internal_sdk_error","replay")}}function ir(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Ut(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Y(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,e.getOptions()._experiments.traceInternals),!1):!0}function Oo(e,t){try{if(typeof t=="function"&&To(e))return t(e)}catch(n){return D&&F.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return e}function Kt(e){return!e.type}function At(e){return e.type==="transaction"}function Do(e){return e.type==="replay_event"}function gn(e){return e.type==="feedback"}function or(e){const t=Po();return(n,r)=>{if(!e.isEnabled()||!Kt(n)&&!At(n))return;const s=r&&r.statusCode;if(!(t&&(!s||s<200||s>=300))){if(At(n)){No(e,n);return}Lo(e,n)}}}function No(e,t){const n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function Lo(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||setTimeout(()=>{e.sendBufferedReplayOrFlush()})}function Po(){const e=ae();if(!e)return!1;const t=e.getTransport();return t&&t.send.__sentry__baseTransport__||!1}function Bo(e){return t=>{!e.isEnabled()||!Kt(t)||Fo(e,t)}}function Fo(e,t){const n=t.exception&&t.exception.values&&t.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=ie({category:"replay.hydrate-error"});We(e,r)}}function Ho(e,t){return e.type||!e.exception||!e.exception.values||!e.exception.values.length?!1:!!(t.originalException&&t.originalException.__rrweb__)}function zo(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:b.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function Uo(e,t){return e.recordingMode!=="buffer"||t.message===Nt||!t.exception||t.type?!1:er(e.getOptions().errorSampleRate)}function Wo(e,t=!1){const n=t?or(e):void 0;return Object.assign((r,s)=>e.isEnabled()?Do(r)?(delete r.breadcrumbs,r):!Kt(r)&&!At(r)&&!gn(r)||!e.checkAndHandleExpiredSession()?r:gn(r)?(e.flush(),r.contexts.feedback.replay_id=e.getSessionId(),zo(e,r),r):Ho(r,s)&&!e.getOptions()._experiments.captureExceptions?(D&&F.log("[Replay] Ignoring error from rrweb internals",r),null):((Uo(e,r)||e.recordingMode==="session")&&(r.tags={...r.tags,replayId:e.getSessionId()}),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function at(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:b.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function $o(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function jo(e){return t=>{if(!e.isEnabled())return;const n=$o(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(at(e,[n]),!1)))}}function qo(e,t){return D&&e.getOptions()._experiments.traceInternals?!1:gs(t,ae())}function ct(e,t){e.isEnabled()&&t!==null&&(qo(e,t.name)||e.addUpdate(()=>(at(e,[t]),!0)))}function Ko(e){const{startTimestamp:t,endTimestamp:n,fetchData:r,response:s}=e;if(!n)return null;const{method:i,url:o}=r;return{type:"resource.fetch",start:t/1e3,end:n/1e3,name:o,data:{method:i,statusCode:s?s.status:void 0}}}function Vo(e){return t=>{if(!e.isEnabled())return;const n=Ko(t);ct(e,n)}}function Yo(e){const{startTimestamp:t,endTimestamp:n,xhr:r}=e,s=r[bn];if(!t||!n||!s)return null;const{method:i,url:o,status_code:c}=s;return o===void 0?null:{type:"resource.xhr",name:o,start:t/1e3,end:n/1e3,data:{method:i,statusCode:c}}}function Go(e){return t=>{if(!e.isEnabled())return;const n=Yo(t);ct(e,n)}}function lt(e,t){if(e)try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=ur(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function ar(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function cr(e){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[ur(e)];if(!e)return[void 0]}catch{return D&&F.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return D&&F.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function nt(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function lr(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:Rn({method:i,statusCode:o,request:c,response:a})}}function ze(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function me(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=Xo(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function Ot(e,t){return Object.keys(e).reduce((n,r)=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=e[r]),n},{})}function ur(e){return new URLSearchParams(e).toString()}function Xo(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Zt,n=Jo(e);if(t){const r=e.slice(0,Zt);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function Jo(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function rt(e,t){const n=Qo(e);return qr(n,t)}function Qo(e,t=L.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(L.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function Zo(e,t,n){try{const r=await ta(e,t,n),s=lr("resource.fetch",r);ct(n.replay,s)}catch(r){D&&F.error("[Replay] Failed to capture fetch breadcrumb",r)}}function ea(e,t,n){const{input:r,response:s}=t,i=r?dr(r):void 0,o=lt(i,n.textEncoder),c=s?ar(s.headers.get("content-length")):void 0;o!==void 0&&(e.data.request_body_size=o),c!==void 0&&(e.data.response_body_size=c)}async function ta(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:l,response_body_size:d}=e.data,u=rt(o,n.networkDetailAllowUrls)&&!rt(o,n.networkDetailDenyUrls),f=u?na(n,t.input,l):ze(l),h=await ra(u,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:h}}function na({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?oa(n,t):{};if(!e)return me(s,r,void 0);const i=dr(n),[o,c]=cr(i),a=me(s,r,o);return c?nt(a,c):a}async function ra(e,{networkCaptureBodies:t,textEncoder:n,networkResponseHeaders:r},s,i){if(!e&&i!==void 0)return ze(i);const o=s?fr(s.headers,r):{};if(!s||!t&&i!==void 0)return me(o,i,void 0);const[c,a]=await ia(s),l=sa(c,{networkCaptureBodies:t,textEncoder:n,responseBodySize:i,captureDetails:e,headers:o});return a?nt(l,a):l}function sa(e,{networkCaptureBodies:t,textEncoder:n,responseBodySize:r,captureDetails:s,headers:i}){try{const o=e&&e.length&&r===void 0?lt(e,n):r;return s?t?me(i,o,e):me(i,o,void 0):ze(o)}catch(o){return D&&F.warn("[Replay] Failed to serialize response body",o),me(i,r,void 0)}}async function ia(e){const t=aa(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await ca(t)]}catch(n){return D&&F.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function dr(e=[]){if(!(e.length!==2||typeof e[1]!="object"))return e[1].body}function fr(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function oa(e,t){return e.length===1&&typeof e[0]!="string"?yn(e[0],t):e.length===2?yn(e[1],t):{}}function yn(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?fr(n,t):Array.isArray(n)?{}:Ot(n,t):{}}function aa(e){try{return e.clone()}catch(t){D&&F.warn("[Replay] Failed to clone response body",t)}}function ca(e){return new Promise((t,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);la(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function la(e){return await e.text()}async function ua(e,t,n){try{const r=fa(e,t,n),s=lr("resource.xhr",r);ct(n.replay,s)}catch(r){D&&F.error("[Replay] Failed to capture xhr breadcrumb",r)}}function da(e,t,n){const{xhr:r,input:s}=t;if(!r)return;const i=lt(s,n.textEncoder),o=r.getResponseHeader("content-length")?ar(r.getResponseHeader("content-length")):ga(r.response,r.responseType,n.textEncoder);i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}function fa(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:l,status_code:d=0,request_body_size:u,response_body_size:f}=e.data;if(!a)return null;if(!c||!rt(a,n.networkDetailAllowUrls)||rt(a,n.networkDetailDenyUrls)){const w=ze(u),g=ze(f);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:d,request:w,response:g}}const h=c[bn],p=h?Ot(h.request_headers,n.networkRequestHeaders):{},m=Ot(ha(c),n.networkResponseHeaders),[S,y]=n.networkCaptureBodies?cr(o):[void 0],[v,A]=n.networkCaptureBodies?pa(c):[void 0],M=me(p,u,S),B=me(m,f,v);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:d,request:y?nt(M,y):M,response:A?nt(B,A):B}}function ha(e){const t=e.getAllResponseHeaders();return t?t.split(`\r
`).reduce((n,r)=>{const[s,i]=r.split(": ");return n[s.toLowerCase()]=i,n},{}):{}}function pa(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return ma(e.response,e.responseType)}catch(n){t.push(n)}return D&&F.warn("[Replay] Failed to get xhr response body",...t),[void 0]}function ma(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch{return D&&F.warn("[Replay] Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return D&&F.info("[Replay] Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function ga(e,t,n){try{const r=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return lt(r,n)}catch{return}}function ya(e){const t=ae();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:c}=e.getOptions(),a={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:c};t&&t.on?t.on("beforeAddBreadcrumb",(l,d)=>_a(a,l,d)):(Mr(Vo(e)),Cr(Go(e)))}catch{}}function _a(e,t,n){if(t.data)try{Sa(t)&&va(n)&&(da(t,n,e),ua(t,n,e)),wa(t)&&Ea(n)&&(ea(t,n,e),Zo(t,n,e))}catch{D&&F.warn("Error when enriching network breadcrumb")}}function Sa(e){return e.category==="xhr"}function wa(e){return e.category==="fetch"}function va(e){return e&&e.xhr}function Ea(e){return e&&e.response}let _n=null;function ba(e){return!!e.category}const ka=e=>t=>{if(!e.isEnabled())return;const n=Ra(t);n&&We(e,n)};function Ra(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();return _n===t||!t||(_n=t,!ba(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui."))?null:t.category==="console"?Ia(t):ie(t)}function Ia(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||t.length===0)return ie(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>qe?(n=!0,`${s.slice(0,qe)}…`):s;if(typeof s=="object")try{const i=Cn(s,7);return JSON.stringify(i).length>qe?(n=!0,`${JSON.stringify(i,null,2).slice(0,qe)}…`):i}catch{}return s});return ie({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Ma(e){const t=st(),n=ae();t.addScopeListener(ka(e)),kr(ro(e)),Rr(jo(e)),ya(e);const r=Wo(e,!Sn(n));n&&n.addEventProcessor?n.addEventProcessor(r):Ir(r),Sn(n)&&(n.on("beforeSendEvent",Bo(e)),n.on("afterSendEvent",or(e)),n.on("createDsc",s=>{const i=e.getSessionId();i&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(s.replay_id=i)}),n.on("startTransaction",s=>{e.lastTransaction=s}),n.on("finishTransaction",s=>{e.lastTransaction=s}),n.on("beforeSendFeedback",(s,i)=>{const o=e.getSessionId();i&&i.includeReplay&&e.isEnabled()&&o&&s.contexts&&s.contexts.feedback&&(s.contexts.feedback.replay_id=o)}))}function Sn(e){return!!(e&&e.on)}async function Ca(e){try{return Promise.all(at(e,[xa(L.performance.memory)]))}catch{return[]}}function xa(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Ta(e,t,n){let r,s,i;const o=n&&n.maxWait?Math.max(n.maxWait,t):0;function c(){return a(),r=e(),r}function a(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function l(){return s!==void 0||i!==void 0?c():r}function d(){return s&&clearTimeout(s),s=setTimeout(c,t),o&&i===void 0&&(i=setTimeout(c,o)),r}return d.cancel=a,d.flush=l,d}function Aa(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){D&&F.warn("[Replay] Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&Qi(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!qt(e,n,s))return!0;if(!s)return!1;if(Da(e,s),e.session&&e.session.previousSessionId)return!0;if(e.recordingMode==="buffer"&&e.session&&e.eventBuffer){const i=e.eventBuffer.getEarliestTimestamp();i&&(Y(`[Replay] Updating session start time to earliest event in buffer to ${new Date(i)}`,e.getOptions()._experiments.traceInternals),e.session.started=i,e.getOptions().stickySession&&jt(e.session))}return e.recordingMode==="session"&&e.flush(),!0})}}function Oa(e){const t=e.getOptions();return{type:b.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Da(e,t){!t||!e.session||e.session.segmentId!==0||qt(e,Oa(e),!1)}function Na(e,t,n,r){return Ar(Or(e,Dr(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function La({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
`;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function Pa({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit&&e.emit("preprocessEvent",r,i);const o=await $r(e.getOptions(),r,i,t,e,jr());if(!o)return null;o.platform=o.platform||"javascript";const c=e.getSdkMetadata&&e.getSdkMetadata(),{name:a,version:l}=c&&c.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:l||"0.0.0"},o}async function Ba({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=La({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:l,initialTimestamp:d}=r,u=ae(),f=st(),h=u&&u.getTransport(),p=u&&u.getDsn();if(!u||!h||!p||!i.sampled)return;const m={type:ws,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:l,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},S=await Pa({scope:f,client:u,replayId:t,event:m});if(!S){u.recordDroppedEvent("event_processor","replay",m),Y("An event processor returned `null`, will not send event.");return}delete S.sdkProcessingMetadata;const y=Na(S,o,p,u.getOptions().tunnel);let v;try{v=await h.send(y)}catch(M){const B=new Error(Nt);try{B.cause=M}catch{}throw B}if(!v)return v;if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new hr(v.statusCode);const A=xr({},v);if(Tr(A,"replay"))throw new pr(A);return v}class hr extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class pr extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function mr(e,t={count:0,interval:Is}){const{recordingData:n,options:r}=e;if(n.length)try{return await Ba(e),!0}catch(s){if(s instanceof hr||s instanceof pr)throw s;if(Hr("Replays",{_retryCount:t.count}),D&&r._experiments&&r._experiments.captureExceptions&&In(s),t.count>=Ms){const i=new Error(`${Nt} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{setTimeout(async()=>{try{await mr(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const gr="__THROTTLED",Fa="__SKIPPED";function Ha(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((l,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?Fa:gr}o=!1;const l=r.get(a)||0;return r.set(a,l+1),e(...c)}}class he{constructor({options:t,recordingOptions:n}){he.prototype.__init.call(this),he.prototype.__init2.call(this),he.prototype.__init3.call(this),he.prototype.__init4.call(this),he.prototype.__init5.call(this),he.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:vs,sessionIdleExpire:Es},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=Ta(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ha((o,c)=>Ao(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(Cs,r),timeout:r,scrollTimeout:xs,ignoreSelector:s?s.join(","):""}:void 0;i&&(this.clickDetector=new Yi(this,i))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(t),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",Ce(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");Ce("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const t=vt({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");Ce("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const t=vt({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=pe({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:Rs},emit:Aa(this),onMutation:this._onMutationHandler,...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this._handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this._handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{Y(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Io(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Y("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Y("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();Y("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&Tt(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${L.location.pathname}${L.location.hash}${L.location.search}`,n=`${L.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===gr){const s=ie({category:"replay.throttled"});this.addUpdate(()=>!qt(this,{type:Wi,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastTransaction||st().getTransaction(),r=(t&&Xt(t).data||{})[vr];if(!(!t||!r||!["route","custom"].includes(r)))return Xt(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=bo({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(t){D&&F.error("[Replay]",t),D&&this._options._experiments&&this._options._experiments.captureExceptions&&In(t)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=vt({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return rr(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{L.document.addEventListener("visibilitychange",this._handleVisibilityChange),L.addEventListener("blur",this._handleWindowBlur),L.addEventListener("focus",this._handleWindowFocus),L.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Ma(this),this._hasInitializedCoreListeners=!0)}catch(t){this._handleException(t)}this._performanceCleanupCallback=yo(this)}_removeListeners(){try{L.document.removeEventListener("visibilitychange",this._handleVisibilityChange),L.removeEventListener("blur",this._handleWindowBlur),L.removeEventListener("focus",this._handleWindowFocus),L.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this._handleException(t)}}__init(){this._handleVisibilityChange=()=>{L.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=ie({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=ie({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{ao(this,t)}}_doChangeToBackgroundTasks(t){!this.session||nr(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Y("[Replay] Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:b.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){const t=uo(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(at(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){D&&F.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await Ca(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await mr({replayId:t,recordingData:i,segmentId:s,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=ae();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){D&&F.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){Y(`[Replay] Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),i&&this._debouncedFlush();return}const c=this.eventBuffer;if(c&&this.session.segmentId===0&&!c.hasCheckout&&Y("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(a){D&&F.error(a)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&jt(this.session)}__init6(){this._onMutationHandler=t=>{const n=t.length,r=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=r&&n>r;if(n>s||i){const o=ie({category:"replay.mutations",data:{count:n,limit:i}});this._createCustomBreadcrumb(o)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function De(e,t,n,r){const s=typeof r=="string"?r.split(","):[],i=[...e,...s,...t];return typeof n<"u"&&(typeof n=="string"&&i.push(`.${n}`),bt(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),i.join(",")}function za({mask:e,unmask:t,block:n,unblock:r,ignore:s,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:a,ignoreClass:l}){const d=['base[href="/"]'],u=De(e,[".sentry-mask","[data-sentry-mask]"],c,a),f=De(t,[".sentry-unmask","[data-sentry-unmask]"]),h={maskTextSelector:u,unmaskTextSelector:f,blockSelector:De(n,[".sentry-block","[data-sentry-block]",...d],i,o),unblockSelector:De(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:De(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],l)};return i instanceof RegExp&&(h.blockClass=i),c instanceof RegExp&&(h.maskTextClass=c),h}function Ua({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const wn='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Wa=["content-length","content-type","accept"];let vn=!1;const $a=e=>new ut(e);class ut{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=bs,flushMaxDelay:n=ks,minReplayDuration:r=Ts,maxReplayDuration:s=en,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},sessionSampleRate:l,errorSampleRate:d,maskAllText:u=!0,maskAllInputs:f=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:m=1e4,slowClickTimeout:S=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:A=[],networkCaptureBodies:M=!0,networkRequestHeaders:B=[],networkResponseHeaders:w=[],mask:g=[],maskAttributes:R=["title","placeholder"],unmask:U=[],block:_=[],unblock:E=[],ignore:P=[],maskFn:$,beforeAddRecordingEvent:j,beforeErrorSampling:J,blockClass:O,blockSelector:Z,maskInputOptions:W,maskTextClass:X,maskTextSelector:ee,ignoreClass:dt}={}){this.name=ut.id;const we=za({mask:g,unmask:U,block:_,unblock:E,ignore:P,blockClass:O,blockSelector:Z,maskTextClass:X,maskTextSelector:ee,ignoreClass:dt});if(this._recordingOptions={maskAllInputs:f,maskAllText:u,maskInputOptions:{...W||{},password:!0},maskTextFn:$,maskInputFn:$,maskAttributeFn:(ce,ve,Oe)=>Ua({maskAttributes:R,maskAllText:u,privacyOptions:we,key:ce,value:ve,el:Oe}),...we,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:ce=>{try{ce.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,As),maxReplayDuration:Math.min(s,en),stickySession:i,sessionSampleRate:l,errorSampleRate:d,useCompression:o,workerUrl:c,blockAllMedia:h,maskAllInputs:f,maskAllText:u,mutationBreadcrumbLimit:p,mutationLimit:m,slowClickTimeout:S,slowClickIgnoreSelectors:y,networkDetailAllowUrls:v,networkDetailDenyUrls:A,networkCaptureBodies:M,networkRequestHeaders:En(B),networkResponseHeaders:En(w),beforeAddRecordingEvent:j,beforeErrorSampling:J,_experiments:a},typeof l=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysSessionSampleRate: ${l} })`),this._initialOptions.sessionSampleRate=l),typeof d=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysOnErrorSampleRate: ${d} })`),this._initialOptions.errorSampleRate=d),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${wn}`:wn),this._isInitialized&&Jt())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return vn}set _isInitialized(t){vn=t}setupOnce(){Jt()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(t)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const t=ja(this._initialOptions);this._replay=new he({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=ae().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}ut.__initStatic();function ja(e){const t=ae(),n=t&&t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...Rn(e)};return n?(e.sessionSampleRate==null&&e.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&bt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(bt(()=>{console.warn("SDK client is not available.")}),r)}function En(e){return[...Wa,...e.map(t=>t.toLowerCase())]}function qa(e){const t={...e};kn(t,"react"),Nr(t)}function Ka(e){e.instrumentPageLoad===void 0&&(e.instrumentPageLoad=!0),e.instrumentNavigation===void 0&&(e.instrumentNavigation=!0),Br({useEffect:e.useEffect,useLocation:e.useLocation,useMatches:e.useMatches,instrumentNavigation:e.instrumentNavigation});const t=Lr({...e,instrumentPageLoad:!1,instrumentNavigation:!1});return{...t,afterAllSetup(n){t.afterAllSetup(n),e.instrumentPageLoad&&Pr()}}}function Va(e){const t={...e,environment:e.environment||"production"};kn(t,"remix",["remix","react"]),qa(t),st().setTag("runtime","browser")}window.ENV.SENTRY_DSN&&Va({dsn:window.ENV.SENTRY_DSN,integrations:[Ka({useEffect:V.useEffect,useLocation:Zr,useMatches:ds}),$a({maskAllText:!1,blockAllMedia:!1})],release:window.ENV.SENTRY_RELEASE,tracesSampleRate:1,tracePropagationTargets:["https://app.lightski.com"],replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1});function Ya(){return V.useEffect(()=>{window.ENV.POSTHOG_PUBLIC_API_KEY&&Kr.init(window.ENV.POSTHOG_PUBLIC_API_KEY,{api_host:"/ph",ui_host:"https://us.posthog.com",person_profiles:"identified_only"})},[]),null}V.startTransition(()=>{Vr.hydrate(gt.jsxs(V.StrictMode,{children:[gt.jsx(hs,{}),gt.jsx(Ya,{})]}),document)});
//# sourceMappingURL=entry.client-Bnh0xw-M.js.map
