mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2026-03-21 17:33:10 +00:00
502 lines
309 KiB
JavaScript
502 lines
309 KiB
JavaScript
const x=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V=globalThis,Ft="10.41.0";function jt(){return os(V),V}function os(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ft,t[Ft]=t[Ft]||{}}function bn(e,t,n=V){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[Ft]=r[Ft]||{};return s[e]||(s[e]=t())}const bd=["debug","info","warn","error","log","assert","trace"],Ed="Sentry Logger ",Ur={};function pt(e){if(!("console"in V))return e();const t=V.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 vd(){Ni().enabled=!0}function Td(){Ni().enabled=!1}function Rc(){return Ni().enabled}function wd(...e){Ai("log",...e)}function Id(...e){Ai("warn",...e)}function kd(...e){Ai("error",...e)}function Ai(e,...t){x&&Rc()&&pt(()=>{V.console[e](`${Ed}[${e}]:`,...t)})}function Ni(){return x?bn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const b={enable:vd,disable:Td,isEnabled:Rc,log:wd,warn:Id,error:kd},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 Rd(i.slice(s))}}function Cd(e){return Array.isArray(e)?Mc(...e):e}function Rd(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 Ts="<anonymous>";function at(e){try{return!e||typeof e!="function"?Ts:e.name||Ts}catch{return Ts}}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 ze(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: ${at(r)}
|
|
Error:`,s)}}let ws=null;function Nc(e){const t="error";Rt(t,e),xt(t,xd)}function xd(){ws=V.onerror,V.onerror=function(e,t,n,r,s){return ze("error",{column:r,error:s,line:n,msg:e,url:t}),ws?ws.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}let Is=null;function Lc(e){const t="unhandledrejection";Rt(t,e),xt(t,Md)}function Md(){Is=V.onunhandledrejection,V.onunhandledrejection=function(e){return ze("unhandledrejection",e),Is?Is.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Dc=Object.prototype.toString;function as(e){switch(Dc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ct(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 Ad(e){return En(e,"DOMException")}function rt(e){return En(e,"String")}function Li(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function un(e){return e===null||Li(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return En(e,"Object")}function cs(e){return typeof Event<"u"&&ct(e,Event)}function Nd(e){return typeof Element<"u"&&ct(e,Element)}function Ld(e){return En(e,"RegExp")}function vn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Dd(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ct(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 Di(e){return typeof Request<"u"&&ct(e,Request)}const Oi=V,Od=80;function De(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||Od;for(;n&&i++<r&&(u=Pd(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 Pd(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Oi.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(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s!=null&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&rt(o)){const c=o.split(/\s+/);for(const a of c)r.push(`.${a}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const c=n.getAttribute(o);c&&r.push(`[${o}="${c}"]`)}return r.join("")}function Vt(){try{return Oi.document.location.href}catch{return""}}function Fc(e){if(!Oi.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 Ne(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 Oe(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,Oe(e,"__sentry_original__",t)}catch{}}function Pi(e){return e.__sentry_original__}function Bc(e){if(as(e))return{message:e.message,name:e.name,stack:e.stack,...Do(e)};if(cs(e)){const t={type:e.type,target:Lo(e.target),currentTarget:Lo(e.currentTarget),...Do(e)};return typeof CustomEvent<"u"&&ct(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Lo(e){try{return Nd(e)?De(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Do(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function Fd(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=V;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 Xs(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 rt(e)?Ld(t)?t.test(e):rt(t)?n?e===t:e.includes(t):!1:!1}function st(e,t=[],n=!1){return t.some(r=>kr(e,r,n))}function $d(){const e=V;return e.crypto||e.msCrypto}let ks;function Bd(){return bt()*16}function Be(e=$d()){try{if(e!=null&&e.randomUUID)return Gn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ks||(ks="10000000100040008000"+1e11),ks.replace(/[018]/g,t=>(t^(Bd()&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 Js(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(Hd(e))return!0;try{Oe(e,"__sentry_captured__",!0)}catch{}return!1}function Hd(e){try{return e.__sentry_captured__}catch{}}const Uc=1e3;function Gt(){return Yn()/Uc}function Ud(){const{performance:e}=V;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=Ud()))()}let Cs=null;function Wd(){var o;const{performance:e}=V;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 Pe(){return Cs===null&&(Cs=Wd()),Cs}function zd(e){const t=_e(),n={sid:Be(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>jd(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:Be()),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 jd(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 ut(){return Be()}function it(){return Be().substring(16)}const Zs="_sentrySpan";function fn(e,t){t?Oe(e,Zs,t):delete e[Zs]}function Wr(e){return e[Zs]}const Vd=100;class et{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:ut(),sampleRand:bt()}}clone(){const t=new et;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 et?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:ut(),sampleRand:bt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:Vd;if(r<=0)return this;const s={timestamp:Gt(),...t,message:t.message?Xs(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)||Be();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)||Be();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)||Be();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 Gd(){return bn("defaultCurrentScope",()=>new et)}function Yd(){return bn("defaultIsolationScope",()=>new et)}class Kd{constructor(t,n){let r;t?r=t:r=new et;let s;n?s=n:s=new et,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=jt(),t=os(e);return t.stack=t.stack||new Kd(Gd(),Yd())}function Xd(e){return pn().withScope(e)}function Jd(e,t){const n=pn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function $o(e){return pn().withScope(()=>e(pn().getIsolationScope()))}function Zd(){return{withIsolationScope:$o,withScope:Xd,withSetScope:Jd,withSetIsolationScope:(e,t)=>$o(t),getCurrentScope:()=>pn().getScope(),getIsolationScope:()=>pn().getIsolationScope()}}function Tn(e){const t=os(e);return t.acs?t.acs:Zd()}function ee(){const e=jt();return Tn(e).getCurrentScope()}function Re(){const e=jt();return Tn(e).getIsolationScope()}function Wc(){return bn("globalScope",()=>new et)}function us(...e){const t=jt(),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 z(){return ee().getClient()}function Qd(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||it()};return r&&(i.parent_span_id=r),i}const Le="sentry.source",Fi="sentry.sample_rate",zc="sentry.previous_trace_sample_rate",lt="sentry.op",fe="sentry.origin",$n="sentry.idle_span_finish_reason",Xn="sentry.measurement_unit",Jn="sentry.measurement_value",Bo="sentry.custom_span_name",$i="sentry.profile_id",wn="sentry.exclusive_time",ef="sentry.link.type",tf="gen_ai.conversation.id",nf=0,Bi=1,ye=2;function rf(e){if(e<400&&e>=100)return{code:Bi};if(e>=400&&e<500)switch(e){case 401:return{code:ye,message:"unauthenticated"};case 403:return{code:ye,message:"permission_denied"};case 404:return{code:ye,message:"not_found"};case 409:return{code:ye,message:"already_exists"};case 413:return{code:ye,message:"failed_precondition"};case 429:return{code:ye,message:"resource_exhausted"};case 499:return{code:ye,message:"cancelled"};default:return{code:ye,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:ye,message:"unimplemented"};case 503:return{code:ye,message:"unavailable"};case 504:return{code:ye,message:"deadline_exceeded"};default:return{code:ye,message:"internal_error"}}return{code:ye,message:"internal_error"}}function qc(e,t){e.setAttribute("http.response.status_code",t);const n=rf(t);n.message!=="unknown_error"&&e.setStatus(n)}const jc="_sentryScope",Vc="_sentryIsolationScope";function sf(e){try{const t=V.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function of(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function af(e,t,n){e&&(Oe(e,Vc,sf(n)),Oe(e,jc,t))}function zr(e){const t=e;return{scope:t[jc],isolationScope:of(t[Vc])}}const Hi="sentry-",cf=/^sentry-/,uf=8192;function Gc(e){const t=df(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.match(cf)){const o=s.slice(Hi.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[`${Hi}${r}`]=s),n),{});return ff(t)}function df(e){if(!(!e||!rt(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){pt(()=>{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:ut(),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=ut(),t=it(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Jc(e=ut(),t=it(),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}=K(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:K(e).parent_span_id,i=zr(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||it():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 K(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[lt],origin:s[fe],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===nf))return e.code===Bi?"ok":e.message||"internal_error"}const Bt="_sentryChildSpans",Qs="_sentryRootSpan";function tu(e,t){const n=e[Qs]||e;Oe(t,Qs,n),e[Bt]?e[Bt].add(t):Oe(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[Qs]||e}function Te(){const e=jt(),t=Tn(e);return t.getActiveSpan?t.getActiveSpan():Wr(ee())}function ei(){Uo||(pt(()=>{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:ye,message:r})}}e.tag="sentry_tracingErrorCallback",zo=!0,Nc(e),Lc(e)}function qe(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=z())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function qo(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&&qo(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&&qo(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){Oe(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 dt(e){var h;const t=z();if(!t)return{};const n=ve(e),r=K(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[Fi]??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[Le],p=r.description;return f!=="url"&&p&&(l.transaction=p),qe()&&(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||ut(),this._spanId=t.spanId||it()}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 Xe(e,t=100,n=1/0){try{return ti("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function iu(e,t=3,n=100*1024){const r=Xe(e,t);return Ff(r)>n?iu(e,t-1,n):r}function ti(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 ti("",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]=ti(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(Dd(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${at(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 ni(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 ni(e,(n,r)=>t.includes(r))}function ri(e){const t=os(V);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:[ri(r),i]:r.push(typeof i=="string"?ri(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(Xe(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 qf(e){const t=typeof e.data=="string"?ri(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const jf={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function jo(e){return jf[e]}function zi(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function ou(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=ou(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=dt(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(K(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=K(p),m=c(h);return m||(ei(),h)}:K,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}=K(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}=K(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 >"}=K(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 ls{constructor(t={}){this._traceId=t.traceId||ut(),this._spanId=t.spanId||it(),this._startTime=t.startTimestamp||_e(),this._links=t.links,this._attributes={},this.setAttributes({[fe]:"manual",[lt]: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(Le,"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[lt],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[fe],profile_id:this._attributes[$i],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=z();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(K(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=>K(l)).filter(Ko),o=this._attributes[Le];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:dt(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 ls&&e.isStandaloneSpan()}function ep(e){const t=z();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(!qe(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 au="__SENTRY_SUPPRESS_TRACING__";function sp(e,t){const n=ji();if(n.startSpan)return n.startSpan(e,t);const r=uu(e),{forceTransaction:s,parentSpan:i,scope:o}=e,c=o==null?void 0:o.clone();return us(c,()=>op(i)(()=>{const u=ee(),d=lu(u,i),f=e.onlyIfParent&&!d?new wt:cu({parentSpan:d,spanArguments:r,forceTransaction:s,scope:u});return fn(u,f),tp(()=>t(f),()=>{const{status:p}=K(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:ye,message:"internal_error"})},()=>{f.end()})}))}function It(e){const t=ji();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=uu(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>us(e.scope,o):s!==void 0?o=>qi(s,o):o=>o())(()=>{const o=ee(),c=lu(o,s);return e.onlyIfParent&&!c?new wt:cu({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function qi(e,t){const n=ji();return n.withActiveSpan?n.withActiveSpan(e,t):us(r=>(fn(r,e||void 0),t(r)))}function cu({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!qe()){const o=new wt;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...dt(o)};Rr(o,c)}return o}const s=Re();let i;if(e&&!n)i=ip(e,r,t),tu(e,i);else if(e){const o=dt(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),af(i,r,s),i}function uu(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 ji(){const e=jt();return Tn(e)}function Xo(e,t,n){var h;const r=z(),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[au]?[!1]:rp(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:Wt((h=u.dsc)==null?void 0:h.sample_rate)},u.sampleRand),p=new ls({...e,attributes:{[Le]:"custom",[Fi]: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[au]?!1:Mt(e),o=i?new ls({...n,parentSpanId:r,traceId:s,sampled:i}):new wt({traceId:s});tu(e,o);const c=z();return c&&(c.emit("spanStart",o),n.endTimestamp&&c.emit("spanEnd",o)),o}function lu(e,t){if(t)return t;if(t===null)return;const n=Wr(e);if(!n)return;const r=z();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ve(n):n}function op(e){return e!==void 0?t=>qi(e,t):t=>t()}const xr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},ap="heartbeatFailed",cp="idleTimeout",up="finalTimeout",lp="externalFinish";function du(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=z();if(!p||!qe()){const y=new wt,I={sample_rate:"0",sampled:"false",...dt(y)};return Rr(y,I),y}const h=ee(),m=Te(),_=dp(e);_.end=new Proxy(_.end,{apply(y,I,P){if(l&&l(_),I instanceof wt)return;const[v,...k]=P,w=v||_e(),C=$t(w),M=Cr(_).filter(T=>T!==_),J=K(_);if(!M.length||!f)return A(C),Reflect.apply(y,I,[C,...k]);const Y=p.getOptions().ignoreSpans,Z=M==null?void 0:M.reduce((T,H)=>{const ne=K(H);return!ne.timestamp||Y&&qr(ne,Y)?T:T?Math.max(T,ne.timestamp):ne.timestamp},void 0),E=J.start_timestamp,F=Math.min(E?E+u/1e3:1/0,Math.max(E||-1/0,Math.min(C,Z||1/0)));return A(F),Reflect.apply(y,I,[F,...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 N(y){s=setTimeout(()=>{!r&&o&&(i=ap,_.end(y))},d)}function R(y){g(),n.set(y,!0);const I=_e();N(I+d/1e3)}function U(y){if(n.has(y)&&n.delete(y),n.size===0){const I=_e();S(I+a/1e3)}}function A(y){r=!0,n.clear(),c.forEach(M=>M()),fn(h,m);const I=K(_),{start_timestamp:P}=I;if(!P)return;I.data[$n]||_.setAttribute($n,i);const k=I.status;(!k||k==="unknown")&&_.setStatus({code:Bi}),b.log(`[Tracing] Idle span "${I.op}" finished`);const w=Cr(_).filter(M=>M!==_);let C=0;w.forEach(M=>{M.isRecording()&&(M.setStatus({code:ye,message:"cancelled"}),M.end(y),x&&b.log("[Tracing] Cancelling span since span ended early",JSON.stringify(M,void 0,2)));const J=K(M),{timestamp:Y=0,start_timestamp:Z=0}=J,E=Z<=y,F=(u+a)/1e3,T=Y-Z<=F;if(x){const H=JSON.stringify(M,void 0,2);E?T||b.log("[Tracing] Discarding span since it finished after idle span final timeout",H):b.log("[Tracing] Discarding span since it happened after idle span was finished",H)}(!T||!E)&&(Mf(_,M),C++)}),C>0&&_.setAttribute("sentry.idle_span_discarded_spans",C)}return c.push(p.on("spanStart",y=>{if(r||y===_||K(y).timestamp||y instanceof ls&&y.isStandaloneSpan())return;Cr(_).includes(y)&&R(y.spanContext().spanId)})),c.push(p.on("spanEnd",y=>{r||U(y.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",y=>{y===_&&(o=!0,S(),n.size&&N())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(_.setStatus({code:ye,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 Rs=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=Rs,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===Rs)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===Rs){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=si(t,n,e,r);return vn(s)?s:Zn(s)}catch(s){return Vi(s)}}function si(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=>si(o,t,n,r+1)):si(i,t,n,r+1)}let tt,Qo,ea,mt;function pp(e){const t=V._sentryDebugIds,n=V._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={},tt||(tt={});const i=(o,c)=>{for(const a of o){const u=c[a],d=tt==null?void 0:tt[a];if(d&&mt&&u)mt[d[0]]=u,tt&&(tt[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&&tt){mt[h]=u,tt[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 fu(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:dt(t),...e.sdkProcessingMetadata};const n=ve(t),r=K(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 pu(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||Be(),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=fu(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=Xs(o.url,i)),i&&((a=(c=e.exception)==null?void 0:c.values)==null||a.forEach(u=>{u.value&&(u.value=Xs(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:Xe(o.data,t,n)}}))},...e.user&&{user:Xe(e.user,t,n)},...e.contexts&&{contexts:Xe(e.contexts,t,n)},...e.extra&&{extra:Xe(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=Xe(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Xe(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Xe(e.contexts.flags,3,n)),r}function Ip(e,t){if(!t)return e;const n=e?e.clone():new et;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 et||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 ds(e,t){return ee().captureException(e,kp(t))}function hu(e,t){return ee().captureEvent(e,t)}function Mp(e,t){Re().setContext(e,t)}function E0(e,t){Re().setTag(e,t)}function v0(e){Re().setUser(e)}function Ap(){const e=z();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function Np(e){Re().addEventProcessor(e)}function na(e){const t=Re(),{user:n}=fu(t,ee()),{userAgent:r}=V.navigator||{},s=zd({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&dn(i,{status:"exited"}),mu(),t.setSession(s),s}function mu(){const e=Re(),n=ee().getSession()||e.getSession();n&&qd(n),_u(),e.setSession()}function _u(){const e=Re(),t=z(),n=e.getSession();n&&t&&t.captureSession(n)}function xs(e=!1){if(e){mu();return}_u()}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&&gu(e,r,n)}),n}function sa(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function gu(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=z();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 ii(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());yu().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function zp(e){return yu().get(e)}function yu(){return bn("clientToLogBufferMap",()=>new WeakMap)}function qp(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function jp(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,[qp(e)])}function Su(e,t){const n=t??Vp(e)??[];if(n.length===0)return;const r=e.getOptions(),s=jp(n,r._metadata,r.tunnel,e.getDsn());bu().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Vp(e){return bu().get(e)}function bu(){return bn("clientToMetricBufferMap",()=>new WeakMap)}function Eu(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=>Eu(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 vu(e,t,n=Yn()){return Kp(e,t)>n}function Tu(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 wu=64;function Xp(e,t,n=Yi(e.bufferSize||wu)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(ni(o,(l,f)=>{const p=jo(f);vu(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}ni(a,(f,p)=>{e.recordDroppedEvent(l,jo(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=Tu(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 Iu(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[$i],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&&{[$i]: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",ku=Symbol.for("SentryInternalError"),Cu=Symbol.for("SentryDoNotSendEventError"),eh=5e3;function Mr(e){return{message:e,[ku]:!0}}function Ms(e){return{message:e,[Cu]:!0}}function ca(e){return!!e&&typeof e=="object"&&ku in e}function ua(e){return!!e&&typeof e=="object"&&Cu 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=Eu(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)??wu),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,ii),(this._options.enableMetrics??((i=this._options._experiments)==null?void 0:i.enableMetrics)??!0)&&la(this,"afterCaptureMetric","flushMetrics",sh,Su)}captureException(t,n,r){const s=Be();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:Be(),...r},o=Li(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=Be();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){ii(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];gu(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,qf(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),pu(i,t,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:Qd(r),...c.contexts};const a=su(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=ee(),s=Re()){return x&&oi(t)&&b.log(`Captured error event \`${Iu(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=Ru(t),a=oi(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(Ms(`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=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),Ms("An event processor returned `null`, will not send event.");if(n.data&&n.data.__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 Ms(`${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,N=g-S;N>0&&this.recordDroppedEvent("before_send","span",N)}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(oi(a)&&s)return s(a,r);if(Ru(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)):ei()}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):(ei(),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 oi(e){return e.type===void 0}function Ru(e){return e.type==="transaction"}function sh(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+xu(e.attributes)}function ih(e){let t=0;return e.message&&(t+=e.message.length*2),t+xu(e.attributes)}function xu(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 as(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():pt(()=>{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 Mu(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 Au(e={}){const t=e.client||z();if(!Ap()||!t)return{};const n=jt(),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?dt(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=z(),r=Re();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Sh}=n.getOptions();if(i<=0)return;const c={timestamp:Gt(),...e},a=s?pt(()=>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=Pi(this),n=_a.has(z())&&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. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],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: ${jr(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: ${jr(e)}`),!0}return!1}function Rh(e,t){return t!=null&&t.length?Iu(e).some(n=>st(n,t)):!1}function xh(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?st(n,t):!1}function Mh(e,t){if(!(t!=null&&t.length))return!1;const n=jr(e);return n?st(n,t):!1}function Ah(e,t){if(!(t!=null&&t.length))return!0;const n=jr(e);return n?st(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 jr(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||!ct(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=ai(e,t,r,i.originalException,n,s.exception.values,o,0))}function ai(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(ct(r[s],Error)){ya(o,c,r);const u=e(t,r[s]),d=a.length;Sa(u,s,d,c),a=ai(e,t,n,r[s],s,[u,...a],u,d)}return Nu(r)&&r.errors.forEach((u,d)=>{if(ct(u,Error)){ya(o,c,r);const l=e(t,u),f=a.length;Sa(l,`errors[${d}]`,f,c),a=ai(e,t,n,u,s,[l,...a],l,f)}}),a}function Nu(e){return Array.isArray(e.errors)}function ya(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Nu(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 V&&bd.forEach(function(e){e in V.console&&Ne(V.console,e,function(t){return Ur[e]=t,function(...n){ze("console",{args:n,level:e});const s=Ur[e];s==null||s.apply(V.console,n)}})})}function Lu(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||!Ou(e,t)||!Du(e,t))}function Wh(e,t){const n=ba(t),r=ba(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Ou(e,t)||!Du(e,t))}function Du(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 Ou(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",qh=()=>({name:zh,setup(e){e.on("spanStart",t=>{const n=ee().getScopeData(),r=Re().getScopeData(),s=n.conversationId||r.conversationId;s&&t.setAttribute(tf,s)})}}),jh=qh;function Vh(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=qe()&&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,qe()&&d?l:void 0,u);m&&(e.args[1]=h,h.headers=m)}const f=z();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=Au({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(Di(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){qc(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:ye,message:"internal_error"});e.end()}function pr(e){return e.split(",").some(t=>t.trim().startsWith(Hi))}function Xh(e){return typeof Headers<"u"&&ct(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,[fe]:r,[lt]:"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())||z();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Pu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Hn=V;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 ci(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(ci(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=ci(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 Fu(e,t){const n="fetch";Rt(n,e),xt(n,()=>$u(void 0,t))}function nm(e){const t="fetch-body-resolved";Rt(t,e),xt(t,()=>$u(sm))}function $u(e,t=!1){t&&!tm()||Ne(V,"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||ze("fetch",{...c}),n.apply(V,r).then(async a=>(e?e(a):ze("fetch",{...c,endTimestamp:_e()*1e3,response:a}),a),a=>{ze("fetch",{...c,endTimestamp:_e()*1e3,error:a}),as(a)&&a.stack===void 0&&(a.stack=s.stack,Oe(a,"framesToPop",1));const u=z(),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})`:Oe(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,()=>{ze("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():Di(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(Di(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 Vr(){return typeof window<"u"&&(!um()||lm())}function lm(){const e=V.process;return(e==null?void 0:e.type)==="renderer"}const Ze=V,se=Ze.document,An=Ze.navigator,Bu="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=z();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=se.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 $e(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=>Ze.document.createElementNS(Dm,c),t=$e(e("svg"),{width:`${Xt}`,height:`${Xt}`,viewBox:`0 0 ${Xt} ${Xt}`,fill:"var(--actor-color, var(--foreground))"}),n=$e(e("g"),{clipPath:"url(#clip0_57_80)"}),r=$e(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=$e(e("clipPath"),{id:"clip0_57_80"}),o=$e(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=se.createElement("button");if(s.type="button",s.className="widget__actor",s.ariaHidden="false",s.ariaLabel=t||e||Bu,s.appendChild(Om()),e){const o=se.createElement("span");o.appendChild(se.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 Hu="rgba(88, 74, 192, 1)",Fm={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:Hu,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:Hu,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=se.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:N=Tm,cancelButtonLabel:R=dm,confirmButtonLabel:U=pm,emailLabel:A=_m,emailPlaceholder:y=mm,formTitle:I=hm,isRequiredLabel:P=vm,messageLabel:v=ym,messagePlaceholder:k=gm,nameLabel:w=bm,namePlaceholder:C=Sm,removeScreenshotButtonLabel:M=wm,submitButtonLabel:J=fm,successMessageText:Y=Em,triggerLabel:Z=Bu,triggerAriaLabel:E="",highlightToolText:F=Im,hideToolText:T=km,removeHighlightText:H=Cm,onFormOpen:ne,onFormClose:te,onSubmitSuccess:me,onSubmitError:we,onFormSubmitted:ht}={})=>{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:Z,triggerAriaLabel:E,cancelButtonLabel:R,submitButtonLabel:J,confirmButtonLabel:U,formTitle:I,emailLabel:A,emailPlaceholder:y,messageLabel:v,messagePlaceholder:k,nameLabel:w,namePlaceholder:C,successMessageText:Y,isRequiredLabel:P,addScreenshotButtonLabel:N,removeScreenshotButtonLabel:M,highlightToolText:F,hideToolText:T,removeHighlightText:H,onFormClose:te,onFormOpen:ne,onSubmitError:we,onSubmitSuccess:me,onFormSubmitted:ht};let Ee=null,Ve=null,Ge=[];const Rn=G=>{if(!Ee){const ue=se.createElement("div");ue.id=String(G.id),se.body.appendChild(ue),Ee=ue.attachShadow({mode:"open"}),Ve=Ia(G),Ee.appendChild(Ve)}return Ee},lr=async G=>{const ue=G.enableScreenshot&&Nm();let xe,Se;try{xe=(t?t():await e("feedbackModalIntegration",m))(),ia(xe)}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=ue?n?n():await e("feedbackScreenshotIntegration",m):void 0;B&&(Se=B(),ia(Se))}catch{Nr&&b.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const le=xe.createDialog({options:{...G,onFormClose:()=>{var B;le==null||le.close(),(B=G.onFormClose)==null||B.call(G)},onFormSubmitted:()=>{var B;le==null||le.close(),(B=G.onFormSubmitted)==null||B.call(G)}},screenshotIntegration:Se,sendFeedback:Am,shadow:Rn(G)});return le},dr=(G,ue={})=>{const xe=hr(be,ue),Se=typeof G=="string"?se.querySelector(G):typeof G.addEventListener=="function"?G:null;if(!Se)throw Nr&&b.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let le=null;const B=async()=>{le||(le=await lr({...xe,onFormSubmitted:()=>{var W;le==null||le.removeFromDom(),(W=xe.onFormSubmitted)==null||W.call(xe)}})),le.appendToDom(),le.open()};Se.addEventListener("click",B);const Ie=()=>{Ge=Ge.filter(W=>W!==Ie),le==null||le.removeFromDom(),le=null,Se.removeEventListener("click",B)};return Ge.push(Ie),Ie},Ye=(G={})=>{const ue=hr(be,G),xe=Rn(ue),Se=Pm({triggerLabel:ue.triggerLabel,triggerAriaLabel:ue.triggerAriaLabel,shadow:xe,styleNonce:h});return dr(Se.el,{...ue,onFormOpen(){Se.hide()},onFormClose(){Se.show()},onFormSubmitted(){Se.show()}}),Se};return{name:"Feedback",setupOnce(){!Vr()||!be.autoInject||(se.readyState==="loading"?se.addEventListener("DOMContentLoaded",()=>Ye().appendToDom()):Ye().appendToDom())},attachTo:dr,createWidget(G={}){const ue=Ye(hr(be,G));return ue.appendToDom(),ue},async createForm(G={}){return lr(hr(be,G))},setTheme(G){if(be.colorScheme=G,Ee){const ue=Ia(be);Ve?Ee.replaceChild(ue,Ve):Ee.prepend(ue),Ve=ue}},remove(){var G;Ee&&((G=Ee.parentElement)==null||G.remove(),Ee=null,Ve=null),Ge.forEach(ue=>ue()),Ge=[]}}};var fs,oe,Uu,Lt,ka,Wu,ui,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 zu(e){var t=e.parentNode;t&&t.removeChild(e)}function j(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?fs.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??++Uu,__i:-1,__u:0};return s==null&&oe.vnode!=null&&oe.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,oe.vnode&&oe.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)&&!Gr.__r++||ka!==oe.debounceRendering)&&((ka=oe.debounceRendering)||Wu)(Gr)}function Gr(){var e,t,n,r=[],s=[];for(Lt.sort(ui);e=Lt.shift();)e.__d&&(n=Lt.length,t=Hm(e,r,s)||t,n===0||Lt.length>n?(li(r,t,s),s.length=r.length=0,t=void 0,Lt.sort(ui)):t&&oe.__c&&oe.__c(t,Ji));t&&li(r,t,s),Gr.__r=0}function ju(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=Vu(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)),di(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)),di(i,i))}function Vu(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=Vu(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(oe.event?oe.event(e):e)}}function Ma(e){if(this.l)return this.l[e.type+!0](oe.event?oe.event(e):e)}function Qi(e,t,n,r,s,i,o,c,a,u){var d,l,f,p,h,m,_,g,S,N,R,U,A,y,I,P=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[c=t.__e=n.__e]),(d=oe.__b)&&d(t);e:if(typeof P=="function")try{if(g=t.props,S=(d=P.contextType)&&r[d.__c],N=d?S?S.props.value:d.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:("prototype"in P&&P.prototype.render?t.__c=l=new P(g,N):(t.__c=l=new Dr(g,N),l.constructor=P,l.render=qm),S&&S.sub(l),l.props=g,l.state||(l.state={}),l.context=N,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),P.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=St({},l.__s)),St(l.__s,P.getDerivedStateFromProps(g,l.__s))),p=l.props,h=l.state,l.__v=t,f)P.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(P.getDerivedStateFromProps==null&&g!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,N),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,N)===!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(v){v&&(v.__=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,N),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,h,m)})}if(l.context=N,l.props=g,l.__P=e,l.__e=!1,U=oe.__r,A=0,"prototype"in P&&P.prototype.render){for(l.state=l.__s,l.__d=!1,U&&U(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,U&&U(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)),ju(e,Zi(I=d!=null&&d.type===Qn&&d.key==null?d.props.children:d)?I:[I],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(v){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),oe.__e(v,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=oe.diffed)&&d(t)}function li(e,t,n){for(var r=0;r<n.length;r++)eo(n[r],n[++r],n[++r]);oe.__c&&oe.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){oe.__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&&fs.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=""),ju(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&&zu(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){oe.__e(r,n)}}function di(e,t,n){var r,s;if(oe.unmount&&oe.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){oe.__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]&&di(r[s],t,n||typeof e.type!="function");n||e.__e==null||zu(e.__e),e.__=e.__e=e.__d=void 0}function qm(e,t,n){return this.constructor(e,n)}function jm(e,t,n){var r,s,i,o;oe.__&&oe.__(e,t),s=(r=!1)?null:t.__k,i=[],o=[],Qi(t,e=t.__k=j(Qn,null,[e]),s||Un,Un,t.ownerSVGElement!==void 0,s?null:t.firstChild?fs.call(t.childNodes):null,i,s?s.__e:t.firstChild,r,o),e.__d=void 0,li(i,e,o)}fs=Ji.slice,oe={__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}},Uu=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=[],Wu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ui=function(e,t){return e.__v.__b-t.__v.__b},Gr.__r=0;var ft,ie,As,Aa,mn=0,Gu=[],Or=[],de=oe,Na=de.__b,La=de.__r,Da=de.diffed,Oa=de.__c,Pa=de.unmount,Fa=de.__;function Yt(e,t){de.__h&&de.__h(ie,e,mn||t),mn=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Or}),n.__[e]}function Dt(e){return mn=1,Yu(Xu,e)}function Yu(e,t,n){var r=Yt(ft++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Xu(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=ie,!ie.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))};ie.u=!0;var i=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.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)},ie.shouldComponentUpdate=s}return r.__N||r.__}function Vm(e,t){var n=Yt(ft++,3);!de.__s&&to(n.__H,t)&&(n.__=e,n.i=t,ie.__H.__h.push(n))}function Ku(e,t){var n=Yt(ft++,4);!de.__s&&to(n.__H,t)&&(n.__=e,n.i=t,ie.__h.push(n))}function Gm(e){return mn=5,er(function(){return{current:e}},[])}function Ym(e,t,n){mn=6,Ku(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(ft++,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=ie.context[e.__c],n=Yt(ft++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ie)),t.props.value):e.__}function Xm(e,t){de.useDebugValue&&de.useDebugValue(t?t(e):e)}function Jm(e){var t=Yt(ft++,10),n=Dt();return t.__=e,ie.componentDidCatch||(ie.componentDidCatch=function(r,s){t.__&&t.__(r,s),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Zm(){var e=Yt(ft++,11);if(!e.__){for(var t=ie.__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=Gu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Pr),e.__H.__h.forEach(fi),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}de.__b=function(e){ie=null,Na&&Na(e)},de.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fa&&Fa(e,t)},de.__r=function(e){La&&La(e),ft=0;var t=(ie=e.__c).__H;t&&(As===ie?(t.__h=[],ie.__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(fi),t.__h=[],ft=0)),As=ie},de.diffed=function(e){Da&&Da(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gu.push(t)!==1&&Aa===de.requestAnimationFrame||((Aa=de.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})),As=ie=null},de.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Pr),n.__h=n.__h.filter(function(r){return!r.__||fi(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],de.__e(r,n.__v)}}),Oa&&Oa(e,t)},de.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&&de.__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=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function fi(e){var t=ie;e.__c=e.__(),ie=t}function to(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Xu(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:Ku,useMemo:er,useReducer:Yu,useRef:Gm,useState:Dt},Symbol.toStringTag,{value:"Module"}),n_="http://www.w3.org/2000/svg";function r_(){const e=r=>se.createElementNS(n_,r),t=$e(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=$e(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 j("h2",{class:"dialog__header"},j("span",{class:"dialog__title"},e.formTitle),e.showBranding?j("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 Ns(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:N,nameLabel:R,namePlaceholder:U,submitButtonLabel:A,isRequiredLabel:y}=e,[I,P]=Dt(!1),[v,k]=Dt(null),[w,C]=Dt(!1),M=u==null?void 0:u.input,[J,Y]=Dt(null),Z=an(T=>{Y(T),C(!1)},[]),E=an(T=>{const H=i_(T,{emailLabel:h,isEmailRequired:_,isNameRequired:g,messageLabel:S,nameLabel:R});return H.length>0?k(`Please enter in the following required fields: ${H.join(", ")}`):k(null),H.length===0},[h,_,g,S,R]),F=an(async T=>{P(!0);try{if(T.preventDefault(),!(T.target instanceof HTMLFormElement))return;const H=new FormData(T.target),ne=await(u&&w?u.value():void 0),te={name:Ns(H,"name"),email:Ns(H,"email"),message:Ns(H,"message"),attachments:ne?[ne]:void 0};if(!E(te))return;try{const me=await s({name:te.name,email:te.email,message:te.message,source:Rm,tags:d},{attachments:te.attachments});i(te,me)}catch(me){Nr&&b.error(me),k(me),o(me)}}finally{P(!1)}},[u&&w,i,o]);return j("form",{class:"form",onSubmit:F},M&&w?j(M,{onError:Z}):null,j("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:I},j("div",{class:"form__top"},v?j("div",{class:"form__error-container"},v):null,a?j("label",{for:"name",class:"form__label"},j(Ls,{label:R,isRequiredLabel:y,isRequired:g}),j("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:U,required:g,type:"text"})):j("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),c?j("label",{for:"email",class:"form__label"},j(Ls,{label:h,isRequiredLabel:y,isRequired:_}),j("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:_,type:"email"})):j("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),j("label",{for:"message",class:"form__label"},j(Ls,{label:S,isRequiredLabel:y,isRequired:!0}),j("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:N,required:!0,rows:5})),M?j("label",{for:"screenshot",class:"form__label"},j("button",{class:"btn btn--default",disabled:I,type:"button",onClick:()=>{Y(null),C(T=>!T)}},w?f:l),J?j("div",{class:"form__error-container"},J.message):null):null),j("div",{class:"btn-group"},j("button",{class:"btn btn--primary",disabled:I,type:"submit"},A),j("button",{class:"btn btn--default",disabled:I,type:"button",onClick:r},p))))}function Ls({label:e,isRequired:t,isRequiredLabel:n}){return j("span",{class:"form__label__text"},e,t&&j("span",{class:"form__label__text--required"},n))}const _r=16,Ba=17,a_="http://www.w3.org/2000/svg";function c_(){const e=a=>Ze.document.createElementNS(a_,a),t=$e(e("svg"),{width:`${_r}`,height:`${Ba}`,viewBox:`0 0 ${_r} ${Ba}`,fill:"inherit"}),n=$e(e("g"),{clipPath:"url(#clip0_57_156)"}),r=$e(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=$e(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=$e(e("clipPath"),{id:"clip0_57_156"}),c=$e(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 j(Qn,null,i?j("div",{class:"success__position",onClick:c},j("div",{class:"success__content"},r.successMessageText,j("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):j("dialog",{class:"dialog",onClick:r.onFormClose,open:e},j("div",{class:"dialog__position"},j("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},j(s_,{options:r}),j(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=se.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=Re().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=se.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(),se.body.style.overflow=u},open(){var p,h;f(!0),(p=e.onFormOpen)==null||p.call(e),(h=z())==null||h.emit("openFeedbackWidget"),u=se.body.style.overflow,se.body.style.overflow="hidden"},close(){f(!1),se.body.style.overflow=u}},l=t==null?void 0:t.createInput({h:j,hooks:t_,dialog:d,options:e}),f=p=>{jm(j(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=se.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(Ze.devicePixelRatio??1);return e.useEffect(()=>{const s=()=>{r(Ze.devicePixelRatio)},i=matchMedia(`(resolution: ${Ze.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:Ze.innerWidth*c,height:Ze.innerHeight*c},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=se.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 Ds(e,t){_t(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function Os(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),N=t.useRef(null),[R,U]=t.useState(1),A=t.useMemo(()=>{const w=se.getElementById(s.id);if(!w)return"white";const C=getComputedStyle(w);return C.getPropertyValue("--button-primary-background")||C.getPropertyValue("--accent-background")},[s.id]);t.useLayoutEffect(()=>{const w=()=>{const C=_.current;C&&(_t(l.canvas,{alpha:!1},M=>{const J=Math.min(C.clientWidth/M.width,C.clientHeight/M.height);U(J)}),(C.clientHeight===0||C.clientWidth===0)&&setTimeout(w,0))};return w(),Ze.addEventListener("resize",w),()=>{Ze.removeEventListener("resize",w)}},[l]);const y=t.useCallback((w,C)=>{_t(w,{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),Ds(g.current,l.canvas)},[l]),t.useEffect(()=>{y(S.current,l.dpi),_t(S.current,{alpha:!0},(w,C)=>{C.clearRect(0,0,w.width,w.height)}),Os(S.current,A,h)},[h,A]),t.useEffect(()=>{y(n,l.dpi),Ds(n,l.canvas),_t(se.createElement("canvas"),{alpha:!0},(w,C)=>{C.scale(l.dpi,l.dpi),w.width=l.canvas.width,w.height=l.canvas.height,Os(w,A,h),Ds(n,w)})},[h,l,A]);const I=w=>{if(!f||!N.current)return;const C=N.current.getBoundingClientRect(),M={type:f,x:w.offsetX/R,y:w.offsetY/R},J=(E,F)=>{const T=(F.clientX-C.x)/R,H=(F.clientY-C.y)/R;return{type:E.type,x:Math.min(E.x,T),y:Math.min(E.y,H),w:Math.abs(T-E.x),h:Math.abs(H-E.y)}},Y=E=>{_t(S.current,{alpha:!0},(F,T)=>{T.clearRect(0,0,F.width,F.height)}),Os(S.current,A,[...h,J(M,E)])},Z=E=>{const F=J(M,E);F.w*R>=1&&F.h*R>=1&&m(T=>[...T,F]),se.removeEventListener("mousemove",Y),se.removeEventListener("mouseup",Z)};se.addEventListener("mousemove",Y),se.addEventListener("mouseup",Z)},P=t.useCallback(w=>C=>{C.preventDefault(),C.stopPropagation(),m(M=>{const J=[...M];return J.splice(w,1),J})},[]),v={width:`${l.canvas.width*R}px`,height:`${l.canvas.height*R}px`},k=w=>{w.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:v}),e("canvas",{ref:S,id:"foreground",style:v}),e("div",{ref:N,onMouseDown:I,style:v},h.map((w,C)=>e("div",{key:C,class:"editor__rect",style:{top:`${w.y*R}px`,left:`${w.x*R}px`,width:`${w.w*R}px`,height:`${w.h*R}px`}},e("button",{"aria-label":s.removeHighlightText,onClick:P(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(se.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=se.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=V;let pi=0;function Ju(){return pi>0}function I_(){pi++,setTimeout(()=>{pi--})}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(Pi(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_(),us(o=>{o.addEventProcessor(c=>(t.mechanism&&(Js(c,void 0),ln(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),ds(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}$c(r,e),Oe(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 T0=$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=z(),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:cs(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 Ps(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 Zu(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&&Zu(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 Zu(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=hi(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 Ps(e,t.error);if(No(t)||Ad(t)){const o=t;if("stack"in t)i=Ps(e,t);else{const c=o.name||(No(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=hi(e,a,n,r),Js(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return as(t)?Ps(e,t):Fn(t)||cs(t)?(i=k_(e,t,n,s),ln(i,{synthetic:!0}),i):(i=hi(e,t,n,r),Js(i,`${t}`),ln(i,{synthetic:!0}),i)}function hi(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(Li(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=Fd(e),r=t?"promise rejection":"exception";return Oc(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:cs(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();Mu(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&&ii(this),u&&Su(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__,O=V,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=O.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){O.document&&O.addEventListener(e,t,n)}function Yr(e,t,n){O.document&&O.removeEventListener(e,t,n)}let cn=-1;const Qu=new Set,H_=()=>{var e,t;return((e=O.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=O.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 Qu)t();isFinite(cn)||(cn=e.type==="visibilitychange"?e.timeStamp:0,Yr("prerenderingchange",Fr,!0))}},rr=()=>{var e;if(O.document&&cn<0){const t=kn();cn=(O.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){Qu.add(t)}}};function U_(e){var t;return e.type==="pagehide"||((t=O.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=O.document)!=null&&i.prerendering||kn()>0?r="prerender":(o=O.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}},Fs=new WeakMap;function oo(e,t){try{return Fs.get(e)||Fs.set(e,new t),Fs.get(e)}catch{return new t}}class Kr{constructor(){Kr.prototype.__init.call(this),Kr.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)}},ps=e=>{var t;(t=O.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},z_=[1800,3e3],q_=(e,t={})=>{ps(()=>{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))})},j_=[.1,.25],V_=(e,t={})=>{q_(ao(()=>{var a;const n=sr("CLS",0);let r;const s=rr(),i=oo(t,Kr),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,j_,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=O==null?void 0:O.setTimeout)==null||a.call(O,r))}))};let el=0,$s=1/0,gr=0;const G_=e=>{e.forEach(t=>{t.interactionId&&($s=Math.min($s,t.interactionId),gr=Math.max(gr,t.interactionId),el=gr?(gr-$s)/7+1:0)})};let mi;const tl=()=>mi?el:performance.interactionCount||0,Y_=()=>{"interactionCount"in performance||mi||(mi=Cn("event",G_,{type:"event",buffered:!0,durationThreshold:0}))},Bs=10;let nl=0;const K_=()=>tl()-nl;class Xr{constructor(){Xr.prototype.__init.call(this),Xr.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){nl=tl(),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<Bs||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>Bs){const o=this._longestInteractionList.splice(Bs);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const rl=e=>{var n;const t=O.requestIdleCallback||O.setTimeout;((n=O.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(),Yr("visibilitychange",e,{capture:!0}),Yr("pagehide",e,{capture:!0})}))},X_=[200,500],J_=40,Z_=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=rr();ps(()=>{Y_();const r=sr("INP");let s;const i=oo(t,Xr),o=a=>{rl(()=>{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={})=>{ps(()=>{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&&(rl(a),Yr(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])vt(d,u,{capture:!0})}})},ng=[800,1800],_i=e=>{var t,n;(t=O.document)!=null&&t.prerendering?ps(()=>_i(e)):((n=O.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>_i(e),!0):setTimeout(e)},rg=(e,t={})=>{const n=sr("TTFB"),r=tr(e,n,ng,t.reportAllChanges);_i(()=>{const s=nr();s&&(n.value=Math.max(s.responseStart-kn(),0),n.entries=[s],r(!0))})},Nn={},Jr={};let sl,il,ol,al;function co(e,t=!1){return hs("cls",e,ig,sl,t)}function uo(e,t=!1){return hs("lcp",e,og,il,t)}function sg(e){return hs("ttfb",e,ag,ol)}function cl(e){return hs("inp",e,cg,al)}function qt(e,t){return ul(e,t),Jr[e]||(ug(e),Jr[e]=!0),ll(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: ${at(r)}
|
|
Error:`,s)}}function ig(){return V_(e=>{ir("cls",{metric:e}),sl=e},{reportAllChanges:!0})}function og(){return tg(e=>{ir("lcp",{metric:e}),il=e},{reportAllChanges:!0})}function ag(){return rg(e=>{ir("ttfb",{metric:e}),ol=e})}function cg(){return Z_(e=>{ir("inp",{metric:e}),al=e})}function hs(e,t,n,r,s=!1){ul(e,t);let i;return Jr[e]||(i=n(),Jr[e]=!0),r&&t({metric:r}),ll(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 ul(e,t){Nn[e]=Nn[e]||[],Nn[e].push(t)}function ll(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=O.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};vt("visibilitychange",t,{capture:!0,once:!0}),vt("pagehide",t,{capture:!0,once:!0})};function Hs(e){return typeof e=="number"&&isFinite(e)}function Ct(e,t,n,{...r}){const s=K(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),qi(e,()=>{const i=It({startTime:t,...r});return i&&i.end(n),i})}function lo(e){var _;const t=z();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":(_=O.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 O.addEventListener&&O.performance}function he(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 dl(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function fl(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(!dl("layout-shift"))return;const r=co(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);fl(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?he((Pe()||0)+t.startTime):_e(),i=ee().getScopeData().transactionName,o=t?De((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[fe]:"auto.http.browser.cls",[lt]:"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}`]=De(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(!dl("largest-contentful-paint"))return;const r=uo(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);fl(e,(s,i)=>{_g(t,n,i,s),r()})}function _g(e,t,n,r){zt&&b.log(`Sending LCP span (${e})`);const s=he((Pe()||0)+((t==null?void 0:t.startTime)||0)),i=ee().getScopeData().transactionName,o=t?De(t.element):"Largest contentful paint",c={[fe]:"auto.http.browser.lcp",[lt]:"ui.webvital.lcp",[wn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=De(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 Ue(e){return e&&((Pe()||performance.timeOrigin)+e)/1e3}function pl(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 Pe()||(n=or())!=null&&n.timeOrigin?gg({...t,"http.request.redirect_start":Ue(e.redirectStart),"http.request.redirect_end":Ue(e.redirectEnd),"http.request.worker_start":Ue(e.workerStart),"http.request.fetch_start":Ue(e.fetchStart),"http.request.domain_lookup_start":Ue(e.domainLookupStart),"http.request.domain_lookup_end":Ue(e.domainLookupEnd),"http.request.connect_start":Ue(e.connectStart),"http.request.secure_connection_start":Ue(e.secureConnectionStart),"http.request.connection_end":Ue(e.connectEnd),"http.request.request_start":Ue(e.requestStart),"http.request.response_start":Ue(e.responseStart),"http.request.response_end":Ue(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,Je={},Ae,tn;function Sg({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=or();if(r&&Pe()){r.mark&&O.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(){qt("longtask",({entries:e})=>{const t=Te();if(!t)return;const{op:n,start_timestamp:r}=K(t);for(const s of e){const i=he(Pe()+s.startTime),o=he(s.duration);n==="navigation"&&r&&i<r||Ct(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[fe]:"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=he(Pe()+r.startTime),{start_timestamp:i,op:o}=K(n);if(o==="navigation"&&i&&s<i)continue;const c=he(r.duration),a={[fe]:"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(){qt("event",({entries:e})=>{const t=Te();if(t){for(const n of e)if(n.name==="click"){const r=he(Pe()+n.startTime),s=he(n.duration),i={name:De(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[fe]:"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&&(Je.cls={value:e.value,unit:""},tn=t)},!0)}function wg(){return uo(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Je.lcp={value:e.value,unit:"millisecond"},Ae=t)},!0)}function Ig(){return sg(({metric:e})=>{e.entries[e.entries.length-1]&&(Je.ttfb={value:e.value,unit:"millisecond"})})}function kg(e,t){const n=or(),r=Pe();if(!(n!=null&&n.getEntries)||!r)return;const s=he(r),i=n.getEntries(),{op:o,start_timestamp:c}=K(e);i.slice(Ha).forEach(a=>{const u=he(a.startTime),d=he(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&&(Je.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(Je.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(Je),t.recordClsOnPageloadSpan||delete Je.cls,t.recordLcpOnPageloadSpan||delete Je.lcp,Object.entries(Je).forEach(([a,u])=>{Zf(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",kn()),Og(e,t)),Ae=void 0,tn=void 0,Je={}}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)&&st(t.name,i))return;const o=nr(!1),c=he(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[fe]:"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+he(c),r+he(o),{op:`browser.${s}`,name:t.name,attributes:{[fe]:"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+he(t.requestStart),s=n+he(t.responseEnd),i=n+he(t.responseStart);t.responseEnd&&(Ct(e,r,s,{op:"browser.request",name:t.name,attributes:{[fe]:"auto.ui.browser.metrics"}}),Ct(e,i,s,{op:"browser.response",name:t.name,attributes:{[fe]:"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={[fe]:"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(O.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,...pl(t)},l=i+r,f=l+s;Ct(e,l,f,{name:n.replace(O.location.origin,""),op:c,attributes:d})}function Dg(e){const t=O.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Hs(n.rtt)&&(Je["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Hs(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Hs(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Og(e,t){Ae&&t.recordLcpOnPageloadSpan&&(Ae.element&&e.setAttribute("lcp.element",De(Ae.element)),Ae.id&&e.setAttribute("lcp.id",Ae.id),Ae.url&&e.setAttribute("lcp.url",Ae.url.trim().slice(0,200)),Ae.loadTime!=null&&e.setAttribute("lcp.loadTime",Ae.loadTime),Ae.renderTime!=null&&e.setAttribute("lcp.renderTime",Ae.renderTime),e.setAttribute("lcp.size",Ae.size)),tn!=null&&tn.sources&&t.recordClsOnPageloadSpan&&tn.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,De(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()&&Pe()?qt("element",Bg):()=>{}}const Bg=({entries:e})=>{const t=Te(),n=t?ve(t):void 0,r=n?K(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?[he(a),"load-time"]:c?[he(c),"render-time"]:[_e(),"entry-emission"],l=o==="image-paint"?he(Math.max(0,(c??0)-(a??0))):0,f={[fe]:"auto.ui.browser.elementtiming",[lt]:"ui.elementtiming",[Le]:"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,gi,yi;function hl(e){const t="dom";Rt(t,e),xt(t,Ug)}function Ug(){if(!O.document)return;const e=ze.bind(null,"dom"),t=Wa(e,!0);O.document.addEventListener("click",t,!1),O.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=O[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(Ne(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)}}),Ne(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!==gi)return!1;try{if(!e.target||e.target._sentryId!==yi)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=qg(n);if(zg(n.type,r))return;Oe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Oe(r,"_sentryId",Be());const s=n.type==="keypress"?"input":n.type;Wg(n)||(e({event:n,name:s,global:t}),gi=n.type,yi=r?r._sentryId:void 0),clearTimeout(Ua),Ua=O.setTimeout(()=>{yi=void 0,gi=void 0},Hg)}}function qg(e){try{return e.target}catch{return null}}let Sr;function ms(e){const t="history";Rt(t,e),xt(t,jg)}function jg(){if(O.addEventListener("popstate",()=>{const t=O.location.href,n=Sr;if(Sr=t,n===t)return;ze("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);ze("history",{from:s,to:i})}return t.apply(this,n)}}Ne(O.history,"pushState",e),Ne(O.history,"replaceState",e)}function Vg(e){try{return new URL(e,O.location.origin).toString()}catch{return e}}const $r={};function ml(e){const t=$r[e];if(t)return t;let n=O[e];if(ci(n))return $r[e]=n.bind(O);const r=O.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(O))}function Gg(e){$r[e]=void 0}function ar(...e){return ml("setTimeout")(...e)}const Ot="__sentry_xhr_v3__";function _l(e){const t="xhr";Rt(t,e),xt(t,Yg)}function Yg(){if(!O.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=_e()*1e3,o=rt(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};ze("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&&rt(f)&&rt(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 ze("xhr",i),t.apply(n,r)}})}function Kg(e){if(rt(e))return e;try{return e.toString()}catch{}}const Xg=Symbol.for("sentry__originalRequestBody");function gl(e){return new URLSearchParams(e).toString()}function yl(e,t=b){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[gl(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 Sl(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 bl(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 Us=[],Br=new Map,Jt=new Map,Jg=60;function Zg(){if(or()&&Pe()){const t=Qg();return()=>{t()}}return()=>{}}const Si={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 cl(ey)}const ey=({metric:e})=>{if(e.value==null)return;const t=he(e.value);if(t>Jg)return;const n=e.entries.find(h=>h.duration===e.value&&Si[h.name]);if(!n)return;const{interactionId:r}=n,s=Si[n.name],i=he(Pe()+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?K(u).description:ee().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||De(n.target),f={[fe]:"auto.http.browser.inp",[lt]:`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(Si);Vr()&&e.forEach(s=>{O.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=De(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?De(c.target):n(c);if(Us.length>10){const d=Us.shift();Br.delete(d)}Us.push(a),Br.set(a,{span:o,elementName:u})})};qt("event",r),qt("first-input",r)}const ny=40;function ry(e,t=ml("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 je=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,sy=30,iy=50;function bi(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=>{const t=e.match(uy);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=oy.exec(e);if(n){const[,s,i,o]=n;return bi(s,Ut,+i,+o)}const r=ay.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const c=cy.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,o]=El(r[1]||Ut,r[2]);return bi(o,i,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]=El(s,r),bi(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},my=[iy,hy],_y=[dy,my],gy=Mc(..._y),El=(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&&hl(vy(n,t.dom)),t.xhr&&_l(wy(n)),t.fetch&&Fu(Iy(n)),t.history&&ms(ky(n)),t.sentry&&n.on("beforeSendEvent",Ey(n))}}},by=Sy;function Ey(e){return function(n){z()===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(z()!==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&&(je&&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=De(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(z()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Lu(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(z()!==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:Pu(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),kt(f,l)}}function Iy(e){return function(n){if(z()!==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:Pu(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),kt(a,c)}}}function ky(e){return function(n){if(z()!==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&&Ne(X,"setTimeout",za),t.setInterval&&Ne(X,"setInterval",za),t.requestAnimationFrame&&Ne(X,"requestAnimationFrame",Ny),t.XMLHttpRequest&&"XMLHttpRequest"in X&&Ne(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.${at(e)}`}}),e.apply(this,t)}}function Ny(e){return function(t){return e.apply(this,[_n(t,{mechanism:{data:{handler:at(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"&&Ne(n,s,function(i){const o={mechanism:{data:{handler:at(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Pi(i);return c&&(o.mechanism.data.handler=at(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")&&(Ne(r,"addEventListener",function(o){return function(c,a,u){try{Oy(a)&&(a.handleEvent=_n(a.handleEvent,{mechanism:{data:{handler:at(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:at(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Ne(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"){je&&b.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}na({ignoreDuration:!0}),xs();const n=Re();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))&&(xs(),r=i)}),t==="route"&&ms(({from:s,to:i})=>{s!==i&&(na({ignoreDuration:!0}),xs())})}}},$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&&(jy(n),qa("onerror")),t.onunhandledrejection&&(Vy(n),qa("onunhandledrejection"))}}},qy=zy;function jy(e){Nc(t=>{const{stackParser:n,attachStacktrace:r}=vl();if(z()!==e||Ju())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",hu(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Vy(e){Lc(t=>{const{stackParser:n,attachStacktrace:r}=vl();if(z()!==e||Ju())return;const s=Gy(t),i=un(s)?Yy(s):io(n,s,void 0,r,!0);i.level="error",hu(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 qa(e){je&&b.log(`Global Handler attached: ${e}`)}function vl(){const e=z();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function Xy(e){if(!(!rt(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()?(je&&pt(()=>{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 Tl(e){return[kh(),vh(),jh(),Ay(),by(),qy(),nS(),Bh(),Jy(),Hy(),Fy()]}function iS(e={}){const t=!e.skipBrowserExtensionCheck&&rS();let n=e.defaultIntegrations==null?Tl():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Cd(e.stackParser||gy),integrations:Bp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||ry};return ah(F_,r)}const ce=V,fo="sentryReplaySession",oS="replay_event",po="Unable to send Replay",aS=3e5,cS=9e5,uS=5e3,lS=5500,dS=6e4,fS=5e3,pS=3,ja=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),ge=(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))(ge||{});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 Zr(e){try{const t=e.rules||e.cssRules;return t?ES(Array.from(t,wl).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 wl(e){let t;if(IS(e))try{t=Zr(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 Il{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 Il}function _s({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 Ei(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 Qr(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function kl(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 Cl(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 vi(...e){return Cl("setTimeout")(...e)}function Rl(...e){return Cl("clearTimeout")(...e)}function xl(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 es(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:gs(e,t)}function US(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function gs(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 Ml(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=es(r,gs(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 Al(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 qS(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=vi(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{Rl(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return vi(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function jS(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=vi(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{Rl(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:N,keepIframeSrcFn:R,newlyAddedElement:U=!1,ignoreCSSAttributes:A}=t,y=GS(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ge.Document,childNodes:[],compatMode:e.compatMode}:{type:ge.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ge.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:N,keepIframeSrcFn:R,newlyAddedElement:U,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:ge.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:ge.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=Zr(e.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}f=es(f,gs(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=_s({type:null,tagName:l,maskInputOptions:a});f=Wn({isMasked:yn(e,r,i,s,o,S),element:e,value:f,maskInputFn:u})}return{type:ge.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:N,ignoreCSSAttributes:R}=t,U=WS(e,r,s,i),A=AS(e);let y={};const I=e.attributes.length;for(let v=0;v<I;v++){const k=e.attributes[v];k.name&&!Al(A,k.name,k.value)&&(y[k.name]=Ml(n,A,gn(k.name),k.value,e,a,R))}if(A==="link"&&o){const v=Array.from(n.styleSheets).find(w=>w.href===e.href);let k=null;v&&(k=Zr(v)),k&&(y.rel=null,y.href=null,y.crossorigin=null,y._cssText=es(k,v.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const v=Zr(e.sheet);v&&(y._cssText=es(v,gs(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){const v=e,k=mo(v),w=Qr(v,Ei(A),k),C=v.checked;if(k!=="submit"&&k!=="button"&&w){const M=yn(v,_,S,g,N,_s({type:k,tagName:Ei(A),maskInputOptions:c}));y.value=Wn({isMasked:M,element:v,value:w,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 v=e.toDataURL(d.type,d.quality),k=n.createElement("canvas");k.width=e.width,k.height=e.height;const w=k.toDataURL(d.type,d.quality);v!==w&&(y.rr_dataURL=v)}}if(A==="img"&&l){Zt||(Zt=n.createElement("canvas"),Xa=Zt.getContext("2d"));const v=e,k=v.currentSrc||v.getAttribute("src")||"<unknown-src>",w=v.crossOrigin,C=()=>{v.removeEventListener("load",C);try{Zt.width=v.naturalWidth,Zt.height=v.naturalHeight,Xa.drawImage(v,0,0),y.rr_dataURL=Zt.toDataURL(d.type,d.quality)}catch(M){if(v.crossOrigin!=="anonymous"){v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0?C():v.addEventListener("load",C);return}else console.warn(`Cannot inline img src=${k}! Error: ${M}`)}v.crossOrigin==="anonymous"&&(w?y.crossOrigin=w:v.removeAttribute("crossorigin"))};v.complete&&v.naturalWidth!==0?C():v.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)),U){const{width:v,height:k}=e.getBoundingClientRect();y={class:y.class,rr_width:`${v}px`,rr_height:`${k}px`}}A==="iframe"&&!p(y.src)&&(!U&&!xl(e)&&(y.rr_src=y.src),delete y.src);let P;try{customElements.get(A)&&(P=!0)}catch{}return{type:ge.Element,tagName:A,attributes:y,childNodes:[],isSVG:US(e)||void 0,needBlock:U,rootId:m,isCustom:P}}function ae(e){return e==null?"":e.toLowerCase()}function XS(e,t){if(t.comment&&e.type===ge.Comment)return!0;if(e.type===ge.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"&&kl(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ae(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(e.attributes.name)==="application-name"||ae(e.attributes.rel)==="icon"||ae(e.attributes.rel)==="apple-touch-icon"||ae(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ae(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ae(e.attributes.property).match(/^(og|twitter|fb):/)||ae(e.attributes.name).match(/^(og|twitter):/)||ae(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ae(e.attributes.name)==="robots"||ae(e.attributes.name)==="googlebot"||ae(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ae(e.attributes.name)==="author"||ae(e.attributes.name)==="generator"||ae(e.attributes.name)==="framework"||ae(e.attributes.name)==="publisher"||ae(e.attributes.name)==="progid"||ae(e.attributes.property).match(/^article:/)||ae(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ae(e.attributes.name)==="google-site-verification"||ae(e.attributes.name)==="yandex-verification"||ae(e.attributes.name)==="csrf-token"||ae(e.attributes.name)==="p:domain_verify"||ae(e.attributes.name)==="verify-v1"||ae(e.attributes.name)==="verification"||ae(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:N={},inlineImages:R=!1,recordCanvas:U=!1,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:I=5e3,onBlockedImageLoad:P,onStylesheetLoad:v,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:C=!1,ignoreCSSAttributes:M}=t;let{preserveWhiteSpace:J=!0}=t;const Y=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:N,inlineImages:R,recordCanvas:U,keepIframeSrcFn:w,newlyAddedElement:C,ignoreCSSAttributes:M});if(!Y)return console.warn(e,"not serialized"),null;let Z;r.hasNode(e)?Z=r.getId(e):XS(Y,S)||!J&&Y.type===ge.Text&&!Y.isStyle&&!Y.textContent.replace(/^\s+|\s+$/gm,"").length?Z=zn:Z=_o();const E=Object.assign(Y,{id:Z});if(r.add(e,E),Z===zn)return null;A&&A(e);let F=!f;if(E.type===ge.Element){F=F&&!E.needBlock;const T=e.shadowRoot;T&&Dn(T)&&(E.isShadowHost=!0)}if((E.type===ge.Document||E.type===ge.Element)&&F){S.headWhitespace&&E.type===ge.Element&&E.tagName==="head"&&(J=!1);const T={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:N,inlineImages:R,recordCanvas:U,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:I,onBlockedImageLoad:P,onStylesheetLoad:v,stylesheetLoadTimeout:k,keepIframeSrcFn:w,ignoreCSSAttributes:M},H=e.childNodes?Array.from(e.childNodes):[];for(const ne of H){const te=sn(ne,T);te&&E.childNodes.push(te)}if(bS(e)&&e.shadowRoot)for(const ne of Array.from(e.shadowRoot.childNodes)){const te=sn(ne,T);te&&(Dn(e.shadowRoot)&&(te.isShadow=!0),E.childNodes.push(te))}}if(e.parentNode&&Ln(e.parentNode)&&Dn(e.parentNode)&&(E.isShadow=!0),E.type===ge.Element&&E.tagName==="iframe"&&!E.needBlock&&qS(e,()=>{const T=xl(e);if(T&&y){const H=sn(T,{doc:T,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:N,inlineImages:R,recordCanvas:U,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:I,onStylesheetLoad:v,stylesheetLoadTimeout:k,keepIframeSrcFn:w,ignoreCSSAttributes:M});H&&y(e,H)}},I),E.type===ge.Element&&E.tagName==="img"&&!e.complete&&E.needBlock){const T=e,H=()=>{if(T.isConnected&&!T.complete&&P)try{const ne=T.getBoundingClientRect();ne.width>0&&ne.height>0&&P(T,E,ne)}catch{}T.removeEventListener("load",H)};T.isConnected&&T.addEventListener("load",H)}return E.type===ge.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&kl(E.attributes.href)==="css")&&jS(e,()=>{if(v){const T=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:N,inlineImages:R,recordCanvas:U,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:I,onStylesheetLoad:v,stylesheetLoadTimeout:k,keepIframeSrcFn:w,ignoreCSSAttributes:M});T&&v(e,T)}},k),E.type===ge.Element&&delete E.needBlock,E}function JS(e,t){const{mirror:n=new Il,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:N,preserveWhiteSpace:R,onSerialize:U,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:I,onStylesheetLoad:P,stylesheetLoadTimeout:v,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:w=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:N,inlineImages:f,recordCanvas:p,preserveWhiteSpace:R,onSerialize:U,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:I,onStylesheetLoad:P,stylesheetLoadTimeout:v,keepIframeSrcFn:k,newlyAddedElement:!1,ignoreCSSAttributes:w})}function Ce(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 qn(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=ys(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function Nl(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){ys(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Nl(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 ts=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ts=()=>new Date().getTime());function Ll(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 Dl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ol(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Pl(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Fe(e,t,n,r,s){if(!e)return!1;const i=Pl(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 Ws(e,t){return t.getId(e)===zn}function Fl(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?Fl(e.parentNode,t):!0:!0}function Ti(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 $l(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Bl(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function wi(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 Hl(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=Hl(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 Ul(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 ys(...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))($||{}),ke=(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))(ke||{}),nt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(nt||{}),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||!Ul(a))return;const u=Ln(a.parentNode)?this.mirror.getId(Hl(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=>{$l(f,this.mirror)&&!Fe(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Bl(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),wi(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Fe(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(!Ws(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Fe(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,Pl(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=Qr(n,c,o);const a=_s({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(Fe(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"),!Al(n.tagName,r)&&(i.attributes[r]=Ml(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(Fe(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);Fe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ws(n,this.mirror)||!ZS(n,this.mirror)||(this.addedSet.has(n)?(Ii(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Fl(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[tc(r,s)]?Ii(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(Ws(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);Fe(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),wi(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 Ii(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>Ii(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:Wl(e,t)}function Wl(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Wl(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 zl(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=qn(Q(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=Q(qn(Q(l=>{const f=cr(l),{clientX:p,clientY:h}=Ti(l)?l.changedTouches[0]:l;c||(c=ts()),o.push({x:p,y:h,id:r.getId(f),timeOffset:ts()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?$.Drag:l instanceof MouseEvent?$.MouseMove:$.TouchMove)}),s,{trailing:!1})),d=[Ce("mousemove",u,n),Ce("touchmove",u,n),Ce("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(Fe(p,r,s,i,!0))return;let h=null,m=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=nt.Mouse;break;case"touch":h=nt.Touch;break;case"pen":h=nt.Pen;break}h===nt.Touch?ke[l]===ke.MouseDown?m="TouchStart":ke[l]===ke.MouseUp&&(m="TouchEnd"):nt.Pen}else Ti(f)&&(h=nt.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===nt.Touch||m.startsWith("Mouse")&&h===nt.Mouse)&&(h=null)):ke[l]===ke.Click&&(h=u,u=null);const _=Ti(f)?f.changedTouches[0]:f;if(!_)return;const g=n.getId(p),{clientX:S,clientY:N}=_;Q(e)({type:ke[m],id:g,x:S,y:N,...h!==null&&{pointerType:h}})};return Object.keys(ke).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(ke[l]){case ke.MouseDown:case ke.MouseUp:f=f.replace("mouse","pointer");break;case ke.TouchStart:case ke.TouchEnd:return}a.push(Ce(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(qn(Q(a=>{const u=cr(a);if(!u||Fe(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=Ll(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 Ce("scroll",c,t)}function pb({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=Q(qn(Q(()=>{const i=Dl(),o=Ol();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return Ce("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 I=cr(y);const P=y.isTrusted,v=I&&Ei(I.tagName);if(v==="OPTION"&&(I=I.parentElement),!I||!v||hb.indexOf(v)<0||Fe(I,r,s,i,!0))return;const k=I;if(k.classList.contains(o)||c&&k.matches(c))return;const w=mo(I);let C=Qr(k,v,w),M=!1;const J=_s({maskInputOptions:a,tagName:v,type:w}),Y=yn(I,f,h,p,m,J);(w==="radio"||w==="checkbox")&&(M=I.checked),C=Wn({isMasked:Y,element:I,value:C,maskInputFn:u}),g(I,l?{text:C,isChecked:M,userTriggered:P}:{text:C,isChecked:M});const Z=I.name;w==="radio"&&Z&&M&&t.querySelectorAll(`input[type="radio"][name="${Z}"]`).forEach(E=>{if(E!==I){const F=Wn({isMasked:Y,element:E,value:Qr(E,v,w),maskInputFn:u});g(E,l?{text:F,isChecked:!M,userTriggered:!1}:{text:F,isChecked:!M})}})}function g(y,I){const P=sc.get(y);if(!P||P.text!==I.text||P.isChecked!==I.isChecked){sc.set(y,I);const v=n.getId(y);Q(e)({...I,id:v})}}const N=(d.input==="last"?["change"]:["input","change"]).map(y=>Ce(y,Q(_),t)),R=t.defaultView;if(!R)return()=>{N.forEach(y=>y())};const U=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 U&&U.set&&N.push(...A.map(y=>Nl(y[0],y[1],{set(){Q(_)({target:this,isTrusted:!1})}},!1,R))),Q(()=>{N.forEach(y=>y())})}function ns(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:[...ns(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:[...ns(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 jl({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:ns(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:ns(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=>qn(Q(d=>{const l=cr(d);if(!l||Fe(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=[Ce("play",c(en.Play),o),Ce("pause",c(en.Pause),o),Ce("seeked",c(en.Seeked),o),Ce("volumechange",c(en.VolumeChange),o),Ce("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 ys(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;Fe(h,r,s,i,!0)||Fe(_,r,s,i,!0)||d.push({start:n.getId(h),startOffset:m,end:n.getId(_),endOffset:g})}o({ranges:d})});return a(),Ce("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=zl(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=jl(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 ki{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 ki(_o),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class wb{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ki(_o),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ki(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!==ge.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=zl({...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})),ys(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(jl({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&&Ul(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:wl(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 pe,rs;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 Ke=CS();function ot(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:N,maskTextFn:R,maxCanvasSize:U=null,packFn:A,sampling:y={},dataURLOptions:I={},mousemoveWait:P,recordDOM:v=!0,recordCanvas:k=!1,recordCrossOriginIframes:w=!1,recordAfter:C=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:M=!1,collectFonts:J=!1,inlineImages:Y=!1,plugins:Z,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:F=new Set([]),errorHandler:T,onMutation:H,getCanvasManager:ne}=e;ub(T);const te=w?window.parent===window:!0;let me=!1;if(!te)try{window.parent.document&&(me=!1)}catch{me=!0}if(te&&!t)throw new Error("emit function is required");if(!te&&!me)return()=>{};P!==void 0&&y.mousemove===void 0&&(y.mousemove=P),Ke.reset();const we=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?_:{},ht=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,Ee=0;const Ve=B=>{for(const Ie of Z||[])Ie.eventProcessor&&(B=Ie.eventProcessor(B));return A&&!me&&(B=A(B)),B};pe=(B,Ie)=>{var Me;const W=B;if(W.timestamp=ts(),(Me=on[0])!=null&&Me.isFrozen()&&W.type!==q.FullSnapshot&&!(W.type===q.IncrementalSnapshot&&W.data.source===$.Mutation)&&on.forEach(He=>He.unfreeze()),te)t==null||t(Ve(W),Ie);else if(me){const He={type:"rrweb",event:Ve(W),origin:window.location.origin,isCheckout:Ie};window.parent.postMessage(He,"*")}if(W.type===q.FullSnapshot)be=W,Ee=0;else if(W.type===q.IncrementalSnapshot){if(W.data.source===$.Mutation&&W.data.isAttachIframe)return;Ee++;const He=r&&Ee>=r,re=n&&be&&W.timestamp-be.timestamp>n;(He||re)&&le(!0)}};const Ge=B=>{pe({type:q.IncrementalSnapshot,data:{source:$.Mutation,...B}})},Rn=B=>pe({type:q.IncrementalSnapshot,data:{source:$.Scroll,...B}}),lr=B=>pe({type:q.IncrementalSnapshot,data:{source:$.CanvasMutation,...B}}),dr=B=>pe({type:q.IncrementalSnapshot,data:{source:$.AdoptedStyleSheet,...B}}),Ye=new Rb({mutationCb:Ge,adoptedStyleSheetCb:dr}),G=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Tb:new wb({mirror:Ke,mutationCb:Ge,stylesheetManager:Ye,recordCrossOriginIframes:w,wrappedEmit:pe});for(const B of Z||[])B.getMirror&&B.getMirror({nodeMirror:Ke,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const ue=new xb,xe=Ab(ne,{mirror:Ke,win:window,mutationCb:B=>pe({type:q.IncrementalSnapshot,data:{source:$.CanvasMutation,...B}}),recordCanvas:k,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:U,sampling:y.canvas,dataURLOptions:I,errorHandler:T}),Se=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ib:new kb({mutationCb:Ge,scrollCb:Rn,bypassOptions:{onMutation:H,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:we,dataURLOptions:I,maskAttributeFn:S,maskTextFn:R,maskInputFn:N,recordCanvas:k,inlineImages:Y,sampling:y,slimDOMOptions:ht,iframeManager:G,stylesheetManager:Ye,canvasManager:xe,keepIframeSrcFn:E,processedNodeManager:ue,ignoreCSSAttributes:F},mirror:Ke}),le=(B=!1)=>{if(!v)return;pe({type:q.Meta,data:{href:window.location.href,width:Ol(),height:Dl()}},B),Ye.reset(),Se.init(),on.forEach(W=>W.lock());const Ie=JS(document,{mirror:Ke,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:we,maskAttributeFn:S,maskInputFn:N,maskTextFn:R,slimDOM:ht,dataURLOptions:I,recordCanvas:k,inlineImages:Y,onSerialize:W=>{$l(W,Ke)&&G.addIframe(W),Bl(W,Ke)&&Ye.trackLinkElement(W),wi(W)&&Se.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,Me)=>{G.attachIframe(W,Me),W.contentWindow&&xe.addWindow(W.contentWindow),Se.observeAttachShadow(W)},onStylesheetLoad:(W,Me)=>{Ye.attachLinkElement(W,Me)},onBlockedImageLoad:(W,Me,{width:He,height:re})=>{Ge({adds:[],removes:[],texts:[],attributes:[{id:Me.id,attributes:{style:{width:`${He}px`,height:`${re}px`}}}]})},keepIframeSrcFn:E,ignoreCSSAttributes:F});if(!Ie)return console.warn("Failed to snapshot the document");pe({type:q.FullSnapshot,data:{node:Ie,initialOffset:Ll(window)}}),on.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ye.adoptStyleSheets(document.adoptedStyleSheets,Ke.getId(document))};rs=le;try{const B=[],Ie=Me=>{var He;return Q(vb)({onMutation:H,mutationCb:Ge,mousemoveCb:(re,vs)=>pe({type:q.IncrementalSnapshot,data:{source:vs,positions:re}}),mouseInteractionCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.MouseInteraction,...re}}),scrollCb:Rn,viewportResizeCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.ViewportResize,...re}}),inputCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.Input,...re}}),mediaInteractionCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.MediaInteraction,...re}}),styleSheetRuleCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.StyleSheetRule,...re}}),styleDeclarationCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.StyleDeclaration,...re}}),canvasMutationCb:lr,fontCb:re=>pe({type:q.IncrementalSnapshot,data:{source:$.Font,...re}}),selectionCb:re=>{pe({type:q.IncrementalSnapshot,data:{source:$.Selection,...re}})},customElementCb:re=>{pe({type:q.IncrementalSnapshot,data:{source:$.CustomElement,...re}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:we,inlineStylesheet:h,sampling:y,recordDOM:v,recordCanvas:k,inlineImages:Y,userTriggeredOnInput:M,collectFonts:J,doc:Me,maskAttributeFn:S,maskInputFn:N,maskTextFn:R,keepIframeSrcFn:E,blockSelector:i,unblockSelector:o,slimDOMOptions:ht,dataURLOptions:I,mirror:Ke,iframeManager:G,stylesheetManager:Ye,shadowDomManager:Se,processedNodeManager:ue,canvasManager:xe,ignoreCSSAttributes:F,plugins:((He=Z==null?void 0:Z.filter(re=>re.observer))==null?void 0:He.map(re=>({observer:re.observer,options:re.options,callback:vs=>pe({type:q.Plugin,data:{plugin:re.name,payload:vs}})})))||[]},{})};G.addLoadListener(Me=>{try{B.push(Ie(Me.contentDocument))}catch(He){console.warn(He)}});const W=()=>{le(),B.push(Ie(document))};return document.readyState==="interactive"||document.readyState==="complete"?W():(B.push(Ce("DOMContentLoaded",()=>{pe({type:q.DomContentLoaded,data:{}}),C==="DOMContentLoaded"&&W()})),B.push(Ce("load",()=>{pe({type:q.Load,data:{}}),C==="load"&&W()},window))),()=>{B.forEach(Me=>Me()),ue.destroy(),rs=void 0,lb()}}catch(B){console.warn(B)}}function Mb(e){if(!rs)throw new Error("please take full snapshot after start recording");rs(e)}ot.mirror=Ke;ot.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 zs(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:Xe(t,10,1e3)}}),t.category==="console")))}const Db="button,a";function Vl(e){return e.closest(Db)||e}function Gl(e){const t=Yl(e);return!t||!(t instanceof Element)?t:Vl(t)}function Yl(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(){Ne(ce,"open",function(e){return function(...t){if(yt)try{yt.forEach(n=>n())}catch{}return e.apply(ce,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:zs(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=zs(t)}registerScroll(t=Date.now()){this._lastScroll=zs(t)}registerClick(t){const n=Vl(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:ce.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:ce.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 qb(e,t){try{if(!jb(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=ot.mirror.getNode(s);i instanceof HTMLElement&&r===ke.Click&&e.registerClick(i)}}catch{}}function jb(e){return e.type===Nb}function Vb(e){return e.data.source===$.MouseInteraction}function Qe(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,Gl(t.event)),ur(e,n)};function Kl(e,t){const n=ot.mirror.getId(e),r=n&&ot.mirror.getNode(n),s=r&&ot.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 Qe({category:`ui.${e.name}`,...Kl(t,n)})}function Jb(e){const t=e.name==="click";let n,r=null;try{r=t?Gl(e.event):Yl(e.event),n=De(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=De(o,{maxStringLength:200})||"<unknown>",d=Kl(o,u);return Qe({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((Pe()||ce.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=ot.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=>ot.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(qt(s,n))}),r.push(uo(qs(cE,e)),co(qs(lE,e)),cl(qs(dE,e))),()=>{r.forEach(s=>s())}}const L=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 js(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 L?(uc.forEach(r=>{n[r]=(...s)=>{b[r](Hr,...s),t&&js(s.join(""),Lu(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),b.error(Hr,r),e?ds(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&js(r,"error")},n.infoTick=(...r)=>{b.log(Hr,...r),t&&setTimeout(()=>js(r[0]),0)}):uc.forEach(r=>{n[r]=()=>{}}),n}const D=mE();class To extends Error{constructor(){super(`Event buffer exceeded maximum size of ${ho}.`)}}class Xl{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():(L&&D.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{L&&D.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(){L&&D.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){L&&D.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=>{L&&D.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 Xl,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){L&&D.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){L&&D.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 L&&D.log("Using simple buffer"),new Xl}function bE(e){try{const t=e||EE();if(!t)return;L&&D.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new yE(n)}catch(t){L&&D.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 ce&&!!ce.sessionStorage}catch{return!1}}function vE(e){TE(),e.session=void 0}function TE(){if(wo())try{ce.sessionStorage.removeItem(fo)}catch{}}function Jl(e){return e===void 0?!1:Math.random()<e}function Ss(e){if(wo())try{ce.sessionStorage.setItem(fo,JSON.stringify(e))}catch{}}function Zl(e){const t=Date.now(),n=e.id||Be(),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 Jl(e)?"session":t?"buffer":!1}function lc({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=wE(e,t),i=Zl({sampled:s,previousSessionId:r});return n&&Ss(i),i}function IE(){if(!wo())return null;try{const e=ce.sessionStorage.getItem(fo);if(!e)return null;const t=JSON.parse(e);return L&&D.infoTick("Loading existing session"),Zl(t)}catch{return null}}function Ci(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function Ql(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Ci(e.started,t,r)||Ci(e.lastActivity,n,r)}function ed(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Ql(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Vs({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&IE();return s?ed(s,{sessionIdleExpire:e,maxReplayDuration:t})?(L&&D.infoTick("Session in sessionStorage is expired, creating new one..."),lc(r,{previousSessionId:s.id})):s:(L&&D.infoTick("Creating new session"),lc(r,{previousSessionId:n}))}function kE(e){return e.type===q.Custom}function Io(e,t,n){return nd(e,t)?(td(e,t,n),!0):!1}function CE(e,t,n){return nd(e,t)?td(e,t,n):Promise.resolve(null)}async function td(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=z();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 nd(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?(L&&D.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 L&&D.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function ko(e){return!e.type}function Ri(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)&&!Ri(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(Ri(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){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||ar(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}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=Qe({category:"replay.hydrate-error",data:{url:Vt()}});ur(e,o)}}function OE(e){const t=z();t&&t.on("beforeAddBreadcrumb",n=>PE(e,n))}function PE(e,t){if(!e.isEnabled()||!rd(t))return;const n=FE(t);n&&ur(e,n)}function FE(e){return!rd(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?$E(e):Qe(e)}function $E(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return Qe(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=Xe(i,7);return JSON.stringify(o).length>Er?(n=!0,`${JSON.stringify(o,null,2).slice(0,Er)}…`):o}catch{}return i});return Qe({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function rd(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 sd(){const e=ee().getPropagationContext().dsc;e&&delete e.replay_id;const t=Te();if(t){const n=dt(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:Jl(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)&&!Ri(t)&&!dc(t))return t;if(!e.checkAndHandleExpiredSession())return sd(),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 L&&D.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&&Ss(c)}return t},{id:"Replay"})}function bs(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 qE(e){return t=>{if(!e.isEnabled())return;const n=zE(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(bs(e,[n]),!1)))}}function jE(e,t){return L&&e.getOptions()._experiments.traceInternals?!1:fh(t,z())}function id(e,t){e.isEnabled()&&t!==null&&(jE(e,t.name)||e.addUpdate(()=>(bs(e,[t]),!0)))}function Es(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=gl(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function od(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function ss(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 ad(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 jn(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 xi(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>ja,n=GE(e);if(t){const r=e.slice(0,ja);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 is(e,t){const n=YE(e);return st(n,t)}function YE(e,t=ce.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ce.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=ad("resource.fetch",r);id(n.replay,s)}catch(r){L&&D.exception(r,"Failed to capture fetch breadcrumb")}}function XE(e,t){const{input:n,response:r}=t,s=n?Sl(n):void 0,i=Es(s),o=r?od(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=is(o,n.networkDetailAllowUrls)&&!is(o,n.networkDetailDenyUrls),f=l?ZE(n,t.input,u):jn(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=Sl(n),[o,c]=yl(i,D),a=Tt(s,r,o);return c?ss(a,c):a}async function QE(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return jn(s);const i=r?cd(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?ss(a,c):a}function ev(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?Es(e):n;return r?t?Tt(s,i,e):Tt(s,i,void 0):jn(i)}catch(i){return L&&D.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?(L&&D.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(L&&D.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function cd(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?cd(n,t):Array.isArray(n)?{}:xi(n,t):{}}function rv(e){try{return e.clone()}catch(t){L&&D.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=ad("resource.xhr",r);id(n.replay,s)}catch(r){L&&D.exception(r,"Failed to capture xhr breadcrumb")}}function av(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Es(r),i=n.getResponseHeader("content-length")?od(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||!is(a,n.networkDetailAllowUrls)||is(a,n.networkDetailDenyUrls)){const A=jn(l),y=jn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:A,response:y}}const p=c[Ot],h=p?xi(p.request_headers,n.networkRequestHeaders):{},m=xi(bl(c),n.networkResponseHeaders),[_,g]=n.networkCaptureBodies?yl(o,D):[void 0],[S,N]=n.networkCaptureBodies?uv(c):[void 0],R=Tt(h,l,_),U=Tt(m,f,S);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:g?ss(R,g):R,response:N?ss(U,N):U}}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 L&&D.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 L&&D.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return L&&D.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 Es(n)}catch{return}}function fv(e){const t=z();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){L&&D.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=z();hl(Kb(e)),ms(qE(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(bs(e,[bv(ce.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 We=V.navigator;function vv(){return/iPhone|iPad|iPod/i.test((We==null?void 0:We.userAgent)??"")||/Macintosh/i.test((We==null?void 0:We.userAgent)??"")&&(We!=null&&We.maxTouchPoints)&&(We==null?void 0:We.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function Tv(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){L&&D.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&qb(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&&(L&&D.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&Ss(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){!t||!e.session||e.session.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(ou(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 pu(e.getOptions(),r,i,t,e,Re());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=z(),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"),L&&D.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 U=new Error(po);try{U.cause=R}catch{}throw U}const N=Tu({},S);if(vu(N,"replay"))throw new Co(N);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new ud(S.statusCode);return S}class ud 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 ld(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 ud||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 ld(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const dd="__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:dd}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)),L){const o=t._experiments;D.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{ce.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=Qe({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=Qe({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){L&&D.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){L&&D.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",L&&D.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){L&&D.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){L&&D.log("Buffering is in progress, call `flush()` to save the replay");return}L&&D.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Vs({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){L&&D.log("Buffering is in progress, call `flush()` to save the replay");return}L&&D.infoTick("Starting replay in buffer mode");const t=Vs({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=ot({...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{L&&D.log(`Stopping Replay${n?` triggered by ${n}`:""}`),sd(),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(),L&&D.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),L&&D.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();L&&D.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(){if(this._lastActivity&&Ci(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${ce.location.pathname}${ce.location.hash}${ce.location.search}`,n=`${ce.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===dd){const s=Qe({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&&K(n).data||{})[Le];if(!(!n||!s||!["route","custom"].includes(s)))return K(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=Vs({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 ed(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{ce.document.addEventListener("visibilitychange",this._handleVisibilityChange),ce.addEventListener("blur",this._handleWindowBlur),ce.addEventListener("focus",this._handleWindowFocus),ce.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{ce.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ce.removeEventListener("blur",this._handleWindowBlur),ce.removeEventListener("focus",this._handleWindowFocus),ce.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||Ql(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()){L&&D.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(bs(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){L&&D.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 ld({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=z();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()){L&&D.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){L&&D.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&&L&&D.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&&Ss(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=Qe({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,V.Request=t,_c=!0}catch{}}const w0=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:N=[],networkResponseHeaders:R=[],mask:U=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:y=[],block:I=[],unblock:P=[],ignore:v=[],maskFn:k,beforeAddRecordingEvent:w,beforeErrorSampling:C,onError:M,attachRawBodyFromRequest:J=!1}={}){this.name="Replay";const Y=Dv({mask:U,unmask:y,block:I,unblock:P,ignore:v});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:k,maskInputFn:k,maskAttributeFn:(Z,E,F)=>Ov({maskAttributes:A,maskAllText:u,privacyOptions:Y,key:Z,value:E,el:F}),...Y,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Z=>{try{Z.__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(N),networkResponseHeaders:gc(R),beforeAddRecordingEvent:w,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&&Vr())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){!Vr()||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&&pt(()=>{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 fd(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 pd(e){try{return new Headers(e)}catch{return}}const yc=new WeakMap,Gs=new Map,hd={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}={...hd,...t},d=typeof i=="function"?i:h=>!0,l=h=>qv(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 _=Gs.get(m.span_id);_&&(m.timestamp=_/1e3,Gs.delete(m.span_id))}}),h)),s&&nm(h=>{if(h.response){const m=yc.get(h.response);m&&h.endTimestamp&&Gs.set(m,h.endTimestamp)}}),Fu(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 _=fd(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&&_l(h=>{var _;const m=jv(h,d,l,f,p,u);m&&(o&&Sc(m),a==null||a(m,{headers:pd((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}function Sc(e){const{url:t}=K(e).data;if(!t||typeof t!="string")return;const n=qt("resource",({entries:r})=>{r.forEach(s=>{Wv(s)&&s.name.endsWith(t)&&(e.setAttributes(pl(s)),setTimeout(n))})})}function qv(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?st(r.toString(),t)||i&&st(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?st(e,t):r}}function jv(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=qe()&&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&&(qc(S,c.status_code),S.end(),i==null||i(S,{headers:pd(bl(o)),error:e.error})),delete r[g]);return}const l=fd(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,[fe]:"auto.http.browser",[lt]:"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,qe()&&h?m:void 0,s);const _=z();return _&&_.emit("beforeOutgoingRequestSpan",m,e),m}function Vv(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Au({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}=K(t);je&&b.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:ye,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):je&&b.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Kv=3600,md="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(Mi(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Mi(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[zc]:s.sampleRate}})}function Zv(e,t,n){const r=K(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[Fi])}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&&(je&&b.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[ef]:"previous_trace"}}),t.setAttribute(Xv,`${o.traceId}-${o.spanId}-${Mi(o)?1:0}`)),i)}function Qv(e){try{X.sessionStorage.setItem(md,JSON.stringify(e))}catch(t){je&&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(md);return JSON.parse(t)}catch{return}}function Mi(e){return e.traceFlags===1}const t0="BrowserTracing",n0={...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:{},...hd},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:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:U,instrumentPageLoad:A,instrumentNavigation:y,detectRedirects:I,linkPreviousTrace:P,consistentTraceSampling:v,enableReportPageLoaded:k,onRequestSpanStart:w,onRequestSpanEnd:C}={...n0,...e};let M,J,Y;function Z(E,F,T=!0){const H=F.op==="pageload",ne=F.name,te=d?d(F):F,me=te.attributes||{};if(ne!==te.name&&(me[Le]="custom",te.attributes=me),!T){const be=Gt();It({...te,startTime:be}).end(be);return}t.name=te.name,t.source=me[Le];const we=du(te,{idleTimeout:l,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:H,beforeSpanEnd:be=>{M==null||M(),kg(be,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:R,ignorePerformanceApiSpans:U}),Tc(E,void 0);const Ee=ee(),Ve=Ee.getPropagationContext();Ee.setPropagationContext({...Ve,traceId:we.spanContext().traceId,sampled:Mt(we),dsc:dt(be)}),H&&(Y=void 0)},trimIdleSpanEndTimestamp:!k});H&&k&&(Y=we),Tc(E,we);function ht(){n&&["interactive","complete"].includes(n.readyState)&&E.emit("idleSpanEnableAutoFinish",we)}H&&!k&&n&&(n.addEventListener("readystatechange",()=>{ht()}),ht())}return{name:t0,setup(E){if(Af(),M=Sg({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:u||!1,client:E}),r&&Zg(),s&&$g(),o&&V.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?Eg():i&&bg(),c&&vg(),I&&n){const T=()=>{J=_e()};addEventListener("click",T,{capture:!0}),addEventListener("keydown",T,{capture:!0,passive:!0})}function F(){const T=Vn(E);T&&!K(T).timestamp&&(je&&b.log(`[Tracing] Finishing current active span with op: ${K(T).op}`),T.setAttribute($n,"cancelled"),T.end())}E.on("startNavigationSpan",(T,H)=>{if(z()!==E)return;if(H!=null&&H.isRedirect){je&&b.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Z(E,{op:"navigation.redirect",...T},!1);return}J=void 0,F(),Re().setPropagationContext({traceId:ut(),sampleRand:Math.random(),propagationSpanId:qe()?void 0:it()});const ne=ee();ne.setPropagationContext({traceId:ut(),sampleRand:Math.random(),propagationSpanId:qe()?void 0:it()}),ne.setSDKProcessingMetadata({normalizedRequest:void 0}),Z(E,{op:"navigation",...T,parentSpan:null,forceTransaction:!0})}),E.on("startPageLoadSpan",(T,H={})=>{if(z()!==E)return;F();const ne=H.sentryTrace||Ec("sentry-trace")||vc("sentry-trace"),te=H.baggage||Ec("baggage")||vc("baggage"),me=vf(ne,te),we=ee();we.setPropagationContext(me),qe()||(we.getPropagationContext().propagationSpanId=it()),we.setSDKProcessingMetadata({normalizedRequest:no()}),Z(E,{op:"pageload",...T})}),E.on("endPageloadSpan",()=>{k&&Y&&(Y.setAttribute($n,"reportPageLoaded"),Y.end())})},afterAllSetup(E){let F=Vt();if(P!=="off"&&Jv(E,{linkPreviousTrace:P,consistentTraceSampling:v}),X.location){if(A){const T=Pe();r0(E,{name:X.location.pathname,startTime:T?T/1e3:void 0,attributes:{[Le]:"url",[fe]:"auto.pageload.browser"}})}y&&ms(({to:T,from:H})=>{if(H===void 0&&(F==null?void 0:F.indexOf(T))!==-1){F=void 0;return}F=void 0;const ne=Xi(T),te=Vn(E),me=te&&I&&i0(te,J);_d(E,{name:(ne==null?void 0:ne.pathname)||X.location.pathname,attributes:{[Le]:"url",[fe]:"auto.navigation.browser"}},{url:T,isRedirect:me})})}h&&Yv(),c&&s0(E,l,f,p,t),r&&ty(),zv(E,{traceFetch:m,traceXHR:_,trackFetchStreamPerformance:g,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:S,enableHTTPTimings:N,onRequestSpanStart:w,onRequestSpanEnd:C})}}};function r0(e,t,n){e.emit("startPageLoadSpan",t,n),ee().setTransactionName(t.name);const r=Vn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function _d(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 s0(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=K(u).op;if(["navigation","pageload"].includes(d)){je&&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){je&&b.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=du({name:s.name,op:a,attributes:{[Le]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const gd="_sentry_idleSpan";function Vn(e){return e[gd]}function Tc(e,t){Oe(e,gd,t)}const wc=1.5;function i0(e,t){const n=K(e),r=Gt(),s=n.start_timestamp;return!(r-s>wc||t&&r-t<=wc)}const yd=["activate","mount"],Sd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,o0=/(?:^|[-_])(\w)/g,a0=e=>e.replace(o0,t=>t.toUpperCase()).replace(/[-_]/g,""),c0="<Root>",Ys="<Anonymous>",u0=(e,t)=>e.repeat(t),Pn=(e,t)=>{if(!e)return Ys;if(e.$root===e)return c0;if(!e.$options)return Ys;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?`<${a0(r)}>`:Ys)+(s&&t!==!1?` at ${s}`:"")},l0=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?"---> ":u0(" ",5+i*2))+(Array.isArray(s)?`${Pn(s[0])}... (${s[1]} recursive calls)`:Pn(s))}`).join(`
|
|
`)}`}return`
|
|
|
|
(found in ${Pn(e)})`},d0=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,s,i)=>{var u;const o=Pn(s,!1),c=s?l0(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(()=>{ds(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",f0={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function Ks(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 p0(e,t){function n(s){return s.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(s=>n(t)===n(s))}const h0=(e={})=>{const t=(e.hooks||[]).concat(yd).filter((s,i,o)=>o.indexOf(s)===i),n={},r=e.timeout||2e3;for(const s of t){const i=f0[s];if(!i){Sd&&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:{[fe]:"auto.ui.vue"},onlyIfParent:!0}),Ks(this,_e(),r));const a=Pn(this,!1);if(!(c||(Array.isArray(e.trackComponents)?p0(e.trackComponents,a):e.trackComponents))){Ks(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:{[fe]:"auto.ui.vue"},onlyIfParent:!0})}}else{const p=this.$_sentryComponentSpans[s];if(!p)return;p.end(),Ks(this,_e(),r)}}}return n},m0=V,_0={Vue:m0.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:yd,timeout:2e3,trackComponents:!1}},g0="Vue",y0=(e={})=>({name:g0,setup(t){const n={..._0,...t.getOptions(),...e};if(!n.Vue&&!n.app){pt(()=>{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;Sd&&((n=e._instance)==null?void 0:n.isMounted)===!0&&pt(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&d0(e,t),qe(t)&&e.mixin(h0(t.tracingOptions))};function I0(e={}){const t={defaultIntegrations:[...Tl(),y0()],...e};return Mu(t,"vue"),iS(t)}function S0(e,t,n){let r=!1;const s="mode"in e;e.onError(i=>ds(i,{mechanism:{handled:!1}})),e.beforeEach((i,o,...c)=>{const a=r?void 0:b0(),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&&(K(a).data[Le]!=="custom"&&(a.updateName(d),a.setAttribute(Le,l)),a.setAttributes({...u,[fe]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!a&&n({name:d,op:"navigation",attributes:{...u,[fe]:"auto.navigation.vue",[Le]:l}}),s){const f=c[0];typeof f=="function"&&f()}})}function b0(){const e=Te(),t=e&&ve(e);return t&&K(t).op==="pageload"?t:void 0}function k0(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),S0(n,{routeLabel:i,instrumentNavigation:r,instrumentPageLoad:s},a=>{_d(o,a)})}}}export{E0 as a,k0 as b,T0 as f,z as g,I0 as i,w0 as r,v0 as s};
|