!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ad6c4162-7677-5db1-bb57-3c2e6b57a3c4")}catch(e){}}(); import{r as de,l as No,n as Gc,F as Vc,o as Yc,p as Kc,q as Xc,t as Jc,v as Qc,x as Zc,y as eu,z as tu,B as nu,C as ru,D as su,j as ni}from"./chunk-LFPYN7LY-B-h9qMx-.js";import{D as M,d as y,g as qe,G as ne,a as pe,b as ge,S as Te,i as Er,e as Hn,f as Ht,T as Oo,n as hs,h as Ct,j as iu,k as je,s as W,l as Hr,m as rr,o as on,p as an,t as _e,q as le,r as Y,u as ou,v as $t,w as fe,x as au,y as Mt,z as ms,A as cu,B as P,C as ri,E as re,F as xn,H as si,I as uu,J as Lo,K as Oe,L as Xt,M as sr,N as Do,O as Po,_ as ir,P as lu,Q as An,R as ct,U as Fo,V as du,W as Bo,X as Jt,Y as fu,Z as pu,$ as Uo,a0 as gs,a1 as Ho,a2 as _s,a3 as or,a4 as hu,a5 as Wt,a6 as ii,a7 as oi,a8 as mu,a9 as $o,aa as gu,ab as Wo,ac as _u,ad as zo,ae as bt,af as yu,ag as $r,ah as ys,ai as cn,aj as ai,ak as Su,al as Eu,am as bu,an as vu,ao as Tu,ap as wu,aq as Iu,ar as Ss,as as nt,at as Pe,au as $n,av as Ru,aw as Se,ax as ci,ay as ui,az as ku,aA as qo,aB as Es,aC as Cu,aD as vt,aE as xt,aF as Mu,aG as Wr,aH as Qt,c as bs,aI as jo,aJ as li,aK as xu,aL as vs,aM as Au,aN as Nu,aO as Ee,aP as Ie,aQ as Go,aR as zt,aS as Ou,aT as Tt,aU as di,aV as fi,aW as br,aX as Vo,aY as Lu,aZ as Du,a_ as Pu,a$ as Fu,b0 as Bu,b1 as Uu,b2 as Hu,b3 as qt}from"./debug-build-C_1LF_Pi.js";import{c as $u}from"./client-qMjYgb4V.js";import{g as Wu,d as zu}from"./chunk-JPUPSTYD-C_u9-dnT.js";import{a as qu}from"./index-DX8cANT_.js";import{k as ju}from"./env-CXMo9-qw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"main"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1878b9c2-1330-4ae7-8171-5b2d991ebe6e",e._sentryDebugIdIdentifier="sentry-dbid-1878b9c2-1330-4ae7-8171-5b2d991ebe6e")}catch{}})();const Nn={},pi={};function Ke(e,t){Nn[e]=Nn[e]||[],Nn[e].push(t)}function Xe(e,t){if(!pi[e]){pi[e]=!0;try{t()}catch(n){M&&y.error(`Error while instrumenting ${e}`,n)}}}function ke(e,t){const n=e&&Nn[e];if(n)for(const r of n)try{r(t)}catch(s){M&&y.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${qe(r)} Error:`,s)}}let vr=null;function Yo(e){const t="error";Ke(t,e),Xe(t,Gu)}function Gu(){vr=ne.onerror,ne.onerror=function(e,t,n,r,s){return ke("error",{column:r,error:s,line:n,msg:e,url:t}),vr?vr.apply(this,arguments):!1},ne.onerror.__SENTRY_INSTRUMENTED__=!0}let Tr=null;function Ko(e){const t="unhandledrejection";Ke(t,e),Xe(t,Vu)}function Vu(){Tr=ne.onunhandledrejection,ne.onunhandledrejection=function(e){return ke("unhandledrejection",e),Tr?Tr.apply(this,arguments):!0},ne.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let hi=!1;function Yu(){if(hi)return;function e(){const t=pe(),n=t&&ge(t);if(n){const r="internal_error";M&&y.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:Te,message:r})}}e.tag="sentry_tracingErrorCallback",hi=!0,Yo(e),Ko(e)}function mi(e){y.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Wn(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(Xu(n)){if(Er(e.description,n))return M&&mi(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Er(e.description,n.name):!0,s=n.op?e.op&&Er(e.op,n.op):!0;if(r&&s)return M&&mi(e),!0}return!1}function Ku(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function Xu(e){return typeof e=="string"||e instanceof RegExp}class Ge{constructor(t={}){this._traceId=t.traceId||Hn(),this._spanId=t.spanId||Ht()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Oo}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Je(e,t=[]){return[e,t]}function Ju(e,t){const[n,r]=e;return[n,[...r,t]]}function zr(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function Qu(e,t){return zr(e,(n,r)=>t.includes(r))}function qr(e){const t=iu(ne);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Zu(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[qr(r),i]:r.push(typeof i=="string"?qr(i):i)}for(const i of n){const[o,c]=i;if(s(` ${JSON.stringify(o)} `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(hs(c))}s(a)}}return typeof r=="string"?r:el(r)}function el(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function tl(e){return[{type:"span"},e]}function nl(e){const t=typeof e.data=="string"?qr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const rl={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function gi(e){return rl[e]}function Ts(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Xo(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Ct(r)},...s&&{trace:s}}}function sl(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function il(e,t,n,r){const s=Ts(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:Ct(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Je(i,[o])}function ol(e,t,n,r){const s=Ts(n),i=e.type&&e.type!=="replay_event"?e.type:"event";sl(e,n?.sdk);const o=Xo(e,s,r,t);return delete e.sdkProcessingMetadata,Je(o,[[{type:i},e]])}function al(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=je(e[0]),s=t?.getDsn(),i=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:Ct(s)}},{beforeSendSpan:c,ignoreSpans:a}=t?.getOptions()||{},u=a?.length?e.filter(p=>!Wn(W(p),a)):e,l=e.length-u.length;l&&t?.recordDroppedEvent("before_send","span",l);const d=c?p=>{const h=W(p),m=c(h);return m||(Hr(),h)}:W,f=[];for(const p of u){const h=d(p);h&&f.push(tl(h))}return Je(o,f)}function cl(e){if(!M)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=W(e),{spanId:s}=e.spanContext(),i=rr(e),o=ge(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:l,description:d}=W(o);u.push(`root ID: ${o.spanContext().spanId}`),l&&u.push(`root op: ${l}`),d&&u.push(`root description: ${d}`)}y.log(`${a} ${u.join(` `)}`)}function ul(e){if(!M)return;const{description:t="< unknown name >",op:n="< unknown op >"}=W(e),{spanId:r}=e.spanContext(),i=ge(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;y.log(o)}function ll(e,t,n,r=pe()){const s=r&&ge(r);s&&(M&&y.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[an]:t,[on]:n}))}function _i(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[on],i=r[an];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}const yi=1e3;class ar{constructor(t={}){this._traceId=t.traceId||Hn(),this._spanId=t.spanId||Ht(),this._startTime=t.startTimestamp||_e(),this._links=t.links,this._attributes={},this.setAttributes({[Y]:"manual",[le]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?ou:Oo}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=$t(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(fe,"custom"),this}end(t){this._endTime||(this._endTime=$t(t),ul(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[le],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:cu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Y],profile_id:this._attributes[ms],exclusive_time:this._attributes[Mt],measurements:_i(this._events),is_segment:this._isStandaloneSpan&&ge(this)===this||void 0,segment_id:this._isStandaloneSpan?ge(this).spanContext().spanId:void 0,links:au(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){M&&y.log("[Tracing] Adding an event to span:",t);const s=Si(n)?n:r||_e(),i=Si(n)?{}:n||{},o={name:t,time:$t(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=P();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===ge(this)))return;if(this._isStandaloneSpan){this._sampled?fl(al([this],t)):(M&&y.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const r=this._convertSpanToTransaction();r&&(ri(this).scope||re()).captureEvent(r)}_convertSpanToTransaction(){if(!Ei(W(this)))return;this._name||(M&&y.warn("Transaction has no name, falling back to ``."),this._name="");const{scope:t,isolationScope:n}=ri(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const i=xn(this).filter(l=>l!==this&&!dl(l)).map(l=>W(l)).filter(Ei),o=this._attributes[fe];delete this._attributes[si],i.forEach(l=>{delete l.data[si]});const c={contexts:{trace:uu(this)},spans:i.length>yi?i.sort((l,d)=>l.start_timestamp-d.start_timestamp).slice(0,yi):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:je(this)},request:r,...o&&{transaction_info:{source:o}}},a=_i(this._events);return a&&Object.keys(a).length&&(M&&y.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function Si(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ei(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function dl(e){return e instanceof ar&&e.isStandaloneSpan()}function fl(e){const t=P();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function pl(e,t,n=()=>{},r=()=>{}){let s;try{s=e()}catch(i){throw t(i),n(),i}return hl(s,t,n,r)}function hl(e,t,n,r){return Lo(e)?e.then(s=>(n(),r(s),s),s=>{throw t(s),n(),s}):(n(),r(e),e)}function ml(e,t,n){if(!Oe(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=Xt(s);if(i===void 0)return M&&y.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return M&&y.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=n_l(i)(()=>{const u=re(),l=ea(u,i),f=e.onlyIfParent&&!l?new Ge:Qo({parentSpan:l,spanArguments:r,forceTransaction:s,scope:u});return ir(u,f),pl(()=>t(f),()=>{const{status:p}=W(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:Te,message:"internal_error"})},()=>{f.end()})}))}function At(e){const t=Is();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Zo(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>sr(e.scope,o):s!==void 0?o=>ws(s,o):o=>o())(()=>{const o=re(),c=ea(o,s);return e.onlyIfParent&&!c?new Ge:Qo({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function ws(e,t){const n=Is();return n.withActiveSpan?n.withActiveSpan(e,t):sr(r=>(ir(r,e||void 0),t(r)))}function Qo({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Oe()){const o=new Ge;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...je(o)};An(o,c)}return o}const s=ct();let i;if(e&&!n)i=gl(e,r,t),Fo(e,i);else if(e){const o=je(e),{traceId:c,spanId:a}=e.spanContext(),u=rr(e);i=bi({traceId:c,parentSpanId:a,...t},r,u),An(i,o)}else{const{traceId:o,dsc:c,parentSpanId:a,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=bi({traceId:o,parentSpanId:a,...t},r,u),c&&An(i,c)}return cl(i),du(i,r,s),i}function Zo(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=$t(e.startTime),delete r.startTime,r}return n}function Is(){const e=Do();return Po(e)}function bi(e,t,n){const r=P(),s=r?.getOptions()||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),[l,d,f]=t.getScopeData().sdkProcessingMetadata[Jo]?[!1]:ml(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:Xt(u.dsc?.sample_rate)},u.sampleRand),p=new ar({...e,attributes:{[fe]:"custom",[Bo]:d!==void 0&&f?d:void 0,...a},sampled:l});return!l&&r&&(M&&y.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",p),p}function gl(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=t.getScopeData().sdkProcessingMetadata[Jo]?!1:rr(e),o=i?new ar({...n,parentSpanId:r,traceId:s,sampled:i}):new Ge({traceId:s});Fo(e,o);const c=P();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function ea(e,t){if(t)return t;if(t===null)return;const n=lu(e);if(!n)return;const r=P();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ge(n):n}function _l(e){return e!==void 0?t=>ws(e,t):t=>t()}const On={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},yl="heartbeatFailed",Sl="idleTimeout",El="finalTimeout",bl="externalFinish";function ta(e,t={}){const n=new Map;let r=!1,s,i=bl,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=On.idleTimeout,finalTimeout:u=On.finalTimeout,childSpanTimeout:l=On.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=P();if(!p||!Oe()){const g=new Ge,w={sample_rate:"0",sampled:"false",...je(g)};return An(g,w),g}const h=re(),m=pe(),_=vl(e);_.end=new Proxy(_.end,{apply(g,w,J){if(d&&d(_),w instanceof Ge)return;const[E,...R]=J,U=E||_e(),z=$t(U),L=xn(_).filter(T=>T!==_),ce=W(_);if(!L.length||!f)return N(z),Reflect.apply(g,w,[z,...R]);const K=p.getOptions().ignoreSpans,ee=L?.reduce((T,X)=>{const te=W(X);return!te.timestamp||K&&Wn(te,K)?T:T?Math.max(T,te.timestamp):te.timestamp},void 0),S=ce.start_timestamp,V=Math.min(S?S+u/1e3:1/0,Math.max(S||-1/0,Math.min(z,ee||1/0)));return N(V),Reflect.apply(g,w,[V,...R])}});function b(){s&&(clearTimeout(s),s=void 0)}function I(g){b(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=Sl,_.end(g))},a)}function $(g){s=setTimeout(()=>{!r&&o&&(i=yl,_.end(g))},l)}function D(g){b(),n.set(g,!0);const w=_e();$(w+l/1e3)}function G(g){if(n.has(g)&&n.delete(g),n.size===0){const w=_e();I(w+a/1e3)}}function N(g){r=!0,n.clear(),c.forEach(L=>L()),ir(h,m);const w=W(_),{start_timestamp:J}=w;if(!J)return;w.data[Jt]||_.setAttribute(Jt,i);const R=w.status;(!R||R==="unknown")&&_.setStatus({code:fu}),y.log(`[Tracing] Idle span "${w.op}" finished`);const U=xn(_).filter(L=>L!==_);let z=0;U.forEach(L=>{L.isRecording()&&(L.setStatus({code:Te,message:"cancelled"}),L.end(g),M&&y.log("[Tracing] Cancelling span since span ended early",JSON.stringify(L,void 0,2)));const ce=W(L),{timestamp:K=0,start_timestamp:ee=0}=ce,S=ee<=g,V=(u+a)/1e3,T=K-ee<=V;if(M){const X=JSON.stringify(L,void 0,2);S?T||y.log("[Tracing] Discarding span since it finished after idle span final timeout",X):y.log("[Tracing] Discarding span since it happened after idle span was finished",X)}(!T||!S)&&(pu(_,L),z++)}),z>0&&_.setAttribute("sentry.idle_span_discarded_spans",z)}return c.push(p.on("spanStart",g=>{if(r||g===_||W(g).timestamp||g instanceof ar&&g.isStandaloneSpan())return;xn(_).includes(g)&&D(g.spanContext().spanId)})),c.push(p.on("spanEnd",g=>{r||G(g.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",g=>{g===_&&(o=!0,I(),n.size&&$())})),t.disableAutoFinish||I(),setTimeout(()=>{r||(_.setStatus({code:Te,message:"deadline_exceeded"}),i=El,_.end())},u),_}function vl(e){const t=At(e);return ir(re(),t),M&&y.log("[Tracing] Started span is an idle span"),t}const Tl="7";function wl(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Il(e){return`${wl(e)}${e.projectId}/envelope/`}function Rl(e,t){const n={sentry_version:Tl};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function kl(e,t,n){return t||`${Il(e)}?${Rl(e,n)}`}const vi=[];function Cl(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Ml(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return Cl(r)}function xl(e,t){const n={};return t.forEach(r=>{r&&na(e,r,n)}),n}function Ti(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function na(e,t,n){if(n[t.name]){M&&y.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!vi.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),vi.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}M&&y.log(`Integration installed: ${t.name}`)}function Al(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Nl(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Ct(r)),Je(s,[Al(e)])}function jr(e,t){const n=t??Ol(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Nl(n,r._metadata,r.tunnel,e.getDsn());ra().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Ol(e){return ra().get(e)}function ra(){return Uo("clientToLogBufferMap",()=>new WeakMap)}function Ll(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Dl(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Ct(r)),Je(s,[Ll(e)])}function sa(e,t){const n=t??Pl(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Dl(n,r._metadata,r.tunnel,e.getDsn());ia().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Pl(e){return ia().get(e)}function ia(){return Uo("clientToMetricBufferMap",()=>new WeakMap)}function oa(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Rs=Symbol.for("SentryBufferFullError");function ks(e=100){const t=new Set;function n(){return t.sizer(c),()=>r(c)),c}function i(o){if(!t.size)return gs(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>oa(setTimeout(()=>u(!1),o)))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const Fl=60*1e3;function Bl(e,t=_s()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Fl:r-t}function Ul(e,t){return e[t]||e.all||0}function aa(e,t,n=_s()){return Ul(e,t)>n}function ca(e,{statusCode:t,headers:n},r=_s()){const s={...e},i=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,l]=c.split(":",5),d=parseInt(a,10),f=(isNaN(d)?60:d)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+Bl(o,r):t===429&&(s.all=r+60*1e3);return s}const ua=64;function Hl(e,t,n=ks(e.bufferSize||ua)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(zr(o,(d,f)=>{const p=gi(f);aa(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(d)}),c.length===0)return Promise.resolve({});const a=Je(o[0],c),u=d=>{if(Qu(a,["client_report"])){M&&y.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}zr(a,(f,p)=>{e.recordDroppedEvent(d,gi(p))})},l=()=>t({body:Zu(a)}).then(d=>d.statusCode===413?(M&&y.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),d):(M&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&y.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=ca(r,d),d),d=>{throw u("network_error"),M&&y.error("Encountered error running transport request:",d),d});return n.add(l).then(d=>d,d=>{if(d===Rs)return M&&y.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw d})}return{send:i,flush:s}}function $l(e,t,n){const r=[{type:"client_report"},{timestamp:or(),discarded_events:e}];return Je(t?{dsn:t}:{},[r])}function la(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Wl(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o?.[ms],exclusive_time:o?.[Mt],measurements:e.measurements,is_segment:!0}}function zl(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[ms]:e.profile_id},...e.exclusive_time&&{[Mt]:e.exclusive_time}}}},measurements:e.measurements}}const wi="Not capturing exception because it's already been captured.",Ii="Discarded session because of missing or non-string release",da=Symbol.for("SentryInternalError"),fa=Symbol.for("SentryDoNotSendEventError"),ql=5e3;function Ln(e){return{message:e,[da]:!0}}function wr(e){return{message:e,[fa]:!0}}function Ri(e){return!!e&&typeof e=="object"&&da in e}function ki(e){return!!e&&typeof e=="object"&&fa in e}function Ci(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=oa(setTimeout(()=>{s(e)},ql)))}),e.on("flush",()=>{s(e)})}class jl{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ks(t.transportOptions?.bufferSize??ua),t.dsn?this._dsn=hu(t.dsn):M&&y.warn("No DSN provided, client will not send events."),this._dsn){const r=kl(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Ci(this,"afterCaptureLog","flushLogs",Kl,jr),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Ci(this,"afterCaptureMetric","flushMetrics",Yl,sa)}captureException(t,n,r){const s=Wt();if(ii(t))return M&&y.log(wi),s;const i={event_id:s,...n};return this._process(()=>this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(t,n,r,s){const i={event_id:Wt(),...r},o=zo(t)?t:String(t),c=bt(t),a=c?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(t,n,r){const s=Wt();if(n?.originalException&&ii(n.originalException))return M&&y.log(wi),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=Mi(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),oi(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){jr(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];na(this,t,this._integrations),n||Ti(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=ol(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Ju(r,nl(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=mu}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){M&&y.warn(Ii);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){M&&y.warn(Ii);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=il(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;M&&y.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return M&&y.error("Error while sending envelope:",n),{}}return M&&y.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=xl(this,t),Ti(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",s=!1;const i=n.exception?.values;if(i){s=!0,r=!1;for(const a of i)if(a.mechanism?.handled===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(oi(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||nsetTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o?.length&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),$o(i,t,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:gu(r),...c.contexts};const a=Wo(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=re(),s=ct()){return M&&Gr(t)&&y.log(`Captured error event \`${la(t)[0]||""}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{M&&(ki(i)?y.log(i.message):Ri(i)?y.warn(i.message):y.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=pa(t),a=Gr(t),l=`before send for type \`${t.type||"error"}\``,d=typeof o>"u"?void 0:Xt(o);if(a&&typeof d=="number"&&_u()>d)return this.recordDroppedEvent("sample_rate","error"),Ho(wr(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=Mi(t.type);return this._prepareEvent(t,n,r,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),wr("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const m=Vl(this,i,p,n);return Gl(m,l)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",f),c){const b=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",b)}throw wr(`${l} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const _=p.sdkProcessingMetadata?.spanCountBeforeProcessing||0,b=p.spans?p.spans.length:0,I=_-b;I>0&&this.recordDroppedEvent("before_send","span",I)}const m=p.transaction_info;if(c&&m&&p.transaction!==t.transaction){const _="custom";p.transaction_info={...m,source:_}}return this.sendEvent(p,n),p}).then(null,p=>{throw ki(p)||Ri(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Ln(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Rs&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){M&&y.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){M&&y.log("No outcomes to send");return}if(!this._dsn){M&&y.log("No dsn provided, will not send outcomes");return}M&&y.log("Sending outcomes:",t);const n=$l(t,this._options.tunnel&&Ct(this._dsn));this.sendEnvelope(n)}}function Mi(e){return e==="replay_event"?"replay":e||"error"}function Gl(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Lo(e))return e.then(r=>{if(!$r(r)&&r!==null)throw Ln(n);return r},r=>{throw Ln(`${t} rejected with ${r}`)});if(!$r(e)&&e!==null)throw Ln(n);return e}function Vl(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o,ignoreSpans:c}=t;let a=n;if(Gr(a)&&s)return s(a,r);if(pa(a)){if(o||c){const u=Wl(a);if(c?.length&&Wn(u,c))return null;if(o){const l=o(u);l?a=yu(n,zl(l)):Hr()}if(a.spans){const l=[],d=a.spans;for(const p of d){if(c?.length&&Wn(p,c)){Ku(d,p);continue}if(o){const h=o(p);h?l.push(h):(Hr(),l.push(p))}else l.push(p)}const f=a.spans.length-l.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=l}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function Gr(e){return e.type===void 0}function pa(e){return e.type==="transaction"}function Yl(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+ha(e.attributes)}function Kl(e){let t=0;return e.message&&(t+=e.message.length*2),t+ha(e.attributes)}function ha(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*xi(n[0]):bt(n)?t+=xi(n):t+=100}),t}function xi(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Xl(e){return ys(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Ai(e){return Xl(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Jl(e,t){t.debug===!0&&(M?y.enable():cn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),re().update(t.initialScope);const r=new e(t);return Ql(r),r.init(),r}function Ql(e){re().setClient(e)}const Zl="thismessage:/";function Cs(e){return"isRelative"in e}function Ms(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Zl:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function ed(e){if(Cs(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function it(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function td(e){return e.split(/[?#]/,1)[0]}function $e(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&i!==-1){const c=e.slice(i+1);o=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}function nd(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return sd(e,n)||rd(e,r)}function rd(e,t){return t?Ni(e)===Ni(t):!1}function sd(e,t){const n=Ms(e);return!n||Cs(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function Ni(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function id(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function ma(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:ai})),s.version=ai)}function ga(e={}){const t=e.client||P();if(!Su()||!t)return{};const n=Do(),r=Po(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||re(),i=e.span||pe(),o=i?Eu(i):od(s),c=i?je(i):Wo(t,s),a=bu(c);if(!vu.test(o))return y.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const l={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(l.traceparent=i?Tu(i):ad(s)),l}function od(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return wu(t,r,n)}function ad(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Iu(t,r,n)}function cd(e,t,n){let r,s,i;const o=n?.maxWait?Math.max(n.maxWait,t):0,c=n?.setTimeoutImpl||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function l(){return s!==void 0||i!==void 0?a():r}function d(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return d.cancel=u,d.flush=l,d}const ud=100;function Ve(e,t){const n=P(),r=ct();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=ud}=n.getOptions();if(i<=0)return;const c={timestamp:or(),...e},a=s?cn(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Oi;const ld="FunctionToString",Li=new WeakMap,dd=(()=>({name:ld,setupOnce(){Oi=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ss(this),n=Li.has(P())&&t!==void 0?t:this;return Oi.apply(n,e)}}catch{}},setup(e){Li.set(e,!0)}})),fd=dd,pd=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],hd="EventFilters",md=(e={})=>{let t;return{name:hd,setup(n){const r=n.getOptions();t=Di(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Di(e,i)}return _d(n,t)?null:n}}},gd=((e={})=>({...md(e),name:"InboundFilters"}));function Di(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:pd],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function _d(e,t){if(e.type){if(e.type==="transaction"&&Sd(e,t.ignoreTransactions))return M&&y.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${nt(e)}`),!0}else{if(yd(e,t.ignoreErrors))return M&&y.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${nt(e)}`),!0;if(Td(e))return M&&y.warn(`Event dropped due to not having an error message, error type or stacktrace. Event: ${nt(e)}`),!0;if(Ed(e,t.denyUrls))return M&&y.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${nt(e)}. Url: ${zn(e)}`),!0;if(!bd(e,t.allowUrls))return M&&y.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${nt(e)}. Url: ${zn(e)}`),!0}return!1}function yd(e,t){return t?.length?la(e).some(n=>Pe(n,t)):!1}function Sd(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Pe(n,t):!1}function Ed(e,t){if(!t?.length)return!1;const n=zn(e);return n?Pe(n,t):!1}function bd(e,t){if(!t?.length)return!0;const n=zn(e);return n?Pe(n,t):!0}function vd(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function zn(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?vd(n):null}catch{return M&&y.error(`Cannot extract url for event ${nt(e)}`),null}}function Td(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function wd(e,t,n,r,s,i){if(!s.exception?.values||!i||!$n(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Vr(e,t,r,i.originalException,n,s.exception.values,o,0))}function Vr(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if($n(r[s],Error)){Pi(o,c,r);const u=e(t,r[s]),l=a.length;Fi(u,s,l,c),a=Vr(e,t,n,r[s],s,[u,...a],u,l)}return _a(r)&&r.errors.forEach((u,l)=>{if($n(u,Error)){Pi(o,c,r);const d=e(t,u),f=a.length;Fi(d,`errors[${l}]`,f,c),a=Vr(e,t,n,u,s,[d,...a],d,f)}}),a}function _a(e){return Array.isArray(e.errors)}function Pi(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",..._a(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Fi(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Id(e){const t="console";Ke(t,e),Xe(t,Rd)}function Rd(){"console"in ne&&Ru.forEach(function(e){e in ne.console&&Se(ne.console,e,function(t){return ci[e]=t,function(...n){ke("console",{args:n,level:e}),ci[e]?.apply(ne.console,n)}})})}function ya(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const kd="Dedupe",Cd=(()=>{let e;return{name:kd,processEvent(t){if(t.type)return t;try{if(xd(t,e))return M&&y.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Md=Cd;function xd(e,t){return t?!!(Ad(e,t)||Nd(e,t)):!1}function Ad(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Ea(e,t)||!Sa(e,t))}function Nd(e,t){const n=Bi(t),r=Bi(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Ea(e,t)||!Sa(e,t))}function Sa(e,t){let n=ui(e),r=ui(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s({name:Od,setup(e){e.on("spanStart",t=>{const n=re().getScopeData(),r=ct().getScopeData(),s=n.conversationId||r.conversationId;s&&t.setAttribute(ku,s)})}})),Dd=Ld;function Pd(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Oe()&&t(o);if(e.endTimestamp){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(c&&(Ud(h,e),Fd(h,e,s)),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},l=!!pe(),d=c&&l?At($d(o,i,a)):new Ge;if(e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){const p=e.args[0],h={...e.args[1]||{}},m=Bd(p,h,Oe()&&l?d:void 0,u);m&&(e.args[1]=h,h.headers=m)}const f=P();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",d,p)}return d}function Fd(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Bd(e,t,n,r){const s=ga({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(Es(e)?e.headers:void 0);if(a)if(Hd(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const l=u.get("baggage");l?En(l)||u.set("baggage",`${l},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(d=>d[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(d=>d[0]==="traceparent")&&u.push(["traceparent",c]);const l=a.find(d=>d[0]==="baggage"&&En(d[1]));return o&&!l&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,l="traceparent"in a?a.traceparent:void 0,d="baggage"in a?a.baggage:void 0,f=d?Array.isArray(d)?[...d]:[d]:[],p=d&&(Array.isArray(d)?d.find(m=>En(m)):En(d));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!l&&(h.traceparent=c),h}else return{...s}}function Ud(e,t){if(t.response){qo(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:Te,message:"internal_error"});e.end()}function En(e){return e.split(",").some(t=>t.trim().startsWith(Cu))}function Hd(e){return typeof Headers<"u"&&$n(e,Headers)}function $d(e,t,n){if(e.startsWith("data:")){const i=$e(e);return{name:`${t} ${i}`,attributes:Ui(e,void 0,t,n)}}const r=Ms(e),s=r?ed(r):e;return{name:`${t} ${s}`,attributes:Ui(e,r,t,n)}}function Ui(e,t,n,r){const s={url:$e(e),type:"fetch","http.method":n,[Y]:r,[le]:"http.client"};return t&&(Cs(t)||(s["http.url"]=$e(t.href),s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function ba(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Zt=ne;function Wd(){return"history"in Zt&&!!Zt.history}function zd(){if(!("fetch"in Zt))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Yr(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function qd(){if(typeof EdgeRuntime=="string")return!0;if(!zd())return!1;if(Yr(Zt.fetch))return!0;let e=!1;const t=Zt.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Yr(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){M&&y.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function va(e,t){const n="fetch";Ke(n,e),Xe(n,()=>Ta(void 0,t))}function jd(e){const t="fetch-body-resolved";Ke(t,e),Xe(t,()=>Ta(Vd))}function Ta(e,t=!1){t&&!qd()||Se(ne,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=Yd(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:_e()*1e3,virtualError:s,headers:Kd(r)};return e||ke("fetch",{...c}),n.apply(ne,r).then(async a=>(e?e(a):ke("fetch",{...c,endTimestamp:_e()*1e3,response:a}),a),a=>{ke("fetch",{...c,endTimestamp:_e()*1e3,error:a}),ys(a)&&a.stack===void 0&&(a.stack=s.stack,vt(a,"framesToPop",1));const l=P()?.getOptions().enhanceFetchErrorMessages??"always";if(l!==!1&&a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(c.fetchData.url).host;l==="always"?a.message=`${a.message} (${p})`:vt(a,"__sentry_fetch_url_host__",p)}catch{}throw a})}})}async function Gd(e,t){if(e?.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function Vd(e){let t;try{t=e.clone()}catch{return}Gd(t,()=>{ke("fetch-body-resolved",{endTimestamp:_e()*1e3,response:e})})}function Dn(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Hi(e){return typeof e=="string"?e:e?Dn(e,"url")?e.url:e.toString?e.toString():"":""}function Yd(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Hi(n),method:Dn(r,"method")?String(r.method).toUpperCase():Es(n)&&Dn(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Hi(t),method:Dn(t,"method")?String(t.method).toUpperCase():"GET"}}function Kd(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Es(t))return new Headers(t.headers)}catch{}}function Xd(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Jd(){return"npm"}function Qd(){return!Xd()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Kr(){return typeof window<"u"&&(!Qd()||Zd())}function Zd(){return ne.process?.type==="renderer"}const B=ne;let Xr=0;function wa(){return Xr>0}function ef(){Xr++,setTimeout(()=>{Xr--})}function wt(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(Ss(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>wt(o,t));return e.apply(this,i)}catch(i){throw ef(),sr(o=>{o.addEventProcessor(c=>(t.mechanism&&(Wr(c,void 0),Qt(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),bs(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}Mu(r,e),vt(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function xs(){const e=xt(),{referrer:t}=B.document||{},{userAgent:n}=B.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function As(e,t){const n=Ns(e,t),r={type:of(t),value:af(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function tf(e,t,n,r){const i=P()?.getOptions().normalizeDepth,o=ff(t),c={__serialized__:Au(t,i)};if(o)return{exception:{values:[As(e,o)]},extra:c};const a={exception:{values:[{type:vs(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:lf(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=Ns(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function Ir(e,t){return{exception:{values:[As(e,t)]}}}function Ns(e,t){const n=t.stacktrace||t.stack||"",r=rf(t),s=sf(t);try{return e(n,r,s)}catch{}return[]}const nf=/Minified React error #\d+;/i;function rf(e){return e&&nf.test(e.message)?1:0}function sf(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Ia(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function of(e){const t=e?.name;return!t&&Ia(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function af(e){const t=e?.message;return Ia(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Ai(t.error):Ai(e):"No error message"}function cf(e,t,n,r){const s=n?.syntheticException||void 0,i=Os(e,t,s,r);return Qt(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),gs(i)}function uf(e,t,n="info",r,s){const i=r?.syntheticException||void 0,o=Jr(e,t,i,s);return o.level=n,r?.event_id&&(o.event_id=r.event_id),gs(o)}function Os(e,t,n,r,s){let i;if(jo(t)&&t.error)return Ir(e,t.error);if(li(t)||xu(t)){const o=t;if("stack"in t)i=Ir(e,t);else{const c=o.name||(li(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=Jr(e,a,n,r),Wr(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return ys(t)?Ir(e,t):$r(t)||vs(t)?(i=tf(e,t,n,s),Qt(i,{synthetic:!0}),i):(i=Jr(e,t,n,r),Wr(i,`${t}`),Qt(i,{synthetic:!0}),i)}function Jr(e,t,n,r){const s={};if(r&&n){const i=Ns(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),Qt(s,{synthetic:!0})}if(zo(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function lf(e,{isUnhandledRejection:t}){const n=Nu(e),r=t?"promise rejection":"exception";return jo(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:vs(e)?`Event \`${df(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function df(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ff(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class pf extends jl{constructor(t){const n=hf(t),r=B.SENTRY_SDK_SOURCE||Jd();ma(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??c?.enableMetrics??!0;B.document&&(i||o||u)&&B.document.addEventListener("visibilitychange",()=>{B.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&jr(this),u&&sa(this))}),s&&this.on("beforeSendSession",id)}eventFromException(t,n){return cf(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return uf(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function hf(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:B.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const ot=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,A=ne,mf=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",un=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=mf(t.value,n),e(t)))}},ln=(e=!0)=>{const t=A.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStartln()?.activationStart??0;function We(e,t,n){A.document&&A.addEventListener(e,t,n)}function qn(e,t,n){A.document&&A.removeEventListener(e,t,n)}let Et=-1;const Ra=new Set,gf=()=>A.document?.visibilityState==="hidden"&&!A.document?.prerendering?0:1/0,Pn=e=>{if(_f(e)&&Et>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of Ra)t();isFinite(Et)||(Et=e.type==="visibilitychange"?e.timeStamp:0,qn("prerenderingchange",Pn,!0))}},dn=()=>{if(A.document&&Et<0){const e=Nt();Et=(A.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??gf(),We("visibilitychange",Pn,!0),We("pagehide",Pn,!0),We("prerenderingchange",Pn,!0)}return{get firstHiddenTime(){return Et},onHidden(e){Ra.add(e)}}};function _f(e){return e.type==="pagehide"||A.document?.visibilityState==="hidden"}const yf=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,fn=(e,t=-1)=>{const n=ln();let r="navigate";return n&&(A.document?.prerendering||Nt()>0?r="prerender":A.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:yf(),navigationType:r}},Rr=new WeakMap;function Ls(e,t){try{return Rr.get(e)||Rr.set(e,new t),Rr.get(e)}catch{return new t}}class jn{constructor(){jn.prototype.__init.call(this),jn.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}}const Ot=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Ds=e=>{let t=!1;return()=>{t||(e(),t=!0)}},cr=e=>{A.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Sf=[1800,3e3],Ef=(e,t={})=>{cr(()=>{const n=dn(),r=fn("FCP");let s;const o=Ot("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime{Ef(Ds(()=>{const n=fn("CLS",0);let r;const s=dn(),i=Ls(t,jn),o=a=>{for(const u of a)i._processEntry(u);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=Ot("layout-shift",o);c&&(r=un(e,n,bf,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),A?.setTimeout?.(r))}))};let ka=0,kr=1/0,bn=0;const Tf=e=>{e.forEach(t=>{t.interactionId&&(kr=Math.min(kr,t.interactionId),bn=Math.max(bn,t.interactionId),ka=bn?(bn-kr)/7+1:0)})};let Qr;const Ca=()=>Qr?ka:performance.interactionCount||0,wf=()=>{"interactionCount"in performance||Qr||(Qr=Ot("event",Tf,{type:"event",buffered:!0,durationThreshold:0}))},Cr=10;let Ma=0;const If=()=>Ca()-Ma;class Gn{constructor(){Gn.prototype.__init.call(this),Gn.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Ma=Ca(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(If()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.lengthn._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((s,i)=>i._latency-s._latency),this._longestInteractionList.length>Cr){const s=this._longestInteractionList.splice(Cr);for(const i of s)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}}const xa=e=>{const t=A.requestIdleCallback||A.setTimeout;A.document?.visibilityState==="hidden"?e():(e=Ds(e),We("visibilitychange",e,{once:!0,capture:!0}),We("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),qn("visibilitychange",e,{capture:!0}),qn("pagehide",e,{capture:!0})}))},Rf=[200,500],kf=40,Cf=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=dn();cr(()=>{wf();const r=fn("INP");let s;const i=Ls(t,Gn),o=a=>{xa(()=>{for(const l of a)i._processEntry(l);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=Ot("event",o,{durationThreshold:t.durationThreshold??kf});s=un(e,r,Rf,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class Mf{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const xf=[2500,4e3],Af=(e,t={})=>{cr(()=>{const n=dn(),r=fn("LCP");let s;const i=Ls(t,Mf),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime{o(c.takeRecords()),c.disconnect(),s(!0)}),u=l=>{l.isTrusted&&(xa(a),qn(l.type,u,{capture:!0}))};for(const l of["keydown","click","visibilitychange"])We(l,u,{capture:!0})}})},Nf=[800,1800],Zr=e=>{A.document?.prerendering?cr(()=>Zr(e)):A.document?.readyState!=="complete"?addEventListener("load",()=>Zr(e),!0):setTimeout(e)},Of=(e,t={})=>{const n=fn("TTFB"),r=un(e,n,Nf,t.reportAllChanges);Zr(()=>{const s=ln();s&&(n.value=Math.max(s.responseStart-Nt(),0),n.entries=[s],r(!0))})},jt={},Vn={};let Aa,Na,Oa,La;function Ps(e,t=!1){return ur("cls",e,Df,Aa,t)}function Fs(e,t=!1){return ur("lcp",e,Pf,Na,t)}function Lf(e){return ur("ttfb",e,Ff,Oa)}function Da(e){return ur("inp",e,Bf,La)}function at(e,t){return Pa(e,t),Vn[e]||(Uf(e),Vn[e]=!0),Fa(e,t)}function pn(e,t){const n=jt[e];if(n?.length)for(const r of n)try{r(t)}catch(s){ot&&y.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${qe(r)} Error:`,s)}}function Df(){return vf(e=>{pn("cls",{metric:e}),Aa=e},{reportAllChanges:!0})}function Pf(){return Af(e=>{pn("lcp",{metric:e}),Na=e},{reportAllChanges:!0})}function Ff(){return Of(e=>{pn("ttfb",{metric:e}),Oa=e})}function Bf(){return Cf(e=>{pn("inp",{metric:e}),La=e})}function ur(e,t,n,r,s=!1){Pa(e,t);let i;return Vn[e]||(i=n(),Vn[e]=!0),r&&t({metric:r}),Fa(e,t,s?i:void 0)}function Uf(e){const t={};e==="event"&&(t.durationThreshold=0),Ot(e,n=>{pn(e,{entries:n})},t)}function Pa(e,t){jt[e]=jt[e]||[],jt[e].push(t)}function Fa(e,t,n){return()=>{n&&n();const r=jt[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function Hf(e){return"duration"in e}const $f=e=>{const t=n=>{(n.type==="pagehide"||A.document?.visibilityState==="hidden")&&e(n)};We("visibilitychange",t,{capture:!0,once:!0}),We("pagehide",t,{capture:!0,once:!0})};function Mr(e){return typeof e=="number"&&isFinite(e)}function Ye(e,t,n,{...r}){const s=W(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ws(e,()=>{const i=At({startTime:t,...r});return i&&i.end(n),i})}function Bs(e){const t=P();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),l=t.getIntegrationByName("Replay")?.getReplayId(),d=re(),f=d.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=d.getScopeData().contexts.profile.profile_id}catch{}const m={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":A.navigator?.userAgent,"client.address":a?"{{auto}}":void 0,...s};return At({name:n,attributes:m,startTime:i,experimental:{standalone:!0}})}function hn(){return A.addEventListener&&A.performance}function oe(e){return e/1e3}function Wf(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function Ba(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ua(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}$f(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a?.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function zf(e){let t=0,n;if(!Ba("layout-shift"))return;const r=Ps(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Ua(e,(s,i)=>{qf(t,n,i,s),r()})}function qf(e,t,n,r){ot&&y.log(`Sending CLS span (${e})`);const s=t?oe((Ee()||0)+t.startTime):_e(),i=re().getScopeData().transactionName,o=t?Ie(t.sources[0]?.node):"Layout shift",c={[Y]:"auto.http.browser.cls",[le]:"ui.webvital.cls",[Mt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,l)=>{c[`cls.source.${l+1}`]=Ie(u.node)});const a=Bs({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[on]:"",[an]:e}),a.end(s))}function jf(e){let t=0,n;if(!Ba("largest-contentful-paint"))return;const r=Fs(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);Ua(e,(s,i)=>{Gf(t,n,i,s),r()})}function Gf(e,t,n,r){ot&&y.log(`Sending LCP span (${e})`);const s=oe((Ee()||0)+(t?.startTime||0)),i=re().getScopeData().transactionName,o=t?Ie(t.element):"Largest contentful paint",c={[Y]:"auto.http.browser.lcp",[le]:"ui.webvital.lcp",[Mt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=Ie(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=Bs({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[on]:"millisecond",[an]:e}),a.end(s))}function Re(e){return e&&((Ee()||performance.timeOrigin)+e)/1e3}function Ha(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=Wf(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Ee()||hn()?.timeOrigin?Vf({...t,"http.request.redirect_start":Re(e.redirectStart),"http.request.redirect_end":Re(e.redirectEnd),"http.request.worker_start":Re(e.workerStart),"http.request.fetch_start":Re(e.fetchStart),"http.request.domain_lookup_start":Re(e.domainLookupStart),"http.request.domain_lookup_end":Re(e.domainLookupEnd),"http.request.connect_start":Re(e.connectStart),"http.request.secure_connection_start":Re(e.secureConnectionStart),"http.request.connection_end":Re(e.connectEnd),"http.request.request_start":Re(e.requestStart),"http.request.response_start":Re(e.responseStart),"http.request.response_end":Re(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Vf(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Yf=2147483647;let $i=0,Ae={},ye,Yn;function Kf({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=hn();if(r&&Ee()){r.mark&&A.performance.mark("sentry-tracing-init");const s=t?jf(n):ep(),i=tp(),o=e?zf(n):Zf();return()=>{s?.(),i(),o?.()}}return()=>{}}function Xf(){at("longtask",({entries:e})=>{const t=pe();if(!t)return;const{op:n,start_timestamp:r}=W(t);for(const s of e){const i=oe(Ee()+s.startTime),o=oe(s.duration);n==="navigation"&&r&&i{const n=pe();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=oe(Ee()+r.startTime),{start_timestamp:i,op:o}=W(n);if(o==="navigation"&&i&&s{const t=pe();if(t){for(const n of e)if(n.name==="click"){const r=oe(Ee()+n.startTime),s=oe(n.duration),i={name:Ie(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Y]:"auto.ui.browser.metrics"}},o=Go(n.target);o&&(i.attributes["ui.component_name"]=o),Ye(t,r,r+s,i)}}})}function Zf(){return Ps(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ae.cls={value:e.value,unit:""},Yn=t)},!0)}function ep(){return Fs(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ae.lcp={value:e.value,unit:"millisecond"},ye=t)},!0)}function tp(){return Lf(({metric:e})=>{e.entries[e.entries.length-1]&&(Ae.ttfb={value:e.value,unit:"millisecond"})})}function np(e,t){const n=hn(),r=Ee();if(!n?.getEntries||!r)return;const s=oe(r),i=n.getEntries(),{op:o,start_timestamp:c}=W(e);i.slice($i).forEach(a=>{const u=oe(a.startTime),l=oe(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u{ll(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",Nt()),dp(e,t)),ye=void 0,Yn=void 0,Ae={}}function rp(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function sp(e,t,n,r,s,i){if(rp(t)||["mark","measure"].includes(t.entryType)&&Pe(t.name,i))return;const o=ln(!1),c=oe(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,l=u+r,d={[Y]:"auto.resource.browser.metrics"};a!==u&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=a),ip(d,t),a<=l&&Ye(e,a,l,{name:t.name,op:t.entryType,attributes:d})}function ip(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&bt(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(bt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function op(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{vn(e,t,r,n)}),vn(e,t,"secureConnection",n,"TLS/SSL"),vn(e,t,"fetch",n,"cache"),vn(e,t,"domainLookup",n,"DNS"),cp(e,t,n)}function vn(e,t,n,r,s=n){const i=ap(n),o=t[i],c=t[`${n}Start`];!c||!o||Ye(e,r+oe(c),r+oe(o),{op:`browser.${s}`,name:t.name,attributes:{[Y]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function ap(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function cp(e,t,n){const r=n+oe(t.requestStart),s=n+oe(t.responseEnd),i=n+oe(t.responseStart);t.responseEnd&&(Ye(e,r,s,{op:"browser.request",name:t.name,attributes:{[Y]:"auto.ui.browser.metrics"}}),Ye(e,i,s,{op:"browser.response",name:t.name,attributes:{[Y]:"auto.ui.browser.metrics"}}))}function up(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o?.includes(c))return;const a={[Y]:"auto.resource.browser.metrics"},u=it(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(A.location.origin),fp(t,a,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const l={...a,...Ha(t)},d=i+r,f=d+s;Ye(e,d,f,{name:n.replace(A.location.origin,""),op:c,attributes:l})}function lp(e){const t=A.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Mr(n.rtt)&&(Ae["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Mr(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Mr(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function dp(e,t){ye&&t.recordLcpOnPageloadSpan&&(ye.element&&e.setAttribute("lcp.element",Ie(ye.element)),ye.id&&e.setAttribute("lcp.id",ye.id),ye.url&&e.setAttribute("lcp.url",ye.url.trim().slice(0,200)),ye.loadTime!=null&&e.setAttribute("lcp.loadTime",ye.loadTime),ye.renderTime!=null&&e.setAttribute("lcp.renderTime",ye.renderTime),e.setAttribute("lcp.size",ye.size)),Yn?.sources&&t.recordClsOnPageloadSpan&&Yn.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ie(n.node)))}function fp(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i{}}const mp=({entries:e})=>{const t=pe(),n=t?ge(t):void 0,r=n?W(n).description:re().getScopeData().transactionName;e.forEach(s=>{const i=s;if(!i.identifier)return;const o=i.name,c=i.renderTime,a=i.loadTime,[u,l]=a?[oe(a),"load-time"]:c?[oe(c),"render-time"]:[_e(),"entry-emission"],d=o==="image-paint"?oe(Math.max(0,(c??0)-(a??0))):0,f={[Y]:"auto.ui.browser.elementtiming",[le]:"ui.elementtiming",[fe]:"component","sentry.span_start_time_source":l,"sentry.transaction_name":r,"element.id":i.id,"element.type":i.element?.tagName?.toLowerCase()||"unknown","element.size":i.naturalWidth&&i.naturalHeight?`${i.naturalWidth}x${i.naturalHeight}`:void 0,"element.render_time":c,"element.load_time":a,"element.url":i.url||void 0,"element.identifier":i.identifier,"element.paint_type":o};pt({name:`element[${i.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},p=>{p.end(u+d)})})},gp=1e3;let Wi,es,ts;function $a(e){Ke("dom",e),Xe("dom",_p)}function _p(){if(!A.document)return;const e=ke.bind(null,"dom"),t=zi(e,!0);A.document.addEventListener("click",t,!1),A.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const s=A[n]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(Se(s,"addEventListener",function(i){return function(o,c,a){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},l=u[o]=u[o]||{refCount:0};if(!l.handler){const d=zi(e);l.handler=d,i.call(this,o,d,a)}l.refCount++}catch{}return i.call(this,o,c,a)}}),Se(s,"removeEventListener",function(i){return function(o,c,a){if(o==="click"||o=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},l=u[o];l&&(l.refCount--,l.refCount<=0&&(i.call(this,o,l.handler,a),l.handler=void 0,delete u[o]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,o,c,a)}}))})}function yp(e){if(e.type!==es)return!1;try{if(!e.target||e.target._sentryId!==ts)return!1}catch{}return!0}function Sp(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function zi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Ep(n);if(Sp(n.type,r))return;vt(n,"_sentryCaptured",!0),r&&!r._sentryId&&vt(r,"_sentryId",Wt());const s=n.type==="keypress"?"input":n.type;yp(n)||(e({event:n,name:s,global:t}),es=n.type,ts=r?r._sentryId:void 0),clearTimeout(Wi),Wi=A.setTimeout(()=>{ts=void 0,es=void 0},gp)}}function Ep(e){try{return e.target}catch{return null}}let Tn;function lr(e){const t="history";Ke(t,e),Xe(t,bp)}function bp(){if(A.addEventListener("popstate",()=>{const t=A.location.href,n=Tn;if(Tn=t,n===t)return;ke("history",{from:n,to:t})}),!Wd())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=Tn,i=vp(String(r));if(Tn=i,s===i)return t.apply(this,n);ke("history",{from:s,to:i})}return t.apply(this,n)}}Se(A.history,"pushState",e),Se(A.history,"replaceState",e)}function vp(e){try{return new URL(e,A.location.origin).toString()}catch{return e}}const Fn={};function Wa(e){const t=Fn[e];if(t)return t;let n=A[e];if(Yr(n))return Fn[e]=n.bind(A);const r=A.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){ot&&y.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(Fn[e]=n.bind(A))}function Tp(e){Fn[e]=void 0}function mn(...e){return Wa("setTimeout")(...e)}const rt="__sentry_xhr_v3__";function za(e){Ke("xhr",e),Xe("xhr",wp)}function wp(){if(!A.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=_e()*1e3,o=zt(r[0])?r[0].toUpperCase():void 0,c=Ip(r[1]);if(!o||!c)return t.apply(n,r);n[rt]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[rt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const l={endTimestamp:_e()*1e3,startTimestamp:i,xhr:n,virtualError:s};ke("xhr",l)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,l,d){return a(),u.apply(l,d)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,l,d){const[f,p]=d,h=l[rt];return h&&zt(f)&&zt(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(l,d)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[rt];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:_e()*1e3,xhr:n};return ke("xhr",i),t.apply(n,r)}})}function Ip(e){if(zt(e))return e;try{return e.toString()}catch{}}const Rp=Symbol.for("sentry__originalRequestBody");function qa(e){return new URLSearchParams(e).toString()}function ja(e,t=y){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[qa(e)];if(!e)return[void 0]}catch(n){return ot&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return ot&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ga(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][Rp];return n!==void 0?n:void 0}}function Va(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return ot&&y.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const xr=[],Bn=new Map,dt=new Map,kp=60;function Cp(){if(hn()&&Ee()){const t=Mp();return()=>{t()}}return()=>{}}const ns={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function Mp(){return Da(xp)}const xp=({metric:e})=>{if(e.value==null)return;const t=oe(e.value);if(t>kp)return;const n=e.entries.find(h=>h.duration===e.value&&ns[h.name]);if(!n)return;const{interactionId:r}=n,s=ns[n.name],i=oe(Ee()+n.startTime),o=pe(),c=o?ge(o):void 0,a=r!=null?Bn.get(r):void 0,u=a?.span||c,l=u?W(u).description:re().getScopeData().transactionName,d=a?.elementName||Ie(n.target),f={[Y]:"auto.http.browser.inp",[le]:`ui.interaction.${s}`,[Mt]:n.duration},p=Bs({name:d,transaction:l,attributes:f,startTime:i});p&&(p.addEvent("inp",{[on]:"millisecond",[an]:e.value}),p.end(i+t))};function Ap(){const e=Object.keys(ns);Kr()&&e.forEach(s=>{A.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=Ie(i),c=Math.round(s.timeStamp);if(dt.set(c,o),dt.size>50){const a=dt.keys().next().value;a!==void 0&&dt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=dt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=dt.get(i+c);if(a){o=a;break}}return o||""}const r=({entries:s})=>{const i=pe(),o=i&&ge(i);s.forEach(c=>{if(!Hf(c))return;const a=c.interactionId;if(a==null||Bn.has(a))return;const u=c.target?Ie(c.target):n(c);if(xr.length>10){const l=xr.shift();Bn.delete(l)}xr.push(a),Bn.set(a,{span:o,elementName:u})})};at("event",r),at("first-input",r)}const Np=40;function Op(e,t=Wa("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw Tp("fetch"),a}finally{n-=o,r--}}return Hl(e,s,ks(e.bufferSize||Np))}const Ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Lp=30,Dp=50;function rs(e,t,n,r){const s={filename:e,function:t===""?Tt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Pp=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Fp=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Bp=/\((\S*)(?::(\d+))(?::(\d+))\)/,Up=/at (.+?) ?\(data:(.+?),/,Hp=e=>{const t=e.match(Up);if(t)return{filename:``,function:t[1]};const n=Pp.exec(e);if(n){const[,s,i,o]=n;return rs(s,Tt,+i,+o)}const r=Fp.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const c=Bp.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,o]=Ya(r[1]||Tt,r[2]);return rs(o,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},$p=[Lp,Hp],Wp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,zp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,qp=e=>{const t=Wp.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=zp.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Tt;return[s,r]=Ya(s,r),rs(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},jp=[Dp,qp],Gp=[$p,jp],Vp=Ou(...Gp),Ya=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Tt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},wn=1024,Yp="Breadcrumbs",Kp=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Yp,setup(n){t.console&&Id(Zp(n)),t.dom&&$a(Qp(n,t.dom)),t.xhr&&za(eh(n)),t.fetch&&va(th(n)),t.history&&lr(nh(n)),t.sentry&&n.on("beforeSendEvent",Jp(n))}}}),Xp=Kp;function Jp(e){return function(n){P()===e&&Ve({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:nt(n)},{event:n})}}function Qp(e,t){return function(r){if(P()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>wn&&(Ce&&y.warn(`\`dom.maxStringLength\` cannot exceed ${wn}, but a value of ${c} was configured. Sentry will use ${wn} instead.`),c=wn),typeof o=="string"&&(o=[o]);try{const u=r.event,l=rh(u)?u.target:u;s=Ie(l,{keyAttrs:o,maxStringLength:c}),i=Go(l)}catch{s=""}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),Ve(a,{event:r.event,name:r.name,global:r.global})}}function Zp(e){return function(n){if(P()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:ya(n.level),message:di(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${di(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Ve(r,{input:n.args,level:n.level})}}function eh(e){return function(n){if(P()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[rt];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,l={method:o,url:c,status_code:a},d={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:l,type:"http",level:ba(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,d),Ve(f,d)}}function th(e){return function(n){if(P()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const i=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",c,o),Ve(c,o)}else{const i=n.response,o={...n.fetchData,status_code:i?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,i?.status;const c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:ba(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),Ve(a,c)}}}function nh(e){return function(n){if(P()!==e)return;let r=n.from,s=n.to;const i=it(B.location.href);let o=r?it(r):void 0;const c=it(s);o?.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Ve({category:"navigation",data:{from:r,to:s}})}}function rh(e){return!!e&&!!e.target}const sh=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ih="BrowserApiErrors",oh=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:ih,setupOnce(){t.setTimeout&&Se(B,"setTimeout",qi),t.setInterval&&Se(B,"setInterval",qi),t.requestAnimationFrame&&Se(B,"requestAnimationFrame",ch),t.XMLHttpRequest&&"XMLHttpRequest"in B&&Se(XMLHttpRequest.prototype,"send",uh);const n=t.eventTarget;n&&(Array.isArray(n)?n:sh).forEach(s=>lh(s,t))}}}),ah=oh;function qi(e){return function(...t){const n=t[0];return t[0]=wt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${qe(e)}`}}),e.apply(this,t)}}function ch(e){return function(t){return e.apply(this,[wt(t,{mechanism:{data:{handler:qe(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function uh(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Se(n,s,function(i){const o={mechanism:{data:{handler:qe(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Ss(i);return c&&(o.mechanism.data.handler=qe(c)),wt(i,o)})}),e.apply(this,t)}}function lh(e,t){const r=B[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Se(r,"addEventListener",function(s){return function(i,o,c){try{dh(o)&&(o.handleEvent=wt(o.handleEvent,{mechanism:{data:{handler:qe(o),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&fh(this,i,o),s.apply(this,[i,wt(o,{mechanism:{data:{handler:qe(o),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),c])}}),Se(r,"removeEventListener",function(s){return function(i,o,c){try{const a=o.__sentry_wrapped__;a&&s.call(this,i,a,c)}catch{}return s.call(this,i,o,c)}}))}function dh(e){return typeof e.handleEvent=="function"}function fh(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const ph=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof B.document>"u"){Ce&&y.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}fi({ignoreDuration:!0}),br();const n=ct();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(br(),r=i)}),t==="route"&&lr(({from:s,to:i})=>{s!==i&&(fi({ignoreDuration:!0}),br())})}}},hh="CultureContext",mh=(()=>({name:hh,preprocessEvent(e){const t=_h();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),gh=mh;function _h(){try{const e=B.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const yh="GlobalHandlers",Sh=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:yh,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(bh(n),ji("onerror")),t.onunhandledrejection&&(vh(n),ji("onunhandledrejection"))}}}),Eh=Sh;function bh(e){Yo(t=>{const{stackParser:n,attachStacktrace:r}=Ka();if(P()!==e||wa())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Ih(Os(n,a||s,void 0,r,!1),i,o,c);u.level="error",Vo(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function vh(e){Ko(t=>{const{stackParser:n,attachStacktrace:r}=Ka();if(P()!==e||wa())return;const s=Th(t),i=bt(s)?wh(s):Os(n,s,void 0,r,!0);i.level="error",Vo(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Th(e){if(bt(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function wh(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Ih(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[],u=r,l=n,d=Rh(t)??xt();return a.length===0&&a.push({colno:u,filename:d,function:Tt,in_app:!0,lineno:l}),e}function ji(e){Ce&&y.log(`Global Handler attached: ${e}`)}function Ka(){return P()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Rh(e){if(!(!zt(e)||e.length===0))return e.startsWith("data:")?`<${$e(e,!1)}>`:e}const kh=()=>({name:"HttpContext",preprocessEvent(e){if(!B.navigator&&!B.location&&!B.document)return;const t=xs(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),Ch="cause",Mh=5,xh="LinkedErrors",Ah=((e={})=>{const t=e.limit||Mh,n=e.key||Ch;return{name:xh,preprocessEvent(r,s,i){const o=i.getOptions();wd(As,o.stackParser,n,t,r,s)}}}),Nh=Ah;function Oh(){return Lh()?(Ce&&cn(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function Lh(){if(typeof B.window>"u")return!1;const e=B;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=xt(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(B===B.top&&r.some(i=>n.startsWith(`${i}://`)))}function Dh(e){return[gd(),fd(),Dd(),ah(),Xp(),Eh(),Nh(),Md(),kh(),gh(),ph()]}function Ph(e={}){const t=!e.skipBrowserExtensionCheck&&Oh();let n=e.defaultIntegrations==null?Dh():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Lu(e.stackParser||Vp),integrations:Ml({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Op};return Jl(pf,r)}const Z=ne,Us="sentryReplaySession",Fh="replay_event",Hs="Unable to send Replay",Bh=3e5,Uh=9e5,Hh=5e3,$h=5500,Wh=6e4,zh=5e3,qh=3,Gi=15e4,In=5e3,jh=3e3,Gh=300,$s=2e7,Vh=4999,Yh=5e4,Vi=36e5;var Kh=Object.defineProperty,Xh=(e,t,n)=>t in e?Kh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yi=(e,t,n)=>Xh(e,typeof t!="symbol"?t+"":t,n),ae=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ae||{});function Jh(e){return e.nodeType===e.ELEMENT_NODE}function Gt(e){return e?.host?.shadowRoot===e}function Vt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Qh(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Zh(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 Kn(e){try{const t=e.rules||e.cssRules;return t?Qh(Array.from(t,Xa).join("")):null}catch{return null}}function em(e){let t="";for(let n=0;nthis.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 sm(){return new Ja}function dr({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 en({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function It(e){return e.toLowerCase()}function ss(e){return e.toUpperCase()}const Ki="__rrweb_original__";function im(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;ra!==0))return!1}return!0}function Ws(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?It(t):null}function Xn(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function Qa(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}const Xi={};function Za(e){const t=Xi[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 Xi[e]=r.bind(window)}function is(...e){return Za("setTimeout")(...e)}function ec(...e){return Za("clearTimeout")(...e)}function tc(e){try{return e.contentDocument}catch{}}let om=1;const am=new RegExp("[^a-z0-9-_:]"),tn=-2;function zs(){return om++}function cm(e){if(e instanceof HTMLFormElement)return"form";const t=It(e.tagName);return am.test(t)?"div":t}function um(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let ft,Ji;const lm=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dm=/^(?:[a-z+]+:)?\/\//i,fm=/^www\..*/i,pm=/^(data:)([^,]*),(.*)/i;function hm(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Jn(e,t){return(e||"").replace(lm,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(dm.test(a)||fm.test(a))return`url(${u}${a}${u})`;if(pm.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${um(t)+a}${u})`;const l=t.split("/"),d=a.split("/");l.pop();for(const f of d)f!=="."&&(f===".."?l.pop():l.push(f));return`url(${u}${l.join("/")}${u})`})}const mm=/^[^ \t\n\r\u000c]+/,gm=/^[, \t\n\r\u000c]+/;function _m(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(gm),!(n>=t.length);){let i=r(mm);if(i.slice(-1)===",")i=gt(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=gt(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(", ")}const Qi=new WeakMap;function gt(e,t){return!t||t.trim()===""?t:fr(e,t)}function ym(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function fr(e,t){let n=Qi.get(e);if(n||(n=e.createElement("a"),Qi.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function nc(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return gt(e,r);if(n==="xlink:href"&&r[0]!=="#")return gt(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return gt(e,r);if(n==="srcset")return _m(e,r);if(n==="style"){let c=Jn(r,fr(e));return o&&o.size>0&&(c=hm(c,o)),c}else if(t==="object"&&n==="data")return gt(e,r);return typeof i=="function"?i(n,r,s):r}function rc(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function Sm(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 Em(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function st(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:st(e.parentNode,t,n,r+1)}function _t(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(Em(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Rt(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 u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=st(o,_t(r,s)),a<0)return!0;c=st(o,_t(t,n),a>=0?a:1/0)}else{if(c=st(o,_t(t,n)),c<0)return!1;a=st(o,_t(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function bm(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=is(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{ec(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return is(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function vm(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=is(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{ec(i),r=!0,t()})}function Tm(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:_,dataURLOptions:b={},inlineImages:I,recordCanvas:$,keepIframeSrcFn:D,newlyAddedElement:G=!1,ignoreCSSAttributes:N}=t,g=wm(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ae.Document,childNodes:[],compatMode:e.compatMode}:{type:ae.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ae.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:g};case e.ELEMENT_NODE:return Rm(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:b,inlineImages:I,recordCanvas:$,keepIframeSrcFn:D,newlyAddedElement:G,rootId:g,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:N});case e.TEXT_NODE:return Im(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:_,rootId:g});case e.CDATA_SECTION_NODE:return{type:ae.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:ae.Comment,textContent:e.textContent||"",rootId:g};default:return!1}}function wm(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function Im(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:l}=t,d=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=d==="STYLE"?!0:void 0,h=d==="SCRIPT"?!0:void 0,m=d==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=Kn(e.parentNode.sheet))}catch(b){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${b}`,e)}f=Jn(f,fr(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=Rt(e,r,i,s,o,n);if(!p&&!h&&!m&&f&&_&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const b=dr({type:null,tagName:d,maskInputOptions:a});f=en({isMasked:Rt(e,r,i,s,o,b),element:e,value:f,maskInputFn:u})}return{type:ae.Text,textContent:f||"",isStyle:p,rootId:l}}function Rm(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:_,unmaskTextClass:b,maskTextSelector:I,unmaskTextSelector:$,ignoreCSSAttributes:D}=t,G=Sm(e,r,s,i),N=cm(e);let g={};const w=e.attributes.length;for(let E=0;EU.href===e.href);let R=null;E&&(R=Kn(E)),R&&(g.rel=null,g.href=null,g.crossorigin=null,g._cssText=Jn(R,E.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=Kn(e.sheet);E&&(g._cssText=Jn(E,fr(n)))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){const E=e,R=Ws(E),U=Xn(E,ss(N),R),z=E.checked;if(R!=="submit"&&R!=="button"&&U){const L=Rt(E,_,I,b,$,dr({type:R,tagName:ss(N),maskInputOptions:c}));g.value=en({isMasked:L,element:E,value:U,maskInputFn:u})}z&&(g.checked=z)}if(N==="option"&&(e.selected&&!c.select?g.selected=!0:delete g.selected),N==="canvas"&&f){if(e.__context==="2d")im(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const E=e.toDataURL(l.type,l.quality),R=n.createElement("canvas");R.width=e.width,R.height=e.height;const U=R.toDataURL(l.type,l.quality);E!==U&&(g.rr_dataURL=E)}}if(N==="img"&&d){ft||(ft=n.createElement("canvas"),Ji=ft.getContext("2d"));const E=e,R=E.currentSrc||E.getAttribute("src")||"",U=E.crossOrigin,z=()=>{E.removeEventListener("load",z);try{ft.width=E.naturalWidth,ft.height=E.naturalHeight,Ji.drawImage(E,0,0),g.rr_dataURL=ft.toDataURL(l.type,l.quality)}catch(L){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?z():E.addEventListener("load",z);return}else console.warn(`Cannot inline img src=${R}! Error: ${L}`)}E.crossOrigin==="anonymous"&&(U?g.crossOrigin=U:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?z():E.addEventListener("load",z)}if((N==="audio"||N==="video")&&(g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),G){const{width:E,height:R}=e.getBoundingClientRect();g={class:g.class,rr_width:`${E}px`,rr_height:`${R}px`}}N==="iframe"&&!p(g.src)&&(!G&&!tc(e)&&(g.rr_src=g.src),delete g.src);let J;try{customElements.get(N)&&(J=!0)}catch{}return{type:ae.Element,tagName:N,attributes:g,childNodes:[],isSVG:ym(e)||void 0,needBlock:G,rootId:m,isCustom:J}}function Q(e){return e==null?"":e.toLowerCase()}function km(e,t){if(t.comment&&e.type===ae.Comment)return!0;if(e.type===ae.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Qa(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Q(e.attributes.name)==="application-name"||Q(e.attributes.rel)==="icon"||Q(e.attributes.rel)==="apple-touch-icon"||Q(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||Q(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Q(e.attributes.name)==="robots"||Q(e.attributes.name)==="googlebot"||Q(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Q(e.attributes.name)==="author"||Q(e.attributes.name)==="generator"||Q(e.attributes.name)==="framework"||Q(e.attributes.name)==="publisher"||Q(e.attributes.name)==="progid"||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Q(e.attributes.name)==="google-site-verification"||Q(e.attributes.name)==="yandex-verification"||Q(e.attributes.name)==="csrf-token"||Q(e.attributes.name)==="p:domain_verify"||Q(e.attributes.name)==="verify-v1"||Q(e.attributes.name)==="verification"||Q(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function yt(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:_,maskInputFn:b,slimDOMOptions:I,dataURLOptions:$={},inlineImages:D=!1,recordCanvas:G=!1,onSerialize:N,onIframeLoad:g,iframeLoadTimeout:w=5e3,onBlockedImageLoad:J,onStylesheetLoad:E,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:U=()=>!1,newlyAddedElement:z=!1,ignoreCSSAttributes:L}=t;let{preserveWhiteSpace:ce=!0}=t;const K=Tm(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:b,dataURLOptions:$,inlineImages:D,recordCanvas:G,keepIframeSrcFn:U,newlyAddedElement:z,ignoreCSSAttributes:L});if(!K)return console.warn(e,"not serialized"),null;let ee;r.hasNode(e)?ee=r.getId(e):km(K,I)||!ce&&K.type===ae.Text&&!K.isStyle&&!K.textContent.replace(/^\s+|\s+$/gm,"").length?ee=tn:ee=zs();const S=Object.assign(K,{id:ee});if(r.add(e,S),ee===tn)return null;N&&N(e);let V=!f;if(S.type===ae.Element){V=V&&!S.needBlock;const T=e.shadowRoot;T&&Vt(T)&&(S.isShadowHost=!0)}if((S.type===ae.Document||S.type===ae.Element)&&V){I.headWhitespace&&S.type===ae.Element&&S.tagName==="head"&&(ce=!1);const T={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:b,slimDOMOptions:I,dataURLOptions:$,inlineImages:D,recordCanvas:G,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:g,iframeLoadTimeout:w,onBlockedImageLoad:J,onStylesheetLoad:E,stylesheetLoadTimeout:R,keepIframeSrcFn:U,ignoreCSSAttributes:L},X=e.childNodes?Array.from(e.childNodes):[];for(const te of X){const se=yt(te,T);se&&S.childNodes.push(se)}if(Jh(e)&&e.shadowRoot)for(const te of Array.from(e.shadowRoot.childNodes)){const se=yt(te,T);se&&(Vt(e.shadowRoot)&&(se.isShadow=!0),S.childNodes.push(se))}}if(e.parentNode&&Gt(e.parentNode)&&Vt(e.parentNode)&&(S.isShadow=!0),S.type===ae.Element&&S.tagName==="iframe"&&!S.needBlock&&bm(e,()=>{const T=tc(e);if(T&&g){const X=yt(T,{doc:T,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:b,slimDOMOptions:I,dataURLOptions:$,inlineImages:D,recordCanvas:G,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:g,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:R,keepIframeSrcFn:U,ignoreCSSAttributes:L});X&&g(e,X)}},w),S.type===ae.Element&&S.tagName==="img"&&!e.complete&&S.needBlock){const T=e,X=()=>{if(T.isConnected&&!T.complete&&J)try{const te=T.getBoundingClientRect();te.width>0&&te.height>0&&J(T,S,te)}catch{}T.removeEventListener("load",X)};T.isConnected&&T.addEventListener("load",X)}return S.type===ae.Element&&S.tagName==="link"&&typeof S.attributes.rel=="string"&&(S.attributes.rel==="stylesheet"||S.attributes.rel==="preload"&&typeof S.attributes.href=="string"&&Qa(S.attributes.href)==="css")&&vm(e,()=>{if(E){const T=yt(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:b,slimDOMOptions:I,dataURLOptions:$,inlineImages:D,recordCanvas:G,preserveWhiteSpace:ce,onSerialize:N,onIframeLoad:g,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:R,keepIframeSrcFn:U,ignoreCSSAttributes:L});T&&E(e,T)}},R),S.type===ae.Element&&delete S.needBlock,S}function Cm(e,t){const{mirror:n=new Ja,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:l=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:b,slimDOM:I=!1,dataURLOptions:$,preserveWhiteSpace:D,onSerialize:G,onIframeLoad:N,iframeLoadTimeout:g,onBlockedImageLoad:w,onStylesheetLoad:J,stylesheetLoadTimeout:E,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:U=new Set([])}=t||{};return yt(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h===!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}:h===!1?{}:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:b,slimDOMOptions:I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I,dataURLOptions:$,inlineImages:f,recordCanvas:p,preserveWhiteSpace:D,onSerialize:G,onIframeLoad:N,iframeLoadTimeout:g,onBlockedImageLoad:w,onStylesheetLoad:J,stylesheetLoadTimeout:E,keepIframeSrcFn:R,newlyAddedElement:!1,ignoreCSSAttributes:U})}function me(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const ht=`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 Zi={map:{},getId(){return console.error(ht),-1},getNode(){return console.error(ht),null},removeNodeFromMap(){console.error(ht)},has(){return console.error(ht),!1},reset(){console.error(ht)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Zi=new Proxy(Zi,{get(e,t,n){return t==="map"&&console.error(ht),Reflect.get(e,t,n)}}));function nn(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&&(Dm(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=pr(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function sc(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){pr(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>sc(e,t,i||{},!0)}function qs(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 Qn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qn=()=>new Date().getTime());function ic(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function oc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ac(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function cc(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function we(e,t,n,r,s){if(!e)return!1;const i=cc(e);if(!i)return!1;const o=_t(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=st(i,o);let a=-1;return c<0?!1:(r&&(a=st(i,_t(null,r))),c>-1&&a<0?!0:c{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 lc(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function dc(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function as(e){return!!e?.shadowRoot}class Am{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,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 fc(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Nm(e){let t=e,n;for(;n=fc(t);)t=n;return t}function Om(e){const t=e.ownerDocument;if(!t)return!1;const n=Nm(e);return t.contains(n)}function pc(e){const t=e.ownerDocument;return t?t.contains(e)||Om(e):!1}const eo={};function js(e){const t=eo[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 eo[e]=r.bind(window)}function Lm(...e){return js("requestAnimationFrame")(...e)}function pr(...e){return js("setTimeout")(...e)}function Dm(...e){return js("clearTimeout")(...e)}var O=(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))(O||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(x||{}),he=(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))(he||{}),De=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(De||{}),mt=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(mt||{});function Gs(e){try{return e.contentDocument}catch{}}function Pm(e){try{return e.contentWindow}catch{}}function to(e){return"__ln"in e}class Fm{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`${e}@${t}`;class Bm{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 Fm,s=a=>{let u=a,l=tn;for(;l===tn;)u=u&&u.nextSibling,l=u&&this.mirror.getId(u);return l},i=a=>{if(!a.parentNode||!pc(a))return;const u=Gt(a.parentNode)?this.mirror.getId(fc(a)):this.mirror.getId(a.parentNode),l=s(a);if(u===-1||l===-1)return r.addNode(a);const d=yt(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=>{lc(f,this.mirror)&&!we(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),dc(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),as(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{we(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:m})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${m}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});d&&(t.push({parentId:u,nextId:l,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)ro(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!so(this.droppedSet,a)&&!ro(this.removes,a,this.mirror)||so(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),l=s(o.value);u!==-1&&l!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const l=u;if(u=u.previous,l){const d=this.mirror.getId(l.value.parentNode);if(s(l.value)===-1)continue;if(d!==-1){a=l;break}else{const p=l.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=l;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:u}=a;if(typeof u.style=="string"){const l=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);l.length!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(!Ar(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!we(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Rt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,cc(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=Ws(n),c=n.tagName;s=Xn(n,c,o);const a=dr({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=Rt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=en({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(we(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(!Gs(n))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"),!rc(n.tagName,r)&&(i.attributes[r]=nc(this.doc,It(n.tagName),It(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),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(we(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=Gt(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);we(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ar(n,this.mirror)||!Mm(n,this.mirror)||(this.addedSet.has(n)?(cs(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||uc(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[no(r,s)]?cs(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Gt(t.target)&&Vt(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(Ar(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[no(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);we(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),as(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","ignoreCSSAttributes"].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 cs(e,t){e.delete(t),t.childNodes?.forEach(n=>cs(e,n))}function ro(e,t,n){return e.length===0?!1:Um(e,t,n)}function Um(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function so(e,t){return e.size===0?!1:hc(e,t)}function hc(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:hc(e,n):!1}let Yt;function Hm(e){Yt=e}function $m(){Yt=void 0}const H=e=>Yt?(...n)=>{try{return e(...n)}catch(r){if(Yt&&Yt(r)===!0)return()=>{};throw r}}:e,St=[];function gn(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 mc(e,t){const n=new Bm;St.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=window?.Zone?.__symbol__?.("MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(H(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 Wm({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=nn(H(d=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),d),o=[],c=null}),i),u=H(nn(H(d=>{const f=gn(d),{clientX:p,clientY:h}=os(d)?d.changedTouches[0]:d;c||(c=Qn()),o.push({x:p,y:h,id:r.getId(f),timeOffset:Qn()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)}),s,{trailing:!1})),l=[me("mousemove",u,n),me("touchmove",u,n),me("drag",u,n)];return H(()=>{l.forEach(d=>d())})}function zm({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 u=null;const l=d=>f=>{const p=gn(f);if(we(p,r,s,i,!0))return;let h=null,m=d;if("pointerType"in f){switch(f.pointerType){case"mouse":h=De.Mouse;break;case"touch":h=De.Touch;break;case"pen":h=De.Pen;break}h===De.Touch?he[d]===he.MouseDown?m="TouchStart":he[d]===he.MouseUp&&(m="TouchEnd"):De.Pen}else os(f)&&(h=De.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===De.Touch||m.startsWith("Mouse")&&h===De.Mouse)&&(h=null)):he[d]===he.Click&&(h=u,u=null);const _=os(f)?f.changedTouches[0]:f;if(!_)return;const b=n.getId(p),{clientX:I,clientY:$}=_;H(e)({type:he[m],id:b,x:I,y:$,...h!==null&&{pointerType:h}})};return Object.keys(he).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&c[d]!==!1).forEach(d=>{let f=It(d);const p=l(d);if(window.PointerEvent)switch(he[d]){case he.MouseDown:case he.MouseUp:f=f.replace("mouse","pointer");break;case he.TouchStart:case he.TouchEnd:return}a.push(me(f,p,t))}),H(()=>{a.forEach(d=>d())})}function gc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=H(nn(H(a=>{const u=gn(a);if(!u||we(u,r,s,i,!0))return;const l=n.getId(u);if(u===t&&t.defaultView){const d=ic(t.defaultView);e({id:l,x:d.left,y:d.top})}else e({id:l,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return me("scroll",c,t)}function qm({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=H(nn(H(()=>{const i=oc(),o=ac();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return me("resize",s,t)}const jm=["INPUT","TEXTAREA","SELECT"],io=new WeakMap;function Gm({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:l,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function _(g){let w=gn(g);const J=g.isTrusted,E=w&&ss(w.tagName);if(E==="OPTION"&&(w=w.parentElement),!w||!E||jm.indexOf(E)<0||we(w,r,s,i,!0))return;const R=w;if(R.classList.contains(o)||c&&R.matches(c))return;const U=Ws(w);let z=Xn(R,E,U),L=!1;const ce=dr({maskInputOptions:a,tagName:E,type:U}),K=Rt(w,f,h,p,m,ce);(U==="radio"||U==="checkbox")&&(L=w.checked),z=en({isMasked:K,element:w,value:z,maskInputFn:u}),b(w,d?{text:z,isChecked:L,userTriggered:J}:{text:z,isChecked:L});const ee=w.name;U==="radio"&&ee&&L&&t.querySelectorAll(`input[type="radio"][name="${ee}"]`).forEach(S=>{if(S!==w){const V=en({isMasked:K,element:S,value:Xn(S,E,U),maskInputFn:u});b(S,d?{text:V,isChecked:!L,userTriggered:!1}:{text:V,isChecked:!L})}})}function b(g,w){const J=io.get(g);if(!J||J.text!==w.text||J.isChecked!==w.isChecked){io.set(g,w);const E=n.getId(g);H(e)({...w,id:E})}}const $=(l.input==="last"?["change"]:["input","change"]).map(g=>me(g,H(_),t)),D=t.defaultView;if(!D)return()=>{$.forEach(g=>g())};const G=D.Object.getOwnPropertyDescriptor(D.HTMLInputElement.prototype,"value"),N=[[D.HTMLInputElement.prototype,"value"],[D.HTMLInputElement.prototype,"checked"],[D.HTMLSelectElement.prototype,"value"],[D.HTMLTextAreaElement.prototype,"value"],[D.HTMLSelectElement.prototype,"selectedIndex"],[D.HTMLOptionElement.prototype,"selected"]];return G&&G.set&&$.push(...N.map(g=>sc(g[0],g[1],{set(){H(_)({target:this,isTrusted:!1})}},!1,D))),H(()=>{$.forEach(g=>g())})}function Zn(e){const t=[];function n(r,s){if(Rn("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Rn("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Rn("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Rn("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 Ue(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Vm({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:H((l,d,f)=>{const[p,h]=f,{id:m,styleId:_}=Ue(d,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,adds:[{rule:p,index:h}]}),l.apply(d,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:H((l,d,f)=>{const[p]=f,{id:h,styleId:m}=Ue(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),l.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:H((l,d,f)=>{const[p]=f,{id:h,styleId:m}=Ue(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),l.apply(d,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:H((l,d,f)=>{const[p]=f,{id:h,styleId:m}=Ue(d,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),l.apply(d,f)})}));const a={};kn("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(kn("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),kn("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),kn("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([l,d])=>{u[l]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[l].insertRule,{apply:H((f,p,h)=>{const[m,_]=h,{id:b,styleId:I}=Ue(p.parentStyleSheet,t,n.styleMirror);return(b&&b!==-1||I&&I!==-1)&&e({id:b,styleId:I,adds:[{rule:m,index:[...Zn(p),_||0]}]}),f.apply(p,h)})}),d.prototype.deleteRule=new Proxy(u[l].deleteRule,{apply:H((f,p,h)=>{const[m]=h,{id:_,styleId:b}=Ue(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||b&&b!==-1)&&e({id:_,styleId:b,removes:[{index:[...Zn(p),m]}]}),f.apply(p,h)})})}),H(()=>{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(([l,d])=>{d.prototype.insertRule=u[l].insertRule,d.prototype.deleteRule=u[l].deleteRule})})}function _c({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"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=s?.prototype?Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(o){const c=i.set?.call(this,o);if(r!==null&&r!==-1)try{t.adoptStyleSheets(o,r)}catch{}return c}}),H(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Ym({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:H((c,a,u)=>{const[l,d,f]=u;if(n.has(l))return i.apply(a,[l,d,f]);const{id:p,styleId:h}=Ue(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:l,value:d,priority:f},index:Zn(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:H((c,a,u)=>{const[l]=u;if(n.has(l))return o.apply(a,[l]);const{id:d,styleId:f}=Ue(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,remove:{property:l},index:Zn(a.parentRule)}),c.apply(a,u)})}),H(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Km({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=H(u=>nn(H(l=>{const d=gn(l);if(!d||we(d,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=d;e({type:u,id:s.getId(d),currentTime:f,volume:p,muted:h,playbackRate:m})}),i.media||500)),a=[me("play",c(mt.Play),o),me("pause",c(mt.Pause),o),me("seeked",c(mt.Seeked),o),me("volumechange",c(mt.VolumeChange),o),me("ratechange",c(mt.RateChange),o)];return H(()=>{a.forEach(u=>u())})}function Xm({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,l){const d=new i(a,u,l);return s.set(d,{family:a,buffer:typeof u!="string",descriptors:l,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};const o=qs(t.fonts,"add",function(c){return function(a){return pr(H(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),H(()=>{r.forEach(c=>c())})}function Jm(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=H(()=>{const u=t.getSelection();if(!u||c&&u?.isCollapsed)return;c=u.isCollapsed||!1;const l=[],d=u.rangeCount||0;for(let f=0;f{}:qs(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function Zm(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=mc(e,e.doc));const s=Wm(e),i=zm(e),o=gc(e),c=qm(e,{win:n}),a=Gm(e),u=Km(e);let l=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(l=Vm(e,{win:n}),d=_c(e,e.doc),f=Ym(e,{win:n}),e.collectFonts&&(p=Xm(e)));const h=Jm(e),m=Qm(e),_=[];for(const b of e.plugins)_.push(b.observer(b.callback,n,b.options));return H(()=>{St.forEach(b=>b.reset()),r?.disconnect(),s(),i(),o(),c(),a(),u(),l(),d(),f(),p(),h(),m(),_.forEach(b=>b())})}function Rn(e){return typeof window[e]<"u"}function kn(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class us{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}}class eg{constructor(){this.crossOriginIframeMirror=new us(zs),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class tg{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new us(zs),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new us(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}),this.recordCrossOriginIframes&&t.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);const r=Gs(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}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 O.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:O.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case O.Meta:case O.Load:case O.DomContentLoaded:return!1;case O.Plugin:return n;case O.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case O.IncrementalSnapshot:switch(n.data.source){case x.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 x.Drag:case x.TouchMove:case x.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(n.data,t,["id"]),n;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case x.Font:return n;case x.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case x.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,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!==ae.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class ng{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class rg{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(!Vt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=mc({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(gc({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),pr(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(_c({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Gs(t),r=Pm(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(qs(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&pc(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Cn=0;Cn({rule:Xa(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 og{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,Lm(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let ie,er;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const xe=sm();function Fe(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:u=!1,maskTextClass:l="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:b,maskAttributeFn:I,maskInputFn:$,maskTextFn:D,maxCanvasSize:G=null,packFn:N,sampling:g={},dataURLOptions:w={},mousemoveWait:J,recordDOM:E=!0,recordCanvas:R=!1,recordCrossOriginIframes:U=!1,recordAfter:z=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:ce=!1,inlineImages:K=!1,plugins:ee,keepIframeSrcFn:S=()=>!1,ignoreCSSAttributes:V=new Set([]),errorHandler:T,onMutation:X,getCanvasManager:te}=e;Hm(T);const se=U?window.parent===window:!0;let be=!1;if(!se)try{window.parent.document&&(be=!1)}catch{be=!0}if(se&&!t)throw new Error("emit function is required");if(!se&&!be)return()=>{};J!==void 0&&g.mousemove===void 0&&(g.mousemove=J),xe.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}:_!==void 0?_:{},ut=b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:b==="all",headMetaDescKeywords:b==="all"}:b||{};xm();let Le,lt=0;const yn=q=>{for(const Me of ee||[])Me.eventProcessor&&(q=Me.eventProcessor(q));return N&&!be&&(q=N(q)),q};ie=(q,Me)=>{const F=q;if(F.timestamp=Qn(),St[0]?.isFrozen()&&F.type!==O.FullSnapshot&&!(F.type===O.IncrementalSnapshot&&F.data.source===x.Mutation)&&St.forEach(ue=>ue.unfreeze()),se)t?.(yn(F),Me);else if(be){const ue={type:"rrweb",event:yn(F),origin:window.location.origin,isCheckout:Me};window.parent.postMessage(ue,"*")}if(F.type===O.FullSnapshot)Le=F,lt=0;else if(F.type===O.IncrementalSnapshot){if(F.data.source===x.Mutation&&F.data.isAttachIframe)return;lt++;const ue=r&<>=r,j=n&&Le&&F.timestamp-Le.timestamp>n;(ue||j)&&Sr(!0)}};const Lt=q=>{ie({type:O.IncrementalSnapshot,data:{source:x.Mutation,...q}})},ti=q=>ie({type:O.IncrementalSnapshot,data:{source:x.Scroll,...q}}),qc=q=>ie({type:O.IncrementalSnapshot,data:{source:x.CanvasMutation,...q}}),jc=q=>ie({type:O.IncrementalSnapshot,data:{source:x.AdoptedStyleSheet,...q}}),Qe=new ig({mutationCb:Lt,adoptedStyleSheetCb:jc}),Ze=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new eg:new tg({mirror:xe,mutationCb:Lt,stylesheetManager:Qe,recordCrossOriginIframes:U,wrappedEmit:ie});for(const q of ee||[])q.getMirror&&q.getMirror({nodeMirror:xe,crossOriginIframeMirror:Ze.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ze.crossOriginIframeStyleMirror});const _r=new og,yr=cg(te,{mirror:xe,win:window,mutationCb:q=>ie({type:O.IncrementalSnapshot,data:{source:x.CanvasMutation,...q}}),recordCanvas:R,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:G,sampling:g.canvas,dataURLOptions:w,errorHandler:T}),Sn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new ng:new rg({mutationCb:Lt,scrollCb:ti,bypassOptions:{onMutation:X,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:ve,dataURLOptions:w,maskAttributeFn:I,maskTextFn:D,maskInputFn:$,recordCanvas:R,inlineImages:K,sampling:g,slimDOMOptions:ut,iframeManager:Ze,stylesheetManager:Qe,canvasManager:yr,keepIframeSrcFn:S,processedNodeManager:_r,ignoreCSSAttributes:V},mirror:xe}),Sr=(q=!1)=>{if(!E)return;ie({type:O.Meta,data:{href:window.location.href,width:ac(),height:oc()}},q),Qe.reset(),Sn.init(),St.forEach(F=>F.lock());const Me=Cm(document,{mirror:xe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:ve,maskAttributeFn:I,maskInputFn:$,maskTextFn:D,slimDOM:ut,dataURLOptions:w,recordCanvas:R,inlineImages:K,onSerialize:F=>{lc(F,xe)&&Ze.addIframe(F),dc(F,xe)&&Qe.trackLinkElement(F),as(F)&&Sn.addShadowRoot(F.shadowRoot,document)},onIframeLoad:(F,ue)=>{Ze.attachIframe(F,ue),F.contentWindow&&yr.addWindow(F.contentWindow),Sn.observeAttachShadow(F)},onStylesheetLoad:(F,ue)=>{Qe.attachLinkElement(F,ue)},onBlockedImageLoad:(F,ue,{width:j,height:Dt})=>{Lt({adds:[],removes:[],texts:[],attributes:[{id:ue.id,attributes:{style:{width:`${j}px`,height:`${Dt}px`}}}]})},keepIframeSrcFn:S,ignoreCSSAttributes:V});if(!Me)return console.warn("Failed to snapshot the document");ie({type:O.FullSnapshot,data:{node:Me,initialOffset:ic(window)}}),St.forEach(F=>F.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Qe.adoptStyleSheets(document.adoptedStyleSheets,xe.getId(document))};er=Sr;try{const q=[],Me=ue=>H(Zm)({onMutation:X,mutationCb:Lt,mousemoveCb:(j,Dt)=>ie({type:O.IncrementalSnapshot,data:{source:Dt,positions:j}}),mouseInteractionCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.MouseInteraction,...j}}),scrollCb:ti,viewportResizeCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.ViewportResize,...j}}),inputCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.Input,...j}}),mediaInteractionCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.MediaInteraction,...j}}),styleSheetRuleCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.StyleSheetRule,...j}}),styleDeclarationCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.StyleDeclaration,...j}}),canvasMutationCb:qc,fontCb:j=>ie({type:O.IncrementalSnapshot,data:{source:x.Font,...j}}),selectionCb:j=>{ie({type:O.IncrementalSnapshot,data:{source:x.Selection,...j}})},customElementCb:j=>{ie({type:O.IncrementalSnapshot,data:{source:x.CustomElement,...j}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:l,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:ve,inlineStylesheet:h,sampling:g,recordDOM:E,recordCanvas:R,inlineImages:K,userTriggeredOnInput:L,collectFonts:ce,doc:ue,maskAttributeFn:I,maskInputFn:$,maskTextFn:D,keepIframeSrcFn:S,blockSelector:i,unblockSelector:o,slimDOMOptions:ut,dataURLOptions:w,mirror:xe,iframeManager:Ze,stylesheetManager:Qe,shadowDomManager:Sn,processedNodeManager:_r,canvasManager:yr,ignoreCSSAttributes:V,plugins:ee?.filter(j=>j.observer)?.map(j=>({observer:j.observer,options:j.options,callback:Dt=>ie({type:O.Plugin,data:{plugin:j.name,payload:Dt}})}))||[]},{});Ze.addLoadListener(ue=>{try{q.push(Me(ue.contentDocument))}catch(j){console.warn(j)}});const F=()=>{Sr(),q.push(Me(document))};return document.readyState==="interactive"||document.readyState==="complete"?F():(q.push(me("DOMContentLoaded",()=>{ie({type:O.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&F()})),q.push(me("load",()=>{ie({type:O.Load,data:{}}),z==="load"&&F()},window))),()=>{q.forEach(ue=>ue()),_r.destroy(),er=void 0,$m()}}catch(q){console.warn(q)}}function ag(e){if(!er)throw new Error("please take full snapshot after start recording");er(e)}Fe.mirror=xe;Fe.takeFullSnapshot=ag;function cg(e,t){try{return e?e(t):new ao}catch{return console.warn("Unable to initialize CanvasManager"),new ao}}var co;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(co||(co={}));const ug=3,lg=5;function Vs(e){return e>9999999999?e:e*1e3}function Nr(e){return e>9999999999?e/1e3:e}function _n(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:O.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:hs(t,10,1e3)}}),t.category==="console")))}const dg="button,a";function yc(e){return e.closest(dg)||e}function Sc(e){const t=Ec(e);return!t||!(t instanceof Element)?t:yc(t)}function Ec(e){return fg(e)?e.target:e}function fg(e){return typeof e=="object"&&!!e&&"target"in e}let He;function pg(e){return He||(He=[],hg()),He.push(e),()=>{const t=He?He.indexOf(e):-1;t>-1&&He.splice(t,1)}}function hg(){Se(Z,"open",function(e){return function(...t){if(He)try{He.forEach(n=>n())}catch{}return e.apply(Z,t)}})}const mg=new Set([x.Mutation,x.StyleSheetRule,x.StyleDeclaration,x.AdoptedStyleSheet,x.CanvasMutation,x.Selection,x.MediaInteraction]);function gg(e,t,n){e.handleClick(t,n)}class _g{constructor(t,n,r=_n){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=pg(()=>{this._lastMutation=uo()});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(Sg(n,this._ignoreSelector)||!Eg(t))return;const r={timestamp:Nr(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=Nr(t)}registerScroll(t=Date.now()){this._lastScroll=Nr(t)}registerClick(t){const n=yc(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=uo();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._scrollTimeout,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,u=a1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:Z.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=mn(()=>this._checkClicks(),1e3)}}const yg=["A","BUTTON","INPUT"];function Sg(e,t){return!!(!yg.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 Eg(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function uo(){return Date.now()/1e3}function bg(e,t){try{if(!vg(t))return;const{source:n}=t.data;if(mg.has(n)&&e.registerMutation(t.timestamp),n===x.Scroll&&e.registerScroll(t.timestamp),Tg(t)){const{type:r,id:s}=t.data,i=Fe.mirror.getNode(s);i instanceof HTMLElement&&r===he.Click&&e.registerClick(i)}}catch{}}function vg(e){return e.type===ug}function Tg(e){return e.data.source===x.MouseInteraction}function Ne(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Ys=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ys||{});const wg=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Ig(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(wg.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const Rg=e=>t=>{if(!e.isEnabled())return;const n=kg(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&s?.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&gg(e.clickDetector,n,Sc(t.event)),_n(e,n)};function bc(e,t){const n=Fe.mirror.getId(e),r=n&&Fe.mirror.getNode(n),s=r&&Fe.mirror.getMeta(r),i=s&&Mg(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===Ys.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Ig(i.attributes)}}:{}}}function kg(e){const{target:t,message:n}=Cg(e);return Ne({category:`ui.${e.name}`,...bc(t,n)})}function Cg(e){const t=e.name==="click";let n,r=null;try{r=t?Sc(e.event):Ec(e.event),n=Ie(r,{maxStringLength:200})||""}catch{n=""}return{target:r,message:n}}function Mg(e){return e.type===Ys.Element}function xg(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=Ag(t);n&&_n(e,n)}function Ag(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||Ng(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=Ie(o,{maxStringLength:200})||"",l=bc(o,u);return Ne({category:"ui.keyDown",message:u,data:{...l.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function Ng(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const Og={resource:Bg,paint:Pg,navigation:Fg};function Or(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function Lg(e){return e.map(Dg).filter(Boolean)}function Dg(e){const t=Og[e.entryType];return t?t(e):null}function kt(e){return((Ee()||Z.performance.timeOrigin)+e)/1e3}function Pg(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=kt(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function Fg(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:l,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:kt(p),end:kt(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:l,loadEventEnd:d,domComplete:i,redirectCount:f}}}function Bg(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:kt(i),end:kt(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function Ug(e){const t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Ks(e,"largest-contentful-paint",n)}function Hg(e){return e.sources!==void 0}function $g(e){const t=[],n=[];for(const r of e.entries)if(Hg(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Fe.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return Ks(e,"cumulative-layout-shift",n,t)}function Wg(e){const t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Ks(e,"interaction-to-next-paint",n)}function Ks(e,t,n,r){const s=e.value,i=e.rating,o=kt(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Fe.mirror.getId(c)):void 0,attributions:r}}}function zg(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(at(s,n))}),r.push(Fs(Or(Ug,e)),Ps(Or($g,e)),Da(Or(Wg,e))),()=>{r.forEach(s=>s())}}const k=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,qg='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]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<>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,s=0,a=new n(r);s>f]=l}else for(o=new n(i),s=0;s>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(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},_=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},x=function(r,e){for(var i=[],s=0;sd&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<e))break;w+=m-(1<>=y;w>0;){var M=o[s].s;p[M]=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(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,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+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+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B255){_(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;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=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,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a>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(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),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(s[j+Q]==s[j+Q-W]){for(var $=0;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,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 s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),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(s),32768),this.s.z=n.length-s+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.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!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>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.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)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}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.prototype.flush=function(){j.prototype.flush.call(this)},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(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;oi.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}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(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;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 jg(){const e=new Blob([qg]);return URL.createObjectURL(e)}const lo=["log","warn","error"],Un="[Replay] ";function Lr(e,t="info"){Ve({category:"console",data:{logger:"replay"},level:t,message:`${Un}${e}`},{level:t})}function Gg(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return k?(lo.forEach(r=>{n[r]=(...s)=>{y[r](Un,...s),t&&Lr(s.join(""),ya(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),y.error(Un,r),e?bs(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Lr(r,"error")},n.infoTick=(...r)=>{y.log(Un,...r),t&&setTimeout(()=>Lr(r[0]),0)}):lo.forEach(r=>{n[r]=()=>{}}),n}const C=Gg();class Xs extends Error{constructor(){super(`Event buffer exceeded maximum size of ${$s}.`)}}class vc{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!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>$s)throw new Xs;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?Vs(t):null}}class Vg{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():(k&&C.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{k&&C.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){k&&C.log("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){k&&C.error("Error in compression worker: ",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 Yg{constructor(t){this._worker=new Vg(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=Vs(t.timestamp);(!this._earliestTimestamp||n$s?Promise.reject(new Xs):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{k&&C.exception(t,'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 Kg{constructor(t){this._fallback=new vc,this._compression=new Yg(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}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}set waitForCheckout(t){this._used.waitForCheckout=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(t){k&&C.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){k&&C.exception(i,"Failed to add events when switching buffers.")}}}function Xg({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=Jg(t);if(n)return n}return k&&C.log("Using simple buffer"),new vc}function Jg(e){try{const t=e||Qg();if(!t)return;k&&C.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Kg(n)}catch(t){k&&C.exception(t,"Failed to create compression worker")}}function Qg(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?jg():""}function Js(){try{return"sessionStorage"in Z&&!!Z.sessionStorage}catch{return!1}}function Zg(e){e_(),e.session=void 0}function e_(){if(Js())try{Z.sessionStorage.removeItem(Us)}catch{}}function Tc(e){return e===void 0?!1:Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(k&&C.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function i_(e,t){try{if(typeof t=="function"&&r_(e))return t(e)}catch(n){return k&&C.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Zs(e){return!e.type}function ds(e){return e.type==="transaction"}function o_(e){return e.type==="replay_event"}function po(e){return e.type==="feedback"}function a_(e){return(t,n)=>{if(!e.isEnabled()||!Zs(t)&&!ds(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(ds(t)){c_(e,t);return}u_(e,t)}}}function c_(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function u_(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)||mn(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function l_(e){return t=>{!e.isEnabled()||!Zs(t)||d_(e,t)}}function d_(e,t){const n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Ne({category:"replay.hydrate-error",data:{url:xt()}});_n(e,r)}}function f_(e){const t=P();t&&t.on("beforeAddBreadcrumb",n=>p_(e,n))}function p_(e,t){if(!e.isEnabled()||!Mc(t))return;const n=h_(t);n&&_n(e,n)}function h_(e){return!Mc(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?m_(e):Ne(e)}function m_(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return Ne(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>In?(n=!0,`${s.slice(0,In)}…`):s;if(typeof s=="object")try{const i=hs(s,7);return JSON.stringify(i).length>In?(n=!0,`${JSON.stringify(i,null,2).slice(0,In)}…`):i}catch{}return s});return Ne({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Mc(e){return!!e.category}function g_(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function xc(){const e=re().getPropagationContext().dsc;e&&delete e.replay_id;const t=pe();if(t){const n=je(t);delete n.replay_id}}function __(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:O.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 y_(e,t){return e.recordingMode!=="buffer"||t.message===Hs||!t.exception||t.type?!1:Tc(e.getOptions().errorSampleRate)}function S_(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(o_(t))return delete t.breadcrumbs,t;if(!Zs(t)&&!ds(t)&&!po(t))return t;if(!e.checkAndHandleExpiredSession())return xc(),t;if(po(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),__(e,t),t;if(g_(t,n)&&!e.getOptions()._experiments.captureExceptions)return k&&C.log("Ignoring error from rrweb internals",t),null;const s=y_(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const o=e.session;o.dirty=!0,e.getOptions().stickySession&&hr(o)}return t},{id:"Replay"})}function mr(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:O.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 E_(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 b_(e){return t=>{if(!e.isEnabled())return;const n=E_(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(mr(e,[n]),!1)))}}function v_(e,t){return k&&e.getOptions()._experiments.traceInternals?!1:nd(t,P())}function Ac(e,t){e.isEnabled()&&t!==null&&(v_(e,t.name)||e.addUpdate(()=>(mr(e,[t]),!0)))}function gr(e){if(!e)return;const t=new TextEncoder;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=qa(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Nc(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function tr(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 Oc(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:{method:i,statusCode:o,request:c,response:a}}}function rn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function ze(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}=T_(n);return r.body=s,i?.length&&(r._meta={warnings:i}),r}function fs(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function T_(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Gi,n=w_(e);if(t){const r=e.slice(0,Gi);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 w_(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function nr(e,t){const n=I_(e);return Pe(n,t)}function I_(e,t=Z.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Z.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 R_(e,t,n){try{const r=await C_(e,t,n),s=Oc("resource.fetch",r);Ac(n.replay,s)}catch(r){k&&C.exception(r,"Failed to capture fetch breadcrumb")}}function k_(e,t){const{input:n,response:r}=t,s=n?Ga(n):void 0,i=gr(s),o=r?Nc(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function C_(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:u,response_body_size:l}=e.data,d=nr(o,n.networkDetailAllowUrls)&&!nr(o,n.networkDetailDenyUrls),f=d?M_(n,t.input,u):rn(u),p=await x_(d,n,t.response,l);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function M_({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?O_(n,t):{};if(!e)return ze(s,r,void 0);const i=Ga(n),[o,c]=ja(i,C),a=ze(s,r,o);return c?tr(a,c):a}async function x_(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return rn(s);const i=r?Lc(r.headers,n):{};if(!r||!t&&s!==void 0)return ze(i,s,void 0);const[o,c]=await N_(r),a=A_(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?tr(a,c):a}function A_(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e?.length&&n===void 0?gr(e):n;return r?t?ze(s,i,e):ze(s,i,void 0):rn(i)}catch(i){return k&&C.exception(i,"Failed to serialize response body"),ze(s,n,void 0)}}async function N_(e){const t=L_(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await D_(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(k&&C.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(k&&C.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function Lc(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function O_(e,t){return e.length===1&&typeof e[0]!="string"?ho(e[0],t):e.length===2?ho(e[1],t):{}}function ho(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Lc(n,t):Array.isArray(n)?{}:fs(n,t):{}}function L_(e){try{return e.clone()}catch(t){k&&C.exception(t,"Failed to clone response body")}}function D_(e){return new Promise((t,n)=>{const r=mn(()=>n(new Error("Timeout while trying to read response body")),500);P_(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function P_(e){return await e.text()}async function F_(e,t,n){try{const r=U_(e,t,n),s=Oc("resource.xhr",r);Ac(n.replay,s)}catch(r){k&&C.exception(r,"Failed to capture xhr breadcrumb")}}function B_(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=gr(r),i=n.getResponseHeader("content-length")?Nc(n.getResponseHeader("content-length")):W_(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function U_(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:l=0,request_body_size:d,response_body_size:f}=e.data;if(!a)return null;if(!c||!nr(a,n.networkDetailAllowUrls)||nr(a,n.networkDetailDenyUrls)){const N=rn(d),g=rn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:l,request:N,response:g}}const p=c[rt],h=p?fs(p.request_headers,n.networkRequestHeaders):{},m=fs(Va(c),n.networkResponseHeaders),[_,b]=n.networkCaptureBodies?ja(o,C):[void 0],[I,$]=n.networkCaptureBodies?H_(c):[void 0],D=ze(h,d,_),G=ze(m,f,I);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:l,request:b?tr(D,b):D,response:$?tr(G,$):G}}function H_(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return $_(e.response,e.responseType)}catch(n){t.push(n)}return k&&C.warn("Failed to get xhr response body",...t),[void 0]}function $_(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(n){return k&&C.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return k&&C.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function W_(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return gr(n)}catch{return}}function z_(e){const t=P();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>q_(c,a,u))}catch{}}function q_(e,t,n){if(t.data)try{j_(t)&&V_(n)&&(B_(t,n),F_(t,n,e)),G_(t)&&Y_(n)&&(k_(t,n),R_(t,n,e))}catch(r){k&&C.exception(r,"Error when enriching network breadcrumb")}}function j_(e){return e.category==="xhr"}function G_(e){return e.category==="fetch"}function V_(e){return e?.xhr}function Y_(e){return e?.response}function K_(e){const t=P();$a(Rg(e)),lr(b_(e)),f_(e),z_(e);const n=S_(e);Du(n),t&&(t.on("beforeSendEvent",l_(e)),t.on("afterSendEvent",a_(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{const i=e.getSessionId();s?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function X_(e){try{return Promise.all(mr(e,[J_(Z.performance.memory)]))}catch{return[]}}function J_(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 Q_(e,t,n){return cd(e,t,{...n,setTimeoutImpl:mn})}const Mn=ne.navigator;function Z_(){return/iPhone|iPad|iPod/i.test(Mn?.userAgent??"")||/Macintosh/i.test(Mn?.userAgent??"")&&Mn?.maxTouchPoints&&Mn?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function ey(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){k&&C.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&bg(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Qs(e,n,s))return!0;if(!s)return!1;const i=e.session;if(ny(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(k&&C.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&hr(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function ty(e){const t=e.getOptions();return{type:O.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 ny(e,t){!t||!e.session||e.session.segmentId!==0||Qs(e,ty(e),!1)}function ry(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function sy(e,t,n,r){return Je(Xo(e,Ts(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function iy({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 oy({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("preprocessEvent",r,i);const o=await $o(e.getOptions(),r,i,t,e,ct());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:l}=c?.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:l},o}async function ay({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=iy({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:l}=r,d=P(),f=re(),p=d?.getTransport(),h=d?.getDsn();if(!d||!p||!h||!i.sampled)return Promise.resolve({});const m={type:Fh,replay_start_timestamp:l/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await oy({scope:f,client:d,replayId:t,event:m});if(!_)return d.recordDroppedEvent("event_processor","replay"),k&&C.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const b=sy(_,o,h,d.getOptions().tunnel);let I;try{I=await p.send(b)}catch(D){const G=new Error(Hs);try{G.cause=D}catch{}throw G}const $=ca({},I);if(aa($,"replay"))throw new ei($);if(typeof I.statusCode=="number"&&(I.statusCode<200||I.statusCode>=300))throw new Dc(I.statusCode);return I}class Dc extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class ei extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class mo extends Error{constructor(){super("Session is too long, not sending replay")}}async function Pc(e,t={count:0,interval:zh}){const{recordingData:n,onError:r}=e;if(n.length)try{return await ay(e),!0}catch(s){if(s instanceof Dc||s instanceof ei)throw s;if(Pu("Replays",{_retryCount:t.count}),r&&r(s),t.count>=qh){const i=new Error(`${Hs} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{mn(async()=>{try{await Pc(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const Fc="__THROTTLED",cy="__SKIPPED";function uy(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,l)=>{l[...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 l=o;return o=!0,l?cy:Fc}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class ly{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Bh,sessionIdleExpire:Uh},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!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=Q_(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=uy((o,c)=>s_(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(jh,r),timeout:r,scrollTimeout:Gh,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new _g(this,i)),k){const o=t._experiments;C.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{Z.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Ne({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Ne({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{xg(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){k&&C.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){k&&C.exception(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",k&&C.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){k&&C.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){k&&C.log("Buffering is in progress, call `flush()` to save the replay");return}k&&C.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Dr({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){k&&C.log("Buffering is in progress, call `flush()` to save the replay");return}k&&C.infoTick("Starting replay in buffer mode");const t=Dr({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=Fe({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:Wh}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:ey(this),...Z_(),onMutation:this._onMutationHandler.bind(this),...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,this.recordingMode="buffer";try{k&&C.log(`Stopping Replay${n?` triggered by ${n}`:""}`),xc(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Zg(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),k&&C.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),k&&C.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();k&&C.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||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(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ls(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${Z.location.pathname}${Z.location.hash}${Z.location.search}`,n=`${Z.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===Fc){const s=Ne({category:"replay.throttled"});this.addUpdate(()=>!Qs(this,{type:lg,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||pe(),n=t&&ge(t),s=(n&&W(n).data||{})[fe];if(!(!n||!s||!["route","custom"].includes(s)))return W(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Xg({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Dr({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,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 Rc(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{Z.document.addEventListener("visibilitychange",this._handleVisibilityChange),Z.addEventListener("blur",this._handleWindowBlur),Z.addEventListener("focus",this._handleWindowFocus),Z.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(K_(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=zg(this)}_removeListeners(){try{Z.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Z.removeEventListener("blur",this._handleWindowBlur),Z.removeEventListener("focus",this._handleWindowFocus),Z.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||Ic(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()){k&&C.log("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:O.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=Lg(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(mr(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&rthis._options.maxReplayDuration+3e4)throw new mo;const r=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Pc({replayId:t,recordingData:i,segmentId:s,eventContext:r,session:this.session,timestamp:n,onError:o=>this.handleException(o)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=P();if(r){let s;n instanceof ei?s="ratelimit_backoff":n instanceof mo?s="invalid":s="send_error",r.recordDroppedEvent(s,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){k&&C.error("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=sthis._options.maxReplayDuration+5e3;if(i||o){k&&C.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&k&&C.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&hr(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(c=>{const a=ry(c.target),u=n.join(",");return a?.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=Ne({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function Pt(e,t){return[...e,...t].join(",")}function dy({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=Pt(e,[".sentry-mask","[data-sentry-mask]"]),c=Pt(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:Pt(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Pt(r,[]),ignoreSelector:Pt(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function fy({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 go='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',py=["content-length","content-type","accept"],hy=Symbol.for("sentry__originalRequestBody");let _o=!1,yo=!1;function my(){if(typeof Request>"u"||yo)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return r?.body!=null&&(s[hy]=r.body),s};t.prototype=e.prototype,ne.Request=t,yo=!0}catch{}}const gy=(e=>new _y(e));class _y{constructor({flushMinDelay:t=Hh,flushMaxDelay:n=$h,minReplayDuration:r=Vh,maxReplayDuration:s=Vi,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:l=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:b=[],networkCaptureBodies:I=!0,networkRequestHeaders:$=[],networkResponseHeaders:D=[],mask:G=[],maskAttributes:N=["title","placeholder","aria-label"],unmask:g=[],block:w=[],unblock:J=[],ignore:E=[],maskFn:R,beforeAddRecordingEvent:U,beforeErrorSampling:z,onError:L,attachRawBodyFromRequest:ce=!1}={}){this.name="Replay";const K=dy({mask:G,unmask:g,block:w,unblock:J,ignore:E});if(this._recordingOptions={maskAllInputs:l,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:R,maskInputFn:R,maskAttributeFn:(ee,S,V)=>fy({maskAttributes:N,maskAllText:u,privacyOptions:K,key:ee,value:S,el:V}),...K,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:ee=>{try{ee.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,Yh),maxReplayDuration:Math.min(s,Vi),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:d,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:_,networkDetailDenyUrls:b,networkCaptureBodies:I,networkRequestHeaders:So($),networkResponseHeaders:So(D),beforeAddRecordingEvent:U,beforeErrorSampling:z,onError:L,attachRawBodyFromRequest:ce,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${go}`:go,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Kr())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return _o}set _isInitialized(t){_o=t}afterAllSetup(t){!Kr()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&my(),this._setup(t),this._initialize(t))}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()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=yy(this._initialOptions,t);this._replay=new ly({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function yy(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=Xt(n.replaysSessionSampleRate),i=Xt(n.replaysOnErrorSampleRate);return s==null&&i==null&&cn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function So(e){return[...py,...e.map(t=>t.toLowerCase())]}function Sy(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Bc(e){try{return new URL(e,B.location.origin).href}catch{return}}function Ey(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Uc(e){try{return new Headers(e)}catch{return}}const Eo=new WeakMap,Pr=new Map,Hc={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function by(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...Hc,...t},l=typeof i=="function"?i:h=>!0,d=h=>vy(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(m=>{if(m.op==="http.client"){const _=Pr.get(m.span_id);_&&(m.timestamp=_/1e3,Pr.delete(m.span_id))}}),h)),s&&jd(h=>{if(h.response){const m=Eo.get(h.response);m&&h.endTimestamp&&Pr.set(m,h.endTimestamp)}}),va(h=>{const m=Pd(h,l,d,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&Eo.set(h.response,h.fetchData.__span),m){const _=Bc(h.fetchData.url),b=_?it(_).host:void 0;m.setAttributes({"http.url":_?$e(_):void 0,"server.address":b}),o&&bo(m),a?.(m,{headers:h.headers})}})),r&&za(h=>{const m=Ty(h,l,d,f,p,u);m&&(o&&bo(m),a?.(m,{headers:Uc(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}function bo(e){const{url:t}=W(e).data;if(!t||typeof t!="string")return;const n=at("resource",({entries:r})=>{r.forEach(s=>{Ey(s)&&s.name.endsWith(t)&&(e.setAttributes(Ha(s)),setTimeout(n))})})}function vy(e,t){const n=xt();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?Pe(r.toString(),t)||i&&Pe(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?Pe(e,t):r}}function Ty(e,t,n,r,s,i){const o=e.xhr,c=o?.[rt];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,l=Oe()&&t(a);if(e.endTimestamp){const b=o.__sentry_xhr_span_id__;if(!b)return;const I=r[b];I&&(l&&c.status_code!==void 0&&(qo(I,c.status_code),I.end(),i?.(I,{headers:Uc(Va(o)),error:e.error})),delete r[b]);return}const d=Bc(a),f=it(d||a),p=$e(td(a)),h=!!pe(),m=l&&h?At({name:`${u} ${p}`,attributes:{url:$e(a),type:"xhr","http.method":u,"http.url":d?$e(d):void 0,"server.address":f?.host,[Y]:"auto.http.browser",[le]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new Ge;o.__sentry_xhr_span_id__=m.spanContext().spanId,r[o.__sentry_xhr_span_id__]=m,n(a)&&wy(o,Oe()&&h?m:void 0,s);const _=P();return _&&_.emit("beforeOutgoingRequestSpan",m,e),m}function wy(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=ga({span:t,propagateTraceparent:n});r&&Iy(e,r,s,i)}function Iy(e,t,n,r){const s=e.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!s?.traceparent&&e.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!Sy(i))&&e.setRequestHeader("baggage",n)}}catch{}}function Ry(){B.document?B.document.addEventListener("visibilitychange",()=>{const e=pe();if(!e)return;const t=ge(e);if(B.document.hidden&&t){const n="cancelled",{op:r,status:s}=W(t);Ce&&y.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:Te,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Ce&&y.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const ky=3600,$c="sentry_previous_trace",Cy="sentry.previous_trace";function My(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?Ny():void 0;e.on("spanStart",o=>{if(ge(o)!==o)return;const c=re().getPropagationContext();s=xy(s,o,c),r&&Ay(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=re(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(ps(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=ps(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[Fu]:s.sampleRate}})}function xy(e,t,n){const r=W(t);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[Bo])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=ky&&(Ce&&y.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Bu]:"previous_trace"}}),t.setAttribute(Cy,`${o.traceId}-${o.spanId}-${ps(o)?1:0}`)),i)}function Ay(e){try{B.sessionStorage.setItem($c,JSON.stringify(e))}catch(t){Ce&&y.warn("Could not store previous trace in sessionStorage",t)}}function Ny(){try{const e=B.sessionStorage?.getItem($c);return JSON.parse(e)}catch{return}}function ps(e){return e.traceFlags===1}const Oy="BrowserTracing",Ly={...On,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Hc},Dy=((e={})=>{const t={name:void 0,source:void 0},n=B.document,{enableInp:r,enableElementTiming:s,enableLongTask:i,enableLongAnimationFrame:o,_experiments:{enableInteractions:c,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:u},beforeStartSpan:l,idleTimeout:d,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:m,traceXHR:_,trackFetchStreamPerformance:b,shouldCreateSpanForRequest:I,enableHTTPTimings:$,ignoreResourceSpans:D,ignorePerformanceApiSpans:G,instrumentPageLoad:N,instrumentNavigation:g,detectRedirects:w,linkPreviousTrace:J,consistentTraceSampling:E,enableReportPageLoaded:R,onRequestSpanStart:U,onRequestSpanEnd:z}={...Ly,...e};let L,ce,K;function ee(S,V,T=!0){const X=V.op==="pageload",te=V.name,se=l?l(V):V,be=se.attributes||{};if(te!==se.name&&(be[fe]="custom",se.attributes=be),!T){const Le=or();At({...se,startTime:Le}).end(Le);return}t.name=se.name,t.source=be[fe];const ve=ta(se,{idleTimeout:d,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:X,beforeSpanEnd:Le=>{L?.(),np(Le,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:D,ignorePerformanceApiSpans:G}),wo(S,void 0);const lt=re(),yn=lt.getPropagationContext();lt.setPropagationContext({...yn,traceId:ve.spanContext().traceId,sampled:rr(ve),dsc:je(Le)}),X&&(K=void 0)},trimIdleSpanEndTimestamp:!R});X&&R&&(K=ve),wo(S,ve);function ut(){n&&["interactive","complete"].includes(n.readyState)&&S.emit("idleSpanEnableAutoFinish",ve)}X&&!R&&n&&(n.addEventListener("readystatechange",()=>{ut()}),ut())}return{name:Oy,setup(S){if(Yu(),L=Kf({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:S}),r&&Cp(),s&&hp(),o&&ne.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Jf():i&&Xf(),c&&Qf(),w&&n){const T=()=>{ce=_e()};addEventListener("click",T,{capture:!0}),addEventListener("keydown",T,{capture:!0,passive:!0})}function V(){const T=sn(S);T&&!W(T).timestamp&&(Ce&&y.log(`[Tracing] Finishing current active span with op: ${W(T).op}`),T.setAttribute(Jt,"cancelled"),T.end())}S.on("startNavigationSpan",(T,X)=>{if(P()!==S)return;if(X?.isRedirect){Ce&&y.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ee(S,{op:"navigation.redirect",...T},!1);return}ce=void 0,V(),ct().setPropagationContext({traceId:Hn(),sampleRand:Math.random(),propagationSpanId:Oe()?void 0:Ht()});const te=re();te.setPropagationContext({traceId:Hn(),sampleRand:Math.random(),propagationSpanId:Oe()?void 0:Ht()}),te.setSDKProcessingMetadata({normalizedRequest:void 0}),ee(S,{op:"navigation",...T,parentSpan:null,forceTransaction:!0})}),S.on("startPageLoadSpan",(T,X={})=>{if(P()!==S)return;V();const te=X.sentryTrace||vo("sentry-trace")||To("sentry-trace"),se=X.baggage||vo("baggage")||To("baggage"),be=Uu(te,se),ve=re();ve.setPropagationContext(be),Oe()||(ve.getPropagationContext().propagationSpanId=Ht()),ve.setSDKProcessingMetadata({normalizedRequest:xs()}),ee(S,{op:"pageload",...T})}),S.on("endPageloadSpan",()=>{R&&K&&(K.setAttribute(Jt,"reportPageLoaded"),K.end())})},afterAllSetup(S){let V=xt();if(J!=="off"&&My(S,{linkPreviousTrace:J,consistentTraceSampling:E}),B.location){if(N){const T=Ee();Py(S,{name:B.location.pathname,startTime:T?T/1e3:void 0,attributes:{[fe]:"url",[Y]:"auto.pageload.browser"}})}g&&lr(({to:T,from:X})=>{if(X===void 0&&V?.indexOf(T)!==-1){V=void 0;return}V=void 0;const te=Ms(T),se=sn(S),be=se&&w&&By(se,ce);Kt(S,{name:te?.pathname||B.location.pathname,attributes:{[fe]:"url",[Y]:"auto.navigation.browser"}},{url:T,isRedirect:be})})}h&&Ry(),c&&Fy(S,d,f,p,t),r&&Ap(),by(S,{traceFetch:m,traceXHR:_,trackFetchStreamPerformance:b,tracePropagationTargets:S.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:I,enableHTTPTimings:$,onRequestSpanStart:U,onRequestSpanEnd:z})}}});function Py(e,t,n){e.emit("startPageLoadSpan",t,n),re().setTransactionName(t.name);const r=sn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Kt(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=re();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...xs(),url:r}}),sn(e)}function vo(e){return B.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function To(e){return B.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function Fy(e,t,n,r,s){const i=B.document;let o;const c=()=>{const a="ui.action.click",u=sn(e);if(u){const l=W(u).op;if(["navigation","pageload"].includes(l)){Ce&&y.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Jt,"interactionInterrupted"),o.end(),o=void 0),!s.name){Ce&&y.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=ta({name:s.name,op:a,attributes:{[fe]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const Wc="_sentry_idleSpan";function sn(e){return e[Wc]}function wo(e,t){vt(e,Wc,t)}const Io=1.5;function By(e,t){const n=W(e),r=or(),s=n.start_timestamp;return!(r-s>Io||t&&r-t<=Io)}const Uy="BrowserTracing";function Hy(e){e.integrations&&Array.isArray(e.integrations)&&e.integrations.some(r=>r.name===Uy)&&cn(()=>{console.warn("browserTracingIntegration is not fully compatible with @sentry/react-router. Please use reactRouterTracingIntegration instead.")}),ma(e,"react-router",["react-router","browser"]);const t=Ph(e);return Hu("runtime","browser"),t}function Fr(e){try{return new URL(e.url).pathname}catch{try{return new URL(e.url,"http://example.com").pathname}catch(t){return qt&&y.warn("Failed to parse URL from request:",e.url,t),""}}}function Br(e){return e.pattern??e.unstable_pattern}function Ur(e){if(e)return e.startsWith("/")?e:`/${e}`}function Be(e,t,n,r){t&&bs(e.error,{mechanism:{type:n,handled:!1,data:r}})}const et=ne;let tt;const zc="__sentryReactRouterClientInstrumentationUsed",$y="__sentryReactRouterNavigateHookInvoked",Ro="__sentryReactRouterPopstateListenerAdded",Bt=ne;function ko(e={}){const{captureErrors:t=!0}=e;return qt&&y.log("React Router client instrumentation API created."),{router(n){Bt[zc]=!0,qt&&y.log("React Router client instrumentation API router hook registered."),!Bt[Ro]&&et.addEventListener&&(Bt[Ro]=!0,et.addEventListener("popstate",()=>{const r=P();if(!r){tt=void 0;return}const s=et.location?.pathname||"/";if(tt){tt.isRecording()&&tt.updateName(s),tt=void 0;return}Kt(r,{name:s,attributes:{[fe]:"url",[le]:"navigation",[Y]:"auto.navigation.react_router.instrumentation_api","navigation.type":"browser.popstate"}})}),qt&&y.log("React Router popstate listener registered for browser back/forward navigation.")),n.instrument({async navigate(r,s){if(s.to===0){const u=await r();u.status==="error"&&u.error instanceof Error&&Be(u,t,"react_router.navigate",{"http.url":s.currentUrl});return}if(Bt[$y]=!0,typeof s.to=="number"){const u=P();let l;if(u){const d=s.to<0?"router.back":"router.forward",f=et.location?.pathname||s.currentUrl;l=Kt(u,{name:f,attributes:{[fe]:"url",[le]:"navigation",[Y]:"auto.navigation.react_router.instrumentation_api","navigation.type":d}}),tt=l}try{const d=await r();l&&et.location&&l.updateName(et.location.pathname),d.status==="error"&&d.error instanceof Error&&(l&&l.setStatus({code:Te,message:"internal_error"}),Be(d,t,"react_router.navigate",{"http.url":et.location?.pathname||s.currentUrl}))}finally{tt=void 0}return}const i=P(),o=String(s.to);let c;i&&(c=Kt(i,{name:o,attributes:{[fe]:"url",[le]:"navigation",[Y]:"auto.navigation.react_router.instrumentation_api","navigation.type":"router.navigate"}}));const a=await r();a.status==="error"&&a.error instanceof Error&&(c&&c.setStatus({code:Te,message:"internal_error"}),Be(a,t,"react_router.navigate",{"http.url":o}))},async fetch(r,s){await pt({name:`Fetcher ${s.fetcherKey}`,attributes:{[le]:"function.react_router.fetcher",[Y]:"auto.function.react_router.instrumentation_api"}},async i=>{const o=await r();o.status==="error"&&o.error instanceof Error&&(i.setStatus({code:Te,message:"internal_error"}),Be(o,t,"react_router.fetcher",{"http.url":s.href}))})}})},route(n){n.instrument({async loader(r,s){const i=Fr(s.request),o=Ur(Br(s))||i;await pt({name:o,attributes:{[le]:"function.react_router.client_loader",[Y]:"auto.function.react_router.instrumentation_api"}},async c=>{const a=await r();a.status==="error"&&a.error instanceof Error&&(c.setStatus({code:Te,message:"internal_error"}),Be(a,t,"react_router.client_loader",{"http.url":i}))})},async action(r,s){const i=Fr(s.request),o=Ur(Br(s))||i;await pt({name:o,attributes:{[le]:"function.react_router.client_action",[Y]:"auto.function.react_router.instrumentation_api"}},async c=>{const a=await r();a.status==="error"&&a.error instanceof Error&&(c.setStatus({code:Te,message:"internal_error"}),Be(a,t,"react_router.client_action",{"http.url":i}))})},async middleware(r,s){const i=Fr(s.request),o=Ur(Br(s))||i;await pt({name:o,attributes:{[le]:"function.react_router.client_middleware",[Y]:"auto.function.react_router.instrumentation_api"}},async c=>{const a=await r();a.status==="error"&&a.error instanceof Error&&(c.setStatus({code:Te,message:"internal_error"}),Be(a,t,"react_router.client_middleware",{"http.url":i}))})},async lazy(r){await pt({name:"Lazy Route Load",attributes:{[le]:"function.react_router.client_lazy",[Y]:"auto.function.react_router.instrumentation_api"}},async s=>{const i=await r();i.status==="error"&&i.error instanceof Error&&(s.setStatus({code:Te,message:"internal_error"}),Be(i,t,"react_router.client_lazy",{}))})}})}}}function Wy(){return!!Bt[zc]}const zy=ne,Co=40;function qy(){function e(){const t=zy.__reactRouterDataRouter;if(t){const n=Mo();if(n){const r=W(n).description,s=xo(t.state);r&&Ut(t.state.location.pathname)===Ut(r)&&(n.updateName(s),n.setAttributes({[fe]:"route",[Y]:"auto.pageload.react_router"}))}if(typeof t.navigate=="function"){const r=t.navigate.bind(t);t.navigate=function(...i){return Wy()||jy(String(i[0])||"","url"),r(...i)}}return t.subscribe(r=>{const s=Mo();if(!s)return;const i=W(s).description,o=xo(r);i&&r.navigation.state==="idle"&&Ut(r.location.pathname)===Ut(i)&&(s.updateName(o),s.setAttributes({[fe]:"route",[Y]:"auto.navigation.react_router"}))}),!0}return!1}if(!e()){let t=0;const n=setInterval(()=>{(e()||t>=Co)&&(t>=Co&&qt&&y.warn("Unable to instrument React Router: router not found after hydration."),clearInterval(n)),t++},50)}}function jy(e,t){const n=P();if(n)return Kt(n,{name:e,attributes:{[fe]:t,[le]:"navigation",[Y]:"auto.navigation.react_router"}})}function Mo(){const e=pe();if(!e)return;const t=ge(e),n=W(t).op;return n==="navigation"||n==="pageload"?t:void 0}function xo(e){const t=e.matches[e.matches.length-1];return Ut(t?.route.path??e.location.pathname)}function Ut(e){let t=e.startsWith("/")?e:`/${e}`;return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function Gy(e={}){const t=Dy({instrumentNavigation:!1});let n;(e.useInstrumentationAPI||e.instrumentationOptions)&&(n=ko(e.instrumentationOptions));const r=()=>(n||(n=ko(e.instrumentationOptions)),n);return{...t,name:"ReactRouterTracingIntegration",afterAllSetup(s){t.afterAllSetup(s),qy()},get clientInstrumentation(){return r()}}}function Vy(e){return de.createElement(Kc,{flushSync:qu.flushSync,...e})}var v=null,Ft=null;function Yy(){if(!v&&window.__reactRouterContext&&window.__reactRouterManifest&&window.__reactRouterRouteModules){if(window.__reactRouterManifest.sri===!0){const e=document.querySelector("script[rr-importmap]");if(e?.textContent)try{window.__reactRouterManifest.sri=JSON.parse(e.textContent).integrity}catch(t){console.error("Failed to parse import map",t)}}v={context:window.__reactRouterContext,manifest:window.__reactRouterManifest,routeModules:window.__reactRouterRouteModules,stateDecodingPromise:void 0,router:void 0,routerInitialized:!1}}}function Ky({getContext:e,unstable_instrumentations:t}){if(Yy(),!v)throw new Error("You must be using the SSR features of React Router in order to skip passing a `router` prop to ``");let n=v;if(!v.stateDecodingPromise){let o=v.context.stream;No(o,"No stream found for single fetch decoding"),v.context.stream=void 0,v.stateDecodingPromise=Xc(o,window).then(c=>{v.context.state=c.value,n.stateDecodingPromise.value=!0}).catch(c=>{n.stateDecodingPromise.error=c})}if(v.stateDecodingPromise.error)throw v.stateDecodingPromise.error;if(!v.stateDecodingPromise.value)throw v.stateDecodingPromise;let r=Jc(v.manifest.routes,v.routeModules,v.context.state,v.context.ssr,v.context.isSpaMode),s;if(v.context.isSpaMode){let{loaderData:o}=v.context.state;v.manifest.routes.root?.hasLoader&&o&&"root"in o&&(s={loaderData:{root:o.root}})}else s=Wu({state:v.context.state,routes:r,getRouteInfo:o=>({clientLoader:v.routeModules[o]?.clientLoader,hasLoader:v.manifest.routes[o]?.hasLoader===!0,hasHydrateFallback:v.routeModules[o]?.HydrateFallback!=null}),location:window.location,basename:window.__reactRouterContext?.basename,isSpaMode:v.context.isSpaMode}),s&&s.errors&&(s.errors=zu(s.errors));window.history.state&&window.history.state.masked&&window.history.replaceState({...window.history.state,masked:void 0},"");let i=Qc({routes:r,history:tu(),basename:v.context.basename,getContext:e,hydrationData:s,hydrationRouteProperties:su,unstable_instrumentations:t,mapRouteProperties:ru,future:{middleware:v.context.future.v8_middleware},dataStrategy:eu(()=>i,v.manifest,v.routeModules,v.context.ssr,v.context.basename,v.context.future.unstable_trailingSlashAwareDataRequests),patchRoutesOnNavigation:Zc(()=>i,v.manifest,v.routeModules,v.context.ssr,v.context.routeDiscovery,v.context.isSpaMode,v.context.basename)});return v.router=i,i.state.initialized&&(v.routerInitialized=!0,i.initialize()),i.createRoutesForHMR=nu,window.__reactRouterDataRouter=i,i}function Xy(e){Ft||(Ft=Ky({getContext:e.getContext,unstable_instrumentations:e.unstable_instrumentations}));let[t,n]=de.useState(void 0);de.useEffect(()=>{},[]),de.useEffect(()=>{},[t]);let[r,s]=de.useState(Ft.state.location);return de.useLayoutEffect(()=>{v&&v.router&&!v.routerInitialized&&(v.routerInitialized=!0,v.router.initialize())},[]),de.useLayoutEffect(()=>{if(v&&v.router)return v.router.subscribe(i=>{i.location!==r&&s(i.location)})},[r]),No(v,"ssrInfo unavailable for HydratedRouter"),Gc(Ft,v.manifest,v.routeModules,v.context.ssr,v.context.routeDiscovery,v.context.isSpaMode),de.createElement(de.Fragment,null,de.createElement(Vc.Provider,{value:{manifest:v.manifest,routeModules:v.routeModules,future:v.context.future,criticalCss:t,ssr:v.context.ssr,isSpaMode:v.context.isSpaMode,routeDiscovery:v.context.routeDiscovery}},de.createElement(Yc,{location:r},de.createElement(Vy,{router:Ft,unstable_useTransitions:e.unstable_useTransitions,onError:e.onError}))),de.createElement(de.Fragment,null))}const{PUBLIC_SENTRY_ENVIRONMENT:Jy}=ju();Hy({environment:Jy,dsn:"https://22ee0d7a1fbc49898b026aeda5193196@sr02.devserver.cv/_sentrysemrush/345",sendDefaultPii:!0,tracesSampleRate:1,replaysOnErrorSampleRate:1,replaysSessionSampleRate:.1,integrations:[gy({maskAllText:!1,blockAllMedia:!1}),Gy()],enableLogs:!0});const Ao=document.querySelector("#ala-root");Ao&&de.startTransition(()=>{$u.hydrateRoot(Ao,ni.jsx(de.StrictMode,{children:ni.jsx(Xy,{})}))}); //# debugId=ad6c4162-7677-5db1-bb57-3c2e6b57a3c4