/* eslint-disable */ /* * To get this file, update the SDK version here: * https://beestat.sentry.io/settings/projects/app/loader-script/ Then open * that script, then find the script that it downloads and paste that below. */ /*! @sentry/browser & @sentry/tracing & @sentry/replay 7.116.0 (79cb6b1) | https://github.com/getsentry/sentry-javascript */ var Sentry=function(t){const e=Object.prototype.toString;function n(t){switch(e.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return f(t,Error)}}function r(t,n){return e.call(t)===`[object ${n}]`}function i(t){return r(t,"ErrorEvent")}function s(t){return r(t,"DOMError")}function o(t){return r(t,"String")}function a(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function c(t){return null===t||a(t)||"object"!=typeof t&&"function"!=typeof t}function u(t){return r(t,"Object")}function l(t){return"undefined"!=typeof Event&&f(t,Event)}function h(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function d(t){return"number"==typeof t&&t!=t}function f(t,e){try{return t instanceof e}catch(t){return!1}}function p(t){return!("object"!=typeof t||null===t||!t.__isVue&&!t.t)}function m(t,e=0){return"string"!=typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function y(t,e){if(!Array.isArray(t))return"";const n=[];for(let e=0;eg(t,e,n)))}function b(t,e,n=250,r,i,s,o){if(!(s.exception&&s.exception.values&&o&&f(o.originalException,Error)))return;const a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var c,u;a&&(s.exception.values=(c=k(t,e,i,o.originalException,r,s.exception.values,a,0),u=n,c.map((t=>(t.value&&(t.value=m(t.value,u)),t)))))}function k(t,e,n,r,i,s,o,a){if(s.length>=n+1)return s;let c=[...s];if(f(r[i],Error)){w(o,a);const s=t(e,r[i]),u=c.length;S(s,i,u,a),c=k(t,e,n,r[i],i,[s,...c],s,u)}return Array.isArray(r.errors)&&r.errors.forEach(((r,s)=>{if(f(r,Error)){w(o,a);const u=t(e,r),l=c.length;S(u,`errors[${s}]`,l,a),c=k(t,e,n,r,i,[u,...c],u,l)}})),c}function w(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,..."AggregateError"===t.type&&{is_exception_group:!0},exception_id:e}}function S(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function T(t){return t&&t.Math==Math?t:void 0}const _="object"==typeof globalThis&&T(globalThis)||"object"==typeof window&&T(window)||"object"==typeof self&&T(self)||"object"==typeof global&&T(global)||function(){return this}()||{};function x(){return _}function I(t,e,n){const r=n||_,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const C=x();function E(t,e={}){if(!t)return"";try{let n=t;const r=5,i=[];let s=0,o=0;const a=" > ",c=a.length;let u;const l=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||80;for(;n&&s++1&&o+i.length*c+u.length>=h));)i.push(u),o+=u.length,n=n.parentNode;return i.reverse().join(a)}catch(t){return""}}function R(t,e){const n=t,r=[];let i,s,a,c,u;if(!n||!n.tagName)return"";if(C.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const l=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(l&&l.length)l.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&o(i))for(s=i.split(/\s+/),u=0;u{const r=O[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}const D=function(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return A.forEach((n=>{e[n]=(...e)=>{t&&M((()=>{_.console[n](`Sentry Logger [${n}]:`,...e)}))}})),e}(),L=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function N(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${o}`}function F(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function j(t){const e="string"==typeof t?function(t){const e=L.exec(t);if(!e)return void M((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[n,r,i="",s,o="",a]=e.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const t=u.match(/^\d+/);t&&(u=t[0])}return F({host:s,pass:i,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(t):F(t);if(e&&function(t){const{port:e,projectId:n,protocol:r}=t;return!(["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(D.error(`Invalid Sentry Dsn: ${e} missing`),!0)))||(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(r)?e&&isNaN(parseInt(e,10))&&(D.error(`Invalid Sentry Dsn: Invalid port ${e}`),1):(D.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(D.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(e))return e}class P extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}}function B(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);"function"==typeof i&&z(i,r),t[e]=i}function U(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(n){D.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function z(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,U(t,"__sentry_original__",e)}catch(t){}}function H(t){return t.__sentry_original__}function q(t){if(n(t))return{message:t.message,name:t.name,stack:t.stack,...K(t)};if(l(t)){const e={type:t.type,target:W(t.target),currentTarget:W(t.currentTarget),...K(t)};return"undefined"!=typeof CustomEvent&&f(t,CustomEvent)&&(e.detail=t.detail),e}return t}function W(t){try{return e=t,"undefined"!=typeof Element&&f(e,Element)?E(t):Object.prototype.toString.call(t)}catch(t){return""}var e}function K(t){if("object"==typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function J(t){return G(t,new Map)}function G(t,e){if(function(t){if(!u(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||"Object"===e}catch(t){return!0}}(t)){const n=e.get(t);if(void 0!==n)return n;const r={};e.set(t,r);for(const n of Object.keys(t))void 0!==t[n]&&(r[n]=G(t[n],e));return r}if(Array.isArray(t)){const n=e.get(t);if(void 0!==n)return n;const r=[];return e.set(t,r),t.forEach((t=>{r.push(G(t,e))})),r}return t}const X=/\(error: (.*)\)/,Y=/captureMessage|captureException/;function V(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0)=>{const r=[],i=t.split("\n");for(let t=n;t1024)continue;const s=X.test(n)?n.replace(X,"$1"):n;if(!s.match(/\S*Error: /)){for(const t of e){const e=t(s);if(e){r.push(e);break}}if(r.length>=50)break}}return function(t){if(!t.length)return[];const e=Array.from(t);/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop();e.reverse(),Y.test(e[e.length-1].function||"")&&(e.pop(),Y.test(e[e.length-1].function||"")&&e.pop());return e.slice(0,50).map((t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"})))}(r)}}const Q="";function Z(t){try{return t&&"function"==typeof t&&t.name||Q}catch(t){return Q}}const tt={},et={};function nt(t,e){tt[t]=tt[t]||[],tt[t].push(e)}function rt(t,e){et[t]||(e(),et[t]=!0)}function it(t,e){const n=t&&tt[t];if(n)for(const r of n)try{r(e)}catch(e){D.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${Z(r)}\nError:`,e)}}function st(){"console"in _&&A.forEach((function(t){t in _.console&&B(_.console,t,(function(e){return O[t]=e,function(...e){it("console",{args:e,level:t});const n=O[t];n&&n.apply(_.console,e)}}))}))}function ot(){const t=_,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function at(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function ct(t){const{message:e,event_id:n}=t;if(e)return e;const r=at(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function ut(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function lt(t,e){const n=at(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r&&r.data,...e.data};n.mechanism.data=t}}function ht(t){if(t&&t.__sentry_captured__)return!0;try{U(t,"__sentry_captured__",!0)}catch(t){}return!1}function dt(t){return Array.isArray(t)?t:[t]}const ft=_;let pt,mt,yt;function gt(t){nt("dom",t),rt("dom",vt)}function vt(){if(!ft.document)return;const t=it.bind(null,"dom"),e=bt(t,!0);ft.document.addEventListener("click",e,!1),ft.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=ft[e]&&ft[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(B(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,s=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=s[n]=s[n]||{refCount:0};if(!o.handler){const r=bt(t);o.handler=r,e.call(this,n,r,i)}o.refCount++}catch(t){}return e.call(this,n,r,i)}})),B(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},s=i[e];s&&(s.refCount--,s.refCount<=0&&(t.call(this,e,s.handler,r),s.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}function bt(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(t){try{return t.target}catch(t){return null}}(n);if(function(t,e){return"keypress"===t&&(!e||!e.tagName||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName&&!e.isContentEditable)}(n.type,r))return;U(n,"_sentryCaptured",!0),r&&!r._sentryId&&U(r,"_sentryId",ot());const i="keypress"===n.type?"input":n.type;if(!function(t){if(t.type!==mt)return!1;try{if(!t.target||t.target._sentryId!==yt)return!1}catch(t){}return!0}(n)){t({event:n,name:i,global:e}),mt=n.type,yt=r?r._sentryId:void 0}clearTimeout(pt),pt=ft.setTimeout((()=>{yt=void 0,mt=void 0}),1e3)}}const kt=x();function wt(){if(!("fetch"in kt))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}function St(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Tt(t){const e="fetch";nt(e,t),rt(e,_t)}function _t(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!wt())return!1;if(St(kt.fetch))return!0;let t=!1;const e=kt.document;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=St(n.contentWindow.fetch)),e.head.removeChild(n)}catch(t){D.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return t})()&&B(_,"fetch",(function(t){return function(...e){const{method:n,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[e,n]=t;return{url:It(e),method:xt(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:It(e),method:xt(e,"method")?String(e.method).toUpperCase():"GET"}}(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return it("fetch",{...i}),t.apply(_,e).then((t=>(it("fetch",{...i,endTimestamp:Date.now(),response:t}),t)),(t=>{throw it("fetch",{...i,endTimestamp:Date.now(),error:t}),t}))}}))}function xt(t,e){return!!t&&"object"==typeof t&&!!t[e]}function It(t){return"string"==typeof t?t:t?xt(t,"url")?t.url:t.toString?t.toString():"":""}let Ct=null;function Et(t){const e="error";nt(e,t),rt(e,Rt)}function Rt(){Ct=_.onerror,_.onerror=function(t,e,n,r,i){const s={column:r,error:i,line:n,msg:t,url:e};return it("error",s),!(!Ct||Ct.__SENTRY_LOADER__)&&Ct.apply(this,arguments)},_.onerror.__SENTRY_INSTRUMENTED__=!0}let $t=null;function At(t){const e="unhandledrejection";nt(e,t),rt(e,Ot)}function Ot(){$t=_.onunhandledrejection,_.onunhandledrejection=function(t){const e=t;return it("unhandledrejection",e),!($t&&!$t.__SENTRY_LOADER__)||$t.apply(this,arguments)},_.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Mt=x();const Dt=_;let Lt;function Nt(t){const e="history";nt(e,t),rt(e,Ft)}function Ft(){if(!function(){const t=Mt.chrome,e=t&&t.app&&t.app.runtime,n="history"in Mt&&!!Mt.history.pushState&&!!Mt.history.replaceState;return!e&&n}())return;const t=Dt.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=Lt,e=String(n);Lt=e;it("history",{from:t,to:e})}return t.apply(this,e)}}Dt.onpopstate=function(...e){const n=Dt.location.href,r=Lt;Lt=n;if(it("history",{from:r,to:n}),t)try{return t.apply(this,e)}catch(t){}},B(Dt.history,"pushState",e),B(Dt.history,"replaceState",e)}const jt=_;function Pt(t){nt("xhr",t),rt("xhr",Bt)}function Bt(){if(!jt.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;B(t,"open",(function(t){return function(...e){const n=Date.now(),r=o(e[0])?e[0].toUpperCase():void 0,i=function(t){if(o(t))return t;try{return t.toString()}catch(t){}return}(e[1]);if(!r||!i)return t.apply(this,e);this.__sentry_xhr_v3__={method:r,url:i,request_headers:{}},"POST"===r&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const s=()=>{const t=this.__sentry_xhr_v3__;if(t&&4===this.readyState){try{t.status_code=this.status}catch(t){}it("xhr",{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?B(this,"onreadystatechange",(function(t){return function(...e){return s(),t.apply(this,e)}})):this.addEventListener("readystatechange",s),B(this,"setRequestHeader",(function(t){return function(...e){const[n,r]=e,i=this.__sentry_xhr_v3__;return i&&o(n)&&o(r)&&(i.request_headers[n.toLowerCase()]=r),t.apply(this,e)}})),t.apply(this,e)}})),B(t,"send",(function(t){return function(...e){const n=this.__sentry_xhr_v3__;if(!n)return t.apply(this,e);void 0!==e[0]&&(n.body=e[0]);return it("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),t.apply(this,e)}}))}function Ut(){return"undefined"!=typeof window&&!0}function zt(t,e=100,n=1/0){try{return qt("",t,e,n)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function Ht(t,e=3,n=102400){const r=zt(t,e);return i=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(i))>n?Ht(t,e-1,n):r;var i}function qt(t,e,n=1/0,r=1/0,i=function(){const t="function"==typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t=r){h[t]="[MaxProperties ~]";break}const e=m[t];h[t]=qt(t,e,c-1,r,i),f++}return o(e),h}var Wt;function Kt(t){return new Gt((e=>{e(t)}))}function Jt(t){return new Gt(((e,n)=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(Wt||(Wt={}));class Gt{constructor(t){Gt.prototype.__init.call(this),Gt.prototype.__init2.call(this),Gt.prototype.__init3.call(this),Gt.prototype.__init4.call(this),this.o=Wt.PENDING,this.u=[];try{t(this.l,this.h)}catch(t){this.h(t)}}then(t,e){return new Gt(((n,r)=>{this.u.push([!1,e=>{if(t)try{n(t(e))}catch(t){r(t)}else n(e)},t=>{if(e)try{n(e(t))}catch(t){r(t)}else r(t)}]),this.p()}))}catch(t){return this.then((t=>t),t)}finally(t){return new Gt(((e,n)=>{let r,i;return this.then((e=>{i=!1,r=e,t&&t()}),(e=>{i=!0,r=e,t&&t()})).then((()=>{i?n(r):e(r)}))}))}__init(){this.l=t=>{this.m(Wt.RESOLVED,t)}}__init2(){this.h=t=>{this.m(Wt.REJECTED,t)}}__init3(){this.m=(t,e)=>{this.o===Wt.PENDING&&(h(e)?e.then(this.l,this.h):(this.o=t,this.v=e,this.p()))}}__init4(){this.p=()=>{if(this.o===Wt.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.o===Wt.RESOLVED&&t[1](this.v),this.o===Wt.REJECTED&&t[2](this.v),t[0]=!0)}))}}}function Xt(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(r){if(!(void 0===t||e.lengthn(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(t){return new Gt(((n,r)=>{let i=e.length;if(!i)return n(!0);const s=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{Kt(t).then((()=>{--i||(clearTimeout(s),n(!0))}),r)}))}))}}}function Yt(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const Vt=["fatal","error","warning","log","info","debug"];function Qt(t){return"warn"===t?"warning":Vt.includes(t)?t:"log"}function Zt(){return Date.now()/1e3}const te=function(){const{performance:t}=_;if(!t||!t.now)return Zt;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/1e3}(),ee=(()=>{const{performance:t}=_;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i{const n=ae(e);for(const e of Object.keys(n))t[e]=n[e];return t}),{});else{if(!t)return;e=ae(t)}const n=Object.entries(e).reduce(((t,[e,n])=>{if(e.match(ie)){t[e.slice(re.length)]=n}return t}),{});return Object.keys(n).length>0?n:void 0}function oe(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce(((t,[e,n],r)=>{const i=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`,s=0===r?i:`${t},${i}`;return s.length>8192?(D.warn(`Not adding key: ${e} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):s}),"")}(Object.entries(t).reduce(((t,[e,n])=>(n&&(t[`sentry-${e}`]=n),t)),{}))}function ae(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[e,n])=>(t[e]=n,t)),{})}const ce=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ue(t){if(!t)return;const e=t.match(ce);if(!e)return;let n;return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function le(t=ot(),e=ot().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function he(t,e=[]){return[t,e]}function de(t,e){const[n,r]=t;return[n,[...r,e]]}function fe(t,e){const n=t[1];for(const t of n){if(e(t,t[0].type))return!0}return!1}function pe(t,e){return(e||new TextEncoder).encode(t)}function me(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(t){"string"==typeof i?i="string"==typeof t?i+t:[pe(i,e),t]:i.push("string"==typeof t?pe(t,e):t)}for(const t of r){const[e,n]=t;if(s(`\n${JSON.stringify(e)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let t;try{t=JSON.stringify(n)}catch(e){t=JSON.stringify(zt(n))}s(t)}}return"string"==typeof i?i:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(i)}function ye(t,e){const n="string"==typeof t.data?pe(t.data,e):t.data;return[J({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const ge={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function ve(t){return ge[t]}function be(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function ke(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:N(r)},...i&&{trace:J({...i})}}}function we(t,e,n=Date.now()){return function(t,e){return t[e]||t.all||0}(t,e)>n}function Se(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const t of s.trim().split(",")){const[e,n,,,s]=t.split(":",5),o=parseInt(e,10),a=1e3*(isNaN(o)?60:o);if(n)for(const t of n.split(";"))"metric_bucket"===t&&s&&!s.split(";").includes("custom")||(i[t]=r+a);else i.all=r+a}else o?i.all=r+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}(o,r):429===e&&(i.all=r+6e4);return i}function Te(t,e){const n={type:e.name||e.constructor.name,value:e.message},r=function(t,e){return t(e.stack||"",1)}(t,e);return r.length&&(n.stacktrace={frames:r}),n}function _e(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}class xe{static __initStatic(){this.id="Feedback"}constructor(t){this.name=xe.id,M((()=>{console.warn("You are using new Feedback() even though this bundle does not include Feedback.")}))}setupOnce(){}openDialog(){}closeDialog(){}attachTo(){}createWidget(){}removeWidget(){}getWidget(){}remove(){}}xe.__initStatic();const Ie="production";function Ce(){return I("globalEventProcessors",(()=>[]))}function Ee(t){Ce().push(t)}function Re(t,e,n,r=0){return new Gt(((i,s)=>{const o=t[r];if(null===e||"function"!=typeof o)i(e);else{const a=o({...e},n);o.id&&null===a&&D.log(`Event processor "${o.id}" dropped event`),h(a)?a.then((e=>Re(t,e,n,r+1).then(i))).then(null,s):Re(t,a,n,r+1).then(i).then(null,s)}}))}function $e(t){const e=te(),n={sid:ot(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return J({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(n)};return t&&Ae(n,t),n}function Ae(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||te(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:ot()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Oe(t,e){let n={};e?n={status:e}:"ok"===t.status&&(n={status:"exited"}),Ae(t,n)}function Me(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:a,origin:c}=Fe(t);return J({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:a,trace_id:n,origin:c})}function De(t){const{traceId:e,spanId:n}=t.spanContext();return le(e,n,je(t))}function Le(t){return"number"==typeof t?Ne(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Ne(t.getTime()):te()}function Ne(t){return t>9999999999?t/1e3:t}function Fe(t){return function(t){return"function"==typeof t.getSpanJSON}(t)?t.getSpanJSON():"function"==typeof t.toJSON?t.toJSON():{}}function je(t){const{traceFlags:e}=t.spanContext();return Boolean(1&e)}function Pe(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||ot(),timestamp:e.timestamp||Zt()},u=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:Ie);void 0===t.release&&void 0!==r&&(t.release=r);void 0===t.dist&&void 0!==i&&(t.dist=i);t.message&&(t.message=m(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=m(o.value,s));const a=t.request;a&&a.url&&(a.url=m(a.url,s))}(c,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(c,u),void 0===e.type&&function(t,e){const n=_._sentryDebugIds;if(!n)return;let r;const i=Be.get(e);i?r=i:(r=new Map,Be.set(e,r));const s=Object.keys(n).reduce(((t,i)=>{let s;const o=r.get(i);o?s=o:(s=e(i),r.set(i,s));for(let e=s.length-1;e>=0;e--){const r=s[e];if(r.filename){t[r.filename]=n[i];break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=s[t.filename])}))}))}catch(t){}}(c,t.stackParser);const l=function(t,e){if(!e)return t;const n=t?t.clone():new an;return n.update(e),n}(r,n.captureContext);n.mechanism&<(c,n.mechanism);const h=i&&i.getEventProcessors?i.getEventProcessors():[],d=function(){on||(on=new an);return on}().getScopeData();if(s){rn(d,s.getScopeData())}if(l){rn(d,l.getScopeData())}const f=[...n.attachments||[],...d.attachments];f.length&&(n.attachments=f),nn(c,d);return Re([...h,...Ce(),...d.eventProcessors],c,n).then((t=>(t&&function(t){const e={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(t){}if(0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach((t=>{n.push({type:"sourcemap",code_file:t,debug_id:e[t]})}))}(t),"number"==typeof o&&o>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:zt(t.data,e,n)}})))},...t.user&&{user:zt(t.user,e,n)},...t.contexts&&{contexts:zt(t.contexts,e,n)},...t.extra&&{extra:zt(t.extra,e,n)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=zt(t.contexts.trace.data,e,n)));t.spans&&(r.spans=t.spans.map((t=>{const r=Fe(t).data;return r&&(t.data=zt(r,e,n)),t})));return r}(t,o,a):t)))}const Be=new WeakMap;function Ue(t){if(t)return function(t){return t instanceof an||"function"==typeof t}(t)||function(t){return Object.keys(t).some((t=>ze.includes(t)))}(t)?{captureContext:t}:t}const ze=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function captureException(t,e){return mn().captureException(t,Ue(e))}function He(t,e){return mn().captureEvent(t,e)}function qe(t,e){mn().addBreadcrumb(t,e)}function We(t,e){mn().setContext(t,e)}function Ke(...t){const e=mn();if(2===t.length){const[n,r]=t;return n?e.withScope((()=>(e.getStackTop().scope=n,r(n)))):e.withScope(r)}return e.withScope(t[0])}function Je(){return mn().getClient()}function Ge(){return mn().getScope()}function Xe(t){const e=Je(),n=yn(),r=Ge(),{release:i,environment:s=Ie}=e&&e.getOptions()||{},{userAgent:o}=_.navigator||{},a=$e({release:i,environment:s,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...t}),c=n.getSession();return c&&"ok"===c.status&&Ae(c,{status:"exited"}),Ye(),n.setSession(a),r.setSession(a),a}function Ye(){const t=yn(),e=Ge(),n=e.getSession()||t.getSession();n&&Oe(n),Ve(),t.setSession(),e.setSession()}function Ve(){const t=yn(),e=Ge(),n=Je(),r=e.getSession()||t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function Qe(t=!1){t?Ye():Ve()}function Ze(t){return t.transaction}function tn(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=J({environment:r.environment||Ie,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function en(t){const e=Je();if(!e)return{};const n=tn(Fe(t).trace_id||"",e,Ge()),r=Ze(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;null!=s&&(n.sample_rate=`${s}`);const a=Fe(r);return o&&"url"!==o&&(n.transaction=a.description),n.sampled=String(je(r)),e.emit&&e.emit("createDsc",n),n}function nn(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;!function(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=e,c=J(n);c&&Object.keys(c).length&&(t.extra={...c,...t.extra});const u=J(r);u&&Object.keys(u).length&&(t.tags={...u,...t.tags});const l=J(i);l&&Object.keys(l).length&&(t.user={...l,...t.user});const h=J(s);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});o&&(t.level=o);a&&(t.transaction=a)}(t,e),r&&function(t,e){t.contexts={trace:Me(e),...t.contexts};const n=Ze(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:en(e),...t.sdkProcessingMetadata};const r=Fe(n).description;r&&(t.tags={transaction:r,...t.tags})}}(t,r),function(t,e){t.fingerprint=t.fingerprint?dt(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,n),function(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}(t,i),function(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}(t,s)}function rn(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:l,attachments:h,propagationContext:d,transactionName:f,span:p}=e;sn(t,"extra",n),sn(t,"tags",r),sn(t,"user",i),sn(t,"contexts",s),sn(t,"sdkProcessingMetadata",a),o&&(t.level=o),f&&(t.transactionName=f),p&&(t.span=p),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),h.length&&(t.attachments=[...t.attachments,...h]),t.propagationContext={...t.propagationContext,...d}}function sn(t,e,n){if(n&&Object.keys(n).length){t[e]={...t[e]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}let on;class an{constructor(){this.k=!1,this.S=[],this.T=[],this._=[],this.I=[],this.C={},this.R={},this.A={},this.O={},this.M={},this.D=cn()}static clone(t){return t?t.clone():new an}clone(){const t=new an;return t._=[...this._],t.R={...this.R},t.A={...this.A},t.O={...this.O},t.C=this.C,t.L=this.L,t.N=this.N,t.F=this.F,t.j=this.j,t.P=this.P,t.T=[...this.T],t.B=this.B,t.I=[...this.I],t.M={...this.M},t.D={...this.D},t.U=this.U,t}setClient(t){this.U=t}getClient(){return this.U}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.T.push(t),this}setUser(t){return this.C=t||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this.F&&Ae(this.F,{user:t}),this.H(),this}getUser(){return this.C}getRequestSession(){return this.B}setRequestSession(t){return this.B=t,this}setTags(t){return this.R={...this.R,...t},this.H(),this}setTag(t,e){return this.R={...this.R,[t]:e},this.H(),this}setExtras(t){return this.A={...this.A,...t},this.H(),this}setExtra(t,e){return this.A={...this.A,[t]:e},this.H(),this}setFingerprint(t){return this.P=t,this.H(),this}setLevel(t){return this.L=t,this.H(),this}setTransactionName(t){return this.j=t,this.H(),this}setContext(t,e){return null===e?delete this.O[t]:this.O[t]=e,this.H(),this}setSpan(t){return this.N=t,this.H(),this}getSpan(){return this.N}getTransaction(){const t=this.N;return t&&t.transaction}setSession(t){return t?this.F=t:delete this.F,this.H(),this}getSession(){return this.F}update(t){if(!t)return this;const e="function"==typeof t?t(this):t;if(e instanceof an){const t=e.getScopeData();this.R={...this.R,...t.tags},this.A={...this.A,...t.extra},this.O={...this.O,...t.contexts},t.user&&Object.keys(t.user).length&&(this.C=t.user),t.level&&(this.L=t.level),t.fingerprint.length&&(this.P=t.fingerprint),e.getRequestSession()&&(this.B=e.getRequestSession()),t.propagationContext&&(this.D=t.propagationContext)}else if(u(e)){const e=t;this.R={...this.R,...e.tags},this.A={...this.A,...e.extra},this.O={...this.O,...e.contexts},e.user&&(this.C=e.user),e.level&&(this.L=e.level),e.fingerprint&&(this.P=e.fingerprint),e.requestSession&&(this.B=e.requestSession),e.propagationContext&&(this.D=e.propagationContext)}return this}clear(){return this._=[],this.R={},this.A={},this.C={},this.O={},this.L=void 0,this.j=void 0,this.P=void 0,this.B=void 0,this.N=void 0,this.F=void 0,this.H(),this.I=[],this.D=cn(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:100;if(n<=0)return this;const r={timestamp:Zt(),...t},i=this._;return i.push(r),this._=i.length>n?i.slice(-n):i,this.H(),this}getLastBreadcrumb(){return this._[this._.length-1]}clearBreadcrumbs(){return this._=[],this.H(),this}addAttachment(t){return this.I.push(t),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this.I=[],this}getScopeData(){const{_:t,I:e,O:n,R:r,A:i,C:s,L:o,P:a,T:c,D:u,M:l,j:h,N:d}=this;return{breadcrumbs:t,attachments:e,contexts:n,tags:r,extra:i,user:s,level:o,fingerprint:a||[],eventProcessors:c,propagationContext:u,sdkProcessingMetadata:l,transactionName:h,span:d}}applyToEvent(t,e={},n=[]){nn(t,this.getScopeData());return Re([...n,...Ce(),...this.T],t,e)}setSDKProcessingMetadata(t){return this.M={...this.M,...t},this}setPropagationContext(t){return this.D=t,this}getPropagationContext(){return this.D}captureException(t,e){const n=e&&e.event_id?e.event_id:ot();if(!this.U)return D.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this.U.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:ot();if(!this.U)return D.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this.U.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:ot();return this.U?(this.U.captureEvent(t,{...e,event_id:n},this),n):(D.warn("No client configured on scope - will not capture event!"),n)}H(){this.k||(this.k=!0,this.S.forEach((t=>{t(this)})),this.k=!1)}}function cn(){return{traceId:ot(),spanId:ot().substring(16)}}const un="7.116.0",ln=parseFloat(un),hn=100;class dn{constructor(t,e,n,r=ln){let i,s;this.q=r,e?i=e:(i=new an,i.setClient(t)),n?s=n:(s=new an,s.setClient(t)),this.W=[{scope:i}],t&&this.bindClient(t),this.K=s}isOlderThan(t){return this.q(this.popScope(),t)),(t=>{throw this.popScope(),t})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.K}getStack(){return this.W}getStackTop(){return this.W[this.W.length-1]}captureException(t,e){const n=this.J=e&&e.event_id?e.event_id:ot(),r=new Error("Sentry syntheticException");return this.getScope().captureException(t,{originalException:t,syntheticException:r,...e,event_id:n}),n}captureMessage(t,e,n){const r=this.J=n&&n.event_id?n.event_id:ot(),i=new Error(t);return this.getScope().captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r}),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:ot();return t.type||(this.J=n),this.getScope().captureEvent(t,{...e,event_id:n}),n}lastEventId(){return this.J}addBreadcrumb(t,e){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=hn}=r.getOptions&&r.getOptions()||{};if(s<=0)return;const o={timestamp:Zt(),...t},a=i?M((()=>i(o,e))):o;null!==a&&(r.emit&&r.emit("beforeAddBreadcrumb",a,e),n.addBreadcrumb(a,s))}setUser(t){this.getScope().setUser(t),this.getIsolationScope().setUser(t)}setTags(t){this.getScope().setTags(t),this.getIsolationScope().setTags(t)}setExtras(t){this.getScope().setExtras(t),this.getIsolationScope().setExtras(t)}setTag(t,e){this.getScope().setTag(t,e),this.getIsolationScope().setTag(t,e)}setExtra(t,e){this.getScope().setExtra(t,e),this.getIsolationScope().setExtra(t,e)}setContext(t,e){this.getScope().setContext(t,e),this.getIsolationScope().setContext(t,e)}configureScope(t){const{scope:e,client:n}=this.getStackTop();n&&t(e)}run(t){const e=pn(this);try{t(this)}finally{pn(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return D.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,e){const n=this.G("startTransaction",t,e);if(!n){this.getClient()?D.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):D.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this.G("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this.X()}endSession(){const t=this.getStackTop().scope,e=t.getSession();e&&Oe(e),this.X(),t.setSession()}startSession(t){const{scope:e,client:n}=this.getStackTop(),{release:r,environment:i=Ie}=n&&n.getOptions()||{},{userAgent:s}=_.navigator||{},o=$e({release:r,environment:i,user:e.getUser(),...s&&{userAgent:s},...t}),a=e.getSession&&e.getSession();return a&&"ok"===a.status&&Ae(a,{status:"exited"}),this.endSession(),e.setSession(o),o}shouldSendDefaultPii(){const t=this.getClient(),e=t&&t.getOptions();return Boolean(e&&e.sendDefaultPii)}X(){const{scope:t,client:e}=this.getStackTop(),n=t.getSession();n&&e&&e.captureSession&&e.captureSession(n)}G(t,...e){const n=fn().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[t])return n.extensions[t].apply(this,e);D.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function fn(){return _.__SENTRY__=_.__SENTRY__||{extensions:{},hub:void 0},_}function pn(t){const e=fn(),n=vn(e);return bn(e,t),n}function mn(){const t=fn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return function(t=fn()){e=t,e&&e.__SENTRY__&&e.__SENTRY__.hub&&!vn(t).isOlderThan(ln)||bn(t,new dn);var e;return vn(t)}(t)}function yn(){return mn().getIsolationScope()}function gn(t,e={}){const n=fn();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function vn(t){return I("hub",(()=>new dn),t)}function bn(t,e){if(!t)return!1;return(t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0}function kn(t){return(t||mn()).getScope().getTransaction()}let wn=!1;function Sn(){const t=kn();if(t){const e="internal_error";D.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}var Tn;function _n(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=function(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(e);"unknown_error"!==n&&t.setStatus(n)}function xn(t,e,n=(()=>{})){let r;try{r=t()}catch(t){throw e(t),n(),t}return function(t,e,n){if(h(t))return t.then((t=>(n(),t)),(t=>{throw e(t),n(),t}));return n(),t}(r,e,n)}function In(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=Je(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function Cn(t){if(!In())return;const e=$n(t),n=mn(),r=t.scope?t.scope.getSpan():En();if(t.onlyIfParent&&!r)return;const i=(t.scope||Ge()).clone();return Rn(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:i})}function En(){return Ge().getSpan()}Sn.tag="sentry_tracingErrorCallback",function(t){t.Ok="ok";t.DeadlineExceeded="deadline_exceeded";t.Unauthenticated="unauthenticated";t.PermissionDenied="permission_denied";t.NotFound="not_found";t.ResourceExhausted="resource_exhausted";t.InvalidArgument="invalid_argument";t.Unimplemented="unimplemented";t.Unavailable="unavailable";t.InternalError="internal_error";t.UnknownError="unknown_error";t.Cancelled="cancelled";t.AlreadyExists="already_exists";t.FailedPrecondition="failed_precondition";t.Aborted="aborted";t.OutOfRange="out_of_range";t.DataLoss="data_loss"}(Tn||(Tn={}));function Rn(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!In())return;const s=yn();let o;if(e&&!r)o=e.startChild(n);else if(e){const r=en(e),{traceId:i,spanId:s}=e.spanContext(),a=je(e);o=t.startTransaction({traceId:i,parentSpanId:s,parentSampled:a,...n,metadata:{dynamicSamplingContext:r,...n.metadata}})}else{const{traceId:e,dsc:r,parentSpanId:a,sampled:c}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:e,parentSpanId:a,parentSampled:c,...n,metadata:{dynamicSamplingContext:r,...n.metadata}})}return i.setSpan(o),function(t,e,n){t&&(U(t,On,n),U(t,An,e))}(o,i,s),o}function $n(t){if(t.startTime){const e={...t};return e.startTimestamp=Le(t.startTime),delete e.startTime,e}return t}const An="_sentryScope",On="_sentryIsolationScope";let Mn;function Dn(t){return Mn?Mn.get(t):void 0}function Ln(t){const e=Dn(t);if(!e)return;const n={};for(const[,[t,r]]of e)n[t]||(n[t]=[]),n[t].push(J(r));return n}const Nn="sentry.source",Fn="sentry.sample_rate",jn="sentry.op",Pn="sentry.origin";class Bn{constructor(t=1e3){this.Y=t,this.spans=[]}add(t){this.spans.length>this.Y?t.spanRecorder=void 0:this.spans.push(t)}}class Un{constructor(t={}){this.V=t.traceId||ot(),this.Z=t.spanId||ot().substring(16),this.tt=t.startTimestamp||te(),this.tags=t.tags?{...t.tags}:{},this.data=t.data?{...t.data}:{},this.instrumenter=t.instrumenter||"sentry",this.et={},this.setAttributes({[Pn]:t.origin||"manual",[jn]:t.op,...t.attributes}),this.nt=t.name||t.description,t.parentSpanId&&(this.rt=t.parentSpanId),"sampled"in t&&(this.it=t.sampled),t.status&&(this.st=t.status),t.endTimestamp&&(this.ot=t.endTimestamp),void 0!==t.exclusiveTime&&(this.ct=t.exclusiveTime),this.ut=t.measurements?{...t.measurements}:{}}get name(){return this.nt||""}set name(t){this.updateName(t)}get description(){return this.nt}set description(t){this.nt=t}get traceId(){return this.V}set traceId(t){this.V=t}get spanId(){return this.Z}set spanId(t){this.Z=t}set parentSpanId(t){this.rt=t}get parentSpanId(){return this.rt}get sampled(){return this.it}set sampled(t){this.it=t}get attributes(){return this.et}set attributes(t){this.et=t}get startTimestamp(){return this.tt}set startTimestamp(t){this.tt=t}get endTimestamp(){return this.ot}set endTimestamp(t){this.ot=t}get status(){return this.st}set status(t){this.st=t}get op(){return this.et["sentry.op"]}set op(t){this.setAttribute(jn,t)}get origin(){return this.et["sentry.origin"]}set origin(t){this.setAttribute(Pn,t)}spanContext(){const{Z:t,V:e,it:n}=this;return{spanId:t,traceId:e,traceFlags:n?1:0}}startChild(t){const e=new Un({...t,parentSpanId:this.Z,sampled:this.it,traceId:this.V});e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e);const n=Ze(this);if(e.transaction=n,n){const r=`[Tracing] Starting '${t&&t.op||"< unknown op >"}' span on transaction '${Fe(e).description||"< unknown name >"}' (${n.spanContext().spanId}).`;D.log(r),this.lt=r}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setAttribute(t,e){void 0===e?delete this.et[t]:this.et[t]=e}setAttributes(t){Object.keys(t).forEach((e=>this.setAttribute(e,t[e])))}setStatus(t){return this.st=t,this}setHttpStatus(t){return _n(this,t),this}setName(t){this.updateName(t)}updateName(t){return this.nt=t,this}isSuccess(){return"ok"===this.st}finish(t){return this.end(t)}end(t){if(this.ot)return;const e=Ze(this);if(e&&e.spanContext().spanId!==this.Z){const t=this.lt;t&&D.log(t.replace("Starting","Finishing"))}this.ot=Le(t)}toTraceparent(){return De(this)}toContext(){return J({data:this.ht(),description:this.nt,endTimestamp:this.ot,op:this.op,parentSpanId:this.rt,sampled:this.it,spanId:this.Z,startTimestamp:this.tt,status:this.st,tags:this.tags,traceId:this.V})}updateWithContext(t){return this.data=t.data||{},this.nt=t.name||t.description,this.ot=t.endTimestamp,this.op=t.op,this.rt=t.parentSpanId,this.it=t.sampled,this.Z=t.spanId||this.Z,this.tt=t.startTimestamp||this.tt,this.st=t.status,this.tags=t.tags||{},this.V=t.traceId||this.V,this}getTraceContext(){return Me(this)}getSpanJSON(){return J({data:this.ht(),description:this.nt,op:this.et["sentry.op"],parent_span_id:this.rt,span_id:this.Z,start_timestamp:this.tt,status:this.st,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.ot,trace_id:this.V,origin:this.et["sentry.origin"],dt:Ln(this),profile_id:this.et.profile_id,exclusive_time:this.ct,measurements:Object.keys(this.ut).length>0?this.ut:void 0})}isRecording(){return!this.ot&&!!this.it}toJSON(){return this.getSpanJSON()}ht(){const{data:t,et:e}=this,n=Object.keys(t).length>0,r=Object.keys(e).length>0;if(n||r)return n&&r?{...t,...e}:n?t:e}}class zn extends Un{constructor(t,e){super(t),this.O={},this.ft=e||mn(),this.nt=t.name||"",this.yt={...t.metadata},this.gt=t.trimEnd,this.transaction=this;const n=this.yt.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this.nt}set name(t){this.setName(t)}get metadata(){return{source:"custom",spanMetadata:{},...this.yt,...this.et["sentry.source"]&&{source:this.et["sentry.source"]},...this.et["sentry.sample_rate"]&&{sampleRate:this.et["sentry.sample_rate"]}}}set metadata(t){this.yt=t}setName(t,e="custom"){this.nt=t,this.setAttribute(Nn,e)}updateName(t){return this.nt=t,this}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new Bn(t)),this.spanRecorder.add(this)}setContext(t,e){null===e?delete this.O[t]:this.O[t]=e}setMeasurement(t,e,n=""){this.ut[t]={value:e,unit:n}}setMetadata(t){this.yt={...this.yt,...t}}end(t){const e=Le(t),n=this.vt(e);if(n)return this.ft.captureEvent(n)}toContext(){return J({...super.toContext(),name:this.nt,trimEnd:this.gt})}updateWithContext(t){return super.updateWithContext(t),this.nt=t.name||"",this.gt=t.trimEnd,this}getDynamicSamplingContext(){return en(this)}setHub(t){this.ft=t}getProfileId(){if(void 0!==this.O&&void 0!==this.O.profile)return this.O.profile.profile_id}vt(t){if(void 0!==this.ot)return;this.nt||(D.warn("Transaction has no name, falling back to ``."),this.nt=""),super.end(t);const e=this.ft.getClient();if(e&&e.emit&&e.emit("finishTransaction",this),!0!==this.it)return D.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(e&&e.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((t=>t!==this&&Fe(t).timestamp)):[];if(this.gt&&n.length>0){const t=n.map((t=>Fe(t).timestamp)).filter(Boolean);this.ot=t.reduce(((t,e)=>t>e?t:e))}const{scope:r,isolationScope:i}={scope:(s=this).bt,isolationScope:s.kt};var s;const{metadata:o}=this,{source:a}=o,c={contexts:{...this.O,trace:Me(this)},spans:n,start_timestamp:this.tt,tags:this.tags,timestamp:this.ot,transaction:this.nt,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:r,capturedSpanIsolationScope:i,...J({dynamicSamplingContext:en(this)})},dt:Ln(this),...a&&{transaction_info:{source:a}}};return Object.keys(this.ut).length>0&&(D.log("[Measurements] Adding measurements to transaction",JSON.stringify(this.ut,void 0,2)),c.measurements=this.ut),D.log(`[Tracing] Finishing ${this.op} transaction: ${this.nt}.`),c}}const Hn={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},qn=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Wn extends Bn{constructor(t,e,n,r){super(r),this.wt=t,this.St=e,this.transactionSpanId=n}add(t){if(t.spanContext().spanId!==this.transactionSpanId){const e=t.end;t.end=(...n)=>(this.St(t.spanContext().spanId),e.apply(t,n)),void 0===Fe(t).timestamp&&this.wt(t.spanContext().spanId)}super.add(t)}}class Kn extends zn{constructor(t,e,n=Hn.idleTimeout,r=Hn.finalTimeout,i=Hn.heartbeatInterval,s=!1,o=!1){super(t,e),this.Tt=e,this._t=n,this.xt=r,this.It=i,this.Ct=s,this.activities={},this.Et=0,this.Rt=!1,this.$t=!1,this.At=[],this.Ot=qn[4],this.Mt=!o,s&&(D.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),e.getScope().setSpan(this)),o||this.Dt(),setTimeout((()=>{this.Rt||(this.setStatus("deadline_exceeded"),this.Ot=qn[3],this.end())}),this.xt)}end(t){const e=Le(t);if(this.Rt=!0,this.activities={},"ui.action.click"===this.op&&this.setAttribute("finishReason",this.Ot),this.spanRecorder){D.log("[Tracing] finishing IdleTransaction",new Date(1e3*e).toISOString(),this.op);for(const t of this.At)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter((t=>{if(t.spanContext().spanId===this.spanContext().spanId)return!0;Fe(t).timestamp||(t.setStatus("cancelled"),t.end(e),D.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));const{start_timestamp:n,timestamp:r}=Fe(t),i=n&&n{this.Rt||this.wt(t)},n=t=>{this.Rt||this.St(t)};this.spanRecorder=new Wn(e,n,this.spanContext().spanId,t),D.log("Starting heartbeat"),this.Lt()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:e}={restartOnChildSpanChange:!0}){this.$t=!1===e,this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0,0===Object.keys(this.activities).length&&this.$t&&(this.Ot=qn[5],this.end(t)))}setFinishReason(t){this.Ot=t}sendAutoFinishSignal(){this.Mt||(D.log("[Tracing] Received finish signal for idle transaction."),this.Dt(),this.Mt=!0)}Dt(t){this.cancelIdleTimeout(),this.Nt=setTimeout((()=>{this.Rt||0!==Object.keys(this.activities).length||(this.Ot=qn[1],this.end(t))}),this._t)}wt(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this.$t}),D.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,D.log("[Tracing] new activities count",Object.keys(this.activities).length)}St(t){if(this.activities[t]&&(D.log(`[Tracing] popActivity ${t}`),delete this.activities[t],D.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const t=te();this.$t?this.Mt&&(this.Ot=qn[5],this.end(t)):this.Dt(t+this._t/1e3)}}Ft(){if(this.Rt)return;const t=Object.keys(this.activities).join("");t===this.jt?this.Et++:this.Et=1,this.jt=t,this.Et>=3?this.Mt&&(D.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this.Ot=qn[0],this.end()):this.Lt()}Lt(){D.log(`pinging Heartbeat -> current counter: ${this.Et}`),setTimeout((()=>{this.Ft()}),this.It)}}function Jn(t,e,n){if(!In(e))return t.sampled=!1,t;if(void 0!==t.sampled)return t.setAttribute(Fn,Number(t.sampled)),t;let r;return"function"==typeof e.tracesSampler?(r=e.tracesSampler(n),t.setAttribute(Fn,Number(r))):void 0!==n.parentSampled?r=n.parentSampled:void 0!==e.tracesSampleRate?(r=e.tracesSampleRate,t.setAttribute(Fn,Number(r))):(r=1,t.setAttribute(Fn,r)),Gn(r)?r?(t.sampled=Math.random()1)||(D.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1)}function Xn(){const t=this.getScope().getSpan();return t?{"sentry-trace":De(t)}:{}}function Yn(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(D.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.\nThe transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new zn(t,this);return o=Jn(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function Vn(t,e,n,r,i,s,o,a=!1){const c=t.getClient(),u=c&&c.getOptions()||{};let l=new Kn(e,t,n,r,o,i,a);return l=Jn(l,u,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),l.isRecording()&&l.initSpanRecorder(u._experiments&&u._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",l),l}function Qn(){const t=fn();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=Yn),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=Xn),wn||(wn=!0,Et(Sn),At(Sn)))}function Zn(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function tr(t,e){return n={sentry_key:t.publicKey,sentry_version:"7",...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(n[t])}`)).join("&");var n}function er(t,e={}){const n="string"==typeof e?e:e.tunnel,r="string"!=typeof e&&e.yt?e.yt.sdk:void 0;return n||`${function(t){return`${Zn(t)}${t.projectId}/envelope/`}(t)}?${tr(t,r)}`}const nr=[];function rr(t){const e=t.defaultIntegrations||[],n=t.integrations;let r;e.forEach((t=>{t.isDefaultInstance=!0})),r=Array.isArray(n)?[...e,...n]:"function"==typeof n?dt(n(e)):e;const i=function(t){const e={};return t.forEach((t=>{const{name:n}=t,r=e[n];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[n]=t)})),Object.keys(e).map((t=>e[t]))}(r),s=function(t,e){for(let n=0;n"Debug"===t.name));if(-1!==s){const[t]=i.splice(s,1);i.push(t)}return i}function ir(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function sr(t,e,n){if(n[e.name])D.log(`Integration skipped because it was already installed: ${e.name}`);else{if(n[e.name]=e,-1===nr.indexOf(e.name)&&(e.setupOnce(Ee,mn),nr.push(e.name)),e.setup&&"function"==typeof e.setup&&e.setup(t),t.on&&"function"==typeof e.preprocessEvent){const n=e.preprocessEvent.bind(e);t.on("preprocessEvent",((e,r)=>n(e,r,t)))}if(t.addEventProcessor&&"function"==typeof e.processEvent){const n=e.processEvent.bind(e),r=Object.assign(((e,r)=>n(e,r,t)),{id:e.name});t.addEventProcessor(r)}D.log(`Integration installed: ${e.name}`)}}function or(t,e){return Object.assign((function(...t){return e(...t)}),{id:t})}function ar(t){return t.replace(/[^\w\-./]+/gi,"")}const cr=[["\n","\\n"],["\r","\\r"],["\t","\\t"],["\\","\\\\"],["|","\\u{7c}"],[",","\\u{2c}"]];function ur(t){return[...t].reduce(((t,e)=>t+function(t){for(const[e,n]of cr)if(t===e)return n;return t}(e)),"")}function lr(t,e,n,r){const i={sent_at:(new Date).toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&e&&(i.dsn=N(e));const s=function(t){const e=function(t){let e="";for(const n of t){const t=Object.entries(n.tags),r=t.length>0?`|#${t.map((([t,e])=>`${t}:${e}`)).join(",")}`:"";e+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return e}(t);return[{type:"statsd",length:e.length},e]}(t);return he(i,[s])}const hr="Not capturing exception because it's already been captured.";function dr(t){return void 0===t.type}function fr(t){return"transaction"===t.type}function pr(t){const e=Je();e&&e.addEventProcessor&&e.addEventProcessor(t)}const mr={c:class{constructor(t){this.v=t}get weight(){return 1}add(t){this.v+=t}toString(){return`${this.v}`}},g:class{constructor(t){this.Pt=t,this.Bt=t,this.Ut=t,this.zt=t,this.Ht=1}get weight(){return 5}add(t){this.Pt=t,tthis.Ut&&(this.Ut=t),this.zt+=t,this.Ht++}toString(){return`${this.Pt}:${this.Bt}:${this.Ut}:${this.zt}:${this.Ht}`}},d:class{constructor(t){this.v=[t]}get weight(){return this.v.length}add(t){this.v.push(t)}toString(){return this.v.join(":")}},s:class{constructor(t){this.first=t,this.v=new Set([t])}get weight(){return this.v.size}add(t){this.v.add(t)}toString(){return Array.from(this.v).map((t=>"string"==typeof t?function(t){let e=0;for(let n=0;n>>0}(t):t)).join(":")}}};function yr(t){const e=mn().getStackTop();e.client=t,e.scope.setClient(t)}function gr(t,e,n=Xt(t.bufferSize||30)){let r={};function i(i){const s=[];if(fe(i,((e,n)=>{const i=ve(n);if(we(r,i)){const r=vr(e,n);t.recordDroppedEvent("ratelimit_backoff",i,r)}else s.push(e)})),0===s.length)return Kt();const o=he(i[0],s),a=e=>{fe(o,((n,r)=>{const i=vr(n,r);t.recordDroppedEvent(e,ve(r),i)}))};return n.add((()=>e({body:me(o,t.textEncoder)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&D.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=Se(r,t),t)),(t=>{throw a("network_error"),t})))).then((t=>t),(t=>{if(t instanceof P)return D.error("Skipped sending event because buffer is full."),a("queue_overflow"),Kt();throw t}))}return i.__sentry__baseTransport__=!0,{send:i,flush:t=>n.drain(t)}}function vr(t,e){if("event"===e||"transaction"===e)return Array.isArray(t)?t[1]:void 0}function br(t){return[{type:"span"},t]}function kr(t,e){const n=e&&function(t){return void 0!==t.getClient}(e)?e.getClient():e,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return function(t,e){return!!e&&t.includes(e.host)}(t,r)||function(t,e){if(!e)return!1;return wr(t)===wr(e)}(t,i)}function wr(t){return"/"===t[t.length-1]?t.slice(0,-1):t}const Sr=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Tr=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],_r="InboundFilters",xr=(t={})=>({name:_r,setupOnce(){},processEvent(e,n,r){const i=r.getOptions(),s=function(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:Sr],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:Tr],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(t,i);return function(t,e){if(e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t))return D.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ct(t)}`),!0;if(function(t,e){if(t.type||!e||!e.length)return!1;return function(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch(t){}n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`));0===e.length&&D.error(`Could not extract message for event ${ct(t)}`);return e}(t).some((t=>v(t,e)))}(t,e.ignoreErrors))return D.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ct(t)}`),!0;if(function(t,e){if("transaction"!==t.type||!e||!e.length)return!1;const n=t.transaction;return!!n&&v(n,e)}(t,e.ignoreTransactions))return D.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ct(t)}`),!0;if(function(t,e){if(!e||!e.length)return!1;const n=Cr(t);return!!n&&v(n,e)}(t,e.denyUrls))return D.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ct(t)}.\nUrl: ${Cr(t)}`),!0;if(!function(t,e){if(!e||!e.length)return!0;const n=Cr(t);return!n||v(n,e)}(t,e.allowUrls))return D.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ct(t)}.\nUrl: ${Cr(t)}`),!0;return!1}(e,s)?null:e}}),Ir=or(_r,xr);function Cr(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch(t){}return e?function(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(e):null}catch(e){return D.error(`Cannot extract url for event ${ct(t)}`),null}}let Er;const Rr="FunctionToString",$r=new WeakMap,Ar=()=>({name:Rr,setupOnce(){Er=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=H(this),n=$r.has(Je())&&void 0!==e?e:this;return Er.apply(n,t)}}catch(t){}},setup(t){$r.set(t,!0)}}),Or=or(Rr,Ar),Mr="LinkedErrors",Dr=or(Mr,((t={})=>{const e=t.limit||5,n=t.key||"cause";return{name:Mr,setupOnce(){},preprocessEvent(t,r,i){const s=i.getOptions();b(Te,s.stackParser,s.maxValueLength,n,e,t,r)}}}));var Lr=Object.freeze({__proto__:null,FunctionToString:Or,InboundFilters:Ir,LinkedErrors:Dr});class Nr{constructor(t){this.U=t,this.qt=new Map,this.Wt=setInterval((()=>this.flush()),5e3)}add(t,e,n,r="none",i={},s=te()){const o=Math.floor(s),a=e.replace(/[^\w\-.]+/gi,"_");const c=function(t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[ar(n)]=ur(String(t[n])));return e}(i),u=function(t){return t.replace(/[^\w]+/gi,"_")}(r),l=function(t,e,n,r){return`${t}${e}${n}${Object.entries(J(r)).sort(((t,e)=>t[0].localeCompare(e[0])))}`}(t,a,u,c);let h=this.qt.get(l);const d=h&&"s"===t?h.metric.weight:0;h?(h.metric.add(n),h.timestampt));this.U.captureAggregateMetrics(t)}this.qt.clear()}}close(){clearInterval(this.Wt),this.flush()}}const Fr="MetricsAggregator",jr=()=>({name:Fr,setupOnce(){},setup(t){t.metricsAggregator=new Nr(t)}});function Pr(t,e,n,r={}){const i=Je(),s=Ge();if(i){if(!i.metricsAggregator)return void D.warn("No metrics aggregator enabled. Please add the MetricsAggregator integration to use metrics APIs");const{unit:o,tags:a,timestamp:c}=r,{release:u,environment:l}=i.getOptions(),h=s.getTransaction(),d={};u&&(d.release=u),l&&(d.environment=l),h&&(d.transaction=Fe(h).description||""),D.log(`Adding value of ${n} to ${t} metric ${e}`),i.metricsAggregator.add(t,e,n,o,{...d,...a},c)}}const Br={increment:function(t,e=1,n){Pr("c",t,e,n)},distribution:function(t,e,n){Pr("d",t,e,n)},set:function(t,e,n){Pr("s",t,e,n)},gauge:function(t,e,n){Pr("g",t,e,n)},MetricsAggregator:or(Fr,jr),metricsAggregatorIntegration:jr},Ur=Lr,zr=_;const Hr=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||void 0===r)&&(r=e.value,e.delta=i,t(e)))}},qr=()=>zr.__WEB_VITALS_POLYFILL__?zr.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const t=zr.performance.timing,e=zr.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==e?"back_forward":1===e?"reload":"navigate"};for(const e in t)"navigationStart"!==e&&"toJSON"!==e&&(n[e]=Math.max(t[e]-t.navigationStart,0));return n})()):zr.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Wr=()=>{const t=qr();return t&&t.activationStart||0},Kr=(t,e)=>{const n=qr();let r="navigate";return n&&(r=zr.document&&zr.document.prerendering||Wr()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Jr=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((t=>{e(t.getEntries())}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},Gr=(t,e)=>{const n=r=>{"pagehide"!==r.type&&"hidden"!==zr.document.visibilityState||(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};zr.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))};let Xr=-1;const Yr=()=>(Xr<0&&(zr.document&&zr.document.visibilityState&&(Xr="hidden"!==zr.document.visibilityState||zr.document.prerendering?1/0:0),Gr((({timeStamp:t})=>{Xr=t}),!0)),{get firstHiddenTime(){return Xr}});let Vr=0,Qr=1/0,Zr=0;const ti=t=>{t.forEach((t=>{t.interactionId&&(Qr=Math.min(Qr,t.interactionId),Zr=Math.max(Zr,t.interactionId),Vr=Zr?(Zr-Qr)/7+1:0)}))};let ei;const ni=()=>{"interactionCount"in performance||ei||(ei=Jr("event",ti,{type:"event",buffered:!0,durationThreshold:0}))},ri=()=>ei?Vr:performance.interactionCount||0,ii=[],si={},oi=t=>{const e=ii[ii.length-1],n=si[t.interactionId];if(n||ii.length<10||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const e={id:t.interactionId,latency:t.duration,entries:[t]};si[e.id]=e,ii.push(e)}ii.sort(((t,e)=>e.latency-t.latency)),ii.splice(10).forEach((t=>{delete si[t.id]}))}},ai=(t,e)=>{e=e||{},ni();const n=Kr("INP");let r;const i=t=>{t.forEach((t=>{if(t.interactionId&&oi(t),"first-input"===t.entryType){!ii.some((e=>e.entries.some((e=>t.duration===e.duration&&t.startTime===e.startTime))))&&oi(t)}}));const e=(()=>{const t=Math.min(ii.length-1,Math.floor(ri()/50));return ii[t]})();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,r())},s=Jr("event",i,{durationThreshold:e.durationThreshold||40});r=Hr(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Gr((()=>{i(s.takeRecords()),n.value<0&&ri()>0&&(n.value=0,n.entries=[]),r(!0)})))},ci={},ui=t=>{zr.document&&(zr.document.prerendering?addEventListener("prerenderingchange",(()=>ui(t)),!0):"complete"!==zr.document.readyState?addEventListener("load",(()=>ui(t)),!0):setTimeout(t,0))},li={},hi={};let di,fi,pi,mi,yi;function gi(t,e=!1){return xi("lcp",t,Si,pi,e)}function vi(t,e){return Ii(t,e),hi[t]||(!function(t){const e={};"event"===t&&(e.durationThreshold=0);Jr(t,(e=>{bi(t,{entries:e})}),e)}(t),hi[t]=!0),Ci(t,e)}function bi(t,e){const n=li[t];if(n&&n.length)for(const r of n)try{r(e)}catch(e){D.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${Z(r)}\nError:`,e)}}function ki(){return((t,e={})=>{const n=Kr("CLS",0);let r,i=0,s=[];const o=t=>{t.forEach((t=>{if(!t.hadRecentInput){const e=s[0],o=s[s.length-1];i&&0!==s.length&&t.startTime-o.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,s.push(t)):(i=t.value,s=[t]),i>n.value&&(n.value=i,n.entries=s,r&&r())}}))},a=Jr("layout-shift",o);if(a){r=Hr(t,n,e.reportAllChanges);const i=()=>{o(a.takeRecords()),r(!0)};return Gr(i),i}})((t=>{bi("cls",{metric:t}),di=t}),{reportAllChanges:!0})}function wi(){return(t=>{const e=Yr(),n=Kr("FID");let r;const i=t=>{t.startTime{t.forEach(i)},o=Jr("first-input",s);r=Hr(t,n),o&&Gr((()=>{s(o.takeRecords()),o.disconnect()}),!0)})((t=>{bi("fid",{metric:t}),fi=t}))}function Si(){return(t=>{const e=Yr(),n=Kr("LCP");let r;const i=t=>{const i=t[t.length-1];if(i){const t=Math.max(i.startTime-Wr(),0);t{ci[n.id]||(i(s.takeRecords()),s.disconnect(),ci[n.id]=!0,r(!0))};return["keydown","click"].forEach((t=>{zr.document&&addEventListener(t,e,{once:!0,capture:!0})})),Gr(e,!0),e}})((t=>{bi("lcp",{metric:t}),pi=t}))}function Ti(){return((t,e)=>{e=e||{};const n=Kr("TTFB"),r=Hr(t,n,e.reportAllChanges);ui((()=>{const t=qr();if(t){if(n.value=Math.max(t.responseStart-Wr(),0),n.value<0||n.value>performance.now())return;n.entries=[t],r(!0)}}))})((t=>{bi("ttfb",{metric:t}),mi=t}))}function _i(){return ai((t=>{bi("inp",{metric:t}),yi=t}))}function xi(t,e,n,r,i=!1){let s;return Ii(t,e),hi[t]||(s=n(),hi[t]=!0),r&&e({metric:r}),Ci(t,e,i?s:void 0)}function Ii(t,e){li[t]=li[t]||[],li[t].push(e)}function Ci(t,e,n){return()=>{n&&n();const r=li[t];if(!r)return;const i=r.indexOf(e);-1!==i&&r.splice(i,1)}}function Ei(t){return"number"==typeof t&&isFinite(t)}function Ri(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}function $i(t){return t/1e3}function Ai(){return zr&&zr.addEventListener&&zr.performance}let Oi,Mi,Di=0,Li={};function Ni(){const t=Ai();if(t&&ee){t.mark&&zr.performance.mark("sentry-tracing-init");const e=xi("fid",(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=$i(ee),r=$i(e.startTime);D.log("[Measurements] Adding FID"),Li.fid={value:t.value,unit:"millisecond"},Li["mark.fid"]={value:n+r,unit:"second"}}),wi,fi),n=function(t,e=!1){return xi("cls",t,ki,di,e)}((({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(D.log("[Measurements] Adding CLS"),Li.cls={value:t.value,unit:""},Mi=e)}),!0),r=gi((({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(D.log("[Measurements] Adding LCP"),Li.lcp={value:t.value,unit:"millisecond"},Oi=e)}),!0),i=function(t){return xi("ttfb",t,Ti,mi)}((({metric:t})=>{t.entries[t.entries.length-1]&&(D.log("[Measurements] Adding TTFB"),Li.ttfb={value:t.value,unit:"millisecond"})}));return()=>{e(),n(),r(),i()}}return()=>{}}function Fi(t,e){if(Ai()&&ee){const n=function(t,e){return n=({metric:n})=>{if(void 0===n.value)return;const r=n.entries.find((t=>t.duration===n.value&&void 0!==ji[t.name])),i=Je();if(!r||!i)return;const s=ji[r.name],o=i.getOptions(),a=$i(ee+r.startTime),c=$i(n.value),u=void 0!==r.interactionId?t[r.interactionId]:void 0;if(void 0===u)return;const{routeName:l,parentContext:h,activeTransaction:d,user:f,replayId:p}=u,m=void 0!==f?f.email||f.id||f.ip_address:void 0,y=void 0!==d?d.getProfileId():void 0,g=new Un({startTimestamp:a,endTimestamp:a+c,op:`ui.interaction.${s}`,name:E(r.target),attributes:{release:o.release,environment:o.environment,transaction:l,...void 0!==m&&""!==m?{user:m}:{},...void 0!==y?{profile_id:y}:{},...void 0!==p?{replay_id:p}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=function(t,e,n){if(!In(e))return!1;let r;return r=void 0!==t&&"function"==typeof e.tracesSampler?e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:zr.location}):void 0!==t&&void 0!==t.sampled?t.sampled:void 0!==e.tracesSampleRate?e.tracesSampleRate:1,Gn(r)?!0===r?n:!1===r?0:r*n:(D.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}(h,o,e);if(v&&Math.random(){D.error("Error while sending interaction:",t)}))}},xi("inp",n,_i,yi);var n}(t,e);return()=>{n()}}return()=>{}}const ji={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 Pi(t){const e=Ai();if(!e||!zr.performance.getEntries||!ee)return;D.log("[Tracing] Adding & adjusting spans using Performance API");const n=$i(ee),r=e.getEntries(),{op:i,start_timestamp:s}=Fe(t);if(r.slice(Di).forEach((e=>{const r=$i(e.startTime),i=$i(e.duration);if(!("navigation"===t.op&&s&&n+r{Bi(t,e,r,n)})),Bi(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Bi(t,e,"fetch",n,"cache","domainLookupStart"),Bi(t,e,"domainLookup",n,"DNS"),function(t,e,n){e.responseEnd&&(Ri(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+$i(e.requestStart),endTimestamp:n+$i(e.responseEnd)}),Ri(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+$i(e.responseStart),endTimestamp:n+$i(e.responseEnd)}))}(t,e,n)}(t,e,n);break;case"mark":case"paint":case"measure":{!function(t,e,n,r,i){const s=i+n,o=s+r;Ri(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s})}(t,e,r,i,n);const s=Yr(),o=e.startTime{if(!Li[t]||!s||n>=s)return;const e=Li[t].value,r=n+$i(e),i=Math.abs(1e3*(r-s)),o=i-e;D.log(`[Measurements] Normalized ${t} from ${e} to ${i} (${o})`),Li[t].value=i}));const e=Li["mark.fid"];e&&Li.fid&&(Ri(t,{description:"first input delay",endTimestamp:e.value+$i(Li.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:e.value}),delete Li["mark.fid"]),"fcp"in Li||delete Li.cls,Object.keys(Li).forEach((t=>{!function(t,e,n){const r=kn();r&&r.setMeasurement(t,e,n)}(t,Li[t].value,Li[t].unit)})),function(t){Oi&&(D.log("[Measurements] Adding LCP Data"),Oi.element&&t.setTag("lcp.element",E(Oi.element)),Oi.id&&t.setTag("lcp.id",Oi.id),Oi.url&&t.setTag("lcp.url",Oi.url.trim().slice(0,200)),t.setTag("lcp.size",Oi.size));Mi&&Mi.sources&&(D.log("[Measurements] Adding CLS Data"),Mi.sources.forEach(((e,n)=>t.setTag(`cls.source.${n+1}`,E(e.node)))))}(t)}Oi=void 0,Mi=void 0,Li={}}function Bi(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],a=e[`${n}Start`];a&&o&&Ri(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+$i(a),endTimestamp:r+$i(o)})}function Ui(t,e,n,r){const i=e[n];null!=i&&i<2147483647&&(t[r]=i)}function zi(t,e,n,r,i="auto.http.browser"){if(!In()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const e=t.fetchData.__span;if(!e)return;const n=r[e];return void(n&&(!function(t,e){if(e.response){_n(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const e=parseInt(n);e>0&&t.setAttribute("http.response_content_length",e)}}else e.error&&t.setStatus("internal_error");t.end()}(n,t),delete r[e]))}const o=Ge(),a=Je(),{method:c,url:u}=t.fetchData,l=function(t){try{return new URL(t).href}catch(t){return}}(u),h=l?Yt(l).host:void 0,d=s?Cn({name:`${c} ${u}`,onlyIfParent:!0,attributes:{url:u,type:"fetch","http.method":c,"http.url":l,"server.address":h,[Pn]:i},op:"http.client"}):void 0;if(d&&(t.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d),n(t.fetchData.url)&&a){const e=t.args[0];t.args[1]=t.args[1]||{};const n=t.args[1];n.headers=function(t,e,n,r,i){const s=i||n.getSpan(),o=yn(),{traceId:a,spanId:c,sampled:u,dsc:l}={...o.getPropagationContext(),...n.getPropagationContext()},h=s?De(s):le(a,c,u),d=oe(l||(s?en(s):tn(a,e,n))),p=r.headers||("undefined"!=typeof Request&&f(t,Request)?t.headers:void 0);if(p){if("undefined"!=typeof Headers&&f(p,Headers)){const t=new Headers(p);return t.append("sentry-trace",h),d&&t.append(ne,d),t}if(Array.isArray(p)){const t=[...p,["sentry-trace",h]];return d&&t.push([ne,d]),t}{const t="baggage"in p?p.baggage:void 0,e=[];return Array.isArray(t)?e.push(...t):t&&e.push(t),d&&e.push(d),{...p,"sentry-trace":h,baggage:e.length>0?e.join(","):void 0}}}return{"sentry-trace":h,baggage:d}}(e,a,o,n,d)}return d}const Hi=["localhost",/^\/(?!\/)/],qi={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Hi,tracePropagationTargets:Hi};function Wi(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:qi.traceFetch,traceXHR:qi.traceXHR,...t},a="function"==typeof s?s:t=>!0,c=t=>function(t,e){return v(t,e||Hi)}(t,r||i),u={};e&&Tt((t=>{const e=zi(t,a,c,u);if(e){const n=Gi(t.fetchData.url),r=n?Yt(n).host:void 0;e.setAttributes({"http.url":n,"server.address":r})}o&&e&&Ki(e)})),n&&Pt((t=>{const e=function(t,e,n,r){const i=t.xhr,s=i&&i.__sentry_xhr_v3__;if(!In()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const t=i.__sentry_xhr_span_id__;if(!t)return;const e=r[t];return void(e&&void 0!==s.status_code&&(_n(e,s.status_code),e.end(),delete r[t]))}const a=Ge(),c=yn(),u=Gi(s.url),l=u?Yt(u).host:void 0,h=o?Cn({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":u,url:s.url,"server.address":l,[Pn]:"auto.http.browser"},op:"http.client"}):void 0;h&&(i.__sentry_xhr_span_id__=h.spanContext().spanId,r[i.__sentry_xhr_span_id__]=h);const d=Je();if(i.setRequestHeader&&n(s.url)&&d){const{traceId:t,spanId:e,sampled:n,dsc:r}={...c.getPropagationContext(),...a.getPropagationContext()};!function(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(ne,n)}catch(t){}}(i,h?De(h):le(t,e,n),oe(r||(h?en(h):tn(t,d,a))))}return h}(t,a,c,u);o&&e&&Ki(e)}))}function Ki(t){const{url:e}=Fe(t).data||{};if(!e||"string"!=typeof e)return;const n=vi("resource",(({entries:r})=>{r.forEach((r=>{if(function(t){return"resource"===t.entryType&&"initiatorType"in t&&"string"==typeof t.nextHopProtocol&&("fetch"===t.initiatorType||"xmlhttprequest"===t.initiatorType)}(r)&&r.name.endsWith(e)){(function(t){const{name:e,version:n}=function(t){let e="unknown",n="unknown",r="";for(const i of t){if("/"===i){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e="h"===r?"http":r,n=t.split(r)[1];break}r+=i}r===t&&(e=r);return{name:e,version:n}}(t.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",e]),!ee)return r;return[...r,["http.request.redirect_start",Ji(t.redirectStart)],["http.request.fetch_start",Ji(t.fetchStart)],["http.request.domain_lookup_start",Ji(t.domainLookupStart)],["http.request.domain_lookup_end",Ji(t.domainLookupEnd)],["http.request.connect_start",Ji(t.connectStart)],["http.request.secure_connection_start",Ji(t.secureConnectionStart)],["http.request.connection_end",Ji(t.connectEnd)],["http.request.request_start",Ji(t.requestStart)],["http.request.response_start",Ji(t.responseStart)],["http.request.response_end",Ji(t.responseEnd)]]})(r).forEach((e=>t.setAttribute(...e))),setTimeout(n)}}))}))}function Ji(t=0){return((ee||performance.timeOrigin)+t)/1e3}function Gi(t){try{return new URL(t,zr.location.origin).href}catch(t){return}}const Xi={...Hn,markBackgroundTransactions:!0,routingInstrumentation:function(t,e=!0,n=!0){if(!zr||!zr.location)return void D.warn("Could not initialize routing instrumentation due to invalid location");let r,i=zr.location.href;e&&(r=t({name:zr.location.pathname,startTimestamp:ee?ee/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&Nt((({to:e,from:n})=>{void 0===n&&i&&-1!==i.indexOf(e)?i=void 0:n!==e&&(i=void 0,r&&(D.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.end()),r=t({name:zr.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...qi};class Yi{constructor(t){this.name="BrowserTracing",this.Kt=!1,Qn(),this.Kt=!(!t||!t.tracePropagationTargets&&!t.tracingOrigins),this.options={...Xi,...t},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this.Jt=Ni(),this.Gt={},this.options.enableInp&&Fi(this.Gt,this.options.interactionsSampleRate),this.options.enableLongTask&&vi("longtask",(({entries:t})=>{for(const e of t){const t=kn();if(!t)return;const n=$i(ee+e.startTime),r=$i(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&vi("event",(({entries:t})=>{for(const e of t){const t=kn();if(!t)return;if("click"===e.name){const n=$i(ee+e.startTime),r=$i(e.duration),i={description:E(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r},s=$(e.target);s&&(i.attributes={"ui.component_name":s}),t.startChild(i)}}})),this.Xt={name:void 0,context:void 0}}setupOnce(t,e){this.Yt=e;const n=e().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:s,startTransactionOnPageLoad:o,markBackgroundTransactions:a,traceFetch:c,traceXHR:u,shouldCreateSpanForRequest:l,enableHTTPTimings:h,_experiments:d}=this.options,f=r&&r.tracePropagationTargets,p=f||this.options.tracePropagationTargets;this.Kt&&f&&D.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),i((t=>{const n=this.Vt(t);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,t,e),n}),o,s),a&&(zr.document?zr.document.addEventListener("visibilitychange",(()=>{const t=kn();if(zr.document.hidden&&t){const e="cancelled",{op:n,status:r}=Fe(t);D.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}})):D.warn("[Tracing] Could not set up background tab detection due to lack of global document")),d.enableInteractions&&this.Qt(),this.options.enableInp&&this.Zt(),Wi({traceFetch:c,traceXHR:u,tracePropagationTargets:p,shouldCreateSpanForRequest:l,enableHTTPTimings:h})}Vt(t){if(!this.Yt)return void D.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`);const e=this.Yt(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:s}=this.options,o="pageload"===t.op;let a;if(o){const e=o?Vi("sentry-trace"):"",n=o?Vi("baggage"):void 0,{traceId:r,dsc:i,parentSpanId:s,sampled:c}=function(t,e){const n=ue(t),r=se(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||ot(),parentSpanId:s||ot().substring(16),spanId:ot().substring(16),sampled:o,dsc:r||{}}:{traceId:i||ot(),spanId:ot().substring(16)}}(e,n);a={traceId:r,parentSpanId:s,parentSampled:c,...t,metadata:{...t.metadata,dynamicSamplingContext:i},trimEnd:!0}}else a={trimEnd:!0,...t};const c="function"==typeof n?n(a):a,u=void 0===c?{...a,sampled:!1}:c;u.metadata=u.name!==a.name?{...u.metadata,source:"custom"}:u.metadata,this.Xt.name=u.name,this.Xt.context=u,!1===u.sampled&&D.log(`[Tracing] Will not send ${u.op} transaction because of beforeNavigate.`),D.log(`[Tracing] Starting ${u.op} transaction on scope`);const{location:l}=zr,h=Vn(e,u,r,i,!0,{location:l},s,o);return o&&zr.document&&(zr.document.addEventListener("readystatechange",(()=>{["interactive","complete"].includes(zr.document.readyState)&&h.sendAutoFinishSignal()})),["interactive","complete"].includes(zr.document.readyState)&&h.sendAutoFinishSignal()),h.registerBeforeFinishCallback((t=>{this.Jt(),Pi(t)})),h}Qt(){let t;const e=()=>{const{idleTimeout:e,finalTimeout:n,heartbeatInterval:r}=this.options,i="ui.action.click",s=kn();if(s&&s.op&&["navigation","pageload"].includes(s.op))return void D.warn(`[Tracing] Did not create ${i} transaction because a pageload or navigation transaction is in progress.`);if(t&&(t.setFinishReason("interactionInterrupted"),t.end(),t=void 0),!this.Yt)return void D.warn(`[Tracing] Did not create ${i} transaction because _getCurrentHub is invalid.`);if(!this.Xt.name)return void D.warn(`[Tracing] Did not create ${i} transaction because _latestRouteName is missing.`);const o=this.Yt(),{location:a}=zr,c={name:this.Xt.name,op:i,trimEnd:!0,data:{[Nn]:this.Xt.context?Qi(this.Xt.context):"url"}};t=Vn(o,c,e,n,!0,{location:a},r)};["click"].forEach((t=>{zr.document&&addEventListener(t,e,{once:!1,capture:!0})}))}Zt(){const t=({entries:t})=>{const e=Je(),n=void 0!==e&&void 0!==e.getIntegrationByName?e.getIntegrationByName("Replay"):void 0,r=void 0!==n?n.getReplayId():void 0,i=kn(),s=Ge(),o=void 0!==s?s.getUser():void 0;t.forEach((t=>{if(function(t){return"duration"in t}(t)){const e=t.interactionId;if(void 0===e)return;const n=this.Gt[e],s=t.duration,a=t.startTime,c=Object.keys(this.Gt),u=c.length>0?c.reduce(((t,e)=>this.Gt[t].durationthis.Gt[t])).some((t=>t.duration===s&&t.startTime===a)))return}if(!e)return;if(n)n.duration=Math.max(n.duration,s);else if(c.length<10||void 0===u||s>this.Gt[u].duration){const t=this.Xt.name,n=this.Xt.context;t&&n&&(u&&Object.keys(this.Gt).length>=10&&delete this.Gt[u],this.Gt[e]={routeName:t,duration:s,parentContext:n,user:o,activeTransaction:i,replayId:r,startTime:a})}}}))};vi("event",t),vi("first-input",t)}}function Vi(t){const e=(n=`meta[name=${t}]`,C.document&&C.document.querySelector?C.document.querySelector(n):null);var n;return e?e.getAttribute("content"):void 0}function Qi(t){const e=t.attributes&&t.attributes["sentry.source"],n=t.data&&t.data["sentry.source"],r=t.metadata&&t.metadata.source;return e||n||r}function Zi(){Qn()}const ts=_,es="sentryReplaySession",ns="Unable to send Replay",rs=15e4,is=5e3,ss=2e7,os=36e5;function as(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}var cs;function us(t){const e=as([t,"optionalAccess",t=>t.host]);return Boolean(as([e,"optionalAccess",t=>t.shadowRoot])===t)}function ls(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function hs(t){try{const n=t.rules||t.cssRules;return n?((e=Array.from(n,ds).join("")).includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e):null}catch(t){return null}var e}function ds(t){let e;if(function(t){return"styleSheet"in t}(t))try{e=hs(t.styleSheet)||function(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}(t)}catch(t){}else if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":"))return function(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}(t.cssText);return e||t.cssText}!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(cs||(cs={}));class fs{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){if(!t)return-1;const e=as([this,"access",t=>t.getMeta,"call",e=>e(t),"optionalAccess",t=>t.id]);return r=()=>-1,null!=(n=e)?n:r();var n,r}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 e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const n=e.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ps({maskInputOptions:t,tagName:e,type:n}){return"OPTION"===e&&(e="SELECT"),Boolean(t[e.toLowerCase()]||n&&t[n]||"password"===n||"INPUT"===e&&!n&&t.text)}function ms({isMasked:t,element:e,value:n,maskInputFn:r}){let i=n||"";return t?(r&&(i=r(i,e)),"*".repeat(i.length)):i}function ys(t){return t.toLowerCase()}function gs(t){return t.toUpperCase()}const vs="__rrweb_original__";function bs(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ys(e):null}function ks(t,e,n){return"INPUT"!==e||"radio"!==n&&"checkbox"!==n?t.value:t.getAttribute("value")||""}let ws=1;const Ss=new RegExp("[^a-z0-9-_:]");function Ts(){return ws++}let _s,xs;const Is=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Cs=/^(?:[a-z+]+:)?\/\//i,Es=/^www\..*/i,Rs=/^(data:)([^,]*),(.*)/i;function $s(t,e){return(t||"").replace(Is,((t,n,r,i,s,o)=>{const a=r||s||o,c=n||i||"";if(!a)return t;if(Cs.test(a)||Es.test(a))return`url(${c}${a}${c})`;if(Rs.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${c})`;const u=e.split("/"),l=a.split("/");u.pop();for(const t of l)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${c}${u.join("/")}${c})`}))}const As=/^[^ \t\n\r\u000c]+/,Os=/^[, \t\n\r\u000c]+/;function Ms(t,e){if(!e||""===e.trim())return e;const n=t.createElement("a");return n.href=e,n.href}function Ds(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function Ls(){const t=document.createElement("a");return t.href="",t.href}function Ns(t,e,n,r,i,s){return r?"src"===n||"href"===n&&("use"!==e||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?Ms(t,r):"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function r(t){let r;const i=t.exec(e.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(Os),!(n>=e.length);){let s=r(As);if(","===s.slice(-1))s=Ms(t,s.substring(0,s.length-1)),i.push(s);else{let r="";s=Ms(t,s);let o=!1;for(;;){const t=e.charAt(n);if(""===t){i.push((s+r).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,i.push((s+r).trim());break}"("===t&&(o=!0)}r+=t,n+=1}}}return i.join(", ")}(t,r):"style"===n?$s(r,Ls()):"object"===e&&"data"===n?Ms(t,r):"function"==typeof s?s(n,r,i):r:Ms(t,r):r}function Fs(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===e}function js(t,e,n=1/0,r=0){return t?t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:js(t.parentNode,e,n,r+1):-1}function Ps(t,e){return n=>{const r=n;if(null===r)return!1;try{if(t)if("string"==typeof t){if(r.matches(`.${t}`))return!0}else if(function(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}(r,t))return!0;return!(!e||!r.matches(e))}catch(t){return!1}}}function Bs(t,e,n,r,i,s){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(null===o)return!1;if("INPUT"===o.tagName){const t=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(t))return!0}let a=-1,c=-1;if(s){if(c=js(o,Ps(r,i)),c<0)return!0;a=js(o,Ps(e,n),c>=0?c:1/0)}else{if(a=js(o,Ps(e,n)),a<0)return!1;c=js(o,Ps(r,i),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0)&&!!s}catch(t){}return!!s}function Us(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:h,unmaskTextSelector:d,inlineStylesheet:f,maskInputOptions:p={},maskTextFn:m,maskInputFn:y,dataURLOptions:g={},inlineImages:v,recordCanvas:b,keepIframeSrcFn:k,newlyAddedElement:w=!1}=e,S=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:cs.Document,childNodes:[],compatMode:t.compatMode}:{type:cs.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:cs.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:S};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:l={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:m,maskAllText:y,maskTextClass:g,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:k}=e,w=function(t,e,n,r){try{if(r&&t.matches(r))return!1;if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}if(n)return t.matches(n)}catch(t){}return!1}(t,r,i,s),S=function(t){if(t instanceof HTMLFormElement)return"form";const e=ys(t.tagName);return Ss.test(e)?"div":e}(t);let T={};const _=t.attributes.length;for(let e=0;e<_;e++){const r=t.attributes[e];r.name&&!Fs(S,r.name)&&(T[r.name]=Ns(n,S,ys(r.name),r.value,t,c))}if("link"===S&&o){const e=Array.from(n.styleSheets).find((e=>e.href===t.href));let r=null;e&&(r=hs(e)),r&&(delete T.rel,delete T.href,T._cssText=$s(r,e.href))}if("style"===S&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=hs(t.sheet);e&&(T._cssText=$s(e,Ls()))}if("input"===S||"textarea"===S||"select"===S||"option"===S){const e=t,n=bs(e),r=ks(e,gs(S),n),i=e.checked;if("submit"!==n&&"button"!==n&&r){const t=Bs(e,g,b,v,k,ps({type:n,tagName:gs(S),maskInputOptions:a}));T.value=ms({isMasked:t,element:e,value:r,maskInputFn:u})}i&&(T.checked=i)}"option"===S&&(t.selected&&!a.select?T.selected=!0:delete T.selected);if("canvas"===S&&d)if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;n0!==t)))return!1}return!0})(t)||(T.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const e=t.toDataURL(l.type,l.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(l.type,l.quality)&&(T.rr_dataURL=e)}if("img"===S&&h){_s||(_s=n.createElement("canvas"),xs=_s.getContext("2d"));const e=t,r=e.crossOrigin;e.crossOrigin="anonymous";const i=()=>{e.removeEventListener("load",i);try{_s.width=e.naturalWidth,_s.height=e.naturalHeight,xs.drawImage(e,0,0),T.rr_dataURL=_s.toDataURL(l.type,l.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}r?T.crossOrigin=r:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?i():e.addEventListener("load",i)}"audio"!==S&&"video"!==S||(T.rr_mediaState=t.paused?"paused":"played",T.rr_mediaCurrentTime=t.currentTime);p||(t.scrollLeft&&(T.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(T.rr_scrollTop=t.scrollTop));if(w){const{width:e,height:n}=t.getBoundingClientRect();T={class:T.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==S||f(T.src)||(t.contentDocument||(T.rr_src=T.src),delete T.src);let x;try{customElements.get(S)&&(x=!0)}catch(t){}return{type:cs.Element,tagName:S,attributes:T,childNodes:[],isSVG:Ds(t)||void 0,needBlock:w,rootId:m,isCustom:x}}(t,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:f,maskAttributeFn:c,maskInputOptions:p,maskInputFn:y,dataURLOptions:g,inlineImages:v,recordCanvas:b,keepIframeSrcFn:k,newlyAddedElement:w,rootId:S,maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:h,unmaskTextSelector:d});case t.TEXT_NODE:return function(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:l}=e,h=t.parentNode&&t.parentNode.tagName;let d=t.textContent;const f="STYLE"===h||void 0,p="SCRIPT"===h||void 0,m="TEXTAREA"===h||void 0;if(f&&d){try{t.nextSibling||t.previousSibling||as([t,"access",t=>t.parentNode,"access",t=>t.sheet,"optionalAccess",t=>t.cssRules])&&(d=hs(t.parentNode.sheet))}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}d=$s(d,Ls())}p&&(d="SCRIPT_PLACEHOLDER");const y=Bs(t,r,s,i,o,n);f||p||m||!d||!y||(d=a?a(d,t.parentElement):d.replace(/[\S]/g,"*"));m&&d&&(c.textarea||y)&&(d=u?u(d,t.parentNode):d.replace(/[\S]/g,"*"));if("OPTION"===h&&d){d=ms({isMasked:Bs(t,r,s,i,o,ps({type:null,tagName:h,maskInputOptions:c})),element:t,value:d,maskInputFn:u})}return{type:cs.Text,textContent:d||"",isStyle:f,rootId:l}}(t,{maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:h,unmaskTextSelector:d,maskTextFn:m,maskInputOptions:p,maskInputFn:y,rootId:S});case t.CDATA_SECTION_NODE:return{type:cs.CDATA,textContent:"",rootId:S};case t.COMMENT_NODE:return{type:cs.Comment,textContent:t.textContent||"",rootId:S};default:return!1}}function zs(t){return null==t?"":t.toLowerCase()}function Hs(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:d=!1,inlineStylesheet:f=!0,maskInputOptions:p={},maskAttributeFn:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b={},inlineImages:k=!1,recordCanvas:w=!1,onSerialize:S,onIframeLoad:T,iframeLoadTimeout:_=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:C=(()=>!1),newlyAddedElement:E=!1}=e;let{preserveWhiteSpace:R=!0}=e;const $=Us(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:y,maskInputFn:g,dataURLOptions:b,inlineImages:k,recordCanvas:w,keepIframeSrcFn:C,newlyAddedElement:E});if(!$)return console.warn(t,"not serialized"),null;let A;A=r.hasNode(t)?r.getId(t):!function(t,e){if(e.comment&&t.type===cs.Comment)return!0;if(t.type===cs.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(zs(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===zs(t.attributes.name)||"icon"===zs(t.attributes.rel)||"apple-touch-icon"===zs(t.attributes.rel)||"shortcut icon"===zs(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&zs(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(zs(t.attributes.property).match(/^(og|twitter|fb):/)||zs(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===zs(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===zs(t.attributes.name)||"googlebot"===zs(t.attributes.name)||"bingbot"===zs(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===zs(t.attributes.name)||"generator"===zs(t.attributes.name)||"framework"===zs(t.attributes.name)||"publisher"===zs(t.attributes.name)||"progid"===zs(t.attributes.name)||zs(t.attributes.property).match(/^article:/)||zs(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===zs(t.attributes.name)||"yandex-verification"===zs(t.attributes.name)||"csrf-token"===zs(t.attributes.name)||"p:domain_verify"===zs(t.attributes.name)||"verify-v1"===zs(t.attributes.name)||"verification"===zs(t.attributes.name)||"shopify-checkout-api-token"===zs(t.attributes.name)))return!0}}return!1}($,v)&&(R||$.type!==cs.Text||$.isStyle||$.textContent.replace(/^\s+|\s+$/gm,"").length)?Ts():-2;const O=Object.assign($,{id:A});if(r.add(t,O),-2===A)return null;S&&S(t);let M=!d;if(O.type===cs.Element){M=M&&!O.needBlock,delete O.needBlock;const e=t.shadowRoot;e&&ls(e)&&(O.isShadowHost=!0)}if((O.type===cs.Document||O.type===cs.Element)&&M){v.headWhitespace&&O.type===cs.Element&&"head"===O.tagName&&(R=!1);const e={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:d,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:k,recordCanvas:w,preserveWhiteSpace:R,onSerialize:S,onIframeLoad:T,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:C};for(const n of Array.from(t.childNodes)){const t=Hs(n,e);t&&O.childNodes.push(t)}if(function(t){return t.nodeType===t.ELEMENT_NODE}(t)&&t.shadowRoot)for(const n of Array.from(t.shadowRoot.childNodes)){const r=Hs(n,e);r&&(ls(t.shadowRoot)&&(r.isShadow=!0),O.childNodes.push(r))}}return t.parentNode&&us(t.parentNode)&&ls(t.parentNode)&&(O.isShadow=!0),O.type===cs.Element&&"iframe"===O.tagName&&function(t,e,n){const r=t.contentWindow;if(!r)return;let i,s=!1;try{i=r.document.readyState}catch(t){return}if("complete"!==i){const r=setTimeout((()=>{s||(e(),s=!0)}),n);return void t.addEventListener("load",(()=>{clearTimeout(r),s=!0,e()}))}const o="about:blank";if(r.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}(t,(()=>{const e=t.contentDocument;if(e&&T){const n=Hs(e,{doc:e,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:k,recordCanvas:w,preserveWhiteSpace:R,onSerialize:S,onIframeLoad:T,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:C});n&&T(t,n)}}),_),O.type===cs.Element&&"link"===O.tagName&&"stylesheet"===O.attributes.rel&&function(t,e,n){let r,i=!1;try{r=t.sheet}catch(t){return}if(r)return;const s=setTimeout((()=>{i||(e(),i=!0)}),n);t.addEventListener("load",(()=>{clearTimeout(s),i=!0,e()}))}(t,(()=>{if(x){const e=Hs(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:v,dataURLOptions:b,inlineImages:k,recordCanvas:w,preserveWhiteSpace:R,onSerialize:S,onIframeLoad:T,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:C});e&&x(t,e)}}),I),O}function qs(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}function Ws(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Ks="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Js={map:{},getId:()=>(console.error(Ks),-1),getNode:()=>(console.error(Ks),null),removeNodeFromMap(){console.error(Ks)},has:()=>(console.error(Ks),!1),reset(){console.error(Ks)}};function Gs(t,e,n={}){let r=null,i=0;return function(...s){const o=Date.now();i||!1!==n.leading||(i=o);const a=e-(o-i),c=this;a<=0||a>e?(r&&(!function(...t){mo("clearTimeout")(...t)}(r),r=null),i=o,t.apply(c,s)):r||!1===n.trailing||(r=yo((()=>{i=!1===n.leading?0:Date.now(),r=null,t.apply(c,s)}),a))}}function Xs(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(t){yo((()=>{n.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>Xs(t,e,s||{},!0)}function Ys(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Js=new Proxy(Js,{get:(t,e,n)=>("map"===e&&console.error(Ks),Reflect.get(t,e,n))}));let Vs=Date.now;function Qs(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:qs([e,"optionalAccess",t=>t.documentElement,"access",t=>t.scrollLeft])||qs([e,"optionalAccess",t=>t.body,"optionalAccess",t=>t.parentElement,"optionalAccess",t=>t.scrollLeft])||qs([e,"optionalAccess",t=>t.body,"optionalAccess",t=>t.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:qs([e,"optionalAccess",t=>t.documentElement,"access",t=>t.scrollTop])||qs([e,"optionalAccess",t=>t.body,"optionalAccess",t=>t.parentElement,"optionalAccess",t=>t.scrollTop])||qs([e,"optionalAccess",t=>t.body,"optionalAccess",t=>t.scrollTop])||0}}function Zs(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function to(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function eo(t){if(!t)return null;return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}function no(t,e,n,r,i){if(!t)return!1;const s=eo(t);if(!s)return!1;const o=Ps(e,n);if(!i){const t=r&&s.matches(r);return o(s)&&!t}const a=js(s,o);let c=-1;return!(a<0)&&(r&&(c=js(s,Ps(null,r))),a>-1&&c<0||at.shadowRoot]))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Vs=()=>(new Date).getTime());class uo{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return e=this.styleIDMap.get(t),n=()=>-1,null!=e?e:n();var e,n}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function lo(t){let e=null;return qs([t,"access",t=>t.getRootNode,"optionalCall",t=>t(),"optionalAccess",t=>t.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function ho(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=lo(n);)n=e;return n}(t);return e.contains(n)}function fo(t){const e=t.ownerDocument;return!!e&&(e.contains(t)||ho(t))}const po={};function mo(t){const e=po[t];if(e)return e;const n=window.document;let r=window[t];if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e);const i=e.contentWindow;i&&i[t]&&(r=i[t]),n.head.removeChild(e)}catch(t){}return po[t]=r.bind(window)}function yo(...t){return mo("setTimeout")(...t)}var go=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(go||{}),vo=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(vo||{}),bo=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(bo||{}),ko=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ko||{});function wo(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}function So(t){return"__ln"in t}class To{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 e=this.head;for(let n=0;nt.next])||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&So(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&So(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const _o=(t,e)=>`${t}@${e}`;class xo{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=[],e=new Set,n=new To,r=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n},i=i=>{if(!i.parentNode||!fo(i))return;const s=us(i.parentNode)?this.mirror.getId(lo(i)):this.mirror.getId(i.parentNode),o=r(i);if(-1===s||-1===o)return n.addNode(i);const a=Hs(i,{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:t=>{oo(t,this.mirror)&&this.iframeManager.addIframe(t),ao(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),co(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});a&&(t.push({parentId:s,nextId:o,node:a}),e.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const t of this.movedSet)Co(this.removes,t,this.mirror)&&!this.movedSet.has(t.parentNode)||i(t);for(const t of this.addedSet)Ro(this.droppedSet,t)||Co(this.removes,t,this.mirror)?Ro(this.movedSet,t)?i(t):this.droppedSet.add(t):i(t);let s=null;for(;n.length;){let t=null;if(s){const e=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==e&&-1!==n&&(t=s)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==e){t=n;break}{const e=n.value;if(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=e.parentNode.host;if(-1!==this.mirror.getId(r)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}s=t.previous,n.removeNode(t.value),i(t.value)}const o={texts:this.texts.map((t=>({id:this.mirror.getId(t.node),value:t.value}))).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{const{attributes:e}=t;if("string"==typeof e.style){const n=JSON.stringify(t.styleDiff),r=JSON.stringify(t.te);n.length!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))},this.processMutation=t=>{if(!ro(t.target,this.mirror))switch(t.type){case"characterData":{const e=t.target.textContent;no(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||e===t.oldValue||this.texts.push({value:Bs(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&e?this.maskTextFn?this.maskTextFn(e,eo(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{const e=t.target;let n=t.attributeName,r=t.target.getAttribute(n);if("value"===n){const n=bs(e),i=e.tagName;r=ks(e,i,n);const s=ps({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=ms({isMasked:Bs(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,s),element:e,value:r,maskInputFn:this.maskInputFn})}if(no(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===t.oldValue)return;let i=this.attributeMap.get(t.target);if("IFRAME"===e.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(e.contentDocument)return;n="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},te:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),"type"===n&&"INPUT"===e.tagName&&"password"===(t.oldValue||"").toLowerCase()&&e.setAttribute("data-rr-is-password","true"),!Fs(e.tagName,n)&&(i.attributes[n]=Ns(this.doc,ys(e.tagName),ys(n),r,e,this.maskAttributeFn),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");t.oldValue&&n.setAttribute("style",t.oldValue);for(const t of Array.from(e.style)){const r=e.style.getPropertyValue(t),s=e.style.getPropertyPriority(t);r!==n.style.getPropertyValue(t)||s!==n.style.getPropertyPriority(t)?i.styleDiff[t]=""===s?r:[r,s]:i.te[t]=[r,s]}for(const t of Array.from(n.style))""===e.style.getPropertyValue(t)&&(i.styleDiff[t]=!1)}break}case"childList":if(no(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{const n=this.mirror.getId(e),r=us(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);no(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||ro(e,this.mirror)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Io(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||io(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[_o(n,r)]?Io(this.movedSet,e):this.removes.push({parentId:r,id:n,isShadow:!(!us(t.target)||!ls(t.target))||void 0})),this.mapRemoves.push(e))}))}},this.genAdds=(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ro(t,this.mirror))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[_o(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);no(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach((t=>this.genAdds(t))),co(t)&&t.shadowRoot.childNodes.forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 Io(t,e){t.delete(e),e.childNodes.forEach((e=>Io(t,e)))}function Co(t,e,n){return 0!==t.length&&Eo(t,e,n)}function Eo(t,e,n){const{parentNode:r}=e;if(!r)return!1;const i=n.getId(r);return!!t.some((t=>t.id===i))||Eo(t,r,n)}function Ro(t,e){return 0!==t.size&&$o(t,e)}function $o(t,e){const{parentNode:n}=e;return!!n&&(!!t.has(n)||$o(t,n))}let Ao;function Oo(t){Ao=t}function Mo(){Ao=void 0}const Do=t=>{if(!Ao)return t;return(...e)=>{try{return t(...e)}catch(t){if(Ao&&!0===Ao(t))return()=>{};throw t}}};function Lo(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}const No=[];function Fo(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function jo(t,e){const n=new xo;No.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const i=Lo([window,"optionalAccess",t=>t.Zone,"optionalAccess",t=>t.__symbol__,"optionalCall",t=>t("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r(Do((e=>{t.onMutation&&!1===t.onMutation(e)||n.processMutations.bind(n)(e)})));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Po({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,c=[];let u=null;return Object.keys(bo).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((o=>{let a=ys(o);const l=(e=>o=>{const a=Fo(o);if(no(a,r,i,s,!0))return;let c=null,l=e;if("pointerType"in o){switch(o.pointerType){case"mouse":c=ko.Mouse;break;case"touch":c=ko.Touch;break;case"pen":c=ko.Pen}c===ko.Touch&&(bo[e]===bo.MouseDown?l="TouchStart":bo[e]===bo.MouseUp&&(l="TouchEnd"))}else so(o)&&(c=ko.Touch);null!==c?(u=c,(l.startsWith("Touch")&&c===ko.Touch||l.startsWith("Mouse")&&c===ko.Mouse)&&(c=null)):bo[e]===bo.Click&&(c=u,u=null);const h=so(o)?o.changedTouches[0]:o;if(!h)return;const d=n.getId(a),{clientX:f,clientY:p}=h;Do(t)({type:bo[l],id:d,x:f,y:p,...null!==c&&{pointerType:c}})})(o);if(window.PointerEvent)switch(bo[o]){case bo.MouseDown:case bo.MouseUp:a=a.replace("mouse","pointer");break;case bo.TouchStart:case bo.TouchEnd:return}c.push(Ws(a,l,e))})),Do((()=>{c.forEach((t=>t()))}))}function Bo({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){return Ws("scroll",Do(Gs(Do((o=>{const a=Fo(o);if(!a||no(a,r,i,s,!0))return;const c=n.getId(a);if(a===e&&e.defaultView){const n=Qs(e.defaultView);t({id:c,x:n.left,y:n.top})}else t({id:c,x:a.scrollLeft,y:a.scrollTop})})),o.scroll||100)),e)}const Uo=["INPUT","TEXTAREA","SELECT"],zo=new WeakMap;function Ho({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:l,userTriggeredOnInput:h,maskTextClass:d,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:m}){function y(t){let n=Fo(t);const l=t.isTrusted,y=n&&gs(n.tagName);if("OPTION"===y&&(n=n.parentElement),!n||!y||Uo.indexOf(y)<0||no(n,r,i,s,!0))return;const v=n;if(v.classList.contains(o)||a&&v.matches(a))return;const b=bs(n);let k=ks(v,y,b),w=!1;const S=ps({maskInputOptions:c,tagName:y,type:b}),T=Bs(n,d,p,f,m,S);"radio"!==b&&"checkbox"!==b||(w=n.checked),k=ms({isMasked:T,element:n,value:k,maskInputFn:u}),g(n,h?{text:k,isChecked:w,userTriggered:l}:{text:k,isChecked:w});const _=n.name;"radio"===b&&_&&w&&e.querySelectorAll(`input[type="radio"][name="${_}"]`).forEach((t=>{if(t!==n){const e=ms({isMasked:T,element:t,value:ks(t,y,b),maskInputFn:u});g(t,h?{text:e,isChecked:!w,userTriggered:!1}:{text:e,isChecked:!w})}}))}function g(e,r){const i=zo.get(e);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){zo.set(e,r);const i=n.getId(e);Do(t)({...r,id:i})}}const v=("last"===l.input?["change"]:["input","change"]).map((t=>Ws(t,Do(y),e))),b=e.defaultView;if(!b)return()=>{v.forEach((t=>t()))};const k=b.Object.getOwnPropertyDescriptor(b.HTMLInputElement.prototype,"value"),w=[[b.HTMLInputElement.prototype,"value"],[b.HTMLInputElement.prototype,"checked"],[b.HTMLSelectElement.prototype,"value"],[b.HTMLTextAreaElement.prototype,"value"],[b.HTMLSelectElement.prototype,"selectedIndex"],[b.HTMLOptionElement.prototype,"selected"]];return k&&k.set&&v.push(...w.map((t=>Xs(t[0],t[1],{set(){Do(y)({target:this,isTrusted:!1})}},!1,b)))),Do((()=>{v.forEach((t=>t()))}))}function qo(t){return function(t,e){if(Go("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Go("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Go("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Go("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function Wo(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function Ko({mirror:t,stylesheetManager:e},n){let r=null;r="#document"===n.nodeName?t.getId(n):t.getId(n.host);const i="#document"===n.nodeName?Lo([n,"access",t=>t.defaultView,"optionalAccess",t=>t.Document]):Lo([n,"access",t=>t.ownerDocument,"optionalAccess",t=>t.defaultView,"optionalAccess",t=>t.ShadowRoot]),s=Lo([i,"optionalAccess",t=>t.prototype])?Object.getOwnPropertyDescriptor(Lo([i,"optionalAccess",t=>t.prototype]),"adoptedStyleSheets"):void 0;return null!==r&&-1!==r&&i&&s?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return Lo([s,"access",t=>t.get,"optionalAccess",t=>t.call,"call",t=>t(this)])},set(t){const n=Lo([s,"access",t=>t.set,"optionalAccess",t=>t.call,"call",e=>e(this,t)]);if(null!==r&&-1!==r)try{e.adoptStyleSheets(t,r)}catch(t){}return n}}),Do((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))):()=>{}}function Jo(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=jo(t,t.doc),i=function({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(!1===e.mousemove)return()=>{};const i="number"==typeof e.mousemove?e.mousemove:50,s="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const c=Gs(Do((e=>{const n=Date.now()-o;t(a.map((t=>(t.timeOffset-=n,t))),e),a=[],o=null})),s),u=Do(Gs(Do((t=>{const e=Fo(t),{clientX:n,clientY:i}=so(t)?t.changedTouches[0]:t;o||(o=Vs()),a.push({x:n,y:i,id:r.getId(e),timeOffset:Vs()-o}),c("undefined"!=typeof DragEvent&&t instanceof DragEvent?vo.Drag:t instanceof MouseEvent?vo.MouseMove:vo.TouchMove)})),i,{trailing:!1})),l=[Ws("mousemove",u,n),Ws("touchmove",u,n),Ws("drag",u,n)];return Do((()=>{l.forEach((t=>t()))}))}(t),s=Po(t),o=Bo(t),a=function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return Ws("resize",Do(Gs(Do((()=>{const e=Zs(),i=to();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)})),200)),e)}(t,{win:n}),c=Ho(t),u=function({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){const a=Do((o=>Gs(Do((s=>{const a=Fo(s);if(!a||no(a,e,n,r,!0))return;const{currentTime:c,volume:u,muted:l,playbackRate:h}=a;t({type:o,id:i.getId(a),currentTime:c,volume:u,muted:l,playbackRate:h})})),s.media||500))),c=[Ws("play",a(0),o),Ws("pause",a(1),o),Ws("seeked",a(2),o),Ws("volumechange",a(3),o),Ws("ratechange",a(4),o)];return Do((()=>{c.forEach((t=>t()))}))}(t),l=function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Do(((r,i,s)=>{const[o,a]=s,{id:c,styleId:u}=Wo(i,e,n.styleMirror);return(c&&-1!==c||u&&-1!==u)&&t({id:c,styleId:u,adds:[{rule:o,index:a}]}),r.apply(i,s)}))});const s=r.CSSStyleSheet.prototype.deleteRule;let o,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Do(((r,i,s)=>{const[o]=s,{id:a,styleId:c}=Wo(i,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,removes:[{index:o}]}),r.apply(i,s)}))}),r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Do(((r,i,s)=>{const[o]=s,{id:a,styleId:c}=Wo(i,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,replace:o}),r.apply(i,s)}))})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Do(((r,i,s)=>{const[o]=s,{id:a,styleId:c}=Wo(i,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,replaceSync:o}),r.apply(i,s)}))}));const c={};Xo("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Xo("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Xo("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Xo("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach((([r,i])=>{u[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[r].insertRule,{apply:Do(((r,i,s)=>{const[o,a]=s,{id:c,styleId:u}=Wo(i.parentStyleSheet,e,n.styleMirror);return(c&&-1!==c||u&&-1!==u)&&t({id:c,styleId:u,adds:[{rule:o,index:[...qo(i),a||0]}]}),r.apply(i,s)}))}),i.prototype.deleteRule=new Proxy(u[r].deleteRule,{apply:Do(((r,i,s)=>{const[o]=s,{id:a,styleId:c}=Wo(i.parentStyleSheet,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,removes:[{index:[...qo(i),o]}]}),r.apply(i,s)}))})})),Do((()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([t,e])=>{e.prototype.insertRule=u[t].insertRule,e.prototype.deleteRule=u[t].deleteRule}))}))}(t,{win:n}),h=Ko(t,t.doc),d=function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Do(((i,o,a)=>{const[c,u,l]=a;if(n.has(c))return s.apply(o,[c,u,l]);const{id:h,styleId:d}=Wo(Lo([o,"access",t=>t.parentRule,"optionalAccess",t=>t.parentStyleSheet]),e,r.styleMirror);return(h&&-1!==h||d&&-1!==d)&&t({id:h,styleId:d,set:{property:c,value:u,priority:l},index:qo(o.parentRule)}),i.apply(o,a)}))});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Do(((i,s,a)=>{const[c]=a;if(n.has(c))return o.apply(s,[c]);const{id:u,styleId:l}=Wo(Lo([s,"access",t=>t.parentRule,"optionalAccess",t=>t.parentStyleSheet]),e,r.styleMirror);return(u&&-1!==u||l&&-1!==l)&&t({id:u,styleId:l,remove:{property:c},index:qo(s.parentRule)}),i.apply(s,a)}))}),Do((()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o}))}(t,{win:n}),f=t.collectFonts?function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,n){const r=new s(t,e,n);return i.set(r,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};const o=Ys(e.fonts,"add",(function(e){return function(n){return yo(Do((()=>{const e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{n.FontFace=s})),r.push(o),Do((()=>{r.forEach((t=>t()))}))}(t):()=>{},p=function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=t;let a=!0;const c=Do((()=>{const t=e.getSelection();if(!t||a&&Lo([t,"optionalAccess",t=>t.isCollapsed]))return;a=t.isCollapsed||!1;const c=[],u=t.rangeCount||0;for(let e=0;e{}}(t),y=[];for(const e of t.plugins)y.push(e.observer(e.callback,n,e.options));return Do((()=>{No.forEach((t=>t.reset())),r.disconnect(),i(),s(),o(),a(),c(),u(),l(),h(),d(),f(),p(),m(),y.forEach((t=>t()))}))}function Go(t){return void 0!==window[t]}function Xo(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Yo{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,e,n,r){const i=n||this.getIdToRemoteIdMap(t),s=r||this.getRemoteIdToIdMap(t);let o=i.get(e);return o||(o=this.generateIdFn(),i.set(e,o),s.set(o,e)),o}getIds(t,e){const n=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,n,r)))}getRemoteId(t,e,n){const r=n||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;const i=r.get(e);return i||-1}getRemoteIds(t,e){const n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,n)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){let e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}function Vo(t){let e,n=t[0],r=1;for(;rn.call(e,...t))),e=void 0)}return n}class Qo{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Yo(Ts),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Yo(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,e){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),Vo([this,"access",t=>t.loadListener,"optionalCall",e=>e(t)]),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case go.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:go.IncrementalSnapshot,data:{source:vo.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case go.Meta:case go.Load:case go.DomContentLoaded:return!1;case go.Plugin:return e;case go.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case go.IncrementalSnapshot:switch(e.data.source){case vo.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case vo.Drag:case vo.TouchMove:case vo.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case vo.ViewportResize:return!1;case vo.MediaInteraction:case vo.MouseInteraction:case vo.Scroll:case vo.CanvasMutation:case vo.Input:return this.replaceIds(e.data,t,["id"]),e;case vo.StyleSheetRule:case vo.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case vo.Font:return e;case vo.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case vo.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),Vo([e,"access",t=>t.data,"access",t=>t.styles,"optionalAccess",t=>t.forEach,"call",e=>e((e=>{this.replaceStyleIds(e,t,["styleId"])}))]),e}}return!1}replace(t,e,n,r){for(const i of r)(Array.isArray(e[i])||"number"==typeof e[i])&&(Array.isArray(e[i])?e[i]=t.getIds(n,e[i]):e[i]=t.getId(n,e[i]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===cs.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Zo{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,e){if(!ls(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=jo({...this.bypassOptions,doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Bo({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),yo((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Ko({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push(Ys(t.prototype,"attachShadow",(function(t){return function(r){const i=t.call(this,r);return this.shadowRoot&&fo(this)&&n.addShadowRoot(this.shadowRoot,e),i}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class ta{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class ea{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new uo,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},r=[];for(const e of t){let t;this.styleMirror.has(e)?t=this.styleMirror.getId(e):(t=this.styleMirror.add(e),r.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,e)=>({rule:ds(t),index:e})))})),n.styleIds.push(t)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class na{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){!function(...t){mo("requestAnimationFrame")(...t)}((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some((t=>t!==e))}add(t,e){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let ra,ia;const sa=new fs;function oa(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:s=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:l="rr-mask",unmaskTextClass:h=null,maskTextSelector:d=null,unmaskTextSelector:f=null,inlineStylesheet:p=!0,maskAllInputs:m,maskInputOptions:y,slimDOMOptions:g,maskAttributeFn:v,maskInputFn:b,maskTextFn:k,maxCanvasSize:w=null,packFn:S,sampling:T={},dataURLOptions:_={},mousemoveWait:x,recordCanvas:I=!1,recordCrossOriginIframes:C=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:$=!1,inlineImages:A=!1,plugins:O,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:D=new Set([]),errorHandler:L,onMutation:N,getCanvasManager:F}=t;Oo(L);const j=!C||window.parent===window;let P=!1;if(!j)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(j&&!e)throw new Error("emit function is required");void 0!==x&&void 0===T.mousemove&&(T.mousemove=x),sa.reset();const B=!0===m?{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!==y?y:{},U=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{};let z;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let e=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let H=0;const q=t=>{for(const e of O||[])e.eventProcessor&&(t=e.eventProcessor(t));return S&&!P&&(t=S(t)),t};ra=(t,i)=>{const s=t;if(s.timestamp=Vs(),!_e([No,"access",t=>t[0],"optionalAccess",t=>t.isFrozen,"call",t=>t()])||s.type===go.FullSnapshot||s.type===go.IncrementalSnapshot&&s.data.source===vo.Mutation||No.forEach((t=>t.unfreeze())),j)_e([e,"optionalCall",t=>t(q(s),i)]);else if(P){const t={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(t,"*")}if(s.type===go.FullSnapshot)z=s,H=0;else if(s.type===go.IncrementalSnapshot){if(s.data.source===vo.Mutation&&s.data.isAttachIframe)return;H++;const t=r&&H>=r,e=n&&z&&s.timestamp-z.timestamp>n;(t||e)&&Z(!0)}};const W=t=>{ra({type:go.IncrementalSnapshot,data:{source:vo.Mutation,...t}})},K=t=>ra({type:go.IncrementalSnapshot,data:{source:vo.Scroll,...t}}),J=t=>ra({type:go.IncrementalSnapshot,data:{source:vo.CanvasMutation,...t}}),G=new ea({mutationCb:W,adoptedStyleSheetCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.AdoptedStyleSheet,...t}})}),X=new Qo({mirror:sa,mutationCb:W,stylesheetManager:G,recordCrossOriginIframes:C,wrappedEmit:ra});for(const t of O||[])t.getMirror&&t.getMirror({nodeMirror:sa,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});const Y=new na,V=function(t,e){try{return t?t(e):new ta}catch(t){return console.warn("Unable to initialize CanvasManager"),new ta}}(F,{mirror:sa,win:window,mutationCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.CanvasMutation,...t}}),recordCanvas:I,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:w,sampling:T.canvas,dataURLOptions:_,errorHandler:L}),Q=new Zo({mutationCb:W,scrollCb:K,bypassOptions:{onMutation:N,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:h,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:B,dataURLOptions:_,maskAttributeFn:v,maskTextFn:k,maskInputFn:b,recordCanvas:I,inlineImages:A,sampling:T,slimDOMOptions:U,iframeManager:X,stylesheetManager:G,canvasManager:V,keepIframeSrcFn:M,processedNodeManager:Y},mirror:sa}),Z=(t=!1)=>{ra({type:go.Meta,data:{href:window.location.href,width:to(),height:Zs()}},t),G.reset(),Q.init(),No.forEach((t=>t.lock()));const e=function(t,e){const{mirror:n=new fs,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:l=null,inlineStylesheet:h=!0,inlineImages:d=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:y,maskInputFn:g,slimDOM:v=!1,dataURLOptions:b,preserveWhiteSpace:k,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:T,onStylesheetLoad:_,stylesheetLoadTimeout:x,keepIframeSrcFn:I=(()=>!1)}=e||{};return Hs(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===p?{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}:!1===p?{}:p,maskAttributeFn:m,maskTextFn:y,maskInputFn:g,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:b,inlineImages:d,recordCanvas:f,preserveWhiteSpace:k,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:T,onStylesheetLoad:_,stylesheetLoadTimeout:x,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:sa,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:u,maskTextClass:l,unmaskTextClass:h,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskAllInputs:B,maskAttributeFn:v,maskInputFn:b,maskTextFn:k,slimDOM:U,dataURLOptions:_,recordCanvas:I,inlineImages:A,onSerialize:t=>{oo(t,sa)&&X.addIframe(t),ao(t,sa)&&G.trackLinkElement(t),co(t)&&Q.addShadowRoot(t.shadowRoot,document)},onIframeLoad:(t,e)=>{X.attachIframe(t,e),Q.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{G.attachLinkElement(t,e)},keepIframeSrcFn:M});if(!e)return console.warn("Failed to snapshot the document");ra({type:go.FullSnapshot,data:{node:e,initialOffset:Qs(window)}}),No.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&G.adoptStyleSheets(document.adoptedStyleSheets,sa.getId(document))};ia=Z;try{const t=[],e=t=>Do(Jo)({onMutation:N,mutationCb:W,mousemoveCb:(t,e)=>ra({type:go.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.MouseInteraction,...t}}),scrollCb:K,viewportResizeCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.ViewportResize,...t}}),inputCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.Input,...t}}),mediaInteractionCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.MediaInteraction,...t}}),styleSheetRuleCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.StyleSheetRule,...t}}),styleDeclarationCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.StyleDeclaration,...t}}),canvasMutationCb:J,fontCb:t=>ra({type:go.IncrementalSnapshot,data:{source:vo.Font,...t}}),selectionCb:t=>{ra({type:go.IncrementalSnapshot,data:{source:vo.Selection,...t}})},customElementCb:t=>{ra({type:go.IncrementalSnapshot,data:{source:vo.CustomElement,...t}})},blockClass:i,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:l,unmaskTextClass:h,maskTextSelector:d,unmaskTextSelector:f,maskInputOptions:B,inlineStylesheet:p,sampling:T,recordCanvas:I,inlineImages:A,userTriggeredOnInput:R,collectFonts:$,doc:t,maskAttributeFn:v,maskInputFn:b,maskTextFn:k,keepIframeSrcFn:M,blockSelector:s,unblockSelector:o,slimDOMOptions:U,dataURLOptions:_,mirror:sa,iframeManager:X,stylesheetManager:G,shadowDomManager:Q,processedNodeManager:Y,canvasManager:V,ignoreCSSAttributes:D,plugins:_e([O,"optionalAccess",t=>t.filter,"call",t=>t((t=>t.observer)),"optionalAccess",t=>t.map,"call",t=>t((t=>({observer:t.observer,options:t.options,callback:e=>ra({type:go.Plugin,data:{plugin:t.name,payload:e}})})))])||[]},{});X.addLoadListener((n=>{try{t.push(e(n.contentDocument))}catch(t){console.warn(t)}}));const n=()=>{Z(),t.push(e(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(t.push(Ws("DOMContentLoaded",(()=>{ra({type:go.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&n()}))),t.push(Ws("load",(()=>{ra({type:go.Load,data:{}}),"load"===E&&n()}),window))),()=>{t.forEach((t=>t())),Y.destroy(),ia=void 0,Mo()}}catch(t){console.warn(t)}}oa.mirror=sa,oa.takeFullSnapshot=function(t){if(!ia)throw new Error("please take full snapshot after start recording");ia(t)};function aa(t){return t>9999999999?t:1e3*t}function ca(t){return t>9999999999?t/1e3:t}function ua(t,e){"sentry.transaction"!==e.category&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate((()=>(t.throttledAddEvent({type:go.Custom,timestamp:1e3*(e.timestamp||0),data:{tag:"breadcrumb",payload:zt(e,10,1e3)}}),"console"===e.category))))}function la(t){return t.closest("button,a")||t}function ha(t){const e=da(t);return e&&e instanceof Element?la(e):e}function da(t){return function(t){return"object"==typeof t&&!!t&&"target"in t}(t)?t.target:t}let fa;function pa(t){return fa||(fa=[],B(ts,"open",(function(t){return function(...e){if(fa)try{fa.forEach((t=>t()))}catch(t){}return t.apply(ts,e)}}))),fa.push(t),()=>{const e=fa?fa.indexOf(t):-1;e>-1&&fa.splice(e,1)}}class ma{constructor(t,e,n=ua){this.ee=0,this.ne=0,this.re=[],this.ie=e.timeout/1e3,this.se=e.threshold/1e3,this.oe=e.scrollTimeout/1e3,this._replay=t,this.ae=e.ignoreSelector,this.ce=n}addListeners(){const t=pa((()=>{this.ee=ga()}));this.ue=()=>{t(),this.re=[],this.ee=0,this.ne=0}}removeListeners(){this.ue&&this.ue(),this.le&&clearTimeout(this.le)}handleClick(t,e){if(function(t,e){if(!ya.includes(t.tagName))return!0;if("INPUT"===t.tagName&&!["submit","button"].includes(t.getAttribute("type")||""))return!0;if("A"===t.tagName&&(t.hasAttribute("download")||t.hasAttribute("target")&&"_self"!==t.getAttribute("target")))return!0;if(e&&t.matches(e))return!0;return!1}(e,this.ae)||!function(t){return!(!t.data||"number"!=typeof t.data.nodeId||!t.timestamp)}(t))return;const n={timestamp:ca(t.timestamp),clickBreadcrumb:t,clickCount:0,node:e};this.re.some((t=>t.node===n.node&&Math.abs(t.timestamp-n.timestamp)<1))||(this.re.push(n),1===this.re.length&&this.he())}registerMutation(t=Date.now()){this.ee=ca(t)}registerScroll(t=Date.now()){this.ne=ca(t)}registerClick(t){const e=la(t);this.de(e)}de(t){this.fe(t).forEach((t=>{t.clickCount++}))}fe(t){return this.re.filter((e=>e.node===t))}pe(){const t=[],e=ga();this.re.forEach((n=>{!n.mutationAfter&&this.ee&&(n.mutationAfter=n.timestamp<=this.ee?this.ee-n.timestamp:void 0),!n.scrollAfter&&this.ne&&(n.scrollAfter=n.timestamp<=this.ne?this.ne-n.timestamp:void 0),n.timestamp+this.ie<=e&&t.push(n)}));for(const e of t){const t=this.re.indexOf(e);t>-1&&(this.me(e),this.re.splice(t,1))}this.re.length&&this.he()}me(t){const e=this._replay,n=t.scrollAfter&&t.scrollAfter<=this.oe,r=t.mutationAfter&&t.mutationAfter<=this.se,i=!n&&!r,{clickCount:s,clickBreadcrumb:o}=t;if(i){const n=1e3*Math.min(t.mutationAfter||this.ie,this.ie),r=n<1e3*this.ie?"mutation":"timeout",i={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:ts.location.href,route:e.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:s||1}};this.ce(e,i)}else if(s>1){const t={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:ts.location.href,route:e.getCurrentRoute(),clickCount:s,metric:!0}};this.ce(e,t)}}he(){this.le&&clearTimeout(this.le),this.le=setTimeout((()=>this.pe()),1e3)}}const ya=["A","BUTTON","INPUT"];function ga(){return Date.now()/1e3}function va(t,e){try{if(!function(t){return 3===t.type}(e))return;const{source:n}=e.data;if(n===vo.Mutation&&t.registerMutation(e.timestamp),n===vo.Scroll&&t.registerScroll(e.timestamp),function(t){return t.data.source===vo.MouseInteraction}(e)){const{type:n,id:r}=e.data,i=oa.mirror.getNode(r);i instanceof HTMLElement&&n===bo.Click&&t.registerClick(i)}}catch(t){}}function ba(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var ka;!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(ka||(ka={}));const wa=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Sa(t){const e={};for(const n in t)if(wa.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),e[r]=t[n]}return e}const Ta=t=>e=>{if(!t.isEnabled())return;const n=function(t){const{target:e,message:n}=function(t){const e="click"===t.name;let n,r=null;try{r=e?ha(t.event):da(t.event),n=E(r,{maxStringLength:200})||""}catch(t){n=""}return{target:r,message:n}}(t);return ba({category:`ui.${t.name}`,..._a(e,n)})}(e);if(!n)return;const r="click"===e.name,i=r?e.event:void 0;var s,o,a;!(r&&t.clickDetector&&i&&i.target)||i.altKey||i.metaKey||i.ctrlKey||i.shiftKey||(s=t.clickDetector,o=n,a=ha(e.event),s.handleClick(o,a)),ua(t,n)};function _a(t,e){const n=oa.mirror.getId(t),r=n&&oa.mirror.getNode(n),i=r&&oa.mirror.getMeta(r),s=i&&function(t){return t.type===ka.Element}(i)?i:null;return{message:e,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map((t=>t.type===ka.Text&&t.textContent)).filter(Boolean).map((t=>t.trim())).join(""),attributes:Sa(s.attributes)}}:{}}}function xa(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=function(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=t;if(!o||function(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable}(o)||!s)return null;const a=e||r||i,c=1===s.length;if(!a&&c)return null;const u=E(o,{maxStringLength:200})||"",l=_a(o,u);return ba({category:"ui.keyDown",message:u,data:{...l.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}(e);n&&ua(t,n)}const Ia={resource:function(t){const{entryType:e,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:u}=t;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${e}.${n}`,start:Ea(s),end:Ea(i),name:r,data:{size:u,statusCode:c,decodedBodySize:o,encodedBodySize:a}}},paint:function(t){const{duration:e,entryType:n,name:r,startTime:i}=t,s=Ea(i);return{type:n,name:r,start:s,end:s+e,data:void 0}},navigation:function(t){const{entryType:e,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:h,redirectCount:d,startTime:f,transferSize:p,type:m}=t;if(0===i)return null;return{type:`${e}.${m}`,start:Ea(f),end:Ea(s),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:h,domComplete:s,redirectCount:d}}}};function Ca(t){return Ia[t.entryType]?Ia[t.entryType](t):null}function Ea(t){return((ee||ts.performance.timeOrigin)+t)/1e3}function Ra(t){function e(e){t.performanceEntries.includes(e)||t.performanceEntries.push(e)}function n({entries:t}){t.forEach(e)}const r=[];return["navigation","paint","resource"].forEach((t=>{r.push(vi(t,n))})),r.push(gi((({metric:e})=>{t.replayPerformanceEntries.push(function(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,i=t.value,s=Ea(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?oa.mirror.getId(r):void 0}}}(e))}))),()=>{r.forEach((t=>t()))}}function $a(t,e){D.info(t),e&&Oa(t)}function Aa(t,e){D.info(t),e&&setTimeout((()=>{Oa(t)}),0)}function Oa(t){qe({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class Ma extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class Da{constructor(){this.events=[],this.ye=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const e=JSON.stringify(t).length;if(this.ye+=e,this.ye>ss)throw new Ma;this.events.push(t)}finish(){return new Promise((t=>{const e=this.events;this.clear(),t(JSON.stringify(e))}))}clear(){this.events=[],this.ye=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map((t=>t.timestamp)).sort()[0];return t?aa(t):null}}class La{constructor(t){this.ge=t,this.ve=0}ensureReady(){return this.be||(this.be=new Promise(((t,e)=>{this.ge.addEventListener("message",(({data:n})=>{n.success?t():e()}),{once:!0}),this.ge.addEventListener("error",(t=>{e(t)}),{once:!0})}))),this.be}destroy(){$a("[Replay] Destroying compression worker"),this.ge.terminate()}postMessage(t,e){const n=this.ke();return new Promise(((r,i)=>{const s=({data:e})=>{const o=e;if(o.method===t&&o.id===n){if(this.ge.removeEventListener("message",s),!o.success)return D.error("[Replay]",o.response),void i(new Error("Error in compression worker"));r(o.response)}};this.ge.addEventListener("message",s),this.ge.postMessage({id:n,method:t,arg:e})}))}ke(){return this.ve++}}class Na{constructor(t){this.ge=new La(t),this.we=null,this.ye=0,this.hasCheckout=!1}get hasEvents(){return!!this.we}get type(){return"worker"}ensureReady(){return this.ge.ensureReady()}destroy(){this.ge.destroy()}addEvent(t){const e=aa(t.timestamp);(!this.we||ess?Promise.reject(new Ma):this.Se(n)}finish(){return this.Te()}clear(){this.we=null,this.ye=0,this.hasCheckout=!1,this.ge.postMessage("clear").then(null,(t=>{D.warn('[Replay] Sending "clear" message to worker failed',t)}))}getEarliestTimestamp(){return this.we}Se(t){return this.ge.postMessage("addEvent",t)}async Te(){const t=await this.ge.postMessage("finish");return this.we=null,this.ye=0,t}}class Fa{constructor(t){this._e=new Da,this.xe=new Na(t),this.Ie=this._e,this.Ce=this.Ee()}get type(){return this.Ie.type}get hasEvents(){return this.Ie.hasEvents}get hasCheckout(){return this.Ie.hasCheckout}set hasCheckout(t){this.Ie.hasCheckout=t}destroy(){this._e.destroy(),this.xe.destroy()}clear(){return this.Ie.clear()}getEarliestTimestamp(){return this.Ie.getEarliestTimestamp()}addEvent(t){return this.Ie.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this.Ie.finish()}ensureWorkerIsLoaded(){return this.Ce}async Ee(){try{await this.xe.ensureReady()}catch(t){return void $a("[Replay] Failed to load the compression worker, falling back to simple buffer")}await this.Re()}async Re(){const{events:t,hasCheckout:e}=this._e,n=[];for(const e of t)n.push(this.xe.addEvent(e));this.xe.hasCheckout=e,this.Ie=this.xe;try{await Promise.all(n)}catch(t){D.warn("[Replay] Failed to add events when switching buffers.",t)}}}function ja({useCompression:t,workerUrl:e}){if(t&&window.Worker){const t=function(t){try{const e=t||function(){if("undefined"==typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const t=new Blob(['var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a>h]=l}else for(o=new n(i),a=0;a>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;ad&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<e))break;p+=m-(1<>=y;p>0;){var M=o[a].s;g[M]=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i>1)),o=0,f=function(t){s[o++]=t};for(i=0;is.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r{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});']);return URL.createObjectURL(t)}();return""}();if(!e)return;$a("[Replay] Using compression worker"+(t?` from ${t}`:""));const n=new Worker(e);return new Fa(n)}catch(t){$a("[Replay] Failed to create compression worker")}}(e);if(t)return t}return $a("[Replay] Using simple buffer"),new Da}function Pa(){try{return"sessionStorage"in ts&&!!ts.sessionStorage}catch(t){return!1}}function Ba(t){!function(){if(!Pa())return;try{ts.sessionStorage.removeItem(es)}catch(t){}}(),t.session=void 0}function Ua(t){return void 0!==t&&Math.random()t.getContext().initialTimestamp+t.getOptions().maxReplayDuration)||($a(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1))}function Qa(t){return!t.type}function Za(t){return"transaction"===t.type}function tc(t){return"feedback"===t.type}function ec(t){const e=function(){const t=Je();if(!t)return!1;const e=t.getTransport();if(!e)return!1;return e.send.__sentry__baseTransport__||!1}();return(n,r)=>{if(!t.isEnabled()||!Qa(n)&&!Za(n))return;const i=r&&r.statusCode;e&&(!i||i<200||i>=300)||(Za(n)?function(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}(t,n):function(t,e){const n=t.getContext();e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id);if("buffer"!==t.recordingMode||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();if("function"==typeof r&&!r(e))return;setTimeout((()=>{t.sendBufferedReplayOrFlush()}))}(t,n))}}function nc(t){return e=>{t.isEnabled()&&Qa(e)&&function(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0].value;if("string"!=typeof n)return;if(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i)){ua(t,ba({category:"replay.hydrate-error"}))}}(t,e)}}function rc(t,e=!1){const n=e?ec(t):void 0;return Object.assign(((e,r)=>{if(!t.isEnabled())return e;if(function(t){return"replay_event"===t.type}(e))return delete e.breadcrumbs,e;if(!Qa(e)&&!Za(e)&&!tc(e))return e;if(!t.checkAndHandleExpiredSession())return e;if(tc(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),function(t,e){t.triggerUserActivity(),t.addUpdate((()=>!e.timestamp||(t.throttledAddEvent({type:go.Custom,timestamp:1e3*e.timestamp,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1)))}(t,e),e;if(function(t,e){return!(t.type||!t.exception||!t.exception.values||!t.exception.values.length||!e.originalException||!e.originalException.__rrweb__)}(e,r)&&!t.getOptions()._experiments.captureExceptions)return D.log("[Replay] Ignoring error from rrweb internals",e),null;const i=function(t,e){return"buffer"===t.recordingMode&&e.message!==ns&&!(!e.exception||e.type)&&Ua(t.getOptions().errorSampleRate)}(t,e);return(i||"session"===t.recordingMode)&&(e.tags={...e.tags,replayId:t.getSessionId()}),n&&n(e,{statusCode:200}),e}),{id:"Replay"})}function ic(t,e){return e.map((({type:e,start:n,end:r,name:i,data:s})=>{const o=t.throttledAddEvent({type:go.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:e,description:i,startTimestamp:n,endTimestamp:r,data:s}}});return"string"==typeof o?Promise.resolve(null):o}))}function sc(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}(e);null!==n&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate((()=>(ic(t,[n]),!1))))}}function oc(t,e){t.isEnabled()&&null!==e&&(function(t,e){return!t.getOptions()._experiments.traceInternals&&kr(e,Je())}(t,e.name)||t.addUpdate((()=>(ic(t,[e]),!0))))}function ac(t,e){if(t)try{if("string"==typeof t)return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=mc(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch(t){}}function cc(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function uc(t){try{if("string"==typeof t)return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[mc(t)];if(!t)return[void 0]}catch(e){return D.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return D.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function lc(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function hc(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:a,response:c}=e;return{type:t,start:n/1e3,end:r/1e3,name:i,data:J({method:s,statusCode:o,request:a,response:c})}}function dc(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function fc(t,e,n){if(!e&&0===Object.keys(t).length)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:i,warnings:s}=function(t){if(!t||"string"!=typeof t)return{body:t};const e=t.length>rs,n=function(t){const e=t[0],n=t[t.length-1];return"["===e&&"]"===n||"{"===e&&"}"===n}(t);if(e){const e=t.slice(0,rs);return n?{body:e,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${e}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch(t){}return{body:t}}(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function pc(t,e){return Object.keys(t).reduce(((n,r)=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=t[r]),n}),{})}function mc(t){return new URLSearchParams(t).toString()}function yc(t,e){const n=function(t,e=ts.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(ts.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;if(!t.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(t);return v(n,e)}async function gc(t,e,n){try{const r=await async function(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=e,{url:o,method:a,status_code:c=0,request_body_size:u,response_body_size:l}=t.data,h=yc(o,n.networkDetailAllowUrls)&&!yc(o,n.networkDetailDenyUrls),d=h?function({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const i=n?function(t,e){if(1===t.length&&"string"!=typeof t[0])return kc(t[0],e);if(2===t.length)return kc(t[1],e);return{}}(n,e):{};if(!t)return fc(i,r,void 0);const s=vc(n),[o,a]=uc(s),c=fc(i,r,o);if(a)return lc(c,a);return c}(n,e.input,u):dc(u),f=await async function(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},i,s){if(!t&&void 0!==s)return dc(s);const o=i?bc(i.headers,r):{};if(!i||!e&&void 0!==s)return fc(o,s,void 0);const[a,c]=await async function(t){const e=function(t){try{return t.clone()}catch(t){D.warn("[Replay] Failed to clone response body",t)}}(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{const t=await function(t){return new Promise(((e,n)=>{const r=setTimeout((()=>n(new Error("Timeout while trying to read response body"))),500);(async function(t){return await t.text()})(t).then((t=>e(t)),(t=>n(t))).finally((()=>clearTimeout(r)))}))}(e);return[t]}catch(t){return D.warn("[Replay] Failed to get text body from response",t),[void 0,"BODY_PARSE_ERROR"]}}(i),u=function(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:i,headers:s}){try{const o=t&&t.length&&void 0===r?ac(t,n):r;return i?fc(s,o,e?t:void 0):dc(o)}catch(t){return D.warn("[Replay] Failed to serialize response body",t),fc(s,r,void 0)}}(a,{networkCaptureBodies:e,textEncoder:n,responseBodySize:s,captureDetails:t,headers:o});if(c)return lc(u,c);return u}(h,n,e.response,l);return{startTimestamp:i,endTimestamp:s,url:o,method:a,statusCode:c,request:d,response:f}}(t,e,n),i=hc("resource.fetch",r);oc(n.replay,i)}catch(t){D.error("[Replay] Failed to capture fetch breadcrumb",t)}}function vc(t=[]){if(2===t.length&&"object"==typeof t[1])return t[1].body}function bc(t,e){const n={};return e.forEach((e=>{t.get(e)&&(n[e]=t.get(e))})),n}function kc(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?bc(n,e):Array.isArray(n)?{}:pc(n,e):{}}async function wc(t,e,n){try{const r=function(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:a}=e,{url:c,method:u,status_code:l=0,request_body_size:h,response_body_size:d}=t.data;if(!c)return null;if(!a||!yc(c,n.networkDetailAllowUrls)||yc(c,n.networkDetailDenyUrls)){return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:dc(h),response:dc(d)}}const f=a.__sentry_xhr_v3__,p=f?pc(f.request_headers,n.networkRequestHeaders):{},m=pc(function(t){const e=t.getAllResponseHeaders();if(!e)return{};return e.split("\r\n").reduce(((t,e)=>{const[n,r]=e.split(": ");return t[n.toLowerCase()]=r,t}),{})}(a),n.networkResponseHeaders),[y,g]=n.networkCaptureBodies?uc(o):[void 0],[v,b]=n.networkCaptureBodies?function(t){const e=[];try{return[t.responseText]}catch(t){e.push(t)}try{return function(t,e){try{if("string"==typeof t)return[t];if(t instanceof Document)return[t.body.outerHTML];if("json"===e&&t&&"object"==typeof t)return[JSON.stringify(t)];if(!t)return[void 0]}catch(e){return D.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return D.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}(t.response,t.responseType)}catch(t){e.push(t)}return D.warn("[Replay] Failed to get xhr response body",...e),[void 0]}(a):[void 0],k=fc(p,h,y),w=fc(m,d,v);return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:g?lc(k,g):k,response:b?lc(w,b):w}}(t,e,n),i=hc("resource.xhr",r);oc(n.replay,i)}catch(t){D.error("[Replay] Failed to capture xhr breadcrumb",t)}}function Sc(t,e,n){const{xhr:r,input:i}=e;if(!r)return;const s=ac(i,n.textEncoder),o=r.getResponseHeader("content-length")?cc(r.getResponseHeader("content-length")):function(t,e,n){try{return ac("json"===e&&t&&"object"==typeof t?JSON.stringify(t):t,n)}catch(t){return}}(r.response,r.responseType,n.textEncoder);void 0!==s&&(t.data.request_body_size=s),void 0!==o&&(t.data.response_body_size=o)}function Tc(t){const e=Je();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a}=t.getOptions(),c={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a};e&&e.on?e.on("beforeAddBreadcrumb",((t,e)=>function(t,e,n){if(!e.data)return;try{(function(t){return"xhr"===t.category})(e)&&function(t){return t&&t.xhr}(n)&&(Sc(e,n,t),wc(e,n,t)),function(t){return"fetch"===t.category}(e)&&function(t){return t&&t.response}(n)&&(!function(t,e,n){const{input:r,response:i}=e,s=ac(r?vc(r):void 0,n.textEncoder),o=i?cc(i.headers.get("content-length")):void 0;void 0!==s&&(t.data.request_body_size=s),void 0!==o&&(t.data.response_body_size=o)}(e,n,t),gc(e,n,t))}catch(t){D.warn("Error when enriching network breadcrumb")}}(c,t,e))):(Tt(function(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:i}=t;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}(e);oc(t,n)}}(t)),Pt(function(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,i=r.__sentry_xhr_v3__;if(!e||!n||!i)return null;const{method:s,url:o,status_code:a}=i;return void 0===o?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:s,statusCode:a}}}(e);oc(t,n)}}(t)))}catch(t){}}let _c=null;const xc=t=>e=>{if(!t.isEnabled())return;const n=function(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();if(_c===e||!e)return null;if(_c=e,!function(t){return!!t.category}(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))return null;if("console"===e.category)return function(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||0===e.length)return ba(t);let n=!1;const r=e.map((t=>{if(!t)return t;if("string"==typeof t)return t.length>is?(n=!0,`${t.slice(0,is)}…`):t;if("object"==typeof t)try{const e=zt(t,7);return JSON.stringify(e).length>is?(n=!0,`${JSON.stringify(e,null,2).slice(0,is)}…`):e}catch(t){}return t}));return ba({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e);return ba(e)}(e);n&&ua(t,n)};function Ic(t){return!(!t||!t.on)}function Cc(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Ec(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession())return void D.warn("[Replay] Received replay event after session expired.");const i=r||!e;e=!0,t.clickDetector&&va(t.clickDetector,n),t.addUpdate((()=>{if("buffer"===t.recordingMode&&i&&t.setInitialState(),!Xa(t,n,i))return!0;if(!i)return!1;if(function(t,e){if(!e||!t.session||0!==t.session.segmentId)return;Xa(t,function(t){const e=t.getOptions();return{type:go.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:!!t.eventBuffer&&"worker"===t.eventBuffer.type,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}(t),!1)}(t,i),t.session&&t.session.previousSessionId)return!0;if("buffer"===t.recordingMode&&t.session&&t.eventBuffer){const e=t.eventBuffer.getEarliestTimestamp();e&&($a(`[Replay] Updating session start time to earliest event in buffer to ${new Date(e)}`,t.getOptions()._experiments.traceInternals),t.session.started=e,t.getOptions().stickySession&&Ha(t.session))}return"session"===t.recordingMode&&t.flush(),!0}))}}async function Rc({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:i,session:s}){const o=function({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}\n`;if("string"==typeof t)n=`${r}${t}`;else{const e=(new TextEncoder).encode(r);n=new Uint8Array(e.length+t.length),n.set(e),n.set(t,e.length)}return n}({recordingData:t,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:l}=r,h=Je(),d=Ge(),f=h&&h.getTransport(),p=h&&h.getDsn();if(!(h&&f&&p&&s.sampled))return;const m={type:"replay_event",replay_start_timestamp:l/1e3,timestamp:i/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:e,segment_id:n,replay_type:s.sampled},y=await async function({client:t,scope:e,replayId:n,event:r}){const i={event_id:n,integrations:"object"!=typeof t._integrations||null===t._integrations||Array.isArray(t._integrations)?void 0:Object.keys(t._integrations)};t.emit&&t.emit("preprocessEvent",r,i);const s=await Pe(t.getOptions(),r,i,e,t,yn());if(!s)return null;s.platform=s.platform||"javascript";const o=t.getSdkMetadata&&t.getSdkMetadata(),{name:a,version:c}=o&&o.sdk||{};return s.sdk={...s.sdk,name:a||"sentry.javascript.unknown",version:c||"0.0.0"},s}({scope:d,client:h,replayId:e,event:m});if(!y)return h.recordDroppedEvent("event_processor","replay",m),void $a("An event processor returned `null`, will not send event.");delete y.sdkProcessingMetadata;const g=function(t,e,n,r){return he(ke(t,be(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:"string"==typeof e?(new TextEncoder).encode(e).length:e.length},e]])}(y,o,p,h.getOptions().tunnel);let v;try{v=await f.send(g)}catch(t){const e=new Error(ns);try{e.cause=t}catch(t){}throw e}if(!v)return v;if("number"==typeof v.statusCode&&(v.statusCode<200||v.statusCode>=300))throw new $c(v.statusCode);const b=Se({},v);if(we(b,"replay"))throw new Ac(b);return v}class $c extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Ac extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function Oc(t,e={count:0,interval:5e3}){const{recordingData:n,options:r}=t;if(n.length)try{return await Rc(t),!0}catch(n){if(n instanceof $c||n instanceof Ac)throw n;if(We("Replays",{$e:e.count}),r._experiments&&r._experiments.captureExceptions&&captureException(n),e.count>=3){const t=new Error("Unable to send Replay - max retries exceeded");try{t.cause=n}catch(t){}throw t}return e.interval*=++e.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await Oc(t,e),n(!0)}catch(t){r(t)}}),e.interval)}))}}const Mc="__THROTTLED";function Dc(t,e,n){const r=new Map;let i=!1;return(...s)=>{const o=Math.floor(Date.now()/1e3);if((t=>{const e=t-n;r.forEach(((t,n)=>{nt+e),0)>=e){const t=i;return i=!0,t?"__SKIPPED":Mc}i=!1;const a=r.get(o)||0;return r.set(o,a+1),t(...s)}}class Lc{constructor({options:t,recordingOptions:e}){Lc.prototype.__init.call(this),Lc.prototype.__init2.call(this),Lc.prototype.__init3.call(this),Lc.prototype.__init4.call(this),Lc.prototype.__init5.call(this),Lc.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this.Ae=Date.now(),this.Oe=!1,this.Me=!1,this.De=!1,this.Le={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this.Ne=e,this.Fe=t,this.je=function(t,e,n){let r,i,s;const o=n&&n.maxWait?Math.max(n.maxWait,e):0;function a(){return c(),r=t(),r}function c(){void 0!==i&&clearTimeout(i),void 0!==s&&clearTimeout(s),i=s=void 0}function u(){return i&&clearTimeout(i),i=setTimeout(a,e),o&&void 0===s&&(s=setTimeout(a,o)),r}return u.cancel=c,u.flush=function(){return void 0!==i||void 0!==s?a():r},u}((()=>this.Pe()),this.Fe.flushMinDelay,{maxWait:this.Fe.flushMaxDelay}),this.Be=Dc(((t,e)=>function(t,e,n){return Va(t,e)?Ya(t,e,n):Promise.resolve(null)}(this,t,e)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;i&&(this.clickDetector=new ma(this,i))}getContext(){return this.Le}isEnabled(){return this.Oe}isPaused(){return this.Me}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this.Fe}initializeSampling(t){const{errorSampleRate:e,sessionSampleRate:n}=this.Fe;e<=0&&n<=0||(this.Ue(t),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",Aa(`[Replay] Starting replay in ${this.recordingMode} mode`,this.Fe._experiments.traceInternals),this.ze()):this.He(new Error("Unable to initialize and create session")))}start(){if(this.Oe&&"session"===this.recordingMode)throw new Error("Replay recording is already in progress");if(this.Oe&&"buffer"===this.recordingMode)throw new Error("Replay buffering is in progress, call `flush()` to save the replay");Aa("[Replay] Starting replay in session mode",this.Fe._experiments.traceInternals),this.qe();const t=Ga({maxReplayDuration:this.Fe.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this.Fe._experiments.traceInternals},{stickySession:this.Fe.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.ze()}startBuffering(){if(this.Oe)throw new Error("Replay recording is already in progress");Aa("[Replay] Starting replay in buffer mode",this.Fe._experiments.traceInternals);const t=Ga({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this.Fe.maxReplayDuration,traceInternals:this.Fe._experiments.traceInternals},{stickySession:this.Fe.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this.ze()}startRecording(){try{const t=this._canvas;this.We=oa({...this.Ne,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:Ec(this),onMutation:this.Ke,...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.He(t)}}stopRecording(){try{return this.We&&(this.We(),this.We=void 0),!0}catch(t){return this.He(t),!1}}async stop({forceFlush:t=!1,reason:e}={}){if(this.Oe){this.Oe=!1;try{$a("[Replay] Stopping Replay"+(e?` triggered by ${e}`:""),this.Fe._experiments.traceInternals),this.Je(),this.stopRecording(),this.je.cancel(),t&&await this.Pe({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,Ba(this)}catch(t){this.He(t)}}}pause(){this.Me||(this.Me=!0,this.stopRecording(),$a("[Replay] Pausing replay",this.Fe._experiments.traceInternals))}resume(){this.Me&&this.Ge()&&(this.Me=!1,this.startRecording(),$a("[Replay] Resuming replay",this.Fe._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const e=Date.now();$a("[Replay] Converting buffer to session",this.Fe._experiments.traceInternals),await this.flushImmediate();const n=this.stopRecording();t&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this.qe(e),this.Xe(e),this.Ye()),this.startRecording())}addUpdate(t){const e=t();"buffer"!==this.recordingMode&&!0!==e&&this.je()}triggerUserActivity(){if(this.qe(),this.We)this.checkAndHandleExpiredSession(),this.Xe();else{if(!this.Ge())return;this.resume()}}updateUserActivity(){this.qe(),this.Xe()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this.je()}flushImmediate(){return this.je(),this.je.flush()}cancelFlush(){this.je.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(!(this.Ae&&Wa(this.Ae,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this.Ge();this.pause()}setInitialState(){const t=`${ts.location.pathname}${ts.location.hash}${ts.location.search}`,e=`${ts.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this.Ve(),this.Le.initialUrl=e,this.Le.initialTimestamp=Date.now(),this.Le.urls.push(e)}throttledAddEvent(t,e){const n=this.Be(t,e);if(n===Mc){const t=ba({category:"replay.throttled"});this.addUpdate((()=>!Xa(this,{type:5,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t,metric:!0}})))}return n}getCurrentRoute(){const t=this.lastTransaction||Ge().getTransaction(),e=(t&&Fe(t).data||{})["sentry.source"];if(t&&e&&["route","custom"].includes(e))return Fe(t).description}ze(){this.setInitialState(),this.Xe(),this.eventBuffer=ja({useCompression:this.Fe.useCompression,workerUrl:this.Fe.workerUrl}),this.Je(),this.Qe(),this.Oe=!0,this.Me=!1,this.startRecording()}He(t){D.error("[Replay]",t),this.Fe._experiments&&this.Fe._experiments.captureExceptions&&captureException(t)}Ue(t){const e=this.Fe.errorSampleRate>0,n=Ga({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this.Fe.maxReplayDuration,traceInternals:this.Fe._experiments.traceInternals,previousSessionId:t},{stickySession:this.Fe.stickySession,sessionSampleRate:this.Fe.sessionSampleRate,allowBuffering:e});this.session=n}Ge(){if(!this.session)return!1;const t=this.session;return!Ja(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this.Fe.maxReplayDuration})||(this.Ze(t),!1)}async Ze(t){this.Oe&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}Qe(){try{ts.document.addEventListener("visibilitychange",this.tn),ts.addEventListener("blur",this.en),ts.addEventListener("focus",this.nn),ts.addEventListener("keydown",this.rn),this.clickDetector&&this.clickDetector.addListeners(),this.De||(!function(t){const e=Ge(),n=Je();e.addScopeListener(xc(t)),gt(Ta(t)),Nt(sc(t)),Tc(t);const r=rc(t,!Ic(n));n&&n.addEventProcessor?n.addEventProcessor(r):pr(r),Ic(n)&&(n.on("beforeSendEvent",nc(t)),n.on("afterSendEvent",ec(t)),n.on("createDsc",(e=>{const n=t.getSessionId();n&&t.isEnabled()&&"session"===t.recordingMode&&t.checkAndHandleExpiredSession()&&(e.replay_id=n)})),n.on("startTransaction",(e=>{t.lastTransaction=e})),n.on("finishTransaction",(e=>{t.lastTransaction=e})),n.on("beforeSendFeedback",((e,n)=>{const r=t.getSessionId();n&&n.includeReplay&&t.isEnabled()&&r&&e.contexts&&e.contexts.feedback&&(e.contexts.feedback.replay_id=r)})))}(this),this.De=!0)}catch(t){this.He(t)}this.sn=Ra(this)}Je(){try{ts.document.removeEventListener("visibilitychange",this.tn),ts.removeEventListener("blur",this.en),ts.removeEventListener("focus",this.nn),ts.removeEventListener("keydown",this.rn),this.clickDetector&&this.clickDetector.removeListeners(),this.sn&&this.sn()}catch(t){this.He(t)}}__init(){this.tn=()=>{"visible"===ts.document.visibilityState?this.an():this.cn()}}__init2(){this.en=()=>{const t=ba({category:"ui.blur"});this.cn(t)}}__init3(){this.nn=()=>{const t=ba({category:"ui.focus"});this.an(t)}}__init4(){this.rn=t=>{xa(this,t)}}cn(t){if(!this.session)return;Ka(this.session,{maxReplayDuration:this.Fe.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this.un(t),this.conditionalFlush())}an(t){if(!this.session)return;this.checkAndHandleExpiredSession()?t&&this.un(t):$a("[Replay] Document has become active, but session has expired")}qe(t=Date.now()){this.Ae=t}Xe(t=Date.now()){this.session&&(this.session.lastActivity=t,this.Ye())}un(t){this.addUpdate((()=>{this.throttledAddEvent({type:go.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})}))}ln(){const t=(e=this.performanceEntries,e.map(Ca).filter(Boolean)).concat(this.replayPerformanceEntries);var e;return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(ic(this,t))}Ve(){this.Le.errorIds.clear(),this.Le.traceIds.clear(),this.Le.urls=[]}hn(){const{session:t,eventBuffer:e}=this;if(!t||!e)return;if(t.segmentId)return;const n=e.getEarliestTimestamp();n&&nthis.Fe.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this.dn(),r=this.session.segmentId++;this.Ye();const i=await this.eventBuffer.finish();await Oc({replayId:t,recordingData:i,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:e})}catch(t){this.He(t),this.stop({reason:"sendReplay"});const e=Je();e&&e.recordDroppedEvent("send_error","replay")}}else D.error("[Replay] No session or eventBuffer found to flush.")}__init5(){this.Pe=async({force:t=!1}={})=>{if(!this.Oe&&!t)return;if(!this.checkAndHandleExpiredSession())return void D.error("[Replay] Attempting to finish replay event after session expired.");if(!this.session)return;const e=this.session.started,n=Date.now()-e;this.je.cancel();const r=nthis.Fe.maxReplayDuration+5e3;if(r||i)return $a(`[Replay] Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`,this.Fe._experiments.traceInternals),void(r&&this.je());const s=this.eventBuffer;if(s&&0===this.session.segmentId&&!s.hasCheckout&&$a("[Replay] Flushing initial segment without checkout.",this.Fe._experiments.traceInternals),!this.pn)return this.pn=this.fn(),await this.pn,void(this.pn=void 0);try{await this.pn}catch(t){D.error(t)}finally{this.je()}}}Ye(){this.session&&this.Fe.stickySession&&Ha(this.session)}__init6(){this.Ke=t=>{const e=t.length,n=this.Fe.mutationLimit,r=n&&e>n;if(e>this.Fe.mutationBreadcrumbLimit||r){const t=ba({category:"replay.mutations",data:{count:e,limit:r}});this.un(t)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function Nc(t,e,n,r){const i=[...t,..."string"==typeof r?r.split(","):[],...e];return void 0!==n&&("string"==typeof n&&i.push(`.${n}`),M((()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")}))),i.join(",")}const Fc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',jc=["content-length","content-type","accept"];let Pc=!1;class Bc{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=5e3,flushMaxDelay:e=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:i=!0,useCompression:s=!0,workerUrl:o,_experiments:a={},sessionSampleRate:c,errorSampleRate:u,maskAllText:l=!0,maskAllInputs:h=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:v=[],networkCaptureBodies:b=!0,networkRequestHeaders:k=[],networkResponseHeaders:w=[],mask:S=[],maskAttributes:T=["title","placeholder"],unmask:_=[],block:x=[],unblock:I=[],ignore:C=[],maskFn:E,beforeAddRecordingEvent:R,beforeErrorSampling:$,blockClass:A,blockSelector:O,maskInputOptions:M,maskTextClass:D,maskTextSelector:L,ignoreClass:N}={}){this.name=Bc.id;const F=function({mask:t,unmask:e,block:n,unblock:r,ignore:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,ignoreClass:u}){const l={maskTextSelector:Nc(t,[".sentry-mask","[data-sentry-mask]"],a,c),unmaskTextSelector:Nc(e,[".sentry-unmask","[data-sentry-unmask]"]),blockSelector:Nc(n,[".sentry-block","[data-sentry-block]",'base[href="/"]'],s,o),unblockSelector:Nc(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Nc(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],u)};return s instanceof RegExp&&(l.blockClass=s),a instanceof RegExp&&(l.maskTextClass=a),l}({mask:S,unmask:_,block:x,unblock:I,ignore:C,blockClass:A,blockSelector:O,maskTextClass:D,maskTextSelector:L,ignoreClass:N});if(this.Ne={maskAllInputs:h,maskAllText:l,maskInputOptions:{...M||{},password:!0},maskTextFn:E,maskInputFn:E,maskAttributeFn:(t,e,n)=>function({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return r?i.unmaskTextSelector&&t.matches(i.unmaskTextSelector)?s:n.includes(e)||"value"===e&&"INPUT"===t.tagName&&["submit","button"].includes(t.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s:s}({maskAttributes:T,maskAllText:l,privacyOptions:F,key:t,value:e,el:n}),...F,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:t=>{try{t.__rrweb__=!0}catch(t){}}},this.mn={flushMinDelay:t,flushMaxDelay:e,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,os),stickySession:i,sessionSampleRate:c,errorSampleRate:u,useCompression:s,workerUrl:o,blockAllMedia:d,maskAllInputs:h,maskAllText:l,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:m,slowClickIgnoreSelectors:y,networkDetailAllowUrls:g,networkDetailDenyUrls:v,networkCaptureBodies:b,networkRequestHeaders:Uc(k),networkResponseHeaders:Uc(w),beforeAddRecordingEvent:R,beforeErrorSampling:$,_experiments:a},"number"==typeof c&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${c} })`),this.mn.sessionSampleRate=c),"number"==typeof u&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${u} })`),this.mn.errorSampleRate=u),this.mn.blockAllMedia&&(this.Ne.blockSelector=this.Ne.blockSelector?`${this.Ne.blockSelector},${Fc}`:Fc),this.yn&&Ut())throw new Error("Multiple Sentry Session Replay instances are not supported");this.yn=!0}get yn(){return Pc}set yn(t){Pc=t}setupOnce(){Ut()&&(this.gn(),setTimeout((()=>this.vn())))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(t){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}vn(){this._replay&&(this.bn(),this._replay.initializeSampling())}gn(){const t=function(t){const e=Je(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...J(t)};if(!n)return M((()=>{console.warn("SDK client is not available.")})),r;null==t.sessionSampleRate&&null==t.errorSampleRate&&null==n.replaysSessionSampleRate&&null==n.replaysOnErrorSampleRate&&M((()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}));"number"==typeof n.replaysSessionSampleRate&&(r.sessionSampleRate=n.replaysSessionSampleRate);"number"==typeof n.replaysOnErrorSampleRate&&(r.errorSampleRate=n.replaysOnErrorSampleRate);return r}(this.mn);this._replay=new Lc({options:t,recordingOptions:this.Ne})}bn(){try{const t=Je().getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch(t){}}}function Uc(t){return[...jc,...t.map((t=>t.toLowerCase()))]}Bc.__initStatic();const zc=_;let Hc=0;function qc(){return Hc>0}function Wc(){Hc++,setTimeout((()=>{Hc--}))}function Kc(t,e={},n){if("function"!=typeof t)return t;try{const e=t.__sentry_wrapped__;if(e)return e;if(H(t))return t}catch(e){return t}const sentryWrapped=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map((t=>Kc(t,e)));return t.apply(this,i)}catch(t){throw Wc(),Ke((n=>{n.addEventProcessor((t=>(e.mechanism&&(ut(t,void 0,void 0),lt(t,e.mechanism)),t.extra={...t.extra,arguments:r},t))),captureException(t)})),t}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(sentryWrapped[e]=t[e])}catch(t){}z(sentryWrapped,t),U(t,"__sentry_wrapped__",sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>t.name})}catch(t){}return sentryWrapped}function Jc(t,e){const n=Xc(t,e),r={type:e&&e.name,value:Vc(e)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Gc(t,e){return{exception:{values:[Jc(t,e)]}}}function Xc(t,e){const n=e.stacktrace||e.stack||"",r=function(t){if(t){if("number"==typeof t.framesToPop)return t.framesToPop;if(Yc.test(t.message))return 1}return 0}(e);try{return t(n,r)}catch(t){}return[]}const Yc=/Minified React error #\d+;/i;function Vc(t){const e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function Qc(t,e,n,r){const i=tu(t,e,n&&n.syntheticException||void 0,r);return lt(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Kt(i)}function Zc(t,e,n="info",r,i){const s=eu(t,e,r&&r.syntheticException||void 0,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),Kt(s)}function tu(t,e,o,a,c){let h;if(i(e)&&e.error){return Gc(t,e.error)}if(s(e)||r(e,"DOMException")){const n=e;if("stack"in e)h=Gc(t,e);else{const e=n.name||(s(n)?"DOMError":"DOMException"),r=n.message?`${e}: ${n.message}`:e;h=eu(t,r,o,a),ut(h,r)}return"code"in n&&(h.tags={...h.tags,"DOMException.code":`${n.code}`}),h}if(n(e))return Gc(t,e);if(u(e)||l(e)){return h=function(t,e,n,r){const i=Je(),s=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:l(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:nu(e,{isUnhandledRejection:r})}]},extra:{__serialized__:Ht(e,s)}};if(n){const e=Xc(t,n);e.length&&(o.exception.values[0].stacktrace={frames:e})}return o}(t,e,o,c),lt(h,{synthetic:!0}),h}return h=eu(t,e,o,a),ut(h,`${e}`,void 0),lt(h,{synthetic:!0}),h}function eu(t,e,n,r){const i={};if(r&&n){const r=Xc(t,n);r.length&&(i.exception={values:[{value:e,stacktrace:{frames:r}}]})}if(a(e)){const{__sentry_template_string__:t,__sentry_template_values__:n}=e;return i.logentry={message:t,params:n},i}return i.message=e,i}function nu(t,{isUnhandledRejection:e}){const n=function(t,e=40){const n=Object.keys(q(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return m(n[0],e);for(let t=n.length;t>0;t--){const r=n.slice(0,t).join(", ");if(!(r.length>e))return t===n.length?r:m(r,e)}return""}(t),r=e?"promise rejection":"exception";if(i(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if(l(t)){return`Event \`${function(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}function ru(t,{metadata:e,tunnel:n,dsn:r}){const i={event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:N(r)}},s=function(t){return[{type:"user_report"},t]}(t);return he(i,[s])}class iu extends class{constructor(t){if(this.Fe=t,this._integrations={},this.kn=!1,this.wn=0,this.Sn={},this.Tn={},this.T=[],t.dsn?this._n=j(t.dsn):D.warn("No DSN provided, client will not send events."),this._n){const e=er(this._n,t);this.xn=t.transport({tunnel:this.Fe.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}}captureException(t,e,n){if(ht(t))return void D.log(hr);let r=e&&e.event_id;return this.In(this.eventFromException(t,e).then((t=>this.Cn(t,e,n))).then((t=>{r=t}))),r}captureMessage(t,e,n,r){let i=n&&n.event_id;const s=a(t)?t:String(t),o=c(t)?this.eventFromMessage(s,e,n):this.eventFromException(t,n);return this.In(o.then((t=>this.Cn(t,n,r))).then((t=>{i=t}))),i}captureEvent(t,e,n){if(e&&e.originalException&&ht(e.originalException))return void D.log(hr);let r=e&&e.event_id;const i=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this.In(this.Cn(t,e,i||n).then((t=>{r=t}))),r}captureSession(t){"string"!=typeof t.release?D.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),Ae(t,{init:!1}))}getDsn(){return this._n}getOptions(){return this.Fe}getSdkMetadata(){return this.Fe.yt}getTransport(){return this.xn}flush(t){const e=this.xn;return e?(this.metricsAggregator&&this.metricsAggregator.flush(),this.En(t).then((n=>e.flush(t).then((t=>n&&t))))):Kt(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),t)))}getEventProcessors(){return this.T}addEventProcessor(t){this.T.push(t)}setupIntegrations(t){(t&&!this.kn||this.Oe()&&!this.kn)&&this.Rn()}init(){this.Oe()&&this.Rn()}getIntegrationById(t){return this.getIntegrationByName(t)}getIntegrationByName(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch(e){return D.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){const e=this._integrations[t.name];sr(this,t,this._integrations),e||ir(this,[t])}sendEvent(t,e={}){this.emit("beforeSendEvent",t,e);let n=function(t,e,n,r){const i=be(n),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]])}(t,n&&n.sdk);const o=ke(t,i,r,e);return delete t.sdkProcessingMetadata,he(o,[[{type:s},t]])}(t,this._n,this.Fe.yt,this.Fe.tunnel);for(const t of e.attachments||[])n=de(n,ye(t,this.Fe.transportOptions&&this.Fe.transportOptions.textEncoder));const r=this.$n(n);r&&r.then((e=>this.emit("afterSendEvent",t,e)),null)}sendSession(t){const e=function(t,e,n,r){const i=be(n);return he({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:N(e)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this._n,this.Fe.yt,this.Fe.tunnel);this.$n(e)}recordDroppedEvent(t,e,n){if(this.Fe.sendClientReports){const n=`${t}:${e}`;D.log(`Adding outcome: "${n}"`),this.Sn[n]=this.Sn[n]+1||1}}captureAggregateMetrics(t){D.log(`Flushing aggregated metrics, number of metrics: ${t.length}`);const e=lr(t,this._n,this.Fe.yt,this.Fe.tunnel);this.$n(e)}on(t,e){this.Tn[t]||(this.Tn[t]=[]),this.Tn[t].push(e)}emit(t,...e){this.Tn[t]&&this.Tn[t].forEach((t=>t(...e)))}Rn(){const{integrations:t}=this.Fe;this._integrations=function(t,e){const n={};return e.forEach((e=>{e&&sr(t,e,n)})),n}(this,t),ir(this,t),this.kn=!0}An(t,e){let n=!1,r=!1;const i=e.exception&&e.exception.values;if(i){r=!0;for(const t of i){const e=t.mechanism;if(e&&!1===e.handled){n=!0;break}}}const s="ok"===t.status;(s&&0===t.errors||s&&n)&&(Ae(t,{...n&&{status:"crashed"},errors:t.errors||Number(r||n)}),this.captureSession(t))}En(t){return new Gt((e=>{let n=0;const r=setInterval((()=>{0==this.wn?(clearInterval(r),e(!0)):(n+=1,t&&n>=t&&(clearInterval(r),e(!1)))}),1)}))}Oe(){return!1!==this.getOptions().enabled&&void 0!==this.xn}On(t,e,n,r=yn()){const i=this.getOptions(),s=Object.keys(this._integrations);return!e.integrations&&s.length>0&&(e.integrations=s),this.emit("preprocessEvent",t,e),Pe(i,t,e,n,this,r).then((t=>{if(null===t)return t;const e={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(t.contexts&&t.contexts.trace)&&e){const{traceId:r,spanId:i,parentSpanId:s,dsc:o}=e;t.contexts={trace:{trace_id:r,span_id:i,parent_span_id:s},...t.contexts};const a=o||tn(r,this,n);t.sdkProcessingMetadata={dynamicSamplingContext:a,...t.sdkProcessingMetadata}}return t}))}Cn(t,e={},n){return this.Mn(t,e,n).then((t=>t.event_id),(t=>{{const e=t;"log"===e.logLevel?D.log(e.message):D.warn(e)}}))}Mn(t,e,n){const r=this.getOptions(),{sampleRate:i}=r,s=fr(t),o=dr(t),a=t.type||"error",c=`before send for type \`${a}\``;if(o&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",t),Jt(new P(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const l="replay_event"===a?"replay":a,d=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this.On(t,e,n,d).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",l,t),new P("An event processor returned `null`, will not send event.","log");if(e.data&&!0===e.data.__sentry__)return n;const i=function(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;if(dr(e)&&r)return r(e,n);if(fr(e)&&i)return i(e,n);return e}(r,n,e);return function(t,e){const n=`${e} must return \`null\` or a valid event.`;if(h(t))return t.then((t=>{if(!u(t)&&null!==t)throw new P(n);return t}),(t=>{throw new P(`${e} rejected with ${t}`)}));if(!u(t)&&null!==t)throw new P(n);return t}(i,c)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",l,t),new P(`${c} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!s&&i&&this.An(i,r);const o=r.transaction_info;if(s&&o&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...o,source:t}}return this.sendEvent(r,e),r})).then(null,(t=>{if(t instanceof P)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new P(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}In(t){this.wn++,t.then((t=>(this.wn--,t)),(t=>(this.wn--,t)))}$n(t){if(this.emit("beforeEnvelope",t),this.Oe()&&this.xn)return this.xn.send(t).then(null,(t=>{D.error("Error while sending event:",t)}));D.error("Transport disabled")}Dn(){const t=this.Sn;return this.Sn={},Object.keys(t).map((e=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t[e]}}))}}{constructor(t){!function(t,e,n=[e],r="npm"){const i=t.yt||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map((t=>({name:`${r}:@sentry/${t}`,version:un}))),version:un}),t.yt=i}(t,"browser",["browser"],zc.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&zc.document&&zc.document.addEventListener("visibilitychange",(()=>{"hidden"===zc.document.visibilityState&&this.Ln()}))}eventFromException(t,e){return Qc(this.Fe.stackParser,t,e,this.Fe.attachStacktrace)}eventFromMessage(t,e="info",n){return Zc(this.Fe.stackParser,t,e,n,this.Fe.attachStacktrace)}captureUserFeedback(t){if(!this.Oe())return void D.warn("SDK not enabled, will not capture user feedback.");const e=ru(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.$n(e)}On(t,e,n){return t.platform=t.platform||"javascript",super.On(t,e,n)}Ln(){const t=this.Dn();if(0===t.length)return void D.log("No outcomes to send");if(!this._n)return void D.log("No dsn provided, will not send outcomes");D.log("Sending outcomes:",t);const e=(n=t,he((r=this.Fe.tunnel&&N(this._n))?{dsn:r}:{},[[{type:"client_report"},{timestamp:i||Zt(),discarded_events:n}]]));var n,r,i;this.$n(e)}}let su;function ou(t,e=function(){if(su)return su;if(St(zc.fetch))return su=zc.fetch.bind(zc);const t=zc.document;let e=zc.fetch;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(t){D.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return su=e.bind(zc)}()){let n=0,r=0;return gr(t,(function(i){const s=i.body.length;n+=s,r++;const o={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,o).then((t=>(n-=s,r--,{statusCode:t.status,headers:{"x-sentry-rate-limits":t.headers.get("X-Sentry-Rate-Limits"),"retry-after":t.headers.get("Retry-After")}})))}catch(t){return su=void 0,n-=s,r--,Jt(t)}}))}function au(t){return gr(t,(function(e){return new Gt(((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",t.url);for(const e in t.headers)Object.prototype.hasOwnProperty.call(t.headers,e)&&i.setRequestHeader(e,t.headers[e]);i.send(e.body)}))}))}const cu="?";function uu(t,e,n,r){const i={filename:t,function:e,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const lu=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hu=/\((\S*)(?::(\d+))(?::(\d+))\)/,du=[30,t=>{const e=lu.exec(t);if(e){if(e[2]&&0===e[2].indexOf("eval")){const t=hu.exec(e[2]);t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3])}const[t,n]=_u(e[1]||cu,e[2]);return uu(n,t,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],fu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,pu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mu=[50,t=>{const e=fu.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const t=pu.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}let t=e[3],n=e[1]||cu;return[n,t]=_u(n,t),uu(t,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}],yu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,gu=[40,t=>{const e=yu.exec(t);return e?uu(e[2],e[1]||cu,+e[3],e[4]?+e[4]:void 0):void 0}],vu=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,bu=[10,t=>{const e=vu.exec(t);return e?uu(e[2],e[3]||cu,+e[1]):void 0}],ku=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,wu=[20,t=>{const e=ku.exec(t);return e?uu(e[5],e[3]||e[4]||cu,+e[1],+e[2]):void 0}],Su=[du,mu,gu],Tu=V(...Su),_u=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return n||r?[-1!==t.indexOf("@")?t.split("@")[0]:cu,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},xu=1024,Iu="Breadcrumbs",Cu=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:Iu,setupOnce(){},setup(t){e.console&&function(t){const e="console";nt(e,t),rt(e,st)}(function(t){return function(e){if(Je()!==t)return;const n={category:"console",data:{arguments:e.args,logger:"console"},level:Qt(e.level),message:y(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;n.message=`Assertion failed: ${y(e.args.slice(1)," ")||"console.assert"}`,n.data.arguments=e.args.slice(1)}qe(n,{input:e.args,level:e.level})}}(t)),e.dom&>(function(t,e){return function(n){if(Je()!==t)return;let r,i,s="object"==typeof e?e.serializeAttribute:void 0,o="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;o&&o>xu&&(D.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=xu),"string"==typeof s&&(s=[s]);try{const t=n.event,e=function(t){return!!t&&!!t.target}(t)?t.target:t;r=E(e,{keyAttrs:s,maxStringLength:o}),i=$(e)}catch(t){r=""}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};i&&(a.data={"ui.component_name":i}),qe(a,{event:n.event,name:n.name,global:n.global})}}(t,e.dom)),e.xhr&&Pt(function(t){return function(e){if(Je()!==t)return;const{startTimestamp:n,endTimestamp:r}=e,i=e.xhr.__sentry_xhr_v3__;if(!n||!r||!i)return;const{method:s,url:o,status_code:a,body:c}=i;qe({category:"xhr",data:{method:s,url:o,status_code:a},type:"http"},{xhr:e.xhr,input:c,startTimestamp:n,endTimestamp:r})}}(t)),e.fetch&&Tt(function(t){return function(e){if(Je()!==t)return;const{startTimestamp:n,endTimestamp:r}=e;if(r&&(!e.fetchData.url.match(/sentry_key/)||"POST"!==e.fetchData.method))if(e.error){qe({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args,startTimestamp:n,endTimestamp:r})}else{const t=e.response;qe({category:"fetch",data:{...e.fetchData,status_code:t&&t.status},type:"http"},{input:e.args,response:t,startTimestamp:n,endTimestamp:r})}}}(t)),e.history&&Nt(function(t){return function(e){if(Je()!==t)return;let n=e.from,r=e.to;const i=Yt(zc.location.href);let s=n?Yt(n):void 0;const o=Yt(r);s&&s.path||(s=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===s.protocol&&i.host===s.host&&(n=s.relative),qe({category:"navigation",data:{from:n,to:r}})}}(t)),e.sentry&&t.on&&t.on("beforeSendEvent",function(t){return function(e){Je()===t&&qe({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:ct(e)},{event:e})}}(t))}}},Eu=or(Iu,Cu);const Ru="Dedupe",$u=()=>{let t;return{name:Ru,setupOnce(){},processEvent(e){if(e.type)return e;try{if(function(t,e){if(!e)return!1;if(function(t,e){const n=t.message,r=e.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!Mu(t,e))return!1;if(!Ou(t,e))return!1;return!0}(t,e))return!0;if(function(t,e){const n=Du(e),r=Du(t);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!Mu(t,e))return!1;if(!Ou(t,e))return!1;return!0}(t,e))return!0;return!1}(e,t))return D.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){}return t=e}}},Au=or(Ru,$u);function Ou(t,e){let n=Lu(t),r=Lu(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,r=r,r.length!==n.length)return!1;for(let t=0;t{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:Nu,setupOnce(){Error.stackTraceLimit=50},setup(t){e.onerror&&(!function(t){Et((e=>{const{stackParser:n,attachStacktrace:r}=Uu();if(Je()!==t||qc())return;const{msg:s,url:a,line:c,column:u,error:l}=e,h=void 0===l&&o(s)?function(t,e,n,r){const s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=i(t)?t.message:t,a="Error";const c=o.match(s);c&&(a=c[1],o=c[2]);return Pu({exception:{values:[{type:a,value:o}]}},e,n,r)}(s,a,c,u):Pu(tu(n,l||s,void 0,r,!1),a,c,u);h.level="error",He(h,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}))}(t),Bu("onerror")),e.onunhandledrejection&&(!function(t){At((e=>{const{stackParser:n,attachStacktrace:r}=Uu();if(Je()!==t||qc())return;const i=function(t){if(c(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(t){}return t}(e),s=c(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:tu(n,i,void 0,r,!0);s.level="error",He(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(t),Bu("onunhandledrejection"))}}},ju=or(Nu,Fu);function Pu(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},u=c.frames=c.frames||[],l=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(n,10))?void 0:n,d=o(e)&&e.length>0?e:function(){try{return C.document.location.href}catch(t){return""}}();return 0===u.length&&u.push({colno:l,filename:d,function:"?",in_app:!0,lineno:h}),t}function Bu(t){D.log(`Global Handler attached: ${t}`)}function Uu(){const t=Je();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const zu="HttpContext",Hu=()=>({name:zu,setupOnce(){},preprocessEvent(t){if(!zc.navigator&&!zc.location&&!zc.document)return;const e=t.request&&t.request.url||zc.location&&zc.location.href,{referrer:n}=zc.document||{},{userAgent:r}=zc.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),qu=or(zu,Hu),Wu="LinkedErrors",Ku=(t={})=>{const e=t.limit||5,n=t.key||"cause";return{name:Wu,setupOnce(){},preprocessEvent(t,r,i){const s=i.getOptions();b(Jc,s.stackParser,s.maxValueLength,n,e,t,r)}}},Ju=or(Wu,Ku),Gu=["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"],Xu="TryCatch",Yu=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:Xu,setupOnce(){e.setTimeout&&B(zc,"setTimeout",Qu),e.setInterval&&B(zc,"setInterval",Qu),e.requestAnimationFrame&&B(zc,"requestAnimationFrame",Zu),e.XMLHttpRequest&&"XMLHttpRequest"in zc&&B(XMLHttpRequest.prototype,"send",tl);const t=e.eventTarget;if(t){(Array.isArray(t)?t:Gu).forEach(el)}}}},Vu=or(Xu,Yu);function Qu(t){return function(...e){const n=e[0];return e[0]=Kc(n,{mechanism:{data:{function:Z(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Zu(t){return function(e){return t.apply(this,[Kc(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Z(t)},handled:!1,type:"instrument"}})])}}function tl(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in n&&"function"==typeof n[t]&&B(n,t,(function(e){const n={mechanism:{data:{function:t,handler:Z(e)},handled:!1,type:"instrument"}},r=H(e);return r&&(n.mechanism.data.handler=Z(r)),Kc(e,n)}))})),t.apply(this,e)}}function el(t){const e=zc,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(B(n,"addEventListener",(function(e){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=Kc(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Z(r),target:t},handled:!1,type:"instrument"}}))}catch(t){}return e.apply(this,[n,Kc(r,{mechanism:{data:{function:"addEventListener",handler:Z(r),target:t},handled:!1,type:"instrument"}}),i])}})),B(n,"removeEventListener",(function(t){return function(e,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&t.call(this,e,n,r)}catch(t){}return t.call(this,e,i,r)}})))}const nl=[xr(),Ar(),Yu(),Cu(),Fu(),Ku(),$u(),Hu()];function rl(t){return[...nl]}var il=Object.freeze({__proto__:null,GlobalHandlers:ju,TryCatch:Vu,Breadcrumbs:Eu,LinkedErrors:Ju,HttpContext:qu,Dedupe:Au});let sl={};zc.Sentry&&zc.Sentry.Integrations&&(sl=zc.Sentry.Integrations);const ol={...sl,...Ur,...il};return ol.Replay=Bc,ol.BrowserTracing=Yi,Zi(),t.Breadcrumbs=Eu,t.BrowserClient=iu,t.BrowserTracing=Yi,t.Dedupe=Au,t.Feedback=xe,t.FunctionToString=Or,t.GlobalHandlers=ju,t.HttpContext=qu,t.Hub=dn,t.InboundFilters=Ir,t.Integrations=ol,t.LinkedErrors=Ju,t.Replay=Bc,t.SDK_VERSION=un,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=jn,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=Pn,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=Fn,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=Nn,t.Scope=an,t.Span=Un,t.TryCatch=Vu,t.WINDOW=zc,t.addBreadcrumb=qe,t.addEventProcessor=pr,t.addExtensionMethods=Zi,t.addGlobalEventProcessor=Ee,t.addIntegration=function(t){const e=Je();e&&e.addIntegration?e.addIntegration(t):D.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`)},t.breadcrumbsIntegration=Cu,t.browserApiErrorsIntegration=Yu,t.browserTracingIntegration=function(t={}){const e=t;return"boolean"==typeof t.markBackgroundSpan&&(e.markBackgroundTransactions=t.markBackgroundSpan),"boolean"==typeof t.instrumentPageLoad&&(e.startTransactionOnPageLoad=t.instrumentPageLoad),"boolean"==typeof t.instrumentNavigation&&(e.startTransactionOnLocationChange=t.instrumentNavigation),new Yi(e)},t.captureEvent=He,t.captureException=captureException,t.captureMessage=function(t,e){const n="string"==typeof e?e:void 0,r="string"!=typeof e?{captureContext:e}:void 0;return mn().captureMessage(t,n,r)},t.captureSession=Qe,t.captureUserFeedback=function(t){const e=Je();e&&e.captureUserFeedback(t)},t.chromeStackLineParser=du,t.close=async function(t){const e=Je();return e?e.close(t):(D.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))},t.configureScope=function(t){mn().configureScope(t)},t.continueTrace=({sentryTrace:t,baggage:e},n)=>{const r=Ge(),{traceparentData:i,dynamicSamplingContext:s,propagationContext:o}=function(t,e){const n=ue(t),r=se(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceparentData:n,dynamicSamplingContext:r||{},propagationContext:{traceId:i||ot(),parentSpanId:s||ot().substring(16),spanId:ot().substring(16),sampled:o,dsc:r||{}}}:{traceparentData:n,dynamicSamplingContext:void 0,propagationContext:{traceId:i||ot(),spanId:ot().substring(16)}}}(t,e);r.setPropagationContext(o),i&&D.log(`[Tracing] Continuing trace ${i.traceId}.`);const a={...i,metadata:J({dynamicSamplingContext:s})};return n?gn((()=>n(a))):a},t.createTransport=gr,t.createUserFeedbackEnvelope=ru,t.dedupeIntegration=$u,t.defaultIntegrations=nl,t.defaultStackLineParsers=Su,t.defaultStackParser=Tu,t.endSession=Ye,t.eventFromException=Qc,t.eventFromMessage=Zc,t.exceptionFromError=Jc,t.feedbackIntegration=function(t){return new xe({})},t.flush=async function(t){const e=Je();return e?e.flush(t):(D.warn("Cannot flush events. No client defined."),Promise.resolve(!1))},t.forceLoad=function(){},t.functionToStringIntegration=Ar,t.geckoStackLineParser=mu,t.getActiveSpan=En,t.getClient=Je,t.getCurrentHub=mn,t.getCurrentScope=Ge,t.getDefaultIntegrations=rl,t.getHubFromCarrier=vn,t.globalHandlersIntegration=Fu,t.httpContextIntegration=Hu,t.inboundFiltersIntegration=xr,t.init=function(t={}){void 0===t.defaultIntegrations&&(t.defaultIntegrations=rl()),void 0===t.release&&("string"==typeof __SENTRY_RELEASE__&&(t.release=__SENTRY_RELEASE__),zc.SENTRY_RELEASE&&zc.SENTRY_RELEASE.id&&(t.release=zc.SENTRY_RELEASE.id)),void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),void 0===t.sendClientReports&&(t.sendClientReports=!0);const e={...t,stackParser:(n=t.stackParser||Tu,Array.isArray(n)?V(...n):n),integrations:rr(t),transport:t.transport||(wt()?ou:au)};var n;!function(t,e){!0===e.debug&&D.enable(),Ge().update(e.initialScope);const n=new t(e);yr(n),function(t){t.init?t.init():t.setupIntegrations&&t.setupIntegrations()}(n)}(iu,e),t.autoSessionTracking&&function(){if(void 0===zc.document)return void D.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");Xe({ignoreDuration:!0}),Qe(),Nt((({from:t,to:e})=>{void 0!==t&&t!==e&&(Xe({ignoreDuration:!0}),Qe())}))}()},t.isInitialized=function(){return!!Je()},t.lastEventId=function(){return mn().lastEventId()},t.linkedErrorsIntegration=Ku,t.makeFetchTransport=ou,t.makeMain=pn,t.makeXHRTransport=au,t.metrics=Br,t.onLoad=function(t){t()},t.opera10StackLineParser=bu,t.opera11StackLineParser=wu,t.parameterize=function(t,...e){const n=new String(String.raw(t,...e));return n.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=e,n},t.replayIntegration=t=>new Bc(t),t.setContext=We,t.setCurrentClient=yr,t.setExtra=function(t,e){mn().setExtra(t,e)},t.setExtras=function(t){mn().setExtras(t)},t.setTag=function(t,e){mn().setTag(t,e)},t.setTags=function(t){mn().setTags(t)},t.setUser=function(t){mn().setUser(t)},t.showReportDialog=(t={},e=mn())=>{if(!zc.document)return void D.error("Global document not defined in showReportDialog call");const{client:n,scope:r}=e.getStackTop(),i=t.dsn||n&&n.getDsn();if(!i)return void D.error("DSN not configured for showReportDialog call");r&&(t.user={...r.getUser(),...t.user}),t.eventId||(t.eventId=e.lastEventId());const s=zc.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=function(t,e){const n=j(t);if(!n)return"";const r=`${Zn(n)}embed/error-page/`;let i=`dsn=${N(n)}`;for(const t in e)if("dsn"!==t&&"onClose"!==t)if("user"===t){const t=e.user;if(!t)continue;t.name&&(i+=`&name=${encodeURIComponent(t.name)}`),t.email&&(i+=`&email=${encodeURIComponent(t.email)}`)}else i+=`&${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`;return`${r}?${i}`}(i,t),t.onLoad&&(s.onload=t.onLoad);const{onClose:o}=t;if(o){const t=e=>{if("__sentry_reportdialog_closed__"===e.data)try{o()}finally{zc.removeEventListener("message",t)}};zc.addEventListener("message",t)}const a=zc.document.head||zc.document.body;a?a.appendChild(s):D.error("Not injecting report dialog. No injection point found in HTML")},t.startInactiveSpan=Cn,t.startSession=Xe,t.startSpan=function(t,e){const n=$n(t);return gn((()=>Ke(t.scope,(r=>{const i=mn(),s=r.getSpan(),o=t.onlyIfParent&&!s?void 0:Rn(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});return xn((()=>e(o)),(()=>{if(o){const{status:t}=Fe(o);t&&"ok"!==t||o.setStatus("internal_error")}}),(()=>o&&o.end()))}))))},t.startSpanManual=function(t,e){const n=$n(t);return gn((()=>Ke(t.scope,(r=>{const i=mn(),s=r.getSpan(),o=t.onlyIfParent&&!s?void 0:Rn(i,{parentSpan:s,spanContext:n,forceTransaction:t.forceTransaction,scope:r});function a(){o&&o.end()}return xn((()=>e(o,a)),(()=>{if(o&&o.isRecording()){const{status:t}=Fe(o);t&&"ok"!==t||o.setStatus("internal_error")}}))}))))},t.startTransaction=function(t,e){return mn().startTransaction({...t},e)},t.winjsStackLineParser=gu,t.withActiveSpan=function(t,e){return Ke((n=>(n.setSpan(t),e(n))))},t.withIsolationScope=function(t){return gn((()=>t(yn())))},t.withScope=Ke,t.wrap=function(t){return Kc(t)()},t}({});