1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-03-24 11:33:11 +00:00
Classworks/assets/vendor-sentry-IwhNtTBL.js

502 lines
309 KiB
JavaScript

const x=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,G=globalThis,Ft="10.45.0";function qt(){return as(G),G}function as(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ft,t[Ft]=t[Ft]||{}}function bn(e,t,n=G){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[Ft]=r[Ft]||{};return s[e]||(s[e]=t())}const Ed=["debug","info","warn","error","log","assert","trace"],vd="Sentry Logger ",Ur={};function ht(e){if(!("console"in G))return e();const t=G.console,n={},r=Object.keys(Ur);r.forEach(s=>{const i=Ur[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function Td(){Li().enabled=!0}function wd(){Li().enabled=!1}function Rc(){return Li().enabled}function Id(...e){Ni("log",...e)}function kd(...e){Ni("warn",...e)}function Cd(...e){Ni("error",...e)}function Ni(e,...t){x&&Rc()&&ht(()=>{G.console[e](`${vd}[${e}]:`,...t)})}function Li(){return x?bn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const b={enable:Td,disable:wd,isEnabled:Rc,log:Id,warn:kd,error:Cd},xc=50,Ut="?",Ro=/\(error: (.*)\)/,xo=/captureMessage|captureException/;function Mc(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
`);for(let c=r;c<o.length;c++){let a=o[c];a.length>1024&&(a=a.slice(0,1024));const u=Ro.test(a)?a.replace(Ro,"$1"):a;if(!u.match(/\S*Error: /)){for(const d of t){const l=d(u);if(l){i.push(l);break}}if(i.length>=xc+s)break}}return xd(i.slice(s))}}function Rd(e){return Array.isArray(e)?Mc(...e):e}function xd(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(fr(t).function||"")&&t.pop(),t.reverse(),xo.test(fr(t).function||"")&&(t.pop(),xo.test(fr(t).function||"")&&t.pop()),t.slice(0,xc).map(n=>({...n,filename:n.filename||fr(t).filename,function:n.function||Ut}))}function fr(e){return e[e.length-1]||{}}const ws="<anonymous>";function ct(e){try{return!e||typeof e!="function"?ws:e.name||ws}catch{return ws}}function Mo(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Ac(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Ir={},Ao={};function Rt(e,t){Ir[e]=Ir[e]||[],Ir[e].push(t)}function xt(e,t){if(!Ao[e]){Ao[e]=!0;try{t()}catch(n){x&&b.error(`Error while instrumenting ${e}`,n)}}}function Ge(e,t){const n=e&&Ir[e];if(n)for(const r of n)try{r(t)}catch(s){x&&b.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${ct(r)}
Error:`,s)}}let Is=null;function Nc(e){const t="error";Rt(t,e),xt(t,Md)}function Md(){Is=G.onerror,G.onerror=function(e,t,n,r,s){return Ge("error",{column:r,error:s,line:n,msg:e,url:t}),Is?Is.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}let ks=null;function Lc(e){const t="unhandledrejection";Rt(t,e),xt(t,Ad)}function Ad(){ks=G.onunhandledrejection,G.onunhandledrejection=function(e){return Ge("unhandledrejection",e),ks?ks.apply(this,arguments):!0},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Dc=Object.prototype.toString;function cs(e){switch(Dc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ut(e,Error)}}function En(e,t){return Dc.call(e)===`[object ${t}]`}function Oc(e){return En(e,"ErrorEvent")}function No(e){return En(e,"DOMError")}function Nd(e){return En(e,"DOMException")}function st(e){return En(e,"String")}function Di(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function un(e){return e===null||Di(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return En(e,"Object")}function us(e){return typeof Event<"u"&&ut(e,Event)}function Ld(e){return typeof Element<"u"&&ut(e,Element)}function Dd(e){return En(e,"RegExp")}function vn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Od(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ut(e,t){try{return e instanceof t}catch{return!1}}function Pc(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Oi(e){return typeof Request<"u"&&ut(e,Request)}const Pi=G,Pd=80;function Le(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Pd;for(;n&&i++<r&&(u=Fd(n,d),!(u==="html"||i>1&&o+s.length*a+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function Fd(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Pi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s!=null&&s.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&st(i)){const o=i.split(/\s+/);for(const c of o)r.push(`.${c}`)}}for(const i of["aria-label","type","name","title","alt"]){const o=n.getAttribute(i);o&&r.push(`[${i}="${o}"]`)}return r.join("")}function Vt(){try{return Pi.document.location.href}catch{return""}}function Fc(e){if(!Pi.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function Ae(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&$c(s,r);try{e[t]=s}catch{x&&b.log(`Failed to replace method "${t}" in object`,e)}}function De(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{x&&b.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function $c(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,De(e,"__sentry_original__",t)}catch{}}function Fi(e){return e.__sentry_original__}function Bc(e){if(cs(e))return{message:e.message,name:e.name,stack:e.stack,...Do(e)};if(us(e)){const t={type:e.type,target:Lo(e.target),currentTarget:Lo(e.currentTarget),...Do(e)};return typeof CustomEvent<"u"&&ut(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Lo(e){try{return Ld(e)?Le(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Do(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function $d(e){const t=Object.keys(Bc(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Kt;function Gn(e){if(Kt!==void 0)return Kt?Kt(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=G;return t in n&&typeof n[t]=="function"?(Kt=n[t],Kt(e)):(Kt=null,e())}function bt(){return Gn(()=>Math.random())}function Yn(){return Gn(()=>Date.now())}function Js(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Oo(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Pc(s)?n.push(Ac(s)):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function kr(e,t,n=!1){return st(e)?Dd(t)?t.test(e):st(t)?n?e===t:e.includes(t):!1:!1}function it(e,t=[],n=!1){return t.some(r=>kr(e,r,n))}function Bd(){const e=G;return e.crypto||e.msCrypto}let Cs;function Hd(){return bt()*16}function Ue(e=Bd()){try{if(e!=null&&e.randomUUID)return Gn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Cs||(Cs="10000000100040008000"+1e11),Cs.replace(/[018]/g,t=>(t^(Hd()&15)>>t/4).toString(16))}function Hc(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Nt(e){const{message:t,event_id:n}=e;if(t)return t;const r=Hc(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Zs(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function ln(e,t){const n=Hc(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s==null?void 0:s.data,...t.data};n.mechanism.data=i}}function Po(e){if(Ud(e))return!0;try{De(e,"__sentry_captured__",!0)}catch{}return!1}function Ud(e){try{return e.__sentry_captured__}catch{}}const Uc=1e3;function Gt(){return Yn()/Uc}function Wd(){const{performance:e}=G;if(!(e!=null&&e.now)||!e.timeOrigin)return Gt;const t=e.timeOrigin;return()=>(t+Gn(()=>e.now()))/Uc}let Fo;function _e(){return(Fo??(Fo=Wd()))()}let Rs=null;function zd(){var o;const{performance:e}=G;if(!(e!=null&&e.now))return;const t=3e5,n=Gn(()=>e.now()),r=Yn(),s=e.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)<t)return s;const i=(o=e.timing)==null?void 0:o.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function Oe(){return Rs===null&&(Rs=zd()),Rs}function jd(e){const t=_e(),n={sid:Ue(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Vd(n)};return e&&dn(n,e),n}function dn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||_e(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ue()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function qd(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),dn(e,n)}function Vd(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Kn(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=Kn(r[s],t[s],n-1));return r}function lt(){return Ue()}function ot(){return Ue().substring(16)}const Qs="_sentrySpan";function fn(e,t){t?De(e,Qs,t):delete e[Qs]}function Wr(e){return e[Qs]}const Gd=100;class tt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:lt(),sampleRand:bt()}}clone(){const t=new tt;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,fn(t,Wr(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&dn(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof tt?n.getScopeData():Fn(n)?t:void 0,{tags:s,attributes:i,extra:o,user:c,contexts:a,level:u,fingerprint:d=[],propagationContext:l,conversationId:f}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},c&&Object.keys(c).length&&(this._user=c),u&&(this._level=u),d.length&&(this._fingerprint=d),l&&(this._propagationContext=l),f&&(this._conversationId=f),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,fn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:lt(),sampleRand:bt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:Gd;if(r<=0)return this;const s={timestamp:Gt(),...t,message:t.message?Js(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Wr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Kn(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Ue();if(!this._client)return x&&b.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=(r==null?void 0:r.event_id)||Ue();if(!this._client)return x&&b.warn("No client configured on scope - will not capture message!"),s;const i=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Ue();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(x&&b.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function Yd(){return bn("defaultCurrentScope",()=>new tt)}function Kd(){return bn("defaultIsolationScope",()=>new tt)}class Xd{constructor(t,n){let r;t?r=t:r=new tt;let s;n?s=n:s=new tt,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return vn(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function pn(){const e=qt(),t=as(e);return t.stack=t.stack||new Xd(Yd(),Kd())}function Jd(e){return pn().withScope(e)}function Zd(e,t){const n=pn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function $o(e){return pn().withScope(()=>e(pn().getIsolationScope()))}function Qd(){return{withIsolationScope:$o,withScope:Jd,withSetScope:Zd,withSetIsolationScope:(e,t)=>$o(t),getCurrentScope:()=>pn().getScope(),getIsolationScope:()=>pn().getIsolationScope()}}function Tn(e){const t=as(e);return t.acs?t.acs:Qd()}function ee(){const e=qt();return Tn(e).getCurrentScope()}function Ce(){const e=qt();return Tn(e).getIsolationScope()}function Wc(){return bn("globalScope",()=>new tt)}function ls(...e){const t=qt(),n=Tn(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function j(){return ee().getClient()}function ef(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||ot()};return r&&(i.parent_span_id=r),i}const Ne="sentry.source",$i="sentry.sample_rate",zc="sentry.previous_trace_sample_rate",dt="sentry.op",pe="sentry.origin",$n="sentry.idle_span_finish_reason",Xn="sentry.measurement_unit",Jn="sentry.measurement_value",Bo="sentry.custom_span_name",Bi="sentry.profile_id",wn="sentry.exclusive_time",tf="sentry.link.type",nf="gen_ai.conversation.id",rf=0,Hi=1,Se=2;function sf(e){if(e<400&&e>=100)return{code:Hi};if(e>=400&&e<500)switch(e){case 401:return{code:Se,message:"unauthenticated"};case 403:return{code:Se,message:"permission_denied"};case 404:return{code:Se,message:"not_found"};case 409:return{code:Se,message:"already_exists"};case 413:return{code:Se,message:"failed_precondition"};case 429:return{code:Se,message:"resource_exhausted"};case 499:return{code:Se,message:"cancelled"};default:return{code:Se,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:Se,message:"unimplemented"};case 503:return{code:Se,message:"unavailable"};case 504:return{code:Se,message:"deadline_exceeded"};default:return{code:Se,message:"internal_error"}}return{code:Se,message:"internal_error"}}function jc(e,t){e.setAttribute("http.response.status_code",t);const n=sf(t);n.message!=="unknown_error"&&e.setStatus(n)}const qc="_sentryScope",Vc="_sentryIsolationScope";function of(e){try{const t=G.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function af(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function cf(e,t,n){e&&(De(e,Vc,of(n)),De(e,qc,t))}function zr(e){const t=e;return{scope:t[qc],isolationScope:af(t[Vc])}}const jr="sentry-",uf=8192;function Gc(e){const t=df(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.startsWith(jr)){const o=s.slice(jr.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function lf(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${jr}${r}`]=s),n),{});return ff(t)}function df(e){if(!(!e||!st(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Ho(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Ho(e)}function Ho(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),s=t.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function ff(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>uf?(x&&b.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const pf=/^o(\d+)\./,hf=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function mf(e){return e==="http"||e==="https"}function In(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function _f(e){const t=hf.exec(e);if(!t){ht(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i="",o="",c=""]=t.slice(1);let a="",u=c;const d=u.split("/");if(d.length>1&&(a=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Yc({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function Yc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function gf(e){if(!x)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(b.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?mf(r)?t&&isNaN(parseInt(t,10))?(b.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(b.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(b.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function yf(e){const t=e.match(pf);return t==null?void 0:t[1]}function Sf(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=yf(n)),r}function bf(e){const t=typeof e=="string"?_f(e):Yc(e);if(!(!t||!gf(t)))return t}function Wt(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const Kc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ef(e){if(!e)return;const t=e.match(Kc);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function vf(e,t){const n=Ef(e),r=Gc(t);if(!(n!=null&&n.traceId))return{traceId:lt(),sampleRand:bt()};const s=Tf(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:c}=n;return{traceId:i,parentSpanId:o,sampled:c,dsc:r||{},sampleRand:s}}function Xc(e=lt(),t=ot(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Jc(e=lt(),t=ot(),n){return`00-${e}-${t}-${n?"01":"00"}`}function Tf(e,t){const n=Wt(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Wt(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?bt()*r:r+bt()*(1-r):bt()}const Zc=0,Ui=1;let Uo=!1;function wf(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=Z(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function If(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:Z(e).parent_span_id,i=zr(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||ot():t;return{parent_span_id:s,span_id:o,trace_id:n}}function kf(e){const{traceId:t,spanId:n}=e.spanContext(),r=Mt(e);return Xc(t,n,r)}function Cf(e){const{traceId:t,spanId:n}=e.spanContext(),r=Mt(e);return Jc(t,n,r)}function Qc(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Ui,attributes:i,...s}))}function $t(e){return typeof e=="number"?Wo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Wo(e.getTime()):_e()}function Wo(e){return e>9999999999?e/1e3:e}function Z(e){var r;if(xf(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(Rf(e)){const{attributes:s,startTime:i,name:o,endTime:c,status:a,links:u}=e,d="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(r=e.parentSpanContext)==null?void 0:r.spanId:void 0;return{span_id:t,trace_id:n,data:s,description:o,parent_span_id:d,start_timestamp:$t(i),timestamp:$t(c)||void 0,status:eu(a),op:s[dt],origin:s[pe],links:Qc(u)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Rf(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function xf(e){return typeof e.getSpanJSON=="function"}function Mt(e){const{traceFlags:t}=e.spanContext();return t===Ui}function eu(e){if(!(!e||e.code===rf))return e.code===Hi?"ok":e.message||"internal_error"}const Bt="_sentryChildSpans",ei="_sentryRootSpan";function tu(e,t){const n=e[ei]||e;De(t,ei,n),e[Bt]?e[Bt].add(t):De(e,Bt,new Set([t]))}function Mf(e,t){e[Bt]&&e[Bt].delete(t)}function Cr(e){const t=new Set;function n(r){if(!t.has(r)&&Mt(r)){t.add(r);const s=r[Bt]?Array.from(r[Bt]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}function ve(e){return e[ei]||e}function Te(){const e=qt(),t=Tn(e);return t.getActiveSpan?t.getActiveSpan():Wr(ee())}function ti(){Uo||(ht(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Uo=!0)}let zo=!1;function Af(){if(zo)return;function e(){const t=Te(),n=t&&ve(t);if(n){const r="internal_error";x&&b.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:Se,message:r})}}e.tag="sentry_tracingErrorCallback",zo=!0,Nc(e),Lc(e)}function Ye(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=j())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function jo(e){b.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function qr(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(Lf(n)){if(kr(e.description,n))return x&&jo(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?kr(e.description,n.name):!0,s=n.op?e.op&&kr(e.op,n.op):!0;if(r&&s)return x&&jo(e),!0}return!1}function Nf(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 Lf(e){return typeof e=="string"||e instanceof RegExp}const Wi="production",nu="_frozenDsc";function Rr(e,t){De(e,nu,t)}function ru(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||Wi,release:n.release,public_key:r,trace_id:e,org_id:Sf(t)};return t.emit("createDsc",s),s}function su(e,t){const n=t.getPropagationContext();return n.dsc||ru(n.traceId,e)}function ft(e){var h;const t=j();if(!t)return{};const n=ve(e),r=Z(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[$i]??s[zc];function c(m){return(typeof o=="number"||typeof o=="string")&&(m.sample_rate=`${o}`),m}const a=n[nu];if(a)return c(a);const u=i==null?void 0:i.get("sentry.dsc"),d=u&&Gc(u);if(d)return c(d);const l=ru(e.spanContext().traceId,t),f=s[Ne],p=r.description;return f!=="url"&&p&&(l.transaction=p),Ye()&&(l.sampled=String(Mt(n)),l.sample_rand=(i==null?void 0:i.get("sentry.sample_rand"))??((h=zr(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),c(l),t.emit("createDsc",l,n),l}class wt{constructor(t={}){this._traceId=t.traceId||lt(),this._spanId=t.spanId||ot()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Zc}}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=100,n=1/0){try{return ni("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function iu(e,t=3,n=100*1024){const r=Je(e,t);return Ff(r)>n?iu(e,t-1,n):r}function ni(e,t,n=1/0,r=1/0,s=$f()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const c=Df(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;const a=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(a===0)return c.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return ni("",p,a-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=Bc(t);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(l>=r){d[p]="[MaxProperties ~]";break}const h=f[p];d[p]=ni(p,h,a-1,r,s),l++}return o(t),d}function Df(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Pc(t))return Ac(t);if(Od(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${ct(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Of(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Of(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function Pf(e){return~-encodeURI(e).split(/%..|./).length}function Ff(e){return Pf(JSON.stringify(e))}function $f(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function At(e,t=[]){return[e,t]}function Bf(e,t){const[n,r]=e;return[n,[...r,t]]}function ri(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 Hf(e,t){return ri(e,(n,r)=>t.includes(r))}function si(e){const t=as(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Uf(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[si(r),i]:r.push(typeof i=="string"?si(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(Je(c))}s(a)}}return typeof r=="string"?r:Wf(r)}function Wf(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 zf(e){return[{type:"span"},e]}function jf(e){const t=typeof e.data=="string"?si(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const ou={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function qf(e){return e in ou}function qo(e){return qf(e)?ou[e]:e}function zi(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function au(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:In(r)},...s&&{trace:s}}}function Vf(e,t){var r,s,i,o;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function Gf(e,t,n,r){const s=zi(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:In(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return At(i,[o])}function Yf(e,t,n,r){const s=zi(n),i=e.type&&e.type!=="replay_event"?e.type:"event";Vf(e,n==null?void 0:n.sdk);const o=au(e,s,r,t);return delete e.sdkProcessingMetadata,At(o,[[{type:i},e]])}function Kf(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=ft(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:In(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>!qr(Z(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=Z(p),m=c(h);return m||(ti(),h)}:Z,f=[];for(const p of u){const h=l(p);h&&f.push(zf(h))}return At(o,f)}function Xf(e){if(!x)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=Z(e),{spanId:s}=e.spanContext(),i=Mt(e),o=ve(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:d,description:l}=Z(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}b.log(`${a}
${u.join(`
`)}`)}function Jf(e){if(!x)return;const{description:t="< unknown name >",op:n="< unknown op >"}=Z(e),{spanId:r}=e.spanContext(),i=ve(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;b.log(o)}function Zf(e,t,n,r=Te()){const s=r&&ve(r);s&&(x&&b.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[Jn]:t,[Xn]:n}))}function Vo(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[Xn],i=r[Jn];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}const Go=1e3;class ds{constructor(t={}){this._traceId=t.traceId||lt(),this._spanId=t.spanId||ot(),this._startTime=t.startTimestamp||_e(),this._links=t.links,this._attributes={},this.setAttributes({[pe]:"manual",[dt]: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?Ui:Zc}}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(Ne,"custom"),this}end(t){this._endTime||(this._endTime=$t(t),Jf(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[dt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:eu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[pe],profile_id:this._attributes[Bi],exclusive_time:this._attributes[wn],measurements:Vo(this._events),is_segment:this._isStandaloneSpan&&ve(this)===this||void 0,segment_id:this._isStandaloneSpan?ve(this).spanContext().spanId:void 0,links:Qc(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){x&&b.log("[Tracing] Adding an event to span:",t);const s=Yo(n)?n:r||_e(),i=Yo(n)?{}:n||{},o={name:t,time:$t(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=j();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===ve(this)))return;if(this._isStandaloneSpan){this._sampled?ep(Kf([this],t)):(x&&b.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&&(zr(this).scope||ee()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Ko(Z(this)))return;this._name||(x&&b.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=zr(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const i=Cr(this).filter(l=>l!==this&&!Qf(l)).map(l=>Z(l)).filter(Ko),o=this._attributes[Ne];delete this._attributes[Bo],i.forEach(l=>{delete l.data[Bo]});const c={contexts:{trace:wf(this)},spans:i.length>Go?i.sort((l,f)=>l.start_timestamp-f.start_timestamp).slice(0,Go):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ft(this)},request:r,...o&&{transaction_info:{source:o}}},a=Vo(this._events);return a&&Object.keys(a).length&&(x&&b.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function Yo(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ko(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Qf(e){return e instanceof ds&&e.isStandaloneSpan()}function ep(e){const t=j();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function tp(e,t,n=()=>{},r=()=>{}){let s;try{s=e()}catch(i){throw t(i),n(),i}return np(s,t,n,r)}function np(e,t,n,r){return vn(e)?e.then(s=>(n(),r(s),s),s=>{throw t(s),n(),s}):(n(),r(e),e)}function rp(e,t,n){if(!Ye(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=Wt(s);if(i===void 0)return x&&b.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 x&&b.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<i;return o||x&&b.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const cu="__SENTRY_SUPPRESS_TRACING__";function sp(e,t){const n=qi();if(n.startSpan)return n.startSpan(e,t);const r=lu(e),{forceTransaction:s,parentSpan:i,scope:o}=e,c=o==null?void 0:o.clone();return ls(c,()=>op(i)(()=>{const u=ee(),d=du(u,i),f=e.onlyIfParent&&!d?new wt:uu({parentSpan:d,spanArguments:r,forceTransaction:s,scope:u});return fn(u,f),tp(()=>t(f),()=>{const{status:p}=Z(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:Se,message:"internal_error"})},()=>{f.end()})}))}function It(e){const t=qi();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=lu(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>ls(e.scope,o):s!==void 0?o=>ji(s,o):o=>o())(()=>{const o=ee(),c=du(o,s);return e.onlyIfParent&&!c?new wt:uu({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function ji(e,t){const n=qi();return n.withActiveSpan?n.withActiveSpan(e,t):ls(r=>(fn(r,e||void 0),t(r)))}function uu({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ye()){const o=new wt;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...ft(o)};Rr(o,c)}return o}const s=Ce();let i;if(e&&!n)i=ip(e,r,t),tu(e,i);else if(e){const o=ft(e),{traceId:c,spanId:a}=e.spanContext(),u=Mt(e);i=Xo({traceId:c,parentSpanId:a,...t},r,u),Rr(i,o)}else{const{traceId:o,dsc:c,parentSpanId:a,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=Xo({traceId:o,parentSpanId:a,...t},r,u),c&&Rr(i,c)}return Xf(i),cf(i,r,s),i}function lu(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 qi(){const e=qt();return Tn(e)}function Xo(e,t,n){var h;const r=j(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),[d,l,f]=t.getScopeData().sdkProcessingMetadata[cu]?[!1]:rp(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:Wt((h=u.dsc)==null?void 0:h.sample_rate)},u.sampleRand),p=new ds({...e,attributes:{[Ne]:"custom",[$i]:l!==void 0&&f?l:void 0,...a},sampled:d});return!d&&r&&(x&&b.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 ip(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=t.getScopeData().sdkProcessingMetadata[cu]?!1:Mt(e),o=i?new ds({...n,parentSpanId:r,traceId:s,sampled:i}):new wt({traceId:s});tu(e,o);const c=j();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function du(e,t){if(t)return t;if(t===null)return;const n=Wr(e);if(!n)return;const r=j();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ve(n):n}function op(e){return e!==void 0?t=>ji(e,t):t=>t()}const xr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},ap="heartbeatFailed",cp="idleTimeout",up="finalTimeout",lp="externalFinish";function fu(e,t={}){const n=new Map;let r=!1,s,i=lp,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=xr.idleTimeout,finalTimeout:u=xr.finalTimeout,childSpanTimeout:d=xr.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=j();if(!p||!Ye()){const y=new wt,T={sample_rate:"0",sampled:"false",...ft(y)};return Rr(y,T),y}const h=ee(),m=Te(),_=dp(e);_.end=new Proxy(_.end,{apply(y,T,F){if(l&&l(_),T instanceof wt)return;const[E,...k]=F,v=E||_e(),C=$t(v),M=Cr(_).filter(w=>w!==_),J=Z(_);if(!M.length||!f)return A(C),Reflect.apply(y,T,[C,...k]);const te=p.getOptions().ignoreSpans,Y=M==null?void 0:M.reduce((w,W)=>{const U=Z(W);return!U.timestamp||te&&qr(U,te)?w:w?Math.max(w,U.timestamp):U.timestamp},void 0),I=J.start_timestamp,N=Math.min(I?I+u/1e3:1/0,Math.max(I||-1/0,Math.min(C,Y||1/0)));return A(N),Reflect.apply(y,T,[N,...k])}});function g(){s&&(clearTimeout(s),s=void 0)}function S(y){g(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=cp,_.end(y))},a)}function L(y){s=setTimeout(()=>{!r&&o&&(i=ap,_.end(y))},d)}function R(y){g(),n.set(y,!0);const T=_e();L(T+d/1e3)}function H(y){if(n.has(y)&&n.delete(y),n.size===0){const T=_e();S(T+a/1e3)}}function A(y){r=!0,n.clear(),c.forEach(M=>M()),fn(h,m);const T=Z(_),{start_timestamp:F}=T;if(!F)return;T.data[$n]||_.setAttribute($n,i);const k=T.status;(!k||k==="unknown")&&_.setStatus({code:Hi}),b.log(`[Tracing] Idle span "${T.op}" finished`);const v=Cr(_).filter(M=>M!==_);let C=0;v.forEach(M=>{M.isRecording()&&(M.setStatus({code:Se,message:"cancelled"}),M.end(y),x&&b.log("[Tracing] Cancelling span since span ended early",JSON.stringify(M,void 0,2)));const J=Z(M),{timestamp:te=0,start_timestamp:Y=0}=J,I=Y<=y,N=(u+a)/1e3,w=te-Y<=N;if(x){const W=JSON.stringify(M,void 0,2);I?w||b.log("[Tracing] Discarding span since it finished after idle span final timeout",W):b.log("[Tracing] Discarding span since it happened after idle span was finished",W)}(!w||!I)&&(Mf(_,M),C++)}),C>0&&_.setAttribute("sentry.idle_span_discarded_spans",C)}return c.push(p.on("spanStart",y=>{if(r||y===_||Z(y).timestamp||y instanceof ds&&y.isStandaloneSpan())return;Cr(_).includes(y)&&R(y.spanContext().spanId)})),c.push(p.on("spanEnd",y=>{r||H(y.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",y=>{y===_&&(o=!0,S(),n.size&&L())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(_.setStatus({code:Se,message:"deadline_exceeded"}),i=up,_.end())},u),_}function dp(e){const t=It(e);return fn(ee(),t),x&&b.log("[Tracing] Started span is an idle span"),t}const xs=0,Jo=1,Zo=2;function Zn(e){return new Bn(t=>{t(e)})}function Vi(e){return new Bn((t,n)=>{n(e)})}class Bn{constructor(t){this._state=xs,this._handlers=[],this._runExecutor(t)}then(t,n){return new Bn((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Bn((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===xs)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Jo&&n[1](this._value),this._state===Zo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(i,o)=>{if(this._state===xs){if(vn(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(Jo,i)},s=i=>{n(Zo,i)};try{t(r,s)}catch(i){s(i)}}}function fp(e,t,n,r=0){try{const s=ii(t,n,e,r);return vn(s)?s:Zn(s)}catch(s){return Vi(s)}}function ii(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return x&&i===null&&b.log(`Event processor "${s.id||"?"}" dropped event`),vn(i)?i.then(o=>ii(o,t,n,r+1)):ii(i,t,n,r+1)}let nt,Qo,ea,mt;function pp(e){const t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(mt&&r.length===Qo&&s.length===ea)return mt;Qo=r.length,ea=s.length,mt={},nt||(nt={});const i=(o,c)=>{for(const a of o){const u=c[a],d=nt==null?void 0:nt[a];if(d&&mt&&u)mt[d[0]]=u,nt&&(nt[a]=[d[0],u]);else if(u){const l=e(a);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&mt&&nt){mt[h]=u,nt[a]=[h,u];break}}}}};return t&&i(r,t),n&&i(s,n),mt}function hp(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;mp(e,t),r&&yp(e,r),Sp(e,n),_p(e,s),gp(e,i)}function ta(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:c,sdkProcessingMetadata:a,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:m}=t;xn(e,"extra",n),xn(e,"tags",r),xn(e,"attributes",s),xn(e,"user",i),xn(e,"contexts",o),e.sdkProcessingMetadata=Kn(e.sdkProcessingMetadata,a,2),c&&(e.level=c),h&&(e.transactionName=h),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function xn(e,t,n){e[t]=Kn(e[t],n,1)}function pu(e,t){const n=Wc().getScopeData();return e&&ta(n,e.getScopeData()),t&&ta(n,t.getScopeData()),n}function mp(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function _p(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function gp(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function yp(e,t){e.contexts={trace:If(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ft(t),...e.sdkProcessingMetadata};const n=ve(t),r=Z(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Sp(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function hu(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||Ue(),timestamp:t.timestamp||Gt()},u=n.integrations||e.integrations.map(g=>g.name);bp(a,e),Tp(a,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&Ep(a,e.stackParser);const d=Ip(r,n.captureContext);n.mechanism&&ln(a,n.mechanism);const l=s?s.getEventProcessors():[],f=pu(i,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),hp(a,f);const h=[...l,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Zn(a):fp(h,a,n)).then(g=>(g&&vp(g),typeof o=="number"&&o>0?wp(g,o,c):g))}function bp(e,t){var c,a;const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||Wi,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&i&&(o.url=Js(o.url,i)),i&&((a=(c=e.exception)==null?void 0:c.values)==null||a.forEach(u=>{u.value&&(u.value=Js(u.value,i))}))}function Ep(e,t){var r,s;const n=pp(t);(s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.filename&&(a.debug_id=n[a.filename])})})}function vp(e){var r,s;const t={};if((s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function Tp(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function wp(e,t,n){var s,i;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Je(o.data,t,n)}}))},...e.user&&{user:Je(e.user,t,n)},...e.contexts&&{contexts:Je(e.contexts,t,n)},...e.extra&&{extra:Je(e.extra,t,n)}};return(s=e.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Je(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Je(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Je(e.contexts.flags,3,n)),r}function Ip(e,t){if(!t)return e;const n=e?e.clone():new tt;return n.update(t),n}function kp(e){if(e)return Cp(e)?{captureContext:e}:xp(e)?{captureContext:e}:e}function Cp(e){return e instanceof tt||typeof e=="function"}const Rp=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function xp(e){return Object.keys(e).some(t=>Rp.includes(t))}function fs(e,t){return ee().captureException(e,kp(t))}function mu(e,t){return ee().captureEvent(e,t)}function Mp(e,t){Ce().setContext(e,t)}function T0(e,t){Ce().setTag(e,t)}function w0(e){Ce().setUser(e)}function Ap(){const e=j();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function Np(e){Ce().addEventProcessor(e)}function na(e){const t=Ce(),{user:n}=pu(t,ee()),{userAgent:r}=G.navigator||{},s=jd({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&dn(i,{status:"exited"}),_u(),t.setSession(s),s}function _u(){const e=Ce(),n=ee().getSession()||e.getSession();n&&qd(n),gu(),e.setSession()}function gu(){const e=Ce(),t=j(),n=e.getSession();n&&t&&t.captureSession(n)}function Ms(e=!1){if(e){_u();return}gu()}const Lp="7";function Dp(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Op(e){return`${Dp(e)}${e.projectId}/envelope/`}function Pp(e,t){const n={sentry_version:Lp};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Fp(e,t,n){return t||`${Op(e)}?${Pp(e,n)}`}const ra=[];function $p(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 Bp(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 $p(r)}function Hp(e,t){const n={};return t.forEach(r=>{r&&yu(e,r,n)}),n}function sa(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function yu(e,t,n){if(n[t.name]){x&&b.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!ra.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),ra.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)}x&&b.log(`Integration installed: ${t.name}`)}function ia(e){const t=j();if(!t){x&&b.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Up(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Wp(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),At(s,[Up(e)])}function oi(e,t){const n=t??zp(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Wp(n,r._metadata,r.tunnel,e.getDsn());Su().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function zp(e){return Su().get(e)}function Su(){return bn("clientToLogBufferMap",()=>new WeakMap)}function jp(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function qp(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),At(s,[jp(e)])}function bu(e,t){const n=t??Vp(e)??[];if(n.length===0)return;const r=e.getOptions(),s=qp(n,r._metadata,r.tunnel,e.getDsn());Eu().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Vp(e){return Eu().get(e)}function Eu(){return bn("clientToMetricBufferMap",()=>new WeakMap)}function vu(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Gi=Symbol.for("SentryBufferFullError");function Yi(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return Vi(Gi);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return Zn(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>vu(setTimeout(()=>u(!1),o)))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const Gp=60*1e3;function Yp(e,t=Yn()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Gp:r-t}function Kp(e,t){return e[t]||e.all||0}function Tu(e,t,n=Yn()){return Kp(e,t)>n}function wu(e,{statusCode:t,headers:n},r=Yn()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+Yp(o,r):t===429&&(s.all=r+60*1e3);return s}const Iu=64;function Xp(e,t,n=Yi(e.bufferSize||Iu)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(ri(o,(l,f)=>{const p=qo(f);Tu(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=At(o[0],c),u=l=>{if(Hf(a,["client_report"])){x&&b.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}ri(a,(f,p)=>{e.recordDroppedEvent(l,qo(p))})},d=()=>t({body:Uf(a)}).then(l=>l.statusCode===413?(x&&b.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(x&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&b.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=wu(r,l),l),l=>{throw u("network_error"),x&&b.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Gi)return x&&b.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}function Jp(e,t,n){const r=[{type:"client_report"},{timestamp:Gt(),discarded_events:e}];return At(t?{dsn:t}:{},[r])}function ku(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Zp(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.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==null?void 0:o[Bi],exclusive_time:o==null?void 0:o[wn],measurements:e.measurements,is_segment:!0}}function Qp(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&&{[Bi]:e.profile_id},...e.exclusive_time&&{[wn]:e.exclusive_time}}}},measurements:e.measurements}}const oa="Not capturing exception because it's already been captured.",aa="Discarded session because of missing or non-string release",Cu=Symbol.for("SentryInternalError"),Ru=Symbol.for("SentryDoNotSendEventError"),eh=5e3;function Mr(e){return{message:e,[Cu]:!0}}function As(e){return{message:e,[Ru]:!0}}function ca(e){return!!e&&typeof e=="object"&&Cu in e}function ua(e){return!!e&&typeof e=="object"&&Ru in e}function la(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=vu(setTimeout(()=>{s(e)},eh)))}),e.on("flush",()=>{s(e)})}class th{constructor(t){var r,s,i;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Yi(((r=t.transportOptions)==null?void 0:r.bufferSize)??Iu),t.dsn?this._dsn=bf(t.dsn):x&&b.warn("No DSN provided, client will not send events."),this._dsn){const o=Fp(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:o})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&la(this,"afterCaptureLog","flushLogs",ih,oi),(this._options.enableMetrics??((i=this._options._experiments)==null?void 0:i.enableMetrics)??!0)&&la(this,"afterCaptureMetric","flushMetrics",sh,bu)}captureException(t,n,r){const s=Ue();if(Po(t))return x&&b.log(oa),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:Ue(),...r},o=Di(t)?t:String(t),c=un(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=Ue();if(n!=null&&n.originalException&&Po(n.originalException))return x&&b.log(oa),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=da(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),dn(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){oi(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];yu(this,t,this._integrations),n||sa(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Yf(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Bf(r,jf(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=Wi}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){x&&b.warn(aa);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){x&&b.warn(aa);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=Gf(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}`;x&&b.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 x&&b.error("Error while sending envelope:",n),{}}return x&&b.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Hp(this,t),sa(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const d of i)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(dn(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(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!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),hu(i,t,n,r,this,s).then(c=>{var u;if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:{...(u=c.contexts)==null?void 0:u.trace,...ef(r)},...c.contexts};const a=su(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=ee(),s=Ce()){return x&&ai(t)&&b.log(`Captured error event \`${ku(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{x&&(ua(i)?b.log(i.message):ca(i)?b.warn(i.message):b.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=xu(t),a=ai(t),d=`before send for type \`${t.type||"error"}\``,l=typeof o>"u"?void 0:Wt(o);if(a&&typeof l=="number"&&bt()>l)return this.recordDroppedEvent("sample_rate","error"),Vi(As(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=da(t.type);return this._prepareEvent(t,n,r,s).then(p=>{var _;if(p===null)throw this.recordDroppedEvent("event_processor",f),As("An event processor returned `null`, will not send event.");if(((_=n.data)==null?void 0:_.__sentry__)===!0)return p;const m=rh(this,i,p,n);return nh(m,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const S=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",S)}throw As(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const g=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,S=p.spans?p.spans.length:0,L=g-S;L>0&&this.recordDroppedEvent("before_send","span",L)}const m=p.transaction_info;if(c&&m&&p.transaction!==t.transaction){const g="custom";p.transaction_info={...m,source:g}}return this.sendEvent(p,n),p}).then(null,p=>{throw ua(p)||ca(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Mr(`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===Gi&&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(){x&&b.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){x&&b.log("No outcomes to send");return}if(!this._dsn){x&&b.log("No dsn provided, will not send outcomes");return}x&&b.log("Sending outcomes:",t);const n=Jp(t,this._options.tunnel&&In(this._dsn));this.sendEnvelope(n)}}function da(e){return e==="replay_event"?"replay":e||"error"}function nh(e,t){const n=`${t} must return \`null\` or a valid event.`;if(vn(e))return e.then(r=>{if(!Fn(r)&&r!==null)throw Mr(n);return r},r=>{throw Mr(`${t} rejected with ${r}`)});if(!Fn(e)&&e!==null)throw Mr(n);return e}function rh(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o,ignoreSpans:c}=t;let a=n;if(ai(a)&&s)return s(a,r);if(xu(a)){if(o||c){const u=Zp(a);if(c!=null&&c.length&&qr(u,c))return null;if(o){const d=o(u);d?a=Kn(n,Qp(d)):ti()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(c!=null&&c.length&&qr(p,c)){Nf(l,p);continue}if(o){const h=o(p);h?d.push(h):(ti(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function ai(e){return e.type===void 0}function xu(e){return e.type==="transaction"}function sh(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Mu(e.attributes)}function ih(e){let t=0;return e.message&&(t+=e.message.length*2),t+Mu(e.attributes)}function Mu(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*fa(n[0]):un(n)?t+=fa(n):t+=100}),t}function fa(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function oh(e){return cs(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function pa(e){return oh(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function ah(e,t){t.debug===!0&&(x?b.enable():ht(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),ee().update(t.initialScope);const r=new e(t);return ch(r),r.init(),r}function ch(e){ee().setClient(e)}const uh="thismessage:/";function Ki(e){return"isRelative"in e}function Xi(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?uh: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 lh(e){if(Ki(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 Ht(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 dh(e){return e.split(/[?#]/,1)[0]}function Et(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 fh(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return hh(e,n)||ph(e,r)}function ph(e,t){return t?ha(e)===ha(t):!1}function hh(e,t){const n=Xi(e);return!n||Ki(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function ha(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function mh(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Au(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:Ft})),s.version=Ft)}function Nu(e={}){const t=e.client||j();if(!Ap()||!t)return{};const n=qt(),r=Tn(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||ee(),i=e.span||Te(),o=i?kf(i):_h(s),c=i?ft(i):su(t,s),a=lf(c);if(!Kc.test(o))return b.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(d.traceparent=i?Cf(i):gh(s)),d}function _h(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Xc(t,r,n)}function gh(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Jc(t,r,n)}function yh(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0: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 d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const Sh=100;function kt(e,t){const n=j(),r=Ce();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Sh}=n.getOptions();if(i<=0)return;const c={timestamp:Gt(),...e},a=s?ht(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let ma;const bh="FunctionToString",_a=new WeakMap,Eh=()=>({name:bh,setupOnce(){ma=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Fi(this),n=_a.has(j())&&t!==void 0?t:this;return ma.apply(n,e)}}catch{}},setup(e){_a.set(e,!0)}}),vh=Eh,Th=[/^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/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],wh="EventFilters",Ih=(e={})=>{let t;return{name:wh,setup(n){const r=n.getOptions();t=ga(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=ga(e,i)}return Ch(n,t)?null:n}}},kh=(e={})=>({...Ih(e),name:"InboundFilters"});function ga(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Th],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Ch(e,t){if(e.type){if(e.type==="transaction"&&xh(e,t.ignoreTransactions))return x&&b.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${Nt(e)}`),!0}else{if(Rh(e,t.ignoreErrors))return x&&b.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${Nt(e)}`),!0;if(Lh(e))return x&&b.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${Nt(e)}`),!0;if(Mh(e,t.denyUrls))return x&&b.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${Nt(e)}.
Url: ${Vr(e)}`),!0;if(!Ah(e,t.allowUrls))return x&&b.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${Nt(e)}.
Url: ${Vr(e)}`),!0}return!1}function Rh(e,t){return t!=null&&t.length?ku(e).some(n=>it(n,t)):!1}function xh(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?it(n,t):!1}function Mh(e,t){if(!(t!=null&&t.length))return!1;const n=Vr(e);return n?it(n,t):!1}function Ah(e,t){if(!(t!=null&&t.length))return!0;const n=Vr(e);return n?it(n,t):!0}function Nh(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Vr(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?Nh(s):null}catch{return x&&b.error(`Cannot extract url for event ${Nt(e)}`),null}}function Lh(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function Dh(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!ut(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=ci(e,t,r,i.originalException,n,s.exception.values,o,0))}function ci(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(ut(r[s],Error)){ya(o,c,r);const u=e(t,r[s]),d=a.length;Sa(u,s,d,c),a=ci(e,t,n,r[s],s,[u,...a],u,d)}return Lu(r)&&r.errors.forEach((u,d)=>{if(ut(u,Error)){ya(o,c,r);const l=e(t,u),f=a.length;Sa(l,`errors[${d}]`,f,c),a=ci(e,t,n,u,s,[l,...a],l,f)}}),a}function Lu(e){return Array.isArray(e.errors)}function ya(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Lu(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Sa(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Oh(e){const t="console";Rt(t,e),xt(t,Ph)}function Ph(){"console"in G&&Ed.forEach(function(e){e in G.console&&Ae(G.console,e,function(t){return Ur[e]=t,function(...n){Ge("console",{args:n,level:e});const s=Ur[e];s==null||s.apply(G.console,n)}})})}function Du(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Fh="Dedupe",$h=()=>{let e;return{name:Fh,processEvent(t){if(t.type)return t;try{if(Hh(t,e))return x&&b.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Bh=$h;function Hh(e,t){return t?!!(Uh(e,t)||Wh(e,t)):!1}function Uh(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Pu(e,t)||!Ou(e,t))}function Wh(e,t){const n=ba(t),r=ba(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Pu(e,t)||!Ou(e,t))}function Ou(e,t){let n=Mo(e),r=Mo(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<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function Pu(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function ba(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const zh="ConversationId",jh=()=>({name:zh,setup(e){e.on("spanStart",t=>{const n=ee().getScopeData(),r=Ce().getScopeData(),s=n.conversationId||r.conversationId;s&&t.setAttribute(nf,s)})}}),qh=jh;function Vh(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Ye()&&t(o);if(e.endTimestamp){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(c&&(Kh(h,e),Gh(h,e,s)),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!Te(),l=c&&d?It(Jh(o,i,a)):new wt;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h={...e.args[1]||{}},m=Yh(p,h,Ye()&&d?l:void 0,u);m&&(e.args[1]=h,h.headers=m)}const f=j();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function Gh(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function Yh(e,t,n,r){const s=Nu({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(Oi(e)?e.headers:void 0);if(a)if(Xh(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 d=u.get("baggage");d?pr(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&pr(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(m=>pr(m)):pr(l));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function Kh(e,t){var n,r;if(t.response){jc(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:Se,message:"internal_error"});e.end()}function pr(e){return e.split(",").some(t=>t.trim().startsWith(jr))}function Xh(e){return typeof Headers<"u"&&ut(e,Headers)}function Jh(e,t,n){if(e.startsWith("data:")){const i=Et(e);return{name:`${t} ${i}`,attributes:Ea(e,void 0,t,n)}}const r=Xi(e),s=r?lh(r):e;return{name:`${t} ${s}`,attributes:Ea(e,r,t,n)}}function Ea(e,t,n,r){const s={url:Et(e),type:"fetch","http.method":n,[pe]:r,[dt]:"http.client"};return t&&(Ki(t)||(s["http.url"]=Et(t.href),s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function Zh(e,t={},n=ee()){const{message:r,name:s,email:i,url:o,source:c,associatedEventId:a,tags:u}=e,d={contexts:{feedback:{contact_email:i,name:s,message:r,url:o,source:c,associated_event_id:a}},type:"feedback",level:"info",tags:u},l=(n==null?void 0:n.getClient())||j();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Fu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Hn=G;function Qh(){return"history"in Hn&&!!Hn.history}function em(){if(!("fetch"in Hn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ui(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function tm(){var n;if(typeof EdgeRuntime=="string")return!0;if(!em())return!1;if(ui(Hn.fetch))return!0;let e=!1;const t=Hn.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=ui(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){x&&b.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function $u(e,t){const n="fetch";Rt(n,e),xt(n,()=>Bu(void 0,t))}function nm(e){const t="fetch-body-resolved";Rt(t,e),xt(t,()=>Bu(sm))}function Bu(e,t=!1){t&&!tm()||Ae(G,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=im(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:_e()*1e3,virtualError:s,headers:om(r)};return e||Ge("fetch",{...c}),n.apply(G,r).then(async a=>(e?e(a):Ge("fetch",{...c,endTimestamp:_e()*1e3,response:a}),a),a=>{Ge("fetch",{...c,endTimestamp:_e()*1e3,error:a}),cs(a)&&a.stack===void 0&&(a.stack=s.stack,De(a,"framesToPop",1));const u=j(),d=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!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;d==="always"?a.message=`${a.message} (${p})`:De(a,"__sentry_fetch_url_host__",p)}catch{}throw a})}})}async function rm(e,t){if(e!=null&&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 sm(e){let t;try{t=e.clone()}catch{return}rm(t,()=>{Ge("fetch-body-resolved",{endTimestamp:_e()*1e3,response:e})})}function Ar(e,t){return!!e&&typeof e=="object"&&!!e[t]}function va(e){return typeof e=="string"?e:e?Ar(e,"url")?e.url:e.toString?e.toString():"":""}function im(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:va(n),method:Ar(r,"method")?String(r.method).toUpperCase():Oi(n)&&Ar(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:va(t),method:Ar(t,"method")?String(t.method).toUpperCase():"GET"}}function om(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Oi(t))return new Headers(t.headers)}catch{}}function am(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function cm(){return"npm"}function um(){return!am()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Gr(){return typeof window<"u"&&(!um()||lm())}function lm(){const e=G.process;return(e==null?void 0:e.type)==="renderer"}const Qe=G,ie=Qe.document,An=Qe.navigator,Hu="Report a Bug",dm="Cancel",fm="Send Bug Report",pm="Confirm",hm="Report a Bug",mm="your.email@example.org",_m="Email",gm="What's the bug? What did you expect?",ym="Description",Sm="Your Name",bm="Name",Em="Thank you for your report!",vm="(required)",Tm="Add a screenshot",wm="Remove screenshot",Im="Highlight",km="Hide",Cm="Remove",Rm="widget",xm="api",Mm=5e3,Am=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=j();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&ee().setTags(e.tags);const r=Zh({source:xm,url:Vt(),...e},t);return new Promise((s,i)=>{const o=setTimeout(()=>i("Unable to determine if Feedback was correctly sent."),3e4),c=n.on("afterSendEvent",(a,u)=>{if(a.event_id===r)return clearTimeout(o),c(),u!=null&&u.statusCode&&u.statusCode>=200&&u.statusCode<300?s(r):(u==null?void 0:u.statusCode)===403?i("Unable to send feedback. This could be because this domain is not in your list of allowed domains."):i("Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},Nr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Nm(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(An.userAgent)||/Macintosh/i.test(An.userAgent)&&An.maxTouchPoints&&An.maxTouchPoints>1||!isSecureContext)}function hr(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{var n,r;(n=t.onFormOpen)==null||n.call(t),(r=e.onFormOpen)==null||r.call(e)},onFormClose:()=>{var n,r;(n=t.onFormClose)==null||n.call(t),(r=e.onFormClose)==null||r.call(e)},onSubmitSuccess:(n,r)=>{var s,i;(s=t.onSubmitSuccess)==null||s.call(t,n,r),(i=e.onSubmitSuccess)==null||i.call(e,n,r)},onSubmitError:n=>{var r,s;(r=t.onSubmitError)==null||r.call(t,n),(s=e.onSubmitError)==null||s.call(e,n)},onFormSubmitted:()=>{var n,r;(n=t.onFormSubmitted)==null||n.call(t),(r=e.onFormSubmitted)==null||r.call(e)},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function Lm(e){const t=ie.createElement("style");return t.textContent=`
.widget__actor {
position: fixed;
z-index: var(--z-index);
margin: var(--page-margin);
inset: var(--actor-inset);
display: flex;
align-items: center;
gap: 8px;
padding: 16px;
font-family: inherit;
font-size: var(--font-size);
font-weight: 600;
line-height: 1.14em;
text-decoration: none;
background: var(--actor-background, var(--background));
border-radius: var(--actor-border-radius, 1.7em/50%);
border: var(--actor-border, var(--border));
box-shadow: var(--actor-box-shadow, var(--box-shadow));
color: var(--actor-color, var(--foreground));
fill: var(--actor-color, var(--foreground));
cursor: pointer;
opacity: 1;
transition: transform 0.2s ease-in-out;
transform: translate(0, 0) scale(1);
}
.widget__actor[aria-hidden="true"] {
opacity: 0;
pointer-events: none;
visibility: hidden;
transform: translate(0, 16px) scale(0.98);
}
.widget__actor:hover {
background: var(--actor-hover-background, var(--background));
filter: var(--interactive-filter);
}
.widget__actor svg {
width: 1.14em;
height: 1.14em;
}
@media (max-width: 600px) {
.widget__actor span {
display: none;
}
}
`,e&&t.setAttribute("nonce",e),t}function He(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const Xt=20,Dm="http://www.w3.org/2000/svg";function Om(){const e=c=>Qe.document.createElementNS(Dm,c),t=He(e("svg"),{width:`${Xt}`,height:`${Xt}`,viewBox:`0 0 ${Xt} ${Xt}`,fill:"var(--actor-color, var(--foreground))"}),n=He(e("g"),{clipPath:"url(#clip0_57_80)"}),r=He(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const s=e("defs"),i=He(e("clipPath"),{id:"clip0_57_80"}),o=He(e("rect"),{width:`${Xt}`,height:`${Xt}`,fill:"white"});return i.appendChild(o),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(o),t}function Pm({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const s=ie.createElement("button");if(s.type="button",s.className="widget__actor",s.ariaHidden="false",s.ariaLabel=t||e||Hu,s.appendChild(Om()),e){const o=ie.createElement("span");o.appendChild(ie.createTextNode(e)),s.appendChild(o)}const i=Lm(r);return{el:s,appendToDom(){n.appendChild(i),n.appendChild(s)},removeFromDom(){s.remove(),i.remove()},show(){s.ariaHidden="false"},hide(){s.ariaHidden="true"}}}const Uu="rgba(88, 74, 192, 1)",Fm={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:Uu,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},Ta={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:Uu,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function wa(e){return`
--foreground: ${e.foreground};
--background: ${e.background};
--accent-foreground: ${e.accentForeground};
--accent-background: ${e.accentBackground};
--success-color: ${e.successColor};
--error-color: ${e.errorColor};
--border: ${e.border};
--box-shadow: ${e.boxShadow};
--outline: ${e.outline};
--interactive-filter: ${e.interactiveFilter};
`}function Ia({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const s=ie.createElement("style");return s.textContent=`
:host {
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
--font-size: 14px;
--z-index: 100000;
--page-margin: 16px;
--inset: auto 0 0 auto;
--actor-inset: var(--inset);
font-family: var(--font-family);
font-size: var(--font-size);
${e!=="system"?`color-scheme: only ${e};`:""}
${wa(e==="dark"?{...Ta,...t}:{...Fm,...n})}
}
${e==="system"?`
@media (prefers-color-scheme: dark) {
:host {
color-scheme: only dark;
${wa({...Ta,...t})}
}
}`:""}
`,r&&s.setAttribute("nonce",r),s}const $m=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:s="sentry-feedback",autoInject:i=!0,showBranding:o=!0,isEmailRequired:c=!1,isNameRequired:a=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:f={email:"email",name:"username"},tags:p,styleNonce:h,scriptNonce:m,colorScheme:_="system",themeLight:g={},themeDark:S={},addScreenshotButtonLabel:L=Tm,cancelButtonLabel:R=dm,confirmButtonLabel:H=pm,emailLabel:A=_m,emailPlaceholder:y=mm,formTitle:T=hm,isRequiredLabel:F=vm,messageLabel:E=ym,messagePlaceholder:k=gm,nameLabel:v=bm,namePlaceholder:C=Sm,removeScreenshotButtonLabel:M=wm,submitButtonLabel:J=fm,successMessageText:te=Em,triggerLabel:Y=Hu,triggerAriaLabel:I="",highlightToolText:N=Im,hideToolText:w=km,removeHighlightText:W=Cm,onFormOpen:U,onFormClose:ne,onSubmitSuccess:se,onSubmitError:Pe,onFormSubmitted:Fe}={})=>{const be={id:s,autoInject:i,showBranding:o,isEmailRequired:c,isNameRequired:a,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:m,colorScheme:_,themeDark:S,themeLight:g,triggerLabel:Y,triggerAriaLabel:I,cancelButtonLabel:R,submitButtonLabel:J,confirmButtonLabel:H,formTitle:T,emailLabel:A,emailPlaceholder:y,messageLabel:E,messagePlaceholder:k,nameLabel:v,namePlaceholder:C,successMessageText:te,isRequiredLabel:F,addScreenshotButtonLabel:L,removeScreenshotButtonLabel:M,highlightToolText:N,hideToolText:w,removeHighlightText:W,onFormClose:ne,onFormOpen:U,onSubmitError:Pe,onSubmitSuccess:se,onFormSubmitted:Fe};let ge=null,ze=null,$e=[];const Rn=K=>{if(!ge){const le=ie.createElement("div");le.id=String(K.id),ie.body.appendChild(le),ge=le.attachShadow({mode:"open"}),ze=Ia(K),ge.appendChild(ze)}return ge},lr=async K=>{const le=K.enableScreenshot&&Nm();let Re,Ee;try{Re=(t?t():await e("feedbackModalIntegration",m))(),ia(Re)}catch{throw Nr&&b.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const B=le?n?n():await e("feedbackScreenshotIntegration",m):void 0;B&&(Ee=B(),ia(Ee))}catch{Nr&&b.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const de=Re.createDialog({options:{...K,onFormClose:()=>{var B;de==null||de.close(),(B=K.onFormClose)==null||B.call(K)},onFormSubmitted:()=>{var B;de==null||de.close(),(B=K.onFormSubmitted)==null||B.call(K)}},screenshotIntegration:Ee,sendFeedback:Am,shadow:Rn(K)});return de},dr=(K,le={})=>{const Re=hr(be,le),Ee=typeof K=="string"?ie.querySelector(K):typeof K.addEventListener=="function"?K:null;if(!Ee)throw Nr&&b.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let de=null;const B=async()=>{de||(de=await lr({...Re,onFormSubmitted:()=>{var z;de==null||de.removeFromDom(),(z=Re.onFormSubmitted)==null||z.call(Re)}})),de.appendToDom(),de.open()};Ee.addEventListener("click",B);const we=()=>{$e=$e.filter(z=>z!==we),de==null||de.removeFromDom(),de=null,Ee.removeEventListener("click",B)};return $e.push(we),we},Ke=(K={})=>{const le=hr(be,K),Re=Rn(le),Ee=Pm({triggerLabel:le.triggerLabel,triggerAriaLabel:le.triggerAriaLabel,shadow:Re,styleNonce:h});return dr(Ee.el,{...le,onFormOpen(){Ee.hide()},onFormClose(){Ee.show()},onFormSubmitted(){Ee.show()}}),Ee};return{name:"Feedback",setupOnce(){!Gr()||!be.autoInject||(ie.readyState==="loading"?ie.addEventListener("DOMContentLoaded",()=>Ke().appendToDom()):Ke().appendToDom())},attachTo:dr,createWidget(K={}){const le=Ke(hr(be,K));return le.appendToDom(),le},async createForm(K={}){return lr(hr(be,K))},setTheme(K){if(be.colorScheme=K,ge){const le=Ia(be);ze?ge.replaceChild(le,ze):ge.prepend(le),ze=le}},remove(){var K;ge&&((K=ge.parentElement)==null||K.remove(),ge=null,ze=null),$e.forEach(le=>le()),$e=[]}}};var ps,ae,Wu,Lt,ka,zu,li,Un={},Ji=[],Bm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zi=Array.isArray;function St(e,t){for(var n in t)e[n]=t[n];return e}function ju(e){var t=e.parentNode;t&&t.removeChild(e)}function V(e,t,n){var r,s,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?ps.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Lr(e,o,r,s,null)}function Lr(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Wu,__i:-1,__u:0};return s==null&&ae.vnode!=null&&ae.vnode(i),i}function Qn(e){return e.children}function Dr(e,t){this.props=e,this.context=t}function hn(e,t){if(t==null)return e.__?hn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?hn(e):null}function Hm(e,t,n){var r,s=e.__v,i=s.__e,o=e.__P;if(o)return(r=St({},s)).__v=s.__v+1,ae.vnode&&ae.vnode(r),Qi(o,r,s,e.__n,o.ownerSVGElement!==void 0,32&s.__u?[i]:null,t,i??hn(s),!!(32&s.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&qu(r),r}function qu(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return qu(e)}}function Ca(e){(!e.__d&&(e.__d=!0)&&Lt.push(e)&&!Yr.__r++||ka!==ae.debounceRendering)&&((ka=ae.debounceRendering)||zu)(Yr)}function Yr(){var e,t,n,r=[],s=[];for(Lt.sort(li);e=Lt.shift();)e.__d&&(n=Lt.length,t=Hm(e,r,s)||t,n===0||Lt.length>n?(di(r,t,s),s.length=r.length=0,t=void 0,Lt.sort(li)):t&&ae.__c&&ae.__c(t,Ji));t&&di(r,t,s),Yr.__r=0}function Vu(e,t,n,r,s,i,o,c,a,u,d){var l,f,p,h,m,_=r&&r.__k||Ji,g=t.length;for(n.__d=a,Um(n,t,_),a=n.__d,l=0;l<g;l++)(p=n.__k[l])!=null&&typeof p!="boolean"&&typeof p!="function"&&(f=p.__i===-1?Un:_[p.__i]||Un,p.__i=l,Qi(e,p,f,s,i,o,c,a,u,d),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&eo(f.ref,null,p),d.push(p.ref,p.__c||h,p)),m==null&&h!=null&&(m=h),65536&p.__u||f.__k===p.__k?a=Gu(p,a,e):typeof p.type=="function"&&p.__d!==void 0?a=p.__d:h&&(a=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=a,n.__e=m}function Um(e,t,n){var r,s,i,o,c,a=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<a;r++)(s=e.__k[r]=(s=t[r])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Lr(null,s,null,null,s):Zi(s)?Lr(Qn,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?Lr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,c=Wm(s,n,o=r+l,d),s.__i=c,i=null,c!==-1&&(d--,(i=n[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&l--,typeof s.type!="function"&&(s.__u|=65536)):c!==o&&(c===o+1?l++:c>o?d>a-o?l+=c-o:l--:l=c<o&&c==o-1?c-o:0,c!==r+l&&(s.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=hn(i)),fi(i,i,!1),n[r]=null,d--);if(d)for(r=0;r<u;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=hn(i)),fi(i,i))}function Gu(e,t,n){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=Gu(r[s],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Wm(e,t,n,r){var s=e.key,i=e.type,o=n-1,c=n+1,a=t[n];if(a===null||a&&s==a.key&&i===a.type)return n;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||c<t.length;){if(o>=0){if((a=t[o])&&!(131072&a.__u)&&s==a.key&&i===a.type)return o;o--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&s==a.key&&i===a.type)return c;c++}}return-1}function Ra(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Bm.test(t)?n:n+"px"}function mr(e,t,n,r,s){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ra(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ra(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?Ma:xa,i)):e.removeEventListener(t,i?Ma:xa,i);else{if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function xa(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(ae.event?ae.event(e):e)}}function Ma(e){if(this.l)return this.l[e.type+!0](ae.event?ae.event(e):e)}function Qi(e,t,n,r,s,i,o,c,a,u){var d,l,f,p,h,m,_,g,S,L,R,H,A,y,T,F=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[c=t.__e=n.__e]),(d=ae.__b)&&d(t);e:if(typeof F=="function")try{if(g=t.props,S=(d=F.contextType)&&r[d.__c],L=d?S?S.props.value:d.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:("prototype"in F&&F.prototype.render?t.__c=l=new F(g,L):(t.__c=l=new Dr(g,L),l.constructor=F,l.render=jm),S&&S.sub(l),l.props=g,l.state||(l.state={}),l.context=L,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),F.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=St({},l.__s)),St(l.__s,F.getDerivedStateFromProps(g,l.__s))),p=l.props,h=l.state,l.__v=t,f)F.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(F.getDerivedStateFromProps==null&&g!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,L),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,L)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),R=0;R<l._sb.length;R++)l.__h.push(l._sb[R]);l._sb=[],l.__h.length&&o.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,L),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,h,m)})}if(l.context=L,l.props=g,l.__P=e,l.__e=!1,H=ae.__r,A=0,"prototype"in F&&F.prototype.render){for(l.state=l.__s,l.__d=!1,H&&H(t),d=l.render(l.props,l.state,l.context),y=0;y<l._sb.length;y++)l.__h.push(l._sb[y]);l._sb=[]}else do l.__d=!1,H&&H(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++A<25);l.state=l.__s,l.getChildContext!=null&&(r=St(St({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(p,h)),Vu(e,Zi(T=d!=null&&d.type===Qn&&d.key==null?d.props.children:d)?T:[T],t,n,r,s,i,o,c,a,u),l.base=t.__e,t.__u&=-161,l.__h.length&&o.push(l),_&&(l.__E=l.__=null)}catch(E){t.__v=null,a||i!=null?(t.__e=c,t.__u|=a?160:32,i[i.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),ae.__e(E,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=zm(n.__e,t,n,r,s,i,o,a,u);(d=ae.diffed)&&d(t)}function di(e,t,n){for(var r=0;r<n.length;r++)eo(n[r],n[++r],n[++r]);ae.__c&&ae.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){ae.__e(i,s.__v)}})}function zm(e,t,n,r,s,i,o,c,a){var u,d,l,f,p,h,m,_=n.props,g=t.props,S=t.type;if(S==="svg"&&(s=!0),i!=null){for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!S&&(S?p.localName===S:p.nodeType===3)){e=p,i[u]=null;break}}if(e==null){if(S===null)return document.createTextNode(g);e=s?document.createElementNS("http://www.w3.org/2000/svg",S):document.createElement(S,g.is&&g),i=null,c=!1}if(S===null)_===g||c&&e.data===g||(e.data=g);else{if(i=i&&ps.call(e.childNodes),_=n.props||Un,!c&&i!=null)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)p=_[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=p:u==="key"||u in g||mr(e,u,null,p,s));for(u in g)p=g[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?h=p:u=="checked"?m=p:u==="key"||c&&typeof p!="function"||_[u]===p||mr(e,u,p,_[u],s);if(d)c||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),Vu(e,Zi(f)?f:[f],t,n,r,s&&S!=="foreignObject",i,o,i?i[0]:n.__k&&hn(n,0),c,a),i!=null)for(u=i.length;u--;)i[u]!=null&&ju(i[u]);c||(u="value",h!==void 0&&(h!==e[u]||S==="progress"&&!h||S==="option"&&h!==_[u])&&mr(e,u,h,_[u],!1),u="checked",m!==void 0&&m!==e[u]&&mr(e,u,m,_[u],!1))}return e}function eo(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){ae.__e(r,n)}}function fi(e,t,n){var r,s;if(ae.unmount&&ae.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||eo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){ae.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&fi(r[s],t,n||typeof e.type!="function");n||e.__e==null||ju(e.__e),e.__=e.__e=e.__d=void 0}function jm(e,t,n){return this.constructor(e,n)}function qm(e,t,n){var r,s,i,o;ae.__&&ae.__(e,t),s=(r=!1)?null:t.__k,i=[],o=[],Qi(t,e=t.__k=V(Qn,null,[e]),s||Un,Un,t.ownerSVGElement!==void 0,s?null:t.firstChild?ps.call(t.childNodes):null,i,s?s.__e:t.firstChild,r,o),e.__d=void 0,di(i,e,o)}ps=Ji.slice,ae={__e:function(e,t,n,r){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,r||{}),o=s.__d),o)return s.__E=s}catch(c){e=c}throw e}},Wu=0,Dr.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=St({},this.state),typeof e=="function"&&(e=e(St({},n),this.props)),e&&St(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ca(this))},Dr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ca(this))},Dr.prototype.render=Qn,Lt=[],zu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,li=function(e,t){return e.__v.__b-t.__v.__b},Yr.__r=0;var pt,oe,Ns,Aa,mn=0,Yu=[],Or=[],fe=ae,Na=fe.__b,La=fe.__r,Da=fe.diffed,Oa=fe.__c,Pa=fe.unmount,Fa=fe.__;function Yt(e,t){fe.__h&&fe.__h(oe,e,mn||t),mn=0;var n=oe.__H||(oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Or}),n.__[e]}function Dt(e){return mn=1,Ku(Ju,e)}function Ku(e,t,n){var r=Yt(pt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ju(void 0,t),function(c){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,c);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=oe,!oe.u)){var s=function(c,a,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,c,a,u);var l=!1;return d.forEach(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===c)&&(!i||i.call(this,c,a,u))};oe.u=!0;var i=oe.shouldComponentUpdate,o=oe.componentWillUpdate;oe.componentWillUpdate=function(c,a,u){if(this.__e){var d=i;i=void 0,s(c,a,u),i=d}o&&o.call(this,c,a,u)},oe.shouldComponentUpdate=s}return r.__N||r.__}function Vm(e,t){var n=Yt(pt++,3);!fe.__s&&to(n.__H,t)&&(n.__=e,n.i=t,oe.__H.__h.push(n))}function Xu(e,t){var n=Yt(pt++,4);!fe.__s&&to(n.__H,t)&&(n.__=e,n.i=t,oe.__h.push(n))}function Gm(e){return mn=5,er(function(){return{current:e}},[])}function Ym(e,t,n){mn=6,Xu(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function er(e,t){var n=Yt(pt++,7);return to(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function an(e,t){return mn=8,er(function(){return e},t)}function Km(e){var t=oe.context[e.__c],n=Yt(pt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(oe)),t.props.value):e.__}function Xm(e,t){fe.useDebugValue&&fe.useDebugValue(t?t(e):e)}function Jm(e){var t=Yt(pt++,10),n=Dt();return t.__=e,oe.componentDidCatch||(oe.componentDidCatch=function(r,s){t.__&&t.__(r,s),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Zm(){var e=Yt(pt++,11);if(!e.__){for(var t=oe.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Qm(){for(var e;e=Yu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Pr),e.__H.__h.forEach(pi),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){oe=null,Na&&Na(e)},fe.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fa&&Fa(e,t)},fe.__r=function(e){La&&La(e),pt=0;var t=(oe=e.__c).__H;t&&(Ns===oe?(t.__h=[],oe.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Or,n.__N=n.i=void 0})):(t.__h.forEach(Pr),t.__h.forEach(pi),t.__h=[],pt=0)),Ns=oe},fe.diffed=function(e){Da&&Da(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Yu.push(t)!==1&&Aa===fe.requestAnimationFrame||((Aa=fe.requestAnimationFrame)||e_)(Qm)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Or&&(n.__=n.__V),n.i=void 0,n.__V=Or})),Ns=oe=null},fe.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Pr),n.__h=n.__h.filter(function(r){return!r.__||pi(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],fe.__e(r,n.__v)}}),Oa&&Oa(e,t)},fe.unmount=function(e){Pa&&Pa(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Pr(r)}catch(s){t=s}}),n.__H=void 0,t&&fe.__e(t,n.__v))};var $a=typeof requestAnimationFrame=="function";function e_(e){var t,n=function(){clearTimeout(r),$a&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);$a&&(t=requestAnimationFrame(n))}function Pr(e){var t=oe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),oe=t}function pi(e){var t=oe;e.__c=e.__(),oe=t}function to(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ju(e,t){return typeof t=="function"?t(e):t}const t_=Object.defineProperty({__proto__:null,useCallback:an,useContext:Km,useDebugValue:Xm,useEffect:Vm,useErrorBoundary:Jm,useId:Zm,useImperativeHandle:Ym,useLayoutEffect:Xu,useMemo:er,useReducer:Ku,useRef:Gm,useState:Dt},Symbol.toStringTag,{value:"Module"}),n_="http://www.w3.org/2000/svg";function r_(){const e=r=>ie.createElementNS(n_,r),t=He(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=He(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function s_({options:e}){const t=er(()=>({__html:r_().outerHTML}),[]);return V("h2",{class:"dialog__header"},V("span",{class:"dialog__title"},e.formTitle),e.showBranding?V("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function i_(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function Ls(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function o_({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:s,onSubmitSuccess:i,onSubmitError:o,showEmail:c,showName:a,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:m,isEmailRequired:_,isNameRequired:g,messageLabel:S,messagePlaceholder:L,nameLabel:R,namePlaceholder:H,submitButtonLabel:A,isRequiredLabel:y}=e,[T,F]=Dt(!1),[E,k]=Dt(null),[v,C]=Dt(!1),M=u==null?void 0:u.input,[J,te]=Dt(null),Y=an(w=>{te(w),C(!1)},[]),I=an(w=>{const W=i_(w,{emailLabel:h,isEmailRequired:_,isNameRequired:g,messageLabel:S,nameLabel:R});return W.length>0?k(`Please enter in the following required fields: ${W.join(", ")}`):k(null),W.length===0},[h,_,g,S,R]),N=an(async w=>{F(!0);try{if(w.preventDefault(),!(w.target instanceof HTMLFormElement))return;const W=new FormData(w.target),U=await(u&&v?u.value():void 0),ne={name:Ls(W,"name"),email:Ls(W,"email"),message:Ls(W,"message"),attachments:U?[U]:void 0};if(!I(ne))return;try{const se=await s({name:ne.name,email:ne.email,message:ne.message,source:Rm,tags:d},{attachments:ne.attachments});i(ne,se)}catch(se){Nr&&b.error(se),k(se),o(se)}}finally{F(!1)}},[u&&v,i,o]);return V("form",{class:"form",onSubmit:N},M&&v?V(M,{onError:Y}):null,V("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:T},V("div",{class:"form__top"},E?V("div",{class:"form__error-container"},E):null,a?V("label",{for:"name",class:"form__label"},V(Ds,{label:R,isRequiredLabel:y,isRequired:g}),V("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:H,required:g,type:"text"})):V("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),c?V("label",{for:"email",class:"form__label"},V(Ds,{label:h,isRequiredLabel:y,isRequired:_}),V("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:_,type:"email"})):V("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),V("label",{for:"message",class:"form__label"},V(Ds,{label:S,isRequiredLabel:y,isRequired:!0}),V("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:L,required:!0,rows:5})),M?V("label",{for:"screenshot",class:"form__label"},V("button",{class:"btn btn--default",disabled:T,type:"button",onClick:()=>{te(null),C(w=>!w)}},v?f:l),J?V("div",{class:"form__error-container"},J.message):null):null),V("div",{class:"btn-group"},V("button",{class:"btn btn--primary",disabled:T,type:"submit"},A),V("button",{class:"btn btn--default",disabled:T,type:"button",onClick:r},p))))}function Ds({label:e,isRequired:t,isRequiredLabel:n}){return V("span",{class:"form__label__text"},e,t&&V("span",{class:"form__label__text--required"},n))}const _r=16,Ba=17,a_="http://www.w3.org/2000/svg";function c_(){const e=a=>Qe.document.createElementNS(a_,a),t=He(e("svg"),{width:`${_r}`,height:`${Ba}`,viewBox:`0 0 ${_r} ${Ba}`,fill:"inherit"}),n=He(e("g"),{clipPath:"url(#clip0_57_156)"}),r=He(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),s=He(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(s,r);const i=e("defs"),o=He(e("clipPath"),{id:"clip0_57_156"}),c=He(e("rect"),{width:`${_r}`,height:`${_r}`,fill:"white",transform:"translate(0 0.5)"});return o.appendChild(c),i.appendChild(o),t.appendChild(i).appendChild(o).appendChild(c),t}function u_({open:e,onFormSubmitted:t,...n}){const r=n.options,s=er(()=>({__html:c_().outerHTML}),[]),[i,o]=Dt(null),c=an(()=>{i&&(clearTimeout(i),o(null)),t()},[i]),a=an((u,d)=>{n.onSubmitSuccess(u,d),o(setTimeout(()=>{t(),o(null)},Mm))},[t]);return V(Qn,null,i?V("div",{class:"success__position",onClick:c},V("div",{class:"success__content"},r.successMessageText,V("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):V("dialog",{class:"dialog",onClick:r.onFormClose,open:e},V("div",{class:"dialog__position"},V("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},V(s_,{options:r}),V(o_,{...n,onSubmitSuccess:a})))))}const l_=`
.dialog {
position: fixed;
z-index: var(--z-index);
margin: 0;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
height: 100vh;
width: 100vw;
color: var(--dialog-color, var(--foreground));
fill: var(--dialog-color, var(--foreground));
line-height: 1.75em;
background-color: rgba(0, 0, 0, 0.05);
border: none;
inset: 0;
opacity: 1;
transition: opacity 0.2s ease-in-out;
}
.dialog__position {
position: fixed;
z-index: var(--z-index);
inset: var(--dialog-inset);
padding: var(--page-margin);
display: flex;
max-height: calc(100vh - (2 * var(--page-margin)));
}
@media (max-width: 600px) {
.dialog__position {
inset: var(--page-margin);
padding: 0;
}
}
.dialog__position:has(.editor) {
inset: var(--page-margin);
padding: 0;
}
.dialog:not([open]) {
opacity: 0;
pointer-events: none;
visibility: hidden;
}
.dialog:not([open]) .dialog__content {
transform: translate(0, -16px) scale(0.98);
}
.dialog__content {
display: flex;
flex-direction: column;
gap: 16px;
padding: var(--dialog-padding, 24px);
max-width: 100%;
width: 100%;
max-height: 100%;
overflow: auto;
background: var(--dialog-background, var(--background));
border-radius: var(--dialog-border-radius, 20px);
border: var(--dialog-border, var(--border));
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
transform: translate(0, 0) scale(1);
transition: transform 0.2s ease-in-out;
}
`,d_=`
.dialog__header {
display: flex;
gap: 4px;
justify-content: space-between;
font-weight: var(--dialog-header-weight, 600);
margin: 0;
}
.dialog__title {
align-self: center;
width: var(--form-width, 272px);
}
@media (max-width: 600px) {
.dialog__title {
width: auto;
}
}
.dialog__position:has(.editor) .dialog__title {
width: auto;
}
.brand-link {
display: inline-flex;
}
.brand-link:focus-visible {
outline: var(--outline);
}
`,f_=`
.form {
display: flex;
overflow: auto;
flex-direction: row;
gap: 16px;
flex: 1 0;
}
.form fieldset {
border: none;
margin: 0;
padding: 0;
}
.form__right {
flex: 0 0 auto;
display: flex;
overflow: auto;
flex-direction: column;
justify-content: space-between;
gap: 20px;
width: var(--form-width, 100%);
}
.dialog__position:has(.editor) .form__right {
width: var(--form-width, 272px);
}
.form__top {
display: flex;
flex-direction: column;
gap: 8px;
}
.form__error-container {
color: var(--error-color);
fill: var(--error-color);
}
.form__label {
display: flex;
flex-direction: column;
gap: 4px;
margin: 0px;
}
.form__label__text {
display: flex;
gap: 4px;
align-items: center;
}
.form__label__text--required {
font-size: 0.85em;
}
.form__input {
font-family: inherit;
line-height: inherit;
background: transparent;
box-sizing: border-box;
border: var(--input-border, var(--border));
border-radius: var(--input-border-radius, 6px);
color: var(--input-color, inherit);
fill: var(--input-color, inherit);
font-size: var(--input-font-size, inherit);
font-weight: var(--input-font-weight, 500);
padding: 6px 12px;
}
.form__input::placeholder {
opacity: 0.65;
color: var(--input-placeholder-color, inherit);
filter: var(--interactive-filter);
}
.form__input:focus-visible {
outline: var(--input-focus-outline, var(--outline));
}
.form__input--textarea {
font-family: inherit;
resize: vertical;
}
.error {
color: var(--error-color);
fill: var(--error-color);
}
`,p_=`
.btn-group {
display: grid;
gap: 8px;
}
.btn {
line-height: inherit;
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
cursor: pointer;
font-family: inherit;
font-size: var(--button-font-size, inherit);
font-weight: var(--button-font-weight, 600);
padding: var(--button-padding, 6px 16px);
}
.btn[disabled] {
opacity: 0.6;
pointer-events: none;
}
.btn--primary {
color: var(--button-primary-color, var(--accent-foreground));
fill: var(--button-primary-color, var(--accent-foreground));
background: var(--button-primary-background, var(--accent-background));
border: var(--button-primary-border, var(--border));
border-radius: var(--button-primary-border-radius, 6px);
font-weight: var(--button-primary-font-weight, 500);
}
.btn--primary:hover {
color: var(--button-primary-hover-color, var(--accent-foreground));
fill: var(--button-primary-hover-color, var(--accent-foreground));
background: var(--button-primary-hover-background, var(--accent-background));
filter: var(--interactive-filter);
}
.btn--primary:focus-visible {
background: var(--button-primary-hover-background, var(--accent-background));
filter: var(--interactive-filter);
outline: var(--button-primary-focus-outline, var(--outline));
}
.btn--default {
color: var(--button-color, var(--foreground));
fill: var(--button-color, var(--foreground));
background: var(--button-background, var(--background));
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
font-weight: var(--button-font-weight, 500);
}
.btn--default:hover {
color: var(--button-color, var(--foreground));
fill: var(--button-color, var(--foreground));
background: var(--button-hover-background, var(--background));
filter: var(--interactive-filter);
}
.btn--default:focus-visible {
background: var(--button-hover-background, var(--background));
filter: var(--interactive-filter);
outline: var(--button-focus-outline, var(--outline));
}
`,h_=`
.success__position {
position: fixed;
inset: var(--dialog-inset);
padding: var(--page-margin);
z-index: var(--z-index);
}
.success__content {
background: var(--success-background, var(--background));
border: var(--success-border, var(--border));
border-radius: var(--success-border-radius, 1.7em/50%);
box-shadow: var(--success-box-shadow, var(--box-shadow));
font-weight: var(--success-font-weight, 600);
color: var(--success-color);
fill: var(--success-color);
padding: 12px 24px;
line-height: 1.75em;
display: grid;
align-items: center;
grid-auto-flow: column;
gap: 6px;
cursor: default;
}
.success__icon {
display: flex;
}
`;function m_(e){const t=ie.createElement("style");return t.textContent=`
:host {
--dialog-inset: var(--inset);
}
${l_}
${d_}
${f_}
${p_}
${h_}
`,e&&t.setAttribute("nonce",e),t}function __(){const e=ee().getUser(),t=Ce().getUser(),n=Wc().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const g_=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const s=r,i=e.useSentryUser,o=__(),c=ie.createElement("div"),a=m_(e.styleNonce);let u="";const d={get el(){return c},appendToDom(){!s.contains(a)&&!s.contains(c)&&(s.appendChild(a),s.appendChild(c))},removeFromDom(){c.remove(),a.remove(),ie.body.style.overflow=u},open(){var p,h;f(!0),(p=e.onFormOpen)==null||p.call(e),(h=j())==null||h.emit("openFeedbackWidget"),u=ie.body.style.overflow,ie.body.style.overflow="hidden"},close(){f(!1),ie.body.style.overflow=u}},l=t==null?void 0:t.createInput({h:V,hooks:t_,dialog:d,options:e}),f=p=>{qm(V(u_,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(i&&(o==null?void 0:o[i.name])||""),defaultEmail:String(i&&(o==null?void 0:o[i.email])||""),onFormClose:()=>{var h;f(!1),(h=e.onFormClose)==null||h.call(e)},onSubmit:n,onSubmitSuccess:(h,m)=>{var _;f(!1),(_=e.onSubmitSuccess)==null||_.call(e,h,m)},onSubmitError:h=>{var m;(m=e.onSubmitError)==null||m.call(e,h)},onFormSubmitted:()=>{var h;(h=e.onFormSubmitted)==null||h.call(e)},open:p}),c)};return d}});function y_({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function S_(e){const t=ie.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`
.editor {
display: flex;
flex-grow: 1;
flex-direction: column;
}
.editor__image-container {
justify-items: center;
padding: 15px;
position: relative;
height: 100%;
border-radius: var(--menu-border-radius, 6px);
background-color: ${n};
background-image: repeating-linear-gradient(
-145deg,
transparent,
transparent 8px,
${n} 8px,
${n} 11px
),
repeating-linear-gradient(
-45deg,
transparent,
transparent 15px,
${r} 15px,
${r} 16px
);
}
.editor__canvas-container {
width: 100%;
height: 100%;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.editor__canvas-container > * {
object-fit: contain;
position: absolute;
}
.editor__tool-container {
padding-top: 8px;
display: flex;
justify-content: center;
}
.editor__tool-bar {
display: flex;
gap: 8px;
}
.editor__tool {
display: flex;
padding: 8px 12px;
justify-content: center;
align-items: center;
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
background: var(--button-background, var(--background));
color: var(--button-color, var(--foreground));
}
.editor__tool--active {
background: var(--button-primary-background, var(--accent-background));
color: var(--button-primary-color, var(--accent-foreground));
}
.editor__rect {
position: absolute;
z-index: 2;
}
.editor__rect button {
opacity: 0;
position: absolute;
top: -12px;
right: -12px;
cursor: pointer;
padding: 0;
z-index: 3;
border: none;
background: none;
}
.editor__rect:hover button {
opacity: 1;
}
`,e&&t.setAttribute("nonce",e),t}function b_({h:e}){return function({action:n,setAction:r,options:s}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},s.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},s.hideToolText)))}}function E_({hooks:e}){function t(){const[n,r]=e.useState(Qe.devicePixelRatio??1);return e.useEffect(()=>{const s=()=>{r(Qe.devicePixelRatio)},i=matchMedia(`(resolution: ${Qe.devicePixelRatio}dppx)`);return i.addEventListener("change",s),()=>{i.removeEventListener("change",s)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:s,onAfterScreenshot:i,onError:o}){const c=t();e.useEffect(()=>{(async()=>{r();const u=await An.mediaDevices.getDisplayMedia({video:{width:Qe.innerWidth*c,height:Qe.innerHeight*c},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=ie.createElement("video");await new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{s(d,c),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),i()})().catch(o)},[])}}function v_(e,t,n){switch(e.type){case"highlight":{t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break}case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h);break}}function _t(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function Os(e,t){_t(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function Ps(e,t,n){_t(e,{alpha:!0},(r,s)=>{n.length&&(s.fillStyle="rgba(0, 0, 0, 0.25)",s.fillRect(0,0,r.width,r.height)),n.forEach(i=>{v_(i,s,t)})})}function T_({h:e,hooks:t,outputBuffer:n,dialog:r,options:s}){const i=E_({hooks:t}),o=b_({h:e}),c=y_({h:e}),a={__html:S_(s.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,m]=t.useState([]),_=t.useRef(null),g=t.useRef(null),S=t.useRef(null),L=t.useRef(null),[R,H]=t.useState(1),A=t.useMemo(()=>{const v=ie.getElementById(s.id);if(!v)return"white";const C=getComputedStyle(v);return C.getPropertyValue("--button-primary-background")||C.getPropertyValue("--accent-background")},[s.id]);t.useLayoutEffect(()=>{const v=()=>{const C=_.current;C&&(_t(l.canvas,{alpha:!1},M=>{const J=Math.min(C.clientWidth/M.width,C.clientHeight/M.height);H(J)}),(C.clientHeight===0||C.clientWidth===0)&&setTimeout(v,0))};return v(),Qe.addEventListener("resize",v),()=>{Qe.removeEventListener("resize",v)}},[l]);const y=t.useCallback((v,C)=>{_t(v,{alpha:!0},(M,J)=>{J.scale(C,C),M.width=l.canvas.width,M.height=l.canvas.height})},[l]);t.useEffect(()=>{y(g.current,l.dpi),Os(g.current,l.canvas)},[l]),t.useEffect(()=>{y(S.current,l.dpi),_t(S.current,{alpha:!0},(v,C)=>{C.clearRect(0,0,v.width,v.height)}),Ps(S.current,A,h)},[h,A]),t.useEffect(()=>{y(n,l.dpi),Os(n,l.canvas),_t(ie.createElement("canvas"),{alpha:!0},(v,C)=>{C.scale(l.dpi,l.dpi),v.width=l.canvas.width,v.height=l.canvas.height,Ps(v,A,h),Os(n,v)})},[h,l,A]);const T=v=>{if(!f||!L.current)return;const C=L.current.getBoundingClientRect(),M={type:f,x:v.offsetX/R,y:v.offsetY/R},J=(I,N)=>{const w=(N.clientX-C.x)/R,W=(N.clientY-C.y)/R;return{type:I.type,x:Math.min(I.x,w),y:Math.min(I.y,W),w:Math.abs(w-I.x),h:Math.abs(W-I.y)}},te=I=>{_t(S.current,{alpha:!0},(N,w)=>{w.clearRect(0,0,N.width,N.height)}),Ps(S.current,A,[...h,J(M,I)])},Y=I=>{const N=J(M,I);N.w*R>=1&&N.h*R>=1&&m(w=>[...w,N]),ie.removeEventListener("mousemove",te),ie.removeEventListener("mouseup",Y)};ie.addEventListener("mousemove",te),ie.addEventListener("mouseup",Y)},F=t.useCallback(v=>C=>{C.preventDefault(),C.stopPropagation(),m(M=>{const J=[...M];return J.splice(v,1),J})},[]),E={width:`${l.canvas.width*R}px`,height:`${l.canvas.height*R}px`},k=v=>{v.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:s.styleNonce,dangerouslySetInnerHTML:a}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:_},e("canvas",{ref:g,id:"background",style:E}),e("canvas",{ref:S,id:"foreground",style:E}),e("div",{ref:L,onMouseDown:T,style:E},h.map((v,C)=>e("div",{key:C,class:"editor__rect",style:{top:`${v.y*R}px`,left:`${v.x*R}px`,width:`${v.w*R}px`,height:`${v.h*R}px`}},e("button",{"aria-label":s.removeHighlightText,onClick:F(C),onMouseDown:k,onMouseUp:k,type:"button"},e(c,null))))))),e(o,{options:s,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((m,_)=>{_t(ie.createElement("canvas"),{alpha:!1},(g,S)=>{S.scale(_,_),g.width=m.videoWidth,g.height=m.videoHeight,S.drawImage(m,0,0,g.width,g.height),h({canvas:g,dpi:_})}),n.width=m.videoWidth,n.height=m.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(m=>{u.display="block",f(m)},[])}),p?e(d,{screenshot:p}):e("div",null)}}const w_=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const s=ie.createElement("canvas");return{input:T_({h:e,hooks:t,outputBuffer:s,dialog:n,options:r}),value:async()=>{const i=await new Promise(o=>{s.toBlob(o,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}),X=G;let hi=0;function Zu(){return hi>0}function I_(){hi++,setTimeout(()=>{hi--})}function _n(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(Fi(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>_n(o,t));return e.apply(this,i)}catch(i){throw I_(),ls(o=>{o.addEventProcessor(c=>(t.mechanism&&(Zs(c,void 0),ln(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),fs(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}$c(r,e),De(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function no(){const e=Vt(),{referrer:t}=X.document||{},{userAgent:n}=X.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const I0=$m({getModalIntegration:()=>g_,getScreenshotIntegration:()=>w_});function ro(e,t){const n=so(e,t),r={type:M_(t),value:A_(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function k_(e,t,n,r){const s=j(),i=s==null?void 0:s.getOptions().normalizeDepth,o=P_(t),c={__serialized__:iu(t,i)};if(o)return{exception:{values:[ro(e,o)]},extra:c};const a={exception:{values:[{type:us(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:D_(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=so(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function Fs(e,t){return{exception:{values:[ro(e,t)]}}}function so(e,t){const n=t.stacktrace||t.stack||"",r=R_(t),s=x_(t);try{return e(n,r,s)}catch{}return[]}const C_=/Minified React error #\d+;/i;function R_(e){return e&&C_.test(e.message)?1:0}function x_(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Qu(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function M_(e){const t=e==null?void 0:e.name;return!t&&Qu(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function A_(e){const t=e==null?void 0:e.message;return Qu(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?pa(t.error):pa(e):"No error message"}function N_(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=io(e,t,s,r);return ln(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),Zn(i)}function L_(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=mi(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),Zn(o)}function io(e,t,n,r,s){let i;if(Oc(t)&&t.error)return Fs(e,t.error);if(No(t)||Nd(t)){const o=t;if("stack"in t)i=Fs(e,t);else{const c=o.name||(No(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=mi(e,a,n,r),Zs(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return cs(t)?Fs(e,t):Fn(t)||us(t)?(i=k_(e,t,n,s),ln(i,{synthetic:!0}),i):(i=mi(e,t,n,r),Zs(i,`${t}`),ln(i,{synthetic:!0}),i)}function mi(e,t,n,r){const s={};if(r&&n){const i=so(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),ln(s,{synthetic:!0})}if(Di(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 D_(e,{isUnhandledRejection:t}){const n=$d(e),r=t?"promise rejection":"exception";return Oc(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:us(e)?`Event \`${O_(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function O_(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function P_(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class F_ extends th{constructor(t){var d;const n=$_(t),r=X.SENTRY_SDK_SOURCE||cm();Au(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.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==null?void 0:c.enableMetrics)??!0;X.document&&(i||o||u)&&X.document.addEventListener("visibilitychange",()=>{X.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&oi(this),u&&bu(this))}),s&&this.on("beforeSendSession",mh)}eventFromException(t,n){return N_(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return L_(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 $_(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=X.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const zt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,P=G,B_=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",tr=(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=B_(t.value,n),e(t)))}},nr=(e=!0)=>{var n,r;const t=(r=(n=P.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},kn=()=>{const e=nr();return(e==null?void 0:e.activationStart)??0};function vt(e,t,n){P.document&&P.addEventListener(e,t,n)}function Kr(e,t,n){P.document&&P.removeEventListener(e,t,n)}let cn=-1;const el=new Set,H_=()=>{var e,t;return((e=P.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=P.document)!=null&&t.prerendering)?0:1/0},Fr=e=>{if(U_(e)&&cn>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of el)t();isFinite(cn)||(cn=e.type==="visibilitychange"?e.timeStamp:0,Kr("prerenderingchange",Fr,!0))}},rr=()=>{var e;if(P.document&&cn<0){const t=kn();cn=(P.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??H_(),vt("visibilitychange",Fr,!0),vt("pagehide",Fr,!0),vt("prerenderingchange",Fr,!0)}return{get firstHiddenTime(){return cn},onHidden(t){el.add(t)}}};function U_(e){var t;return e.type==="pagehide"||((t=P.document)==null?void 0:t.visibilityState)==="hidden"}const W_=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,sr=(e,t=-1)=>{var i,o;const n=nr();let r="navigate";return n&&((i=P.document)!=null&&i.prerendering||kn()>0?r="prerender":(o=P.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:W_(),navigationType:r}},$s=new WeakMap;function oo(e,t){try{return $s.get(e)||$s.set(e,new t),$s.get(e)}catch{return new t}}class Xr{constructor(){Xr.prototype.__init.call(this),Xr.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;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]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const Cn=(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{}},ao=e=>{let t=!1;return()=>{t||(e(),t=!0)}},hs=e=>{var t;(t=P.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},z_=[1800,3e3],j_=(e,t={})=>{hs(()=>{const n=rr(),r=sr("FCP");let s;const o=Cn("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-kn(),0),r.entries.push(a),s(!0)))});o&&(s=tr(e,r,z_,t.reportAllChanges))})},q_=[.1,.25],V_=(e,t={})=>{j_(ao(()=>{var a;const n=sr("CLS",0);let r;const s=rr(),i=oo(t,Xr),o=u=>{for(const d of u)i._processEntry(d);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=Cn("layout-shift",o);c&&(r=tr(e,n,q_,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=P==null?void 0:P.setTimeout)==null||a.call(P,r))}))};let tl=0,Bs=1/0,gr=0;const G_=e=>{e.forEach(t=>{t.interactionId&&(Bs=Math.min(Bs,t.interactionId),gr=Math.max(gr,t.interactionId),tl=gr?(gr-Bs)/7+1:0)})};let _i;const nl=()=>_i?tl:performance.interactionCount||0,Y_=()=>{"interactionCount"in performance||_i||(_i=Cn("event",G_,{type:"event",buffered:!0,durationThreshold:0}))},Hs=10;let rl=0;const K_=()=>nl()-rl;class Jr{constructor(){Jr.prototype.__init.call(this),Jr.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){rl=nl(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(K_()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.call(this,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.length<Hs||t.duration>n._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((o,c)=>c._latency-o._latency),this._longestInteractionList.length>Hs){const o=this._longestInteractionList.splice(Hs);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const sl=e=>{var n;const t=P.requestIdleCallback||P.setTimeout;((n=P.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=ao(e),vt("visibilitychange",e,{once:!0,capture:!0}),vt("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Kr("visibilitychange",e,{capture:!0}),Kr("pagehide",e,{capture:!0})}))},X_=[200,500],J_=40,Z_=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=rr();hs(()=>{Y_();const r=sr("INP");let s;const i=oo(t,Jr),o=a=>{sl(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=Cn("event",o,{durationThreshold:t.durationThreshold??J_});s=tr(e,r,X_,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class Q_{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const eg=[2500,4e3],tg=(e,t={})=>{hs(()=>{const n=rr(),r=sr("LCP");let s;const i=oo(t,Q_),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-kn(),0),r.entries=[u],s())},c=Cn("largest-contentful-paint",o);if(c){s=tr(e,r,eg,t.reportAllChanges);const a=ao(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&(sl(a),Kr(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])vt(d,u,{capture:!0})}})},ng=[800,1800],gi=e=>{var t,n;(t=P.document)!=null&&t.prerendering?hs(()=>gi(e)):((n=P.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>gi(e),!0):setTimeout(e)},rg=(e,t={})=>{const n=sr("TTFB"),r=tr(e,n,ng,t.reportAllChanges);gi(()=>{const s=nr();s&&(n.value=Math.max(s.responseStart-kn(),0),n.entries=[s],r(!0))})},Nn={},Zr={};let il,ol,al,cl;function co(e,t=!1){return ms("cls",e,ig,il,t)}function uo(e,t=!1){return ms("lcp",e,og,ol,t)}function sg(e){return ms("ttfb",e,ag,al)}function ul(e){return ms("inp",e,cg,cl)}function jt(e,t){return ll(e,t),Zr[e]||(ug(e),Zr[e]=!0),dl(e,t)}function ir(e,t){const n=Nn[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){zt&&b.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${ct(r)}
Error:`,s)}}function ig(){return V_(e=>{ir("cls",{metric:e}),il=e},{reportAllChanges:!0})}function og(){return tg(e=>{ir("lcp",{metric:e}),ol=e},{reportAllChanges:!0})}function ag(){return rg(e=>{ir("ttfb",{metric:e}),al=e})}function cg(){return Z_(e=>{ir("inp",{metric:e}),cl=e})}function ms(e,t,n,r,s=!1){ll(e,t);let i;return Zr[e]||(i=n(),Zr[e]=!0),r&&t({metric:r}),dl(e,t,s?i:void 0)}function ug(e){const t={};e==="event"&&(t.durationThreshold=0),Cn(e,n=>{ir(e,{entries:n})},t)}function ll(e,t){Nn[e]=Nn[e]||[],Nn[e].push(t)}function dl(e,t,n){return()=>{n&&n();const r=Nn[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function lg(e){return"duration"in e}const dg=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=P.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};vt("visibilitychange",t,{capture:!0,once:!0}),vt("pagehide",t,{capture:!0,once:!0})};function Us(e){return typeof e=="number"&&isFinite(e)}function Ct(e,t,n,{...r}){const s=Z(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ji(e,()=>{const i=It({startTime:t,...r});return i&&i.end(n),i})}function lo(e){var _;const t=j();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=ee(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch{}const m={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=P.navigator)==null?void 0:_.userAgent,"client.address":a?"{{auto}}":void 0,...s};return It({name:n,attributes:m,startTime:i,experimental:{standalone:!0}})}function or(){return P.addEventListener&&P.performance}function me(e){return e/1e3}function fg(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 fl(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function pl(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}dg(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function pg(e){let t=0,n;if(!fl("layout-shift"))return;const r=co(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);pl(e,(s,i)=>{hg(t,n,i,s),r()})}function hg(e,t,n,r){var u;zt&&b.log(`Sending CLS span (${e})`);const s=t?me((Oe()||0)+t.startTime):_e(),i=ee().getScopeData().transactionName,o=t?Le((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[pe]:"auto.http.browser.cls",[dt]:"ui.webvital.cls",[wn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{c[`cls.source.${l+1}`]=Le(d.node)});const a=lo({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[Xn]:"",[Jn]:e}),a.end(s))}function mg(e){let t=0,n;if(!fl("largest-contentful-paint"))return;const r=uo(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);pl(e,(s,i)=>{_g(t,n,i,s),r()})}function _g(e,t,n,r){zt&&b.log(`Sending LCP span (${e})`);const s=me((Oe()||0)+((t==null?void 0:t.startTime)||0)),i=ee().getScopeData().transactionName,o=t?Le(t.element):"Largest contentful paint",c={[pe]:"auto.http.browser.lcp",[dt]:"ui.webvital.lcp",[wn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=Le(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=lo({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[Xn]:"millisecond",[Jn]:e}),a.end(s))}function qe(e){return e&&((Oe()||performance.timeOrigin)+e)/1e3}function hl(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=fg(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return Oe()||(n=or())!=null&&n.timeOrigin?gg({...t,"http.request.redirect_start":qe(e.redirectStart),"http.request.redirect_end":qe(e.redirectEnd),"http.request.worker_start":qe(e.workerStart),"http.request.fetch_start":qe(e.fetchStart),"http.request.domain_lookup_start":qe(e.domainLookupStart),"http.request.domain_lookup_end":qe(e.domainLookupEnd),"http.request.connect_start":qe(e.connectStart),"http.request.secure_connection_start":qe(e.secureConnectionStart),"http.request.connection_end":qe(e.connectEnd),"http.request.request_start":qe(e.requestStart),"http.request.response_start":qe(e.responseStart),"http.request.response_end":qe(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function gg(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const yg=2147483647;let Ha=0,Ze={},Me,tn;function Sg({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=or();if(r&&Oe()){r.mark&&P.performance.mark("sentry-tracing-init");const s=t?mg(n):wg(),i=Ig(),o=e?pg(n):Tg();return()=>{s==null||s(),i(),o==null||o()}}return()=>{}}function bg(){jt("longtask",({entries:e})=>{const t=Te();if(!t)return;const{op:n,start_timestamp:r}=Z(t);for(const s of e){const i=me(Oe()+s.startTime),o=me(s.duration);n==="navigation"&&r&&i<r||Ct(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[pe]:"auto.ui.browser.metrics"}})}})}function Eg(){new PerformanceObserver(t=>{const n=Te();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=me(Oe()+r.startTime),{start_timestamp:i,op:o}=Z(n);if(o==="navigation"&&i&&s<i)continue;const c=me(r.duration),a={[pe]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=d,a["browser.script.invoker_type"]=l,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),Ct(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function vg(){jt("event",({entries:e})=>{const t=Te();if(t){for(const n of e)if(n.name==="click"){const r=me(Oe()+n.startTime),s=me(n.duration),i={name:Le(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[pe]:"auto.ui.browser.metrics"}},o=Fc(n.target);o&&(i.attributes["ui.component_name"]=o),Ct(t,r,r+s,i)}}})}function Tg(){return co(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ze.cls={value:e.value,unit:""},tn=t)},!0)}function wg(){return uo(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ze.lcp={value:e.value,unit:"millisecond"},Me=t)},!0)}function Ig(){return sg(({metric:e})=>{e.entries[e.entries.length-1]&&(Ze.ttfb={value:e.value,unit:"millisecond"})})}function kg(e,t){const n=or(),r=Oe();if(!(n!=null&&n.getEntries)||!r)return;const s=me(r),i=n.getEntries(),{op:o,start_timestamp:c}=Z(e);i.slice(Ha).forEach(a=>{const u=me(a.startTime),d=me(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u<c))switch(a.entryType){case"navigation":{Mg(e,a,s);break}case"mark":case"paint":case"measure":{Rg(e,a,u,d,s,t.ignorePerformanceApiSpans);const l=rr(),f=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&f&&(Ze.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(Ze.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{Lg(e,a,a.name,u,d,s,t.ignoreResourceSpans);break}}}),Ha=Math.max(i.length-1,0),Dg(e),o==="pageload"&&(Fg(Ze),t.recordClsOnPageloadSpan||delete Ze.cls,t.recordLcpOnPageloadSpan||delete Ze.lcp,Object.entries(Ze).forEach(([a,u])=>{Zf(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",kn()),Og(e,t)),Me=void 0,tn=void 0,Ze={}}function Cg(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Rg(e,t,n,r,s,i){if(Cg(t)||["mark","measure"].includes(t.entryType)&&it(t.name,i))return;const o=nr(!1),c=me(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[pe]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),xg(l,t),a<=d&&Ct(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function xg(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&un(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(un(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Mg(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{yr(e,t,r,n)}),yr(e,t,"secureConnection",n,"TLS/SSL"),yr(e,t,"fetch",n,"cache"),yr(e,t,"domainLookup",n,"DNS"),Ng(e,t,n)}function yr(e,t,n,r,s=n){const i=Ag(n),o=t[i],c=t[`${n}Start`];!c||!o||Ct(e,r+me(c),r+me(o),{op:`browser.${s}`,name:t.name,attributes:{[pe]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Ag(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Ng(e,t,n){const r=n+me(t.requestStart),s=n+me(t.responseEnd),i=n+me(t.responseStart);t.responseEnd&&(Ct(e,r,s,{op:"browser.request",name:t.name,attributes:{[pe]:"auto.ui.browser.metrics"}}),Ct(e,i,s,{op:"browser.response",name:t.name,attributes:{[pe]:"auto.ui.browser.metrics"}}))}function Lg(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!=null&&o.includes(c))return;const a={[pe]:"auto.resource.browser.metrics"},u=Ht(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(P.location.origin),Pg(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 d={...a,...hl(t)},l=i+r,f=l+s;Ct(e,l,f,{name:n.replace(P.location.origin,""),op:c,attributes:d})}function Dg(e){const t=P.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Us(n.rtt)&&(Ze["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Us(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Us(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Og(e,t){Me&&t.recordLcpOnPageloadSpan&&(Me.element&&e.setAttribute("lcp.element",Le(Me.element)),Me.id&&e.setAttribute("lcp.id",Me.id),Me.url&&e.setAttribute("lcp.url",Me.url.trim().slice(0,200)),Me.loadTime!=null&&e.setAttribute("lcp.loadTime",Me.loadTime),Me.renderTime!=null&&e.setAttribute("lcp.renderTime",Me.renderTime),e.setAttribute("lcp.size",Me.size)),tn!=null&&tn.sources&&t.recordClsOnPageloadSpan&&tn.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Le(n.node)))}function Pg(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<yg||typeof i=="string")&&(t[s]=i)})}function Fg(e){const t=nr(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function $g(){return or()&&Oe()?jt("element",Bg):()=>{}}const Bg=({entries:e})=>{const t=Te(),n=t?ve(t):void 0,r=n?Z(n).description:ee().getScopeData().transactionName;e.forEach(s=>{var p,h;const i=s;if(!i.identifier)return;const o=i.name,c=i.renderTime,a=i.loadTime,[u,d]=a?[me(a),"load-time"]:c?[me(c),"render-time"]:[_e(),"entry-emission"],l=o==="image-paint"?me(Math.max(0,(c??0)-(a??0))):0,f={[pe]:"auto.ui.browser.elementtiming",[dt]:"ui.elementtiming",[Ne]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":i.id,"element.type":((h=(p=i.element)==null?void 0:p.tagName)==null?void 0:h.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};sp({name:`element[${i.identifier}]`,attributes:f,startTime:u,onlyIfParent:!0},m=>{m.end(u+l)})})},Hg=1e3;let Ua,yi,Si;function ml(e){const t="dom";Rt(t,e),xt(t,Ug)}function Ug(){if(!P.document)return;const e=Ge.bind(null,"dom"),t=Wa(e,!0);P.document.addEventListener("click",t,!1),P.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=P[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(Ae(s,"addEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){const p=Wa(e);f.handler=p,c.call(this,a,p,d)}f.refCount++}catch{}return c.call(this,a,u,d)}}),Ae(s,"removeEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,d),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,d)}}))})}function Wg(e){if(e.type!==yi)return!1;try{if(!e.target||e.target._sentryId!==Si)return!1}catch{}return!0}function zg(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Wa(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=jg(n);if(zg(n.type,r))return;De(n,"_sentryCaptured",!0),r&&!r._sentryId&&De(r,"_sentryId",Ue());const s=n.type==="keypress"?"input":n.type;Wg(n)||(e({event:n,name:s,global:t}),yi=n.type,Si=r?r._sentryId:void 0),clearTimeout(Ua),Ua=P.setTimeout(()=>{Si=void 0,yi=void 0},Hg)}}function jg(e){try{return e.target}catch{return null}}let Sr;function _s(e){const t="history";Rt(t,e),xt(t,qg)}function qg(){if(P.addEventListener("popstate",()=>{const t=P.location.href,n=Sr;if(Sr=t,n===t)return;Ge("history",{from:n,to:t})}),!Qh())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=Sr,i=Vg(String(r));if(Sr=i,s===i)return t.apply(this,n);Ge("history",{from:s,to:i})}return t.apply(this,n)}}Ae(P.history,"pushState",e),Ae(P.history,"replaceState",e)}function Vg(e){try{return new URL(e,P.location.origin).toString()}catch{return e}}const $r={};function _l(e){const t=$r[e];if(t)return t;let n=P[e];if(ui(n))return $r[e]=n.bind(P);const r=P.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!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){zt&&b.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&($r[e]=n.bind(P))}function Gg(e){$r[e]=void 0}function ar(...e){return _l("setTimeout")(...e)}const Ot="__sentry_xhr_v3__";function gl(e){const t="xhr";Rt(t,e),xt(t,Yg)}function Yg(){if(!P.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=_e()*1e3,o=st(r[0])?r[0].toUpperCase():void 0,c=Kg(r[1]);if(!o||!c)return t.apply(n,r);n[Ot]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[Ot];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:_e()*1e3,startTimestamp:i,xhr:n,virtualError:s};Ge("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[Ot];return h&&st(f)&&st(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[Ot];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:_e()*1e3,xhr:n};return Ge("xhr",i),t.apply(n,r)}})}function Kg(e){if(st(e))return e;try{return e.toString()}catch{}}const Xg=Symbol.for("sentry__originalRequestBody");function yl(e){return new URLSearchParams(e).toString()}function Sl(e,t=b){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[yl(e)];if(!e)return[void 0]}catch(n){return zt&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return zt&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function bl(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][Xg];return n!==void 0?n:void 0}}function El(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return zt&&b.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 Ws=[],Br=new Map,Jt=new Map,Jg=60;function Zg(){if(or()&&Oe()){const t=Qg();return()=>{t()}}return()=>{}}const bi={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 Qg(){return ul(ey)}const ey=({metric:e})=>{if(e.value==null)return;const t=me(e.value);if(t>Jg)return;const n=e.entries.find(h=>h.duration===e.value&&bi[h.name]);if(!n)return;const{interactionId:r}=n,s=bi[n.name],i=me(Oe()+n.startTime),o=Te(),c=o?ve(o):void 0,a=r!=null?Br.get(r):void 0,u=(a==null?void 0:a.span)||c,d=u?Z(u).description:ee().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||Le(n.target),f={[pe]:"auto.http.browser.inp",[dt]:`ui.interaction.${s}`,[wn]:n.duration},p=lo({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[Xn]:"millisecond",[Jn]:e.value}),p.end(i+t))};function ty(){const e=Object.keys(bi);Gr()&&e.forEach(s=>{P.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=Le(i),c=Math.round(s.timeStamp);if(Jt.set(c,o),Jt.size>50){const a=Jt.keys().next().value;a!==void 0&&Jt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=Jt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=Jt.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=Te(),o=i&&ve(i);s.forEach(c=>{if(!lg(c))return;const a=c.interactionId;if(a==null||Br.has(a))return;const u=c.target?Le(c.target):n(c);if(Ws.length>10){const d=Ws.shift();Br.delete(d)}Ws.push(a),Br.set(a,{span:o,elementName:u})})};jt("event",r),jt("first-input",r)}const ny=40;function ry(e,t=_l("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 Gg("fetch"),a}finally{n-=o,r--}}return Xp(e,s,Yi(e.bufferSize||ny))}const We=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,sy=30,iy=50;function Ei(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Ut:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const oy=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ay=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cy=/\((\S*)(?::(\d+))(?::(\d+))\)/,uy=/at (.+?) ?\(data:(.+?),/,ly=e=>{var s;const t=e.match(uy);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=oy.exec(e);if(n){const[,i,o,c]=n;return Ei(i,Ut,+o,+c)}const r=ay.exec(e);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const a=cy.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[o,c]=vl(r[1]||Ut,r[2]);return Ei(c,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},dy=[sy,ly],fy=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,py=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hy=e=>{const t=fy.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=py.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]||Ut;return[s,r]=vl(s,r),Ei(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},my=[iy,hy],_y=[dy,my],gy=Mc(..._y),vl=(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]:Ut,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},br=1024,yy="Breadcrumbs",Sy=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:yy,setup(n){t.console&&Oh(Ty(n)),t.dom&&ml(vy(n,t.dom)),t.xhr&&gl(wy(n)),t.fetch&&$u(Iy(n)),t.history&&_s(ky(n)),t.sentry&&n.on("beforeSendEvent",Ey(n))}}},by=Sy;function Ey(e){return function(n){j()===e&&kt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Nt(n)},{event:n})}}function vy(e,t){return function(r){if(j()!==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>br&&(We&&b.warn(`\`dom.maxStringLength\` cannot exceed ${br}, but a value of ${c} was configured. Sentry will use ${br} instead.`),c=br),typeof o=="string"&&(o=[o]);try{const u=r.event,d=Cy(u)?u.target:u;s=Le(d,{keyAttrs:o,maxStringLength:c}),i=Fc(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),kt(a,{event:r.event,name:r.name,global:r.global})}}function Ty(e){return function(n){if(j()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Du(n.level),message:Oo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Oo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;kt(r,{input:n.args,level:n.level})}}function wy(e){return function(n){if(j()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[Ot];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:Fu(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),kt(f,l)}}function Iy(e){return function(n){if(j()!==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),kt(c,o)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status};n.fetchData.request_body_size,n.fetchData.response_body_size,i==null||i.status;const c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:Fu(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),kt(a,c)}}}function ky(e){return function(n){if(j()!==e)return;let r=n.from,s=n.to;const i=Ht(X.location.href);let o=r?Ht(r):void 0;const c=Ht(s);o!=null&&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),kt({category:"navigation",data:{from:r,to:s}})}}function Cy(e){return!!e&&!!e.target}const Ry=["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"],xy="BrowserApiErrors",My=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:xy,setupOnce(){t.setTimeout&&Ae(X,"setTimeout",za),t.setInterval&&Ae(X,"setInterval",za),t.requestAnimationFrame&&Ae(X,"requestAnimationFrame",Ny),t.XMLHttpRequest&&"XMLHttpRequest"in X&&Ae(XMLHttpRequest.prototype,"send",Ly);const n=t.eventTarget;n&&(Array.isArray(n)?n:Ry).forEach(s=>Dy(s,t))}}},Ay=My;function za(e){return function(...t){const n=t[0];return t[0]=_n(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ct(e)}`}}),e.apply(this,t)}}function Ny(e){return function(t){return e.apply(this,[_n(t,{mechanism:{data:{handler:ct(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Ly(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Ae(n,s,function(i){const o={mechanism:{data:{handler:ct(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Fi(i);return c&&(o.mechanism.data.handler=ct(c)),_n(i,o)})}),e.apply(this,t)}}function Dy(e,t){var s,i;const r=(s=X[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(Ae(r,"addEventListener",function(o){return function(c,a,u){try{Oy(a)&&(a.handleEvent=_n(a.handleEvent,{mechanism:{data:{handler:ct(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Py(this,c,a),o.apply(this,[c,_n(a,{mechanism:{data:{handler:ct(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Ae(r,"removeEventListener",function(o){return function(c,a,u){try{const d=a.__sentry_wrapped__;d&&o.call(this,c,d,u)}catch{}return o.call(this,c,a,u)}}))}function Oy(e){return typeof e.handleEvent=="function"}function Py(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const Fy=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof X.document>"u"){We&&b.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}na({ignoreDuration:!0}),Ms();const n=Ce();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();((r==null?void 0:r.id)!==(i==null?void 0:i.id)||(r==null?void 0:r.ip_address)!==(i==null?void 0:i.ip_address))&&(Ms(),r=i)}),t==="route"&&_s(({from:s,to:i})=>{s!==i&&(na({ignoreDuration:!0}),Ms())})}}},$y="CultureContext",By=()=>({name:$y,preprocessEvent(e){var n;const t=Uy();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}}),Hy=By;function Uy(){try{const e=X.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const Wy="GlobalHandlers",zy=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Wy,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(qy(n),ja("onerror")),t.onunhandledrejection&&(Vy(n),ja("onunhandledrejection"))}}},jy=zy;function qy(e){Nc(t=>{const{stackParser:n,attachStacktrace:r}=Tl();if(j()!==e||Zu())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=Ky(io(n,a||s,void 0,r,!1),i,o,c);u.level="error",mu(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Vy(e){Lc(t=>{const{stackParser:n,attachStacktrace:r}=Tl();if(j()!==e||Zu())return;const s=Gy(t),i=un(s)?Yy(s):io(n,s,void 0,r,!0);i.level="error",mu(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Gy(e){if(un(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 Yy(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Ky(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,d=n,l=Xy(t)??Vt();return a.length===0&&a.push({colno:u,filename:l,function:Ut,in_app:!0,lineno:d}),e}function ja(e){We&&b.log(`Global Handler attached: ${e}`)}function Tl(){const e=j();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function Xy(e){if(!(!st(e)||e.length===0))return e.startsWith("data:")?`<${Et(e,!1)}>`:e}const Jy=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!X.navigator&&!X.location&&!X.document)return;const t=no(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),Zy="cause",Qy=5,eS="LinkedErrors",tS=(e={})=>{const t=e.limit||Qy,n=e.key||Zy;return{name:eS,preprocessEvent(r,s,i){const o=i.getOptions();Dh(ro,o.stackParser,n,t,r,s)}}},nS=tS;function rS(){return sS()?(We&&ht(()=>{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 sS(){var i;if(typeof X.window>"u")return!1;const e=X;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((i=t==null?void 0:t.runtime)!=null&&i.id))return!1;const n=Vt(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(X===X.top&&r.some(o=>n.startsWith(`${o}://`)))}function wl(e){return[kh(),vh(),qh(),Ay(),by(),jy(),nS(),Bh(),Jy(),Hy(),Fy()]}function iS(e={}){const t=!e.skipBrowserExtensionCheck&&rS();let n=e.defaultIntegrations==null?wl():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Rd(e.stackParser||gy),integrations:Bp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||ry};return ah(F_,r)}const ue=G,fo="sentryReplaySession",oS="replay_event",po="Unable to send Replay",aS=3e5,cS=9e5,uS=5e3,lS=5500,dS=6e4,fS=5e3,pS=3,qa=15e4,Er=5e3,hS=3e3,mS=300,ho=2e7,_S=4999,gS=5e4,Va=36e5;var yS=Object.defineProperty,SS=(e,t,n)=>t in e?yS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ga=(e,t,n)=>SS(e,typeof t!="symbol"?t+"":t,n),ye=(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))(ye||{});function bS(e){return e.nodeType===e.ELEMENT_NODE}function Ln(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function Dn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ES(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 vS(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 Qr(e){try{const t=e.rules||e.cssRules;return t?ES(Array.from(t,Il).join("")):null}catch{return null}}function TS(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function Il(e){let t;if(IS(e))try{t=Qr(e.styleSheet)||vS(e)}catch{}else if(kS(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=TS(e)),r&&(n=wS(n)),r||s)return n}return t||e.cssText}function wS(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function IS(e){return"styleSheet"in e}function kS(e){return"selectorText"in e}class kl{constructor(){Ga(this,"idNodeMap",new Map),Ga(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function CS(){return new kl}function gs({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 Wn({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function gn(e){return e.toLowerCase()}function vi(e){return e.toUpperCase()}const Ya="__rrweb_original__";function RS(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=Ya in i?i[Ya]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function mo(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?gn(t):null}function es(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function Cl(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const Ka={};function Rl(e){const t=Ka[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 Ka[e]=r.bind(window)}function Ti(...e){return Rl("setTimeout")(...e)}function xl(...e){return Rl("clearTimeout")(...e)}function Ml(e){try{return e.contentDocument}catch{}}let xS=1;const MS=new RegExp("[^a-z0-9-_:]"),zn=-2;function _o(){return xS++}function AS(e){if(e instanceof HTMLFormElement)return"form";const t=gn(e.tagName);return MS.test(t)?"div":t}function NS(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Zt,Xa;const LS=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,DS=/^(?:[a-z+]+:)?\/\//i,OS=/^www\..*/i,PS=/^(data:)([^,]*),(.*)/i;function FS(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 ts(e,t){return(e||"").replace(LS,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(DS.test(a)||OS.test(a))return`url(${u}${a}${u})`;if(PS.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${NS(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const $S=/^[^ \t\n\r\u000c]+/,BS=/^[, \t\n\r\u000c]+/;function HS(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(BS),!(n>=t.length);){let i=r($S);if(i.slice(-1)===",")i=nn(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=nn(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 Ja=new WeakMap;function nn(e,t){return!t||t.trim()===""?t:ys(e,t)}function US(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ys(e,t){let n=Ja.get(e);if(n||(n=e.createElement("a"),Ja.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Al(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return nn(e,r);if(n==="xlink:href"&&r[0]!=="#")return nn(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return nn(e,r);if(n==="srcset")return HS(e,r);if(n==="style"){let c=ts(r,ys(e));return o&&o.size>0&&(c=FS(c,o)),c}else if(t==="object"&&n==="data")return nn(e,r);return typeof i=="function"?i(n,r,s):r}function Nl(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function WS(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 zS(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Pt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Pt(e.parentNode,t,n,r+1)}function rn(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(zS(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function yn(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=Pt(o,rn(r,s)),a<0)return!0;c=Pt(o,rn(t,n),a>=0?a:1/0)}else{if(c=Pt(o,rn(t,n)),c<0)return!1;a=Pt(o,rn(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function jS(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=Ti(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{xl(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Ti(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function qS(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Ti(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{xl(i),r=!0,t()})}function VS(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:_,dataURLOptions:g={},inlineImages:S,recordCanvas:L,keepIframeSrcFn:R,newlyAddedElement:H=!1,ignoreCSSAttributes:A}=t,y=GS(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ye.Document,childNodes:[],compatMode:e.compatMode}:{type:ye.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ye.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return KS(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:g,inlineImages:S,recordCanvas:L,keepIframeSrcFn:R,newlyAddedElement:H,rootId:y,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:A});case e.TEXT_NODE:return YS(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:_,rootId:y});case e.CDATA_SECTION_NODE:return{type:ye.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:ye.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function GS(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function YS(e,t){var g;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,m=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(g=e.parentNode.sheet)!=null&&g.cssRules&&(f=Qr(e.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}f=ts(f,ys(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=yn(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,"*")),l==="OPTION"&&f){const S=gs({type:null,tagName:l,maskInputOptions:a});f=Wn({isMasked:yn(e,r,i,s,o,S),element:e,value:f,maskInputFn:u})}return{type:ye.Text,textContent:f||"",isStyle:p,rootId:d}}function KS(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:_,unmaskTextClass:g,maskTextSelector:S,unmaskTextSelector:L,ignoreCSSAttributes:R}=t,H=WS(e,r,s,i),A=AS(e);let y={};const T=e.attributes.length;for(let E=0;E<T;E++){const k=e.attributes[E];k.name&&!Nl(A,k.name,k.value)&&(y[k.name]=Al(n,A,gn(k.name),k.value,e,a,R))}if(A==="link"&&o){const E=Array.from(n.styleSheets).find(v=>v.href===e.href);let k=null;E&&(k=Qr(E)),k&&(y.rel=null,y.href=null,y.crossorigin=null,y._cssText=ts(k,E.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=Qr(e.sheet);E&&(y._cssText=ts(E,ys(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){const E=e,k=mo(E),v=es(E,vi(A),k),C=E.checked;if(k!=="submit"&&k!=="button"&&v){const M=yn(E,_,S,g,L,gs({type:k,tagName:vi(A),maskInputOptions:c}));y.value=Wn({isMasked:M,element:E,value:v,maskInputFn:u})}C&&(y.checked=C)}if(A==="option"&&(e.selected&&!c.select?y.selected=!0:delete y.selected),A==="canvas"&&f){if(e.__context==="2d")RS(e)||(y.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const E=e.toDataURL(d.type,d.quality),k=n.createElement("canvas");k.width=e.width,k.height=e.height;const v=k.toDataURL(d.type,d.quality);E!==v&&(y.rr_dataURL=E)}}if(A==="img"&&l){Zt||(Zt=n.createElement("canvas"),Xa=Zt.getContext("2d"));const E=e,k=E.currentSrc||E.getAttribute("src")||"<unknown-src>",v=E.crossOrigin,C=()=>{E.removeEventListener("load",C);try{Zt.width=E.naturalWidth,Zt.height=E.naturalHeight,Xa.drawImage(E,0,0),y.rr_dataURL=Zt.toDataURL(d.type,d.quality)}catch(M){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?C():E.addEventListener("load",C);return}else console.warn(`Cannot inline img src=${k}! Error: ${M}`)}E.crossOrigin==="anonymous"&&(v?y.crossOrigin=v:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?C():E.addEventListener("load",C)}if((A==="audio"||A==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),H){const{width:E,height:k}=e.getBoundingClientRect();y={class:y.class,rr_width:`${E}px`,rr_height:`${k}px`}}A==="iframe"&&!p(y.src)&&(!H&&!Ml(e)&&(y.rr_src=y.src),delete y.src);let F;try{customElements.get(A)&&(F=!0)}catch{}return{type:ye.Element,tagName:A,attributes:y,childNodes:[],isSVG:US(e)||void 0,needBlock:H,rootId:m,isCustom:F}}function ce(e){return e==null?"":e.toLowerCase()}function XS(e,t){if(t.comment&&e.type===ye.Comment)return!0;if(e.type===ye.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"&&Cl(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ce(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ce(e.attributes.name)==="application-name"||ce(e.attributes.rel)==="icon"||ce(e.attributes.rel)==="apple-touch-icon"||ce(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ce(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ce(e.attributes.property).match(/^(og|twitter|fb):/)||ce(e.attributes.name).match(/^(og|twitter):/)||ce(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ce(e.attributes.name)==="robots"||ce(e.attributes.name)==="googlebot"||ce(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ce(e.attributes.name)==="author"||ce(e.attributes.name)==="generator"||ce(e.attributes.name)==="framework"||ce(e.attributes.name)==="publisher"||ce(e.attributes.name)==="progid"||ce(e.attributes.property).match(/^article:/)||ce(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ce(e.attributes.name)==="google-site-verification"||ce(e.attributes.name)==="yandex-verification"||ce(e.attributes.name)==="csrf-token"||ce(e.attributes.name)==="p:domain_verify"||ce(e.attributes.name)==="verify-v1"||ce(e.attributes.name)==="verification"||ce(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function sn(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:L={},inlineImages:R=!1,recordCanvas:H=!1,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:T=5e3,onBlockedImageLoad:F,onStylesheetLoad:E,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:v=()=>!1,newlyAddedElement:C=!1,ignoreCSSAttributes:M}=t;let{preserveWhiteSpace:J=!0}=t;const te=VS(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,dataURLOptions:L,inlineImages:R,recordCanvas:H,keepIframeSrcFn:v,newlyAddedElement:C,ignoreCSSAttributes:M});if(!te)return console.warn(e,"not serialized"),null;let Y;r.hasNode(e)?Y=r.getId(e):XS(te,S)||!J&&te.type===ye.Text&&!te.isStyle&&!te.textContent.replace(/^\s+|\s+$/gm,"").length?Y=zn:Y=_o();const I=Object.assign(te,{id:Y});if(r.add(e,I),Y===zn)return null;A&&A(e);let N=!f;if(I.type===ye.Element){N=N&&!I.needBlock;const w=e.shadowRoot;w&&Dn(w)&&(I.isShadowHost=!0)}if((I.type===ye.Document||I.type===ye.Element)&&N){S.headWhitespace&&I.type===ye.Element&&I.tagName==="head"&&(J=!1);const w={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:L,inlineImages:R,recordCanvas:H,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:T,onBlockedImageLoad:F,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:v,ignoreCSSAttributes:M},W=e.childNodes?Array.from(e.childNodes):[];for(const U of W){const ne=sn(U,w);ne&&I.childNodes.push(ne)}if(bS(e)&&e.shadowRoot)for(const U of Array.from(e.shadowRoot.childNodes)){const ne=sn(U,w);ne&&(Dn(e.shadowRoot)&&(ne.isShadow=!0),I.childNodes.push(ne))}}if(e.parentNode&&Ln(e.parentNode)&&Dn(e.parentNode)&&(I.isShadow=!0),I.type===ye.Element&&I.tagName==="iframe"&&!I.needBlock&&jS(e,()=>{const w=Ml(e);if(w&&y){const W=sn(w,{doc:w,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:L,inlineImages:R,recordCanvas:H,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:T,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:v,ignoreCSSAttributes:M});W&&y(e,W)}},T),I.type===ye.Element&&I.tagName==="img"&&!e.complete&&I.needBlock){const w=e,W=()=>{if(w.isConnected&&!w.complete&&F)try{const U=w.getBoundingClientRect();U.width>0&&U.height>0&&F(w,I,U)}catch{}w.removeEventListener("load",W)};w.isConnected&&w.addEventListener("load",W)}return I.type===ye.Element&&I.tagName==="link"&&typeof I.attributes.rel=="string"&&(I.attributes.rel==="stylesheet"||I.attributes.rel==="preload"&&typeof I.attributes.href=="string"&&Cl(I.attributes.href)==="css")&&qS(e,()=>{if(E){const w=sn(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:L,inlineImages:R,recordCanvas:H,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:T,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:v,ignoreCSSAttributes:M});w&&E(e,w)}},k),I.type===ye.Element&&delete I.needBlock,I}function JS(e,t){const{mirror:n=new kl,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOM:S=!1,dataURLOptions:L,preserveWhiteSpace:R,onSerialize:H,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:T,onStylesheetLoad:F,stylesheetLoadTimeout:E,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:v=new Set([])}=t||{};return sn(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,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:g,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:L,inlineImages:f,recordCanvas:p,preserveWhiteSpace:R,onSerialize:H,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:T,onStylesheetLoad:F,stylesheetLoadTimeout:E,keepIframeSrcFn:k,newlyAddedElement:!1,ignoreCSSAttributes:v})}function ke(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Qt=`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 Za={map:{},getId(){return console.error(Qt),-1},getNode(){return console.error(Qt),null},removeNodeFromMap(){console.error(Qt)},has(){return console.error(Qt),!1},reset(){console.error(Qt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Za=new Proxy(Za,{get(e,t,n){return t==="map"&&console.error(Qt),Reflect.get(e,t,n)}}));function jn(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&&(sb(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=Ss(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function Ll(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){Ss(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Ll(e,t,i||{},!0)}function go(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 ns=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ns=()=>new Date().getTime());function Dl(e){var n,r,s,i,o,c;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function Ol(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Pl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Fl(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Be(e,t,n,r,s){if(!e)return!1;const i=Fl(e);if(!i)return!1;const o=rn(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=Pt(i,o);let a=-1;return c<0?!1:(r&&(a=Pt(i,rn(null,r))),c>-1&&a<0?!0:c<a)}function ZS(e,t){return t.getId(e)!==-1}function zs(e,t){return t.getId(e)===zn}function $l(e,t){if(Ln(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?$l(e.parentNode,t):!0:!0}function wi(e){return!!e.changedTouches}function QS(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Bl(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Hl(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ii(e){return!!(e!=null&&e.shadowRoot)}class eb{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 Ul(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function tb(e){let t=e,n;for(;n=Ul(t);)t=n;return t}function nb(e){const t=e.ownerDocument;if(!t)return!1;const n=tb(e);return t.contains(n)}function Wl(e){const t=e.ownerDocument;return t?t.contains(e)||nb(e):!1}const Qa={};function yo(e){const t=Qa[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 Qa[e]=r.bind(window)}function rb(...e){return yo("requestAnimationFrame")(...e)}function Ss(...e){return yo("setTimeout")(...e)}function sb(...e){return yo("clearTimeout")(...e)}var q=(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))(q||{}),$=(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))($||{}),Ie=(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))(Ie||{}),rt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(rt||{}),en=(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))(en||{});function So(e){try{return e.contentDocument}catch{}}function ib(e){try{return e.contentWindow}catch{}}function ec(e){return"__ln"in e}class ob{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&ec(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&ec(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const tc=(e,t)=>`${e}@${t}`;class ab{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 ob,s=a=>{let u=a,d=zn;for(;d===zn;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!Wl(a))return;const u=Ln(a.parentNode)?this.mirror.getId(Ul(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=sn(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=>{Bl(f,this.mirror)&&!Be(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Hl(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Ii(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Be(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});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)nc(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!rc(this.droppedSet,a)&&!nc(this.removes,a,this.mirror)||rc(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),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!zs(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Be(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:yn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Fl(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=mo(n),c=n.tagName;s=es(n,c,o);const a=gs({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=yn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Wn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(Be(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(!So(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"),!Nl(n.tagName,r)&&(i.attributes[r]=Al(this.doc,gn(n.tagName),gn(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(Be(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=Ln(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Be(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||zs(n,this.mirror)||!ZS(n,this.mirror)||(this.addedSet.has(n)?(ki(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||$l(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[tc(r,s)]?ki(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Ln(t.target)&&Dn(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(zs(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[tc(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Be(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Ii(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 ki(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>ki(e,r))}function nc(e,t,n){return e.length===0?!1:cb(e,t,n)}function cb(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 rc(e,t){return e.size===0?!1:zl(e,t)}function zl(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:zl(e,n):!1}let On;function ub(e){On=e}function lb(){On=void 0}const Q=e=>On?(...n)=>{try{return e(...n)}catch(r){if(On&&On(r)===!0)return()=>{};throw r}}:e,on=[];function cr(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 jl(e,t){var o,c;const n=new ab;on.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(Q(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function db({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=jn(Q(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=Q(jn(Q(l=>{const f=cr(l),{clientX:p,clientY:h}=wi(l)?l.changedTouches[0]:l;c||(c=ns()),o.push({x:p,y:h,id:r.getId(f),timeOffset:ns()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?$.Drag:l instanceof MouseEvent?$.MouseMove:$.TouchMove)}),s,{trailing:!1})),d=[ke("mousemove",u,n),ke("touchmove",u,n),ke("drag",u,n)];return Q(()=>{d.forEach(l=>l())})}function fb({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 d=l=>f=>{const p=cr(f);if(Be(p,r,s,i,!0))return;let h=null,m=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=rt.Mouse;break;case"touch":h=rt.Touch;break;case"pen":h=rt.Pen;break}h===rt.Touch?Ie[l]===Ie.MouseDown?m="TouchStart":Ie[l]===Ie.MouseUp&&(m="TouchEnd"):rt.Pen}else wi(f)&&(h=rt.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===rt.Touch||m.startsWith("Mouse")&&h===rt.Mouse)&&(h=null)):Ie[l]===Ie.Click&&(h=u,u=null);const _=wi(f)?f.changedTouches[0]:f;if(!_)return;const g=n.getId(p),{clientX:S,clientY:L}=_;Q(e)({type:Ie[m],id:g,x:S,y:L,...h!==null&&{pointerType:h}})};return Object.keys(Ie).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=gn(l);const p=d(l);if(window.PointerEvent)switch(Ie[l]){case Ie.MouseDown:case Ie.MouseUp:f=f.replace("mouse","pointer");break;case Ie.TouchStart:case Ie.TouchEnd:return}a.push(ke(f,p,t))}),Q(()=>{a.forEach(l=>l())})}function ql({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=Q(jn(Q(a=>{const u=cr(a);if(!u||Be(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=Dl(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return ke("scroll",c,t)}function pb({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=Q(jn(Q(()=>{const i=Ol(),o=Pl();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return ke("resize",s,t)}const hb=["INPUT","TEXTAREA","SELECT"],sc=new WeakMap;function mb({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function _(y){let T=cr(y);const F=y.isTrusted,E=T&&vi(T.tagName);if(E==="OPTION"&&(T=T.parentElement),!T||!E||hb.indexOf(E)<0||Be(T,r,s,i,!0))return;const k=T;if(k.classList.contains(o)||c&&k.matches(c))return;const v=mo(T);let C=es(k,E,v),M=!1;const J=gs({maskInputOptions:a,tagName:E,type:v}),te=yn(T,f,h,p,m,J);(v==="radio"||v==="checkbox")&&(M=T.checked),C=Wn({isMasked:te,element:T,value:C,maskInputFn:u}),g(T,l?{text:C,isChecked:M,userTriggered:F}:{text:C,isChecked:M});const Y=T.name;v==="radio"&&Y&&M&&t.querySelectorAll(`input[type="radio"][name="${Y}"]`).forEach(I=>{if(I!==T){const N=Wn({isMasked:te,element:I,value:es(I,E,v),maskInputFn:u});g(I,l?{text:N,isChecked:!M,userTriggered:!1}:{text:N,isChecked:!M})}})}function g(y,T){const F=sc.get(y);if(!F||F.text!==T.text||F.isChecked!==T.isChecked){sc.set(y,T);const E=n.getId(y);Q(e)({...T,id:E})}}const L=(d.input==="last"?["change"]:["input","change"]).map(y=>ke(y,Q(_),t)),R=t.defaultView;if(!R)return()=>{L.forEach(y=>y())};const H=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return H&&H.set&&L.push(...A.map(y=>Ll(y[0],y[1],{set(){Q(_)({target:this,isTrusted:!1})}},!1,R))),Q(()=>{L.forEach(y=>y())})}function rs(e){const t=[];function n(r,s){if(vr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||vr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||vr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||vr("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 gt(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function _b({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:Q((d,l,f)=>{const[p,h]=f,{id:m,styleId:_}=gt(l,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Q((d,l,f)=>{const[p]=f,{id:h,styleId:m}=gt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Q((d,l,f)=>{const[p]=f,{id:h,styleId:m}=gt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Q((d,l,f)=>{const[p]=f,{id:h,styleId:m}=gt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),d.apply(l,f)})}));const a={};Tr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Tr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Tr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Tr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:Q((f,p,h)=>{const[m,_]=h,{id:g,styleId:S}=gt(p.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:m,index:[...rs(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:Q((f,p,h)=>{const[m]=h,{id:_,styleId:g}=gt(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&e({id:_,styleId:g,removes:[{index:[...rs(p),m]}]}),f.apply(p,h)})})}),Q(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Vl({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=i.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),Q(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function gb({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Q((c,a,u)=>{var m;const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=gt((m=a.parentRule)==null?void 0:m.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:rs(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Q((c,a,u)=>{var p;const[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=gt((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:rs(a.parentRule)}),c.apply(a,u)})}),Q(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function yb({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=Q(u=>jn(Q(d=>{const l=cr(d);if(!l||Be(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:m})}),i.media||500)),a=[ke("play",c(en.Play),o),ke("pause",c(en.Pause),o),ke("seeked",c(en.Seeked),o),ke("volumechange",c(en.VolumeChange),o),ke("ratechange",c(en.RateChange),o)];return Q(()=>{a.forEach(u=>u())})}function Sb({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=go(t.fonts,"add",function(c){return function(a){return Ss(Q(()=>{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),Q(()=>{r.forEach(c=>c())})}function bb(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=Q(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:m,endContainer:_,endOffset:g}=p;Be(h,r,s,i,!0)||Be(_,r,s,i,!0)||d.push({start:n.getId(h),startOffset:m,end:n.getId(_),endOffset:g})}o({ranges:d})});return a(),ke("selectionchange",a)}function Eb({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:go(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function vb(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=jl(e,e.doc));const s=db(e),i=fb(e),o=ql(e),c=pb(e,{win:n}),a=mb(e),u=yb(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=_b(e,{win:n}),l=Vl(e,e.doc),f=gb(e,{win:n}),e.collectFonts&&(p=Sb(e)));const h=bb(e),m=Eb(e),_=[];for(const g of e.plugins)_.push(g.observer(g.callback,n,g.options));return Q(()=>{on.forEach(g=>g.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),m(),_.forEach(g=>g())})}function vr(e){return typeof window[e]<"u"}function Tr(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ci{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 Tb{constructor(){this.crossOriginIframeMirror=new Ci(_o),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class wb{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ci(_o),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ci(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){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=So(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){var r;switch(n.type){case q.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:q.IncrementalSnapshot,data:{source:$.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case q.Meta:case q.Load:case q.DomContentLoaded:return!1;case q.Plugin:return n;case q.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case q.IncrementalSnapshot:switch(n.data.source){case $.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case $.Drag:case $.TouchMove:case $.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case $.ViewportResize:return!1;case $.MediaInteraction:case $.MouseInteraction:case $.Scroll:case $.CanvasMutation:case $.Input:return this.replaceIds(n.data,t,["id"]),n;case $.StyleSheetRule:case $.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case $.Font:return n;case $.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case $.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==ye.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Ib{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class kb{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(!Dn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=jl({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ql({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Ss(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Vl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=So(t),r=ib(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(go(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Wl(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 ic="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cb=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var wr=0;wr<ic.length;wr++)Cb[ic.charCodeAt(wr)]=wr;class oc{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class Rb{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new eb,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:Il(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 xb{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,rb(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let he,ss;var Cc;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Cc=e.contentWindow)==null?void 0:Cc.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Xe=CS();function at(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:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:g,maskAttributeFn:S,maskInputFn:L,maskTextFn:R,maxCanvasSize:H=null,packFn:A,sampling:y={},dataURLOptions:T={},mousemoveWait:F,recordDOM:E=!0,recordCanvas:k=!1,recordCrossOriginIframes:v=!1,recordAfter:C=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:M=!1,collectFonts:J=!1,inlineImages:te=!1,plugins:Y,keepIframeSrcFn:I=()=>!1,ignoreCSSAttributes:N=new Set([]),errorHandler:w,onMutation:W,getCanvasManager:U}=e;ub(w);const ne=v?window.parent===window:!0;let se=!1;if(!ne)try{window.parent.document&&(se=!1)}catch{se=!0}if(ne&&!t)throw new Error("emit function is required");if(!ne&&!se)return()=>{};F!==void 0&&y.mousemove===void 0&&(y.mousemove=F),Xe.reset();const Pe=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?_:{},Fe=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};QS();let be,ge=0;const ze=B=>{for(const we of Y||[])we.eventProcessor&&(B=we.eventProcessor(B));return A&&!se&&(B=A(B)),B};he=(B,we)=>{var xe;const z=B;if(z.timestamp=ns(),(xe=on[0])!=null&&xe.isFrozen()&&z.type!==q.FullSnapshot&&!(z.type===q.IncrementalSnapshot&&z.data.source===$.Mutation)&&on.forEach(je=>je.unfreeze()),ne)t==null||t(ze(z),we);else if(se){const je={type:"rrweb",event:ze(z),origin:window.location.origin,isCheckout:we};window.parent.postMessage(je,"*")}if(z.type===q.FullSnapshot)be=z,ge=0;else if(z.type===q.IncrementalSnapshot){if(z.data.source===$.Mutation&&z.data.isAttachIframe)return;ge++;const je=r&&ge>=r,re=n&&be&&z.timestamp-be.timestamp>n;(je||re)&&de(!0)}};const $e=B=>{he({type:q.IncrementalSnapshot,data:{source:$.Mutation,...B}})},Rn=B=>he({type:q.IncrementalSnapshot,data:{source:$.Scroll,...B}}),lr=B=>he({type:q.IncrementalSnapshot,data:{source:$.CanvasMutation,...B}}),dr=B=>he({type:q.IncrementalSnapshot,data:{source:$.AdoptedStyleSheet,...B}}),Ke=new Rb({mutationCb:$e,adoptedStyleSheetCb:dr}),K=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Tb:new wb({mirror:Xe,mutationCb:$e,stylesheetManager:Ke,recordCrossOriginIframes:v,wrappedEmit:he});for(const B of Y||[])B.getMirror&&B.getMirror({nodeMirror:Xe,crossOriginIframeMirror:K.crossOriginIframeMirror,crossOriginIframeStyleMirror:K.crossOriginIframeStyleMirror});const le=new xb,Re=Ab(U,{mirror:Xe,win:window,mutationCb:B=>he({type:q.IncrementalSnapshot,data:{source:$.CanvasMutation,...B}}),recordCanvas:k,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:H,sampling:y.canvas,dataURLOptions:T,errorHandler:w}),Ee=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ib:new kb({mutationCb:$e,scrollCb:Rn,bypassOptions:{onMutation:W,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:Pe,dataURLOptions:T,maskAttributeFn:S,maskTextFn:R,maskInputFn:L,recordCanvas:k,inlineImages:te,sampling:y,slimDOMOptions:Fe,iframeManager:K,stylesheetManager:Ke,canvasManager:Re,keepIframeSrcFn:I,processedNodeManager:le,ignoreCSSAttributes:N},mirror:Xe}),de=(B=!1)=>{if(!E)return;he({type:q.Meta,data:{href:window.location.href,width:Pl(),height:Ol()}},B),Ke.reset(),Ee.init(),on.forEach(z=>z.lock());const we=JS(document,{mirror:Xe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:Pe,maskAttributeFn:S,maskInputFn:L,maskTextFn:R,slimDOM:Fe,dataURLOptions:T,recordCanvas:k,inlineImages:te,onSerialize:z=>{Bl(z,Xe)&&K.addIframe(z),Hl(z,Xe)&&Ke.trackLinkElement(z),Ii(z)&&Ee.addShadowRoot(z.shadowRoot,document)},onIframeLoad:(z,xe)=>{K.attachIframe(z,xe),z.contentWindow&&Re.addWindow(z.contentWindow),Ee.observeAttachShadow(z)},onStylesheetLoad:(z,xe)=>{Ke.attachLinkElement(z,xe)},onBlockedImageLoad:(z,xe,{width:je,height:re})=>{$e({adds:[],removes:[],texts:[],attributes:[{id:xe.id,attributes:{style:{width:`${je}px`,height:`${re}px`}}}]})},keepIframeSrcFn:I,ignoreCSSAttributes:N});if(!we)return console.warn("Failed to snapshot the document");he({type:q.FullSnapshot,data:{node:we,initialOffset:Dl(window)}}),on.forEach(z=>z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ke.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))};ss=de;try{const B=[],we=xe=>{var je;return Q(vb)({onMutation:W,mutationCb:$e,mousemoveCb:(re,Ts)=>he({type:q.IncrementalSnapshot,data:{source:Ts,positions:re}}),mouseInteractionCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.MouseInteraction,...re}}),scrollCb:Rn,viewportResizeCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.ViewportResize,...re}}),inputCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.Input,...re}}),mediaInteractionCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.MediaInteraction,...re}}),styleSheetRuleCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.StyleSheetRule,...re}}),styleDeclarationCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.StyleDeclaration,...re}}),canvasMutationCb:lr,fontCb:re=>he({type:q.IncrementalSnapshot,data:{source:$.Font,...re}}),selectionCb:re=>{he({type:q.IncrementalSnapshot,data:{source:$.Selection,...re}})},customElementCb:re=>{he({type:q.IncrementalSnapshot,data:{source:$.CustomElement,...re}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:Pe,inlineStylesheet:h,sampling:y,recordDOM:E,recordCanvas:k,inlineImages:te,userTriggeredOnInput:M,collectFonts:J,doc:xe,maskAttributeFn:S,maskInputFn:L,maskTextFn:R,keepIframeSrcFn:I,blockSelector:i,unblockSelector:o,slimDOMOptions:Fe,dataURLOptions:T,mirror:Xe,iframeManager:K,stylesheetManager:Ke,shadowDomManager:Ee,processedNodeManager:le,canvasManager:Re,ignoreCSSAttributes:N,plugins:((je=Y==null?void 0:Y.filter(re=>re.observer))==null?void 0:je.map(re=>({observer:re.observer,options:re.options,callback:Ts=>he({type:q.Plugin,data:{plugin:re.name,payload:Ts}})})))||[]},{})};K.addLoadListener(xe=>{try{B.push(we(xe.contentDocument))}catch(je){console.warn(je)}});const z=()=>{de(),B.push(we(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():(B.push(ke("DOMContentLoaded",()=>{he({type:q.DomContentLoaded,data:{}}),C==="DOMContentLoaded"&&z()})),B.push(ke("load",()=>{he({type:q.Load,data:{}}),C==="load"&&z()},window))),()=>{B.forEach(xe=>xe()),le.destroy(),ss=void 0,lb()}}catch(B){console.warn(B)}}function Mb(e){if(!ss)throw new Error("please take full snapshot after start recording");ss(e)}at.mirror=Xe;at.takeFullSnapshot=Mb;function Ab(e,t){try{return e?e(t):new oc}catch{return console.warn("Unable to initialize CanvasManager"),new oc}}var ac;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ac||(ac={}));const Nb=3,Lb=5;function bo(e){return e>9999999999?e:e*1e3}function js(e){return e>9999999999?e/1e3:e}function ur(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:q.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Je(t,10,1e3)}}),t.category==="console")))}const Db="button,a";function Gl(e){return e.closest(Db)||e}function Yl(e){const t=Kl(e);return!t||!(t instanceof Element)?t:Gl(t)}function Kl(e){return Ob(e)?e.target:e}function Ob(e){return typeof e=="object"&&!!e&&"target"in e}let yt;function Pb(e){return yt||(yt=[],Fb()),yt.push(e),()=>{const t=yt?yt.indexOf(e):-1;t>-1&&yt.splice(t,1)}}function Fb(){Ae(ue,"open",function(e){return function(...t){if(yt)try{yt.forEach(n=>n())}catch{}return e.apply(ue,t)}})}const $b=new Set([$.Mutation,$.StyleSheetRule,$.StyleDeclaration,$.AdoptedStyleSheet,$.CanvasMutation,$.Selection,$.MediaInteraction]);function Bb(e,t,n){e.handleClick(t,n)}class Hb{constructor(t,n,r=ur){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=Pb(()=>{this._lastMutation=cc()});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(Wb(n,this._ignoreSelector)||!zb(t))return;const r={timestamp:js(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=js(t)}registerScroll(t=Date.now()){this._lastScroll=js(t)}registerClick(t){const n=Gl(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=cc();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=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:ue.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:ue.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=ar(()=>this._checkClicks(),1e3)}}const Ub=["A","BUTTON","INPUT"];function Wb(e,t){return!!(!Ub.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 zb(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function cc(){return Date.now()/1e3}function jb(e,t){try{if(!qb(t))return;const{source:n}=t.data;if($b.has(n)&&e.registerMutation(t.timestamp),n===$.Scroll&&e.registerScroll(t.timestamp),Vb(t)){const{type:r,id:s}=t.data,i=at.mirror.getNode(s);i instanceof HTMLElement&&r===Ie.Click&&e.registerClick(i)}}catch{}}function qb(e){return e.type===Nb}function Vb(e){return e.data.source===$.MouseInteraction}function et(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Eo=(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))(Eo||{});const Gb=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Yb(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(Gb.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const Kb=e=>t=>{if(!e.isEnabled())return;const n=Xb(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&Bb(e.clickDetector,n,Yl(t.event)),ur(e,n)};function Xl(e,t){const n=at.mirror.getId(e),r=n&&at.mirror.getNode(n),s=r&&at.mirror.getMeta(r),i=s&&Zb(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===Eo.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Yb(i.attributes)}}:{}}}function Xb(e){const{target:t,message:n}=Jb(e);return et({category:`ui.${e.name}`,...Xl(t,n)})}function Jb(e){const t=e.name==="click";let n,r=null;try{r=t?Yl(e.event):Kl(e.event),n=Le(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function Zb(e){return e.type===Eo.Element}function Qb(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=eE(t);n&&ur(e,n)}function eE(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||tE(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=Le(o,{maxStringLength:200})||"<unknown>",d=Xl(o,u);return et({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function tE(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const nE={resource:aE,paint:iE,navigation:oE};function qs(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function rE(e){return e.map(sE).filter(Boolean)}function sE(e){const t=nE[e.entryType];return t?t(e):null}function Sn(e){return((Oe()||ue.performance.timeOrigin)+e)/1e3}function iE(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Sn(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function oE(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:Sn(p),end:Sn(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function aE(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:Sn(i),end:Sn(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function cE(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return vo(e,"largest-contentful-paint",n)}function uE(e){return e.sources!==void 0}function lE(e){const t=[],n=[];for(const r of e.entries)if(uE(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=at.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return vo(e,"cumulative-layout-shift",n,t)}function dE(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return vo(e,"interaction-to-next-paint",n)}function vo(e,t,n,r){const s=e.value,i=e.rating,o=Sn(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>at.mirror.getId(c)):void 0,attributions:r}}}function fE(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(jt(s,n))}),r.push(uo(qs(cE,e)),co(qs(lE,e)),ul(qs(dE,e))),()=>{r.forEach(s=>s())}}const D=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,pE='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<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>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;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(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<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=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<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!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+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(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<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(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<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>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;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(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;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=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<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,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;o<e;++o){if(s+5>i.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<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function hE(){const e=new Blob([pE]);return URL.createObjectURL(e)}const uc=["log","warn","error"],Hr="[Replay] ";function Vs(e,t="info"){kt({category:"console",data:{logger:"replay"},level:t,message:`${Hr}${e}`},{level:t})}function mE(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return D?(uc.forEach(r=>{n[r]=(...s)=>{b[r](Hr,...s),t&&Vs(s.join(""),Du(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),b.error(Hr,r),e?fs(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Vs(r,"error")},n.infoTick=(...r)=>{b.log(Hr,...r),t&&setTimeout(()=>Vs(r[0]),0)}):uc.forEach(r=>{n[r]=()=>{}}),n}const O=mE();class To extends Error{constructor(){super(`Event buffer exceeded maximum size of ${ho}.`)}}class Jl{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>ho)throw new To;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?bo(t):null}}class _E{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():(D&&O.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{D&&O.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(){D&&O.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){D&&O.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 gE{constructor(t){this._worker=new _E(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=bo(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>ho?Promise.reject(new To):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{D&&O.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 yE{constructor(t){this._fallback=new Jl,this._compression=new gE(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){D&&O.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){D&&O.exception(i,"Failed to add events when switching buffers.")}}}function SE({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=bE(t);if(n)return n}return D&&O.log("Using simple buffer"),new Jl}function bE(e){try{const t=e||EE();if(!t)return;D&&O.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new yE(n)}catch(t){D&&O.exception(t,"Failed to create compression worker")}}function EE(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?hE():""}function wo(){try{return"sessionStorage"in ue&&!!ue.sessionStorage}catch{return!1}}function vE(e){TE(),e.session=void 0}function TE(){if(wo())try{ue.sessionStorage.removeItem(fo)}catch{}}function Zl(e){return e===void 0?!1:Math.random()<e}function bs(e){if(wo())try{ue.sessionStorage.setItem(fo,JSON.stringify(e))}catch{}}function Ql(e){const t=Date.now(),n=e.id||Ue(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function wE(e,t){return Zl(e)?"session":t?"buffer":!1}function lc({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=wE(e,t),i=Ql({sampled:s,previousSessionId:r});return n&&bs(i),i}function IE(){if(!wo())return null;try{const e=ue.sessionStorage.getItem(fo);if(!e)return null;const t=JSON.parse(e);return D&&O.infoTick("Loading existing session"),Ql(t)}catch{return null}}function Ri(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function ed(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Ri(e.started,t,r)||Ri(e.lastActivity,n,r)}function td(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!ed(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Gs({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&IE();return s?td(s,{sessionIdleExpire:e,maxReplayDuration:t})?(D&&O.infoTick("Session in sessionStorage is expired, creating new one..."),lc(r,{previousSessionId:s.id})):s:(D&&O.infoTick("Creating new session"),lc(r,{previousSessionId:n}))}function kE(e){return e.type===q.Custom}function Io(e,t,n){return rd(e,t)?(nd(e,t,n),!0):!1}function CE(e,t,n){return rd(e,t)?nd(e,t,n):Promise.resolve(null)}async function nd(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=RE(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof To,c=o?"addEventSizeExceeded":"addEvent",a=j();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function rd(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=bo(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(D&&O.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function RE(e,t){try{if(typeof t=="function"&&kE(e))return t(e)}catch(n){return D&&O.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function ko(e){return!e.type}function xi(e){return e.type==="transaction"}function xE(e){return e.type==="replay_event"}function dc(e){return e.type==="feedback"}function ME(e){return(t,n)=>{if(!e.isEnabled()||!ko(t)&&!xi(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(xi(t)){AE(e,t);return}NE(e,t)}}}function AE(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function NE(e,t){var s;const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!((s=t.tags)!=null&&s.replayId))return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||ar(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(i){e.handleException(i)}})}function LE(e){return t=>{!e.isEnabled()||!ko(t)||DE(e,t)}}function DE(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.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 o=et({category:"replay.hydrate-error",data:{url:Vt()}});ur(e,o)}}function OE(e){const t=j();t&&t.on("beforeAddBreadcrumb",n=>PE(e,n))}function PE(e,t){if(!e.isEnabled()||!sd(t))return;const n=FE(t);n&&ur(e,n)}function FE(e){return!sd(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?$E(e):et(e)}function $E(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return et(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Er?(n=!0,`${i.slice(0,Er)}`):i;if(typeof i=="object")try{const o=Je(i,7);return JSON.stringify(o).length>Er?(n=!0,`${JSON.stringify(o,null,2).slice(0,Er)}`):o}catch{}return i});return et({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function sd(e){return!!e.category}function BE(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function id(){const e=ee().getPropagationContext().dsc;e&&delete e.replay_id;const t=Te();if(t){const n=ft(t);delete n.replay_id}}function HE(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:q.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 UE(e,t){return e.recordingMode!=="buffer"||t.message===po||!t.exception||t.type?!1:Zl(e.getOptions().errorSampleRate)}function WE(e){return Object.assign((t,n)=>{var o;if(!e.isEnabled()||e.isPaused())return t;if(xE(t))return delete t.breadcrumbs,t;if(!ko(t)&&!xi(t)&&!dc(t))return t;if(!e.checkAndHandleExpiredSession())return id(),t;if(dc(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),HE(e,t),t;if(BE(t,n)&&!e.getOptions()._experiments.captureExceptions)return D&&O.log("Ignoring error from rrweb internals",t),null;const s=UE(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&bs(c)}return t},{id:"Replay"})}function Es(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:q.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 zE(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 jE(e){return t=>{if(!e.isEnabled())return;const n=zE(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Es(e,[n]),!1)))}}function qE(e,t){return D&&e.getOptions()._experiments.traceInternals?!1:fh(t,j())}function od(e,t){e.isEnabled()&&t!==null&&(qE(e,t.name)||e.addUpdate(()=>(Es(e,[t]),!0)))}function vs(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=yl(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function ad(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function is(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 cd(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 qn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Tt(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}=VE(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function Mi(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 VE(e){if(!e||typeof e!="string")return{body:e};const t=e.length>qa,n=GE(e);if(t){const r=e.slice(0,qa);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 GE(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function os(e,t){const n=YE(e);return it(n,t)}function YE(e,t=ue.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ue.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 KE(e,t,n){try{const r=await JE(e,t,n),s=cd("resource.fetch",r);od(n.replay,s)}catch(r){D&&O.exception(r,"Failed to capture fetch breadcrumb")}}function XE(e,t){const{input:n,response:r}=t,s=n?bl(n):void 0,i=vs(s),o=r?ad(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 JE(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:d}=e.data,l=os(o,n.networkDetailAllowUrls)&&!os(o,n.networkDetailDenyUrls),f=l?ZE(n,t.input,u):qn(u),p=await QE(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function ZE({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?nv(n,t):{};if(!e)return Tt(s,r,void 0);const i=bl(n),[o,c]=Sl(i,O),a=Tt(s,r,o);return c?is(a,c):a}async function QE(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return qn(s);const i=r?ud(r.headers,n):{};if(!r||!t&&s!==void 0)return Tt(i,s,void 0);const[o,c]=await tv(r),a=ev(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?is(a,c):a}function ev(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?vs(e):n;return r?t?Tt(s,i,e):Tt(s,i,void 0):qn(i)}catch(i){return D&&O.exception(i,"Failed to serialize response body"),Tt(s,n,void 0)}}async function tv(e){const t=rv(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await sv(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(D&&O.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(D&&O.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function ud(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function nv(e,t){return e.length===1&&typeof e[0]!="string"?fc(e[0],t):e.length===2?fc(e[1],t):{}}function fc(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?ud(n,t):Array.isArray(n)?{}:Mi(n,t):{}}function rv(e){try{return e.clone()}catch(t){D&&O.exception(t,"Failed to clone response body")}}function sv(e){return new Promise((t,n)=>{const r=ar(()=>n(new Error("Timeout while trying to read response body")),500);iv(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function iv(e){return await e.text()}async function ov(e,t,n){try{const r=cv(e,t,n),s=cd("resource.xhr",r);od(n.replay,s)}catch(r){D&&O.exception(r,"Failed to capture xhr breadcrumb")}}function av(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=vs(r),i=n.getResponseHeader("content-length")?ad(n.getResponseHeader("content-length")):dv(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function cv(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!os(a,n.networkDetailAllowUrls)||os(a,n.networkDetailDenyUrls)){const A=qn(l),y=qn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:A,response:y}}const p=c[Ot],h=p?Mi(p.request_headers,n.networkRequestHeaders):{},m=Mi(El(c),n.networkResponseHeaders),[_,g]=n.networkCaptureBodies?Sl(o,O):[void 0],[S,L]=n.networkCaptureBodies?uv(c):[void 0],R=Tt(h,l,_),H=Tt(m,f,S);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:g?is(R,g):R,response:L?is(H,L):H}}function uv(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return lv(e.response,e.responseType)}catch(n){t.push(n)}return D&&O.warn("Failed to get xhr response body",...t),[void 0]}function lv(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 D&&O.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return D&&O.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function dv(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return vs(n)}catch{return}}function fv(e){const t=j();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)=>pv(c,a,u))}catch{}}function pv(e,t,n){if(t.data)try{hv(t)&&_v(n)&&(av(t,n),ov(t,n,e)),mv(t)&&gv(n)&&(XE(t,n),KE(t,n,e))}catch(r){D&&O.exception(r,"Error when enriching network breadcrumb")}}function hv(e){return e.category==="xhr"}function mv(e){return e.category==="fetch"}function _v(e){return e==null?void 0:e.xhr}function gv(e){return e==null?void 0:e.response}function yv(e){const t=j();ml(Kb(e)),_s(jE(e)),OE(e),fv(e);const n=WE(e);Np(n),t&&(t.on("beforeSendEvent",LE(e)),t.on("afterSendEvent",ME(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)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function Sv(e){try{return Promise.all(Es(e,[bv(ue.performance.memory)]))}catch{return[]}}function bv(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 Ev(e,t,n){return yh(e,t,{...n,setTimeoutImpl:ar})}const Ve=G.navigator;function vv(){return/iPhone|iPad|iPod/i.test((Ve==null?void 0:Ve.userAgent)??"")||/Macintosh/i.test((Ve==null?void 0:Ve.userAgent)??"")&&(Ve!=null&&Ve.maxTouchPoints)&&(Ve==null?void 0:Ve.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function Tv(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){D&&O.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&jb(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Io(e,n,s))return!0;if(!s)return!1;const i=e.session;if(Iv(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(D&&O.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&bs(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function wv(e){const t=e.getOptions();return{type:q.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 Iv(e,t){var n;!t||((n=e.session)==null?void 0:n.segmentId)!==0||Io(e,wv(e),!1)}function kv(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Cv(e,t,n,r){return At(au(e,zi(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function Rv({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 xv({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 hu(e.getOptions(),r,i,t,e,Ce());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function Mv({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=Rv({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=j(),f=ee(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const m={type:oS,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await xv({scope:f,client:l,replayId:t,event:m});if(!_)return l.recordDroppedEvent("event_processor","replay"),D&&O.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const g=Cv(_,o,h,l.getOptions().tunnel);let S;try{S=await p.send(g)}catch(R){const H=new Error(po);try{H.cause=R}catch{}throw H}const L=wu({},S);if(Tu(L,"replay"))throw new Co(L);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new ld(S.statusCode);return S}class ld extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Co extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class pc extends Error{constructor(){super("Session is too long, not sending replay")}}async function dd(e,t={count:0,interval:fS}){const{recordingData:n,onError:r}=e;if(n.length)try{return await Mv(e),!0}catch(s){if(s instanceof ld||s instanceof Co)throw s;if(Mp("Replays",{_retryCount:t.count}),r&&r(s),t.count>=pS){const i=new Error(`${po} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{ar(async()=>{try{await dd(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const fd="__THROTTLED",Av="__SKIPPED";function Nv(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?Av:fd}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class Lv{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:aS,sessionIdleExpire:cS},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=Ev(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Nv((o,c)=>CE(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(hS,r),timeout:r,scrollTimeout:mS,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new Hb(this,i)),D){const o=t._experiments;O.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{ue.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=et({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=et({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{Qb(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){D&&O.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){D&&O.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",D&&O.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){D&&O.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){D&&O.log("Buffering is in progress, call `flush()` to save the replay");return}D&&O.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Gs({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){D&&O.log("Buffering is in progress, call `flush()` to save the replay");return}D&&O.infoTick("Starting replay in buffer mode");const t=Gs({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=at({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:dS}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Tv(this),...vv(),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}={}){var r;if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{D&&O.log(`Stopping Replay${n?` triggered by ${n}`:""}`),id(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(r=this.eventBuffer)==null||r.destroy(),this.eventBuffer=null,vE(this)}catch(s){this.handleException(s)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),D&&O.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),D&&O.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();D&&O.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){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){var t;if(this._lastActivity&&Ri(this._lastActivity,this.timeouts.sessionIdlePause)&&((t=this.session)==null?void 0:t.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${ue.location.pathname}${ue.location.hash}${ue.location.search}`,n=`${ue.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===fd){const s=et({category:"replay.throttled"});this.addUpdate(()=>!Io(this,{type:Lb,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Te(),n=t&&ve(t),s=(n&&Z(n).data||{})[Ne];if(!(!n||!s||!["route","custom"].includes(s)))return Z(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=SE({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=Gs({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 td(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{ue.document.addEventListener("visibilitychange",this._handleVisibilityChange),ue.addEventListener("blur",this._handleWindowBlur),ue.addEventListener("focus",this._handleWindowFocus),ue.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(yv(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=fE(this)}_removeListeners(){try{ue.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ue.removeEventListener("blur",this._handleWindowBlur),ue.removeEventListener("focus",this._handleWindowFocus),ue.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||ed(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()){D&&O.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:q.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=rE(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(Es(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&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){var n;const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){D&&O.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await Sv(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new pc;const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await dd({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendReplay"});const s=j();if(s){let i;r instanceof Co?i="ratelimit_backoff":r instanceof pc?i="invalid":i="send_error",s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){D&&O.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=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){D&&O.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&&D&&O.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&&bs(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=kv(c.target),u=n.join(",");return a==null?void 0: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=et({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function Mn(e,t){return[...e,...t].join(",")}function Dv({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=Mn(e,[".sentry-mask","[data-sentry-mask]"]),c=Mn(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:Mn(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Mn(r,[]),ignoreSelector:Mn(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function Ov({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 hc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Pv=["content-length","content-type","accept"],Fv=Symbol.for("sentry__originalRequestBody");let mc=!1,_c=!1;function $v(){if(typeof Request>"u"||_c)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return(r==null?void 0:r.body)!=null&&(s[Fv]=r.body),s};t.prototype=e.prototype,G.Request=t,_c=!0}catch{}}const k0=e=>new Bv(e);class Bv{constructor({flushMinDelay:t=uS,flushMaxDelay:n=lS,minReplayDuration:r=_S,maxReplayDuration:s=Va,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:g=[],networkCaptureBodies:S=!0,networkRequestHeaders:L=[],networkResponseHeaders:R=[],mask:H=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:y=[],block:T=[],unblock:F=[],ignore:E=[],maskFn:k,beforeAddRecordingEvent:v,beforeErrorSampling:C,onError:M,attachRawBodyFromRequest:J=!1}={}){this.name="Replay";const te=Dv({mask:H,unmask:y,block:T,unblock:F,ignore:E});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:k,maskInputFn:k,maskAttributeFn:(Y,I,N)=>Ov({maskAttributes:A,maskAllText:u,privacyOptions:te,key:Y,value:I,el:N}),...te,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Y=>{try{Y.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,gS),maxReplayDuration:Math.min(s,Va),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:_,networkDetailDenyUrls:g,networkCaptureBodies:S,networkRequestHeaders:gc(L),networkResponseHeaders:gc(R),beforeAddRecordingEvent:v,beforeErrorSampling:C,onError:M,attachRawBodyFromRequest:J,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${hc}`:hc,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Gr())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return mc}set _isInitialized(t){mc=t}afterAllSetup(t){!Gr()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&$v(),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){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=Hv(this._initialOptions,t);this._replay=new Lv({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function Hv(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=Wt(n.replaysSessionSampleRate),i=Wt(n.replaysOnErrorSampleRate);return s==null&&i==null&&ht(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function gc(e){return[...Pv,...e.map(t=>t.toLowerCase())]}function Uv(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function pd(e){try{return new URL(e,X.location.origin).href}catch{return}}function Wv(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function hd(e){try{return new Headers(e)}catch{return}}const yc=new WeakMap,Ys=new Map,md={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function zv(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...md,...t},d=typeof i=="function"?i:h=>!0,l=h=>jv(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 _=Ys.get(m.span_id);_&&(m.timestamp=_/1e3,Ys.delete(m.span_id))}}),h)),s&&nm(h=>{if(h.response){const m=yc.get(h.response);m&&h.endTimestamp&&Ys.set(m,h.endTimestamp)}}),$u(h=>{const m=Vh(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&yc.set(h.response,h.fetchData.__span),m){const _=pd(h.fetchData.url),g=_?Ht(_).host:void 0;m.setAttributes({"http.url":_?Et(_):void 0,"server.address":g}),o&&Sc(m),a==null||a(m,{headers:h.headers})}})),r&&gl(h=>{var _;const m=qv(h,d,l,f,p,u);m&&(o&&Sc(m),a==null||a(m,{headers:hd((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}function Sc(e){const{url:t}=Z(e).data;if(!t||typeof t!="string")return;const n=jt("resource",({entries:r})=>{r.forEach(s=>{Wv(s)&&s.name.endsWith(t)&&(e.setAttributes(hl(s)),setTimeout(n))})})}function jv(e,t){const n=Vt();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?it(r.toString(),t)||i&&it(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?it(e,t):r}}function qv(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[Ot];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=Ye()&&t(a);if(e.endTimestamp){const g=o.__sentry_xhr_span_id__;if(!g)return;const S=r[g];S&&(d&&c.status_code!==void 0&&(jc(S,c.status_code),S.end(),i==null||i(S,{headers:hd(El(o)),error:e.error})),delete r[g]);return}const l=pd(a),f=Ht(l||a),p=Et(dh(a)),h=!!Te(),m=d&&h?It({name:`${u} ${p}`,attributes:{url:Et(a),type:"xhr","http.method":u,"http.url":l?Et(l):void 0,"server.address":f==null?void 0:f.host,[pe]:"auto.http.browser",[dt]:"http.client",...(f==null?void 0:f.search)&&{"http.query":f==null?void 0:f.search},...(f==null?void 0:f.hash)&&{"http.fragment":f==null?void 0:f.hash}}}):new wt;o.__sentry_xhr_span_id__=m.spanContext().spanId,r[o.__sentry_xhr_span_id__]=m,n(a)&&Vv(o,Ye()&&h?m:void 0,s);const _=j();return _&&_.emit("beforeOutgoingRequestSpan",m,e),m}function Vv(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Nu({span:t,propagateTraceparent:n});r&&Gv(e,r,s,i)}function Gv(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!Uv(o))&&e.setRequestHeader("baggage",n)}}catch{}}function Yv(){X.document?X.document.addEventListener("visibilitychange",()=>{const e=Te();if(!e)return;const t=ve(e);if(X.document.hidden&&t){const n="cancelled",{op:r,status:s}=Z(t);We&&b.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:Se,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):We&&b.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Kv=3600,_d="sentry_previous_trace",Xv="sentry.previous_trace";function Jv(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?e0():void 0;e.on("spanStart",o=>{if(ve(o)!==o)return;const c=ee().getPropagationContext();s=Zv(s,o,c),r&&Qv(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=ee(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(Ai(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Ai(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[zc]:s.sampleRate}})}function Zv(e,t,n){const r=Z(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[$i])}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<=Kv&&(We&&b.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[tf]:"previous_trace"}}),t.setAttribute(Xv,`${o.traceId}-${o.spanId}-${Ai(o)?1:0}`)),i)}function Qv(e){try{X.sessionStorage.setItem(_d,JSON.stringify(e))}catch(t){We&&b.warn("Could not store previous trace in sessionStorage",t)}}function e0(){var e;try{const t=(e=X.sessionStorage)==null?void 0:e.getItem(_d);return JSON.parse(t)}catch{return}}function Ai(e){return e.traceFlags===1}const t0="BrowserTracing",n0=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function r0(){const e=X.navigator;return e!=null&&e.userAgent?n0.test(e.userAgent):!1}const s0={...xr,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:{},...md},bc=(e={})=>{const t={name:void 0,source:void 0},n=X.document,{enableInp:r,enableElementTiming:s,enableLongTask:i,enableLongAnimationFrame:o,_experiments:{enableInteractions:c,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:l,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:m,traceXHR:_,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:S,enableHTTPTimings:L,ignoreResourceSpans:R,ignorePerformanceApiSpans:H,instrumentPageLoad:A,instrumentNavigation:y,detectRedirects:T,linkPreviousTrace:F,consistentTraceSampling:E,enableReportPageLoaded:k,onRequestSpanStart:v,onRequestSpanEnd:C}={...s0,...e},M=r0();let J,te,Y;function I(N,w,W=!0){const U=w.op==="pageload",ne=w.name,se=d?d(w):w,Pe=se.attributes||{};if(ne!==se.name&&(Pe[Ne]="custom",se.attributes=Pe),!W){const ge=Gt();It({...se,startTime:ge}).end(ge);return}t.name=se.name,t.source=Pe[Ne];const Fe=fu(se,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:U,beforeSpanEnd:ge=>{J==null||J(),kg(ge,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:R,ignorePerformanceApiSpans:H}),Tc(N,void 0);const ze=ee(),$e=ze.getPropagationContext();ze.setPropagationContext({...$e,traceId:Fe.spanContext().traceId,sampled:Mt(Fe),dsc:ft(ge)}),U&&(Y=void 0)},trimIdleSpanEndTimestamp:!k});U&&k&&(Y=Fe),Tc(N,Fe);function be(){n&&["interactive","complete"].includes(n.readyState)&&N.emit("idleSpanEnableAutoFinish",Fe)}U&&!k&&n&&(n.addEventListener("readystatechange",()=>{be()}),be())}return{name:t0,setup(N){var W;if(M){We&&b.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(Af(),J=Sg({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:N}),r&&Zg(),s&&$g(),o&&G.PerformanceObserver&&((W=PerformanceObserver.supportedEntryTypes)!=null&&W.includes("long-animation-frame"))?Eg():i&&bg(),c&&vg(),T&&n){const U=()=>{te=_e()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function w(){const U=Vn(N);U&&!Z(U).timestamp&&(We&&b.log(`[Tracing] Finishing current active span with op: ${Z(U).op}`),U.setAttribute($n,"cancelled"),U.end())}N.on("startNavigationSpan",(U,ne)=>{if(j()!==N)return;if(ne!=null&&ne.isRedirect){We&&b.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),I(N,{op:"navigation.redirect",...U},!1);return}te=void 0,w(),Ce().setPropagationContext({traceId:lt(),sampleRand:Math.random(),propagationSpanId:Ye()?void 0:ot()});const se=ee();se.setPropagationContext({traceId:lt(),sampleRand:Math.random(),propagationSpanId:Ye()?void 0:ot()}),se.setSDKProcessingMetadata({normalizedRequest:void 0}),I(N,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),N.on("startPageLoadSpan",(U,ne={})=>{if(j()!==N)return;w();const se=ne.sentryTrace||Ec("sentry-trace")||vc("sentry-trace"),Pe=ne.baggage||Ec("baggage")||vc("baggage"),Fe=vf(se,Pe),be=ee();be.setPropagationContext(Fe),Ye()||(be.getPropagationContext().propagationSpanId=ot()),be.setSDKProcessingMetadata({normalizedRequest:no()}),I(N,{op:"pageload",...U})}),N.on("endPageloadSpan",()=>{k&&Y&&(Y.setAttribute($n,"reportPageLoaded"),Y.end())})},afterAllSetup(N){if(M)return;let w=Vt();if(F!=="off"&&Jv(N,{linkPreviousTrace:F,consistentTraceSampling:E}),X.location){if(A){const W=Oe();i0(N,{name:X.location.pathname,startTime:W?W/1e3:void 0,attributes:{[Ne]:"url",[pe]:"auto.pageload.browser"}})}y&&_s(({to:W,from:U})=>{if(U===void 0&&(w==null?void 0:w.indexOf(W))!==-1){w=void 0;return}w=void 0;const ne=Xi(W),se=Vn(N),Pe=se&&T&&a0(se,te);gd(N,{name:(ne==null?void 0:ne.pathname)||X.location.pathname,attributes:{[Ne]:"url",[pe]:"auto.navigation.browser"}},{url:W,isRedirect:Pe})})}h&&Yv(),c&&o0(N,l,f,p,t),r&&ty(),zv(N,{traceFetch:m,traceXHR:_,trackFetchStreamPerformance:g,tracePropagationTargets:N.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:S,enableHTTPTimings:L,onRequestSpanStart:v,onRequestSpanEnd:C})}}};function i0(e,t,n){e.emit("startPageLoadSpan",t,n),ee().setTransactionName(t.name);const r=Vn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function gd(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=ee();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...no(),url:r}}),Vn(e)}function Ec(e){const t=X.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function vc(e){var r,s,i;const t=(s=(r=X.performance)==null?void 0:r.getEntriesByType)==null?void 0:s.call(r,"navigation")[0],n=(i=t==null?void 0:t.serverTiming)==null?void 0:i.find(o=>o.name===e);return n==null?void 0:n.description}function o0(e,t,n,r,s){const i=X.document;let o;const c=()=>{const a="ui.action.click",u=Vn(e);if(u){const d=Z(u).op;if(["navigation","pageload"].includes(d)){We&&b.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute($n,"interactionInterrupted"),o.end(),o=void 0),!s.name){We&&b.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=fu({name:s.name,op:a,attributes:{[Ne]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const yd="_sentry_idleSpan";function Vn(e){return e[yd]}function Tc(e,t){De(e,yd,t)}const wc=1.5;function a0(e,t){const n=Z(e),r=Gt(),s=n.start_timestamp;return!(r-s>wc||t&&r-t<=wc)}const Sd=["activate","mount"],bd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,c0=/(?:^|[-_])(\w)/g,u0=e=>e.replace(c0,t=>t.toUpperCase()).replace(/[-_]/g,""),l0="<Root>",Ks="<Anonymous>",d0=(e,t)=>e.repeat(t),Pn=(e,t)=>{if(!e)return Ks;if(e.$root===e)return l0;if(!e.$options)return Ks;const n=e.$options;let r=n.name||n._componentTag||n.__name;const s=n.__file;if(!r&&s){const i=s.match(/([^/\\]+)\.vue$/);i&&(r=i[1])}return(r?`<${u0(r)}>`:Ks)+(s&&t!==!1?` at ${s}`:"")},f0=e=>{if(e&&(e._isVue||e.__isVue)&&e.$parent){const t=[];let n=0;for(;e;){if(t.length>0){const s=t[t.length-1];if(s.constructor===e.constructor){n++,e=e.$parent;continue}else n>0&&(t[t.length-1]=[s,n],n=0)}t.push(e),e=e.$parent}return`
found in
${t.map((s,i)=>`${(i===0?"---> ":d0(" ",5+i*2))+(Array.isArray(s)?`${Pn(s[0])}... (${s[1]} recursive calls)`:Pn(s))}`).join(`
`)}`}return`
(found in ${Pn(e)})`},p0=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,s,i)=>{var u;const o=Pn(s,!1),c=s?f0(s):"",a={componentName:o,lifecycleHook:i,trace:c};if((t==null?void 0:t.attachProps)!==!1&&s&&((u=s.$options)!=null&&u.propsData?a.propsData=s.$options.propsData:s.$props&&(a.propsData=s.$props)),setTimeout(()=>{fs(r,{captureContext:{contexts:{vue:a}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&e.config.errorHandler)n.call(e,r,s,i);else throw r}},Ic="ui.vue",h0={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function Xs(e,t,n){e.$_sentryRootComponentSpanTimer&&clearTimeout(e.$_sentryRootComponentSpanTimer),e.$_sentryRootComponentSpanTimer=setTimeout(()=>{var r;(r=e.$root)!=null&&r.$_sentryRootComponentSpan&&(e.$root.$_sentryRootComponentSpan.end(t),e.$root.$_sentryRootComponentSpan=void 0)},n)}function m0(e,t){function n(s){return s.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(s=>n(t)===n(s))}const _0=(e={})=>{const t=(e.hooks||[]).concat(Sd).filter((s,i,o)=>o.indexOf(s)===i),n={},r=e.timeout||2e3;for(const s of t){const i=h0[s];if(!i){bd&&b.warn(`Unknown hook: ${s}`);continue}for(const o of i)n[o]=function(){var f;const c=this.$root===this;c&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||It({name:"Application Render",op:`${Ic}.render`,attributes:{[pe]:"auto.ui.vue"},onlyIfParent:!0}),Xs(this,_e(),r));const a=Pn(this,!1);if(!(c||(Array.isArray(e.trackComponents)?m0(e.trackComponents,a):e.trackComponents))){Xs(this,_e(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=o===i[0],l=((f=this.$root)==null?void 0:f.$_sentryRootComponentSpan)||Te();if(d){if(l){const p=this.$_sentryComponentSpans[s];p&&p.end(),this.$_sentryComponentSpans[s]=It({name:`Vue ${a}`,op:`${Ic}.${s}`,attributes:{[pe]:"auto.ui.vue"},onlyIfParent:!0})}}else{const p=this.$_sentryComponentSpans[s];if(!p)return;p.end(),Xs(this,_e(),r)}}}return n},g0=G,y0={Vue:g0.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:Sd,timeout:2e3,trackComponents:!1}},S0="Vue",b0=(e={})=>({name:S0,setup(t){const n={...y0,...t.getOptions(),...e};if(!n.Vue&&!n.app){ht(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(s=>kc(s,n)):n.Vue&&kc(n.Vue,n)}}),kc=(e,t)=>{var n;bd&&((n=e._instance)==null?void 0:n.isMounted)===!0&&ht(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&p0(e,t),Ye(t)&&e.mixin(_0(t.tracingOptions))};function C0(e={}){const t={defaultIntegrations:[...wl(),b0()],...e};return Au(t,"vue"),iS(t)}function E0(e,t,n){let r=!1;const s="mode"in e;e.onError(i=>fs(i,{mechanism:{handled:!1}})),e.beforeEach((i,o,...c)=>{const a=r?void 0:v0(),u={};for(const f of Object.keys(i.params))u[`url.path.parameter.${f}`]=i.params[f],u[`params.${f}`]=i.params[f];for(const f of Object.keys(i.query)){const p=i.query[f];p&&(u[`query.${f}`]=p)}let d=i.path,l="url";if(i.name&&t.routeLabel!=="path")d=i.name.toString(),l="custom";else if(i.matched.length>0){const f=i.matched.length-1;d=i.matched[f].path,l="route"}if(ee().setTransactionName(d),t.instrumentPageLoad&&a&&(Z(a).data[Ne]!=="custom"&&(a.updateName(d),a.setAttribute(Ne,l)),a.setAttributes({...u,[pe]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!a&&n({name:d,op:"navigation",attributes:{...u,[pe]:"auto.navigation.vue",[Ne]:l}}),s){const f=c[0];typeof f=="function"&&f()}})}function v0(){const e=Te(),t=e&&ve(e);return t&&Z(t).op==="pageload"?t:void 0}function R0(e={}){if(!e.router)return bc(e);const t=bc({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:s=!0,routeLabel:i="name"}=e;return{...t,afterAllSetup(o){t.afterAllSetup(o),E0(n,{routeLabel:i,instrumentNavigation:r,instrumentPageLoad:s},a=>{gd(o,a)})}}}export{T0 as a,R0 as b,I0 as f,j as g,C0 as i,k0 as r,w0 as s};