From 5bf77030e42d3c573fca7379c15c9bcb113a2753 Mon Sep 17 00:00:00 2001 From: Odumosu Dipo Date: Wed, 23 Oct 2024 17:30:14 +0100 Subject: [PATCH 1/2] feat: enable tracing for the PWA --- apollo/pwa/static/js/serviceworker.js | 4 ++-- apollo/pwa/static/vendor/sentry/bundle.min.js | 4 ++-- apollo/pwa/static/vendor/sentry/bundle.min.js.map | 1 - apollo/pwa/static/vendor/sentry/bundle.tracing.min.js | 3 +++ apollo/pwa/templates/pwa/index.html | 2 +- apollo/pwa/views_pwa.py | 2 +- apollo/settings.py | 1 + 7 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 apollo/pwa/static/vendor/sentry/bundle.min.js.map create mode 100644 apollo/pwa/static/vendor/sentry/bundle.tracing.min.js diff --git a/apollo/pwa/static/js/serviceworker.js b/apollo/pwa/static/js/serviceworker.js index cf33a03f9..6ff0a50d7 100644 --- a/apollo/pwa/static/js/serviceworker.js +++ b/apollo/pwa/static/js/serviceworker.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'apollo-cache-static-v11'; +const CACHE_NAME = 'apollo-cache-static-v13'; const CACHED_URLS = [ '/pwa/', @@ -23,7 +23,7 @@ const CACHED_URLS = [ '/pwa/static/vendor/notiflix/notiflix-2.7.0.min.js', '/pwa/static/vendor/popper.js/popper.min.js', '/pwa/static/vendor/tippy.js/tippy.umd.min.js', - '/pwa/static/vendor/sentry/bundle.min.js', + '/pwa/static/vendor/sentry/bundle.tracing.min.js', '/pwa/static/vendor/vue/vue.min.js', ]; diff --git a/apollo/pwa/static/vendor/sentry/bundle.min.js b/apollo/pwa/static/vendor/sentry/bundle.min.js index a4ba5e6b1..e0537e29e 100644 --- a/apollo/pwa/static/vendor/sentry/bundle.min.js +++ b/apollo/pwa/static/vendor/sentry/bundle.min.js @@ -1,3 +1,3 @@ -/*! @sentry/browser 6.3.0 (8bcd596) | https://github.com/getsentry/sentry-javascript */ -var Sentry=function(t){var n=function(t,r){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(t,r)};function r(t,r){function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i,e,o,u,s,c=function(){return(c=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function f(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,e,o=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=o.next()).done;)u.push(i.value)}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return u}function h(){for(var t=[],n=0;n ".length,u=void 0;n&&i++<5&&!("html"===(u=j(n))||i>1&&e+r.length*o+u.length>=80);)r.push(u),e+=u.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return""}}function j(t){var n,r,i,e,o,u=t,s=[];if(!u||!u.tagName)return"";if(s.push(u.tagName.toLowerCase()),u.id&&s.push("#"+u.id),(n=u.className)&&p(n))for(r=n.split(/\s+/),o=0;o=200&&n<300?t.Success:429===n?t.RateLimit:n>=400&&n<500?t.Invalid:n>=500?t.Failed:t.Unknown}}(t.Status||(t.Status={})),function(t){t.Explicit="explicitly_set",t.Sampler="client_sampler",t.Rate="client_rate",t.Inheritance="inheritance"}(s||(s={}));var k=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){return t.__proto__=n,t}:function(t,n){for(var r in n)t.hasOwnProperty(r)||(t[r]=n[r]);return t});var S=function(t){function n(n){var r=this.constructor,i=t.call(this,n)||this;return i.message=n,i.name=r.prototype.constructor.name,k(i,r.prototype),i}return r(n,t),n}(Error),_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,O=function(){function t(t){"string"==typeof t?this.t(t):this.i(t),this.o()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var n=this,r=n.host,i=n.path,e=n.pass,o=n.port,u=n.projectId;return n.protocol+"://"+n.publicKey+(t&&e?":"+e:"")+"@"+r+(o?":"+o:"")+"/"+(i?i+"/":i)+u},t.prototype.t=function(t){var n=_.exec(t);if(!n)throw new S("Invalid Dsn");var r=f(n.slice(1),6),i=r[0],e=r[1],o=r[2],u=void 0===o?"":o,s=r[3],c=r[4],a=void 0===c?"":c,h="",v=r[5],l=v.split("/");if(l.length>1&&(h=l.slice(0,-1).join("/"),v=l.pop()),v){var d=v.match(/^\d+/);d&&(v=d[0])}this.i({host:s,pass:u,path:h,projectId:v,port:a,protocol:i,publicKey:e})},t.prototype.i=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype.o=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach(function(n){if(!t[n])throw new S("Invalid Dsn: "+n+" missing")}),!this.projectId.match(/^\d+$/))throw new S("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new S("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new S("Invalid Dsn: Invalid port "+this.port)},t}();function D(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function T(t,n){return void 0===n&&(n=0),"string"!=typeof t||0===n?t:t.length<=n?t:t.substr(0,n)+"..."}function R(t,n){if(!Array.isArray(t))return"";for(var r=[],i=0;i"}return t.event_id||""}function L(t){var n=M();if(!("console"in n))return t();var r=n.console,i={};["debug","info","warn","error","log","assert"].forEach(function(t){t in n.console&&r[t].__sentry_original__&&(i[t]=r[t],r[t]=r[t].__sentry_original__)});var e=t();return Object.keys(i).forEach(function(t){r[t]=i[t]}),e}function U(t,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||n||"",t.exception.values[0].type=t.exception.values[0].type||r||"Error"}function H(t,n){void 0===n&&(n={});try{t.exception.values[0].mechanism=t.exception.values[0].mechanism||{},Object.keys(n).forEach(function(r){t.exception.values[0].mechanism[r]=n[r]})}catch(t){}}var F=6e4;var P=M(),X="Sentry Logger ",B=function(){function t(){this.u=!1}return t.prototype.disable=function(){this.u=!1},t.prototype.enable=function(){this.u=!0},t.prototype.log=function(){for(var t=[],n=0;n";function G(t){try{return t&&"function"==typeof t&&t.name||$}catch(t){return $}}function z(t,n,r){if(n in t){var i=t[n],e=r(i);if("function"==typeof e)try{e.prototype=e.prototype||{},Object.defineProperties(e,{__sentry_original__:{enumerable:!1,value:i}})}catch(t){}t[n]=e}}function K(t){if(v(t)){var n=t,r={message:n.message,name:n.name,stack:n.stack};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r}if(b(t)){var e=t,o={};o.type=e.type;try{o.target=w(e.target)?x(e.target):Object.prototype.toString.call(e.target)}catch(t){o.target=""}try{o.currentTarget=w(e.currentTarget)?x(e.currentTarget):Object.prototype.toString.call(e.currentTarget)}catch(t){o.currentTarget=""}for(var i in"undefined"!=typeof CustomEvent&&E(t,CustomEvent)&&(o.detail=e.detail),e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e);return o}return t}function V(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}function Q(t,n,r){void 0===n&&(n=3),void 0===r&&(r=102400);var i=tt(t,n);return V(i)>r?Q(t,n-1,r):i}function Y(t,n){return"domain"===n&&t&&"object"==typeof t&&t.v?"[Domain]":"domainEmitter"===n?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":m(r=t)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+G(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t;var r}function Z(t,n,r,i){if(void 0===r&&(r=1/0),void 0===i&&(i=new W),0===r)return function(t){var n=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===n)return"[Object]";if("[object Array]"===n)return"[Array]";var r=Y(t);return y(r)?r:n}(n);if(null!=n&&"function"==typeof n.toJSON)return n.toJSON();var e=Y(n,t);if(y(e))return e;var o=K(n),u=Array.isArray(n)?[]:{};if(i.memoize(n))return"[Circular ~]";for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(u[s]=Z(s,o[s],r-1,i));return i.unmemoize(n),u}function tt(t,n){try{return JSON.parse(JSON.stringify(t,function(t,r){return Z(t,r,n)}))}catch(t){return"**non-serializable**"}}function nt(t,n){void 0===n&&(n=40);var r=Object.keys(K(t));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=n)return T(r[0],n);for(var i=r.length;i>0;i--){var e=r.slice(0,i).join(", ");if(!(e.length>n))return i===r.length?e:T(e,n)}return""}function rt(t){var n,r;if(m(t)){var i=t,e={};try{for(var o=a(Object.keys(i)),u=o.next();!u.done;u=o.next()){var s=u.value;void 0!==i[s]&&(e[s]=rt(i[s]))}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e}return Array.isArray(t)?t.map(rt):t}function it(){if(!("fetch"in M()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function et(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ot(){if(!it())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}var ut,st=M(),ct={},at={};function ft(t){if(!at[t])switch(at[t]=!0,t){case"console":!function(){if(!("console"in st))return;["debug","info","warn","error","log","assert"].forEach(function(t){t in st.console&&z(st.console,t,function(n){return function(){for(var r=[],i=0;i2?n[2]:void 0;if(i){var e=ut,o=String(i);ut=o,vt("history",{from:e,to:o})}return t.apply(this,n)}}st.onpopstate=function(){for(var t=[],n=0;n0&&r(!1)},t);xt.all(n.D).then(function(){clearTimeout(i),r(!0)}).then(null,function(){r(!0)})})},t}(),kt={nowSeconds:function(){return Date.now()/1e3}};var St=D()?function(){try{return(t=module,n="perf_hooks",t.require(n)).performance}catch(t){return}var t,n}():function(){var t=M().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),_t=void 0===St?kt:{nowSeconds:function(){return(St.timeOrigin+St.now())/1e3}},Ot=kt.nowSeconds.bind(kt),Dt=(_t.nowSeconds.bind(_t),function(){var t=M().performance;if(t){var n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):36e5,e=i<36e5,o=t.timing&&t.timing.navigationStart,u="number"==typeof o?Math.abs(o+n-r):36e5;(e||u<36e5)&&(i<=u&&t.timeOrigin)}}(),function(){function t(){this.T=!1,this.R=[],this.I=[],this.N=[],this.M={},this.C={},this.A={},this.q={}}return t.clone=function(n){var r=new t;return n&&(r.N=h(n.N),r.C=c({},n.C),r.A=c({},n.A),r.q=c({},n.q),r.M=n.M,r.L=n.L,r.U=n.U,r.H=n.H,r.F=n.F,r.P=n.P,r.I=h(n.I)),r},t.prototype.addScopeListener=function(t){this.R.push(t)},t.prototype.addEventProcessor=function(t){return this.I.push(t),this},t.prototype.setUser=function(t){return this.M=t||{},this.H&&this.H.update({user:t}),this.X(),this},t.prototype.getUser=function(){return this.M},t.prototype.setTags=function(t){return this.C=c(c({},this.C),t),this.X(),this},t.prototype.setTag=function(t,n){var r;return this.C=c(c({},this.C),((r={})[t]=n,r)),this.X(),this},t.prototype.setExtras=function(t){return this.A=c(c({},this.A),t),this.X(),this},t.prototype.setExtra=function(t,n){var r;return this.A=c(c({},this.A),((r={})[t]=n,r)),this.X(),this},t.prototype.setFingerprint=function(t){return this.P=t,this.X(),this},t.prototype.setLevel=function(t){return this.L=t,this.X(),this},t.prototype.setTransactionName=function(t){return this.F=t,this.X(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,n){var r;return null===n?delete this.q[t]:this.q=c(c({},this.q),((r={})[t]=n,r)),this.X(),this},t.prototype.setSpan=function(t){return this.U=t,this.X(),this},t.prototype.getSpan=function(){return this.U},t.prototype.getTransaction=function(){var t,n,r,i,e=this.getSpan();return(null===(t=e)||void 0===t?void 0:t.transaction)?null===(n=e)||void 0===n?void 0:n.transaction:(null===(i=null===(r=e)||void 0===r?void 0:r.spanRecorder)||void 0===i?void 0:i.spans[0])?e.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this.H=t:delete this.H,this.X(),this},t.prototype.getSession=function(){return this.H},t.prototype.update=function(n){if(!n)return this;if("function"==typeof n){var r=n(this);return r instanceof t?r:this}return n instanceof t?(this.C=c(c({},this.C),n.C),this.A=c(c({},this.A),n.A),this.q=c(c({},this.q),n.q),n.M&&Object.keys(n.M).length&&(this.M=n.M),n.L&&(this.L=n.L),n.P&&(this.P=n.P)):m(n)&&(n=n,this.C=c(c({},this.C),n.tags),this.A=c(c({},this.A),n.extra),this.q=c(c({},this.q),n.contexts),n.user&&(this.M=n.user),n.level&&(this.L=n.level),n.fingerprint&&(this.P=n.fingerprint)),this},t.prototype.clear=function(){return this.N=[],this.C={},this.A={},this.M={},this.q={},this.L=void 0,this.F=void 0,this.P=void 0,this.U=void 0,this.H=void 0,this.X(),this},t.prototype.addBreadcrumb=function(t,n){var r=c({timestamp:Ot()},t);return this.N=void 0!==n&&n>=0?h(this.N,[r]).slice(-n):h(this.N,[r]),this.X(),this},t.prototype.clearBreadcrumbs=function(){return this.N=[],this.X(),this},t.prototype.applyToEvent=function(t,n){var r;if(this.A&&Object.keys(this.A).length&&(t.extra=c(c({},this.A),t.extra)),this.C&&Object.keys(this.C).length&&(t.tags=c(c({},this.C),t.tags)),this.M&&Object.keys(this.M).length&&(t.user=c(c({},this.M),t.user)),this.q&&Object.keys(this.q).length&&(t.contexts=c(c({},this.q),t.contexts)),this.L&&(t.level=this.L),this.F&&(t.transaction=this.F),this.U){t.contexts=c({trace:this.U.getTraceContext()},t.contexts);var i=null===(r=this.U.transaction)||void 0===r?void 0:r.name;i&&(t.tags=c({transaction:i},t.tags))}return this.B(t),t.breadcrumbs=h(t.breadcrumbs||[],this.N),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this.J(h(Tt(),this.I),t,n)},t.prototype.J=function(t,n,r,i){var e=this;return void 0===i&&(i=0),new xt(function(o,u){var s=t[i];if(null===n||"function"!=typeof s)o(n);else{var a=s(c({},n),r);g(a)?a.then(function(n){return e.J(t,n,r,i+1).then(o)}).then(null,u):e.J(t,a,r,i+1).then(o).then(null,u)}})},t.prototype.X=function(){var t=this;this.T||(this.T=!0,this.R.forEach(function(n){n(t)}),this.T=!1)},t.prototype.B=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this.P&&(t.fingerprint=t.fingerprint.concat(this.P)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}());function Tt(){var t=M();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function Rt(t){Tt().push(t)}var It=function(){function t(t){this.errors=0,this.sid=C(),this.timestamp=Date.now(),this.started=Date.now(),this.duration=0,this.status=e.Ok,this.init=!0,t&&this.update(t)}return t.prototype.update=function(t){void 0===t&&(t={}),t.user&&(t.user.ip_address&&(this.ipAddress=t.user.ip_address),t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Date.now(),t.sid&&(this.sid=32===t.sid.length?t.sid:C()),void 0!==t.init&&(this.init=t.init),t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),"number"==typeof t.duration?this.duration=t.duration:this.duration=this.timestamp-this.started,t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),t.ipAddress&&(this.ipAddress=t.ipAddress),t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===e.Ok?this.update({status:e.Exited}):this.update()},t.prototype.toJSON=function(){return rt({sid:""+this.sid,init:this.init,started:new Date(this.started).toISOString(),timestamp:new Date(this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:rt({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),Nt=3,Mt=function(){function t(t,n,r){void 0===n&&(n=new Dt),void 0===r&&(r=Nt),this.W=r,this.$=[{}],this.getStackTop().scope=n,this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this.W=t&&(clearInterval(e),r(!1)))},1)})},t.prototype.at=function(){return this.ot},t.prototype.lt=function(){return!1!==this.getOptions().enabled&&void 0!==this.st},t.prototype.pt=function(t,n,r){var i=this,e=this.getOptions().normalizeDepth,o=void 0===e?3:e,u=c(c({},t),{event_id:t.event_id||(r&&r.event_id?r.event_id:C()),timestamp:t.timestamp||Ot()});this.yt(u),this.bt(u);var s=n;r&&r.captureContext&&(s=Dt.clone(s).update(r.captureContext));var a=xt.resolve(u);return s&&(a=s.applyToEvent(u,r)),a.then(function(t){return"number"==typeof o&&o>0?i.wt(t,o):t})},t.prototype.wt=function(t,n){if(!t)return null;var r=c(c(c(c(c({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(function(t){return c(c({},t),t.data&&{data:tt(t.data,n)})})}),t.user&&{user:tt(t.user,n)}),t.contexts&&{contexts:tt(t.contexts,n)}),t.extra&&{extra:tt(t.extra,n)});return t.contexts&&t.contexts.trace&&(r.contexts.trace=t.contexts.trace),r},t.prototype.yt=function(t){var n=this.getOptions(),r=n.environment,i=n.release,e=n.dist,o=n.maxValueLength,u=void 0===o?250:o;"environment"in t||(t.environment="environment"in n?r:"production"),void 0===t.release&&void 0!==i&&(t.release=i),void 0===t.dist&&void 0!==e&&(t.dist=e),t.message&&(t.message=T(t.message,u));var s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=T(s.value,u));var c=t.request;c&&c.url&&(c.url=T(c.url,u))},t.prototype.bt=function(t){var n=t.sdk,r=Object.keys(this.it);n&&r.length>0&&(n.integrations=r)},t.prototype.gt=function(t){this.at().sendEvent(t)},t.prototype.ft=function(t,n,r){return this.Et(t,n,r).then(function(t){return t.event_id},function(t){J.error(t)})},t.prototype.Et=function(t,n,r){var i=this,e=this.getOptions(),o=e.beforeSend,u=e.sampleRate;if(!this.lt())return xt.reject(new S("SDK not enabled, will not send event."));var s="transaction"===t.type;return!s&&"number"==typeof u&&Math.random()>u?xt.reject(new S("Discarding event because it's not included in the random sample (sampling rate = "+u+")")):this.pt(t,r,n).then(function(t){if(null===t)throw new S("An event processor returned null, will not send event.");if(n&&n.data&&!0===n.data.__sentry__||s||!o)return t;var r=o(t,n);if(void 0===r)throw new S("`beforeSend` method has to return `null` or a valid event.");return g(r)?r.then(function(t){return t},function(t){throw new S("beforeSend rejected with "+t)}):r}).then(function(t){if(null===t)throw new S("`beforeSend` returned `null`, will not send event.");var n=r&&r.getSession&&r.getSession();return!s&&n&&i.dt(n,t),i.gt(t),t}).then(null,function(t){if(t instanceof S)throw t;throw i.captureException(t,{data:{__sentry__:!0},originalException:t}),new S("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)})},t.prototype.ct=function(t){var n=this;this.et+=1,t.then(function(t){return n.et-=1,t},function(t){return n.et-=1,t})},t}(),$t=function(){function n(){}return n.prototype.sendEvent=function(n){return xt.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:t.Status.Skipped})},n.prototype.close=function(t){return xt.resolve(!0)},n}(),Gt=function(){function t(t){this.ut=t,this.ut.dsn||J.warn("No DSN provided, backend will not do anything."),this.xt=this.jt()}return t.prototype.eventFromException=function(t,n){throw new S("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,n,r){throw new S("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this.xt.sendEvent(t).then(null,function(t){J.error("Error while sending event: "+t)})},t.prototype.sendSession=function(t){this.xt.sendSession?this.xt.sendSession(t).then(null,function(t){J.error("Error while sending session: "+t)}):J.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this.xt},t.prototype.jt=function(){return new $t},t}();function zt(t){if(t.metadata&&t.metadata.sdk){var n=t.metadata.sdk;return{name:n.name,version:n.version}}}function Kt(t,n){return n?(t.sdk=t.sdk||{name:n.name,version:n.version},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=h(t.sdk.integrations||[],n.integrations||[]),t.sdk.packages=h(t.sdk.packages||[],n.packages||[]),t):t}function Vt(t,n){var r=zt(n);return{body:JSON.stringify(c({sent_at:(new Date).toISOString()},r&&{sdk:r}))+"\n"+JSON.stringify({type:"session"})+"\n"+JSON.stringify(t),type:"session",url:n.getEnvelopeEndpointWithUrlEncodedAuth()}}function Qt(t,n){var r=zt(n),i=t.type||"event",e="transaction"===i,o=t.debug_meta||{},u=o.transactionSampling,s=function(t,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var e=0;for(i=Object.getOwnPropertySymbols(t);e|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,cn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,an=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,fn=/\((\S*)(?::(\d+))(?::(\d+))\)/,hn=/Minified React error #\d+;/i;function vn(t){var n=null,r=0;t&&("number"==typeof t.framesToPop?r=t.framesToPop:hn.test(t.message)&&(r=1));try{if(n=function(t){if(!t||!t.stacktrace)return null;for(var n,r=t.stacktrace,i=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,e=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=r.split("\n"),u=[],s=0;s eval")>-1&&(n=an.exec(r[3]))?(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]=""):0!==u||r[5]||void 0===t.columnNumber||(e[0].column=t.columnNumber+1),i={url:r[3],func:r[1]||on,args:r[2]?r[2].split(","):[],line:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}!i.func&&i.line&&(i.func=on),e.push(i)}if(!e.length)return null;return{message:dn(t),name:t.name,stack:e}}(t))return ln(n,r)}catch(t){}return{message:dn(t),name:t&&t.name,stack:[],failed:!0}}function ln(t,n){try{return c(c({},t),{stack:t.stack.slice(n)})}catch(n){return t}}function dn(t){var n=t&&t.message;return n?n.error&&"string"==typeof n.error.message?n.error.message:n:"No error message"}var pn=50;function yn(t){var n=bn(t.stack),r={type:t.name,value:t.message};return n&&n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function mn(t){return{exception:{values:[yn(t)]}}}function bn(t){if(!t||!t.length)return[];var n=t,r=n[0].func||"",i=n[n.length-1].func||"";return-1===r.indexOf("captureMessage")&&-1===r.indexOf("captureException")||(n=n.slice(1)),-1!==i.indexOf("sentryWrapped")&&(n=n.slice(0,-1)),n.slice(0,pn).map(function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||n[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}}).reverse()}function wn(n,r,i){var e=En(r,i&&i.syntheticException||void 0,{attachStacktrace:n.attachStacktrace});return H(e,{handled:!0,type:"generic"}),e.level=t.Severity.Error,i&&i.event_id&&(e.event_id=i.event_id),xt.resolve(e)}function gn(n,r,i,e){void 0===i&&(i=t.Severity.Info);var o=xn(r,e&&e.syntheticException||void 0,{attachStacktrace:n.attachStacktrace});return o.level=i,e&&e.event_id&&(o.event_id=e.event_id),xt.resolve(o)}function En(t,n,r){var i,e;if(void 0===r&&(r={}),l(t)&&t.error)return i=mn(vn(t=t.error));if(d(t)||(e=t,"[object DOMException]"===Object.prototype.toString.call(e))){var o=t,u=o.name||(d(o)?"DOMError":"DOMException"),s=o.message?u+": "+o.message:u;return U(i=xn(s,n,r),s),"code"in o&&(i.tags=c(c({},i.tags),{"DOMException.code":""+o.code})),i}return v(t)?i=mn(vn(t)):m(t)||b(t)?(H(i=function(t,n,r){var i={exception:{values:[{type:b(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:"Non-Error "+(r?"promise rejection":"exception")+" captured with keys: "+nt(t)}]},extra:{__serialized__:Q(t)}};if(n){var e=bn(vn(n).stack);i.stacktrace={frames:e}}return i}(t,n,r.rejection),{synthetic:!0}),i):(U(i=xn(t,n,r),""+t,void 0),H(i,{synthetic:!0}),i)}function xn(t,n,r){void 0===r&&(r={});var i={message:t};if(r.attachStacktrace&&n){var e=bn(vn(n).stack);i.stacktrace={frames:e}}return i}var jn={event:"error",transaction:"transaction",session:"session"},kn=function(){function n(t){this.options=t,this.D=new jt(30),this.Nt={},this.Mt=new Xt(t.dsn,t.Ct),this.url=this.Mt.getStoreEndpointWithUrlEncodedAuth()}return n.prototype.sendEvent=function(t){throw new S("Transport Class has to implement `sendEvent` method")},n.prototype.close=function(t){return this.D.drain(t)},n.prototype.At=function(n){var r=n.requestType,i=n.response,e=n.headers,o=n.resolve,u=n.reject,s=t.Status.fromHttpCode(i.status);this.qt(e)&&J.warn("Too many requests, backing off until: "+this.Lt(r)),s!==t.Status.Success?u(i):o({status:s})},n.prototype.Lt=function(t){var n=jn[t];return this.Nt[n]||this.Nt.all},n.prototype.Ut=function(t){return this.Lt(t)>new Date(Date.now())},n.prototype.qt=function(t){var n,r,i,e,o=Date.now(),u=t["x-sentry-rate-limits"],s=t["retry-after"];if(u){try{for(var c=a(u.trim().split(",")),f=c.next();!f.done;f=c.next()){var h=f.value.split(":",2),v=parseInt(h[0],10),l=1e3*(isNaN(v)?60:v);try{for(var d=(i=void 0,a(h[1].split(";"))),p=d.next();!p.done;p=d.next()){var y=p.value;this.Nt[y||"all"]=new Date(o+l)}}catch(t){i={error:t}}finally{try{p&&!p.done&&(e=d.return)&&e.call(d)}finally{if(i)throw i.error}}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!0}return!!s&&(this.Nt.all=new Date(o+function(t,n){if(!n)return F;var r=parseInt(""+n,10);if(!isNaN(r))return 1e3*r;var i=Date.parse(""+n);return isNaN(i)?F:i-t}(o,s)),!0)},n}();var Sn=function(t){function n(n,r){void 0===r&&(r=function(){var t,n,r=M();if(et(r.fetch))return r.fetch.bind(r);var i=r.document,e=r.fetch;if("function"==typeof(null===(t=i)||void 0===t?void 0:t.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o),(null===(n=o.contentWindow)||void 0===n?void 0:n.fetch)&&(e=o.contentWindow.fetch),i.head.removeChild(o)}catch(t){J.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e.bind(r)}());var i=t.call(this,n)||this;return i.Ht=r,i}return r(n,t),n.prototype.sendEvent=function(t){return this.Ft(Qt(t,this.Mt),t)},n.prototype.sendSession=function(t){return this.Ft(Vt(t,this.Mt),t)},n.prototype.Ft=function(t,n){var r=this;if(this.Ut(t.type))return Promise.reject({event:n,type:t.type,reason:"Transport locked till "+this.Lt(t.type)+" due to too many requests.",status:429});var i={body:t.body,method:"POST",referrerPolicy:ot()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(i,this.options.fetchParameters),void 0!==this.options.headers&&(i.headers=this.options.headers),this.D.add(new xt(function(n,e){r.Ht(t.url,i).then(function(i){var o={"x-sentry-rate-limits":i.headers.get("X-Sentry-Rate-Limits"),"retry-after":i.headers.get("Retry-After")};r.At({requestType:t.type,response:i,headers:o,resolve:n,reject:e})}).catch(e)}))},n}(kn),_n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.sendEvent=function(t){return this.Ft(Qt(t,this.Mt),t)},n.prototype.sendSession=function(t){return this.Ft(Vt(t,this.Mt),t)},n.prototype.Ft=function(t,n){var r=this;return this.Ut(t.type)?Promise.reject({event:n,type:t.type,reason:"Transport locked till "+this.Lt(t.type)+" due to too many requests.",status:429}):this.D.add(new xt(function(n,i){var e=new XMLHttpRequest;for(var o in e.onreadystatechange=function(){if(4===e.readyState){var o={"x-sentry-rate-limits":e.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":e.getResponseHeader("Retry-After")};r.At({requestType:t.type,response:e,headers:o,resolve:n,reject:i})}},e.open("POST",t.url),r.options.headers)r.options.headers.hasOwnProperty(o)&&e.setRequestHeader(o,r.options.headers[o]);e.send(t.body)}))},n}(kn),On=Object.freeze({__proto__:null,BaseTransport:kn,FetchTransport:Sn,XHRTransport:_n}),Dn=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return r(i,n),i.prototype.eventFromException=function(t,n){return wn(this.ut,t,n)},i.prototype.eventFromMessage=function(n,r,i){return void 0===r&&(r=t.Severity.Info),gn(this.ut,n,r,i)},i.prototype.jt=function(){if(!this.ut.dsn)return n.prototype.jt.call(this);var t=c(c({},this.ut.transportOptions),{dsn:this.ut.dsn,Ct:this.ut.Ct});return this.ut.transport?new this.ut.transport(t):it()?new Sn(t):new _n(t)},i}(Gt),Tn=0;function Rn(){return Tn>0}function In(t,n,r){if(void 0===n&&(n={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(n){return t}var sentryWrapped=function(){var i=Array.prototype.slice.call(arguments);try{r&&"function"==typeof r&&r.apply(this,arguments);var e=i.map(function(t){return In(t,n)});return t.handleEvent?t.handleEvent.apply(this,e):t.apply(this,e)}catch(t){throw Tn+=1,setTimeout(function(){Tn-=1}),Pt(function(r){r.addEventProcessor(function(t){var r=c({},t);return n.mechanism&&(U(r,void 0,void 0),H(r,n.mechanism)),r.extra=c(c({},r.extra),{arguments:i}),r}),captureException(t)}),t}};try{for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(sentryWrapped[i]=t[i])}catch(t){}t.prototype=t.prototype||{},sentryWrapped.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:sentryWrapped}),Object.defineProperties(sentryWrapped,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:function(){return t.name}})}catch(t){}return sentryWrapped}function Nn(t){if(void 0===t&&(t={}),t.eventId)if(t.dsn){var n=document.createElement("script");n.async=!0,n.src=new Xt(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(n.onload=t.onLoad),(document.head||document.body).appendChild(n)}else J.error("Missing dsn option in showReportDialog call");else J.error("Missing eventId option in showReportDialog call")}var Mn=function(){function n(t){this.name=n.id,this.Pt=!1,this.Xt=!1,this.ut=c({onerror:!0,onunhandledrejection:!0},t)}return n.prototype.setupOnce=function(){Error.stackTraceLimit=50,this.ut.onerror&&(J.log("Global Handler attached: onerror"),this.Bt()),this.ut.onunhandledrejection&&(J.log("Global Handler attached: onunhandledrejection"),this.Jt())},n.prototype.Bt=function(){var t=this;this.Pt||(ht({callback:function(r){var i=r.error,e=qt(),o=e.getIntegration(n),u=i&&!0===i.__sentry_own_request__;if(o&&!Rn()&&!u){var s=e.getClient(),c=y(i)?t.Wt(r.msg,r.url,r.line,r.column):t.$t(En(i,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),r.url,r.line,r.column);H(c,{handled:!1,type:"onerror"}),e.captureEvent(c,{originalException:i})}},type:"error"}),this.Pt=!0)},n.prototype.Jt=function(){var r=this;this.Xt||(ht({callback:function(i){var e=i;try{"reason"in i?e=i.reason:"detail"in i&&"reason"in i.detail&&(e=i.detail.reason)}catch(t){}var o=qt(),u=o.getIntegration(n),s=e&&!0===e.__sentry_own_request__;if(!u||Rn()||s)return!0;var c=o.getClient(),a=y(e)?r.Gt(e):En(e,void 0,{attachStacktrace:c&&c.getOptions().attachStacktrace,rejection:!0});a.level=t.Severity.Error,H(a,{handled:!1,type:"onunhandledrejection"}),o.captureEvent(a,{originalException:e})},type:"unhandledrejection"}),this.Xt=!0)},n.prototype.Wt=function(t,n,r,i){var e,o=l(t)?t.message:t;if(p(o)){var u=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);u&&(e=u[1],o=u[2])}var s={exception:{values:[{type:e||"Error",value:o}]}};return this.$t(s,n,r,i)},n.prototype.Gt=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},n.prototype.$t=function(t,n,r,i){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var e=isNaN(parseInt(i,10))?void 0:i,o=isNaN(parseInt(r,10))?void 0:r,u=p(n)&&n.length>0?n:function(){try{return document.location.href}catch(t){return""}}();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:e,filename:u,function:"?",in_app:!0,lineno:o}),t},n.id="GlobalHandlers",n}(),Cn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],An=function(){function t(n){this.name=t.id,this.ut=c({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},n)}return t.prototype.setupOnce=function(){var t=M();(this.ut.setTimeout&&z(t,"setTimeout",this.zt.bind(this)),this.ut.setInterval&&z(t,"setInterval",this.zt.bind(this)),this.ut.requestAnimationFrame&&z(t,"requestAnimationFrame",this.Kt.bind(this)),this.ut.XMLHttpRequest&&"XMLHttpRequest"in t&&z(XMLHttpRequest.prototype,"send",this.Vt.bind(this)),this.ut.eventTarget)&&(Array.isArray(this.ut.eventTarget)?this.ut.eventTarget:Cn).forEach(this.Qt.bind(this))},t.prototype.zt=function(t){return function(){for(var n=[],r=0;r"}0!==n.length&&qt().addBreadcrumb({category:"ui."+t.name,message:n},{event:t.event,name:t.name,global:t.global})},n.prototype.tn=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var n=t.xhr.__sentry_xhr__||{},r=n.method,i=n.url,e=n.status_code,o=n.body;qt().addBreadcrumb({category:"xhr",data:{method:r,url:i,status_code:e},type:"http"},{xhr:t.xhr,input:o})}else;},n.prototype.nn=function(n){n.endTimestamp&&(n.fetchData.url.match(/sentry_key/)&&"POST"===n.fetchData.method||(n.error?qt().addBreadcrumb({category:"fetch",data:n.fetchData,level:t.Severity.Error,type:"http"},{data:n.error,input:n.args}):qt().addBreadcrumb({category:"fetch",data:c(c({},n.fetchData),{status_code:n.response.status}),type:"http"},{input:n.args,response:n.response})))},n.prototype.rn=function(t){var n=M(),r=t.from,i=t.to,e=A(n.location.href),o=A(r),u=A(i);o.path||(o=e),e.protocol===u.protocol&&e.host===u.host&&(i=u.relative),e.protocol===o.protocol&&e.host===o.host&&(r=o.relative),qt().addBreadcrumb({category:"navigation",data:{from:r,to:i}})},n.id="Breadcrumbs",n}(),Ln="cause",Un=5,Hn=function(){function t(n){void 0===n&&(n={}),this.name=t.id,this.in=n.key||Ln,this.O=n.limit||Un}return t.prototype.setupOnce=function(){Rt(function(n,r){var i=qt().getIntegration(t);return i?i.en(n,r):n})},t.prototype.en=function(t,n){if(!(t.exception&&t.exception.values&&n&&E(n.originalException,Error)))return t;var r=this.on(n.originalException,this.in);return t.exception.values=h(r,t.exception.values),t},t.prototype.on=function(t,n,r){if(void 0===r&&(r=[]),!E(t[n],Error)||r.length+1>=this.O)return r;var i=yn(vn(t[n]));return this.on(t[n],n,h([i],r))},t.id="LinkedErrors",t}(),Fn=M(),Pn=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){Rt(function(n){var r,i,e;if(qt().getIntegration(t)){if(!Fn.navigator&&!Fn.location&&!Fn.document)return n;var o=(null===(r=n.request)||void 0===r?void 0:r.url)||(null===(i=Fn.location)||void 0===i?void 0:i.href),u=(Fn.document||{}).referrer,s=(Fn.navigator||{}).userAgent,a=c(c(c({},null===(e=n.request)||void 0===e?void 0:e.headers),u&&{Referer:u}),s&&{"User-Agent":s}),f=c(c({},o&&{url:o}),{headers:a});return c(c({},n),{request:f})}return n})},t.id="UserAgent",t}(),Xn=Object.freeze({__proto__:null,GlobalHandlers:Mn,TryCatch:An,Breadcrumbs:qn,LinkedErrors:Hn,UserAgent:Pn}),Bn=function(t){function n(n){void 0===n&&(n={});return n.Ct=n.Ct||{},n.Ct.sdk=n.Ct.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:Zt}],version:Zt},t.call(this,Dn,n)||this}return r(n,t),n.prototype.showReportDialog=function(t){void 0===t&&(t={}),M().document&&(this.lt()?Nn(c(c({},t),{dsn:t.dsn||this.getDsn()})):J.error("Trying to call showReportDialog with Sentry Client disabled"))},n.prototype.pt=function(n,r,i){return n.platform=n.platform||"javascript",t.prototype.pt.call(this,n,r,i)},n.prototype.gt=function(n){var r=this.getIntegration(qn);r&&r.addSentryBreadcrumb(n),t.prototype.gt.call(this,n)},n}(Wt),Jn=[new rn,new tn,new An,new qn,new Mn,new Hn,new Pn];var Wn={},$n=M();$n.Sentry&&$n.Sentry.Integrations&&(Wn=$n.Sentry.Integrations);var Gn=c(c(c({},Wn),en),Xn);return t.BrowserClient=Bn,t.Hub=Mt,t.Integrations=Gn,t.SDK_NAME="sentry.javascript.browser",t.SDK_VERSION=Zt,t.Scope=Dt,t.Transports=On,t.addBreadcrumb=function(t){Ft("addBreadcrumb",t)},t.addGlobalEventProcessor=Rt,t.captureEvent=function(t){return Ft("captureEvent",t)},t.captureException=captureException,t.captureMessage=function(t,n){var r;try{throw new Error(t)}catch(t){r=t}return Ft("captureMessage",t,"string"==typeof n?n:void 0,c({originalException:t,syntheticException:r},"string"!=typeof n?{captureContext:n}:void 0))},t.close=function(t){var n=qt().getClient();return n?n.close(t):xt.reject(!1)},t.configureScope=function(t){Ft("configureScope",t)},t.defaultIntegrations=Jn,t.eventFromException=wn,t.eventFromMessage=gn,t.flush=function(t){var n=qt().getClient();return n?n.flush(t):xt.reject(!1)},t.forceLoad=function(){},t.getCurrentHub=qt,t.getHubFromCarrier=Ut,t.init=function(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=Jn),void 0===t.release){var n=M();n.SENTRY_RELEASE&&n.SENTRY_RELEASE.id&&(t.release=n.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),function(t,n){!0===n.debug&&J.enable();var r=qt(),i=new t(n);r.bindClient(i)}(Bn,t),t.autoSessionTracking&&function(){if(void 0!==M().document){var t=qt();"startSession"in t&&(t.startSession(),t.captureSession(),ht({callback:function(){t.startSession(),t.captureSession()},type:"history"}))}else J.warn("Session tracking in non-browser environment with @sentry/browser is not supported.")}()},t.injectReportDialog=Nn,t.lastEventId=function(){return qt().lastEventId()},t.makeMain=At,t.onLoad=function(t){t()},t.setContext=function(t,n){Ft("setContext",t,n)},t.setExtra=function(t,n){Ft("setExtra",t,n)},t.setExtras=function(t){Ft("setExtras",t)},t.setTag=function(t,n){Ft("setTag",t,n)},t.setTags=function(t){Ft("setTags",t)},t.setUser=function(t){Ft("setUser",t)},t.showReportDialog=function(t){void 0===t&&(t={}),t.eventId||(t.eventId=qt().lastEventId());var n=qt().getClient();n&&n.showReportDialog(t)},t.startTransaction=function(t,n){return Ft("startTransaction",c({},t),n)},t.withScope=Pt,t.wrap=function(t){return In(t)()},t}({}); +/*! @sentry/browser 8.35.0 (4e33b54) | https://github.com/getsentry/sentry-javascript */ +var Sentry=function(t){t=window.Sentry||{};const n=Object.prototype.toString;function e(t){switch(n.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return l(t,Error)}}function r(t,e){return n.call(t)===`[object ${e}]`}function o(t){return r(t,"ErrorEvent")}function i(t){return r(t,"DOMError")}function s(t){return r(t,"String")}function c(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function u(t){return null===t||c(t)||"object"!=typeof t&&"function"!=typeof t}function a(t){return r(t,"Object")}function f(t){return"undefined"!=typeof Event&&l(t,Event)}function h(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function l(t,n){try{return t instanceof n}catch(t){return!1}}function d(t){return!("object"!=typeof t||null===t||!t.__isVue&&!t.t)}function p(t,n=0){return"string"!=typeof t||0===n||t.length<=n?t:`${t.slice(0,n)}...`}function m(t,n){if(!Array.isArray(t))return"";const e=[];for(let n=0;ny(t,n,e)))}function v(t,n,e=250,r,o,i,s){if(!(i.exception&&i.exception.values&&s&&l(s.originalException,Error)))return;const c=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var u,a;c&&(i.exception.values=(u=b(t,n,o,s.originalException,r,i.exception.values,c,0),a=e,u.map((t=>(t.value&&(t.value=p(t.value,a)),t)))))}function b(t,n,e,r,o,i,s,c){if(i.length>=e+1)return i;let u=[...i];if(l(r[o],Error)){_(s,c);const i=t(n,r[o]),a=u.length;w(i,o,a,c),u=b(t,n,e,r[o],o,[i,...u],i,a)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(l(r,Error)){_(s,c);const a=t(n,r),f=u.length;w(a,`errors[${i}]`,f,c),u=b(t,n,e,r,o,[a,...u],a,f)}})),u}function _(t,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,..."AggregateError"===t.type&&{is_exception_group:!0},exception_id:n}}function w(t,n,e,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:n,exception_id:e,parent_id:r}}function E(t){return void 0===t?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const S="8.35.0",$=globalThis;function x(t,n,e){const r=e||$,o=r.__SENTRY__=r.__SENTRY__||{},i=o[S]=o[S]||{};return i[t]||(i[t]=n())}const k=$,I=80;function j(t,n={}){if(!t)return"";try{let e=t;const r=5,o=[];let i=0,s=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||I;for(;e&&i++1&&s+o.length*u+a.length>=h));)o.push(a),s+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return""}}function T(t,n){const e=t,r=[];if(!e||!e.tagName)return"";if(k.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const o=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(o&&o.length)o.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{e.id&&r.push(`#${e.id}`);const t=e.className;if(t&&s(t)){const n=t.split(/\s+/);for(const t of n)r.push(`.${t}`)}}const i=["aria-label","type","name","title","alt"];for(const t of i){const n=e.getAttribute(t);n&&r.push(`[${t}="${n}"]`)}return r.join("")}const O=["debug","info","warn","error","log","assert","trace"],R={};function C(t){if(!("console"in $))return t();const n=$.console,e={},r=Object.keys(R);r.forEach((t=>{const r=R[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const A=x("logger",(function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return O.forEach((t=>{n[t]=()=>{}})),n})),D=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function M(t,n=!1){const{host:e,path:r,pass:o,port:i,projectId:s,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function N(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function P(t){const n="string"==typeof t?function(t){const n=D.exec(t);if(!n)return void C((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[e,r,o="",i="",s="",c=""]=n.slice(1);let u="",a=c;const f=a.split("/");if(f.length>1&&(u=f.slice(0,-1).join("/"),a=f.pop()),a){const t=a.match(/^\d+/);t&&(a=t[0])}return N({host:i,pass:o,path:u,projectId:a,port:s,protocol:e,publicKey:r})}(t):N(t);if(n)return n}class L extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function U(t,n,e){if(!(n in t))return;const r=t[n],o=e(r);"function"==typeof o&&B(o,r),t[n]=o}function F(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(t){}}function B(t,n){try{const e=n.prototype||{};t.prototype=n.prototype=e,F(t,"__sentry_original__",n)}catch(t){}}function W(t){return t.__sentry_original__}function q(t){if(e(t))return{message:t.message,name:t.name,stack:t.stack,...z(t)};if(f(t)){const n={type:t.type,target:H(t.target),currentTarget:H(t.currentTarget),...z(t)};return"undefined"!=typeof CustomEvent&&l(t,CustomEvent)&&(n.detail=t.detail),n}return t}function H(t){try{return n=t,"undefined"!=typeof Element&&l(n,Element)?j(t):Object.prototype.toString.call(t)}catch(t){return""}var n}function z(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function G(t){return Y(t,new Map)}function Y(t,n){if(function(t){if(!a(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.getOwnPropertyNames(t))void 0!==t[e]&&(r[e]=Y(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(Y(t,n))})),r}return t}const X=50,J="?",K=/\(error: (.*)\)/,V=/captureMessage|captureException/;function Q(...t){const n=t.sort(((t,n)=>t[0]-n[0])).map((t=>t[1]));return(t,e=0,r=0)=>{const o=[],i=t.split("\n");for(let t=e;t1024)continue;const s=K.test(e)?e.replace(K,"$1"):e;if(!s.match(/\S*Error: /)){for(const t of n){const n=t(s);if(n){o.push(n);break}}if(o.length>=X+r)break}}return function(t){if(!t.length)return[];const n=Array.from(t);/sentryWrapped/.test(Z(n).function||"")&&n.pop();n.reverse(),V.test(Z(n).function||"")&&(n.pop(),V.test(Z(n).function||"")&&n.pop());return n.slice(0,X).map((t=>({...t,filename:t.filename||Z(n).filename,function:t.function||J})))}(o.slice(r))}}function Z(t){return t[t.length-1]||{}}const tt="";function nt(t){try{return t&&"function"==typeof t&&t.name||tt}catch(t){return tt}}function et(t){const n=t.exception;if(n){const t=[];try{return n.values.forEach((n=>{n.stacktrace.frames&&t.push(...n.stacktrace.frames)})),t}catch(t){return}}}const rt={},ot={};function it(t,n){rt[t]=rt[t]||[],rt[t].push(n)}function st(t,n){ot[t]||(n(),ot[t]=!0)}function ct(t,n){const e=t&&rt[t];if(e)for(const t of e)try{t(n)}catch(t){}}function ut(){"console"in $&&O.forEach((function(t){t in $.console&&U($.console,t,(function(n){return R[t]=n,function(...n){ct("console",{args:n,level:t});const e=R[t];e&&e.apply($.console,n)}}))}))}const at=$;function ft(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ht(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in at))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}())return!1;if(ft(at.fetch))return!0;let t=!1;const n=at.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(t=ft(e.contentWindow.fetch)),n.head.removeChild(e)}catch(t){}return t}const lt=1e3;function dt(){return Date.now()/lt}const pt=function(){const{performance:t}=$;if(!t||!t.now)return dt;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/lt}();function mt(t,n){const r="fetch";it(r,t),st(r,(()=>function(t,n=!1){if(n&&!ht())return;U($,"fetch",(function(n){return function(...r){const{method:o,url:i}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[n,e]=t;return{url:gt(n),method:yt(e,"method")?String(e.method).toUpperCase():"GET"}}const n=t[0];return{url:gt(n),method:yt(n,"method")?String(n.method).toUpperCase():"GET"}}(r),s={args:r,fetchData:{method:o,url:i},startTimestamp:1e3*pt()};t||ct("fetch",{...s});const c=(new Error).stack;return n.apply($,r).then((async n=>(t?t(n):ct("fetch",{...s,endTimestamp:1e3*pt(),response:n}),n)),(t=>{throw ct("fetch",{...s,endTimestamp:1e3*pt(),error:t}),e(t)&&void 0===t.stack&&(t.stack=c,F(t,"framesToPop",1)),t}))}}))}(void 0,n)))}function yt(t,n){return!!t&&"object"==typeof t&&!!t[n]}function gt(t){return"string"==typeof t?t:t?yt(t,"url")?t.url:t.toString?t.toString():"":""}(()=>{const{performance:t}=$;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,i=o16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function St(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function $t(t){const{message:n,event_id:e}=t;if(n)return n;const r=St(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||e||"":e||""}function xt(t,n,e){const r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=n||""),i.type||(i.type=e||"Error")}function kt(t,n){const e=St(t);if(!e)return;const r=e.mechanism;if(e.mechanism={type:"generic",handled:!0,...r,...n},n&&"data"in n){const t={...r&&r.data,...n.data};e.mechanism.data=t}}function It(t){if(t&&t.__sentry_captured__)return!0;try{F(t,"__sentry_captured__",!0)}catch(t){}return!1}function jt(t){return Array.isArray(t)?t:[t]}function Tt(t,n=100,e=1/0){try{return Rt("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function Ot(t,n=3,e=102400){const r=Tt(t,n);return o=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(o))>e?Ot(t,n-1,e):r;var o}function Rt(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t=r){h[t]="[MaxProperties ~]";break}const n=p[t];h[t]=Rt(t,n,u-1,r,o),l++}return s(n),h}var Ct;function At(t){return new Mt((n=>{n(t)}))}function Dt(t){return new Mt(((n,e)=>{e(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(Ct||(Ct={}));class Mt{constructor(t){Mt.prototype.__init.call(this),Mt.prototype.__init2.call(this),Mt.prototype.__init3.call(this),Mt.prototype.__init4.call(this),this.i=Ct.PENDING,this.u=[];try{t(this.h,this.l)}catch(t){this.l(t)}}then(t,n){return new Mt(((e,r)=>{this.u.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.p()}))}catch(t){return this.then((t=>t),t)}finally(t){return new Mt(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.h=t=>{this.m(Ct.RESOLVED,t)}}__init2(){this.l=t=>{this.m(Ct.REJECTED,t)}}__init3(){this.m=(t,n)=>{this.i===Ct.PENDING&&(h(n)?n.then(this.h,this.l):(this.i=t,this.v=n,this.p()))}}__init4(){this.p=()=>{if(this.i===Ct.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.i===Ct.RESOLVED&&t[1](this.v),this.i===Ct.REJECTED&&t[2](this.v),t[0]=!0)}))}}}function Nt(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]||Promise.resolve(void 0)}return{$:n,add:function(r){if(!(void 0===t||n.lengthe(o))).then(null,(()=>e(o).then(null,(()=>{})))),o},drain:function(t){return new Mt(((e,r)=>{let o=n.length;if(!o)return e(!0);const i=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{At(t).then((()=>{--o||(clearTimeout(i),e(!0))}),r)}))}))}}}function Pt(t){if(!t)return{};const n=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!n)return{};const e=n[6]||"",r=n[8]||"";return{host:n[4],path:n[5],protocol:n[2],search:e,hash:r,relative:n[5]+e+r}}const Lt=["fatal","error","warning","log","info","debug"];function Ut(t){return"warn"===t?"warning":Lt.includes(t)?t:"log"}const Ft="sentry-",Bt=/^sentry-/,Wt=8192;function qt(t){const n=function(t){if(!t||!s(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,n)=>{const e=zt(n);return Object.entries(e).forEach((([n,e])=>{t[n]=e})),t}),{});return zt(t)}(t);if(!n)return;const e=Object.entries(n).reduce(((t,[n,e])=>{if(n.match(Bt)){t[n.slice(Ft.length)]=e}return t}),{});return Object.keys(e).length>0?e:void 0}function Ht(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce(((t,[n,e],r)=>{const o=`${encodeURIComponent(n)}=${encodeURIComponent(e)}`,i=0===r?o:`${t},${o}`;return i.length>Wt?t:i}),"")}(Object.entries(t).reduce(((t,[n,e])=>(e&&(t[`${Ft}${n}`]=e),t)),{}))}function zt(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[n,e])=>(n&&e&&(t[n]=e),t)),{})}const Gt=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Yt(t,n){const e=function(t){if(!t)return;const n=t.match(Gt);if(!n)return;let e;return"1"===n[3]?e=!0:"0"===n[3]&&(e=!1),{traceId:n[1],parentSampled:e,parentSpanId:n[2]}}(t),r=qt(n),{traceId:o,parentSpanId:i,parentSampled:s}=e||{};return e?{traceId:o||Et(),parentSpanId:i||Et().substring(16),spanId:Et().substring(16),sampled:s,dsc:r||{}}:{traceId:o||Et(),spanId:Et().substring(16)}}function Xt(t,n=[]){return[t,n]}function Jt(t,n){const[e,r]=t;return[e,[...r,n]]}function Kt(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function Vt(t){return $.__SENTRY__&&$.__SENTRY__.encodePolyfill?$.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function Qt(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[Vt(r),t]:r.push("string"==typeof t?Vt(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(Tt(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}function Zt(t){const n="string"==typeof t.data?Vt(t.data):t.data;return[G({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const tn={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function nn(t){return tn[t]}function en(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}const rn=6e4;function on(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},i=e&&e["x-sentry-rate-limits"],s=e&&e["retry-after"];if(i)for(const t of i.trim().split(",")){const[n,e,,,i]=t.split(":",5),s=parseInt(n,10),c=1e3*(isNaN(s)?60:s);if(e)for(const t of e.split(";"))"metric_bucket"===t&&i&&!i.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else s?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?rn:r-n}(s,r):429===n&&(o.all=r+6e4);return o}function sn(){return{traceId:Et(),spanId:Et().substring(16)}}const cn=$;const un=()=>{},an=["attachTo","createForm","createWidget","remove"],fn=Object.assign((t=>(C((()=>{console.warn("You are using feedbackIntegration() even though this bundle does not include feedback.")})),{name:"Feedback",...an.reduce(((t,n)=>(t[n]=un,t)),{})})),{_isShim:!0}),hn=["start","stop","flush"];function ln(){return dn($),$}function dn(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||S,n[S]=n[S]||{}}function pn(t){const n=pt(),e={sid:Et(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return G({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}})}(e)};return t&&mn(e,t),e}function mn(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||pt(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:Et()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}const yn="_sentrySpan";function gn(t,n){n?F(t,yn,n):delete t[yn]}function vn(t){return t[yn]}class bn{constructor(){this._=!1,this.S=[],this.k=[],this.I=[],this.j=[],this.T={},this.O={},this.R={},this.C={},this.A={},this.D=sn()}clone(){const t=new bn;return t.I=[...this.I],t.O={...this.O},t.R={...this.R},t.C={...this.C},t.T=this.T,t.M=this.M,t.N=this.N,t.P=this.P,t.L=this.L,t.k=[...this.k],t.U=this.U,t.j=[...this.j],t.A={...this.A},t.D={...this.D},t.F=this.F,t.B=this.B,gn(t,vn(this)),t}setClient(t){this.F=t}setLastEventId(t){this.B=t}getClient(){return this.F}lastEventId(){return this.B}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.k.push(t),this}setUser(t){return this.T=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.N&&mn(this.N,{user:t}),this.W(),this}getUser(){return this.T}getRequestSession(){return this.U}setRequestSession(t){return this.U=t,this}setTags(t){return this.O={...this.O,...t},this.W(),this}setTag(t,n){return this.O={...this.O,[t]:n},this.W(),this}setExtras(t){return this.R={...this.R,...t},this.W(),this}setExtra(t,n){return this.R={...this.R,[t]:n},this.W(),this}setFingerprint(t){return this.L=t,this.W(),this}setLevel(t){return this.M=t,this.W(),this}setTransactionName(t){return this.P=t,this.W(),this}setContext(t,n){return null===n?delete this.C[t]:this.C[t]=n,this.W(),this}setSession(t){return t?this.N=t:delete this.N,this.W(),this}getSession(){return this.N}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof _n?[n.getScopeData(),n.getRequestSession()]:a(n)?[t,t.requestSession]:[],{tags:o,extra:i,user:s,contexts:c,level:u,fingerprint:f=[],propagationContext:h}=e||{};return this.O={...this.O,...o},this.R={...this.R,...i},this.C={...this.C,...c},s&&Object.keys(s).length&&(this.T=s),u&&(this.M=u),f.length&&(this.L=f),h&&(this.D=h),r&&(this.U=r),this}clear(){return this.I=[],this.O={},this.R={},this.T={},this.C={},this.M=void 0,this.P=void 0,this.L=void 0,this.U=void 0,this.N=void 0,gn(this,void 0),this.j=[],this.D=sn(),this.W(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:dt(),...t},o=this.I;return o.push(r),this.I=o.length>e?o.slice(-e):o,this.W(),this}getLastBreadcrumb(){return this.I[this.I.length-1]}clearBreadcrumbs(){return this.I=[],this.W(),this}addAttachment(t){return this.j.push(t),this}clearAttachments(){return this.j=[],this}getScopeData(){return{breadcrumbs:this.I,attachments:this.j,contexts:this.C,tags:this.O,extra:this.R,user:this.T,level:this.M,fingerprint:this.L||[],eventProcessors:this.k,propagationContext:this.D,sdkProcessingMetadata:this.A,transactionName:this.P,span:vn(this)}}setSDKProcessingMetadata(t){return this.A={...this.A,...t},this}setPropagationContext(t){return this.D=t,this}getPropagationContext(){return this.D}captureException(t,n){const e=n&&n.event_id?n.event_id:Et();if(!this.F)return A.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.F.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:Et();if(!this.F)return A.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.F.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:Et();return this.F?(this.F.captureEvent(t,{...n,event_id:e},this),e):(A.warn("No client configured on scope - will not capture event!"),e)}W(){this._||(this._=!0,this.S.forEach((t=>{t(this)})),this._=!1)}}const _n=bn;class wn{constructor(t,n){let e,r;e=t||new _n,r=n||new _n,this.q=[{scope:e}],this.H=r}withScope(t){const n=this.G();let e;try{e=t(n)}catch(t){throw this.Y(),t}return h(e)?e.then((t=>(this.Y(),t)),(t=>{throw this.Y(),t})):(this.Y(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.H}getStackTop(){return this.q[this.q.length-1]}G(){const t=this.getScope().clone();return this.q.push({client:this.getClient(),scope:t}),t}Y(){return!(this.q.length<=1)&&!!this.q.pop()}}function En(){const t=dn(ln());return t.stack=t.stack||new wn(x("defaultCurrentScope",(()=>new _n)),x("defaultIsolationScope",(()=>new _n)))}function Sn(t){return En().withScope(t)}function $n(t,n){const e=En();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function xn(t){return En().withScope((()=>t(En().getIsolationScope())))}function kn(t){const n=dn(t);return n.acs?n.acs:{withIsolationScope:xn,withScope:Sn,withSetScope:$n,withSetIsolationScope:(t,n)=>xn(n),getCurrentScope:()=>En().getScope(),getIsolationScope:()=>En().getIsolationScope()}}function In(){return kn(ln()).getCurrentScope()}function jn(){return kn(ln()).getIsolationScope()}function Tn(){return x("globalScope",(()=>new _n))}function On(...t){const n=kn(ln());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}function Rn(){return In().getClient()}const Cn="_sentryMetrics";function An(t){const n=t[Cn];if(!n)return;const e={};for(const[,[t,r]]of n){(e[t]||(e[t]=[])).push(G(r))}return e}const Dn="sentry.source",Mn="sentry.sample_rate",Nn="sentry.op",Pn="sentry.origin",Ln=0,Un=1,Fn=1;function Bn(t){const{spanId:n,traceId:e}=t.spanContext(),{parent_span_id:r}=Hn(t);return G({parent_span_id:r,span_id:n,trace_id:e})}function Wn(t){return"number"==typeof t?qn(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?qn(t.getTime()):pt()}function qn(t){return t>9999999999?t/1e3:t}function Hn(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:i,endTime:s,parentSpanId:c,status:u}=t;return G({span_id:n,trace_id:e,data:r,description:i,parent_span_id:c,start_timestamp:Wn(o),timestamp:Wn(s)||void 0,status:Gn(u),op:r[Nn],origin:r[Pn],_metrics_summary:An(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function zn(t){const{traceFlags:n}=t.spanContext();return n===Fn}function Gn(t){if(t&&t.code!==Ln)return t.code===Un?"ok":t.message||"unknown_error"}const Yn="_sentryRootSpan";function Xn(t){return t[Yn]||t}const Jn="production",Kn="_frozenDsc";function Vn(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=G({environment:e.environment||Jn,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}function Qn(t){const n=Rn();if(!n)return{};const e=Vn(Hn(t).trace_id||"",n),r=Xn(t),o=r[Kn];if(o)return o;const i=r.spanContext().traceState,s=i&&i.get("sentry.dsc"),c=s&&qt(s);if(c)return c;const u=Hn(r),a=u.data||{},f=a[Mn];null!=f&&(e.sample_rate=`${f}`);const h=a[Dn],l=u.description;return"url"!==h&&l&&(e.transaction=l),function(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=Rn(),e=t||n&&n.getOptions();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}()&&(e.sampled=String(zn(r))),n.emit("createDsc",e,r),e}function Zn(t,n,e,r){const o=en(e),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const s=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:M(r)},...o&&{trace:G({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return Xt(s,[[{type:i},t]])}function te(t,n,e,r=0){return new Mt(((o,i)=>{const s=t[r];if(null===n||"function"!=typeof s)o(n);else{const c=s({...n},e);h(c)?c.then((n=>te(t,n,e,r+1).then(o))).then(null,i):te(t,c,e,r+1).then(o).then(null,i)}}))}function ne(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,transactionName:c}=n,u=G(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=G(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=G(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const h=G(i);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});s&&(t.level=s);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:Bn(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Qn(n),...t.sdkProcessingMetadata};const e=Xn(n),r=Hn(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?jt(t.fingerprint):[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,i)}function ee(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:a,eventProcessors:f,attachments:h,propagationContext:l,transactionName:d,span:p}=n;re(t,"extra",e),re(t,"tags",r),re(t,"user",o),re(t,"contexts",i),re(t,"sdkProcessingMetadata",c),s&&(t.level=s),d&&(t.transactionName=d),p&&(t.span=p),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),a.length&&(t.fingerprint=[...t.fingerprint,...a]),f.length&&(t.eventProcessors=[...t.eventProcessors,...f]),h.length&&(t.attachments=[...t.attachments,...h]),t.propagationContext={...t.propagationContext,...l}}function re(t,n,e){if(e&&Object.keys(e).length){t[n]={...t[n]};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[n][r]=e[r])}}function oe(t,n,e,r,o,i){const{normalizeDepth:s=3,normalizeMaxBreadth:c=1e3}=t,u={...n,event_id:n.event_id||e.event_id||Et(),timestamp:n.timestamp||dt()},a=e.integrations||t.integrations.map((t=>t.name));!function(t,n){const{environment:e,release:r,dist:o,maxValueLength:i=250}=n;"environment"in t||(t.environment="environment"in n?e:Jn);void 0===t.release&&void 0!==r&&(t.release=r);void 0===t.dist&&void 0!==o&&(t.dist=o);t.message&&(t.message=p(t.message,i));const s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=p(s.value,i));const c=t.request;c&&c.url&&(c.url=p(c.url,i))}(u,t),function(t,n){n.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...n])}(u,a),o&&o.emit("applyFrameMetadata",n),void 0===n.type&&function(t,n){const e=$._sentryDebugIds;if(!e)return;let r;const o=ie.get(n);o?r=o:(r=new Map,ie.set(n,r));const i=Object.entries(e).reduce(((t,[e,o])=>{let i;const s=r.get(e);s?i=s:(i=n(e),r.set(e,i));for(let n=i.length-1;n>=0;n--){const e=i[n];if(e.filename){t[e.filename]=o;break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=i[t.filename])}))}))}catch(t){}}(u,t.stackParser);const f=function(t,n){if(!n)return t;const e=t?t.clone():new _n;return e.update(n),e}(r,e.captureContext);e.mechanism&&kt(u,e.mechanism);const h=o?o.getEventProcessors():[],l=Tn().getScopeData();if(i){ee(l,i.getScopeData())}if(f){ee(l,f.getScopeData())}const d=[...e.attachments||[],...l.attachments];d.length&&(e.attachments=d),ne(u,l);return te([...h,...l.eventProcessors],u,e).then((t=>(t&&function(t){const n={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?n[t.abs_path]=t.debug_id:t.filename&&(n[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(t){}if(0===Object.keys(n).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const e=t.debug_meta.images;Object.entries(n).forEach((([t,n])=>{e.push({type:"sourcemap",code_file:t,debug_id:n})}))}(t),"number"==typeof s&&s>0?function(t,n,e){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:Tt(t.data,n,e)}})))},...t.user&&{user:Tt(t.user,n,e)},...t.contexts&&{contexts:Tt(t.contexts,n,e)},...t.extra&&{extra:Tt(t.extra,n,e)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Tt(t.contexts.trace.data,n,e)));t.spans&&(r.spans=t.spans.map((t=>({...t,...t.data&&{data:Tt(t.data,n,e)}}))));return r}(t,s,c):t)))}const ie=new WeakMap;function se(t){if(t)return function(t){return t instanceof _n||"function"==typeof t}(t)||function(t){return Object.keys(t).some((t=>ce.includes(t)))}(t)?{captureContext:t}:t}const ce=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function captureException(t,n){return In().captureException(t,se(n))}function ue(t,n){return In().captureEvent(t,n)}function ae(t,n){jn().setContext(t,n)}function fe(t){jn().setExtras(t)}function he(t,n){jn().setExtra(t,n)}function le(t){jn().setTags(t)}function de(t,n){jn().setTag(t,n)}function pe(t){jn().setUser(t)}function me(){return jn().lastEventId()}function ye(t){const n=Rn(),e=jn(),r=In(),{release:o,environment:i=Jn}=n&&n.getOptions()||{},{userAgent:s}=$.navigator||{},c=pn({release:o,environment:i,user:r.getUser()||e.getUser(),...s&&{userAgent:s},...t}),u=e.getSession();return u&&"ok"===u.status&&mn(u,{status:"exited"}),ge(),e.setSession(c),r.setSession(c),c}function ge(){const t=jn(),n=In(),e=n.getSession()||t.getSession();e&&function(t,n){let e={};n?e={status:n}:"ok"===t.status&&(e={status:"exited"}),mn(t,e)}(e),ve(),t.setSession(),n.setSession()}function ve(){const t=jn(),n=In(),e=Rn(),r=n.getSession()||t.getSession();r&&e&&e.captureSession(r)}function be(t=!1){t?ge():ve()}const _e="7";function we(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}function Ee(t,n){return e={sentry_key:t.publicKey,sentry_version:_e,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}function Se(t,n,e){return n||`${function(t){return`${we(t)}${t.projectId}/envelope/`}(t)}?${Ee(t,e)}`}const $e=[];function xe(t){const n=t.defaultIntegrations||[],e=t.integrations;let r;n.forEach((t=>{t.isDefaultInstance=!0})),r=Array.isArray(e)?[...n,...e]:"function"==typeof e?jt(e(n)):n;const o=function(t){const n={};return t.forEach((t=>{const{name:e}=t,r=n[e];r&&!r.isDefaultInstance&&t.isDefaultInstance||(n[e]=t)})),Object.values(n)}(r),i=o.findIndex((t=>"Debug"===t.name));if(i>-1){const[t]=o.splice(i,1);o.push(t)}return o}function ke(t,n){for(const e of n)e&&e.afterAllSetup&&e.afterAllSetup(t)}function Ie(t,n,e){if(!e[n.name]){if(e[n.name]=n,-1===$e.indexOf(n.name)&&"function"==typeof n.setupOnce&&(n.setupOnce(),$e.push(n.name)),n.setup&&"function"==typeof n.setup&&n.setup(t),"function"==typeof n.preprocessEvent){const e=n.preprocessEvent.bind(n);t.on("preprocessEvent",((n,r)=>e(n,r,t)))}if("function"==typeof n.processEvent){const e=n.processEvent.bind(n),r=Object.assign(((n,r)=>e(n,r,t)),{id:n.name});t.addEventProcessor(r)}}}class je{constructor(t){if(this.X=t,this._integrations={},this.J=0,this.K={},this.V={},this.k=[],t.dsn&&(this.Z=P(t.dsn)),this.Z){const n=Se(this.Z,t.tunnel,t._metadata?t._metadata.sdk:void 0);this.tt=t.transport({tunnel:this.X.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,e){const r=Et();if(It(t))return r;const o={event_id:r,...n};return this.nt(this.eventFromException(t,o).then((t=>this.et(t,o,e)))),o.event_id}captureMessage(t,n,e,r){const o={event_id:Et(),...e},i=c(t)?t:String(t),s=u(t)?this.eventFromMessage(i,n,o):this.eventFromException(t,o);return this.nt(s.then((t=>this.et(t,o,r)))),o.event_id}captureEvent(t,n,e){const r=Et();if(n&&n.originalException&&It(n.originalException))return r;const o={event_id:r,...n},i=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this.nt(this.et(t,o,i||e)),o.event_id}captureSession(t){"string"!=typeof t.release||(this.sendSession(t),mn(t,{init:!1}))}getDsn(){return this.Z}getOptions(){return this.X}getSdkMetadata(){return this.X._metadata}getTransport(){return this.tt}flush(t){const n=this.tt;return n?(this.emit("flush"),this.rt(t).then((e=>n.flush(t).then((t=>e&&t))))):At(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,this.emit("close"),t)))}getEventProcessors(){return this.k}addEventProcessor(t){this.k.push(t)}init(){(this.ot()||this.X.integrations.some((({name:t})=>t.startsWith("Spotlight"))))&&this.it()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];Ie(this,t,this._integrations),n||ke(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let e=Zn(t,this.Z,this.X._metadata,this.X.tunnel);for(const t of n.attachments||[])e=Jt(e,Zt(t));const r=this.sendEnvelope(e);r&&r.then((n=>this.emit("afterSendEvent",t,n)),null)}sendSession(t){const n=function(t,n,e,r){const o=en(e);return Xt({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:M(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this.Z,this.X._metadata,this.X.tunnel);this.sendEnvelope(n)}recordDroppedEvent(t,n,e){if(this.X.sendClientReports){const r="number"==typeof e?e:1,o=`${t}:${n}`;this.K[o]=(this.K[o]||0)+r}}on(t,n){const e=this.V[t]=this.V[t]||[];return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}emit(t,...n){const e=this.V[t];e&&e.forEach((t=>t(...n)))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this.ot()&&this.tt?this.tt.send(t).then(null,(t=>t)):At({})}it(){const{integrations:t}=this.X;this._integrations=function(t,n){const e={};return n.forEach((n=>{n&&Ie(t,n,e)})),e}(this,t),ke(this,t)}st(t,n){let e=!1,r=!1;const o=n.exception&&n.exception.values;if(o){r=!0;for(const t of o){const n=t.mechanism;if(n&&!1===n.handled){e=!0;break}}}const i="ok"===t.status;(i&&0===t.errors||i&&e)&&(mn(t,{...e&&{status:"crashed"},errors:t.errors||Number(r||e)}),this.captureSession(t))}rt(t){return new Mt((n=>{let e=0;const r=setInterval((()=>{0==this.J?(clearInterval(r),n(!0)):(e+=1,t&&e>=t&&(clearInterval(r),n(!1)))}),1)}))}ot(){return!1!==this.getOptions().enabled&&void 0!==this.tt}ct(t,n,e,r=jn()){const o=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||r.setLastEventId(t.event_id||n.event_id),oe(o,t,n,e,this,r).then((t=>{if(null===t)return t;const n={...r.getPropagationContext(),...e?e.getPropagationContext():void 0};if(!(t.contexts&&t.contexts.trace)&&n){const{traceId:e,spanId:r,parentSpanId:o,dsc:i}=n;t.contexts={trace:G({trace_id:e,span_id:r,parent_span_id:o}),...t.contexts};const s=i||Vn(e,this);t.sdkProcessingMetadata={dynamicSamplingContext:s,...t.sdkProcessingMetadata}}return t}))}et(t,n={},e){return this.ut(t,n,e).then((t=>t.event_id),(t=>{}))}ut(t,n,e){const r=this.getOptions(),{sampleRate:o}=r,i=Oe(t),s=Te(t),c=t.type||"error",u=`before send for type \`${c}\``,f=void 0===o?void 0:function(t){if("boolean"==typeof t)return Number(t);const n="string"==typeof t?parseFloat(t):t;return"number"!=typeof n||isNaN(n)||n<0||n>1?void 0:n}(o);if(s&&"number"==typeof f&&Math.random()>f)return this.recordDroppedEvent("sample_rate","error",t),Dt(new L(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const l="replay_event"===c?"replay":c,d=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this.ct(t,n,e,d).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l,t),new L("An event processor returned `null`, will not send event.","log");if(n.data&&!0===n.data.__sentry__)return e;const o=function(t,n,e,r){const{beforeSend:o,beforeSendTransaction:i,beforeSendSpan:s}=n;if(Te(e)&&o)return o(e,r);if(Oe(e)){if(e.spans&&s){const n=[];for(const r of e.spans){const e=s(r);e?n.push(e):t.recordDroppedEvent("before_send","span")}e.spans=n}if(i){if(e.spans){const t=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:t}}return i(e,r)}}return e}(this,r,e,n);return function(t,n){const e=`${n} must return \`null\` or a valid event.`;if(h(t))return t.then((t=>{if(!a(t)&&null!==t)throw new L(e);return t}),(t=>{throw new L(`${n} rejected with ${t}`)}));if(!a(t)&&null!==t)throw new L(e);return t}(o,u)})).then((r=>{if(null===r){if(this.recordDroppedEvent("before_send",l,t),i){const n=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",n)}throw new L(`${u} returned \`null\`, will not send event.`,"log")}const o=e&&e.getSession();if(!i&&o&&this.st(o,r),i){const t=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);t>0&&this.recordDroppedEvent("before_send","span",t)}const s=r.transaction_info;if(i&&s&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...s,source:t}}return this.sendEvent(r,n),r})).then(null,(t=>{if(t instanceof L)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new L(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}nt(t){this.J++,t.then((t=>(this.J--,t)),(t=>(this.J--,t)))}ft(){const t=this.K;return this.K={},Object.entries(t).map((([t,n])=>{const[e,r]=t.split(":");return{reason:e,category:r,quantity:n}}))}ht(){const t=this.ft();if(0===t.length)return;if(!this.Z)return;const n=(e=t,Xt((r=this.X.tunnel&&M(this.Z))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||dt(),discarded_events:e}]]));var e,r,o;this.sendEnvelope(n)}}function Te(t){return void 0===t.type}function Oe(t){return"transaction"===t.type}function Re(t){In().setClient(t)}const Ce=64;function Ae(t,n,e=Nt(t.bufferSize||Ce)){let r={};return{send:function(o){const i=[];if(Kt(o,((n,e)=>{const o=nn(e);if(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e}(r,o)){const r=De(n,e);t.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(n)})),0===i.length)return At({});const s=Xt(o[0],i),c=n=>{Kt(s,((e,r)=>{const o=De(e,r);t.recordDroppedEvent(n,nn(r),o)}))};return e.add((()=>n({body:Qt(s)}).then((t=>(r=on(r,t),t)),(t=>{throw c("network_error"),t})))).then((t=>t),(t=>{if(t instanceof L)return c("queue_overflow"),At({});throw t}))},flush:t=>e.drain(t)}}function De(t,n){if("event"===n||"transaction"===n)return Array.isArray(t)?t[1]:void 0}const Me=100;function Ne(t,n){const e=Rn(),r=jn();if(!e)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Me}=e.getOptions();if(i<=0)return;const s={timestamp:dt(),...t},c=o?C((()=>o(s,n))):s;null!==c&&(e.emit&&e.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,i))}let Pe;const Le=new WeakMap,Ue=()=>({name:"FunctionToString",setupOnce(){Pe=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=W(this),e=Le.has(Rn())&&void 0!==n?n:this;return Pe.apply(e,t)}}catch(t){}},setup(t){Le.set(t,!0)}}),Fe=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],Be=(t={})=>({name:"InboundFilters",processEvent(n,e,r){const o=r.getOptions(),i=function(t={},n={}){return{allowUrls:[...t.allowUrls||[],...n.allowUrls||[]],denyUrls:[...t.denyUrls||[],...n.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...n.ignoreErrors||[],...t.disableErrorDefaults?[]:Fe],ignoreTransactions:[...t.ignoreTransactions||[],...n.ignoreTransactions||[]],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(t,o);return function(t,n){if(n.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t))return!0;if(function(t,n){if(t.type||!n||!n.length)return!1;return function(t){const n=[];t.message&&n.push(t.message);let e;try{e=t.exception.values[t.exception.values.length-1]}catch(t){}e&&e.value&&(n.push(e.value),e.type&&n.push(`${e.type}: ${e.value}`));return n}(t).some((t=>g(t,n)))}(t,n.ignoreErrors))return!0;if(function(t){if(t.type)return!1;if(!t.exception||!t.exception.values||0===t.exception.values.length)return!1;return!t.message&&!t.exception.values.some((t=>t.stacktrace||t.type&&"Error"!==t.type||t.value))}(t))return!0;if(function(t,n){if("transaction"!==t.type||!n||!n.length)return!1;const e=t.transaction;return!!e&&g(e,n)}(t,n.ignoreTransactions))return!0;if(function(t,n){if(!n||!n.length)return!1;const e=We(t);return!!e&&g(e,n)}(t,n.denyUrls))return!0;if(!function(t,n){if(!n||!n.length)return!0;const e=We(t);return!e||g(e,n)}(t,n.allowUrls))return!0;return!1}(n,i)?null:n}});function We(t){try{let n;try{n=t.exception.values[0].stacktrace.frames}catch(t){}return n?function(t=[]){for(let n=t.length-1;n>=0;n--){const e=t[n];if(e&&""!==e.filename&&"[native code]"!==e.filename)return e.filename||null}return null}(n):null}catch(t){return null}}const qe=()=>{let t;return{name:"Dedupe",processEvent(n){if(n.type)return n;try{if(function(t,n){if(!n)return!1;if(function(t,n){const e=t.message,r=n.message;if(!e&&!r)return!1;if(e&&!r||!e&&r)return!1;if(e!==r)return!1;if(!ze(t,n))return!1;if(!He(t,n))return!1;return!0}(t,n))return!0;if(function(t,n){const e=Ge(n),r=Ge(t);if(!e||!r)return!1;if(e.type!==r.type||e.value!==r.value)return!1;if(!ze(t,n))return!1;if(!He(t,n))return!1;return!0}(t,n))return!0;return!1}(n,t))return null}catch(t){}return t=n}}};function He(t,n){let e=et(t),r=et(n);if(!e&&!r)return!0;if(e&&!r||!e&&r)return!1;if(r.length!==e.length)return!1;for(let t=0;tRn(),getScope:In,getIsolationScope:jn,captureException:(t,n)=>In().captureException(t,n),captureMessage:(t,n,e)=>In().captureMessage(t,n,e),captureEvent:ue,addBreadcrumb:Ne,setUser:pe,setTags:le,setTag:de,setExtra:he,setExtras:fe,setContext:ae,getIntegration(t){const n=Rn();return n&&n.getIntegrationByName(t.id)||null},startSession:ye,endSession:ge,captureSession(t){if(t)return ge();!function(){const t=In(),n=Rn(),e=t.getSession();n&&e&&n.captureSession(e)}()}}};const Xe=t=>(C((()=>{console.warn("You are using browserTracingIntegration() even though this bundle does not include tracing.")})),{name:"BrowserTracing"});function Je(){C((()=>{console.warn("You are using metrics even though this bundle does not include tracing.")}))}const Ke={increment:Je,distribution:Je,set:Je,gauge:Je,timing:(t,n)=>{if(Je(),"function"==typeof n)return n()}},Ve=$;let Qe=0;function Ze(){return Qe>0}function tr(t,n={},e){if("function"!=typeof t)return t;try{const n=t.__sentry_wrapped__;if(n)return"function"==typeof n?n:t;if(W(t))return t}catch(n){return t}const sentryWrapped=function(){const r=Array.prototype.slice.call(arguments);try{e&&"function"==typeof e&&e.apply(this,arguments);const o=r.map((t=>tr(t,n)));return t.apply(this,o)}catch(t){throw Qe++,setTimeout((()=>{Qe--})),On((e=>{e.addEventProcessor((t=>(n.mechanism&&(xt(t,void 0,void 0),kt(t,n.mechanism)),t.extra={...t.extra,arguments:r},t))),captureException(t)})),t}};try{for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(sentryWrapped[n]=t[n])}catch(t){}B(sentryWrapped,t),F(t,"__sentry_wrapped__",sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>t.name})}catch(t){}return sentryWrapped}function nr(t,n){const e=or(t,n),r={type:cr(n),value:ur(n)};return e.length&&(r.stacktrace={frames:e}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function er(t,n,e,r){const o=Rn(),i=o&&o.getOptions().normalizeDepth,s=function(t){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];if(e instanceof Error)return e}return}(n),c={__serialized__:Ot(n,i)};if(s)return{exception:{values:[nr(t,s)]},extra:c};const u={exception:{values:[{type:f(n)?n.constructor.name:r?"UnhandledRejection":"Error",value:dr(n,{isUnhandledRejection:r})}]},extra:c};if(e){const n=or(t,e);n.length&&(u.exception.values[0].stacktrace={frames:n})}return u}function rr(t,n){return{exception:{values:[nr(t,n)]}}}function or(t,n){const e=n.stacktrace||n.stack||"",r=function(t){if(t&&ir.test(t.message))return 1;return 0}(n),o=function(t){if("number"==typeof t.framesToPop)return t.framesToPop;return 0}(n);try{return t(e,r,o)}catch(t){}return[]}const ir=/Minified React error #\d+;/i;function sr(t){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&t instanceof WebAssembly.Exception}function cr(t){const n=t&&t.name;if(!n&&sr(t)){return t.message&&Array.isArray(t.message)&&2==t.message.length?t.message[0]:"WebAssembly.Exception"}return n}function ur(t){const n=t&&t.message;return n?n.error&&"string"==typeof n.error.message?n.error.message:sr(t)&&Array.isArray(t.message)&&2==t.message.length?t.message[1]:n:"No error message"}function ar(t,n,e,r){const o=hr(t,n,e&&e.syntheticException||void 0,r);return kt(o),o.level="error",e&&e.event_id&&(o.event_id=e.event_id),At(o)}function fr(t,n,e="info",r,o){const i=lr(t,n,r&&r.syntheticException||void 0,o);return i.level=e,r&&r.event_id&&(i.event_id=r.event_id),At(i)}function hr(t,n,s,c,u){let h;if(o(n)&&n.error){return rr(t,n.error)}if(i(n)||r(n,"DOMException")){const e=n;if("stack"in n)h=rr(t,n);else{const n=e.name||(i(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n;h=lr(t,r,s,c),xt(h,r)}return"code"in e&&(h.tags={...h.tags,"DOMException.code":`${e.code}`}),h}if(e(n))return rr(t,n);if(a(n)||f(n)){return h=er(t,n,s,u),kt(h,{synthetic:!0}),h}return h=lr(t,n,s,c),xt(h,`${n}`,void 0),kt(h,{synthetic:!0}),h}function lr(t,n,e,r){const o={};if(r&&e){const r=or(t,e);r.length&&(o.exception={values:[{value:n,stacktrace:{frames:r}}]})}if(c(n)){const{__sentry_template_string__:t,__sentry_template_values__:e}=n;return o.logentry={message:t,params:e},o}return o.message=n,o}function dr(t,{isUnhandledRejection:n}){const e=function(t,n=40){const e=Object.keys(q(t));e.sort();const r=e[0];if(!r)return"[object has no keys]";if(r.length>=n)return p(r,n);for(let t=e.length;t>0;t--){const r=e.slice(0,t).join(", ");if(!(r.length>n))return t===e.length?r:p(r,n)}return""}(t),r=n?"promise rejection":"exception";if(o(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if(f(t)){return`Event \`${function(t){try{const n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch(t){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${e}`}function pr(t,{metadata:n,tunnel:e,dsn:r}){const o={event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&n.sdk&&{sdk:{name:n.sdk.name,version:n.sdk.version}},...!!e&&!!r&&{dsn:M(r)}},i=function(t){return[{type:"user_report"},t]}(t);return Xt(o,[i])}class mr extends je{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t};!function(t,n,e=[n],r="npm"){const o=t._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${n}`,packages:e.map((t=>({name:`${r}:@sentry/${t}`,version:S}))),version:S}),t._metadata=o}(n,"browser",["browser"],Ve.SENTRY_SDK_SOURCE||"cdn"),super(n),n.sendClientReports&&Ve.document&&Ve.document.addEventListener("visibilitychange",(()=>{"hidden"===Ve.document.visibilityState&&this.ht()}))}eventFromException(t,n){return ar(this.X.stackParser,t,n,this.X.attachStacktrace)}eventFromMessage(t,n="info",e){return fr(this.X.stackParser,t,n,e,this.X.attachStacktrace)}captureUserFeedback(t){if(!this.ot())return;const n=pr(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}ct(t,n,e){return t.platform=t.platform||"javascript",super.ct(t,n,e)}}const yr=$,gr=1e3;let vr,br,_r,wr;function Er(){if(!yr.document)return;const t=ct.bind(null,"dom"),n=Sr(t,!0);yr.document.addEventListener("click",n,!1),yr.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach((n=>{const e=yr[n]&&yr[n].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(U(e,"addEventListener",(function(n){return function(e,r,o){if("click"===e||"keypress"==e)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=i[e]=i[e]||{refCount:0};if(!s.handler){const r=Sr(t);s.handler=r,n.call(this,e,r,o)}s.refCount++}catch(t){}return n.call(this,e,r,o)}})),U(e,"removeEventListener",(function(t){return function(n,e,r){if("click"===n||"keypress"==n)try{const e=this,o=e.__sentry_instrumentation_handlers__||{},i=o[n];i&&(i.refCount--,i.refCount<=0&&(t.call(this,n,i.handler,r),i.handler=void 0,delete o[n]),0===Object.keys(o).length&&delete e.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,n,e,r)}})))}))}function Sr(t,n=!1){return e=>{if(!e||e._sentryCaptured)return;const r=function(t){try{return t.target}catch(t){return null}}(e);if(function(t,n){return"keypress"===t&&(!n||!n.tagName||"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable)}(e.type,r))return;F(e,"_sentryCaptured",!0),r&&!r._sentryId&&F(r,"_sentryId",Et());const o="keypress"===e.type?"input":e.type;if(!function(t){if(t.type!==br)return!1;try{if(!t.target||t.target._sentryId!==_r)return!1}catch(t){}return!0}(e)){t({event:e,name:o,global:n}),br=e.type,_r=r?r._sentryId:void 0}clearTimeout(vr),vr=yr.setTimeout((()=>{_r=void 0,br=void 0}),gr)}}function $r(t){const n="history";it(n,t),st(n,xr)}function xr(){if(!function(){const t=cn.chrome,n=t&&t.app&&t.app.runtime,e="history"in cn&&!!cn.history.pushState&&!!cn.history.replaceState;return!n&&e}())return;const t=yr.onpopstate;function n(t){return function(...n){const e=n.length>2?n[2]:void 0;if(e){const t=wr,n=String(e);wr=n;ct("history",{from:t,to:n})}return t.apply(this,n)}}yr.onpopstate=function(...n){const e=yr.location.href,r=wr;wr=e;if(ct("history",{from:r,to:e}),t)try{return t.apply(this,n)}catch(t){}},U(yr.history,"pushState",n),U(yr.history,"replaceState",n)}const kr={};function Ir(t){kr[t]=void 0}const jr="__sentry_xhr_v3__";function Tr(){if(!yr.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(t,n,e){const r=1e3*pt(),o=s(e[0])?e[0].toUpperCase():void 0,i=function(t){if(s(t))return t;try{return t.toString()}catch(t){}return}(e[1]);if(!o||!i)return t.apply(n,e);n[jr]={method:o,url:i,request_headers:{}},"POST"===o&&i.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const t=n[jr];if(t&&4===n.readyState){try{t.status_code=n.status}catch(t){}ct("xhr",{endTimestamp:1e3*pt(),startTimestamp:r,xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(t,n,e)=>(c(),t.apply(n,e))}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(t,n,e){const[r,o]=e,i=n[jr];return i&&s(r)&&s(o)&&(i.request_headers[r.toLowerCase()]=o),t.apply(n,e)}}),t.apply(n,e)}}),t.send=new Proxy(t.send,{apply(t,n,e){const r=n[jr];if(!r)return t.apply(n,e);void 0!==e[0]&&(r.body=e[0]);return ct("xhr",{startTimestamp:1e3*pt(),xhr:n}),t.apply(n,e)}})}function Or(t,n=function(t){const n=kr[t];if(n)return n;let e=yr[t];if(ft(e))return kr[t]=e.bind(yr);const r=yr.document;if(r&&"function"==typeof r.createElement)try{const n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n);const o=n.contentWindow;o&&o[t]&&(e=o[t]),r.head.removeChild(n)}catch(t){}return e?kr[t]=e.bind(yr):e}("fetch")){let e=0,r=0;return Ae(t,(function(o){const i=o.body.length;e+=i,r++;const s={body:o.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:e<=6e4&&r<15,...t.fetchOptions};if(!n)return Ir("fetch"),Dt("No fetch implementation available");try{return n(t.url,s).then((t=>(e-=i,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 Ir("fetch"),e-=i,r--,Dt(t)}}))}function Rr(t,n,e,r){const o={filename:t,function:""===n?J:n,in_app:!0};return void 0!==e&&(o.lineno=e),void 0!==r&&(o.colno=r),o}const Cr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ar=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Dr=/\((\S*)(?::(\d+))(?::(\d+))\)/,Mr=[30,t=>{const n=Cr.exec(t);if(n){const[,t,e,r]=n;return Rr(t,J,+e,+r)}const e=Ar.exec(t);if(e){if(e[2]&&0===e[2].indexOf("eval")){const t=Dr.exec(e[2]);t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3])}const[t,n]=Yr(e[1]||J,e[2]);return Rr(n,t,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],Nr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Pr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Lr=[50,t=>{const n=Nr.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=Pr.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],e=n[1]||J;return[e,t]=Yr(e,t),Rr(t,e,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}}],Ur=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Fr=[40,t=>{const n=Ur.exec(t);return n?Rr(n[2],n[1]||J,+n[3],n[4]?+n[4]:void 0):void 0}],Br=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Wr=[10,t=>{const n=Br.exec(t);return n?Rr(n[2],n[3]||J,+n[1]):void 0}],qr=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Hr=[20,t=>{const n=qr.exec(t);return n?Rr(n[5],n[3]||n[4]||J,+n[1],+n[2]):void 0}],zr=[Mr,Lr],Gr=Q(...zr),Yr=(t,n)=>{const e=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return e||r?[-1!==t.indexOf("@")?t.split("@")[0]:J,e?`safari-extension:${n}`:`safari-web-extension:${n}`]:[t,n]},Xr=1024,Jr=(t={})=>{const n={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(t){var e;n.console&&function(t){const n="console";it(n,t),st(n,ut)}(function(t){return function(n){if(Rn()!==t)return;const e={category:"console",data:{arguments:n.args,logger:"console"},level:Ut(n.level),message:m(n.args," ")};if("assert"===n.level){if(!1!==n.args[0])return;e.message=`Assertion failed: ${m(n.args.slice(1)," ")||"console.assert"}`,e.data.arguments=n.args.slice(1)}Ne(e,{input:n.args,level:n.level})}}(t)),n.dom&&(e=function(t,n){return function(e){if(Rn()!==t)return;let r,o,i="object"==typeof n?n.serializeAttribute:void 0,s="object"==typeof n&&"number"==typeof n.maxStringLength?n.maxStringLength:void 0;s&&s>Xr&&(s=Xr),"string"==typeof i&&(i=[i]);try{const t=e.event,n=function(t){return!!t&&!!t.target}(t)?t.target:t;r=j(n,{keyAttrs:i,maxStringLength:s}),o=function(t){if(!k.HTMLElement)return null;let n=t;for(let t=0;t<5;t++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(n)}catch(t){r=""}if(0===r.length)return;const c={category:`ui.${e.name}`,message:r};o&&(c.data={"ui.component_name":o}),Ne(c,{event:e.event,name:e.name,global:e.global})}}(t,n.dom),it("dom",e),st("dom",Er)),n.xhr&&function(t){it("xhr",t),st("xhr",Tr)}(function(t){return function(n){if(Rn()!==t)return;const{startTimestamp:e,endTimestamp:r}=n,o=n.xhr[jr];if(!e||!r||!o)return;const{method:i,url:s,status_code:c,body:u}=o,a={method:i,url:s,status_code:c},f={xhr:n.xhr,input:u,startTimestamp:e,endTimestamp:r};Ne({category:"xhr",data:a,type:"http",level:E(c)},f)}}(t)),n.fetch&&mt(function(t){return function(n){if(Rn()!==t)return;const{startTimestamp:e,endTimestamp:r}=n;if(r&&(!n.fetchData.url.match(/sentry_key/)||"POST"!==n.fetchData.method))if(n.error){Ne({category:"fetch",data:n.fetchData,level:"error",type:"http"},{data:n.error,input:n.args,startTimestamp:e,endTimestamp:r})}else{const t=n.response,o={...n.fetchData,status_code:t&&t.status},i={input:n.args,response:t,startTimestamp:e,endTimestamp:r};Ne({category:"fetch",data:o,type:"http",level:E(o.status_code)},i)}}}(t)),n.history&&$r(function(t){return function(n){if(Rn()!==t)return;let e=n.from,r=n.to;const o=Pt(Ve.location.href);let i=e?Pt(e):void 0;const s=Pt(r);i&&i.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(e=i.relative),Ne({category:"navigation",data:{from:e,to:r}})}}(t)),n.sentry&&t.on("beforeSendEvent",function(t){return function(n){Rn()===t&&Ne({category:"sentry."+("transaction"===n.type?"transaction":"event"),event_id:n.event_id,level:n.level,message:$t(n)},{event:n})}}(t))}}};const Kr=["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"],Vr=(t={})=>{const n={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){n.setTimeout&&U(Ve,"setTimeout",Qr),n.setInterval&&U(Ve,"setInterval",Qr),n.requestAnimationFrame&&U(Ve,"requestAnimationFrame",Zr),n.XMLHttpRequest&&"XMLHttpRequest"in Ve&&U(XMLHttpRequest.prototype,"send",to);const t=n.eventTarget;if(t){(Array.isArray(t)?t:Kr).forEach(no)}}}};function Qr(t){return function(...n){const e=n[0];return n[0]=tr(e,{mechanism:{data:{function:nt(t)},handled:!1,type:"instrument"}}),t.apply(this,n)}}function Zr(t){return function(n){return t.apply(this,[tr(n,{mechanism:{data:{function:"requestAnimationFrame",handler:nt(t)},handled:!1,type:"instrument"}})])}}function to(t){return function(...n){const e=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in e&&"function"==typeof e[t]&&U(e,t,(function(n){const e={mechanism:{data:{function:t,handler:nt(n)},handled:!1,type:"instrument"}},r=W(n);return r&&(e.mechanism.data.handler=nt(r)),tr(n,e)}))})),t.apply(this,n)}}function no(t){const n=Ve,e=n[t]&&n[t].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(U(e,"addEventListener",(function(n){return function(e,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=tr(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:nt(r),target:t},handled:!1,type:"instrument"}}))}catch(t){}return n.apply(this,[e,tr(r,{mechanism:{data:{function:"addEventListener",handler:nt(r),target:t},handled:!1,type:"instrument"}}),o])}})),U(e,"removeEventListener",(function(t){return function(n,e,r){const o=e;try{const e=o&&o.__sentry_wrapped__;e&&t.call(this,n,e,r)}catch(t){}return t.call(this,n,o,r)}})))}const eo=(t={})=>{const n={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){n.onerror&&function(t){!function(t){const n="error";it(n,t),st(n,bt)}((n=>{const{stackParser:e,attachStacktrace:r}=ro();if(Rn()!==t||Ze())return;const{msg:o,url:i,line:c,column:u,error:a}=n,f=function(t,n,e,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],c=i[0]=i[0]||{},u=c.stacktrace=c.stacktrace||{},a=u.frames=u.frames||[],f=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(e,10))?void 0:e,l=s(n)&&n.length>0?n:function(){try{return k.document.location.href}catch(t){return""}}();0===a.length&&a.push({colno:f,filename:l,function:J,in_app:!0,lineno:h});return t}(hr(e,a||o,void 0,r,!1),i,c,u);f.level="error",ue(f,{originalException:a,mechanism:{handled:!1,type:"onerror"}})}))}(t),n.onunhandledrejection&&function(t){!function(t){const n="unhandledrejection";it(n,t),st(n,wt)}((n=>{const{stackParser:e,attachStacktrace:r}=ro();if(Rn()!==t||Ze())return;const o=function(t){if(u(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}(n),i=u(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:hr(e,o,void 0,r,!0);i.level="error",ue(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(t)}}};function ro(){const t=Rn();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const oo=()=>({name:"HttpContext",preprocessEvent(t){if(!Ve.navigator&&!Ve.location&&!Ve.document)return;const n=t.request&&t.request.url||Ve.location&&Ve.location.href,{referrer:e}=Ve.document||{},{userAgent:r}=Ve.navigator||{},o={...t.request&&t.request.headers,...e&&{Referer:e},...r&&{"User-Agent":r}},i={...t.request,...n&&{url:n},headers:o};t.request=i}}),io=(t={})=>{const n=t.limit||5,e=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(t,r,o){const i=o.getOptions();v(nr,i.stackParser,i.maxValueLength,e,n,t,r)}}};function so(t){return[Be(),Ue(),Vr(),Jr(),eo(),io(),qe(),oo()]}const co={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",debugIntegration:"debug",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",sessionTimingIntegration:"sessiontiming",browserProfilingIntegration:"browserprofiling"},uo=Ve;return t.BrowserClient=mr,t.SDK_VERSION=S,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=Nn,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=Pn,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=Mn,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=Dn,t.Scope=_n,t.WINDOW=Ve,t.addBreadcrumb=Ne,t.addEventProcessor=function(t){jn().addEventProcessor(t)},t.addIntegration=function(t){const n=Rn();n&&n.addIntegration(t)},t.breadcrumbsIntegration=Jr,t.browserApiErrorsIntegration=Vr,t.browserTracingIntegration=Xe,t.captureEvent=ue,t.captureException=captureException,t.captureMessage=function(t,n){const e="string"==typeof n?n:void 0,r="string"!=typeof n?{captureContext:n}:void 0;return In().captureMessage(t,e,r)},t.captureSession=be,t.captureUserFeedback=function(t){const n=Rn();n&&n.captureUserFeedback(t)},t.chromeStackLineParser=Mr,t.close=async function(t){const n=Rn();return n?n.close(t):Promise.resolve(!1)},t.continueTrace=({sentryTrace:t,baggage:n},e)=>On((r=>{const o=Yt(t,n);return r.setPropagationContext(o),e()})),t.createTransport=Ae,t.createUserFeedbackEnvelope=pr,t.dedupeIntegration=qe,t.defaultStackLineParsers=zr,t.defaultStackParser=Gr,t.endSession=ge,t.eventFromException=ar,t.eventFromMessage=fr,t.exceptionFromError=nr,t.feedbackAsyncIntegration=fn,t.feedbackIntegration=fn,t.flush=async function(t){const n=Rn();return n?n.flush(t):Promise.resolve(!1)},t.forceLoad=function(){},t.functionToStringIntegration=Ue,t.geckoStackLineParser=Lr,t.getClient=Rn,t.getCurrentHub=Ye,t.getCurrentScope=In,t.getDefaultIntegrations=so,t.getGlobalScope=Tn,t.getIsolationScope=jn,t.globalHandlersIntegration=eo,t.httpContextIntegration=oo,t.inboundFiltersIntegration=Be,t.init=function(t={}){const n=function(t={}){const n={defaultIntegrations:so(),release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Ve.SENTRY_RELEASE&&Ve.SENTRY_RELEASE.id?Ve.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return null==t.defaultIntegrations&&delete t.defaultIntegrations,{...n,...t}}(t);if(function(){const t=void 0!==Ve.window&&Ve;if(!t)return!1;const n=t[t.chrome?"chrome":"browser"],e=n&&n.runtime&&n.runtime.id,r=Ve.location&&Ve.location.href||"",o=!!e&&Ve===Ve.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((t=>r.startsWith(`${t}//`))),i=void 0!==t.nw;return!!e&&!o&&!i}())return void C((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}));const e={...n,stackParser:(r=n.stackParser||Gr,Array.isArray(r)?Q(...r):r),integrations:xe(n),transport:n.transport||Or};var r;const o=function(t,n){!0===n.debug&&C((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),In().update(n.initialScope);const e=new t(n);return Re(e),e.init(),e}(mr,e);return n.autoSessionTracking&&function(){if(void 0===Ve.document)return;ye({ignoreDuration:!0}),be(),$r((({from:t,to:n})=>{void 0!==t&&t!==n&&(ye({ignoreDuration:!0}),be())}))}(),o},t.isInitialized=function(){return!!Rn()},t.lastEventId=me,t.lazyLoadIntegration=async function(t,n){const e=co[t],r=uo.Sentry=uo.Sentry||{};if(!e)throw new Error(`Cannot lazy load integration: ${t}`);const o=r[t];if("function"==typeof o&&!("_isShim"in o))return o;const i=function(t){const n=Rn(),e=n&&n.getOptions(),r=e&&e.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${S}/${t}.min.js`,r).toString()}(e),s=Ve.document.createElement("script");s.src=i,s.crossOrigin="anonymous",s.referrerPolicy="origin",n&&s.setAttribute("nonce",n);const c=new Promise(((t,n)=>{s.addEventListener("load",(()=>t())),s.addEventListener("error",n)})),u=Ve.document.currentScript,a=Ve.document.body||Ve.document.head||u&&u.parentElement;if(!a)throw new Error(`Could not find parent element to insert lazy-loaded ${t} script`);a.appendChild(s);try{await c}catch(n){throw new Error(`Error when loading integration: ${t}`)}const f=r[t];if("function"!=typeof f)throw new Error(`Could not load integration: ${t}`);return f},t.linkedErrorsIntegration=io,t.makeFetchTransport=Or,t.metrics=Ke,t.onLoad=function(t){t()},t.opera10StackLineParser=Wr,t.opera11StackLineParser=Hr,t.parameterize=function(t,...n){const e=new String(String.raw(t,...n));return e.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),e.__sentry_template_values__=n,e},t.replayIntegration=function(t){return C((()=>{console.warn("You are using replayIntegration() even though this bundle does not include replay.")})),{name:"Replay",...hn.reduce(((t,n)=>(t[n]=un,t)),{})}},t.setContext=ae,t.setCurrentClient=Re,t.setExtra=he,t.setExtras=fe,t.setTag=de,t.setTags=le,t.setUser=pe,t.showReportDialog=function(t={}){if(!Ve.document)return;const n=In(),e=n.getClient(),r=e&&e.getDsn();if(!r)return;if(n&&(t.user={...n.getUser(),...t.user}),!t.eventId){const n=me();n&&(t.eventId=n)}const o=Ve.document.createElement("script");o.async=!0,o.crossOrigin="anonymous",o.src=function(t,n){const e=P(t);if(!e)return"";const r=`${we(e)}embed/error-page/`;let o=`dsn=${M(e)}`;for(const t in n)if("dsn"!==t&&"onClose"!==t)if("user"===t){const t=n.user;if(!t)continue;t.name&&(o+=`&name=${encodeURIComponent(t.name)}`),t.email&&(o+=`&email=${encodeURIComponent(t.email)}`)}else o+=`&${encodeURIComponent(t)}=${encodeURIComponent(n[t])}`;return`${r}?${o}`}(r,t),t.onLoad&&(o.onload=t.onLoad);const{onClose:i}=t;if(i){const t=n=>{if("__sentry_reportdialog_closed__"===n.data)try{i()}finally{Ve.removeEventListener("message",t)}};Ve.addEventListener("message",t)}const s=Ve.document.head||Ve.document.body;s&&s.appendChild(o)},t.spanToBaggageHeader=function(t){return Ht(Qn(t))},t.spanToJSON=Hn,t.spanToTraceHeader=function(t){const{traceId:n,spanId:e}=t.spanContext();return function(t=Et(),n=Et().substring(16),e){let r="";return void 0!==e&&(r=e?"-1":"-0"),`${t}-${n}${r}`}(n,e,zn(t))},t.startSession=ye,t.suppressTracing=function(t){const n=kn(ln());return n.suppressTracing?n.suppressTracing(t):On((n=>(n.setSDKProcessingMetadata({__SENTRY_SUPPRESS_TRACING__:!0}),t())))},t.winjsStackLineParser=Fr,t.withIsolationScope=function(...t){const n=kn(ln());if(2===t.length){const[e,r]=t;return e?n.withSetIsolationScope(e,r):n.withIsolationScope(r)}return n.withIsolationScope(t[0])},t.withScope=On,t}({}); //# sourceMappingURL=bundle.min.js.map diff --git a/apollo/pwa/static/vendor/sentry/bundle.min.js.map b/apollo/pwa/static/vendor/sentry/bundle.min.js.map deleted file mode 100644 index 5193c9493..000000000 --- a/apollo/pwa/static/vendor/sentry/bundle.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.min.js","sources":["../../types/src/loglevel.ts","../../types/src/session.ts","../../types/src/severity.ts","../../types/src/status.ts","../../types/src/transaction.ts","../../utils/src/is.ts","../../utils/src/browser.ts","../../utils/src/polyfill.ts","../../utils/src/error.ts","../../utils/src/dsn.ts","../../utils/src/node.ts","../../utils/src/string.ts","../../utils/src/misc.ts","../../utils/src/logger.ts","../../utils/src/memo.ts","../../utils/src/stacktrace.ts","../../utils/src/object.ts","../../utils/src/supports.ts","../../utils/src/instrument.ts","../../utils/src/syncpromise.ts","../../utils/src/promisebuffer.ts","../../utils/src/time.ts","../../hub/src/scope.ts","../../hub/src/session.ts","../../hub/src/hub.ts","../../minimal/src/index.ts","../../core/src/api.ts","../../core/src/integration.ts","../../core/src/baseclient.ts","../../core/src/transports/noop.ts","../../core/src/basebackend.ts","../../core/src/request.ts","../../core/src/integrations/functiontostring.ts","../../core/src/version.ts","../../core/src/integrations/inboundfilters.ts","../src/tracekit.ts","../src/parsers.ts","../src/eventbuilder.ts","../src/transports/base.ts","../src/transports/fetch.ts","../src/transports/xhr.ts","../src/backend.ts","../src/helpers.ts","../src/integrations/globalhandlers.ts","../src/integrations/trycatch.ts","../src/integrations/breadcrumbs.ts","../src/integrations/linkederrors.ts","../src/integrations/useragent.ts","../src/client.ts","../src/sdk.ts","../src/index.ts","../src/version.ts","../../core/src/sdk.ts"],"sourcesContent":["/** Console logging verbosity for the SDK. */\nexport enum LogLevel {\n /** No logs will be generated. */\n None = 0,\n /** Only SDK internal errors will be logged. */\n Error = 1,\n /** Information useful for debugging the SDK will be logged. */\n Debug = 2,\n /** All SDK actions will be logged. */\n Verbose = 3,\n}\n","import { User } from './user';\n\n/**\n * @inheritdoc\n */\nexport interface Session extends SessionContext {\n /** JSDoc */\n update(context?: SessionContext): void;\n\n /** JSDoc */\n close(status?: SessionStatus): void;\n\n /** JSDoc */\n toJSON(): {\n init: boolean;\n sid: string;\n did?: string;\n timestamp: string;\n started: string;\n duration: number;\n status: SessionStatus;\n errors: number;\n attrs?: {\n release?: string;\n environment?: string;\n user_agent?: string;\n ip_address?: string;\n };\n };\n}\n\n/**\n * Session Context\n */\nexport interface SessionContext {\n sid?: string;\n did?: string;\n init?: boolean;\n timestamp?: number;\n started?: number;\n duration?: number;\n status?: SessionStatus;\n release?: string;\n environment?: string;\n userAgent?: string;\n ipAddress?: string;\n errors?: number;\n user?: User | null;\n}\n\n/**\n * Session Status\n */\nexport enum SessionStatus {\n /** JSDoc */\n Ok = 'ok',\n /** JSDoc */\n Exited = 'exited',\n /** JSDoc */\n Crashed = 'crashed',\n /** JSDoc */\n Abnormal = 'abnormal',\n}\n","/** JSDoc */\n// eslint-disable-next-line import/export\nexport enum Severity {\n /** JSDoc */\n Fatal = 'fatal',\n /** JSDoc */\n Error = 'error',\n /** JSDoc */\n Warning = 'warning',\n /** JSDoc */\n Log = 'log',\n /** JSDoc */\n Info = 'info',\n /** JSDoc */\n Debug = 'debug',\n /** JSDoc */\n Critical = 'critical',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace Severity {\n /**\n * Converts a string-based level into a {@link Severity}.\n *\n * @param level string representation of Severity\n * @returns Severity\n */\n export function fromString(level: string): Severity {\n switch (level) {\n case 'debug':\n return Severity.Debug;\n case 'info':\n return Severity.Info;\n case 'warn':\n case 'warning':\n return Severity.Warning;\n case 'error':\n return Severity.Error;\n case 'fatal':\n return Severity.Fatal;\n case 'critical':\n return Severity.Critical;\n case 'log':\n default:\n return Severity.Log;\n }\n }\n}\n","/** The status of an event. */\n// eslint-disable-next-line import/export\nexport enum Status {\n /** The status could not be determined. */\n Unknown = 'unknown',\n /** The event was skipped due to configuration or callbacks. */\n Skipped = 'skipped',\n /** The event was sent to Sentry successfully. */\n Success = 'success',\n /** The client is currently rate limited and will try again later. */\n RateLimit = 'rate_limit',\n /** The event could not be processed. */\n Invalid = 'invalid',\n /** A server-side error ocurred during submission. */\n Failed = 'failed',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace Status {\n /**\n * Converts a HTTP status code into a {@link Status}.\n *\n * @param code The HTTP response status code.\n * @returns The send status or {@link Status.Unknown}.\n */\n export function fromHttpCode(code: number): Status {\n if (code >= 200 && code < 300) {\n return Status.Success;\n }\n\n if (code === 429) {\n return Status.RateLimit;\n }\n\n if (code >= 400 && code < 500) {\n return Status.Invalid;\n }\n\n if (code >= 500) {\n return Status.Failed;\n }\n\n return Status.Unknown;\n }\n}\n","import { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';\nimport { Span, SpanContext } from './span';\n\n/**\n * Interface holding Transaction-specific properties\n */\nexport interface TransactionContext extends SpanContext {\n /**\n * Human-readable identifier for the transaction\n */\n name: string;\n\n /**\n * If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming\n * the duration of the transaction. This is useful to discard extra time in the transaction that is not\n * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the\n * transaction after a given \"idle time\" and we don't want this \"idle time\" to be part of the transaction.\n */\n trimEnd?: boolean;\n\n /**\n * If this transaction has a parent, the parent's sampling decision\n */\n parentSampled?: boolean;\n}\n\n/**\n * Data pulled from a `sentry-trace` header\n */\nexport type TraceparentData = Pick;\n\n/**\n * Transaction \"Class\", inherits Span only has `setName`\n */\nexport interface Transaction extends TransactionContext, Span {\n /**\n * @inheritDoc\n */\n spanId: string;\n\n /**\n * @inheritDoc\n */\n traceId: string;\n\n /**\n * @inheritDoc\n */\n startTimestamp: number;\n\n /**\n * @inheritDoc\n */\n tags: { [key: string]: Primitive };\n\n /**\n * @inheritDoc\n */\n data: { [key: string]: any };\n\n /**\n * Set the name of the transaction\n */\n setName(name: string): void;\n\n /** Returns the current transaction properties as a `TransactionContext` */\n toContext(): TransactionContext;\n\n /** Updates the current transaction with a new `TransactionContext` */\n updateWithContext(transactionContext: TransactionContext): this;\n}\n\n/**\n * Context data passed by the user when starting a transaction, to be used by the tracesSampler method.\n */\nexport interface CustomSamplingContext {\n [key: string]: any;\n}\n\n/**\n * Data passed to the `tracesSampler` function, which forms the basis for whatever decisions it might make.\n *\n * Adds default data to data provided by the user. See {@link Hub.startTransaction}\n */\nexport interface SamplingContext extends CustomSamplingContext {\n /**\n * Context data with which transaction being sampled was created\n */\n transactionContext: TransactionContext;\n\n /**\n * Sampling decision from the parent transaction, if any.\n */\n parentSampled?: boolean;\n\n /**\n * Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`\n * integration.\n */\n location?: WorkerLocation;\n\n /**\n * Object representing the incoming request to a node server. Passed by default when using the TracingHandler.\n */\n request?: ExtractedNodeRequestData;\n}\n\nexport type Measurements = Record;\n\nexport enum TransactionSamplingMethod {\n Explicit = 'explicitly_set',\n Sampler = 'client_sampler',\n Rate = 'client_rate',\n Inheritance = 'inheritance',\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { Primitive } from '@sentry/types';\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: any): boolean {\n switch (Object.prototype.toString.call(wat)) {\n case '[object Error]':\n return true;\n case '[object Exception]':\n return true;\n case '[object DOMException]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object ErrorEvent]';\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object DOMError]';\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object DOMException]';\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object String]';\n}\n\n/**\n * Checks whether given value's is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: any): wat is Primitive {\n return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object Object]';\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: any): boolean {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: any): boolean {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: any): boolean {\n return Object.prototype.toString.call(wat) === '[object RegExp]';\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): boolean {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: any): boolean {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n try {\n return wat instanceof base;\n } catch (_e) {\n return false;\n }\n}\n","import { isString } from './is';\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(elem: unknown): string {\n type SimpleNode = {\n parentNode: SimpleNode;\n } | null;\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const MAX_OUTPUT_LEN = 80;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n\n // eslint-disable-next-line no-plusplus\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds MAX_OUTPUT_LEN\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown): string {\n const elem = el as {\n tagName?: string;\n id?: string;\n className?: string;\n getAttribute(key: string): string;\n };\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n const allowedAttrs = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n","export const setPrototypeOf =\n Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties);\n\n/**\n * setPrototypeOf polyfill using __proto__\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction setProtoOf(obj: TTarget, proto: TProto): TTarget & TProto {\n // @ts-ignore __proto__ does not exist on obj\n obj.__proto__ = proto;\n return obj as TTarget & TProto;\n}\n\n/**\n * setPrototypeOf polyfill using mixin\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction mixinProperties(obj: TTarget, proto: TProto): TTarget & TProto {\n for (const prop in proto) {\n // eslint-disable-next-line no-prototype-builtins\n if (!obj.hasOwnProperty(prop)) {\n // @ts-ignore typescript complains about indexing so we remove\n obj[prop] = proto[prop];\n }\n }\n\n return obj as TTarget & TProto;\n}\n","import { setPrototypeOf } from './polyfill';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n /** Display name of this error instance. */\n public name: string;\n\n public constructor(public message: string) {\n super(message);\n\n this.name = new.target.prototype.constructor.name;\n setPrototypeOf(this, new.target.prototype);\n }\n}\n","import { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { SentryError } from './error';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+))?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\n/** Error message */\nconst ERROR_MESSAGE = 'Invalid Dsn';\n\n/** The Sentry Dsn, identifying a Sentry instance and project. */\nexport class Dsn implements DsnComponents {\n /** Protocol used to connect to Sentry. */\n public protocol!: DsnProtocol;\n /** Public authorization key (deprecated, renamed to publicKey). */\n public user!: string;\n /** Public authorization key. */\n public publicKey!: string;\n /** Private authorization key (deprecated, optional). */\n public pass!: string;\n /** Hostname of the Sentry instance. */\n public host!: string;\n /** Port of the Sentry instance. */\n public port!: string;\n /** Path */\n public path!: string;\n /** Project ID */\n public projectId!: string;\n\n /** Creates a new Dsn component */\n public constructor(from: DsnLike) {\n if (typeof from === 'string') {\n this._fromString(from);\n } else {\n this._fromComponents(from);\n }\n\n this._validate();\n }\n\n /**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\n public toString(withPassword: boolean = false): string {\n const { host, path, pass, port, projectId, protocol, publicKey } = this;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n }\n\n /** Parses a string into this Dsn. */\n private _fromString(str: string): void {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n throw new SentryError(ERROR_MESSAGE);\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() as string;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n this._fromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n }\n\n /** Maps Dsn components into this instance. */\n private _fromComponents(components: DsnComponents): void {\n // TODO this is for backwards compatibility, and can be removed in a future version\n if ('user' in components && !('publicKey' in components)) {\n components.publicKey = components.user;\n }\n this.user = components.publicKey || '';\n\n this.protocol = components.protocol;\n this.publicKey = components.publicKey || '';\n this.pass = components.pass || '';\n this.host = components.host;\n this.port = components.port || '';\n this.path = components.path || '';\n this.projectId = components.projectId;\n }\n\n /** Validates this Dsn and throws on error. */\n private _validate(): void {\n ['protocol', 'publicKey', 'host', 'projectId'].forEach(component => {\n if (!this[component as keyof DsnComponents]) {\n throw new SentryError(`${ERROR_MESSAGE}: ${component} missing`);\n }\n });\n\n if (!this.projectId.match(/^\\d+$/)) {\n throw new SentryError(`${ERROR_MESSAGE}: Invalid projectId ${this.projectId}`);\n }\n\n if (this.protocol !== 'http' && this.protocol !== 'https') {\n throw new SentryError(`${ERROR_MESSAGE}: Invalid protocol ${this.protocol}`);\n }\n\n if (this.port && isNaN(parseInt(this.port, 10))) {\n throw new SentryError(`${ERROR_MESSAGE}: Invalid port ${this.port}`);\n }\n }\n}\n","/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function dynamicRequire(mod: any, request: string): any {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}\n","import { isRegExp, isString } from './is';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.substr(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n let newLine = line;\n const ll = newLine.length;\n if (ll <= 150) {\n return newLine;\n }\n if (colno > ll) {\n // eslint-disable-next-line no-param-reassign\n colno = ll;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, ll);\n if (end > ll - 5) {\n end = ll;\n }\n if (end === ll) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < ll) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n output.push(String(value));\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the value matches a regex or includes the string\n * @param value The string value to be checked against\n * @param pattern Either a regex or a string that must be contained in value\n */\nexport function isMatchingPattern(value: string, pattern: RegExp | string): boolean {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return (pattern as RegExp).test(value);\n }\n if (typeof pattern === 'string') {\n return value.indexOf(pattern) !== -1;\n }\n return false;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Event, Integration, StackFrame, WrappedFunction } from '@sentry/types';\n\nimport { isNodeEnv } from './node';\nimport { snipLine } from './string';\n\n/** Internal */\ninterface SentryGlobal {\n Sentry?: {\n Integrations?: Integration[];\n };\n SENTRY_ENVIRONMENT?: string;\n SENTRY_DSN?: string;\n SENTRY_RELEASE?: {\n id?: string;\n };\n __SENTRY__: {\n globalEventProcessors: any;\n hub: any;\n logger: any;\n };\n}\n\nconst fallbackGlobalObject = {};\n\n/**\n * Safely get global scope object\n *\n * @returns Global scope object\n */\nexport function getGlobalObject(): T & SentryGlobal {\n return (isNodeEnv()\n ? global\n : typeof window !== 'undefined'\n ? window\n : typeof self !== 'undefined'\n ? self\n : fallbackGlobalObject) as T & SentryGlobal;\n}\n\n/**\n * Extended Window interface that allows for Crypto API usage in IE browsers\n */\ninterface MsCryptoWindow extends Window {\n msCrypto?: Crypto;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n const global = getGlobalObject() as MsCryptoWindow;\n const crypto = global.crypto || global.msCrypto;\n\n if (!(crypto === void 0) && crypto.getRandomValues) {\n // Use window.crypto API if available\n const arr = new Uint16Array(8);\n crypto.getRandomValues(arr);\n\n // set 4 in byte 7\n // eslint-disable-next-line no-bitwise\n arr[3] = (arr[3] & 0xfff) | 0x4000;\n // set 2 most significant bits of byte 9 to '10'\n // eslint-disable-next-line no-bitwise\n arr[4] = (arr[4] & 0x3fff) | 0x8000;\n\n const pad = (num: number): string => {\n let v = num.toString(16);\n while (v.length < 4) {\n v = `0${v}`;\n }\n return v;\n };\n\n return (\n pad(arr[0]) + pad(arr[1]) + pad(arr[2]) + pad(arr[3]) + pad(arr[4]) + pad(arr[5]) + pad(arr[6]) + pad(arr[7])\n );\n }\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, c => {\n // eslint-disable-next-line no-bitwise\n const r = (Math.random() * 16) | 0;\n // eslint-disable-next-line no-bitwise\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(\n url: string,\n): {\n host?: string;\n path?: string;\n protocol?: string;\n relative?: string;\n} {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n if (event.message) {\n return event.message;\n }\n if (event.exception && event.exception.values && event.exception.values[0]) {\n const exception = event.exception.values[0];\n\n if (exception.type && exception.value) {\n return `${exception.type}: ${exception.value}`;\n }\n return exception.type || exception.value || event.event_id || '';\n }\n return event.event_id || '';\n}\n\n/** JSDoc */\ninterface ExtensibleConsole extends Console {\n [key: string]: any;\n}\n\n/** JSDoc */\nexport function consoleSandbox(callback: () => any): any {\n const global = getGlobalObject();\n const levels = ['debug', 'info', 'warn', 'error', 'log', 'assert'];\n\n if (!('console' in global)) {\n return callback();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalConsole = (global as any).console as ExtensibleConsole;\n const wrappedLevels: { [key: string]: any } = {};\n\n // Restore all wrapped console methods\n levels.forEach(level => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (level in (global as any).console && (originalConsole[level] as WrappedFunction).__sentry_original__) {\n wrappedLevels[level] = originalConsole[level] as WrappedFunction;\n originalConsole[level] = (originalConsole[level] as WrappedFunction).__sentry_original__;\n }\n });\n\n // Perform callback manipulations\n const result = callback();\n\n // Revert restoration to wrapped state\n Object.keys(wrappedLevels).forEach(level => {\n originalConsole[level] = wrappedLevels[level];\n });\n\n return result;\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].value = event.exception.values[0].value || value || '';\n event.exception.values[0].type = event.exception.values[0].type || type || 'Error';\n}\n\n/**\n * Adds exception mechanism to a given event.\n * @param event The event to modify.\n * @param mechanism Mechanism of the mechanism.\n * @hidden\n */\nexport function addExceptionMechanism(\n event: Event,\n mechanism: {\n [key: string]: any;\n } = {},\n): void {\n // TODO: Use real type with `keyof Mechanism` thingy and maybe make it better?\n try {\n // @ts-ignore Type 'Mechanism | {}' is not assignable to type 'Mechanism | undefined'\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception!.values![0].mechanism = event.exception!.values![0].mechanism || {};\n Object.keys(mechanism).forEach(key => {\n // @ts-ignore Mechanism has no index signature\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception!.values![0].mechanism[key] = mechanism[key];\n });\n } catch (_oO) {\n // no-empty\n }\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n major?: number;\n minor?: number;\n patch?: number;\n prerelease?: string;\n buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\nconst defaultRetryAfter = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param now current unix timestamp\n * @param header string representation of 'Retry-After' header\n */\nexport function parseRetryAfterHeader(now: number, header?: string | number | null): number {\n if (!header) {\n return defaultRetryAfter;\n }\n\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return defaultRetryAfter;\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n const lineno = frame.lineno || 0;\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line: string) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { consoleSandbox, getGlobalObject } from './misc';\n\n// TODO: Implement different loggers for different environments\nconst global = getGlobalObject();\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\n/** JSDoc */\nclass Logger {\n /** JSDoc */\n private _enabled: boolean;\n\n /** JSDoc */\n public constructor() {\n this._enabled = false;\n }\n\n /** JSDoc */\n public disable(): void {\n this._enabled = false;\n }\n\n /** JSDoc */\n public enable(): void {\n this._enabled = true;\n }\n\n /** JSDoc */\n public log(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.log(`${PREFIX}[Log]: ${args.join(' ')}`);\n });\n }\n\n /** JSDoc */\n public warn(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`);\n });\n }\n\n /** JSDoc */\n public error(...args: any[]): void {\n if (!this._enabled) {\n return;\n }\n consoleSandbox(() => {\n global.console.error(`${PREFIX}[Error]: ${args.join(' ')}`);\n });\n }\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nglobal.__SENTRY__ = global.__SENTRY__ || {};\nconst logger = (global.__SENTRY__.logger as Logger) || (global.__SENTRY__.logger = new Logger());\n\nexport { logger };\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/**\n * Memo class used for decycle json objects. Uses WeakSet if available otherwise array.\n */\nexport class Memo {\n /** Determines if WeakSet is available */\n private readonly _hasWeakSet: boolean;\n /** Either WeakSet or Array */\n private readonly _inner: any;\n\n public constructor() {\n this._hasWeakSet = typeof WeakSet === 'function';\n this._inner = this._hasWeakSet ? new WeakSet() : [];\n }\n\n /**\n * Sets obj to remember.\n * @param obj Object to remember\n */\n public memoize(obj: any): boolean {\n if (this._hasWeakSet) {\n if (this._inner.has(obj)) {\n return true;\n }\n this._inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < this._inner.length; i++) {\n const value = this._inner[i];\n if (value === obj) {\n return true;\n }\n }\n this._inner.push(obj);\n return false;\n }\n\n /**\n * Removes object from internal storage.\n * @param obj Object to forget\n */\n public unmemoize(obj: any): void {\n if (this._hasWeakSet) {\n this._inner.delete(obj);\n } else {\n for (let i = 0; i < this._inner.length; i++) {\n if (this._inner[i] === obj) {\n this._inner.splice(i, 1);\n break;\n }\n }\n }\n }\n}\n","const defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ExtendedError, WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive, isSyntheticEvent } from './is';\nimport { Memo } from './memo';\nimport { getFunctionName } from './stacktrace';\nimport { truncate } from './string';\n\n/**\n * Wrap a given object method with a higher-order function\n *\n * @param source An object that contains a method to be wrapped.\n * @param name A name of method to be wrapped.\n * @param replacementFactory A function that should be used to wrap a given method, returning the wrapped method which\n * will be substituted in for `source[name]`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] as () => any;\n const wrapped = replacementFactory(original) as WrappedFunction;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n try {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __sentry_original__: {\n enumerable: false,\n value: original,\n },\n });\n } catch (_Oo) {\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any object into an object literal with all its attributes\n * attached to it.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n */\nfunction getWalkSource(\n value: any,\n): {\n [key: string]: any;\n} {\n if (isError(value)) {\n const error = value as ExtendedError;\n const err: {\n [key: string]: any;\n stack: string | undefined;\n message: string;\n name: string;\n } = {\n message: error.message,\n name: error.name,\n stack: error.stack,\n };\n\n for (const i in error) {\n if (Object.prototype.hasOwnProperty.call(error, i)) {\n err[i] = error[i];\n }\n }\n\n return err;\n }\n\n if (isEvent(value)) {\n /**\n * Event-like interface that's usable in browser and node\n */\n interface SimpleEvent {\n [key: string]: unknown;\n type: string;\n target?: unknown;\n currentTarget?: unknown;\n }\n\n const event = value as SimpleEvent;\n\n const source: {\n [key: string]: any;\n } = {};\n\n source.type = event.type;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n source.target = isElement(event.target)\n ? htmlTreeAsString(event.target)\n : Object.prototype.toString.call(event.target);\n } catch (_oO) {\n source.target = '';\n }\n\n try {\n source.currentTarget = isElement(event.currentTarget)\n ? htmlTreeAsString(event.currentTarget)\n : Object.prototype.toString.call(event.currentTarget);\n } catch (_oO) {\n source.currentTarget = '';\n }\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n source.detail = event.detail;\n }\n\n for (const i in event) {\n if (Object.prototype.hasOwnProperty.call(event, i)) {\n source[i] = event;\n }\n }\n\n return source;\n }\n\n return value as {\n [key: string]: any;\n };\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\nfunction jsonSize(value: any): number {\n return utf8Length(JSON.stringify(value));\n}\n\n/** JSDoc */\nexport function normalizeToSize(\n object: { [key: string]: any },\n // Default Node.js REPL depth\n depth: number = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize: number = 100 * 1024,\n): T {\n const serialized = normalize(object, depth);\n\n if (jsonSize(serialized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return serialized as T;\n}\n\n/**\n * Transform any non-primitive, BigInt, or Symbol-type value into a string. Acts as a no-op on strings, numbers,\n * booleans, null, and undefined.\n *\n * @param value The value to stringify\n * @returns For non-primitive, BigInt, and Symbol-type values, a string denoting the value's type, type and value, or\n * type and `description` property, respectively. For non-BigInt, non-Symbol primitives, returns the original value,\n * unchanged.\n */\nfunction serializeValue(value: any): any {\n const type = Object.prototype.toString.call(value);\n\n // Node.js REPL notation\n if (typeof value === 'string') {\n return value;\n }\n if (type === '[object Object]') {\n return '[Object]';\n }\n if (type === '[object Array]') {\n return '[Array]';\n }\n\n const normalized = normalizeValue(value);\n return isPrimitive(normalized) ? normalized : type;\n}\n\n/**\n * normalizeValue()\n *\n * Takes unserializable input and make it serializable friendly\n *\n * - translates undefined/NaN values to \"[undefined]\"/\"[NaN]\" respectively,\n * - serializes Error objects\n * - filter global objects\n */\nfunction normalizeValue(value: T, key?: any): T | string {\n if (key === 'domain' && value && typeof value === 'object' && ((value as unknown) as { _events: any })._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n if (typeof (global as any) !== 'undefined' && (value as unknown) === global) {\n return '[Global]';\n }\n\n if (typeof (window as any) !== 'undefined' && (value as unknown) === window) {\n return '[Window]';\n }\n\n if (typeof (document as any) !== 'undefined' && (value as unknown) === document) {\n return '[Document]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (value === void 0) {\n return '[undefined]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n // symbols and bigints are considered primitives by TS, but aren't natively JSON-serilaizable\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n return value;\n}\n\n/**\n * Walks an object to perform a normalization on it\n *\n * @param key of object that's walked in current iteration\n * @param value object to be walked\n * @param depth Optional number indicating how deep should walking be performed\n * @param memo Optional Memo class handling decycling\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function walk(key: string, value: any, depth: number = +Infinity, memo: Memo = new Memo()): any {\n // If we reach the maximum depth, serialize whatever has left\n if (depth === 0) {\n return serializeValue(value);\n }\n\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // If value implements `toJSON` method, call it and return early\n if (value !== null && value !== undefined && typeof value.toJSON === 'function') {\n return value.toJSON();\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further\n const normalized = normalizeValue(value, key);\n if (isPrimitive(normalized)) {\n return normalized;\n }\n\n // Create source that we will use for next itterations, either objectified error object (Error type with extracted keys:value pairs) or the input itself\n const source = getWalkSource(value);\n\n // Create an accumulator that will act as a parent for all future itterations of that branch\n const acc = Array.isArray(value) ? [] : {};\n\n // If we already walked that branch, bail out, as it's circular reference\n if (memo.memoize(value)) {\n return '[Circular ~]';\n }\n\n // Walk all keys of the source\n for (const innerKey in source) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(source, innerKey)) {\n continue;\n }\n // Recursively walk through all the child nodes\n (acc as { [key: string]: any })[innerKey] = walk(innerKey, source[innerKey], depth - 1, memo);\n }\n\n // Once walked through all the branches, remove the parent from memo storage\n memo.unmemoize(value);\n\n // Return accumulated values\n return acc;\n}\n\n/**\n * normalize()\n *\n * - Creates a copy to prevent original input mutation\n * - Skip non-enumerablers\n * - Calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializeable values (undefined/NaN/Functions) to serializable format\n * - Translates known global objects/Classes to a string representations\n * - Takes care of Error objects serialization\n * - Optionally limit depth of final output\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function normalize(input: any, depth?: number): any {\n try {\n return JSON.parse(JSON.stringify(input, (key: string, value: any) => walk(key, value, depth)));\n } catch (_oO) {\n return '**non-serializable**';\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function extractExceptionKeysForMessage(exception: any, maxLength: number = 40): string {\n const keys = Object.keys(getWalkSource(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return the new object with removed keys that value was `undefined`.\n * Works recursively on objects and arrays.\n */\nexport function dropUndefinedKeys(val: T): T {\n if (isPlainObject(val)) {\n const obj = val as { [key: string]: any };\n const rv: { [key: string]: any } = {};\n for (const key of Object.keys(obj)) {\n if (typeof obj[key] !== 'undefined') {\n rv[key] = dropUndefinedKeys(obj[key]);\n }\n }\n return rv as T;\n }\n\n if (Array.isArray(val)) {\n return (val as any[]).map(dropUndefinedKeys) as any;\n }\n\n return val;\n}\n","import { logger } from './logger';\nimport { getGlobalObject } from './misc';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-ignore It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n if (!('fetch' in getGlobalObject())) {\n return false;\n }\n\n try {\n new Headers();\n new Request('');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n if (!supportsFetch()) {\n return false;\n }\n\n const global = getGlobalObject();\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFetch(global.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = global.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement as unknown) === `function`) {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n return 'ReportingObserver' in getGlobalObject();\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n // https://caniuse.com/#feat=referrer-policy\n // It doesn't. And it throw exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' as ReferrerPolicy,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n const global = getGlobalObject();\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chrome = (global as any).chrome;\n const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport { WrappedFunction } from '@sentry/types';\n\nimport { isInstanceOf, isString } from './is';\nimport { logger } from './logger';\nimport { getGlobalObject } from './misc';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\n\nconst global = getGlobalObject();\n\n/** Object describing handler that will be triggered for a given `type` of instrumentation */\ninterface InstrumentHandler {\n type: InstrumentHandlerType;\n callback: InstrumentHandlerCallback;\n}\ntype InstrumentHandlerType =\n | 'console'\n | 'dom'\n | 'fetch'\n | 'history'\n | 'sentry'\n | 'xhr'\n | 'error'\n | 'unhandledrejection';\ntype InstrumentHandlerCallback = (data: any) => void;\n\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n * - Console API\n * - Fetch API\n * - XHR API\n * - History API\n * - DOM API (click/typing)\n * - Error API\n * - UnhandledRejection API\n */\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Instruments given API */\nfunction instrument(type: InstrumentHandlerType): void {\n if (instrumented[type]) {\n return;\n }\n\n instrumented[type] = true;\n\n switch (type) {\n case 'console':\n instrumentConsole();\n break;\n case 'dom':\n instrumentDOM();\n break;\n case 'xhr':\n instrumentXHR();\n break;\n case 'fetch':\n instrumentFetch();\n break;\n case 'history':\n instrumentHistory();\n break;\n case 'error':\n instrumentError();\n break;\n case 'unhandledrejection':\n instrumentUnhandledRejection();\n break;\n default:\n logger.warn('unknown instrumentation type:', type);\n }\n}\n\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addInstrumentationHandler(handler: InstrumentHandler): void {\n if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n return;\n }\n handlers[handler.type] = handlers[handler.type] || [];\n (handlers[handler.type] as InstrumentHandlerCallback[]).push(handler.callback);\n instrument(handler.type);\n}\n\n/** JSDoc */\nfunction triggerHandlers(type: InstrumentHandlerType, data: any): void {\n if (!type || !handlers[type]) {\n return;\n }\n\n for (const handler of handlers[type] || []) {\n try {\n handler(data);\n } catch (e) {\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(\n handler,\n )}\\nError: ${e}`,\n );\n }\n }\n}\n\n/** JSDoc */\nfunction instrumentConsole(): void {\n if (!('console' in global)) {\n return;\n }\n\n ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function(level: string): void {\n if (!(level in global.console)) {\n return;\n }\n\n fill(global.console, level, function(originalConsoleLevel: () => any): Function {\n return function(...args: any[]): void {\n triggerHandlers('console', { args, level });\n\n // this fails for some browsers. :(\n if (originalConsoleLevel) {\n Function.prototype.apply.call(originalConsoleLevel, global.console, args);\n }\n };\n });\n });\n}\n\n/** JSDoc */\nfunction instrumentFetch(): void {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(global, 'fetch', function(originalFetch: () => void): () => void {\n return function(...args: any[]): void {\n const handlerData = {\n args,\n fetchData: {\n method: getFetchMethod(args),\n url: getFetchUrl(args),\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...handlerData,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(global, args).then(\n (response: Response) => {\n triggerHandlers('fetch', {\n ...handlerData,\n endTimestamp: Date.now(),\n response,\n });\n return response;\n },\n (error: Error) => {\n triggerHandlers('fetch', {\n ...handlerData,\n endTimestamp: Date.now(),\n error,\n });\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\ntype XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;\n\n/** JSDoc */\ninterface SentryWrappedXMLHttpRequest extends XMLHttpRequest {\n [key: string]: any;\n __sentry_xhr__?: {\n method?: string;\n url?: string;\n status_code?: number;\n body?: XHRSendInput;\n };\n}\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/** Extract `method` from fetch call arguments */\nfunction getFetchMethod(fetchArgs: any[] = []): string {\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {\n return String(fetchArgs[0].method).toUpperCase();\n }\n if (fetchArgs[1] && fetchArgs[1].method) {\n return String(fetchArgs[1].method).toUpperCase();\n }\n return 'GET';\n}\n\n/** Extract `url` from fetch call arguments */\nfunction getFetchUrl(fetchArgs: any[] = []): string {\n if (typeof fetchArgs[0] === 'string') {\n return fetchArgs[0];\n }\n if ('Request' in global && isInstanceOf(fetchArgs[0], Request)) {\n return fetchArgs[0].url;\n }\n return String(fetchArgs[0]);\n}\n/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n/** JSDoc */\nfunction instrumentXHR(): void {\n if (!('XMLHttpRequest' in global)) {\n return;\n }\n\n // Poor man's implementation of ES6 `Map`, tracking and keeping in sync key and value separately.\n const requestKeys: XMLHttpRequest[] = [];\n const requestValues: Array[] = [];\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function(originalOpen: () => void): () => void {\n return function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const url = args[1];\n xhr.__sentry_xhr__ = {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n url: args[1],\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (isString(url) && xhr.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) {\n xhr.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler = function(): void {\n if (xhr.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n if (xhr.__sentry_xhr__) {\n xhr.__sentry_xhr__.status_code = xhr.status;\n }\n } catch (e) {\n /* do nothing */\n }\n\n try {\n const requestPos = requestKeys.indexOf(xhr);\n if (requestPos !== -1) {\n // Make sure to pop both key and value to keep it in sync.\n requestKeys.splice(requestPos);\n const args = requestValues.splice(requestPos)[0];\n if (xhr.__sentry_xhr__ && args[0] !== undefined) {\n xhr.__sentry_xhr__.body = args[0] as XHRSendInput;\n }\n }\n } catch (e) {\n /* do nothing */\n }\n\n triggerHandlers('xhr', {\n args,\n endTimestamp: Date.now(),\n startTimestamp: Date.now(),\n xhr,\n });\n }\n };\n\n if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') {\n fill(xhr, 'onreadystatechange', function(original: WrappedFunction): Function {\n return function(...readyStateArgs: any[]): void {\n onreadystatechangeHandler();\n return original.apply(xhr, readyStateArgs);\n };\n });\n } else {\n xhr.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n return originalOpen.apply(xhr, args);\n };\n });\n\n fill(xhrproto, 'send', function(originalSend: () => void): () => void {\n return function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void {\n requestKeys.push(this);\n requestValues.push(args);\n\n triggerHandlers('xhr', {\n args,\n startTimestamp: Date.now(),\n xhr: this,\n });\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nlet lastHref: string;\n\n/** JSDoc */\nfunction instrumentHistory(): void {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = global.onpopstate;\n global.onpopstate = function(this: WindowEventHandlers, ...args: any[]): any {\n const to = global.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n triggerHandlers('history', {\n from,\n to,\n });\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n /** @hidden */\n function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n return function(this: History, ...args: any[]): void {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n triggerHandlers('history', {\n from,\n to,\n });\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(global.history, 'pushState', historyReplacementFunction);\n fill(global.history, 'replaceState', historyReplacementFunction);\n}\n\nconst debounceDuration = 1000;\nlet debounceTimerID: number | undefined;\nlet lastCapturedEvent: Event | undefined;\n\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\nfunction shouldShortcircuitPreviousDebounce(previous: Event | undefined, current: Event): boolean {\n // If there was no previous event, it should always be swapped for the new one.\n if (!previous) {\n return true;\n }\n\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (previous.type !== current.type) {\n return true;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (previous.target !== current.target) {\n return true;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return false;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(event: Event): boolean {\n // We are only interested in filtering `keypress` events for now.\n if (event.type !== 'keypress') {\n return false;\n }\n\n try {\n const target = event.target as HTMLElement;\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\nfunction makeDOMEventHandler(handler: Function, globalListener: boolean = false): (event: Event) => void {\n return (event: Event): void => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || lastCapturedEvent === event) {\n return;\n }\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event)) {\n return;\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n if (debounceTimerID === undefined) {\n handler({\n event: event,\n name,\n global: globalListener,\n });\n lastCapturedEvent = event;\n }\n // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n handler({\n event: event,\n name,\n global: globalListener,\n });\n lastCapturedEvent = event;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = global.setTimeout(() => {\n debounceTimerID = undefined;\n }, debounceDuration);\n };\n}\n\ntype AddEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n __sentry_instrumentation_handlers__?: {\n [key in 'click' | 'keypress']?: {\n handler?: Function;\n /** The number of custom listeners attached to this element */\n refCount: number;\n };\n };\n};\n\n/** JSDoc */\nfunction instrumentDOM(): void {\n if (!('document' in global)) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n global.document.addEventListener('click', globalDOMEventHandler, false);\n global.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target: string) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = (global as any)[target] && (global as any)[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function(originalAddEventListener: AddEventListener): AddEventListener {\n return function(\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): AddEventListener {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount += 1;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(proto, 'removeEventListener', function(originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n return function(\n this: Element,\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this as InstrumentedElement;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount -= 1;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n });\n });\n}\n\nlet _oldOnErrorHandler: OnErrorEventHandler = null;\n/** JSDoc */\nfunction instrumentError(): void {\n _oldOnErrorHandler = global.onerror;\n\n global.onerror = function(msg: any, url: any, line: any, column: any, error: any): boolean {\n triggerHandlers('error', {\n column,\n error,\n line,\n msg,\n url,\n });\n\n if (_oldOnErrorHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n}\n\nlet _oldOnUnhandledRejectionHandler: ((e: any) => void) | null = null;\n/** JSDoc */\nfunction instrumentUnhandledRejection(): void {\n _oldOnUnhandledRejectionHandler = global.onunhandledrejection;\n\n global.onunhandledrejection = function(e: any): boolean {\n triggerHandlers('unhandledrejection', e);\n\n if (_oldOnUnhandledRejectionHandler) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n}\n","/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nenum States {\n /** Pending */\n PENDING = 'PENDING',\n /** Resolved / OK */\n RESOLVED = 'RESOLVED',\n /** Rejected / Error */\n REJECTED = 'REJECTED',\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise implements PromiseLike {\n private _state: States = States.PENDING;\n private _handlers: Array<{\n done: boolean;\n onfulfilled?: ((value: T) => T | PromiseLike) | null;\n onrejected?: ((reason: any) => any) | null;\n }> = [];\n private _value: any;\n\n public constructor(\n executor: (resolve: (value?: T | PromiseLike | null) => void, reject: (reason?: any) => void) => void,\n ) {\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n public static resolve(value: T | PromiseLike): PromiseLike {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n }\n\n /** JSDoc */\n public static reject(reason?: any): PromiseLike {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n }\n\n /** JSDoc */\n public static all(collection: Array>): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n if (!Array.isArray(collection)) {\n reject(new TypeError(`Promise.all requires an array as input.`));\n return;\n }\n\n if (collection.length === 0) {\n resolve([]);\n return;\n }\n\n let counter = collection.length;\n const resolvedCollection: U[] = [];\n\n collection.forEach((item, index) => {\n SyncPromise.resolve(item)\n .then(value => {\n resolvedCollection[index] = value;\n counter -= 1;\n\n if (counter !== 0) {\n return;\n }\n resolve(resolvedCollection);\n })\n .then(null, reject);\n });\n });\n }\n\n /** JSDoc */\n public then(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike) | null,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n this._attachHandler({\n done: false,\n onfulfilled: result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result as any);\n return;\n }\n try {\n resolve(onfulfilled(result));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n onrejected: reason => {\n if (!onrejected) {\n reject(reason);\n return;\n }\n try {\n resolve(onrejected(reason));\n return;\n } catch (e) {\n reject(e);\n return;\n }\n },\n });\n });\n }\n\n /** JSDoc */\n public catch(\n onrejected?: ((reason: any) => TResult | PromiseLike) | null,\n ): PromiseLike {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n public finally(onfinally?: (() => void) | null): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n let val: TResult | any;\n let isRejected: boolean;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve((val as unknown) as any);\n });\n });\n }\n\n /** JSDoc */\n public toString(): string {\n return '[object SyncPromise]';\n }\n\n /** JSDoc */\n private readonly _resolve = (value?: T | PromiseLike | null) => {\n this._setResult(States.RESOLVED, value);\n };\n\n /** JSDoc */\n private readonly _reject = (reason?: any) => {\n this._setResult(States.REJECTED, reason);\n };\n\n /** JSDoc */\n private readonly _setResult = (state: States, value?: T | PromiseLike | any) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n (value as PromiseLike).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };\n\n // TODO: FIXME\n /** JSDoc */\n private readonly _attachHandler = (handler: {\n /** JSDoc */\n done: boolean;\n /** JSDoc */\n onfulfilled?(value: T): any;\n /** JSDoc */\n onrejected?(reason: any): any;\n }) => {\n this._handlers = this._handlers.concat(handler);\n this._executeHandlers();\n };\n\n /** JSDoc */\n private readonly _executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler.done) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n if (handler.onfulfilled) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler.onfulfilled((this._value as unknown) as any);\n }\n }\n\n if (this._state === States.REJECTED) {\n if (handler.onrejected) {\n handler.onrejected(this._value);\n }\n }\n\n handler.done = true;\n });\n };\n}\n\nexport { SyncPromise };\n","import { SentryError } from './error';\nimport { SyncPromise } from './syncpromise';\n\n/** A simple queue that holds promises. */\nexport class PromiseBuffer {\n /** Internal set of queued Promises */\n private readonly _buffer: Array> = [];\n\n public constructor(protected _limit?: number) {}\n\n /**\n * Says if the buffer is ready to take more requests\n */\n public isReady(): boolean {\n return this._limit === undefined || this.length() < this._limit;\n }\n\n /**\n * Add a promise to the queue.\n *\n * @param task Can be any PromiseLike\n * @returns The original promise.\n */\n public add(task: PromiseLike): PromiseLike {\n if (!this.isReady()) {\n return SyncPromise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));\n }\n if (this._buffer.indexOf(task) === -1) {\n this._buffer.push(task);\n }\n task\n .then(() => this.remove(task))\n .then(null, () =>\n this.remove(task).then(null, () => {\n // We have to add this catch here otherwise we have an unhandledPromiseRejection\n // because it's a new Promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Remove a promise to the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n public remove(task: PromiseLike): PromiseLike {\n const removedTask = this._buffer.splice(this._buffer.indexOf(task), 1)[0];\n return removedTask;\n }\n\n /**\n * This function returns the number of unresolved promises in the queue.\n */\n public length(): number {\n return this._buffer.length;\n }\n\n /**\n * This will drain the whole queue, returns true if queue is empty or drained.\n * If timeout is provided and the queue takes longer to drain, the promise still resolves but with false.\n *\n * @param timeout Number in ms to wait until it resolves with false.\n */\n public drain(timeout?: number): PromiseLike {\n return new SyncPromise(resolve => {\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n SyncPromise.all(this._buffer)\n .then(() => {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n })\n .then(null, () => {\n resolve(true);\n });\n });\n }\n}\n","import { getGlobalObject } from './misc';\nimport { dynamicRequire, isNodeEnv } from './node';\n\n/**\n * An object that can return the current timestamp in seconds since the UNIX epoch.\n */\ninterface TimestampSource {\n nowSeconds(): number;\n}\n\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\nconst dateTimestampSource: TimestampSource = {\n nowSeconds: () => Date.now() / 1000,\n};\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high resolution monotonic clock.\n */\ninterface Performance {\n /**\n * The millisecond timestamp at which measurement began, measured in Unix time.\n */\n timeOrigin: number;\n /**\n * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n */\n now(): number;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction getBrowserPerformance(): Performance | undefined {\n const { performance } = getGlobalObject();\n if (!performance || !performance.now) {\n return undefined;\n }\n\n // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n const timeOrigin = Date.now() - performance.now();\n\n return {\n now: () => performance.now(),\n timeOrigin,\n };\n}\n\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\nfunction getNodePerformance(): Performance | undefined {\n try {\n const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n}\n\n/**\n * The Performance API implementation for the current platform, if available.\n */\nconst platformPerformance: Performance | undefined = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\n\nconst timestampSource: TimestampSource =\n platformPerformance === undefined\n ? dateTimestampSource\n : {\n nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,\n };\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\nexport const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource);\n\n// Re-exported with an old name for backwards-compatibility.\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\nexport const usingPerformanceAPI = platformPerformance !== undefined;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = getGlobalObject();\n if (!performance) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n","/* eslint-disable max-lines */\nimport {\n Breadcrumb,\n CaptureContext,\n Context,\n Contexts,\n Event,\n EventHint,\n EventProcessor,\n Extra,\n Extras,\n Primitive,\n Scope as ScopeInterface,\n ScopeContext,\n Severity,\n Span,\n Transaction,\n User,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, getGlobalObject, isPlainObject, isThenable, SyncPromise } from '@sentry/utils';\n\nimport { Session } from './session';\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n /** Flag if notifiying is happening. */\n protected _notifyingListeners: boolean = false;\n\n /** Callback for client to receive scope changes. */\n protected _scopeListeners: Array<(scope: Scope) => void> = [];\n\n /** Callback list that will be called after {@link applyToEvent}. */\n protected _eventProcessors: EventProcessor[] = [];\n\n /** Array of breadcrumbs. */\n protected _breadcrumbs: Breadcrumb[] = [];\n\n /** User */\n protected _user: User = {};\n\n /** Tags */\n protected _tags: { [key: string]: Primitive } = {};\n\n /** Extra */\n protected _extra: Extras = {};\n\n /** Contexts */\n protected _contexts: Contexts = {};\n\n /** Fingerprint */\n protected _fingerprint?: string[];\n\n /** Severity */\n protected _level?: Severity;\n\n /** Transaction Name */\n protected _transactionName?: string;\n\n /** Span */\n protected _span?: Span;\n\n /** Session */\n protected _session?: Session;\n\n /**\n * Inherit values from the parent scope.\n * @param scope to clone.\n */\n public static clone(scope?: Scope): Scope {\n const newScope = new Scope();\n if (scope) {\n newScope._breadcrumbs = [...scope._breadcrumbs];\n newScope._tags = { ...scope._tags };\n newScope._extra = { ...scope._extra };\n newScope._contexts = { ...scope._contexts };\n newScope._user = scope._user;\n newScope._level = scope._level;\n newScope._span = scope._span;\n newScope._session = scope._session;\n newScope._transactionName = scope._transactionName;\n newScope._fingerprint = scope._fingerprint;\n newScope._eventProcessors = [...scope._eventProcessors];\n }\n return newScope;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n public addScopeListener(callback: (scope: Scope) => void): void {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n public addEventProcessor(callback: EventProcessor): this {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): this {\n this._user = user || {};\n if (this._session) {\n this._session.update({ user });\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getUser(): User | undefined {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: Primitive }): this {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: Primitive): this {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: Extras): this {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: Extra): this {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setFingerprint(fingerprint: string[]): this {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setLevel(level: Severity): this {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setTransactionName(name?: string): this {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Can be removed in major version.\n * @deprecated in favor of {@link this.setTransactionName}\n */\n public setTransaction(name?: string): this {\n return this.setTransactionName(name);\n }\n\n /**\n * @inheritDoc\n */\n public setContext(key: string, context: Context | null): this {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts = { ...this._contexts, [key]: context };\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public setSpan(span?: Span): this {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getSpan(): Span | undefined {\n return this._span;\n }\n\n /**\n * @inheritDoc\n */\n public getTransaction(): Transaction | undefined {\n // often, this span will be a transaction, but it's not guaranteed to be\n const span = this.getSpan() as undefined | (Span & { spanRecorder: { spans: Span[] } });\n\n // try it the new way first\n if (span?.transaction) {\n return span?.transaction;\n }\n\n // fallback to the old way (known bug: this only finds transactions with sampled = true)\n if (span?.spanRecorder?.spans[0]) {\n return span.spanRecorder.spans[0] as Transaction;\n }\n\n // neither way found a transaction\n return undefined;\n }\n\n /**\n * @inheritDoc\n */\n public setSession(session?: Session): this {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public getSession(): Session | undefined {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n public update(captureContext?: CaptureContext): this {\n if (!captureContext) {\n return this;\n }\n\n if (typeof captureContext === 'function') {\n const updatedScope = (captureContext as (scope: T) => T)(this);\n return updatedScope instanceof Scope ? updatedScope : this;\n }\n\n if (captureContext instanceof Scope) {\n this._tags = { ...this._tags, ...captureContext._tags };\n this._extra = { ...this._extra, ...captureContext._extra };\n this._contexts = { ...this._contexts, ...captureContext._contexts };\n if (captureContext._user && Object.keys(captureContext._user).length) {\n this._user = captureContext._user;\n }\n if (captureContext._level) {\n this._level = captureContext._level;\n }\n if (captureContext._fingerprint) {\n this._fingerprint = captureContext._fingerprint;\n }\n } else if (isPlainObject(captureContext)) {\n // eslint-disable-next-line no-param-reassign\n captureContext = captureContext as ScopeContext;\n this._tags = { ...this._tags, ...captureContext.tags };\n this._extra = { ...this._extra, ...captureContext.extra };\n this._contexts = { ...this._contexts, ...captureContext.contexts };\n if (captureContext.user) {\n this._user = captureContext.user;\n }\n if (captureContext.level) {\n this._level = captureContext.level;\n }\n if (captureContext.fingerprint) {\n this._fingerprint = captureContext.fingerprint;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public clear(): this {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n this._breadcrumbs =\n maxBreadcrumbs !== undefined && maxBreadcrumbs >= 0\n ? [...this._breadcrumbs, mergedBreadcrumb].slice(-maxBreadcrumbs)\n : [...this._breadcrumbs, mergedBreadcrumb];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n public clearBreadcrumbs(): this {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Applies the current context and fingerprint to the event.\n * Note that breadcrumbs will be added by the client.\n * Also if the event has already breadcrumbs on it, we do not merge them.\n * @param event Event\n * @param hint May contain additional informartion about the original exception.\n * @hidden\n */\n public applyToEvent(event: Event, hint?: EventHint): PromiseLike {\n if (this._extra && Object.keys(this._extra).length) {\n event.extra = { ...this._extra, ...event.extra };\n }\n if (this._tags && Object.keys(this._tags).length) {\n event.tags = { ...this._tags, ...event.tags };\n }\n if (this._user && Object.keys(this._user).length) {\n event.user = { ...this._user, ...event.user };\n }\n if (this._contexts && Object.keys(this._contexts).length) {\n event.contexts = { ...this._contexts, ...event.contexts };\n }\n if (this._level) {\n event.level = this._level;\n }\n if (this._transactionName) {\n event.transaction = this._transactionName;\n }\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relys on that.\n if (this._span) {\n event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };\n const transactionName = this._span.transaction?.name;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n\n this._applyFingerprint(event);\n\n event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];\n event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n\n return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);\n }\n\n /**\n * This will be called after {@link applyToEvent} is finished.\n */\n protected _notifyEventProcessors(\n processors: EventProcessor[],\n event: Event | null,\n hint?: EventHint,\n index: number = 0,\n ): PromiseLike {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) as Event | null;\n if (isThenable(result)) {\n (result as PromiseLike)\n .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n this._notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n }\n\n /**\n * This will be called on every set call.\n */\n protected _notifyScopeListeners(): void {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n\n /**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\n private _applyFingerprint(event: Event): void {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint\n ? Array.isArray(event.fingerprint)\n ? event.fingerprint\n : [event.fingerprint]\n : [];\n\n // If we have something on the scope, then merge it with event\n if (this._fingerprint) {\n event.fingerprint = event.fingerprint.concat(this._fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n }\n}\n\n/**\n * Retruns the global event processors.\n */\nfunction getGlobalEventProcessors(): EventProcessor[] {\n /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n const global = getGlobalObject();\n global.__SENTRY__ = global.__SENTRY__ || {};\n global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];\n return global.__SENTRY__.globalEventProcessors;\n /* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n getGlobalEventProcessors().push(callback);\n}\n","import { Session as SessionInterface, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, uuid4 } from '@sentry/utils';\n\n/**\n * @inheritdoc\n */\nexport class Session implements SessionInterface {\n public userAgent?: string;\n public errors: number = 0;\n public release?: string;\n public sid: string = uuid4();\n public did?: string;\n public timestamp: number = Date.now();\n public started: number = Date.now();\n public duration: number = 0;\n public status: SessionStatus = SessionStatus.Ok;\n public environment?: string;\n public ipAddress?: string;\n public init: boolean = true;\n\n constructor(context?: Omit) {\n if (context) {\n this.update(context);\n }\n }\n\n /** JSDoc */\n // eslint-disable-next-line complexity\n update(context: SessionContext = {}): void {\n if (context.user) {\n if (context.user.ip_address) {\n this.ipAddress = context.user.ip_address;\n }\n\n if (!context.did) {\n this.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n this.timestamp = context.timestamp || Date.now();\n\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n this.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n this.init = context.init;\n }\n if (context.did) {\n this.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n this.started = context.started;\n }\n if (typeof context.duration === 'number') {\n this.duration = context.duration;\n } else {\n this.duration = this.timestamp - this.started;\n }\n if (context.release) {\n this.release = context.release;\n }\n if (context.environment) {\n this.environment = context.environment;\n }\n if (context.ipAddress) {\n this.ipAddress = context.ipAddress;\n }\n if (context.userAgent) {\n this.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n this.errors = context.errors;\n }\n if (context.status) {\n this.status = context.status;\n }\n }\n\n /** JSDoc */\n close(status?: Exclude): void {\n if (status) {\n this.update({ status });\n } else if (this.status === SessionStatus.Ok) {\n this.update({ status: SessionStatus.Exited });\n } else {\n this.update();\n }\n }\n\n /** JSDoc */\n toJSON(): {\n init: boolean;\n sid: string;\n did?: string;\n timestamp: string;\n started: string;\n duration: number;\n status: SessionStatus;\n errors: number;\n attrs?: {\n release?: string;\n environment?: string;\n user_agent?: string;\n ip_address?: string;\n };\n } {\n return dropUndefinedKeys({\n sid: `${this.sid}`,\n init: this.init,\n started: new Date(this.started).toISOString(),\n timestamp: new Date(this.timestamp).toISOString(),\n status: this.status,\n errors: this.errors,\n did: typeof this.did === 'number' || typeof this.did === 'string' ? `${this.did}` : undefined,\n duration: this.duration,\n attrs: dropUndefinedKeys({\n release: this.release,\n environment: this.environment,\n ip_address: this.ipAddress,\n user_agent: this.userAgent,\n }),\n });\n }\n}\n","/* eslint-disable max-lines */\nimport {\n Breadcrumb,\n BreadcrumbHint,\n Client,\n CustomSamplingContext,\n Event,\n EventHint,\n Extra,\n Extras,\n Hub as HubInterface,\n Integration,\n IntegrationClass,\n Primitive,\n SessionContext,\n SessionStatus,\n Severity,\n Span,\n SpanContext,\n Transaction,\n TransactionContext,\n User,\n} from '@sentry/types';\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalObject, isNodeEnv, logger, uuid4 } from '@sentry/utils';\n\nimport { Carrier, DomainAsCarrier, Layer } from './interfaces';\nimport { Scope } from './scope';\nimport { Session } from './session';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = 3;\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * Absolute maximum number of breadcrumbs added to an event. The\n * `maxBreadcrumbs` option cannot be higher than this value.\n */\nconst MAX_BREADCRUMBS = 100;\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n /** Is a {@link Layer}[] containing the client and scope */\n private readonly _stack: Layer[] = [{}];\n\n /** Contains the last event id of a captured event. */\n private _lastEventId?: string;\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n */\n public constructor(client?: Client, scope: Scope = new Scope(), private readonly _version: number = API_VERSION) {\n this.getStackTop().scope = scope;\n this.bindClient(client);\n }\n\n /**\n * @inheritDoc\n */\n public isOlderThan(version: number): boolean {\n return this._version < version;\n }\n\n /**\n * @inheritDoc\n */\n public bindClient(client?: Client): void {\n const top = this.getStackTop();\n top.client = client;\n if (client && client.setupIntegrations) {\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n */\n public pushScope(): Scope {\n // We want to clone the content of prev scope\n const scope = Scope.clone(this.getScope());\n this.getStack().push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n */\n public popScope(): boolean {\n if (this.getStack().length <= 1) return false;\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n */\n public withScope(callback: (scope: Scope) => void): void {\n const scope = this.pushScope();\n try {\n callback(scope);\n } finally {\n this.popScope();\n }\n }\n\n /**\n * @inheritDoc\n */\n public getClient(): C | undefined {\n return this.getStackTop().client as C;\n }\n\n /** Returns the scope of the top stack. */\n public getScope(): Scope | undefined {\n return this.getStackTop().scope;\n }\n\n /** Returns the scope stack for domains or the process. */\n public getStack(): Layer[] {\n return this._stack;\n }\n\n /** Returns the topmost scope layer in the order domain > local > process. */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public captureException(exception: any, hint?: EventHint): string {\n const eventId = (this._lastEventId = uuid4());\n let finalHint = hint;\n\n // If there's no explicit hint provided, mimick the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n if (!hint) {\n let syntheticException: Error;\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception as Error;\n }\n finalHint = {\n originalException: exception,\n syntheticException,\n };\n }\n\n this._invokeClient('captureException', exception, {\n ...finalHint,\n event_id: eventId,\n });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(message: string, level?: Severity, hint?: EventHint): string {\n const eventId = (this._lastEventId = uuid4());\n let finalHint = hint;\n\n // If there's no explicit hint provided, mimick the same thing that would happen\n // in the minimal itself to create a consistent behavior.\n // We don't do this in the client, as it's the lowest level API, and doing this,\n // would prevent user from having full control over direct calls.\n if (!hint) {\n let syntheticException: Error;\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception as Error;\n }\n finalHint = {\n originalException: message,\n syntheticException,\n };\n }\n\n this._invokeClient('captureMessage', message, level, {\n ...finalHint,\n event_id: eventId,\n });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint): string {\n const eventId = (this._lastEventId = uuid4());\n this._invokeClient('captureEvent', event, {\n ...hint,\n event_id: eventId,\n });\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public lastEventId(): string | undefined {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n */\n public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n const { scope, client } = this.getStackTop();\n\n if (!scope || !client) return;\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n scope.addBreadcrumb(finalBreadcrumb, Math.min(maxBreadcrumbs, MAX_BREADCRUMBS));\n }\n\n /**\n * @inheritDoc\n */\n public setUser(user: User | null): void {\n const scope = this.getScope();\n if (scope) scope.setUser(user);\n }\n\n /**\n * @inheritDoc\n */\n public setTags(tags: { [key: string]: Primitive }): void {\n const scope = this.getScope();\n if (scope) scope.setTags(tags);\n }\n\n /**\n * @inheritDoc\n */\n public setExtras(extras: Extras): void {\n const scope = this.getScope();\n if (scope) scope.setExtras(extras);\n }\n\n /**\n * @inheritDoc\n */\n public setTag(key: string, value: Primitive): void {\n const scope = this.getScope();\n if (scope) scope.setTag(key, value);\n }\n\n /**\n * @inheritDoc\n */\n public setExtra(key: string, extra: Extra): void {\n const scope = this.getScope();\n if (scope) scope.setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public setContext(name: string, context: { [key: string]: any } | null): void {\n const scope = this.getScope();\n if (scope) scope.setContext(name, context);\n }\n\n /**\n * @inheritDoc\n */\n public configureScope(callback: (scope: Scope) => void): void {\n const { scope, client } = this.getStackTop();\n if (scope && client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n public run(callback: (hub: Hub) => void): void {\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n */\n public getIntegration(integration: IntegrationClass): T | null {\n const client = this.getClient();\n if (!client) return null;\n try {\n return client.getIntegration(integration);\n } catch (_oO) {\n logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n public startSpan(context: SpanContext): Span {\n return this._callExtensionMethod('startSpan', context);\n }\n\n /**\n * @inheritDoc\n */\n public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n return this._callExtensionMethod('startTransaction', context, customSamplingContext);\n }\n\n /**\n * @inheritDoc\n */\n public traceHeaders(): { [key: string]: string } {\n return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n }\n\n /**\n * @inheritDoc\n */\n public captureSession(endSession: boolean = false): void {\n // both send the update and pull the session from the scope\n if (endSession) {\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n */\n public endSession(): void {\n this.getStackTop()\n ?.scope?.getSession()\n ?.close();\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n this.getStackTop()?.scope?.setSession();\n }\n\n /**\n * @inheritDoc\n */\n public startSession(context?: SessionContext): Session {\n const { scope, client } = this.getStackTop();\n const { release, environment } = (client && client.getOptions()) || {};\n const session = new Session({\n release,\n environment,\n ...(scope && { user: scope.getUser() }),\n ...context,\n });\n\n if (scope) {\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === SessionStatus.Ok) {\n currentSession.update({ status: SessionStatus.Exited });\n }\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n }\n\n return session;\n }\n\n /**\n * Sends the current Session on the scope\n */\n private _sendSessionUpdate(): void {\n const { scope, client } = this.getStackTop();\n if (!scope) return;\n\n const session = scope.getSession && scope.getSession();\n if (session) {\n if (client && client.captureSession) {\n client.captureSession(session);\n }\n }\n }\n\n /**\n * Internal helper function to call a method on the top client if it exists.\n *\n * @param method The method to call on the client.\n * @param args Arguments to pass to the client function.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _invokeClient(method: M, ...args: any[]): void {\n const { scope, client } = this.getStackTop();\n if (client && client[method]) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (client as any)[method](...args, scope);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _callExtensionMethod(method: string, ...args: any[]): T {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/** Returns the global shim registry. */\nexport function getMainCarrier(): Carrier {\n const carrier = getGlobalObject();\n carrier.__SENTRY__ = carrier.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return carrier;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n // If there's no hub, or its an old API, assign a new one\n if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n setHubOnCarrier(registry, new Hub());\n }\n\n // Prefer domains over global if they are there (applicable only to Node environment)\n if (isNodeEnv()) {\n return getHubFromActiveDomain(registry);\n }\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * Returns the active domain, if one exists\n * @deprecated No longer used; remove in v7\n * @returns The domain, or undefined if there is no active domain\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function getActiveDomain(): DomainAsCarrier | undefined {\n logger.warn('Function `getActiveDomain` is deprecated and will be removed in a future version.');\n\n const sentry = getMainCarrier().__SENTRY__;\n\n return sentry && sentry.extensions && sentry.extensions.domain && sentry.extensions.domain.active;\n}\n\n/**\n * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist\n * @returns discovered hub\n */\nfunction getHubFromActiveDomain(registry: Carrier): Hub {\n try {\n const activeDomain = getMainCarrier().__SENTRY__?.extensions?.domain?.active;\n\n // If there's no active domain, just return global hub\n if (!activeDomain) {\n return getHubFromCarrier(registry);\n }\n\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) {\n const registryHubTopStack = getHubFromCarrier(registry).getStackTop();\n setHubOnCarrier(activeDomain, new Hub(registryHubTopStack.client, Scope.clone(registryHubTopStack.scope)));\n }\n\n // Return hub that lives on a domain\n return getHubFromCarrier(activeDomain);\n } catch (_Oo) {\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n }\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub) return carrier.__SENTRY__.hub;\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = new Hub();\n return carrier.__SENTRY__.hub;\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n if (!carrier) return false;\n carrier.__SENTRY__ = carrier.__SENTRY__ || {};\n carrier.__SENTRY__.hub = hub;\n return true;\n}\n","import { getCurrentHub, Hub, Scope } from '@sentry/hub';\nimport {\n Breadcrumb,\n CaptureContext,\n CustomSamplingContext,\n Event,\n Extra,\n Extras,\n Primitive,\n Severity,\n Transaction,\n TransactionContext,\n User,\n} from '@sentry/types';\n\n/**\n * This calls a function on the current hub.\n * @param method function to call on hub.\n * @param args to pass to function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction callOnHub(method: string, ...args: any[]): T {\n const hub = getCurrentHub();\n if (hub && hub[method as keyof Hub]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (hub[method as keyof Hub] as any)(...args);\n }\n throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);\n}\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function captureException(exception: any, captureContext?: CaptureContext): string {\n let syntheticException: Error;\n try {\n throw new Error('Sentry syntheticException');\n } catch (exception) {\n syntheticException = exception as Error;\n }\n return callOnHub('captureException', exception, {\n captureContext,\n originalException: exception,\n syntheticException,\n });\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param level Define the level of the message.\n * @returns The generated eventId.\n */\nexport function captureMessage(message: string, captureContext?: CaptureContext | Severity): string {\n let syntheticException: Error;\n try {\n throw new Error(message);\n } catch (exception) {\n syntheticException = exception as Error;\n }\n\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n\n return callOnHub('captureMessage', message, level, {\n originalException: message,\n syntheticException,\n ...context,\n });\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\nexport function captureEvent(event: Event): string {\n return callOnHub('captureEvent', event);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): void {\n callOnHub('configureScope', callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb): void {\n callOnHub('addBreadcrumb', breadcrumb);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setContext(name: string, context: { [key: string]: any } | null): void {\n callOnHub('setContext', name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): void {\n callOnHub('setExtras', extras);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): void {\n callOnHub('setTags', tags);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): void {\n callOnHub('setExtra', key, extra);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): void {\n callOnHub('setTag', key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): void {\n callOnHub('setUser', user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): void {\n callOnHub('withScope', callback);\n}\n\n/**\n * Calls a function on the latest client. Use this with caution, it's meant as\n * in \"internal\" helper so we don't need to expose every possible function in\n * the shim. It is not guaranteed that the client actually implements the\n * function.\n *\n * @param method The method to call on the client/client.\n * @param args Arguments to pass to the client/fontend.\n * @hidden\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _callOnClient(method: string, ...args: any[]): void {\n callOnHub('_invokeClient', method, ...args);\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\nexport function startTransaction(\n context: TransactionContext,\n customSamplingContext?: CustomSamplingContext,\n): Transaction {\n return callOnHub('startTransaction', { ...context }, customSamplingContext);\n}\n","import { DsnLike, SdkMetadata } from '@sentry/types';\nimport { Dsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/**\n * Helper class to provide urls, headers and metadata that can be used to form\n * different types of requests to Sentry endpoints.\n * Supports both envelopes and regular event requests.\n **/\nexport class API {\n /** The DSN as passed to Sentry.init() */\n public dsn: DsnLike;\n\n /** Metadata about the SDK (name, version, etc) for inclusion in envelope headers */\n public metadata: SdkMetadata;\n\n /** The internally used Dsn object. */\n private readonly _dsnObject: Dsn;\n\n /** Create a new instance of API */\n public constructor(dsn: DsnLike, metadata: SdkMetadata = {}) {\n this.dsn = dsn;\n this._dsnObject = new Dsn(dsn);\n this.metadata = metadata;\n }\n\n /** Returns the Dsn object. */\n public getDsn(): Dsn {\n return this._dsnObject;\n }\n\n /** Returns the prefix to construct Sentry ingestion API endpoints. */\n public getBaseApiEndpoint(): string {\n const dsn = this._dsnObject;\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n }\n\n /** Returns the store endpoint URL. */\n public getStoreEndpoint(): string {\n return this._getIngestEndpoint('store');\n }\n\n /**\n * Returns the store endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n public getStoreEndpointWithUrlEncodedAuth(): string {\n return `${this.getStoreEndpoint()}?${this._encodedAuth()}`;\n }\n\n /**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\n public getEnvelopeEndpointWithUrlEncodedAuth(): string {\n return `${this._getEnvelopeEndpoint()}?${this._encodedAuth()}`;\n }\n\n /** Returns only the path component for the store endpoint. */\n public getStoreEndpointPath(): string {\n const dsn = this._dsnObject;\n return `${dsn.path ? `/${dsn.path}` : ''}/api/${dsn.projectId}/store/`;\n }\n\n /**\n * Returns an object that can be used in request headers.\n * This is needed for node and the old /store endpoint in sentry\n */\n public getRequestHeaders(clientName: string, clientVersion: string): { [key: string]: string } {\n // CHANGE THIS to use metadata but keep clientName and clientVersion compatible\n const dsn = this._dsnObject;\n const header = [`Sentry sentry_version=${SENTRY_API_VERSION}`];\n header.push(`sentry_client=${clientName}/${clientVersion}`);\n header.push(`sentry_key=${dsn.publicKey}`);\n if (dsn.pass) {\n header.push(`sentry_secret=${dsn.pass}`);\n }\n return {\n 'Content-Type': 'application/json',\n 'X-Sentry-Auth': header.join(', '),\n };\n }\n\n /** Returns the url to the report dialog endpoint. */\n public getReportDialogEndpoint(\n dialogOptions: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n user?: { name?: string; email?: string };\n } = {},\n ): string {\n const dsn = this._dsnObject;\n const endpoint = `${this.getBaseApiEndpoint()}embed/error-page/`;\n\n const encodedOptions = [];\n encodedOptions.push(`dsn=${dsn.toString()}`);\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'user') {\n if (!dialogOptions.user) {\n continue;\n }\n if (dialogOptions.user.name) {\n encodedOptions.push(`name=${encodeURIComponent(dialogOptions.user.name)}`);\n }\n if (dialogOptions.user.email) {\n encodedOptions.push(`email=${encodeURIComponent(dialogOptions.user.email)}`);\n }\n } else {\n encodedOptions.push(`${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`);\n }\n }\n if (encodedOptions.length) {\n return `${endpoint}?${encodedOptions.join('&')}`;\n }\n\n return endpoint;\n }\n\n /** Returns the envelope endpoint URL. */\n private _getEnvelopeEndpoint(): string {\n return this._getIngestEndpoint('envelope');\n }\n\n /** Returns the ingest API endpoint for target. */\n private _getIngestEndpoint(target: 'store' | 'envelope'): string {\n const base = this.getBaseApiEndpoint();\n const dsn = this._dsnObject;\n return `${base}${dsn.projectId}/${target}/`;\n }\n\n /** Returns a URL-encoded string with auth config suitable for a query string. */\n private _encodedAuth(): string {\n const dsn = this._dsnObject;\n const auth = {\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n };\n return urlEncode(auth);\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { Integration, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport interface IntegrationIndex {\n [key: string]: Integration;\n}\n\n/** Gets integration to install */\nexport function getIntegrationsToSetup(options: Options): Integration[] {\n const defaultIntegrations = (options.defaultIntegrations && [...options.defaultIntegrations]) || [];\n const userIntegrations = options.integrations;\n let integrations: Integration[] = [];\n if (Array.isArray(userIntegrations)) {\n const userIntegrationsNames = userIntegrations.map(i => i.name);\n const pickedIntegrationsNames: string[] = [];\n\n // Leave only unique default integrations, that were not overridden with provided user integrations\n defaultIntegrations.forEach(defaultIntegration => {\n if (\n userIntegrationsNames.indexOf(defaultIntegration.name) === -1 &&\n pickedIntegrationsNames.indexOf(defaultIntegration.name) === -1\n ) {\n integrations.push(defaultIntegration);\n pickedIntegrationsNames.push(defaultIntegration.name);\n }\n });\n\n // Don't add same user integration twice\n userIntegrations.forEach(userIntegration => {\n if (pickedIntegrationsNames.indexOf(userIntegration.name) === -1) {\n integrations.push(userIntegration);\n pickedIntegrationsNames.push(userIntegration.name);\n }\n });\n } else if (typeof userIntegrations === 'function') {\n integrations = userIntegrations(defaultIntegrations);\n integrations = Array.isArray(integrations) ? integrations : [integrations];\n } else {\n integrations = [...defaultIntegrations];\n }\n\n // Make sure that if present, `Debug` integration will always run last\n const integrationsNames = integrations.map(i => i.name);\n const alwaysLastToRun = 'Debug';\n if (integrationsNames.indexOf(alwaysLastToRun) !== -1) {\n integrations.push(...integrations.splice(integrationsNames.indexOf(alwaysLastToRun), 1));\n }\n\n return integrations;\n}\n\n/** Setup given integration */\nexport function setupIntegration(integration: Integration): void {\n if (installedIntegrations.indexOf(integration.name) !== -1) {\n return;\n }\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n logger.log(`Integration installed: ${integration.name}`);\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(options: O): IntegrationIndex {\n const integrations: IntegrationIndex = {};\n getIntegrationsToSetup(options).forEach(integration => {\n integrations[integration.name] = integration;\n setupIntegration(integration);\n });\n return integrations;\n}\n","/* eslint-disable max-lines */\nimport { Scope, Session } from '@sentry/hub';\nimport {\n Client,\n Event,\n EventHint,\n Integration,\n IntegrationClass,\n Options,\n SessionStatus,\n Severity,\n} from '@sentry/types';\nimport {\n dateTimestampInSeconds,\n Dsn,\n isPrimitive,\n isThenable,\n logger,\n normalize,\n SentryError,\n SyncPromise,\n truncate,\n uuid4,\n} from '@sentry/utils';\n\nimport { Backend, BackendClass } from './basebackend';\nimport { IntegrationIndex, setupIntegrations } from './integration';\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding backend constructor and options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}. Also, the Backend instance is available via\n * {@link Client.getBackend}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event via the backend, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(NodeBackend, options);\n * }\n *\n * // ...\n * }\n */\nexport abstract class BaseClient implements Client {\n /**\n * The backend used to physically interact in the environment. Usually, this\n * will correspond to the client. When composing SDKs, however, the Backend\n * from the root SDK will be used.\n */\n protected readonly _backend: B;\n\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n protected readonly _dsn?: Dsn;\n\n /** Array of used integrations. */\n protected _integrations: IntegrationIndex = {};\n\n /** Number of call being processed */\n protected _processing: number = 0;\n\n /**\n * Initializes this client instance.\n *\n * @param backendClass A constructor function to create the backend.\n * @param options Options for the client.\n */\n protected constructor(backendClass: BackendClass, options: O) {\n this._backend = new backendClass(options);\n this._options = options;\n\n if (options.dsn) {\n this._dsn = new Dsn(options.dsn);\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n this._process(\n this._getBackend()\n .eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureMessage(message: string, level?: Severity, hint?: EventHint, scope?: Scope): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n const promisedEvent = isPrimitive(message)\n ? this._getBackend().eventFromMessage(String(message), level, hint)\n : this._getBackend().eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n let eventId: string | undefined = hint && hint.event_id;\n\n this._process(\n this._captureEvent(event, hint, scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n public captureSession(session: Session): void {\n if (!(typeof session.release === 'string')) {\n logger.warn('Discarded session because of missing or non-string release');\n } else {\n this._sendSession(session);\n // After sending, we set init false to inidcate it's not the first occurence\n session.update({ init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n public getDsn(): Dsn | undefined {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n public getOptions(): O {\n return this._options;\n }\n\n /**\n * @inheritDoc\n */\n public flush(timeout?: number): PromiseLike {\n return this._isClientProcessing(timeout).then(ready => {\n return this._getBackend()\n .getTransport()\n .close(timeout)\n .then(transportFlushed => ready && transportFlushed);\n });\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n return result;\n });\n }\n\n /**\n * Sets up the integrations\n */\n public setupIntegrations(): void {\n if (this._isEnabled()) {\n this._integrations = setupIntegrations(this._options);\n }\n }\n\n /**\n * @inheritDoc\n */\n public getIntegration(integration: IntegrationClass): T | null {\n try {\n return (this._integrations[integration.id] as T) || null;\n } catch (_oO) {\n logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /** Updates existing session based on the provided event */\n protected _updateSessionFromEvent(session: Session, event: Event): void {\n let crashed = false;\n let errored = false;\n let userAgent;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n const user = event.user;\n if (!session.userAgent) {\n const headers = event.request ? event.request.headers : {};\n for (const key in headers) {\n if (key.toLowerCase() === 'user-agent') {\n userAgent = headers[key];\n break;\n }\n }\n }\n\n session.update({\n ...(crashed && { status: SessionStatus.Crashed }),\n user,\n userAgent,\n errors: session.errors + Number(errored || crashed),\n });\n this.captureSession(session);\n }\n\n /** Deliver captured session to Sentry */\n protected _sendSession(session: Session): void {\n this._getBackend().sendSession(session);\n }\n\n /** Waits for the client to be done with processing. */\n protected _isClientProcessing(timeout?: number): PromiseLike {\n return new SyncPromise(resolve => {\n let ticked: number = 0;\n const tick: number = 1;\n\n const interval = setInterval(() => {\n if (this._processing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Returns the current backend. */\n protected _getBackend(): B {\n return this._backend;\n }\n\n /** Determines whether this SDK is enabled and a valid Dsn is present. */\n protected _isEnabled(): boolean {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike {\n const { normalizeDepth = 3 } = this.getOptions();\n const prepared: Event = {\n ...event,\n event_id: event.event_id || (hint && hint.event_id ? hint.event_id : uuid4()),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n\n this._applyClientOptions(prepared);\n this._applyIntegrationsMetadata(prepared);\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n let finalScope = scope;\n if (hint && hint.captureContext) {\n finalScope = Scope.clone(finalScope).update(hint.captureContext);\n }\n\n // We prepare the result here with a resolved Event.\n let result = SyncPromise.resolve(prepared);\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n if (finalScope) {\n // In case we have a hub we reassign it.\n result = finalScope.applyToEvent(prepared, hint);\n }\n\n return result.then(evt => {\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return this._normalizeEvent(evt, normalizeDepth);\n }\n return evt;\n });\n }\n\n /**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\n protected _normalizeEvent(event: Event | null, depth: number): Event | null {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth),\n }),\n };\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n normalized.contexts.trace = event.contexts.trace;\n }\n return normalized;\n }\n\n /**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\n protected _applyClientOptions(event: Event): void {\n const options = this.getOptions();\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : 'production';\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n }\n\n /**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\n protected _applyIntegrationsMetadata(event: Event): void {\n const sdkInfo = event.sdk;\n const integrationsArray = Object.keys(this._integrations);\n if (sdkInfo && integrationsArray.length > 0) {\n sdkInfo.integrations = integrationsArray;\n }\n }\n\n /**\n * Tells the backend to send this event\n * @param event The Sentry event to send\n */\n protected _sendEvent(event: Event): void {\n this._getBackend().sendEvent(event);\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n protected _captureEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n logger.error(reason);\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n protected _processEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { beforeSend, sampleRate } = this.getOptions();\n\n if (!this._isEnabled()) {\n return SyncPromise.reject(new SentryError('SDK not enabled, will not send event.'));\n }\n\n const isTransaction = event.type === 'transaction';\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n return SyncPromise.reject(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n ),\n );\n }\n\n return this._prepareEvent(event, scope, hint)\n .then(prepared => {\n if (prepared === null) {\n throw new SentryError('An event processor returned null, will not send event.');\n }\n\n const isInternalException = hint && hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n if (isInternalException || isTransaction || !beforeSend) {\n return prepared;\n }\n\n const beforeSendResult = beforeSend(prepared, hint);\n if (typeof beforeSendResult === 'undefined') {\n throw new SentryError('`beforeSend` method has to return `null` or a valid event.');\n } else if (isThenable(beforeSendResult)) {\n return (beforeSendResult as PromiseLike).then(\n event => event,\n e => {\n throw new SentryError(`beforeSend rejected with ${e}`);\n },\n );\n }\n return beforeSendResult;\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n throw new SentryError('`beforeSend` returned `null`, will not send event.');\n }\n\n const session = scope && scope.getSession && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n this._sendEvent(processedEvent);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason as Error,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n protected _process(promise: PromiseLike): void {\n this._processing += 1;\n promise.then(\n value => {\n this._processing -= 1;\n return value;\n },\n reason => {\n this._processing -= 1;\n return reason;\n },\n );\n }\n}\n","import { Event, Response, Status, Transport } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\n/** Noop transport */\nexport class NoopTransport implements Transport {\n /**\n * @inheritDoc\n */\n public sendEvent(_: Event): PromiseLike {\n return SyncPromise.resolve({\n reason: `NoopTransport: Event has been skipped because no Dsn is configured.`,\n status: Status.Skipped,\n });\n }\n\n /**\n * @inheritDoc\n */\n public close(_?: number): PromiseLike {\n return SyncPromise.resolve(true);\n }\n}\n","import { Event, EventHint, Options, Session, Severity, Transport } from '@sentry/types';\nimport { logger, SentryError } from '@sentry/utils';\n\nimport { NoopTransport } from './transports/noop';\n\n/**\n * Internal platform-dependent Sentry SDK Backend.\n *\n * While {@link Client} contains business logic specific to an SDK, the\n * Backend offers platform specific implementations for low-level operations.\n * These are persisting and loading information, sending events, and hooking\n * into the environment.\n *\n * Backends receive a handle to the Client in their constructor. When a\n * Backend automatically generates events, it must pass them to\n * the Client for validation and processing first.\n *\n * Usually, the Client will be of corresponding type, e.g. NodeBackend\n * receives NodeClient. However, higher-level SDKs can choose to instantiate\n * multiple Backends and delegate tasks between them. In this case, an event\n * generated by one backend might very well be sent by another one.\n *\n * The client also provides access to options via {@link Client.getOptions}.\n * @hidden\n */\nexport interface Backend {\n /** Creates a {@link Event} from an exception. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n eventFromException(exception: any, hint?: EventHint): PromiseLike;\n\n /** Creates a {@link Event} from a plain message. */\n eventFromMessage(message: string, level?: Severity, hint?: EventHint): PromiseLike;\n\n /** Submits the event to Sentry */\n sendEvent(event: Event): void;\n\n /** Submits the session to Sentry */\n sendSession(session: Session): void;\n\n /**\n * Returns the transport that is used by the backend.\n * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.\n *\n * @returns The transport.\n */\n getTransport(): Transport;\n}\n\n/**\n * A class object that can instantiate Backend objects.\n * @hidden\n */\nexport type BackendClass = new (options: O) => B;\n\n/**\n * This is the base implemention of a Backend.\n * @hidden\n */\nexport abstract class BaseBackend implements Backend {\n /** Options passed to the SDK. */\n protected readonly _options: O;\n\n /** Cached transport used internally. */\n protected _transport: Transport;\n\n /** Creates a new backend instance. */\n public constructor(options: O) {\n this._options = options;\n if (!this._options.dsn) {\n logger.warn('No DSN provided, backend will not do anything.');\n }\n this._transport = this._setupTransport();\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n public eventFromException(_exception: any, _hint?: EventHint): PromiseLike {\n throw new SentryError('Backend has to implement `eventFromException` method');\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(_message: string, _level?: Severity, _hint?: EventHint): PromiseLike {\n throw new SentryError('Backend has to implement `eventFromMessage` method');\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): void {\n this._transport.sendEvent(event).then(null, reason => {\n logger.error(`Error while sending event: ${reason}`);\n });\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session): void {\n if (!this._transport.sendSession) {\n logger.warn(\"Dropping session because custom transport doesn't implement sendSession\");\n return;\n }\n\n this._transport.sendSession(session).then(null, reason => {\n logger.error(`Error while sending session: ${reason}`);\n });\n }\n\n /**\n * @inheritDoc\n */\n public getTransport(): Transport {\n return this._transport;\n }\n\n /**\n * Sets up the transport so it can be used later to send requests.\n */\n protected _setupTransport(): Transport {\n return new NoopTransport();\n }\n}\n","import { Event, SdkInfo, SentryRequest, Session } from '@sentry/types';\n\nimport { API } from './api';\n\n/** Extract sdk info from from the API metadata */\nfunction getSdkMetadataForEnvelopeHeader(api: API): SdkInfo | undefined {\n if (!api.metadata || !api.metadata.sdk) {\n return;\n }\n const { name, version } = api.metadata.sdk;\n return { name, version };\n}\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n if (!sdkInfo) {\n return event;\n }\n\n event.sdk = event.sdk || {\n name: sdkInfo.name,\n version: sdkInfo.version,\n };\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates a SentryRequest from a Session. */\nexport function sessionToSentryRequest(session: Session, api: API): SentryRequest {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n const envelopeHeaders = JSON.stringify({\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n });\n const itemHeaders = JSON.stringify({\n type: 'session',\n });\n\n return {\n body: `${envelopeHeaders}\\n${itemHeaders}\\n${JSON.stringify(session)}`,\n type: 'session',\n url: api.getEnvelopeEndpointWithUrlEncodedAuth(),\n };\n}\n\n/** Creates a SentryRequest from an event. */\nexport function eventToSentryRequest(event: Event, api: API): SentryRequest {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(api);\n const eventType = event.type || 'event';\n const useEnvelope = eventType === 'transaction';\n\n const { transactionSampling, ...metadata } = event.debug_meta || {};\n const { method: samplingMethod, rate: sampleRate } = transactionSampling || {};\n if (Object.keys(metadata).length === 0) {\n delete event.debug_meta;\n } else {\n event.debug_meta = metadata;\n }\n\n const req: SentryRequest = {\n body: JSON.stringify(sdkInfo ? enhanceEventWithSdkInfo(event, api.metadata.sdk) : event),\n type: eventType,\n url: useEnvelope ? api.getEnvelopeEndpointWithUrlEncodedAuth() : api.getStoreEndpointWithUrlEncodedAuth(),\n };\n\n // https://develop.sentry.dev/sdk/envelopes/\n\n // Since we don't need to manipulate envelopes nor store them, there is no\n // exported concept of an Envelope with operations including serialization and\n // deserialization. Instead, we only implement a minimal subset of the spec to\n // serialize events inline here.\n if (useEnvelope) {\n const envelopeHeaders = JSON.stringify({\n event_id: event.event_id,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n });\n const itemHeaders = JSON.stringify({\n type: event.type,\n\n // TODO: Right now, sampleRate may or may not be defined (it won't be in the cases of inheritance and\n // explicitly-set sampling decisions). Are we good with that?\n sample_rates: [{ id: samplingMethod, rate: sampleRate }],\n\n // The content-type is assumed to be 'application/json' and not part of\n // the current spec for transaction items, so we don't bloat the request\n // body with it.\n //\n // content_type: 'application/json',\n //\n // The length is optional. It must be the number of bytes in req.Body\n // encoded as UTF-8. Since the server can figure this out and would\n // otherwise refuse events that report the length incorrectly, we decided\n // not to send the length to avoid problems related to reporting the wrong\n // size and to reduce request body size.\n //\n // length: new TextEncoder().encode(req.body).length,\n });\n // The trailing newline is optional. We intentionally don't send it to avoid\n // sending unnecessary bytes.\n //\n // const envelope = `${envelopeHeaders}\\n${itemHeaders}\\n${req.body}\\n`;\n const envelope = `${envelopeHeaders}\\n${itemHeaders}\\n${req.body}`;\n req.body = envelope;\n }\n\n return req;\n}\n","import { Integration, WrappedFunction } from '@sentry/types';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'FunctionToString';\n\n /**\n * @inheritDoc\n */\n public name: string = FunctionToString.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function(this: WrappedFunction, ...args: any[]): string {\n const context = this.__sentry_original__ || this;\n return originalFunctionToString.apply(context, args);\n };\n }\n}\n","export const SDK_VERSION = '6.3.0';\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';\nimport { Event, Integration } from '@sentry/types';\nimport { getEventDescription, isMatchingPattern, logger } from '@sentry/utils';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\n/** JSDoc */\ninterface InboundFiltersOptions {\n allowUrls: Array;\n denyUrls: Array;\n ignoreErrors: Array;\n ignoreInternal: boolean;\n\n /** @deprecated use {@link InboundFiltersOptions.allowUrls} instead. */\n whitelistUrls: Array;\n /** @deprecated use {@link InboundFiltersOptions.denyUrls} instead. */\n blacklistUrls: Array;\n}\n\n/** Inbound filters configurable by the user */\nexport class InboundFilters implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'InboundFilters';\n\n /**\n * @inheritDoc\n */\n public name: string = InboundFilters.id;\n\n public constructor(private readonly _options: Partial = {}) {}\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event) => {\n const hub = getCurrentHub();\n if (!hub) {\n return event;\n }\n const self = hub.getIntegration(InboundFilters);\n if (self) {\n const client = hub.getClient();\n const clientOptions = client ? client.getOptions() : {};\n const options = self._mergeOptions(clientOptions);\n if (self._shouldDropEvent(event, options)) {\n return null;\n }\n }\n return event;\n });\n }\n\n /** JSDoc */\n private _shouldDropEvent(event: Event, options: Partial): boolean {\n if (this._isSentryError(event, options)) {\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (this._isIgnoredError(event, options)) {\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (this._isDeniedUrl(event, options)) {\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${this._getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!this._isAllowedUrl(event, options)) {\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${this._getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n }\n\n /** JSDoc */\n private _isSentryError(event: Event, options: Partial): boolean {\n if (!options.ignoreInternal) {\n return false;\n }\n\n try {\n return (\n (event &&\n event.exception &&\n event.exception.values &&\n event.exception.values[0] &&\n event.exception.values[0].type === 'SentryError') ||\n false\n );\n } catch (_oO) {\n return false;\n }\n }\n\n /** JSDoc */\n private _isIgnoredError(event: Event, options: Partial): boolean {\n if (!options.ignoreErrors || !options.ignoreErrors.length) {\n return false;\n }\n\n return this._getPossibleEventMessages(event).some(message =>\n // Not sure why TypeScript complains here...\n (options.ignoreErrors as Array).some(pattern => isMatchingPattern(message, pattern)),\n );\n }\n\n /** JSDoc */\n private _isDeniedUrl(event: Event, options: Partial): boolean {\n // TODO: Use Glob instead?\n if (!options.denyUrls || !options.denyUrls.length) {\n return false;\n }\n const url = this._getEventFilterUrl(event);\n return !url ? false : options.denyUrls.some(pattern => isMatchingPattern(url, pattern));\n }\n\n /** JSDoc */\n private _isAllowedUrl(event: Event, options: Partial): boolean {\n // TODO: Use Glob instead?\n if (!options.allowUrls || !options.allowUrls.length) {\n return true;\n }\n const url = this._getEventFilterUrl(event);\n return !url ? true : options.allowUrls.some(pattern => isMatchingPattern(url, pattern));\n }\n\n /** JSDoc */\n private _mergeOptions(clientOptions: Partial = {}): Partial {\n return {\n allowUrls: [\n // eslint-disable-next-line deprecation/deprecation\n ...(this._options.whitelistUrls || []),\n ...(this._options.allowUrls || []),\n // eslint-disable-next-line deprecation/deprecation\n ...(clientOptions.whitelistUrls || []),\n ...(clientOptions.allowUrls || []),\n ],\n denyUrls: [\n // eslint-disable-next-line deprecation/deprecation\n ...(this._options.blacklistUrls || []),\n ...(this._options.denyUrls || []),\n // eslint-disable-next-line deprecation/deprecation\n ...(clientOptions.blacklistUrls || []),\n ...(clientOptions.denyUrls || []),\n ],\n ignoreErrors: [\n ...(this._options.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...DEFAULT_IGNORE_ERRORS,\n ],\n ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true,\n };\n }\n\n /** JSDoc */\n private _getPossibleEventMessages(event: Event): string[] {\n if (event.message) {\n return [event.message];\n }\n if (event.exception) {\n try {\n const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};\n return [`${value}`, `${type}: ${value}`];\n } catch (oO) {\n logger.error(`Cannot extract message for event ${getEventDescription(event)}`);\n return [];\n }\n }\n return [];\n }\n\n /** JSDoc */\n private _getEventFilterUrl(event: Event): string | null {\n try {\n if (event.stacktrace) {\n const frames = event.stacktrace.frames;\n return (frames && frames[frames.length - 1].filename) || null;\n }\n if (event.exception) {\n const frames =\n event.exception.values && event.exception.values[0].stacktrace && event.exception.values[0].stacktrace.frames;\n return (frames && frames[frames.length - 1].filename) || null;\n }\n return null;\n } catch (oO) {\n logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n }\n}\n","/**\n * This was originally forked from https://github.com/occ/TraceKit, but has since been\n * largely modified and is now maintained as part of Sentry JS SDK.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/**\n * An object representing a single stack frame.\n * {Object} StackFrame\n * {string} url The JavaScript or HTML file URL.\n * {string} func The function name, or empty for anonymous functions (if guessing did not work).\n * {string[]?} args The arguments passed to the function, if known.\n * {number=} line The line number, if known.\n * {number=} column The column number, if known.\n * {string[]} context An array of source code lines; the middle element corresponds to the correct line#.\n */\nexport interface StackFrame {\n url: string;\n func: string;\n args: string[];\n line: number | null;\n column: number | null;\n}\n\n/**\n * An object representing a JavaScript stack trace.\n * {Object} StackTrace\n * {string} name The name of the thrown exception.\n * {string} message The exception error message.\n * {TraceKit.StackFrame[]} stack An array of stack frames.\n */\nexport interface StackTrace {\n name: string;\n message: string;\n mechanism?: string;\n stack: StackFrame[];\n failed?: boolean;\n}\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chrome = /^\\s*at (?:(.*?) ?\\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\\/).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst gecko = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst winjs = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\nconst geckoEval = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\nconst chromeEval = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function computeStackTrace(ex: any): StackTrace {\n let stack = null;\n let popSize = 0;\n\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n popSize = ex.framesToPop;\n } else if (reactMinifiedRegexp.test(ex.message)) {\n popSize = 1;\n }\n }\n\n try {\n // This must be tried first because Opera 10 *destroys*\n // its stacktrace property if you try to access the stack\n // property first!!\n stack = computeStackTraceFromStacktraceProp(ex);\n if (stack) {\n return popFrames(stack, popSize);\n }\n } catch (e) {\n // no-empty\n }\n\n try {\n stack = computeStackTraceFromStackProp(ex);\n if (stack) {\n return popFrames(stack, popSize);\n }\n } catch (e) {\n // no-empty\n }\n\n return {\n message: extractMessage(ex),\n name: ex && ex.name,\n stack: [],\n failed: true,\n };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, complexity\nfunction computeStackTraceFromStackProp(ex: any): StackTrace | null {\n if (!ex || !ex.stack) {\n return null;\n }\n\n const stack = [];\n const lines = ex.stack.split('\\n');\n let isEval;\n let submatch;\n let parts;\n let element;\n\n for (let i = 0; i < lines.length; ++i) {\n if ((parts = chrome.exec(lines[i]))) {\n const isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n if (isEval && (submatch = chromeEval.exec(parts[2]))) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = submatch[1]; // url\n parts[3] = submatch[2]; // line\n parts[4] = submatch[3]; // column\n }\n\n // Arpad: Working with the regexp above is super painful. it is quite a hack, but just stripping the `address at `\n // prefix here seems like the quickest solution for now.\n let url = parts[2] && parts[2].indexOf('address at ') === 0 ? parts[2].substr('address at '.length) : parts[2];\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n let func = parts[1] || UNKNOWN_FUNCTION;\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n if (isSafariExtension || isSafariWebExtension) {\n func = func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION;\n url = isSafariExtension ? `safari-extension:${url}` : `safari-web-extension:${url}`;\n }\n\n element = {\n url,\n func,\n args: isNative ? [parts[2]] : [],\n line: parts[3] ? +parts[3] : null,\n column: parts[4] ? +parts[4] : null,\n };\n } else if ((parts = winjs.exec(lines[i]))) {\n element = {\n url: parts[2],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: [],\n line: +parts[3],\n column: parts[4] ? +parts[4] : null,\n };\n } else if ((parts = gecko.exec(lines[i]))) {\n isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval && (submatch = geckoEval.exec(parts[3]))) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || `eval`;\n parts[3] = submatch[1];\n parts[4] = submatch[2];\n parts[5] = ''; // no column when eval\n } else if (i === 0 && !parts[5] && ex.columnNumber !== void 0) {\n // FireFox uses this awesome columnNumber property for its top frame\n // Also note, Firefox's column number is 0-based and everything else expects 1-based,\n // so adding 1\n // NOTE: this hack doesn't work if top-most frame is eval\n stack[0].column = (ex.columnNumber as number) + 1;\n }\n element = {\n url: parts[3],\n func: parts[1] || UNKNOWN_FUNCTION,\n args: parts[2] ? parts[2].split(',') : [],\n line: parts[4] ? +parts[4] : null,\n column: parts[5] ? +parts[5] : null,\n };\n } else {\n continue;\n }\n\n if (!element.func && element.line) {\n element.func = UNKNOWN_FUNCTION;\n }\n\n stack.push(element);\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n message: extractMessage(ex),\n name: ex.name,\n stack,\n };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction computeStackTraceFromStacktraceProp(ex: any): StackTrace | null {\n if (!ex || !ex.stacktrace) {\n return null;\n }\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace;\n const opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n const opera11Regex = / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\((.*)\\))? in (.*):\\s*$/i;\n const lines = stacktrace.split('\\n');\n const stack = [];\n let parts;\n\n for (let line = 0; line < lines.length; line += 2) {\n let element = null;\n if ((parts = opera10Regex.exec(lines[line]))) {\n element = {\n url: parts[2],\n func: parts[3],\n args: [],\n line: +parts[1],\n column: null,\n };\n } else if ((parts = opera11Regex.exec(lines[line]))) {\n element = {\n url: parts[6],\n func: parts[3] || parts[4],\n args: parts[5] ? parts[5].split(',') : [],\n line: +parts[1],\n column: +parts[2],\n };\n }\n\n if (element) {\n if (!element.func && element.line) {\n element.func = UNKNOWN_FUNCTION;\n }\n stack.push(element);\n }\n }\n\n if (!stack.length) {\n return null;\n }\n\n return {\n message: extractMessage(ex),\n name: ex.name,\n stack,\n };\n}\n\n/** Remove N number of frames from the stack */\nfunction popFrames(stacktrace: StackTrace, popSize: number): StackTrace {\n try {\n return {\n ...stacktrace,\n stack: stacktrace.stack.slice(popSize),\n };\n } catch (e) {\n return stacktrace;\n }\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction extractMessage(ex: any): string {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n","import { Event, Exception, StackFrame } from '@sentry/types';\nimport { extractExceptionKeysForMessage, isEvent, normalizeToSize } from '@sentry/utils';\n\nimport { computeStackTrace, StackFrame as TraceKitStackFrame, StackTrace as TraceKitStackTrace } from './tracekit';\n\nconst STACKTRACE_LIMIT = 50;\n\n/**\n * This function creates an exception from an TraceKitStackTrace\n * @param stacktrace TraceKitStackTrace that will be converted to an exception\n * @hidden\n */\nexport function exceptionFromStacktrace(stacktrace: TraceKitStackTrace): Exception {\n const frames = prepareFramesForEvent(stacktrace.stack);\n\n const exception: Exception = {\n type: stacktrace.name,\n value: stacktrace.message,\n };\n\n if (frames && frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n exception: Record,\n syntheticException?: Error,\n rejection?: boolean,\n): Event {\n const event: Event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : rejection ? 'UnhandledRejection' : 'Error',\n value: `Non-Error ${\n rejection ? 'promise rejection' : 'exception'\n } captured with keys: ${extractExceptionKeysForMessage(exception)}`,\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception),\n },\n };\n\n if (syntheticException) {\n const stacktrace = computeStackTrace(syntheticException);\n const frames = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames,\n };\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromStacktrace(stacktrace: TraceKitStackTrace): Event {\n const exception = exceptionFromStacktrace(stacktrace);\n\n return {\n exception: {\n values: [exception],\n },\n };\n}\n\n/**\n * @hidden\n */\nexport function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[] {\n if (!stack || !stack.length) {\n return [];\n }\n\n let localStack = stack;\n\n const firstFrameFunction = localStack[0].func || '';\n const lastFrameFunction = localStack[localStack.length - 1].func || '';\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (firstFrameFunction.indexOf('captureMessage') !== -1 || firstFrameFunction.indexOf('captureException') !== -1) {\n localStack = localStack.slice(1);\n }\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (lastFrameFunction.indexOf('sentryWrapped') !== -1) {\n localStack = localStack.slice(0, -1);\n }\n\n // The frame where the crash happened, should be the last entry in the array\n return localStack\n .slice(0, STACKTRACE_LIMIT)\n .map(\n (frame: TraceKitStackFrame): StackFrame => ({\n colno: frame.column === null ? undefined : frame.column,\n filename: frame.url || localStack[0].url,\n function: frame.func || '?',\n in_app: true,\n lineno: frame.line === null ? undefined : frame.line,\n }),\n )\n .reverse();\n}\n","import { Event, EventHint, Options, Severity } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isPlainObject,\n SyncPromise,\n} from '@sentry/utils';\n\nimport { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';\nimport { computeStackTrace } from './tracekit';\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nexport function eventFromException(options: Options, exception: unknown, hint?: EventHint): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(exception, syntheticException, {\n attachStacktrace: options.attachStacktrace,\n });\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n event.level = Severity.Error;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return SyncPromise.resolve(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n options: Options,\n message: string,\n level: Severity = Severity.Info,\n hint?: EventHint,\n): PromiseLike {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(message, syntheticException, {\n attachStacktrace: options.attachStacktrace,\n });\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return SyncPromise.resolve(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n exception: unknown,\n syntheticException?: Error,\n options: {\n rejection?: boolean;\n attachStacktrace?: boolean;\n } = {},\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n // eslint-disable-next-line no-param-reassign\n exception = errorEvent.error;\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n return event;\n }\n if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {\n // If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)\n // then we just extract the name, code, and message, as they don't provide anything else\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n const domException = exception as DOMException;\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n\n event = eventFromString(message, syntheticException, options);\n addExceptionTypeValue(event, message);\n if ('code' in domException) {\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception as Error)) {\n // we have a real Error object, do nothing\n event = eventFromStacktrace(computeStackTrace(exception as Error));\n return event;\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it is plain Object or Event, serialize it manually and extract options\n // This will allow us to group events based on top-level keys\n // which is much better than creating new group when any key/value change\n const objectException = exception as Record;\n event = eventFromPlainObject(objectException, syntheticException, options.rejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(exception as string, syntheticException, options);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n input: string,\n syntheticException?: Error,\n options: {\n attachStacktrace?: boolean;\n } = {},\n): Event {\n const event: Event = {\n message: input,\n };\n\n if (options.attachStacktrace && syntheticException) {\n const stacktrace = computeStackTrace(syntheticException);\n const frames = prepareFramesForEvent(stacktrace.stack);\n event.stacktrace = {\n frames,\n };\n }\n\n return event;\n}\n","import { API } from '@sentry/core';\nimport {\n Event,\n Response as SentryResponse,\n SentryRequestType,\n Status,\n Transport,\n TransportOptions,\n} from '@sentry/types';\nimport { logger, parseRetryAfterHeader, PromiseBuffer, SentryError } from '@sentry/utils';\n\nconst CATEGORY_MAPPING: {\n [key in SentryRequestType]: string;\n} = {\n event: 'error',\n transaction: 'transaction',\n session: 'session',\n};\n\n/** Base Transport class implementation */\nexport abstract class BaseTransport implements Transport {\n /**\n * @deprecated\n */\n public url: string;\n\n /** Helper to get Sentry API endpoints. */\n protected readonly _api: API;\n\n /** A simple buffer holding all requests. */\n protected readonly _buffer: PromiseBuffer = new PromiseBuffer(30);\n\n /** Locks transport after receiving rate limits in a response */\n protected readonly _rateLimits: Record = {};\n\n public constructor(public options: TransportOptions) {\n this._api = new API(options.dsn, options._metadata);\n // eslint-disable-next-line deprecation/deprecation\n this.url = this._api.getStoreEndpointWithUrlEncodedAuth();\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(_: Event): PromiseLike {\n throw new SentryError('Transport Class has to implement `sendEvent` method');\n }\n\n /**\n * @inheritDoc\n */\n public close(timeout?: number): PromiseLike {\n return this._buffer.drain(timeout);\n }\n\n /**\n * Handle Sentry repsonse for promise-based transports.\n */\n protected _handleResponse({\n requestType,\n response,\n headers,\n resolve,\n reject,\n }: {\n requestType: SentryRequestType;\n response: Response | XMLHttpRequest;\n headers: Record;\n resolve: (value?: SentryResponse | PromiseLike | null | undefined) => void;\n reject: (reason?: unknown) => void;\n }): void {\n const status = Status.fromHttpCode(response.status);\n /**\n * \"The name is case-insensitive.\"\n * https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n */\n const limited = this._handleRateLimit(headers);\n if (limited) logger.warn(`Too many requests, backing off until: ${this._disabledUntil(requestType)}`);\n\n if (status === Status.Success) {\n resolve({ status });\n return;\n }\n\n reject(response);\n }\n\n /**\n * Gets the time that given category is disabled until for rate limiting\n */\n protected _disabledUntil(requestType: SentryRequestType): Date {\n const category = CATEGORY_MAPPING[requestType];\n return this._rateLimits[category] || this._rateLimits.all;\n }\n\n /**\n * Checks if a category is rate limited\n */\n protected _isRateLimited(requestType: SentryRequestType): boolean {\n return this._disabledUntil(requestType) > new Date(Date.now());\n }\n\n /**\n * Sets internal _rateLimits from incoming headers. Returns true if headers contains a non-empty rate limiting header.\n */\n protected _handleRateLimit(headers: Record): boolean {\n const now = Date.now();\n const rlHeader = headers['x-sentry-rate-limits'];\n const raHeader = headers['retry-after'];\n\n if (rlHeader) {\n // rate limit headers are of the form\n //
,
,..\n // where each
is of the form\n // : : : \n // where\n // is a delay in ms\n // is the event type(s) (error, transaction, etc) being rate limited and is of the form\n // ;;...\n // is what's being limited (org, project, or key) - ignored by SDK\n // is an arbitrary string like \"org_quota\" - ignored by SDK\n for (const limit of rlHeader.trim().split(',')) {\n const parameters = limit.split(':', 2);\n const headerDelay = parseInt(parameters[0], 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n for (const category of parameters[1].split(';')) {\n this._rateLimits[category || 'all'] = new Date(now + delay);\n }\n }\n return true;\n } else if (raHeader) {\n this._rateLimits.all = new Date(now + parseRetryAfterHeader(now, raHeader));\n return true;\n }\n return false;\n }\n}\n","import { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { Event, Response, SentryRequest, Session, TransportOptions } from '@sentry/types';\nimport { getGlobalObject, isNativeFetch, logger, supportsReferrerPolicy, SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\ntype FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nfunction getNativeFetchImplementation(): FetchImpl {\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Fast path to avoid DOM I/O\n const global = getGlobalObject();\n if (isNativeFetch(global.fetch)) {\n return global.fetch.bind(global);\n }\n\n const document = global.document;\n let fetchImpl = global.fetch;\n // eslint-disable-next-line deprecation/deprecation\n if (typeof document?.createElement === `function`) {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n if (sandbox.contentWindow?.fetch) {\n fetchImpl = sandbox.contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return fetchImpl.bind(global);\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** `fetch` based transport */\nexport class FetchTransport extends BaseTransport {\n /**\n * Fetch API reference which always points to native browser implementation.\n */\n private _fetch: typeof fetch;\n\n constructor(options: TransportOptions, fetchImpl: FetchImpl = getNativeFetchImplementation()) {\n super(options);\n this._fetch = fetchImpl;\n }\n\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session): PromiseLike {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n }\n\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n private _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike {\n if (this._isRateLimited(sentryRequest.type)) {\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: `Transport locked till ${this._disabledUntil(sentryRequest.type)} due to too many requests.`,\n status: 429,\n });\n }\n\n const options: RequestInit = {\n body: sentryRequest.body,\n method: 'POST',\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default\n // https://caniuse.com/#feat=referrer-policy\n // It doesn't. And it throw exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n referrerPolicy: (supportsReferrerPolicy() ? 'origin' : '') as ReferrerPolicy,\n };\n if (this.options.fetchParameters !== undefined) {\n Object.assign(options, this.options.fetchParameters);\n }\n if (this.options.headers !== undefined) {\n options.headers = this.options.headers;\n }\n\n return this._buffer.add(\n new SyncPromise((resolve, reject) => {\n this._fetch(sentryRequest.url, options)\n .then(response => {\n const headers = {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n };\n this._handleResponse({\n requestType: sentryRequest.type,\n response,\n headers,\n resolve,\n reject,\n });\n })\n .catch(reject);\n }),\n );\n }\n}\n","import { eventToSentryRequest, sessionToSentryRequest } from '@sentry/core';\nimport { Event, Response, SentryRequest, Session } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport { BaseTransport } from './base';\n\n/** `XHR` based transport */\nexport class XHRTransport extends BaseTransport {\n /**\n * @inheritDoc\n */\n public sendEvent(event: Event): PromiseLike {\n return this._sendRequest(eventToSentryRequest(event, this._api), event);\n }\n\n /**\n * @inheritDoc\n */\n public sendSession(session: Session): PromiseLike {\n return this._sendRequest(sessionToSentryRequest(session, this._api), session);\n }\n\n /**\n * @param sentryRequest Prepared SentryRequest to be delivered\n * @param originalPayload Original payload used to create SentryRequest\n */\n private _sendRequest(sentryRequest: SentryRequest, originalPayload: Event | Session): PromiseLike {\n if (this._isRateLimited(sentryRequest.type)) {\n return Promise.reject({\n event: originalPayload,\n type: sentryRequest.type,\n reason: `Transport locked till ${this._disabledUntil(sentryRequest.type)} due to too many requests.`,\n status: 429,\n });\n }\n\n return this._buffer.add(\n new SyncPromise((resolve, reject) => {\n const request = new XMLHttpRequest();\n\n request.onreadystatechange = (): void => {\n if (request.readyState === 4) {\n const headers = {\n 'x-sentry-rate-limits': request.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': request.getResponseHeader('Retry-After'),\n };\n this._handleResponse({ requestType: sentryRequest.type, response: request, headers, resolve, reject });\n }\n };\n\n request.open('POST', sentryRequest.url);\n for (const header in this.options.headers) {\n if (this.options.headers.hasOwnProperty(header)) {\n request.setRequestHeader(header, this.options.headers[header]);\n }\n }\n request.send(sentryRequest.body);\n }),\n );\n }\n}\n","import { BaseBackend } from '@sentry/core';\nimport { Event, EventHint, Options, Severity, Transport } from '@sentry/types';\nimport { supportsFetch } from '@sentry/utils';\n\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { FetchTransport, XHRTransport } from './transports';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see BrowserClient for more information.\n */\nexport interface BrowserOptions extends Options {\n /**\n * A pattern for error URLs which should exclusively be sent to Sentry.\n * This is the opposite of {@link Options.denyUrls}.\n * By default, all errors will be sent.\n */\n allowUrls?: Array;\n\n /**\n * A pattern for error URLs which should not be sent to Sentry.\n * To allow certain errors instead, use {@link Options.allowUrls}.\n * By default, all errors will be sent.\n */\n denyUrls?: Array;\n\n /** @deprecated use {@link Options.allowUrls} instead. */\n whitelistUrls?: Array;\n\n /** @deprecated use {@link Options.denyUrls} instead. */\n blacklistUrls?: Array;\n\n /**\n * A flag enabling Sessions Tracking feature.\n * By default, Sessions Tracking is enabled.\n */\n autoSessionTracking?: boolean;\n}\n\n/**\n * The Sentry Browser SDK Backend.\n * @hidden\n */\nexport class BrowserBackend extends BaseBackend {\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike {\n return eventFromException(this._options, exception, hint);\n }\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level: Severity = Severity.Info, hint?: EventHint): PromiseLike {\n return eventFromMessage(this._options, message, level, hint);\n }\n\n /**\n * @inheritDoc\n */\n protected _setupTransport(): Transport {\n if (!this._options.dsn) {\n // We return the noop transport here in case there is no Dsn.\n return super._setupTransport();\n }\n\n const transportOptions = {\n ...this._options.transportOptions,\n dsn: this._options.dsn,\n _metadata: this._options._metadata,\n };\n\n if (this._options.transport) {\n return new this._options.transport(transportOptions);\n }\n if (supportsFetch()) {\n return new FetchTransport(transportOptions);\n }\n return new XHRTransport(transportOptions);\n }\n}\n","import { API, captureException, withScope } from '@sentry/core';\nimport { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport { addExceptionMechanism, addExceptionTypeValue, logger } from '@sentry/utils';\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError += 1;\n setTimeout(() => {\n ignoreOnError -= 1;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n fn: WrappedFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n before?: WrappedFunction,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // We don't wanna wrap it twice\n if (fn.__sentry__) {\n return fn;\n }\n\n // If this has already been wrapped in the past, return that wrapped function\n if (fn.__sentry_wrapped__) {\n return fn.__sentry_wrapped__;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sentryWrapped: WrappedFunction = function(this: any): void {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n if (fn.handleEvent) {\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return fn.handleEvent.apply(this, wrappedArguments);\n }\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope((scope: Scope) => {\n scope.addEventProcessor((event: SentryEvent) => {\n const processedEvent = { ...event };\n\n if (options.mechanism) {\n addExceptionTypeValue(processedEvent, undefined, undefined);\n addExceptionMechanism(processedEvent, options.mechanism);\n }\n\n processedEvent.extra = {\n ...processedEvent.extra,\n arguments: args,\n };\n\n return processedEvent;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n fn.prototype = fn.prototype || {};\n sentryWrapped.prototype = fn.prototype;\n\n Object.defineProperty(fn, '__sentry_wrapped__', {\n enumerable: false,\n value: sentryWrapped,\n });\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n Object.defineProperties(sentryWrapped, {\n __sentry__: {\n enumerable: false,\n value: true,\n },\n __sentry_original__: {\n enumerable: false,\n value: fn,\n },\n });\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n eventId?: string;\n dsn?: DsnLike;\n user?: {\n email?: string;\n name?: string;\n };\n lang?: string;\n title?: string;\n subtitle?: string;\n subtitle2?: string;\n labelName?: string;\n labelEmail?: string;\n labelComments?: string;\n labelClose?: string;\n labelSubmit?: string;\n errorGeneric?: string;\n errorFormEntry?: string;\n successMessage?: string;\n /** Callback after reportDialog showed up */\n onLoad?(): void;\n}\n\n/**\n * Injects the Report Dialog script\n * @hidden\n */\nexport function injectReportDialog(options: ReportDialogOptions = {}): void {\n if (!options.eventId) {\n logger.error(`Missing eventId option in showReportDialog call`);\n return;\n }\n if (!options.dsn) {\n logger.error(`Missing dsn option in showReportDialog call`);\n return;\n }\n\n const script = document.createElement('script');\n script.async = true;\n script.src = new API(options.dsn).getReportDialogEndpoint(options);\n\n if (options.onLoad) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n script.onload = options.onLoad;\n }\n\n (document.head || document.body).appendChild(script);\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { getCurrentHub } from '@sentry/core';\nimport { Event, Integration, Primitive, Severity } from '@sentry/types';\nimport {\n addExceptionMechanism,\n addInstrumentationHandler,\n getLocationHref,\n isErrorEvent,\n isPrimitive,\n isString,\n logger,\n} from '@sentry/utils';\n\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\n/** JSDoc */\ninterface GlobalHandlersIntegrations {\n onerror: boolean;\n onunhandledrejection: boolean;\n}\n\n/** Global handlers */\nexport class GlobalHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'GlobalHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = GlobalHandlers.id;\n\n /** JSDoc */\n private readonly _options: GlobalHandlersIntegrations;\n\n /** JSDoc */\n private _onErrorHandlerInstalled: boolean = false;\n\n /** JSDoc */\n private _onUnhandledRejectionHandlerInstalled: boolean = false;\n\n /** JSDoc */\n public constructor(options?: GlobalHandlersIntegrations) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n }\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n Error.stackTraceLimit = 50;\n\n if (this._options.onerror) {\n logger.log('Global Handler attached: onerror');\n this._installGlobalOnErrorHandler();\n }\n\n if (this._options.onunhandledrejection) {\n logger.log('Global Handler attached: onunhandledrejection');\n this._installGlobalOnUnhandledRejectionHandler();\n }\n }\n\n /** JSDoc */\n private _installGlobalOnErrorHandler(): void {\n if (this._onErrorHandlerInstalled) {\n return;\n }\n\n addInstrumentationHandler({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback: (data: { msg: any; url: any; line: any; column: any; error: any }) => {\n const error = data.error;\n const currentHub = getCurrentHub();\n const hasIntegration = currentHub.getIntegration(GlobalHandlers);\n const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n return;\n }\n\n const client = currentHub.getClient();\n const event = isPrimitive(error)\n ? this._eventFromIncompleteOnError(data.msg, data.url, data.line, data.column)\n : this._enhanceEventWithInitialFrame(\n eventFromUnknownInput(error, undefined, {\n attachStacktrace: client && client.getOptions().attachStacktrace,\n rejection: false,\n }),\n data.url,\n data.line,\n data.column,\n );\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n\n currentHub.captureEvent(event, {\n originalException: error,\n });\n },\n type: 'error',\n });\n\n this._onErrorHandlerInstalled = true;\n }\n\n /** JSDoc */\n private _installGlobalOnUnhandledRejectionHandler(): void {\n if (this._onUnhandledRejectionHandlerInstalled) {\n return;\n }\n\n addInstrumentationHandler({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback: (e: any) => {\n let error = e;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n error = e.reason;\n }\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n error = e.detail.reason;\n }\n } catch (_oO) {\n // no-empty\n }\n\n const currentHub = getCurrentHub();\n const hasIntegration = currentHub.getIntegration(GlobalHandlers);\n const isFailedOwnDelivery = error && error.__sentry_own_request__ === true;\n\n if (!hasIntegration || shouldIgnoreOnError() || isFailedOwnDelivery) {\n return true;\n }\n\n const client = currentHub.getClient();\n const event = isPrimitive(error)\n ? this._eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(error, undefined, {\n attachStacktrace: client && client.getOptions().attachStacktrace,\n rejection: true,\n });\n\n event.level = Severity.Error;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onunhandledrejection',\n });\n\n currentHub.captureEvent(event, {\n originalException: error,\n });\n\n return;\n },\n type: 'unhandledrejection',\n });\n\n this._onUnhandledRejectionHandlerInstalled = true;\n }\n\n /**\n * This function creates a stack from an old, error-less onerror handler.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n const ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name;\n\n if (isString(message)) {\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name || 'Error',\n value: message,\n },\n ],\n },\n };\n\n return this._enhanceEventWithInitialFrame(event, url, line, column);\n }\n\n /**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\n private _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n }\n\n /** JSDoc */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n event.exception = event.exception || {};\n event.exception.values = event.exception.values || [];\n event.exception.values[0] = event.exception.values[0] || {};\n event.exception.values[0].stacktrace = event.exception.values[0].stacktrace || {};\n event.exception.values[0].stacktrace.frames = event.exception.values[0].stacktrace.frames || [];\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n if (event.exception.values[0].stacktrace.frames.length === 0) {\n event.exception.values[0].stacktrace.frames.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n }\n}\n","import { Integration, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getGlobalObject } from '@sentry/utils';\n\nimport { wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\n/** JSDoc */\ninterface TryCatchOptions {\n setTimeout: boolean;\n setInterval: boolean;\n requestAnimationFrame: boolean;\n XMLHttpRequest: boolean;\n eventTarget: boolean | string[];\n}\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'TryCatch';\n\n /**\n * @inheritDoc\n */\n public name: string = TryCatch.id;\n\n /** JSDoc */\n private readonly _options: TryCatchOptions;\n\n /**\n * @inheritDoc\n */\n public constructor(options?: Partial) {\n this._options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n }\n\n /**\n * Wrap timer functions and event targets to catch errors\n * and provide better metadata.\n */\n public setupOnce(): void {\n const global = getGlobalObject();\n\n if (this._options.setTimeout) {\n fill(global, 'setTimeout', this._wrapTimeFunction.bind(this));\n }\n\n if (this._options.setInterval) {\n fill(global, 'setInterval', this._wrapTimeFunction.bind(this));\n }\n\n if (this._options.requestAnimationFrame) {\n fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this));\n }\n\n if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) {\n fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this));\n }\n\n if (this._options.eventTarget) {\n const eventTarget = Array.isArray(this._options.eventTarget) ? this._options.eventTarget : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(this._wrapEventTarget.bind(this));\n }\n }\n\n /** JSDoc */\n private _wrapTimeFunction(original: () => void): () => number {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function(this: any, ...args: any[]): number {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: true,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n }\n\n /** JSDoc */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _wrapRAF(original: any): (callback: () => void) => any {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function(this: any, callback: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.call(\n this,\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: true,\n type: 'instrument',\n },\n }),\n );\n };\n }\n\n /** JSDoc */\n private _wrapEventTarget(target: string): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const global = getGlobalObject() as { [key: string]: any };\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = global[target] && global[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function(\n original: () => void,\n ): (eventName: string, fn: EventListenerObject, options?: boolean | AddEventListenerOptions) => void {\n return function(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n try {\n if (typeof fn.handleEvent === 'function') {\n fn.handleEvent = wrap(fn.handleEvent.bind(fn), {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: true,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.call(\n this,\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap((fn as any) as WrappedFunction, {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: true,\n type: 'instrument',\n },\n }),\n options,\n );\n };\n });\n\n fill(proto, 'removeEventListener', function(\n originalRemoveEventListener: () => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n return function(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this: any,\n eventName: string,\n fn: EventListenerObject,\n options?: boolean | EventListenerOptions,\n ): () => void {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = (fn as unknown) as WrappedFunction;\n try {\n const originalEventHandler = wrappedEventHandler?.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n });\n }\n\n /** JSDoc */\n private _wrapXHR(originalSend: () => void): () => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function(this: XMLHttpRequest, ...args: any[]): void {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function(original: WrappedFunction): () => any {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: true,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n if (original.__sentry_original__) {\n wrapOptions.mechanism.data.handler = getFunctionName(original.__sentry_original__);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable max-lines */\nimport { getCurrentHub } from '@sentry/core';\nimport { Event, Integration, Severity } from '@sentry/types';\nimport {\n addInstrumentationHandler,\n getEventDescription,\n getGlobalObject,\n htmlTreeAsString,\n parseUrl,\n safeJoin,\n} from '@sentry/utils';\n\n/** JSDoc */\ninterface BreadcrumbsOptions {\n console: boolean;\n dom: boolean;\n fetch: boolean;\n history: boolean;\n sentry: boolean;\n xhr: boolean;\n}\n\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\nexport class Breadcrumbs implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Breadcrumbs';\n\n /**\n * @inheritDoc\n */\n public name: string = Breadcrumbs.id;\n\n /** JSDoc */\n private readonly _options: BreadcrumbsOptions;\n\n /**\n * @inheritDoc\n */\n public constructor(options?: Partial) {\n this._options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n }\n\n /**\n * Create a breadcrumb of `sentry` from the events themselves\n */\n public addSentryBreadcrumb(event: Event): void {\n if (!this._options.sentry) {\n return;\n }\n getCurrentHub().addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n }\n\n /**\n * Instrument browser built-ins w/ breadcrumb capturing\n * - Console API\n * - DOM API (click/typing)\n * - XMLHttpRequest API\n * - Fetch API\n * - History API\n */\n public setupOnce(): void {\n if (this._options.console) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._consoleBreadcrumb(...args);\n },\n type: 'console',\n });\n }\n if (this._options.dom) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._domBreadcrumb(...args);\n },\n type: 'dom',\n });\n }\n if (this._options.xhr) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._xhrBreadcrumb(...args);\n },\n type: 'xhr',\n });\n }\n if (this._options.fetch) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._fetchBreadcrumb(...args);\n },\n type: 'fetch',\n });\n }\n if (this._options.history) {\n addInstrumentationHandler({\n callback: (...args) => {\n this._historyBreadcrumb(...args);\n },\n type: 'history',\n });\n }\n }\n\n /**\n * Creates breadcrumbs from console API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _consoleBreadcrumb(handlerData: { [key: string]: any }): void {\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: Severity.fromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n getCurrentHub().addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n }\n\n /**\n * Creates breadcrumbs from DOM API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _domBreadcrumb(handlerData: { [key: string]: any }): void {\n let target;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n target = handlerData.event.target\n ? htmlTreeAsString(handlerData.event.target as Node)\n : htmlTreeAsString((handlerData.event as unknown) as Node);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n getCurrentHub().addBreadcrumb(\n {\n category: `ui.${handlerData.name}`,\n message: target,\n },\n {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n },\n );\n }\n\n /**\n * Creates breadcrumbs from XHR API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _xhrBreadcrumb(handlerData: { [key: string]: any }): void {\n if (handlerData.endTimestamp) {\n // We only capture complete, non-sentry requests\n if (handlerData.xhr.__sentry_own_request__) {\n return;\n }\n\n const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};\n\n getCurrentHub().addBreadcrumb(\n {\n category: 'xhr',\n data: {\n method,\n url,\n status_code,\n },\n type: 'http',\n },\n {\n xhr: handlerData.xhr,\n input: body,\n },\n );\n\n return;\n }\n }\n\n /**\n * Creates breadcrumbs from fetch API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _fetchBreadcrumb(handlerData: { [key: string]: any }): void {\n // We only capture complete fetch requests\n if (!handlerData.endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n getCurrentHub().addBreadcrumb(\n {\n category: 'fetch',\n data: handlerData.fetchData,\n level: Severity.Error,\n type: 'http',\n },\n {\n data: handlerData.error,\n input: handlerData.args,\n },\n );\n } else {\n getCurrentHub().addBreadcrumb(\n {\n category: 'fetch',\n data: {\n ...handlerData.fetchData,\n status_code: handlerData.response.status,\n },\n type: 'http',\n },\n {\n input: handlerData.args,\n response: handlerData.response,\n },\n );\n }\n }\n\n /**\n * Creates breadcrumbs from history API calls\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _historyBreadcrumb(handlerData: { [key: string]: any }): void {\n const global = getGlobalObject();\n let from = handlerData.from;\n let to = handlerData.to;\n const parsedLoc = parseUrl(global.location.href);\n let parsedFrom = parseUrl(from);\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n getCurrentHub().addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, EventHint, Exception, ExtendedError, Integration } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport { exceptionFromStacktrace } from '../parsers';\nimport { computeStackTrace } from '../tracekit';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'LinkedErrors';\n\n /**\n * @inheritDoc\n */\n public readonly name: string = LinkedErrors.id;\n\n /**\n * @inheritDoc\n */\n private readonly _key: string;\n\n /**\n * @inheritDoc\n */\n private readonly _limit: number;\n\n /**\n * @inheritDoc\n */\n public constructor(options: { key?: string; limit?: number } = {}) {\n this._key = options.key || DEFAULT_KEY;\n this._limit = options.limit || DEFAULT_LIMIT;\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event, hint?: EventHint) => {\n const self = getCurrentHub().getIntegration(LinkedErrors);\n if (self) {\n return self._handler(event, hint);\n }\n return event;\n });\n }\n\n /**\n * @inheritDoc\n */\n private _handler(event: Event, hint?: EventHint): Event | null {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return event;\n }\n const linkedErrors = this._walkErrorTree(hint.originalException as ExtendedError, this._key);\n event.exception.values = [...linkedErrors, ...event.exception.values];\n return event;\n }\n\n /**\n * @inheritDoc\n */\n private _walkErrorTree(error: ExtendedError, key: string, stack: Exception[] = []): Exception[] {\n if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {\n return stack;\n }\n const stacktrace = computeStackTrace(error[key]);\n const exception = exceptionFromStacktrace(stacktrace);\n return this._walkErrorTree(error[key], key, [exception, ...stack]);\n }\n}\n","import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport { Event, Integration } from '@sentry/types';\nimport { getGlobalObject } from '@sentry/utils';\n\nconst global = getGlobalObject();\n\n/** UserAgent */\nexport class UserAgent implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'UserAgent';\n\n /**\n * @inheritDoc\n */\n public name: string = UserAgent.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n addGlobalEventProcessor((event: Event) => {\n if (getCurrentHub().getIntegration(UserAgent)) {\n // if none of the information we want exists, don't bother\n if (!global.navigator && !global.location && !global.document) {\n return event;\n }\n\n // grab as much info as exists and add it to the event\n const url = event.request?.url || global.location?.href;\n const { referrer } = global.document || {};\n const { userAgent } = global.navigator || {};\n\n const headers = {\n ...event.request?.headers,\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...(url && { url }), headers };\n\n return { ...event, request };\n }\n return event;\n });\n }\n}\n","import { BaseClient, Scope, SDK_VERSION } from '@sentry/core';\nimport { Event, EventHint } from '@sentry/types';\nimport { getGlobalObject, logger } from '@sentry/utils';\n\nimport { BrowserBackend, BrowserOptions } from './backend';\nimport { injectReportDialog, ReportDialogOptions } from './helpers';\nimport { Breadcrumbs } from './integrations';\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserOptions = {}) {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.browser',\n packages: [\n {\n name: 'npm:@sentry/browser',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n super(BrowserBackend, options);\n }\n\n /**\n * Show a report dialog to the user to send feedback to a specific event.\n *\n * @param options Set individual options for the dialog\n */\n public showReportDialog(options: ReportDialogOptions = {}): void {\n // doesn't work without a document (React Native)\n const document = getGlobalObject().document;\n if (!document) {\n return;\n }\n\n if (!this._isEnabled()) {\n logger.error('Trying to call showReportDialog with Sentry Client disabled');\n return;\n }\n\n injectReportDialog({\n ...options,\n dsn: options.dsn || this.getDsn(),\n });\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(event: Event, scope?: Scope, hint?: EventHint): PromiseLike {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, scope, hint);\n }\n\n /**\n * @inheritDoc\n */\n protected _sendEvent(event: Event): void {\n const integration = this.getIntegration(Breadcrumbs);\n if (integration) {\n integration.addSentryBreadcrumb(event);\n }\n super._sendEvent(event);\n }\n}\n","import { getCurrentHub, initAndBind, Integrations as CoreIntegrations } from '@sentry/core';\nimport { addInstrumentationHandler, getGlobalObject, logger, SyncPromise } from '@sentry/utils';\n\nimport { BrowserOptions } from './backend';\nimport { BrowserClient } from './client';\nimport { ReportDialogOptions, wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations';\n\nexport const defaultIntegrations = [\n new CoreIntegrations.InboundFilters(),\n new CoreIntegrations.FunctionToString(),\n new TryCatch(),\n new Breadcrumbs(),\n new GlobalHandlers(),\n new LinkedErrors(),\n new UserAgent(),\n];\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = defaultIntegrations;\n }\n if (options.release === undefined) {\n const window = getGlobalObject();\n // This supports the variable that sentry-webpack-plugin injects\n if (window.SENTRY_RELEASE && window.SENTRY_RELEASE.id) {\n options.release = window.SENTRY_RELEASE.id;\n }\n }\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n\n initAndBind(BrowserClient, options);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n if (!options.eventId) {\n options.eventId = getCurrentHub().lastEventId();\n }\n const client = getCurrentHub().getClient();\n if (client) {\n client.showReportDialog(options);\n }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n return getCurrentHub().lastEventId();\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function flush(timeout?: number): PromiseLike {\n const client = getCurrentHub().getClient();\n if (client) {\n return client.flush(timeout);\n }\n return SyncPromise.reject(false);\n}\n\n/**\n * A promise that resolves when all current events have been sent.\n * If you provide a timeout and the queue takes longer to drain the promise returns false.\n *\n * @param timeout Maximum time in ms the client should wait.\n */\nexport function close(timeout?: number): PromiseLike {\n const client = getCurrentHub().getClient();\n if (client) {\n return client.close(timeout);\n }\n return SyncPromise.reject(false);\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n return internalWrap(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n const window = getGlobalObject();\n const document = window.document;\n\n if (typeof document === 'undefined') {\n logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n const hub = getCurrentHub();\n\n if ('startSession' in hub) {\n // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n // pinned at the same version in package.json, but there are edge cases where it's possible'. See\n // https://github.com/getsentry/sentry-javascript/issues/3234 and\n // https://github.com/getsentry/sentry-javascript/issues/3207.\n\n hub.startSession();\n hub.captureSession();\n\n // We want to create a session for every navigation as well\n addInstrumentationHandler({\n callback: () => {\n hub.startSession();\n hub.captureSession();\n },\n type: 'history',\n });\n }\n}\n","export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\nimport { getGlobalObject } from '@sentry/utils';\n\nimport * as BrowserIntegrations from './integrations';\nimport * as Transports from './transports';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nconst _window = getGlobalObject();\nif (_window.Sentry && _window.Sentry.Integrations) {\n windowIntegrations = _window.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n ...windowIntegrations,\n ...CoreIntegrations,\n ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations, Transports };\n","// TODO: Remove in the next major release and rely only on @sentry/core SDK_VERSION and SdkInfo metadata\nexport const SDK_NAME = 'sentry.javascript.browser';\n","import { getCurrentHub } from '@sentry/hub';\nimport { Client, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind(clientClass: ClientClass, options: O): void {\n if (options.debug === true) {\n logger.enable();\n }\n const hub = getCurrentHub();\n const client = new clientClass(options);\n hub.bindClient(client);\n}\n"],"names":["LogLevel","SessionStatus","Severity","Status","TransactionSamplingMethod","isError","wat","Object","prototype","toString","call","isInstanceOf","Error","isErrorEvent","isDOMError","isString","isPrimitive","isPlainObject","isEvent","Event","isElement","Element","isThenable","Boolean","then","base","_e","htmlTreeAsString","elem","currentElem","out","height","len","sepLength","length","nextStr","_htmlElementAsString","push","parentNode","reverse","join","_oO","el","className","classes","key","attr","i","tagName","toLowerCase","id","split","allowedAttrs","getAttribute","level","Debug","Info","Warning","Fatal","Critical","Log","code","Success","RateLimit","Invalid","Failed","Unknown","setPrototypeOf","__proto__","Array","obj","proto","prop","hasOwnProperty","message","_super","_this","name","_newTarget","constructor","__extends","DSN_REGEX","from","this","_fromString","_fromComponents","_validate","Dsn","withPassword","_a","host","path","pass","port","projectId","str","match","exec","SentryError","protocol","publicKey","_b","_c","slice","pop","projectMatch","components","user","forEach","component","ERROR_MESSAGE","isNaN","parseInt","isNodeEnv","process","truncate","max","substr","safeJoin","input","delimiter","isArray","output","value","String","e","isMatchingPattern","pattern","test","indexOf","fallbackGlobalObject","getGlobalObject","global","window","self","uuid4","crypto","msCrypto","getRandomValues","arr","Uint16Array","pad","num","v","replace","c","r","Math","random","parseUrl","url","query","fragment","relative","getEventDescription","event","exception","values","type","event_id","consoleSandbox","callback","originalConsole","console","wrappedLevels","__sentry_original__","result","keys","addExceptionTypeValue","addExceptionMechanism","mechanism","defaultRetryAfter","PREFIX","_enabled","Logger","_i","args","log","warn","error","__SENTRY__","logger","_hasWeakSet","WeakSet","_inner","Memo","has","add","delete","splice","defaultFunctionName","getFunctionName","fn","fill","source","replacementFactory","original","wrapped","defineProperties","enumerable","_Oo","getWalkSource","err","stack","event_1","target","currentTarget","CustomEvent","detail","jsonSize","encodeURI","utf8Length","JSON","stringify","normalizeToSize","object","depth","maxSize","serialized","normalize","normalizeValue","_events","document","walk","memo","Infinity","normalized","serializeValue","toJSON","acc","memoize","innerKey","unmemoize","parse","extractExceptionKeysForMessage","maxLength","sort","includedKeys","dropUndefinedKeys","val","rv","__values","map","supportsFetch","Headers","Request","Response","isNativeFetch","func","supportsReferrerPolicy","referrerPolicy","lastHref","handlers","instrumented","instrument","originalConsoleLevel","triggerHandlers","Function","apply","instrumentConsole","triggerDOMHandler","bind","globalDOMEventHandler","makeDOMEventHandler","addEventListener","originalAddEventListener","listener","options","handlers_1","__sentry_instrumentation_handlers__","handlerForType","refCount","handler","originalRemoveEventListener","handlers_2","undefined","instrumentDOM","requestKeys","requestValues","xhrproto","XMLHttpRequest","originalOpen","xhr","__sentry_xhr__","method","toUpperCase","__sentry_own_request__","onreadystatechangeHandler","readyState","status_code","status","requestPos","args_1","body","endTimestamp","Date","now","startTimestamp","onreadystatechange","readyStateArgs","originalSend","instrumentXHR","fetch","doc","createElement","sandbox","hidden","head","appendChild","contentWindow","removeChild","supportsNativeFetch","originalFetch","handlerData","fetchData","getFetchMethod","getFetchUrl","response","instrumentFetch","chrome","isChromePackagedApp","app","runtime","hasHistoryApi","history","pushState","replaceState","oldOnPopState","onpopstate","historyReplacementFunction","originalHistoryFunction","to","location","href","instrumentHistory","_oldOnErrorHandler","onerror","msg","line","column","arguments","_oldOnUnhandledRejectionHandler","onunhandledrejection","addInstrumentationHandler","data","fetchArgs","debounceTimerID","lastCapturedEvent","debounceDuration","globalListener","isContentEditable","shouldSkipDOMEvent","previous","current","shouldShortcircuitPreviousDebounce","clearTimeout","setTimeout","States","executor","PENDING","_setResult","RESOLVED","reason","REJECTED","state","_state","_resolve","_reject","_value","_executeHandlers","_handlers","concat","cachedHandlers","done","onfulfilled","onrejected","SyncPromise","resolve","_","reject","collection","counter","resolvedCollection","item","index","TypeError","_attachHandler","onfinally","isRejected","_limit","PromiseBuffer","task","isReady","_buffer","remove","timeout","capturedSetTimeout","all","dateTimestampSource","nowSeconds","platformPerformance","mod","module","request","require","performance","getNodePerformance","timeOrigin","getBrowserPerformance","timestampSource","dateTimestampInSeconds","performanceNow","dateNow","timeOriginDelta","abs","timeOriginIsReliable","navigationStart","timing","navigationStartDelta","Scope","scope","newScope","_breadcrumbs","_tags","_extra","_contexts","_user","_level","_span","_session","_transactionName","_fingerprint","_eventProcessors","_scopeListeners","update","_notifyScopeListeners","tags","extras","extra","fingerprint","setTransactionName","context","span","getSpan","transaction","spanRecorder","spans","session","captureContext","updatedScope","contexts","breadcrumb","maxBreadcrumbs","mergedBreadcrumb","timestamp","__spread","hint","trace","getTraceContext","transactionName","_applyFingerprint","breadcrumbs","_notifyEventProcessors","getGlobalEventProcessors","processors","processor","final","_notifyingListeners","globalEventProcessors","addGlobalEventProcessor","Ok","Session","ip_address","ipAddress","did","email","username","sid","init","started","duration","release","environment","userAgent","errors","Exited","toISOString","attrs","user_agent","API_VERSION","client","_version","getStackTop","bindClient","Hub","version","setupIntegrations","clone","getScope","getStack","getClient","pushScope","popScope","_stack","eventId","_lastEventId","finalHint","syntheticException","originalException","_invokeClient","beforeBreadcrumb","_d","finalBreadcrumb","addBreadcrumb","min","setUser","setTags","setExtras","setTag","setExtra","setContext","oldHub","makeMain","integration","getIntegration","_callExtensionMethod","customSamplingContext","endSession","_sendSessionUpdate","getSession","close","setSession","getUser","currentSession","captureSession","sentry","getMainCarrier","extensions","carrier","hub","registry","getHubFromCarrier","setHubOnCarrier","getCurrentHub","hasHubOnCarrier","isOlderThan","activeDomain","domain","active","registryHubTopStack","getHubFromActiveDomain","callOnHub","captureException","withScope","dsn","metadata","_dsnObject","API","_getIngestEndpoint","getStoreEndpoint","_encodedAuth","_getEnvelopeEndpoint","clientName","clientVersion","header","Content-Type","X-Sentry-Auth","dialogOptions","endpoint","getBaseApiEndpoint","encodedOptions","encodeURIComponent","auth","sentry_key","sentry_version","installedIntegrations","integrations","defaultIntegrations","userIntegrations","userIntegrationsNames_1","pickedIntegrationsNames_1","defaultIntegration","userIntegration","integrationsNames","getIntegrationsToSetup","setupOnce","setupIntegration","backendClass","_backend","_options","_dsn","BaseClient","_process","_getBackend","eventFromException","_captureEvent","promisedEvent","eventFromMessage","_sendSession","_isClientProcessing","ready","getTransport","transportFlushed","flush","getOptions","enabled","_isEnabled","_integrations","crashed","errored","exceptions","exceptions_1","handled","headers","Crashed","Number","sendSession","ticked","interval","setInterval","_processing","clearInterval","normalizeDepth","prepared","_applyClientOptions","_applyIntegrationsMetadata","finalScope","applyToEvent","evt","_normalizeEvent","b","dist","maxValueLength","sdkInfo","sdk","integrationsArray","sendEvent","_processEvent","finalEvent","beforeSend","sampleRate","isTransaction","_prepareEvent","__sentry__","beforeSendResult","processedEvent","_updateSessionFromEvent","_sendEvent","promise","NoopTransport","Skipped","_transport","_setupTransport","BaseBackend","_exception","_hint","_message","getSdkMetadataForEnvelopeHeader","api","enhanceEventWithSdkInfo","packages","sessionToSentryRequest","sent_at","getEnvelopeEndpointWithUrlEncodedAuth","eventToSentryRequest","eventType","useEnvelope","transactionSampling","samplingMethod","debug_meta","req","getStoreEndpointWithUrlEncodedAuth","envelope","sample_rates","rate","originalFunctionToString","SDK_VERSION","FunctionToString","DEFAULT_IGNORE_ERRORS","InboundFilters","clientOptions","_mergeOptions","_shouldDropEvent","_isSentryError","_isIgnoredError","_isDeniedUrl","_getEventFilterUrl","_isAllowedUrl","ignoreInternal","ignoreErrors","_getPossibleEventMessages","some","denyUrls","allowUrls","whitelistUrls","blacklistUrls","oO","stacktrace","frames_1","frames","filename","frames_2","UNKNOWN_FUNCTION","gecko","winjs","geckoEval","chromeEval","reactMinifiedRegexp","computeStackTrace","ex","popSize","framesToPop","parts","opera10Regex","opera11Regex","lines","element","extractMessage","computeStackTraceFromStacktraceProp","popFrames","submatch","isNative","isSafariExtension","isSafariWebExtension","columnNumber","computeStackTraceFromStackProp","failed","STACKTRACE_LIMIT","exceptionFromStacktrace","prepareFramesForEvent","eventFromStacktrace","localStack","firstFrameFunction","lastFrameFunction","frame","colno","function","in_app","lineno","eventFromUnknownInput","attachStacktrace","eventFromString","domException","name_1","DOMException.code","rejection","__serialized__","eventFromPlainObject","synthetic","CATEGORY_MAPPING","_api","_metadata","BaseTransport","drain","requestType","fromHttpCode","_handleRateLimit","_disabledUntil","category","_rateLimits","rlHeader","raHeader","trim","parameters","headerDelay","delay","headerDate","parseRetryAfterHeader","fetchImpl","getNativeFetchImplementation","_fetch","FetchTransport","_sendRequest","sentryRequest","originalPayload","_isRateLimited","Promise","fetchParameters","assign","x-sentry-rate-limits","get","retry-after","_handleResponse","catch","XHRTransport","getResponseHeader","open","setRequestHeader","send","BrowserBackend","transportOptions","Ct","transport","ignoreOnError","shouldIgnoreOnError","wrap","before","__sentry_wrapped__","sentryWrapped","wrappedArguments","arg","handleEvent","addEventProcessor","property","defineProperty","getOwnPropertyDescriptor","configurable","injectReportDialog","script","async","src","getReportDialogEndpoint","onLoad","onload","GlobalHandlers","stackTraceLimit","_installGlobalOnErrorHandler","_installGlobalOnUnhandledRejectionHandler","_onErrorHandlerInstalled","currentHub","hasIntegration","isFailedOwnDelivery","_eventFromIncompleteOnError","_enhanceEventWithInitialFrame","captureEvent","_onUnhandledRejectionHandlerInstalled","_eventFromRejectionWithPrimitive","groups","getLocationHref","DEFAULT_EVENT_TARGET","TryCatch","eventTarget","requestAnimationFrame","_wrapTimeFunction","_wrapRAF","_wrapXHR","_wrapEventTarget","originalCallback","eventName","wrappedEventHandler","originalEventHandler","wrapOptions","Breadcrumbs","dom","_consoleBreadcrumb","_domBreadcrumb","_xhrBreadcrumb","_fetchBreadcrumb","_historyBreadcrumb","fromString","parsedLoc","parsedFrom","parsedTo","DEFAULT_KEY","DEFAULT_LIMIT","LinkedErrors","_key","limit","_handler","linkedErrors","_walkErrorTree","UserAgent","navigator","referrer","Referer","User-Agent","BrowserClient","getDsn","platform","addSentryBreadcrumb","CoreIntegrations.InboundFilters","CoreIntegrations.FunctionToString","windowIntegrations","_window","Sentry","Integrations","INTEGRATIONS","CoreIntegrations","BrowserIntegrations","window_1","SENTRY_RELEASE","autoSessionTracking","clientClass","debug","enable","initAndBind","startSession","startSessionTracking","lastEventId","showReportDialog","internalWrap"],"mappings":";gVACYA,ECoDAC,ECnDAC,ECAAC,EC2GAC,qvBClGIC,EAAQC,GACtB,OAAQC,OAAOC,UAAUC,SAASC,KAAKJ,IACrC,IAAK,iBAEL,IAAK,qBAEL,IAAK,wBACH,OAAO,EACT,QACE,OAAOK,EAAaL,EAAKM,iBAWfC,EAAaP,GAC3B,MAA+C,wBAAxCC,OAAOC,UAAUC,SAASC,KAAKJ,Y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y,EAAS5uB,IAEX4uB,EAAOC,gBAAkBD,EAAOC,eAAe9zB,KACjDyN,EAAQsN,QAAU8Y,EAAOC,eAAe9zB,SAGRiO,IAAhCR,EAAQsmB,sBACVtmB,EAAQsmB,qBAAsB,YGzE+BC,EAAgCvmB,IACzE,IAAlBA,EAAQwmB,OACV9rB,EAAO+rB,SAET,IAAMzV,EAAMI,KACNrD,EAAS,IAAIwY,EAAYvmB,GAC/BgR,EAAI9C,WAAWH,GHsEf2Y,CAAYnB,GAAevlB,GAEvBA,EAAQsmB,qBAwFd,WAIE,QAAwB,IAHT9uB,IACS2F,SAExB,CAKA,IAAM6T,EAAMI,KAER,iBAAkBJ,IAOpBA,EAAI2V,eACJ3V,EAAIL,iBAGJ/L,GAA0B,CACxBtL,SAAU,WACR0X,EAAI2V,eACJ3V,EAAIL,kBAENxX,KAAM,kBAtBRuB,EAAOH,KAAK,sFA5FZqsB,qDAyBF,OAAOxV,KAAgByV,+CAeFvtB,GACrBA,2BxBpByBpF,EAAc4W,GACvC8G,GAAgB,aAAc1d,EAAM4W,wBAwBb5Y,EAAayY,GACpCiH,GAAgB,WAAY1f,EAAKyY,yBAlBTD,GACxBkH,GAAgB,YAAalH,sBA4BRxY,EAAa8E,GAClC4a,GAAgB,SAAU1f,EAAK8E,uBAtBTyT,GACtBmH,GAAgB,UAAWnH,uBA6BLzU,GACtB4b,GAAgB,UAAW5b,gCwB3DIgK,gBAAAA,MAC1BA,EAAQ6O,UACX7O,EAAQ6O,QAAUuC,KAAgByV,eAEpC,IAAM9Y,EAASqD,KAAgB3C,YAC3BV,GACFA,EAAO+Y,iBAAiB9mB,gCxB0G1B8K,EACAqF,GAEA,OAAOyB,GAAU,wBAAyB9G,GAAWqF,mCwB5ClC9U,GACnB,OAAO0rB,GAAa1rB,EAAb0rB"} \ No newline at end of file diff --git a/apollo/pwa/static/vendor/sentry/bundle.tracing.min.js b/apollo/pwa/static/vendor/sentry/bundle.tracing.min.js new file mode 100644 index 000000000..569a9b5e6 --- /dev/null +++ b/apollo/pwa/static/vendor/sentry/bundle.tracing.min.js @@ -0,0 +1,3 @@ +/*! @sentry/browser (Performance Monitoring) 8.35.0 (4e33b54) | https://github.com/getsentry/sentry-javascript */ +var Sentry=function(t){t=window.Sentry||{};const n=Object.prototype.toString;function e(t){switch(n.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return l(t,Error)}}function r(t,e){return n.call(t)===`[object ${e}]`}function o(t){return r(t,"ErrorEvent")}function i(t){return r(t,"DOMError")}function s(t){return r(t,"String")}function c(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function u(t){return null===t||c(t)||"object"!=typeof t&&"function"!=typeof t}function a(t){return r(t,"Object")}function f(t){return"undefined"!=typeof Event&&l(t,Event)}function d(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function l(t,n){try{return t instanceof n}catch(t){return!1}}function h(t){return!("object"!=typeof t||null===t||!t.__isVue&&!t.t)}function p(t,n=0){return"string"!=typeof t||0===n||t.length<=n?t:`${t.slice(0,n)}...`}function m(t,n){if(!Array.isArray(t))return"";const e=[];for(let n=0;ng(t,n,e)))}function v(t,n,e=250,r,o,i,s){if(!(i.exception&&i.exception.values&&s&&l(s.originalException,Error)))return;const c=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var u,a;c&&(i.exception.values=(u=b(t,n,o,s.originalException,r,i.exception.values,c,0),a=e,u.map((t=>(t.value&&(t.value=p(t.value,a)),t)))))}function b(t,n,e,r,o,i,s,c){if(i.length>=e+1)return i;let u=[...i];if(l(r[o],Error)){_(s,c);const i=t(n,r[o]),a=u.length;w(i,o,a,c),u=b(t,n,e,r[o],o,[i,...u],i,a)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(l(r,Error)){_(s,c);const a=t(n,r),f=u.length;w(a,`errors[${i}]`,f,c),u=b(t,n,e,r,o,[a,...u],a,f)}})),u}function _(t,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,..."AggregateError"===t.type&&{is_exception_group:!0},exception_id:n}}function w(t,n,e,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:n,exception_id:e,parent_id:r}}function S(t){return void 0===t?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const E="8.35.0",$=globalThis;function T(t,n,e){const r=e||$,o=r.__SENTRY__=r.__SENTRY__||{},i=o[E]=o[E]||{};return i[t]||(i[t]=n())}const k=$,I=80;function x(t,n={}){if(!t)return"";try{let e=t;const r=5,o=[];let i=0,s=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,d=!Array.isArray(n)&&n.maxStringLength||I;for(;e&&i++1&&s+o.length*u+a.length>=d));)o.push(a),s+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return""}}function A(t,n){const e=t,r=[];if(!e||!e.tagName)return"";if(k.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const o=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(o&&o.length)o.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{e.id&&r.push(`#${e.id}`);const t=e.className;if(t&&s(t)){const n=t.split(/\s+/);for(const t of n)r.push(`.${t}`)}}const i=["aria-label","type","name","title","alt"];for(const t of i){const n=e.getAttribute(t);n&&r.push(`[${t}="${n}"]`)}return r.join("")}function j(t){if(!k.HTMLElement)return null;let n=t;for(let t=0;t<5;t++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}const C=["debug","info","warn","error","log","assert","trace"],O={};function M(t){if(!("console"in $))return t();const n=$.console,e={},r=Object.keys(O);r.forEach((t=>{const r=O[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const R=T("logger",(function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return C.forEach((t=>{n[t]=()=>{}})),n})),P=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function L(t,n=!1){const{host:e,path:r,pass:o,port:i,projectId:s,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function N(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function D(t){const n="string"==typeof t?function(t){const n=P.exec(t);if(!n)return void M((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[e,r,o="",i="",s="",c=""]=n.slice(1);let u="",a=c;const f=a.split("/");if(f.length>1&&(u=f.slice(0,-1).join("/"),a=f.pop()),a){const t=a.match(/^\d+/);t&&(a=t[0])}return N({host:i,pass:o,path:u,projectId:a,port:s,protocol:e,publicKey:r})}(t):N(t);if(n)return n}class F extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function q(t,n,e){if(!(n in t))return;const r=t[n],o=e(r);"function"==typeof o&&H(o,r),t[n]=o}function U(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(t){}}function H(t,n){try{const e=n.prototype||{};t.prototype=n.prototype=e,U(t,"__sentry_original__",n)}catch(t){}}function B(t){return t.__sentry_original__}function W(t){if(e(t))return{message:t.message,name:t.name,stack:t.stack,...X(t)};if(f(t)){const n={type:t.type,target:z(t.target),currentTarget:z(t.currentTarget),...X(t)};return"undefined"!=typeof CustomEvent&&l(t,CustomEvent)&&(n.detail=t.detail),n}return t}function z(t){try{return n=t,"undefined"!=typeof Element&&l(n,Element)?x(t):Object.prototype.toString.call(t)}catch(t){return""}var n}function X(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function G(t){return J(t,new Map)}function J(t,n){if(function(t){if(!a(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.getOwnPropertyNames(t))void 0!==t[e]&&(r[e]=J(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(J(t,n))})),r}return t}const Y=50,K="?",V=/\(error: (.*)\)/,Q=/captureMessage|captureException/;function Z(...t){const n=t.sort(((t,n)=>t[0]-n[0])).map((t=>t[1]));return(t,e=0,r=0)=>{const o=[],i=t.split("\n");for(let t=e;t1024)continue;const s=V.test(e)?e.replace(V,"$1"):e;if(!s.match(/\S*Error: /)){for(const t of n){const n=t(s);if(n){o.push(n);break}}if(o.length>=Y+r)break}}return function(t){if(!t.length)return[];const n=Array.from(t);/sentryWrapped/.test(tt(n).function||"")&&n.pop();n.reverse(),Q.test(tt(n).function||"")&&(n.pop(),Q.test(tt(n).function||"")&&n.pop());return n.slice(0,Y).map((t=>({...t,filename:t.filename||tt(n).filename,function:t.function||K})))}(o.slice(r))}}function tt(t){return t[t.length-1]||{}}const nt="";function et(t){try{return t&&"function"==typeof t&&t.name||nt}catch(t){return nt}}function rt(t){const n=t.exception;if(n){const t=[];try{return n.values.forEach((n=>{n.stacktrace.frames&&t.push(...n.stacktrace.frames)})),t}catch(t){return}}}const ot={},it={};function st(t,n){ot[t]=ot[t]||[],ot[t].push(n)}function ct(t,n){it[t]||(n(),it[t]=!0)}function ut(t,n){const e=t&&ot[t];if(e)for(const t of e)try{t(n)}catch(t){}}function at(){"console"in $&&C.forEach((function(t){t in $.console&&q($.console,t,(function(n){return O[t]=n,function(...n){ut("console",{args:n,level:t});const e=O[t];e&&e.apply($.console,n)}}))}))}const ft=$;function dt(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function lt(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in ft))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}())return!1;if(dt(ft.fetch))return!0;let t=!1;const n=ft.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(t=dt(e.contentWindow.fetch)),n.head.removeChild(e)}catch(t){}return t}const ht=1e3;function pt(){return Date.now()/ht}const mt=function(){const{performance:t}=$;if(!t||!t.now)return pt;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/ht}(),gt=(()=>{const{performance:t}=$;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,i=ovt(void 0,n)))}function vt(t,n=!1){n&&!lt()||q($,"fetch",(function(n){return function(...r){const{method:o,url:i}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[n,e]=t;return{url:wt(n),method:_t(e,"method")?String(e.method).toUpperCase():"GET"}}const n=t[0];return{url:wt(n),method:_t(n,"method")?String(n.method).toUpperCase():"GET"}}(r),s={args:r,fetchData:{method:o,url:i},startTimestamp:1e3*mt()};t||ut("fetch",{...s});const c=(new Error).stack;return n.apply($,r).then((async n=>(t?t(n):ut("fetch",{...s,endTimestamp:1e3*mt(),response:n}),n)),(t=>{throw ut("fetch",{...s,endTimestamp:1e3*mt(),error:t}),e(t)&&void 0===t.stack&&(t.stack=c,U(t,"framesToPop",1)),t}))}}))}function bt(t){let n;try{n=t.clone()}catch(t){return}!async function(t,n){if(t&&t.body){const e=t.body,r=e.getReader(),o=setTimeout((()=>{e.cancel().then(null,(()=>{}))}),9e4);let i=!0;for(;i;){let t;try{t=setTimeout((()=>{e.cancel().then(null,(()=>{}))}),5e3);const{done:o}=await r.read();clearTimeout(t),o&&(n(),i=!1)}catch(t){i=!1}finally{clearTimeout(t)}}clearTimeout(o),r.releaseLock(),e.cancel().then(null,(()=>{}))}}(n,(()=>{ut("fetch-body-resolved",{endTimestamp:1e3*mt(),response:t})}))}function _t(t,n){return!!t&&"object"==typeof t&&!!t[n]}function wt(t){return"string"==typeof t?t:t?_t(t,"url")?t.url:t.toString?t.toString():"":""}let St=null;function Et(t){const n="error";st(n,t),ct(n,$t)}function $t(){St=$.onerror,$.onerror=function(t,n,e,r,o){return ut("error",{column:r,error:o,line:e,msg:t,url:n}),!(!St||St.__SENTRY_LOADER__)&&St.apply(this,arguments)},$.onerror.__SENTRY_INSTRUMENTED__=!0}let Tt=null;function kt(t){const n="unhandledrejection";st(n,t),ct(n,It)}function It(){Tt=$.onunhandledrejection,$.onunhandledrejection=function(t){return ut("unhandledrejection",t),!(Tt&&!Tt.__SENTRY_LOADER__)||Tt.apply(this,arguments)},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function xt(){const t=$,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function At(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function jt(t){const{message:n,event_id:e}=t;if(n)return n;const r=At(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||e||"":e||""}function Ct(t,n,e){const r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=n||""),i.type||(i.type=e||"Error")}function Ot(t,n){const e=At(t);if(!e)return;const r=e.mechanism;if(e.mechanism={type:"generic",handled:!0,...r,...n},n&&"data"in n){const t={...r&&r.data,...n.data};e.mechanism.data=t}}function Mt(t){if(t&&t.__sentry_captured__)return!0;try{U(t,"__sentry_captured__",!0)}catch(t){}return!1}function Rt(t){return Array.isArray(t)?t:[t]}function Pt(t,n=100,e=1/0){try{return Nt("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function Lt(t,n=3,e=102400){const r=Pt(t,n);return o=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(o))>e?Lt(t,n-1,e):r;var o}function Nt(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t=r){d[t]="[MaxProperties ~]";break}const n=p[t];d[t]=Nt(t,n,u-1,r,o),l++}return s(n),d}var Dt;function Ft(t){return new Ut((n=>{n(t)}))}function qt(t){return new Ut(((n,e)=>{e(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(Dt||(Dt={}));class Ut{constructor(t){Ut.prototype.__init.call(this),Ut.prototype.__init2.call(this),Ut.prototype.__init3.call(this),Ut.prototype.__init4.call(this),this.i=Dt.PENDING,this.u=[];try{t(this.l,this.h)}catch(t){this.h(t)}}then(t,n){return new Ut(((e,r)=>{this.u.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.p()}))}catch(t){return this.then((t=>t),t)}finally(t){return new Ut(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.l=t=>{this.m(Dt.RESOLVED,t)}}__init2(){this.h=t=>{this.m(Dt.REJECTED,t)}}__init3(){this.m=(t,n)=>{this.i===Dt.PENDING&&(d(n)?n.then(this.l,this.h):(this.i=t,this.v=n,this.p()))}}__init4(){this.p=()=>{if(this.i===Dt.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.i===Dt.RESOLVED&&t[1](this.v),this.i===Dt.REJECTED&&t[2](this.v),t[0]=!0)}))}}}function Ht(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]||Promise.resolve(void 0)}return{$:n,add:function(r){if(!(void 0===t||n.lengthe(o))).then(null,(()=>e(o).then(null,(()=>{})))),o},drain:function(t){return new Ut(((e,r)=>{let o=n.length;if(!o)return e(!0);const i=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{Ft(t).then((()=>{--o||(clearTimeout(i),e(!0))}),r)}))}))}}}function Bt(t){if(!t)return{};const n=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!n)return{};const e=n[6]||"",r=n[8]||"";return{host:n[4],path:n[5],protocol:n[2],search:e,hash:r,relative:n[5]+e+r}}const Wt=["fatal","error","warning","log","info","debug"];function zt(t){return"warn"===t?"warning":Wt.includes(t)?t:"log"}const Xt="baggage",Gt="sentry-",Jt=/^sentry-/,Yt=8192;function Kt(t){const n=function(t){if(!t||!s(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,n)=>{const e=Qt(n);return Object.entries(e).forEach((([n,e])=>{t[n]=e})),t}),{});return Qt(t)}(t);if(!n)return;const e=Object.entries(n).reduce(((t,[n,e])=>{if(n.match(Jt)){t[n.slice(Gt.length)]=e}return t}),{});return Object.keys(e).length>0?e:void 0}function Vt(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce(((t,[n,e],r)=>{const o=`${encodeURIComponent(n)}=${encodeURIComponent(e)}`,i=0===r?o:`${t},${o}`;return i.length>Yt?t:i}),"")}(Object.entries(t).reduce(((t,[n,e])=>(e&&(t[`${Gt}${n}`]=e),t)),{}))}function Qt(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[n,e])=>(n&&e&&(t[n]=e),t)),{})}const Zt=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function tn(t,n){const e=function(t){if(!t)return;const n=t.match(Zt);if(!n)return;let e;return"1"===n[3]?e=!0:"0"===n[3]&&(e=!1),{traceId:n[1],parentSampled:e,parentSpanId:n[2]}}(t),r=Kt(n),{traceId:o,parentSpanId:i,parentSampled:s}=e||{};return e?{traceId:o||xt(),parentSpanId:i||xt().substring(16),spanId:xt().substring(16),sampled:s,dsc:r||{}}:{traceId:o||xt(),spanId:xt().substring(16)}}function nn(t=xt(),n=xt().substring(16),e){let r="";return void 0!==e&&(r=e?"-1":"-0"),`${t}-${n}${r}`}function en(t,n=[]){return[t,n]}function rn(t,n){const[e,r]=t;return[e,[...r,n]]}function on(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function sn(t){return $.__SENTRY__&&$.__SENTRY__.encodePolyfill?$.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function cn(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[sn(r),t]:r.push("string"==typeof t?sn(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(Pt(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}function un(t){return[{type:"span"},t]}function an(t){const n="string"==typeof t.data?sn(t.data):t.data;return[G({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const fn={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function dn(t){return fn[t]}function ln(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}const hn=6e4;function pn(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},i=e&&e["x-sentry-rate-limits"],s=e&&e["retry-after"];if(i)for(const t of i.trim().split(",")){const[n,e,,,i]=t.split(":",5),s=parseInt(n,10),c=1e3*(isNaN(s)?60:s);if(e)for(const t of e.split(";"))"metric_bucket"===t&&i&&!i.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else s?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?hn:r-n}(s,r):429===n&&(o.all=r+6e4);return o}function mn(t){let n,e=t[0],r=1;for(;re.call(n,...t))),n=void 0)}return e}function gn(){return{traceId:xt(),spanId:xt().substring(16)}}const yn=$;const vn=()=>{},bn=["attachTo","createForm","createWidget","remove"],_n=Object.assign((t=>(M((()=>{console.warn("You are using feedbackIntegration() even though this bundle does not include feedback.")})),{name:"Feedback",...bn.reduce(((t,n)=>(t[n]=vn,t)),{})})),{_isShim:!0}),wn=["start","stop","flush"];function Sn(){return En($),$}function En(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||E,n[E]=n[E]||{}}function $n(t){const n=mt(),e={sid:xt(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return G({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}})}(e)};return t&&Tn(e,t),e}function Tn(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||mt(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:xt()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}const kn="_sentrySpan";function In(t,n){n?U(t,kn,n):delete t[kn]}function xn(t){return t[kn]}class An{constructor(){this._=!1,this.S=[],this.T=[],this.k=[],this.I=[],this.A={},this.j={},this.C={},this.O={},this.M={},this.R=gn()}clone(){const t=new An;return t.k=[...this.k],t.j={...this.j},t.C={...this.C},t.O={...this.O},t.A=this.A,t.P=this.P,t.L=this.L,t.N=this.N,t.D=this.D,t.T=[...this.T],t.F=this.F,t.I=[...this.I],t.M={...this.M},t.R={...this.R},t.q=this.q,t.U=this.U,In(t,xn(this)),t}setClient(t){this.q=t}setLastEventId(t){this.U=t}getClient(){return this.q}lastEventId(){return this.U}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.T.push(t),this}setUser(t){return this.A=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.L&&Tn(this.L,{user:t}),this.H(),this}getUser(){return this.A}getRequestSession(){return this.F}setRequestSession(t){return this.F=t,this}setTags(t){return this.j={...this.j,...t},this.H(),this}setTag(t,n){return this.j={...this.j,[t]:n},this.H(),this}setExtras(t){return this.C={...this.C,...t},this.H(),this}setExtra(t,n){return this.C={...this.C,[t]:n},this.H(),this}setFingerprint(t){return this.D=t,this.H(),this}setLevel(t){return this.P=t,this.H(),this}setTransactionName(t){return this.N=t,this.H(),this}setContext(t,n){return null===n?delete this.O[t]:this.O[t]=n,this.H(),this}setSession(t){return t?this.L=t:delete this.L,this.H(),this}getSession(){return this.L}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof jn?[n.getScopeData(),n.getRequestSession()]:a(n)?[t,t.requestSession]:[],{tags:o,extra:i,user:s,contexts:c,level:u,fingerprint:f=[],propagationContext:d}=e||{};return this.j={...this.j,...o},this.C={...this.C,...i},this.O={...this.O,...c},s&&Object.keys(s).length&&(this.A=s),u&&(this.P=u),f.length&&(this.D=f),d&&(this.R=d),r&&(this.F=r),this}clear(){return this.k=[],this.j={},this.C={},this.A={},this.O={},this.P=void 0,this.N=void 0,this.D=void 0,this.F=void 0,this.L=void 0,In(this,void 0),this.I=[],this.R=gn(),this.H(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:pt(),...t},o=this.k;return o.push(r),this.k=o.length>e?o.slice(-e):o,this.H(),this}getLastBreadcrumb(){return this.k[this.k.length-1]}clearBreadcrumbs(){return this.k=[],this.H(),this}addAttachment(t){return this.I.push(t),this}clearAttachments(){return this.I=[],this}getScopeData(){return{breadcrumbs:this.k,attachments:this.I,contexts:this.O,tags:this.j,extra:this.C,user:this.A,level:this.P,fingerprint:this.D||[],eventProcessors:this.T,propagationContext:this.R,sdkProcessingMetadata:this.M,transactionName:this.N,span:xn(this)}}setSDKProcessingMetadata(t){return this.M={...this.M,...t},this}setPropagationContext(t){return this.R=t,this}getPropagationContext(){return this.R}captureException(t,n){const e=n&&n.event_id?n.event_id:xt();if(!this.q)return R.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.q.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:xt();if(!this.q)return R.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.q.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:xt();return this.q?(this.q.captureEvent(t,{...n,event_id:e},this),e):(R.warn("No client configured on scope - will not capture event!"),e)}H(){this._||(this._=!0,this.S.forEach((t=>{t(this)})),this._=!1)}}const jn=An;class Cn{constructor(t,n){let e,r;e=t||new jn,r=n||new jn,this.B=[{scope:e}],this.W=r}withScope(t){const n=this.X();let e;try{e=t(n)}catch(t){throw this.G(),t}return d(e)?e.then((t=>(this.G(),t)),(t=>{throw this.G(),t})):(this.G(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.W}getStackTop(){return this.B[this.B.length-1]}X(){const t=this.getScope().clone();return this.B.push({client:this.getClient(),scope:t}),t}G(){return!(this.B.length<=1)&&!!this.B.pop()}}function On(){const t=En(Sn());return t.stack=t.stack||new Cn(T("defaultCurrentScope",(()=>new jn)),T("defaultIsolationScope",(()=>new jn)))}function Mn(t){return On().withScope(t)}function Rn(t,n){const e=On();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function Pn(t){return On().withScope((()=>t(On().getIsolationScope())))}function Ln(t){const n=En(t);return n.acs?n.acs:{withIsolationScope:Pn,withScope:Mn,withSetScope:Rn,withSetIsolationScope:(t,n)=>Pn(n),getCurrentScope:()=>On().getScope(),getIsolationScope:()=>On().getIsolationScope()}}function Nn(){return Ln(Sn()).getCurrentScope()}function Dn(){return Ln(Sn()).getIsolationScope()}function Fn(){return T("globalScope",(()=>new jn))}function qn(...t){const n=Ln(Sn());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}function Un(){return Nn().getClient()}const Hn="_sentryMetrics";function Bn(t){const n=t[Hn];if(!n)return;const e={};for(const[,[t,r]]of n){(e[t]||(e[t]=[])).push(G(r))}return e}const Wn="sentry.source",zn="sentry.sample_rate",Xn="sentry.op",Gn="sentry.origin",Jn="sentry.idle_span_finish_reason",Yn="sentry.measurement_unit",Kn="sentry.measurement_value",Vn="sentry.exclusive_time",Qn=0,Zn=1,te=2;function ne(t,n){t.setAttribute("http.response.status_code",n);const e=function(t){if(t<400&&t>=100)return{code:Zn};if(t>=400&&t<500)switch(t){case 401:return{code:te,message:"unauthenticated"};case 403:return{code:te,message:"permission_denied"};case 404:return{code:te,message:"not_found"};case 409:return{code:te,message:"already_exists"};case 413:return{code:te,message:"failed_precondition"};case 429:return{code:te,message:"resource_exhausted"};case 499:return{code:te,message:"cancelled"};default:return{code:te,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:te,message:"unimplemented"};case 503:return{code:te,message:"unavailable"};case 504:return{code:te,message:"deadline_exceeded"};default:return{code:te,message:"internal_error"}}return{code:te,message:"unknown_error"}}(n);"unknown_error"!==e.message&&t.setStatus(e)}const ee=1;function re(t){const{spanId:n,traceId:e}=t.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:c}=ue(t);return G({parent_span_id:i,span_id:n,trace_id:e,data:r,op:o,status:s,origin:c})}function oe(t){const{spanId:n,traceId:e}=t.spanContext(),{parent_span_id:r}=ue(t);return G({parent_span_id:r,span_id:n,trace_id:e})}function ie(t){const{traceId:n,spanId:e}=t.spanContext();return nn(n,e,ae(t))}function se(t){return"number"==typeof t?ce(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?ce(t.getTime()):mt()}function ce(t){return t>9999999999?t/1e3:t}function ue(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:i,endTime:s,parentSpanId:c,status:u}=t;return G({span_id:n,trace_id:e,data:r,description:i,parent_span_id:c,start_timestamp:se(o),timestamp:se(s)||void 0,status:fe(u),op:r[Xn],origin:r[Gn],_metrics_summary:Bn(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function ae(t){const{traceFlags:n}=t.spanContext();return n===ee}function fe(t){if(t&&t.code!==Qn)return t.code===Zn?"ok":t.message||"unknown_error"}const de="_sentryChildSpans",le="_sentryRootSpan";function he(t,n){const e=t[le]||t;U(n,le,e),t[de]?t[de].add(n):U(t,de,new Set([n]))}function pe(t){const n=new Set;return function t(e){if(!n.has(e)&&ae(e)){n.add(e);const r=e[de]?Array.from(e[de]):[];for(const n of r)t(n)}}(t),Array.from(n)}function me(t){return t[le]||t}function ge(){const t=Ln(Sn());return t.getActiveSpan?t.getActiveSpan():xn(Nn())}function ye(t,n,e,r,o,i){const s=ge();s&&function(t,n,e,r,o,i,s){const c=t[Hn]||(t[Hn]=new Map),u=`${n}:${e}@${o}`,a=c.get(s);if(a){const[,t]=a;c.set(s,[u,{min:Math.min(t.min,r),max:Math.max(t.max,r),count:t.count+=1,sum:t.sum+=r,tags:t.tags}])}else c.set(s,[u,{min:r,max:r,count:1,sum:r,tags:i}])}(s,t,n,e,r,o,i)}let ve=!1;function be(){ve||(ve=!0,Et(_e),kt(_e))}function _e(){const t=ge(),n=t&&me(t);if(n){const t="internal_error";n.setStatus({code:te,message:t})}}_e.tag="sentry_tracingErrorCallback";const we="_sentryScope",Se="_sentryIsolationScope";function Ee(t){return{scope:t[we],isolationScope:t[Se]}}function $e(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=Un(),e=t||n&&n.getOptions();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}class Te{constructor(t={}){this.J=t.traceId||xt(),this.Y=t.spanId||xt().substring(16)}spanContext(){return{spanId:this.Y,traceId:this.J,traceFlags:0}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,e){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function ke(t,n,e=(()=>{})){let r;try{r=t()}catch(t){throw n(t),e(),t}return function(t,n,e){if(d(t))return t.then((t=>(e(),t)),(t=>{throw n(t),e(),t}));return e(),t}(r,n,e)}const Ie="production",xe="_frozenDsc";function Ae(t,n){U(t,xe,n)}function je(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=G({environment:e.environment||Ie,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}function Ce(t){const n=Un();if(!n)return{};const e=je(ue(t).trace_id||"",n),r=me(t),o=r[xe];if(o)return o;const i=r.spanContext().traceState,s=i&&i.get("sentry.dsc"),c=s&&Kt(s);if(c)return c;const u=ue(r),a=u.data||{},f=a[zn];null!=f&&(e.sample_rate=`${f}`);const d=a[Wn],l=u.description;return"url"!==d&&l&&(e.transaction=l),$e()&&(e.sampled=String(ae(r))),n.emit("createDsc",e,r),e}function Oe(t){if("boolean"==typeof t)return Number(t);const n="string"==typeof t?parseFloat(t):t;return"number"!=typeof n||isNaN(n)||n<0||n>1?void 0:n}function Me(t,n,e,r){const o=ln(e),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const s=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:L(r)},...o&&{trace:G({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return en(s,[[{type:i},t]])}function Re(t,n,e,r=ge()){const o=r&&me(r);o&&o.addEvent(t,{[Kn]:n,[Yn]:e})}function Pe(t){if(!t||0===t.length)return;const n={};return t.forEach((t=>{const e=t.attributes||{},r=e[Yn],o=e[Kn];"string"==typeof r&&"number"==typeof o&&(n[t.name]={value:o,unit:r})})),n}class Le{constructor(t={}){this.J=t.traceId||xt(),this.Y=t.spanId||xt().substring(16),this.K=t.startTimestamp||mt(),this.V={},this.setAttributes({[Gn]:"manual",[Xn]:t.op,...t.attributes}),this.Z=t.name,t.parentSpanId&&(this.tt=t.parentSpanId),"sampled"in t&&(this.nt=t.sampled),t.endTimestamp&&(this.et=t.endTimestamp),this.o=[],this.rt=t.isStandalone,this.et&&this.ot()}addLink(t){return this}addLinks(t){return this}recordException(t,n){}spanContext(){const{Y:t,J:n,nt:e}=this;return{spanId:t,traceId:n,traceFlags:e?ee:0}}setAttribute(t,n){return void 0===n?delete this.V[t]:this.V[t]=n,this}setAttributes(t){return Object.keys(t).forEach((n=>this.setAttribute(n,t[n]))),this}updateStartTime(t){this.K=se(t)}setStatus(t){return this.it=t,this}updateName(t){return this.Z=t,this}end(t){this.et||(this.et=se(t),this.ot())}getSpanJSON(){return G({data:this.V,description:this.Z,op:this.V[Xn],parent_span_id:this.tt,span_id:this.Y,start_timestamp:this.K,status:fe(this.it),timestamp:this.et,trace_id:this.J,origin:this.V[Gn],_metrics_summary:Bn(this),profile_id:this.V["sentry.profile_id"],exclusive_time:this.V[Vn],measurements:Pe(this.o),is_segment:this.rt&&me(this)===this||void 0,segment_id:this.rt?me(this).spanContext().spanId:void 0})}isRecording(){return!this.et&&!!this.nt}addEvent(t,n,e){const r=Ne(n)?n:e||mt(),o=Ne(n)?{}:n||{},i={name:t,time:se(r),attributes:o};return this.o.push(i),this}isStandaloneSpan(){return!!this.rt}ot(){const t=Un();t&&t.emit("spanEnd",this);if(!(this.rt||this===me(this)))return;if(this.rt)return void(this.nt?function(t){const n=Un();if(!n)return;const e=t[1];if(!e||0===e.length)return void n.recordDroppedEvent("before_send","span");const r=n.getTransport();r&&r.send(t).then(null,(t=>{}))}(function(t,n){const e=Ce(t[0]),r=n&&n.getDsn(),o=n&&n.getOptions().tunnel,i={sent_at:(new Date).toISOString(),...function(t){return!!t.trace_id&&!!t.public_key}(e)&&{trace:e},...!!o&&r&&{dsn:L(r)}},s=n&&n.getOptions().beforeSendSpan,c=s?t=>s(ue(t)):t=>ue(t),u=[];for(const n of t){const t=c(n);t&&u.push(un(t))}return en(i,u)}([this],t)):t&&t.recordDroppedEvent("sample_rate","span"));const n=this.st();if(n){(Ee(this).scope||Nn()).captureEvent(n)}}st(){if(!De(ue(this)))return;this.Z||(this.Z="");const{scope:t,isolationScope:n}=Ee(this),e=(t||Nn()).getClient()||Un();if(!0!==this.nt)return void(e&&e.recordDroppedEvent("sample_rate","transaction"));const r=pe(this).filter((t=>t!==this&&!function(t){return t instanceof Le&&t.isStandaloneSpan()}(t))).map((t=>ue(t))).filter(De),o=this.V[Wn],i={contexts:{trace:re(this)},spans:r.length>1e3?r.sort(((t,n)=>t.start_timestamp-n.start_timestamp)).slice(0,1e3):r,start_timestamp:this.K,timestamp:this.et,transaction:this.Z,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,...G({dynamicSamplingContext:Ce(this)})},_metrics_summary:Bn(this),...o&&{transaction_info:{source:o}}},s=Pe(this.o);return s&&Object.keys(s).length&&(i.measurements=s),i}}function Ne(t){return t&&"number"==typeof t||t instanceof Date||Array.isArray(t)}function De(t){return!!(t.start_timestamp&&t.timestamp&&t.span_id&&t.trace_id)}const Fe="__SENTRY_SUPPRESS_TRACING__";function qe(t,n){const e=ze();if(e.startSpanManual)return e.startSpanManual(t,n);const r=We(t),{forceTransaction:o,parentSpan:i}=t;return qn(t.scope,(()=>Je(i)((()=>{const e=Nn(),i=Ge(e),s=t.onlyIfParent&&!i?new Te:Be({parentSpan:i,spanArguments:r,forceTransaction:o,scope:e});function c(){s.end()}return In(e,s),ke((()=>n(s,c)),(()=>{const{status:t}=ue(s);!s.isRecording()||t&&"ok"!==t||s.setStatus({code:te,message:"internal_error"})}))}))))}function Ue(t){const n=ze();if(n.startInactiveSpan)return n.startInactiveSpan(t);const e=We(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?n=>qn(t.scope,n):void 0!==o?t=>He(o,t):t=>t())((()=>{const n=Nn(),o=Ge(n);return t.onlyIfParent&&!o?new Te:Be({parentSpan:o,spanArguments:e,forceTransaction:r,scope:n})}))}function He(t,n){const e=ze();return e.withActiveSpan?e.withActiveSpan(t,n):qn((e=>(In(e,t||void 0),n(e))))}function Be({parentSpan:t,spanArguments:n,forceTransaction:e,scope:r}){if(!$e())return new Te;const o=Dn();let i;if(t&&!e)i=function(t,n,e){const{spanId:r,traceId:o}=t.spanContext(),i=!n.getScopeData().sdkProcessingMetadata[Fe]&&ae(t),s=i?new Le({...e,parentSpanId:r,traceId:o,sampled:i}):new Te({traceId:o});he(t,s);const c=Un();c&&(c.emit("spanStart",s),e.endTimestamp&&c.emit("spanEnd",s));return s}(t,r,n),he(t,i);else if(t){const e=Ce(t),{traceId:o,spanId:s}=t.spanContext(),c=ae(t);i=Xe({traceId:o,parentSpanId:s,...n},r,c),Ae(i,e)}else{const{traceId:t,dsc:e,parentSpanId:s,sampled:c}={...o.getPropagationContext(),...r.getPropagationContext()};i=Xe({traceId:t,parentSpanId:s,...n},r,c),e&&Ae(i,e)}return function(t,n,e){t&&(U(t,Se,e),U(t,we,n))}(i,r,o),i}function We(t){const n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){const e={...n};return e.startTimestamp=se(t.startTime),delete e.startTime,e}return n}function ze(){return Ln(Sn())}function Xe(t,n,e){const r=Un(),o=r&&r.getOptions()||{},{name:i="",attributes:s}=t,[c,u]=n.getScopeData().sdkProcessingMetadata[Fe]?[!1]:function(t,n){if(!$e(t))return[!1];let e;e="function"==typeof t.tracesSampler?t.tracesSampler(n):void 0!==n.parentSampled?n.parentSampled:void 0!==t.tracesSampleRate?t.tracesSampleRate:1;const r=Oe(e);return void 0===r?[!1]:r&&Math.random()He(t,n):t=>t()}const Ye={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Ke="heartbeatFailed",Ve="idleTimeout",Qe="finalTimeout",Ze="externalFinish";function tr(t,n={}){const e=new Map;let r,o=!1,i=Ze,s=!n.disableAutoFinish;const c=[],{idleTimeout:u=Ye.idleTimeout,finalTimeout:a=Ye.finalTimeout,childSpanTimeout:f=Ye.childSpanTimeout,beforeSpanEnd:d}=n,l=Un();if(!l||!$e())return new Te;const h=Nn(),p=ge(),m=function(t){const n=Ue(t);return In(Nn(),n),n}(t);function g(){r&&(clearTimeout(r),r=void 0)}function y(t){g(),r=setTimeout((()=>{!o&&0===e.size&&s&&(i=Ve,m.end(t))}),u)}function v(t){r=setTimeout((()=>{!o&&s&&(i=Ke,m.end(t))}),f)}function b(t){o=!0,e.clear(),c.forEach((t=>t())),In(h,p);const n=ue(m),{start_timestamp:r}=n;if(!r)return;(n.data||{})[Jn]||m.setAttribute(Jn,i),R.log(`[Tracing] Idle span "${n.op}" finished`);const s=pe(m).filter((t=>t!==m));let f=0;s.forEach((n=>{n.isRecording()&&(n.setStatus({code:te,message:"cancelled"}),n.end(t));const e=ue(n),{timestamp:r=0,start_timestamp:o=0}=e;r-o<=(a+u)/1e3&&o<=t||(!function(t,n){t[de]&&t[de].delete(n)}(m,n),f++)})),f>0&&m.setAttribute("sentry.idle_span_discarded_spans",f)}return m.end=new Proxy(m.end,{apply(t,n,e){d&&d(m);const[r,...o]=e,i=se(r||mt()),s=pe(m).filter((t=>t!==m));if(!s.length)return b(i),Reflect.apply(t,n,[i,...o]);const c=s.map((t=>ue(t).timestamp)).filter((t=>!!t)),u=c.length?Math.max(...c):void 0,f=ue(m).start_timestamp,l=Math.min(f?f+a/1e3:1/0,Math.max(f||-1/0,Math.min(i,u||1/0)));return b(l),Reflect.apply(t,n,[l,...o])}}),c.push(l.on("spanStart",(t=>{if(o||t===m||ue(t).timestamp)return;var n;pe(m).includes(t)&&(n=t.spanContext().spanId,g(),e.set(n,!0),v(mt()+f/1e3))}))),c.push(l.on("spanEnd",(t=>{var n;o||(n=t.spanContext().spanId,e.has(n)&&e.delete(n),0===e.size&&y(mt()+u/1e3))}))),c.push(l.on("idleSpanEnableAutoFinish",(t=>{t===m&&(s=!0,y(),e.size&&v())}))),n.disableAutoFinish||y(),setTimeout((()=>{o||(m.setStatus({code:te,message:"deadline_exceeded"}),i=Qe,m.end())}),a),m}function nr(t,n,e,r=0){return new Ut(((o,i)=>{const s=t[r];if(null===n||"function"!=typeof s)o(n);else{const c=s({...n},e);d(c)?c.then((n=>nr(t,n,e,r+1).then(o))).then(null,i):nr(t,c,e,r+1).then(o).then(null,i)}}))}function er(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,transactionName:c}=n,u=G(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=G(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=G(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const d=G(i);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts});s&&(t.level=s);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:oe(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Ce(n),...t.sdkProcessingMetadata};const e=me(n),r=ue(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?Rt(t.fingerprint):[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,i)}function rr(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:a,eventProcessors:f,attachments:d,propagationContext:l,transactionName:h,span:p}=n;or(t,"extra",e),or(t,"tags",r),or(t,"user",o),or(t,"contexts",i),or(t,"sdkProcessingMetadata",c),s&&(t.level=s),h&&(t.transactionName=h),p&&(t.span=p),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),a.length&&(t.fingerprint=[...t.fingerprint,...a]),f.length&&(t.eventProcessors=[...t.eventProcessors,...f]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...l}}function or(t,n,e){if(e&&Object.keys(e).length){t[n]={...t[n]};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[n][r]=e[r])}}function ir(t,n,e,r,o,i){const{normalizeDepth:s=3,normalizeMaxBreadth:c=1e3}=t,u={...n,event_id:n.event_id||e.event_id||xt(),timestamp:n.timestamp||pt()},a=e.integrations||t.integrations.map((t=>t.name));!function(t,n){const{environment:e,release:r,dist:o,maxValueLength:i=250}=n;"environment"in t||(t.environment="environment"in n?e:Ie);void 0===t.release&&void 0!==r&&(t.release=r);void 0===t.dist&&void 0!==o&&(t.dist=o);t.message&&(t.message=p(t.message,i));const s=t.exception&&t.exception.values&&t.exception.values[0];s&&s.value&&(s.value=p(s.value,i));const c=t.request;c&&c.url&&(c.url=p(c.url,i))}(u,t),function(t,n){n.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...n])}(u,a),o&&o.emit("applyFrameMetadata",n),void 0===n.type&&function(t,n){const e=$._sentryDebugIds;if(!e)return;let r;const o=sr.get(n);o?r=o:(r=new Map,sr.set(n,r));const i=Object.entries(e).reduce(((t,[e,o])=>{let i;const s=r.get(e);s?i=s:(i=n(e),r.set(e,i));for(let n=i.length-1;n>=0;n--){const e=i[n];if(e.filename){t[e.filename]=o;break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=i[t.filename])}))}))}catch(t){}}(u,t.stackParser);const f=function(t,n){if(!n)return t;const e=t?t.clone():new jn;return e.update(n),e}(r,e.captureContext);e.mechanism&&Ot(u,e.mechanism);const d=o?o.getEventProcessors():[],l=Fn().getScopeData();if(i){rr(l,i.getScopeData())}if(f){rr(l,f.getScopeData())}const h=[...e.attachments||[],...l.attachments];h.length&&(e.attachments=h),er(u,l);return nr([...d,...l.eventProcessors],u,e).then((t=>(t&&function(t){const n={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?n[t.abs_path]=t.debug_id:t.filename&&(n[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(t){}if(0===Object.keys(n).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const e=t.debug_meta.images;Object.entries(n).forEach((([t,n])=>{e.push({type:"sourcemap",code_file:t,debug_id:n})}))}(t),"number"==typeof s&&s>0?function(t,n,e){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:Pt(t.data,n,e)}})))},...t.user&&{user:Pt(t.user,n,e)},...t.contexts&&{contexts:Pt(t.contexts,n,e)},...t.extra&&{extra:Pt(t.extra,n,e)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Pt(t.contexts.trace.data,n,e)));t.spans&&(r.spans=t.spans.map((t=>({...t,...t.data&&{data:Pt(t.data,n,e)}}))));return r}(t,s,c):t)))}const sr=new WeakMap;function cr(t){if(t)return function(t){return t instanceof jn||"function"==typeof t}(t)||function(t){return Object.keys(t).some((t=>ur.includes(t)))}(t)?{captureContext:t}:t}const ur=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function captureException(t,n){return Nn().captureException(t,cr(n))}function ar(t,n){return Nn().captureEvent(t,n)}function fr(t,n){Dn().setContext(t,n)}function dr(t){Dn().setExtras(t)}function lr(t,n){Dn().setExtra(t,n)}function hr(t){Dn().setTags(t)}function pr(t,n){Dn().setTag(t,n)}function mr(t){Dn().setUser(t)}function gr(){return Dn().lastEventId()}function yr(t){const n=Un(),e=Dn(),r=Nn(),{release:o,environment:i=Ie}=n&&n.getOptions()||{},{userAgent:s}=$.navigator||{},c=$n({release:o,environment:i,user:r.getUser()||e.getUser(),...s&&{userAgent:s},...t}),u=e.getSession();return u&&"ok"===u.status&&Tn(u,{status:"exited"}),vr(),e.setSession(c),r.setSession(c),c}function vr(){const t=Dn(),n=Nn(),e=n.getSession()||t.getSession();e&&function(t,n){let e={};n?e={status:n}:"ok"===t.status&&(e={status:"exited"}),Tn(t,e)}(e),br(),t.setSession(),n.setSession()}function br(){const t=Dn(),n=Nn(),e=Un(),r=n.getSession()||t.getSession();r&&e&&e.captureSession(r)}function _r(t=!1){t?vr():br()}const wr="7";function Sr(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}function Er(t,n){return e={sentry_key:t.publicKey,sentry_version:wr,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}function $r(t,n,e){return n||`${function(t){return`${Sr(t)}${t.projectId}/envelope/`}(t)}?${Er(t,e)}`}const Tr=[];function kr(t){const n=t.defaultIntegrations||[],e=t.integrations;let r;n.forEach((t=>{t.isDefaultInstance=!0})),r=Array.isArray(e)?[...n,...e]:"function"==typeof e?Rt(e(n)):n;const o=function(t){const n={};return t.forEach((t=>{const{name:e}=t,r=n[e];r&&!r.isDefaultInstance&&t.isDefaultInstance||(n[e]=t)})),Object.values(n)}(r),i=o.findIndex((t=>"Debug"===t.name));if(i>-1){const[t]=o.splice(i,1);o.push(t)}return o}function Ir(t,n){for(const e of n)e&&e.afterAllSetup&&e.afterAllSetup(t)}function xr(t,n,e){if(!e[n.name]){if(e[n.name]=n,-1===Tr.indexOf(n.name)&&"function"==typeof n.setupOnce&&(n.setupOnce(),Tr.push(n.name)),n.setup&&"function"==typeof n.setup&&n.setup(t),"function"==typeof n.preprocessEvent){const e=n.preprocessEvent.bind(n);t.on("preprocessEvent",((n,r)=>e(n,r,t)))}if("function"==typeof n.processEvent){const e=n.processEvent.bind(n),r=Object.assign(((n,r)=>e(n,r,t)),{id:n.name});t.addEventProcessor(r)}}}class Ar{constructor(t){if(this.ct=t,this._integrations={},this.ut=0,this.ft={},this.dt={},this.T=[],t.dsn&&(this.lt=D(t.dsn)),this.lt){const n=$r(this.lt,t.tunnel,t._metadata?t._metadata.sdk:void 0);this.ht=t.transport({tunnel:this.ct.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,e){const r=xt();if(Mt(t))return r;const o={event_id:r,...n};return this.gt(this.eventFromException(t,o).then((t=>this.yt(t,o,e)))),o.event_id}captureMessage(t,n,e,r){const o={event_id:xt(),...e},i=c(t)?t:String(t),s=u(t)?this.eventFromMessage(i,n,o):this.eventFromException(t,o);return this.gt(s.then((t=>this.yt(t,o,r)))),o.event_id}captureEvent(t,n,e){const r=xt();if(n&&n.originalException&&Mt(n.originalException))return r;const o={event_id:r,...n},i=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this.gt(this.yt(t,o,i||e)),o.event_id}captureSession(t){"string"!=typeof t.release||(this.sendSession(t),Tn(t,{init:!1}))}getDsn(){return this.lt}getOptions(){return this.ct}getSdkMetadata(){return this.ct._metadata}getTransport(){return this.ht}flush(t){const n=this.ht;return n?(this.emit("flush"),this.vt(t).then((e=>n.flush(t).then((t=>e&&t))))):Ft(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,this.emit("close"),t)))}getEventProcessors(){return this.T}addEventProcessor(t){this.T.push(t)}init(){(this.bt()||this.ct.integrations.some((({name:t})=>t.startsWith("Spotlight"))))&&this._t()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];xr(this,t,this._integrations),n||Ir(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let e=Me(t,this.lt,this.ct._metadata,this.ct.tunnel);for(const t of n.attachments||[])e=rn(e,an(t));const r=this.sendEnvelope(e);r&&r.then((n=>this.emit("afterSendEvent",t,n)),null)}sendSession(t){const n=function(t,n,e,r){const o=ln(e);return en({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:L(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this.lt,this.ct._metadata,this.ct.tunnel);this.sendEnvelope(n)}recordDroppedEvent(t,n,e){if(this.ct.sendClientReports){const r="number"==typeof e?e:1,o=`${t}:${n}`;this.ft[o]=(this.ft[o]||0)+r}}on(t,n){const e=this.dt[t]=this.dt[t]||[];return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}emit(t,...n){const e=this.dt[t];e&&e.forEach((t=>t(...n)))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this.bt()&&this.ht?this.ht.send(t).then(null,(t=>t)):Ft({})}_t(){const{integrations:t}=this.ct;this._integrations=function(t,n){const e={};return n.forEach((n=>{n&&xr(t,n,e)})),e}(this,t),Ir(this,t)}wt(t,n){let e=!1,r=!1;const o=n.exception&&n.exception.values;if(o){r=!0;for(const t of o){const n=t.mechanism;if(n&&!1===n.handled){e=!0;break}}}const i="ok"===t.status;(i&&0===t.errors||i&&e)&&(Tn(t,{...e&&{status:"crashed"},errors:t.errors||Number(r||e)}),this.captureSession(t))}vt(t){return new Ut((n=>{let e=0;const r=setInterval((()=>{0==this.ut?(clearInterval(r),n(!0)):(e+=1,t&&e>=t&&(clearInterval(r),n(!1)))}),1)}))}bt(){return!1!==this.getOptions().enabled&&void 0!==this.ht}St(t,n,e,r=Dn()){const o=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||r.setLastEventId(t.event_id||n.event_id),ir(o,t,n,e,this,r).then((t=>{if(null===t)return t;const n={...r.getPropagationContext(),...e?e.getPropagationContext():void 0};if(!(t.contexts&&t.contexts.trace)&&n){const{traceId:e,spanId:r,parentSpanId:o,dsc:i}=n;t.contexts={trace:G({trace_id:e,span_id:r,parent_span_id:o}),...t.contexts};const s=i||je(e,this);t.sdkProcessingMetadata={dynamicSamplingContext:s,...t.sdkProcessingMetadata}}return t}))}yt(t,n={},e){return this.Et(t,n,e).then((t=>t.event_id),(t=>{}))}Et(t,n,e){const r=this.getOptions(),{sampleRate:o}=r,i=Cr(t),s=jr(t),c=t.type||"error",u=`before send for type \`${c}\``,f=void 0===o?void 0:Oe(o);if(s&&"number"==typeof f&&Math.random()>f)return this.recordDroppedEvent("sample_rate","error",t),qt(new F(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const l="replay_event"===c?"replay":c,h=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this.St(t,n,e,h).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",l,t),new F("An event processor returned `null`, will not send event.","log");if(n.data&&!0===n.data.__sentry__)return e;const o=function(t,n,e,r){const{beforeSend:o,beforeSendTransaction:i,beforeSendSpan:s}=n;if(jr(e)&&o)return o(e,r);if(Cr(e)){if(e.spans&&s){const n=[];for(const r of e.spans){const e=s(r);e?n.push(e):t.recordDroppedEvent("before_send","span")}e.spans=n}if(i){if(e.spans){const t=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:t}}return i(e,r)}}return e}(this,r,e,n);return function(t,n){const e=`${n} must return \`null\` or a valid event.`;if(d(t))return t.then((t=>{if(!a(t)&&null!==t)throw new F(e);return t}),(t=>{throw new F(`${n} rejected with ${t}`)}));if(!a(t)&&null!==t)throw new F(e);return t}(o,u)})).then((r=>{if(null===r){if(this.recordDroppedEvent("before_send",l,t),i){const n=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",n)}throw new F(`${u} returned \`null\`, will not send event.`,"log")}const o=e&&e.getSession();if(!i&&o&&this.wt(o,r),i){const t=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);t>0&&this.recordDroppedEvent("before_send","span",t)}const s=r.transaction_info;if(i&&s&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...s,source:t}}return this.sendEvent(r,n),r})).then(null,(t=>{if(t instanceof F)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new F(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}gt(t){this.ut++,t.then((t=>(this.ut--,t)),(t=>(this.ut--,t)))}$t(){const t=this.ft;return this.ft={},Object.entries(t).map((([t,n])=>{const[e,r]=t.split(":");return{reason:e,category:r,quantity:n}}))}Tt(){const t=this.$t();if(0===t.length)return;if(!this.lt)return;const n=(e=t,en((r=this.ct.tunnel&&L(this.lt))?{dsn:r}:{},[[{type:"client_report"},{timestamp:o||pt(),discarded_events:e}]]));var e,r,o;this.sendEnvelope(n)}}function jr(t){return void 0===t.type}function Cr(t){return"transaction"===t.type}function Or(t){Nn().setClient(t)}const Mr=64;function Rr(t,n,e=Ht(t.bufferSize||Mr)){let r={};return{send:function(o){const i=[];if(on(o,((n,e)=>{const o=dn(e);if(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e}(r,o)){const r=Pr(n,e);t.recordDroppedEvent("ratelimit_backoff",o,r)}else i.push(n)})),0===i.length)return Ft({});const s=en(o[0],i),c=n=>{on(s,((e,r)=>{const o=Pr(e,r);t.recordDroppedEvent(n,dn(r),o)}))};return e.add((()=>n({body:cn(s)}).then((t=>(r=pn(r,t),t)),(t=>{throw c("network_error"),t})))).then((t=>t),(t=>{if(t instanceof F)return c("queue_overflow"),Ft({});throw t}))},flush:t=>e.drain(t)}}function Pr(t,n){if("event"===n||"transaction"===n)return Array.isArray(t)?t[1]:void 0}const Lr=100;function Nr(t,n){const e=Un(),r=Dn();if(!e)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Lr}=e.getOptions();if(i<=0)return;const s={timestamp:pt(),...t},c=o?M((()=>o(s,n))):s;null!==c&&(e.emit&&e.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,i))}let Dr;const Fr=new WeakMap,qr=()=>({name:"FunctionToString",setupOnce(){Dr=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=B(this),e=Fr.has(Un())&&void 0!==n?n:this;return Dr.apply(e,t)}}catch(t){}},setup(t){Fr.set(t,!0)}}),Ur=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],Hr=(t={})=>({name:"InboundFilters",processEvent(n,e,r){const o=r.getOptions(),i=function(t={},n={}){return{allowUrls:[...t.allowUrls||[],...n.allowUrls||[]],denyUrls:[...t.denyUrls||[],...n.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...n.ignoreErrors||[],...t.disableErrorDefaults?[]:Ur],ignoreTransactions:[...t.ignoreTransactions||[],...n.ignoreTransactions||[]],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(t,o);return function(t,n){if(n.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t))return!0;if(function(t,n){if(t.type||!n||!n.length)return!1;return function(t){const n=[];t.message&&n.push(t.message);let e;try{e=t.exception.values[t.exception.values.length-1]}catch(t){}e&&e.value&&(n.push(e.value),e.type&&n.push(`${e.type}: ${e.value}`));return n}(t).some((t=>y(t,n)))}(t,n.ignoreErrors))return!0;if(function(t){if(t.type)return!1;if(!t.exception||!t.exception.values||0===t.exception.values.length)return!1;return!t.message&&!t.exception.values.some((t=>t.stacktrace||t.type&&"Error"!==t.type||t.value))}(t))return!0;if(function(t,n){if("transaction"!==t.type||!n||!n.length)return!1;const e=t.transaction;return!!e&&y(e,n)}(t,n.ignoreTransactions))return!0;if(function(t,n){if(!n||!n.length)return!1;const e=Br(t);return!!e&&y(e,n)}(t,n.denyUrls))return!0;if(!function(t,n){if(!n||!n.length)return!0;const e=Br(t);return!e||y(e,n)}(t,n.allowUrls))return!0;return!1}(n,i)?null:n}});function Br(t){try{let n;try{n=t.exception.values[0].stacktrace.frames}catch(t){}return n?function(t=[]){for(let n=t.length-1;n>=0;n--){const e=t[n];if(e&&""!==e.filename&&"[native code]"!==e.filename)return e.filename||null}return null}(n):null}catch(t){return null}}const Wr=()=>{let t;return{name:"Dedupe",processEvent(n){if(n.type)return n;try{if(function(t,n){if(!n)return!1;if(function(t,n){const e=t.message,r=n.message;if(!e&&!r)return!1;if(e&&!r||!e&&r)return!1;if(e!==r)return!1;if(!Xr(t,n))return!1;if(!zr(t,n))return!1;return!0}(t,n))return!0;if(function(t,n){const e=Gr(n),r=Gr(t);if(!e||!r)return!1;if(e.type!==r.type||e.value!==r.value)return!1;if(!Xr(t,n))return!1;if(!zr(t,n))return!1;return!0}(t,n))return!0;return!1}(n,t))return null}catch(t){}return t=n}}};function zr(t,n){let e=rt(t),r=rt(n);if(!e&&!r)return!0;if(e&&!r||!e&&r)return!1;if(r.length!==e.length)return!1;for(let t=0;tnew WeakMap)),r=e.get(t);if(r)return r;const o=new n(t);return t.on("flush",(()=>o.flush())),t.on("close",(()=>o.close())),e.set(t,o),o}function Kr(t,n,e,r,o={}){const i=o.client||Un();if(!i)return;const s=ge(),c=s?me(s):void 0,u=c&&ue(c).description,{unit:a,tags:f,timestamp:d}=o,{release:l,environment:h}=i.getOptions(),p={};l&&(p.release=l),h&&(p.environment=h),u&&(p.transaction=u);Yr(i,t).add(n,e,r,a,{...p,...f},d)}function Vr(t,n,e,r){Kr(t,Jr,n,Zr(e),r)}const Qr={increment:function(t,n,e=1,r){Kr(t,"c",n,Zr(e),r)},distribution:Vr,set:function(t,n,e,r){Kr(t,"s",n,e,r)},gauge:function(t,n,e,r){Kr(t,"g",n,Zr(e),r)},timing:function(t,n,e,r="second",o){if("function"==typeof e){const r=mt();return qe({op:"metrics.timing",name:n,startTime:r,onlyIfParent:!0},(i=>ke((()=>e()),(()=>{}),(()=>{const e=mt();Vr(t,n,e-r,{...o,unit:"second"}),i.end(e)}))))}Vr(t,n,e,{...o,unit:r})},getMetricsAggregatorForClient:Yr};function Zr(t){return"string"==typeof t?parseInt(t):t}function to(t){return t.replace(/[^\w\-./]+/gi,"")}const no=[["\n","\\n"],["\r","\\r"],["\t","\\t"],["\\","\\\\"],["|","\\u{7c}"],[",","\\u{2c}"]];function eo(t){return[...t].reduce(((t,n)=>t+function(t){for(const[n,e]of no)if(t===n)return e;return t}(n)),"")}function ro(t,n){R.log(`Flushing aggregated metrics, number of metrics: ${n.length}`);const e=function(t,n,e,r){const o={sent_at:(new Date).toISOString()};e&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version});r&&n&&(o.dsn=L(n));const i=function(t){const n=function(t){let n="";for(const e of t){const t=Object.entries(e.tags),r=t.length>0?`|#${t.map((([t,n])=>`${t}:${n}`)).join(",")}`:"";n+=`${e.name}@${e.unit}:${e.metric}|${e.metricType}${r}|T${e.timestamp}\n`}return n}(t);return[{type:"statsd",length:n.length},n]}(t);return en(o,[i])}(n,t.getDsn(),t.getSdkMetadata(),t.getOptions().tunnel);t.sendEnvelope(e)}const oo={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.kt=t,this.It=t,this.xt=t,this.At=t,this.jt=1}get weight(){return 5}add(t){this.kt=t,tthis.xt&&(this.xt=t),this.At+=t,this.jt++}toString(){return`${this.kt}:${this.It}:${this.xt}:${this.At}:${this.jt}`}},[Jr]: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 n=0;for(let e=0;e>>0}(t):t)).join(":")}}};class io{constructor(t){this.q=t,this.Ct=new Map,this.Ot=setInterval((()=>this.flush()),5e3)}add(t,n,e,r="none",o={},i=mt()){const s=Math.floor(i),c=n.replace(/[^\w\-.]+/gi,"_");const u=function(t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[to(e)]=eo(String(t[e])));return n}(o),a=function(t){return t.replace(/[^\w]+/gi,"_")}(r),f=function(t,n,e,r){return`${t}${n}${e}${Object.entries(G(r)).sort(((t,n)=>t[0].localeCompare(n[0])))}`}(t,c,a,u);let d=this.Ct.get(f);const l=d&&"s"===t?d.metric.weight:0;d?(d.metric.add(e),d.timestamp0&&t.setAttribute("http.response_content_length",n)}}else n.error&&t.setStatus({code:te,message:"internal_error"});t.end()}(e,t),delete r[n]))}const s=Nn(),c=Un(),{method:u,url:a}=t.fetchData,f=function(t){try{return new URL(t).href}catch(t){return}}(a),d=f?Bt(f).host:void 0,h=!!ge(),p=i&&h?Ue({name:`${u} ${a}`,attributes:{url:a,type:"fetch","http.method":u,"http.url":f,"server.address":d,[Gn]:o,[Xn]:"http.client"}}):new Te;if(t.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,e(t.fetchData.url)&&c){const n=t.args[0];t.args[1]=t.args[1]||{};const e=t.args[1];e.headers=function(t,n,e,r,o){const i=Dn(),{traceId:s,spanId:c,sampled:u,dsc:a}={...i.getPropagationContext(),...e.getPropagationContext()},f=o?ie(o):nn(s,c,u),d=Vt(a||(o?Ce(o):je(s,n))),h=r.headers||("undefined"!=typeof Request&&l(t,Request)?t.headers:void 0);if(h){if("undefined"!=typeof Headers&&l(h,Headers)){const t=new Headers(h);if(t.set("sentry-trace",f),d){const n=t.get(Xt);if(n){const e=co(n);t.set(Xt,e?`${e},${d}`:d)}else t.set(Xt,d)}return t}if(Array.isArray(h)){const t=[...h.filter((t=>!(Array.isArray(t)&&"sentry-trace"===t[0]))).map((t=>{if(Array.isArray(t)&&t[0]===Xt&&"string"==typeof t[1]){const[n,e,...r]=t;return[n,co(e),...r]}return t})),["sentry-trace",f]];return d&&t.push([Xt,d]),t}{const t="baggage"in h?h.baggage:void 0;let n=[];return Array.isArray(t)?n=t.map((t=>"string"==typeof t?co(t):t)).filter((t=>""===t)):t&&n.push(co(t)),d&&n.push(d),{...h,"sentry-trace":f,baggage:n.length>0?n.join(","):void 0}}}return{"sentry-trace":f,baggage:d}}(n,c,s,e,$e()&&h?p:void 0)}return p}function co(t){return t.split(",").filter((t=>!t.split("=")[0].startsWith(Gt))).join(",")}const uo=function(){return{bindClient(t){Nn().setClient(t)},withScope:qn,getClient:()=>Un(),getScope:Nn,getIsolationScope:Dn,captureException:(t,n)=>Nn().captureException(t,n),captureMessage:(t,n,e)=>Nn().captureMessage(t,n,e),captureEvent:ar,addBreadcrumb:Nr,setUser:mr,setTags:hr,setTag:pr,setExtra:lr,setExtras:dr,setContext:fr,getIntegration(t){const n=Un();return n&&n.getIntegrationByName(t.id)||null},startSession:yr,endSession:vr,captureSession(t){if(t)return vr();!function(){const t=Nn(),n=Un(),e=t.getSession();n&&e&&n.captureSession(e)}()}}};const ao=$;let fo=0;function lo(){return fo>0}function ho(t,n={},e){if("function"!=typeof t)return t;try{const n=t.__sentry_wrapped__;if(n)return"function"==typeof n?n:t;if(B(t))return t}catch(n){return t}const sentryWrapped=function(){const r=Array.prototype.slice.call(arguments);try{e&&"function"==typeof e&&e.apply(this,arguments);const o=r.map((t=>ho(t,n)));return t.apply(this,o)}catch(t){throw fo++,setTimeout((()=>{fo--})),qn((e=>{e.addEventProcessor((t=>(n.mechanism&&(Ct(t,void 0,void 0),Ot(t,n.mechanism)),t.extra={...t.extra,arguments:r},t))),captureException(t)})),t}};try{for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(sentryWrapped[n]=t[n])}catch(t){}H(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 po(t,n){const e=yo(t,n),r={type:_o(n),value:wo(n)};return e.length&&(r.stacktrace={frames:e}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function mo(t,n,e,r){const o=Un(),i=o&&o.getOptions().normalizeDepth,s=function(t){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];if(e instanceof Error)return e}return}(n),c={__serialized__:Lt(n,i)};if(s)return{exception:{values:[po(t,s)]},extra:c};const u={exception:{values:[{type:f(n)?n.constructor.name:r?"UnhandledRejection":"Error",value:ko(n,{isUnhandledRejection:r})}]},extra:c};if(e){const n=yo(t,e);n.length&&(u.exception.values[0].stacktrace={frames:n})}return u}function go(t,n){return{exception:{values:[po(t,n)]}}}function yo(t,n){const e=n.stacktrace||n.stack||"",r=function(t){if(t&&vo.test(t.message))return 1;return 0}(n),o=function(t){if("number"==typeof t.framesToPop)return t.framesToPop;return 0}(n);try{return t(e,r,o)}catch(t){}return[]}const vo=/Minified React error #\d+;/i;function bo(t){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&t instanceof WebAssembly.Exception}function _o(t){const n=t&&t.name;if(!n&&bo(t)){return t.message&&Array.isArray(t.message)&&2==t.message.length?t.message[0]:"WebAssembly.Exception"}return n}function wo(t){const n=t&&t.message;return n?n.error&&"string"==typeof n.error.message?n.error.message:bo(t)&&Array.isArray(t.message)&&2==t.message.length?t.message[1]:n:"No error message"}function So(t,n,e,r){const o=$o(t,n,e&&e.syntheticException||void 0,r);return Ot(o),o.level="error",e&&e.event_id&&(o.event_id=e.event_id),Ft(o)}function Eo(t,n,e="info",r,o){const i=To(t,n,r&&r.syntheticException||void 0,o);return i.level=e,r&&r.event_id&&(i.event_id=r.event_id),Ft(i)}function $o(t,n,s,c,u){let d;if(o(n)&&n.error){return go(t,n.error)}if(i(n)||r(n,"DOMException")){const e=n;if("stack"in n)d=go(t,n);else{const n=e.name||(i(e)?"DOMError":"DOMException"),r=e.message?`${n}: ${e.message}`:n;d=To(t,r,s,c),Ct(d,r)}return"code"in e&&(d.tags={...d.tags,"DOMException.code":`${e.code}`}),d}if(e(n))return go(t,n);if(a(n)||f(n)){return d=mo(t,n,s,u),Ot(d,{synthetic:!0}),d}return d=To(t,n,s,c),Ct(d,`${n}`,void 0),Ot(d,{synthetic:!0}),d}function To(t,n,e,r){const o={};if(r&&e){const r=yo(t,e);r.length&&(o.exception={values:[{value:n,stacktrace:{frames:r}}]})}if(c(n)){const{__sentry_template_string__:t,__sentry_template_values__:e}=n;return o.logentry={message:t,params:e},o}return o.message=n,o}function ko(t,{isUnhandledRejection:n}){const e=function(t,n=40){const e=Object.keys(W(t));e.sort();const r=e[0];if(!r)return"[object has no keys]";if(r.length>=n)return p(r,n);for(let t=e.length;t>0;t--){const r=e.slice(0,t).join(", ");if(!(r.length>n))return t===e.length?r:p(r,n)}return""}(t),r=n?"promise rejection":"exception";if(o(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if(f(t)){return`Event \`${function(t){try{const n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch(t){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${e}`}function Io(t,{metadata:n,tunnel:e,dsn:r}){const o={event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&n.sdk&&{sdk:{name:n.sdk.name,version:n.sdk.version}},...!!e&&!!r&&{dsn:L(r)}},i=function(t){return[{type:"user_report"},t]}(t);return en(o,[i])}class xo extends Ar{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t};!function(t,n,e=[n],r="npm"){const o=t._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${n}`,packages:e.map((t=>({name:`${r}:@sentry/${t}`,version:E}))),version:E}),t._metadata=o}(n,"browser",["browser"],ao.SENTRY_SDK_SOURCE||"cdn"),super(n),n.sendClientReports&&ao.document&&ao.document.addEventListener("visibilitychange",(()=>{"hidden"===ao.document.visibilityState&&this.Tt()}))}eventFromException(t,n){return So(this.ct.stackParser,t,n,this.ct.attachStacktrace)}eventFromMessage(t,n="info",e){return Eo(this.ct.stackParser,t,n,e,this.ct.attachStacktrace)}captureUserFeedback(t){if(!this.bt())return;const n=Io(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}St(t,n,e){return t.platform=t.platform||"javascript",super.St(t,n,e)}}const Ao=(t,n,e,r)=>{let o,i;return s=>{n.value>=0&&(s||r)&&(i=n.value-(o||0),(i||void 0===o)&&(o=n.value,n.delta=i,n.rating=((t,n)=>t>n[1]?"poor":t>n[0]?"needs-improvement":"good")(n.value,e),t(n)))}},jo=$,Co=()=>jo.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],Oo=()=>{const t=Co();return t&&t.activationStart||0},Mo=(t,n)=>{const e=Co();let r="navigate";e&&(jo.document&&jo.document.prerendering||Oo()>0?r="prerender":jo.document&&jo.document.wasDiscarded?r="restore":e.type&&(r=e.type.replace(/_/g,"-")));return{name:t,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Ro=(t,n,e)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((t=>{Promise.resolve().then((()=>{n(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},e||{})),r}}catch(t){}},Po=t=>{const n=n=>{("pagehide"===n.type||jo.document&&"hidden"===jo.document.visibilityState)&&t(n)};jo.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},Lo=t=>{let n=!1;return e=>{n||(t(e),n=!0)}};let No=-1;const Do=t=>{"hidden"===jo.document.visibilityState&&No>-1&&(No="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("visibilitychange",Do,!0),removeEventListener("prerenderingchange",Do,!0))},Fo=()=>(jo.document&&No<0&&(No="hidden"!==jo.document.visibilityState||jo.document.prerendering?1/0:0,addEventListener("visibilitychange",Do,!0),addEventListener("prerenderingchange",Do,!0)),{get firstHiddenTime(){return No}}),qo=t=>{jo.document&&jo.document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Uo=[1800,3e3],Ho=[.1,.25],Bo=(t,n={})=>{((t,n={})=>{qo((()=>{const e=Fo(),r=Mo("FCP");let o;const i=Ro("paint",(t=>{t.forEach((t=>{"first-contentful-paint"===t.name&&(i.disconnect(),t.startTime{const e=Mo("CLS",0);let r,o=0,i=[];const s=t=>{t.forEach((t=>{if(!t.hadRecentInput){const n=i[0],e=i[i.length-1];o&&n&&e&&t.startTime-e.startTime<1e3&&t.startTime-n.startTime<5e3?(o+=t.value,i.push(t)):(o=t.value,i=[t])}})),o>e.value&&(e.value=o,e.entries=i,r())},c=Ro("layout-shift",s);c&&(r=Ao(t,e,Ho,n.reportAllChanges),Po((()=>{s(c.takeRecords()),r(!0)})),setTimeout(r,0))})))},Wo=[100,300],zo=(t,n={})=>{qo((()=>{const e=Fo(),r=Mo("FID");let o;const i=t=>{t.startTime{t.forEach(i)},c=Ro("first-input",s);o=Ao(t,r,Wo,n.reportAllChanges),c&&Po(Lo((()=>{s(c.takeRecords()),c.disconnect()})))}))};let Xo=0,Go=1/0,Jo=0;const Yo=t=>{t.forEach((t=>{t.interactionId&&(Go=Math.min(Go,t.interactionId),Jo=Math.max(Jo,t.interactionId),Xo=Jo?(Jo-Go)/7+1:0)}))};let Ko;const Vo=()=>{"interactionCount"in performance||Ko||(Ko=Ro("event",Yo,{type:"event",buffered:!0,durationThreshold:0}))},Qo=[200,500],Zo=()=>(Ko?Xo:performance.interactionCount||0)-0,ti=[],ni={},ei=t=>{const n=ti[ti.length-1],e=ni[t.interactionId];if(e||ti.length<10||n&&t.duration>n.latency){if(e)e.entries.push(t),e.latency=Math.max(e.latency,t.duration);else{const n={id:t.interactionId,latency:t.duration,entries:[t]};ni[n.id]=n,ti.push(n)}ti.sort(((t,n)=>n.latency-t.latency)),ti.splice(10).forEach((t=>{delete ni[t.id]}))}},ri=(t,n={})=>{qo((()=>{Vo();const e=Mo("INP");let r;const o=t=>{t.forEach((t=>{if(t.interactionId&&ei(t),"first-input"===t.entryType){!ti.some((n=>n.entries.some((n=>t.duration===n.duration&&t.startTime===n.startTime))))&&ei(t)}}));const n=(()=>{const t=Math.min(ti.length-1,Math.floor(Zo()/50));return ti[t]})();n&&n.latency!==e.value&&(e.value=n.latency,e.entries=n.entries,r())},i=Ro("event",o,{durationThreshold:null!=n.durationThreshold?n.durationThreshold:40});r=Ao(t,e,Qo,n.reportAllChanges),i&&("PerformanceEventTiming"in jo&&"interactionId"in PerformanceEventTiming.prototype&&i.observe({type:"first-input",buffered:!0}),Po((()=>{o(i.takeRecords()),e.value<0&&Zo()>0&&(e.value=0,e.entries=[]),r(!0)})))}))},oi=[2500,4e3],ii={},si=(t,n={})=>{qo((()=>{const e=Fo(),r=Mo("LCP");let o;const i=t=>{const n=t[t.length-1];n&&n.startTime{ii[r.id]||(i(s.takeRecords()),s.disconnect(),ii[r.id]=!0,o(!0))}));["keydown","click"].forEach((t=>{jo.document&&addEventListener(t,(()=>setTimeout(e,0)),!0)})),Po(e)}}))},ci=[800,1800],ui=t=>{jo.document&&jo.document.prerendering?qo((()=>ui(t))):jo.document&&"complete"!==jo.document.readyState?addEventListener("load",(()=>ui(t)),!0):setTimeout(t,0)},ai=(t,n={})=>{const e=Mo("TTFB"),r=Ao(t,e,ci,n.reportAllChanges);ui((()=>{const t=Co();if(t){const n=t.responseStart;if(n<=0||n>performance.now())return;e.value=Math.max(n-Oo(),0),e.entries=[t],r(!0)}}))},fi={},di={};let li,hi,pi,mi,gi;function yi(t,n=!1){return Ti("cls",t,_i,li,n)}function vi(t,n){return ki(t,n),di[t]||(!function(t){const n={};"event"===t&&(n.durationThreshold=0);Ro(t,(n=>{bi(t,{entries:n})}),n)}(t),di[t]=!0),Ii(t,n)}function bi(t,n){const e=fi[t];if(e&&e.length)for(const t of e)try{t(n)}catch(t){}}function _i(){return Bo((t=>{bi("cls",{metric:t}),li=t}),{reportAllChanges:!0})}function wi(){return zo((t=>{bi("fid",{metric:t}),hi=t}))}function Si(){return si((t=>{bi("lcp",{metric:t}),pi=t}),{reportAllChanges:!0})}function Ei(){return ai((t=>{bi("ttfb",{metric:t}),mi=t}))}function $i(){return ri((t=>{bi("inp",{metric:t}),gi=t}))}function Ti(t,n,e,r,o=!1){let i;return ki(t,n),di[t]||(i=e(),di[t]=!0),r&&n({metric:r}),Ii(t,n,o?i:void 0)}function ki(t,n){fi[t]=fi[t]||[],fi[t].push(n)}function Ii(t,n,e){return()=>{e&&e();const r=fi[t];if(!r)return;const o=r.indexOf(n);-1!==o&&r.splice(o,1)}}function xi(t){return"number"==typeof t&&isFinite(t)}function Ai(t,n,e,{...r}){const o=ue(t).start_timestamp;return o&&o>n&&"function"==typeof t.updateStartTime&&t.updateStartTime(n),He(t,(()=>{const t=Ue({startTime:n,...r});return t&&t.end(e),t}))}function ji(t){const n=Un();if(!n)return;const{name:e,transaction:r,attributes:o,startTime:i}=t,{release:s,environment:c}=n.getOptions(),u=n.getIntegrationByName("Replay"),a=u&&u.getReplayId(),f=Nn(),d=f.getUser(),l=void 0!==d?d.email||d.id||d.ip_address:void 0;let h;try{h=f.getScopeData().contexts.profile.profile_id}catch(t){}return Ue({name:e,attributes:{release:s,environment:c,user:l||void 0,profile_id:h||void 0,replay_id:a||void 0,transaction:r,"user_agent.original":jo.navigator&&jo.navigator.userAgent,...o},startTime:i,experimental:{standalone:!0}})}function Ci(){return jo&&jo.addEventListener&&jo.performance}function Oi(t){return t/1e3}function Mi(){let t,n,e=0;if(!function(){try{return mn([PerformanceObserver,"access",t=>t.supportedEntryTypes,"optionalAccess",t=>t.includes,"call",t=>t("layout-shift")])}catch(t){return!1}}())return;let r=!1;function o(){r||(r=!0,n&&function(t,n,e){const r=Oi((gt||0)+(mn([n,"optionalAccess",t=>t.startTime])||0)),o=Nn().getScopeData().transactionName,i=n?x(mn([n,"access",t=>t.sources,"access",t=>t[0],"optionalAccess",t=>t.node])):"Layout shift",s=G({[Gn]:"auto.http.browser.cls",[Xn]:"ui.webvital.cls",[Vn]:mn([n,"optionalAccess",t=>t.duration])||0,"sentry.pageload.span_id":e}),c=ji({name:i,transaction:o,attributes:s,startTime:r});mn([c,"optionalAccess",t=>t.addEvent,"call",n=>n("cls",{[Yn]:"",[Kn]:t})]),mn([c,"optionalAccess",t=>t.end,"call",t=>t(r)])}(e,t,n),i())}const i=yi((({metric:n})=>{const r=n.entries[n.entries.length-1];r&&(e=n.value,t=r)}),!0);Po((()=>{o()})),setTimeout((()=>{const t=mn([Un(),"optionalAccess",t=>t.on,"call",n=>n("startNavigationSpan",(()=>{o(),t&&t()}))]),e=ge(),r=e&&me(e),i=r&&ue(r);i&&"pageload"===i.op&&(n=r.spanContext().spanId)}),0)}const Ri=2147483647;let Pi,Li,Ni=0,Di={};function Fi({recordClsStandaloneSpans:t}){const n=Ci();if(n&>){n.mark&&jo.performance.mark("sentry-tracing-init");const e=Ti("fid",(({metric:t})=>{const n=t.entries[t.entries.length-1];if(!n)return;const e=Oi(gt),r=Oi(n.startTime);Di.fid={value:t.value,unit:"millisecond"},Di["mark.fid"]={value:e+r,unit:"second"}}),wi,hi),r=function(t,n=!1){return Ti("lcp",t,Si,pi,n)}((({metric:t})=>{const n=t.entries[t.entries.length-1];n&&(Di.lcp={value:t.value,unit:"millisecond"},Pi=n)}),!0),o=function(t){return Ti("ttfb",t,Ei,mi)}((({metric:t})=>{t.entries[t.entries.length-1]&&(Di.ttfb={value:t.value,unit:"millisecond"})})),i=t?Mi():yi((({metric:t})=>{const n=t.entries[t.entries.length-1];n&&(Di.cls={value:t.value,unit:""},Li=n)}),!0);return()=>{e(),r(),o(),i&&i()}}return()=>{}}function qi(t,n){const e=Ci();if(!e||!jo.performance.getEntries||!gt)return;const r=Oi(gt),o=e.getEntries(),{op:i,start_timestamp:s}=ue(t);if(o.slice(Ni).forEach((n=>{const e=Oi(n.startTime),o=Oi(Math.max(0,n.duration));if(!("navigation"===i&&s&&r+e{Ui(t,n,r,e)})),Ui(t,n,"secureConnection",e,"TLS/SSL","connectEnd"),Ui(t,n,"fetch",e,"cache","domainLookupStart"),Ui(t,n,"domainLookup",e,"DNS"),function(t,n,e){const r=e+Oi(n.requestStart),o=e+Oi(n.responseEnd),i=e+Oi(n.responseStart);n.responseEnd&&(Ai(t,r,o,{op:"browser.request",name:n.name,attributes:{[Gn]:"auto.ui.browser.metrics"}}),Ai(t,i,o,{op:"browser.response",name:n.name,attributes:{[Gn]:"auto.ui.browser.metrics"}}))}(t,n,e)}(t,n,r);break;case"mark":case"paint":case"measure":{!function(t,n,e,r,o){const i=Co(),s=Oi(i?i.requestStart:0),c=o+Math.max(e,s),u=o+e,a=u+r,f={[Gn]:"auto.resource.browser.metrics"};c!==u&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=c);Ai(t,c,a,{name:n.name,op:n.entryType,attributes:f})}(t,n,e,o,r);const i=Fo(),s=n.startTime{Re(t,n.value,n.unit)})),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",Oo()),function(t){Pi&&(Pi.element&&t.setAttribute("lcp.element",x(Pi.element)),Pi.id&&t.setAttribute("lcp.id",Pi.id),Pi.url&&t.setAttribute("lcp.url",Pi.url.trim().slice(0,200)),t.setAttribute("lcp.size",Pi.size));Li&&Li.sources&&Li.sources.forEach(((n,e)=>t.setAttribute(`cls.source.${e+1}`,x(n.node))))}(t)}Pi=void 0,Li=void 0,Di={}}function Ui(t,n,e,r,o,i){const s=i?n[i]:n[`${e}End`],c=n[`${e}Start`];c&&s&&Ai(t,r+Oi(c),r+Oi(s),{op:`browser.${o||e}`,name:n.name,attributes:{[Gn]:"auto.ui.browser.metrics"}})}function Hi(t,n,e,r){const o=n[e];null!=o&&o{const e=jo[n]&&jo[n].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(q(e,"addEventListener",(function(n){return function(e,r,o){if("click"===e||"keypress"==e)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},s=i[e]=i[e]||{refCount:0};if(!s.handler){const r=Yi(t);s.handler=r,n.call(this,e,r,o)}s.refCount++}catch(t){}return n.call(this,e,r,o)}})),q(e,"removeEventListener",(function(t){return function(n,e,r){if("click"===n||"keypress"==n)try{const e=this,o=e.__sentry_instrumentation_handlers__||{},i=o[n];i&&(i.refCount--,i.refCount<=0&&(t.call(this,n,i.handler,r),i.handler=void 0,delete o[n]),0===Object.keys(o).length&&delete e.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,n,e,r)}})))}))}function Yi(t,n=!1){return e=>{if(!e||e._sentryCaptured)return;const r=function(t){try{return t.target}catch(t){return null}}(e);if(function(t,n){return"keypress"===t&&(!n||!n.tagName||"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable)}(e.type,r))return;U(e,"_sentryCaptured",!0),r&&!r._sentryId&&U(r,"_sentryId",xt());const o="keypress"===e.type?"input":e.type;if(!function(t){if(t.type!==zi)return!1;try{if(!t.target||t.target._sentryId!==Xi)return!1}catch(t){}return!0}(e)){t({event:e,name:o,global:n}),zi=e.type,Xi=r?r._sentryId:void 0}clearTimeout(Wi),Wi=jo.setTimeout((()=>{Xi=void 0,zi=void 0}),Bi)}}function Ki(t){const n="history";st(n,t),ct(n,Vi)}function Vi(){if(!function(){const t=yn.chrome,n=t&&t.app&&t.app.runtime,e="history"in yn&&!!yn.history.pushState&&!!yn.history.replaceState;return!n&&e}())return;const t=jo.onpopstate;function n(t){return function(...n){const e=n.length>2?n[2]:void 0;if(e){const t=Gi,n=String(e);Gi=n;ut("history",{from:t,to:n})}return t.apply(this,n)}}jo.onpopstate=function(...n){const e=jo.location.href,r=Gi;Gi=e;if(ut("history",{from:r,to:e}),t)try{return t.apply(this,n)}catch(t){}},q(jo.history,"pushState",n),q(jo.history,"replaceState",n)}const Qi={};function Zi(t){Qi[t]=void 0}const ts="__sentry_xhr_v3__";function ns(t){st("xhr",t),ct("xhr",es)}function es(){if(!jo.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(t,n,e){const r=1e3*mt(),o=s(e[0])?e[0].toUpperCase():void 0,i=function(t){if(s(t))return t;try{return t.toString()}catch(t){}return}(e[1]);if(!o||!i)return t.apply(n,e);n[ts]={method:o,url:i,request_headers:{}},"POST"===o&&i.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const t=n[ts];if(t&&4===n.readyState){try{t.status_code=n.status}catch(t){}ut("xhr",{endTimestamp:1e3*mt(),startTimestamp:r,xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(t,n,e)=>(c(),t.apply(n,e))}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(t,n,e){const[r,o]=e,i=n[ts];return i&&s(r)&&s(o)&&(i.request_headers[r.toLowerCase()]=o),t.apply(n,e)}}),t.apply(n,e)}}),t.send=new Proxy(t.send,{apply(t,n,e){const r=n[ts];if(!r)return t.apply(n,e);void 0!==e[0]&&(r.body=e[0]);return ut("xhr",{startTimestamp:1e3*mt(),xhr:n}),t.apply(n,e)}})}const rs=[],os=new Map;function is(){if(Ci()&>){const t=Ti("inp",(({metric:t})=>{if(null==t.value)return;const n=t.entries.find((n=>n.duration===t.value&&ss[n.name]));if(!n)return;const{interactionId:e}=n,r=ss[n.name],o=Oi(gt+n.startTime),i=Oi(t.value),s=ge(),c=s?me(s):void 0,u=(null!=e?os.get(e):void 0)||c,a=u?ue(u).description:Nn().getScopeData().transactionName,f=ji({name:x(n.target),transaction:a,attributes:G({[Gn]:"auto.http.browser.inp",[Xn]:`ui.interaction.${r}`,[Vn]:n.duration}),startTime:o});mn([f,"optionalAccess",t=>t.addEvent,"call",n=>n("inp",{[Yn]:"millisecond",[Kn]:t.value})]),mn([f,"optionalAccess",t=>t.end,"call",t=>t(o+i)])}),$i,gi);return()=>{t()}}return()=>{}}const ss={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 cs(t,n=function(t){const n=Qi[t];if(n)return n;let e=jo[t];if(dt(e))return Qi[t]=e.bind(jo);const r=jo.document;if(r&&"function"==typeof r.createElement)try{const n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n);const o=n.contentWindow;o&&o[t]&&(e=o[t]),r.head.removeChild(n)}catch(t){}return e?Qi[t]=e.bind(jo):e}("fetch")){let e=0,r=0;return Rr(t,(function(o){const i=o.body.length;e+=i,r++;const s={body:o.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:e<=6e4&&r<15,...t.fetchOptions};if(!n)return Zi("fetch"),qt("No fetch implementation available");try{return n(t.url,s).then((t=>(e-=i,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 Zi("fetch"),e-=i,r--,qt(t)}}))}function us(t,n,e,r){const o={filename:t,function:""===n?K:n,in_app:!0};return void 0!==e&&(o.lineno=e),void 0!==r&&(o.colno=r),o}const as=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,fs=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ds=/\((\S*)(?::(\d+))(?::(\d+))\)/,ls=[30,t=>{const n=as.exec(t);if(n){const[,t,e,r]=n;return us(t,K,+e,+r)}const e=fs.exec(t);if(e){if(e[2]&&0===e[2].indexOf("eval")){const t=ds.exec(e[2]);t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3])}const[t,n]=$s(e[1]||K,e[2]);return us(n,t,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],hs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ps=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ms=[50,t=>{const n=hs.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=ps.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],e=n[1]||K;return[e,t]=$s(e,t),us(t,e,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}}],gs=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ys=[40,t=>{const n=gs.exec(t);return n?us(n[2],n[1]||K,+n[3],n[4]?+n[4]:void 0):void 0}],vs=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,bs=[10,t=>{const n=vs.exec(t);return n?us(n[2],n[3]||K,+n[1]):void 0}],_s=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,ws=[20,t=>{const n=_s.exec(t);return n?us(n[5],n[3]||n[4]||K,+n[1],+n[2]):void 0}],Ss=[ls,ms],Es=Z(...Ss),$s=(t,n)=>{const e=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return e||r?[-1!==t.indexOf("@")?t.split("@")[0]:K,e?`safari-extension:${n}`:`safari-web-extension:${n}`]:[t,n]},Ts=1024,ks=(t={})=>{const n={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(t){var e;n.console&&function(t){const n="console";st(n,t),ct(n,at)}(function(t){return function(n){if(Un()!==t)return;const e={category:"console",data:{arguments:n.args,logger:"console"},level:zt(n.level),message:m(n.args," ")};if("assert"===n.level){if(!1!==n.args[0])return;e.message=`Assertion failed: ${m(n.args.slice(1)," ")||"console.assert"}`,e.data.arguments=n.args.slice(1)}Nr(e,{input:n.args,level:n.level})}}(t)),n.dom&&(e=function(t,n){return function(e){if(Un()!==t)return;let r,o,i="object"==typeof n?n.serializeAttribute:void 0,s="object"==typeof n&&"number"==typeof n.maxStringLength?n.maxStringLength:void 0;s&&s>Ts&&(s=Ts),"string"==typeof i&&(i=[i]);try{const t=e.event,n=function(t){return!!t&&!!t.target}(t)?t.target:t;r=x(n,{keyAttrs:i,maxStringLength:s}),o=j(n)}catch(t){r=""}if(0===r.length)return;const c={category:`ui.${e.name}`,message:r};o&&(c.data={"ui.component_name":o}),Nr(c,{event:e.event,name:e.name,global:e.global})}}(t,n.dom),st("dom",e),ct("dom",Ji)),n.xhr&&ns(function(t){return function(n){if(Un()!==t)return;const{startTimestamp:e,endTimestamp:r}=n,o=n.xhr[ts];if(!e||!r||!o)return;const{method:i,url:s,status_code:c,body:u}=o,a={method:i,url:s,status_code:c},f={xhr:n.xhr,input:u,startTimestamp:e,endTimestamp:r};Nr({category:"xhr",data:a,type:"http",level:S(c)},f)}}(t)),n.fetch&&yt(function(t){return function(n){if(Un()!==t)return;const{startTimestamp:e,endTimestamp:r}=n;if(r&&(!n.fetchData.url.match(/sentry_key/)||"POST"!==n.fetchData.method))if(n.error){Nr({category:"fetch",data:n.fetchData,level:"error",type:"http"},{data:n.error,input:n.args,startTimestamp:e,endTimestamp:r})}else{const t=n.response,o={...n.fetchData,status_code:t&&t.status},i={input:n.args,response:t,startTimestamp:e,endTimestamp:r};Nr({category:"fetch",data:o,type:"http",level:S(o.status_code)},i)}}}(t)),n.history&&Ki(function(t){return function(n){if(Un()!==t)return;let e=n.from,r=n.to;const o=Bt(ao.location.href);let i=e?Bt(e):void 0;const s=Bt(r);i&&i.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(e=i.relative),Nr({category:"navigation",data:{from:e,to:r}})}}(t)),n.sentry&&t.on("beforeSendEvent",function(t){return function(n){Un()===t&&Nr({category:"sentry."+("transaction"===n.type?"transaction":"event"),event_id:n.event_id,level:n.level,message:jt(n)},{event:n})}}(t))}}};const Is=["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"],xs=(t={})=>{const n={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){n.setTimeout&&q(ao,"setTimeout",As),n.setInterval&&q(ao,"setInterval",As),n.requestAnimationFrame&&q(ao,"requestAnimationFrame",js),n.XMLHttpRequest&&"XMLHttpRequest"in ao&&q(XMLHttpRequest.prototype,"send",Cs);const t=n.eventTarget;if(t){(Array.isArray(t)?t:Is).forEach(Os)}}}};function As(t){return function(...n){const e=n[0];return n[0]=ho(e,{mechanism:{data:{function:et(t)},handled:!1,type:"instrument"}}),t.apply(this,n)}}function js(t){return function(n){return t.apply(this,[ho(n,{mechanism:{data:{function:"requestAnimationFrame",handler:et(t)},handled:!1,type:"instrument"}})])}}function Cs(t){return function(...n){const e=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in e&&"function"==typeof e[t]&&q(e,t,(function(n){const e={mechanism:{data:{function:t,handler:et(n)},handled:!1,type:"instrument"}},r=B(n);return r&&(e.mechanism.data.handler=et(r)),ho(n,e)}))})),t.apply(this,n)}}function Os(t){const n=ao,e=n[t]&&n[t].prototype;e&&e.hasOwnProperty&&e.hasOwnProperty("addEventListener")&&(q(e,"addEventListener",(function(n){return function(e,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=ho(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:et(r),target:t},handled:!1,type:"instrument"}}))}catch(t){}return n.apply(this,[e,ho(r,{mechanism:{data:{function:"addEventListener",handler:et(r),target:t},handled:!1,type:"instrument"}}),o])}})),q(e,"removeEventListener",(function(t){return function(n,e,r){const o=e;try{const e=o&&o.__sentry_wrapped__;e&&t.call(this,n,e,r)}catch(t){}return t.call(this,n,o,r)}})))}const Ms=(t={})=>{const n={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){n.onerror&&function(t){Et((n=>{const{stackParser:e,attachStacktrace:r}=Rs();if(Un()!==t||lo())return;const{msg:o,url:i,line:c,column:u,error:a}=n,f=function(t,n,e,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],c=i[0]=i[0]||{},u=c.stacktrace=c.stacktrace||{},a=u.frames=u.frames||[],f=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(e,10))?void 0:e,l=s(n)&&n.length>0?n:function(){try{return k.document.location.href}catch(t){return""}}();0===a.length&&a.push({colno:f,filename:l,function:K,in_app:!0,lineno:d});return t}($o(e,a||o,void 0,r,!1),i,c,u);f.level="error",ar(f,{originalException:a,mechanism:{handled:!1,type:"onerror"}})}))}(t),n.onunhandledrejection&&function(t){kt((n=>{const{stackParser:e,attachStacktrace:r}=Rs();if(Un()!==t||lo())return;const o=function(t){if(u(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}(n),i=u(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:$o(e,o,void 0,r,!0);i.level="error",ar(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(t)}}};function Rs(){const t=Un();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Ps=()=>({name:"HttpContext",preprocessEvent(t){if(!ao.navigator&&!ao.location&&!ao.document)return;const n=t.request&&t.request.url||ao.location&&ao.location.href,{referrer:e}=ao.document||{},{userAgent:r}=ao.navigator||{},o={...t.request&&t.request.headers,...e&&{Referer:e},...r&&{"User-Agent":r}},i={...t.request,...n&&{url:n},headers:o};t.request=i}}),Ls=(t={})=>{const n=t.limit||5,e=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(t,r,o){const i=o.getOptions();v(po,i.stackParser,i.maxValueLength,e,n,t,r)}}};function Ns(t){return[Hr(),qr(),xs(),ks(),Ms(),Ls(),Wr(),Ps()]}const Ds={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",debugIntegration:"debug",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",sessionTimingIntegration:"sessiontiming",browserProfilingIntegration:"browserprofiling"},Fs=ao;const qs={increment:function(t,n=1,e){Qr.increment(io,t,n,e)},distribution:function(t,n,e){Qr.distribution(io,t,n,e)},set:function(t,n,e){Qr.set(io,t,n,e)},gauge:function(t,n,e){Qr.gauge(io,t,n,e)},timing:function(t,n,e="second",r){return Qr.timing(io,t,n,e,r)}};const Us=new WeakMap,Hs=new Map,Bs={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Ws(t,n){const{traceFetch:e,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:i,enableHTTPTimings:s,tracePropagationTargets:c}={traceFetch:Bs.traceFetch,traceXHR:Bs.traceXHR,trackFetchStreamPerformance:Bs.trackFetchStreamPerformance,...n},u="function"==typeof i?i:t=>!0,a=t=>function(t,n){const e=ao.location&&ao.location.href;if(e){let r,o;try{r=new URL(t,e),o=new URL(e).origin}catch(t){return!1}const i=r.origin===o;return n?y(r.toString(),n)||i&&y(r.pathname,n):i}{const e=!!t.match(/^\/(?!\/)/);return n?y(t,n):e}}(t,c),f={};e&&(t.addEventProcessor((t=>("transaction"===t.type&&t.spans&&t.spans.forEach((t=>{if("http.client"===t.op){const n=Hs.get(t.span_id);n&&(t.timestamp=n/1e3,Hs.delete(t.span_id))}})),t))),o&&function(t){const n="fetch-body-resolved";st(n,t),ct(n,(()=>vt(bt)))}((t=>{if(t.response){const n=Us.get(t.response);n&&t.endTimestamp&&Hs.set(n,t.endTimestamp)}})),yt((t=>{const n=so(t,u,a,f);if(t.response&&t.fetchData.__span&&Us.set(t.response,t.fetchData.__span),n){const e=Gs(t.fetchData.url),r=e?Bt(e).host:void 0;n.setAttributes({"http.url":e,"server.address":r})}s&&n&&zs(n)}))),r&&ns((t=>{const n=function(t,n,e,r){const o=t.xhr,i=o&&o[ts];if(!o||o.__sentry_own_request__||!i)return;const s=$e()&&n(i.url);if(t.endTimestamp&&s){const t=o.__sentry_xhr_span_id__;if(!t)return;const n=r[t];return void(n&&void 0!==i.status_code&&(ne(n,i.status_code),n.end(),delete r[t]))}const c=Gs(i.url),u=c?Bt(c).host:void 0,a=!!ge(),f=s&&a?Ue({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":c,url:i.url,"server.address":u,[Gn]:"auto.http.browser",[Xn]:"http.client"}}):new Te;o.__sentry_xhr_span_id__=f.spanContext().spanId,r[o.__sentry_xhr_span_id__]=f;const d=Un();o.setRequestHeader&&e(i.url)&&d&&function(t,n,e){const r=Nn(),o=Dn(),{traceId:i,spanId:s,sampled:c,dsc:u}={...o.getPropagationContext(),...r.getPropagationContext()},a=e&&$e()?ie(e):nn(i,s,c),f=Vt(u||(e?Ce(e):je(i,n)));!function(t,n,e){try{t.setRequestHeader("sentry-trace",n),e&&t.setRequestHeader(Xt,e)}catch(t){}}(t,a,f)}(o,d,$e()&&a?f:void 0);return f}(t,u,a,f);s&&n&&zs(n)}))}function zs(t){const{url:n}=ue(t).data||{};if(!n||"string"!=typeof n)return;const e=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(n)){(function(t){const{name:n,version:e}=function(t){let n="unknown",e="unknown",r="";for(const o of t){if("/"===o){[n,e]=t.split("/");break}if(!isNaN(Number(o))){n="h"===r?"http":r,e=t.split(r)[1];break}r+=o}r===t&&(n=r);return{name:n,version:e}}(t.nextHopProtocol),r=[];if(r.push(["network.protocol.version",e],["network.protocol.name",n]),!gt)return r;return[...r,["http.request.redirect_start",Xs(t.redirectStart)],["http.request.fetch_start",Xs(t.fetchStart)],["http.request.domain_lookup_start",Xs(t.domainLookupStart)],["http.request.domain_lookup_end",Xs(t.domainLookupEnd)],["http.request.connect_start",Xs(t.connectStart)],["http.request.secure_connection_start",Xs(t.secureConnectionStart)],["http.request.connection_end",Xs(t.connectEnd)],["http.request.request_start",Xs(t.requestStart)],["http.request.response_start",Xs(t.responseStart)],["http.request.response_end",Xs(t.responseEnd)]]})(r).forEach((n=>t.setAttribute(...n))),setTimeout(e)}}))}))}function Xs(t=0){return((gt||performance.timeOrigin)+t)/1e3}function Gs(t){try{return new URL(t,ao.location.origin).href}catch(t){return}}const Js={...Ye,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...Bs};function Ys(t,n,e){t.emit("startPageLoadSpan",n,e),Nn().setTransactionName(n.name);const r=ge();return"pageload"===(r&&ue(r).op)?r:void 0}function Ks(t,n){Dn().setPropagationContext(gn()),Nn().setPropagationContext(gn()),t.emit("startNavigationSpan",n),Nn().setTransactionName(n.name);const e=ge();return"navigation"===(e&&ue(e).op)?e:void 0}function Vs(t){const n=(e=`meta[name=${t}]`,k.document&&k.document.querySelector?k.document.querySelector(e):null);var e;return n?n.getAttribute("content"):void 0}return be(),t.BrowserClient=xo,t.SDK_VERSION=E,t.SEMANTIC_ATTRIBUTE_SENTRY_OP=Xn,t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN=Gn,t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=zn,t.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE=Wn,t.Scope=jn,t.WINDOW=ao,t.addBreadcrumb=Nr,t.addEventProcessor=function(t){Dn().addEventProcessor(t)},t.addIntegration=function(t){const n=Un();n&&n.addIntegration(t)},t.breadcrumbsIntegration=ks,t.browserApiErrorsIntegration=xs,t.browserTracingIntegration=(t={})=>{be();const{enableInp:n,enableLongTask:e,enableLongAnimationFrame:r,_experiments:{enableInteractions:o,enableStandaloneClsSpans:i},beforeStartSpan:s,idleTimeout:c,finalTimeout:u,childSpanTimeout:a,markBackgroundSpan:f,traceFetch:d,traceXHR:l,trackFetchStreamPerformance:h,shouldCreateSpanForRequest:p,enableHTTPTimings:m,instrumentPageLoad:g,instrumentNavigation:y}={...Js,...t},v=Fi({recordClsStandaloneSpans:i||!1});n&&is(),r&&$.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?new PerformanceObserver((t=>{if(ge())for(const n of t.getEntries()){if(!n.scripts[0])continue;const t=Oi(gt+n.startTime),e=Oi(n.duration),r={[Gn]:"auto.ui.browser.metrics"},o=n.scripts[0],{invoker:i,invokerType:s,sourceURL:c,sourceFunctionName:u,sourceCharPosition:a}=o;r["browser.script.invoker"]=i,r["browser.script.invoker_type"]=s,c&&(r["code.filepath"]=c),u&&(r["code.function"]=u),-1!==a&&(r["browser.script.source_char_position"]=a);const f=Ue({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:t,attributes:r});f&&f.end(t+e)}})).observe({type:"long-animation-frame",buffered:!0}):e&&vi("longtask",(({entries:t})=>{if(ge())for(const n of t){const t=Oi(gt+n.startTime),e=Oi(n.duration),r=Ue({name:"Main UI thread blocked",op:"ui.long-task",startTime:t,attributes:{[Gn]:"auto.ui.browser.metrics"}});r&&r.end(t+e)}})),o&&vi("event",(({entries:t})=>{if(ge())for(const n of t)if("click"===n.name){const t=Oi(gt+n.startTime),e=Oi(n.duration),r={name:x(n.target),op:`ui.interaction.${n.name}`,startTime:t,attributes:{[Gn]:"auto.ui.browser.metrics"}},o=j(n.target);o&&(r.attributes["ui.component_name"]=o);const i=Ue(r);i&&i.end(t+e)}}));const b={name:void 0,source:void 0};function _(t,n){const e="pageload"===n.op,r=s?s(n):n,o=r.attributes||{};n.name!==r.name&&(o[Wn]="custom",r.attributes=o),b.name=r.name,b.source=o[Wn];const f=tr(r,{idleTimeout:c,finalTimeout:u,childSpanTimeout:a,disableAutoFinish:e,beforeSpanEnd:t=>{v(),qi(t,{recordClsOnPageloadSpan:!i})}});function d(){["interactive","complete"].includes(ao.document.readyState)&&t.emit("idleSpanEnableAutoFinish",f)}return e&&ao.document&&(ao.document.addEventListener("readystatechange",(()=>{d()})),d()),f}return{name:"BrowserTracing",afterAllSetup(t){let e,r=ao.location&&ao.location.href;t.on("startNavigationSpan",(n=>{Un()===t&&(e&&!ue(e).timestamp&&e.end(),e=_(t,{op:"navigation",...n}))})),t.on("startPageLoadSpan",((n,r={})=>{if(Un()!==t)return;e&&!ue(e).timestamp&&e.end();const o=tn(r.sentryTrace||Vs("sentry-trace"),r.baggage||Vs("baggage"));Nn().setPropagationContext(o),e=_(t,{op:"pageload",...n})})),t.on("spanEnd",(t=>{const n=ue(t).op;if(t!==me(t)||"navigation"!==n&&"pageload"!==n)return;const e=Nn(),r=e.getPropagationContext();e.setPropagationContext({...r,sampled:void 0!==r.sampled?r.sampled:ae(t),dsc:r.dsc||Ce(t)})})),ao.location&&(g&&Ys(t,{name:ao.location.pathname,startTime:gt?gt/1e3:void 0,attributes:{[Wn]:"url",[Gn]:"auto.pageload.browser"}}),y&&Ki((({to:n,from:e})=>{void 0===e&&r&&-1!==r.indexOf(n)?r=void 0:e!==n&&(r=void 0,Ks(t,{name:ao.location.pathname,attributes:{[Wn]:"url",[Gn]:"auto.navigation.browser"}}))}))),f&&ao&&ao.document&&ao.document.addEventListener("visibilitychange",(()=>{const t=ge();if(!t)return;const n=me(t);if(ao.document.hidden&&n){const t="cancelled",{op:e,status:r}=ue(n);r||n.setStatus({code:te,message:t}),n.setAttribute("sentry.cancellation_reason","document.hidden"),n.end()}})),o&&function(t,n,e,r){let o;const i=()=>{const i="ui.action.click",s=ge(),c=s&&me(s);if(c){const t=ue(c).op;if(["navigation","pageload"].includes(t))return}o&&(o.setAttribute(Jn,"interactionInterrupted"),o.end(),o=void 0),r.name&&(o=tr({name:r.name,op:i,attributes:{[Wn]:r.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:e}))};ao.document&&addEventListener("click",i,{once:!1,capture:!0})}(c,u,a,b),n&&function(t){const n=({entries:t})=>{const n=ge(),e=n&&me(n);t.forEach((t=>{if(!function(t){return"duration"in t}(t)||!e)return;const n=t.interactionId;if(null!=n&&!os.has(n)){if(rs.length>10){const t=rs.shift();os.delete(t)}rs.push(n),os.set(n,e)}}))};vi("event",n),vi("first-input",n)}(),Ws(t,{traceFetch:d,traceXHR:l,trackFetchStreamPerformance:h,tracePropagationTargets:t.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:p,enableHTTPTimings:m})}}},t.captureEvent=ar,t.captureException=captureException,t.captureMessage=function(t,n){const e="string"==typeof n?n:void 0,r="string"!=typeof n?{captureContext:n}:void 0;return Nn().captureMessage(t,e,r)},t.captureSession=_r,t.captureUserFeedback=function(t){const n=Un();n&&n.captureUserFeedback(t)},t.chromeStackLineParser=ls,t.close=async function(t){const n=Un();return n?n.close(t):Promise.resolve(!1)},t.continueTrace=({sentryTrace:t,baggage:n},e)=>qn((r=>{const o=tn(t,n);return r.setPropagationContext(o),e()})),t.createTransport=Rr,t.createUserFeedbackEnvelope=Io,t.dedupeIntegration=Wr,t.defaultStackLineParsers=Ss,t.defaultStackParser=Es,t.endSession=vr,t.eventFromException=So,t.eventFromMessage=Eo,t.exceptionFromError=po,t.feedbackAsyncIntegration=_n,t.feedbackIntegration=_n,t.flush=async function(t){const n=Un();return n?n.flush(t):Promise.resolve(!1)},t.forceLoad=function(){},t.functionToStringIntegration=qr,t.geckoStackLineParser=ms,t.getActiveSpan=ge,t.getClient=Un,t.getCurrentHub=uo,t.getCurrentScope=Nn,t.getDefaultIntegrations=Ns,t.getGlobalScope=Fn,t.getIsolationScope=Dn,t.getRootSpan=me,t.getSpanDescendants=pe,t.globalHandlersIntegration=Ms,t.httpContextIntegration=Ps,t.inboundFiltersIntegration=Hr,t.init=function(t={}){const n=function(t={}){const n={defaultIntegrations:Ns(),release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:ao.SENTRY_RELEASE&&ao.SENTRY_RELEASE.id?ao.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return null==t.defaultIntegrations&&delete t.defaultIntegrations,{...n,...t}}(t);if(function(){const t=void 0!==ao.window&&ao;if(!t)return!1;const n=t[t.chrome?"chrome":"browser"],e=n&&n.runtime&&n.runtime.id,r=ao.location&&ao.location.href||"",o=!!e&&ao===ao.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((t=>r.startsWith(`${t}//`))),i=void 0!==t.nw;return!!e&&!o&&!i}())return void M((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}));const e={...n,stackParser:(r=n.stackParser||Es,Array.isArray(r)?Z(...r):r),integrations:kr(n),transport:n.transport||cs};var r;const o=function(t,n){!0===n.debug&&M((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Nn().update(n.initialScope);const e=new t(n);return Or(e),e.init(),e}(xo,e);return n.autoSessionTracking&&function(){if(void 0===ao.document)return;yr({ignoreDuration:!0}),_r(),Ki((({from:t,to:n})=>{void 0!==t&&t!==n&&(yr({ignoreDuration:!0}),_r())}))}(),o},t.isInitialized=function(){return!!Un()},t.lastEventId=gr,t.lazyLoadIntegration=async function(t,n){const e=Ds[t],r=Fs.Sentry=Fs.Sentry||{};if(!e)throw new Error(`Cannot lazy load integration: ${t}`);const o=r[t];if("function"==typeof o&&!("_isShim"in o))return o;const i=function(t){const n=Un(),e=n&&n.getOptions(),r=e&&e.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${E}/${t}.min.js`,r).toString()}(e),s=ao.document.createElement("script");s.src=i,s.crossOrigin="anonymous",s.referrerPolicy="origin",n&&s.setAttribute("nonce",n);const c=new Promise(((t,n)=>{s.addEventListener("load",(()=>t())),s.addEventListener("error",n)})),u=ao.document.currentScript,a=ao.document.body||ao.document.head||u&&u.parentElement;if(!a)throw new Error(`Could not find parent element to insert lazy-loaded ${t} script`);a.appendChild(s);try{await c}catch(n){throw new Error(`Error when loading integration: ${t}`)}const f=r[t];if("function"!=typeof f)throw new Error(`Could not load integration: ${t}`);return f},t.linkedErrorsIntegration=Ls,t.makeFetchTransport=cs,t.metrics=qs,t.onLoad=function(t){t()},t.opera10StackLineParser=bs,t.opera11StackLineParser=ws,t.parameterize=function(t,...n){const e=new String(String.raw(t,...n));return e.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),e.__sentry_template_values__=n,e},t.replayIntegration=function(t){return M((()=>{console.warn("You are using replayIntegration() even though this bundle does not include replay.")})),{name:"Replay",...wn.reduce(((t,n)=>(t[n]=vn,t)),{})}},t.setContext=fr,t.setCurrentClient=Or,t.setExtra=lr,t.setExtras=dr,t.setMeasurement=Re,t.setTag=pr,t.setTags=hr,t.setUser=mr,t.showReportDialog=function(t={}){if(!ao.document)return;const n=Nn(),e=n.getClient(),r=e&&e.getDsn();if(!r)return;if(n&&(t.user={...n.getUser(),...t.user}),!t.eventId){const n=gr();n&&(t.eventId=n)}const o=ao.document.createElement("script");o.async=!0,o.crossOrigin="anonymous",o.src=function(t,n){const e=D(t);if(!e)return"";const r=`${Sr(e)}embed/error-page/`;let o=`dsn=${L(e)}`;for(const t in n)if("dsn"!==t&&"onClose"!==t)if("user"===t){const t=n.user;if(!t)continue;t.name&&(o+=`&name=${encodeURIComponent(t.name)}`),t.email&&(o+=`&email=${encodeURIComponent(t.email)}`)}else o+=`&${encodeURIComponent(t)}=${encodeURIComponent(n[t])}`;return`${r}?${o}`}(r,t),t.onLoad&&(o.onload=t.onLoad);const{onClose:i}=t;if(i){const t=n=>{if("__sentry_reportdialog_closed__"===n.data)try{i()}finally{ao.removeEventListener("message",t)}};ao.addEventListener("message",t)}const s=ao.document.head||ao.document.body;s&&s.appendChild(o)},t.spanToBaggageHeader=function(t){return Vt(Ce(t))},t.spanToJSON=ue,t.spanToTraceHeader=ie,t.startBrowserTracingNavigationSpan=Ks,t.startBrowserTracingPageLoadSpan=Ys,t.startInactiveSpan=Ue,t.startNewTrace=function(t){return qn((n=>(n.setPropagationContext(gn()),He(null,t))))},t.startSession=yr,t.startSpan=function(t,n){const e=ze();if(e.startSpan)return e.startSpan(t,n);const r=We(t),{forceTransaction:o,parentSpan:i}=t;return qn(t.scope,(()=>Je(i)((()=>{const e=Nn(),i=Ge(e),s=t.onlyIfParent&&!i?new Te:Be({parentSpan:i,spanArguments:r,forceTransaction:o,scope:e});return In(e,s),ke((()=>n(s)),(()=>{const{status:t}=ue(s);!s.isRecording()||t&&"ok"!==t||s.setStatus({code:te,message:"internal_error"})}),(()=>s.end()))}))))},t.startSpanManual=qe,t.suppressTracing=function(t){const n=ze();return n.suppressTracing?n.suppressTracing(t):qn((n=>(n.setSDKProcessingMetadata({[Fe]:!0}),t())))},t.winjsStackLineParser=ys,t.withActiveSpan=He,t.withIsolationScope=function(...t){const n=Ln(Sn());if(2===t.length){const[e,r]=t;return e?n.withSetIsolationScope(e,r):n.withIsolationScope(r)}return n.withIsolationScope(t[0])},t.withScope=qn,t}({}); +//# sourceMappingURL=bundle.tracing.min.js.map diff --git a/apollo/pwa/templates/pwa/index.html b/apollo/pwa/templates/pwa/index.html index 1c48f1e6a..be48d1b65 100644 --- a/apollo/pwa/templates/pwa/index.html +++ b/apollo/pwa/templates/pwa/index.html @@ -289,7 +289,7 @@
{% if trace_errors %} - + {% endif %} diff --git a/apollo/pwa/views_pwa.py b/apollo/pwa/views_pwa.py index 9ce957f4f..6ff99cd19 100644 --- a/apollo/pwa/views_pwa.py +++ b/apollo/pwa/views_pwa.py @@ -13,7 +13,7 @@ def index(): """Index view for the PWA.""" commit = current_app.config["COMMIT"] or current_app.config["VERSION"] - trace_errors = current_app.config["DEBUG"] + trace_errors = current_app.config["SENTRY_CAPTURE_FRONTEND"] sentry_dsn = current_app.config["SENTRY_DSN"] or "" context = {"commit": commit, "trace_errors": trace_errors} diff --git a/apollo/settings.py b/apollo/settings.py index fb90bdbbf..2acf6ee88 100644 --- a/apollo/settings.py +++ b/apollo/settings.py @@ -60,6 +60,7 @@ SENTRY_DSN = config("SENTRY_DSN", default=None) SENTRY_USER_ATTRS = ["email"] +SENTRY_CAPTURE_FRONTEND = config("SENTRY_CAPTURE_FRONTEND", cast=config.boolean, default=False) MAIL_SERVER = config("MAIL_SERVER", default=None) MAIL_PORT = config("MAIL_PORT", default=None) From a32a8675e766a6f8f133bfa32df4a74cc7940d31 Mon Sep 17 00:00:00 2001 From: Odumosu Dipo Date: Wed, 23 Oct 2024 17:41:23 +0100 Subject: [PATCH 2/2] chore: add debug logging --- apollo/api/hooks.py | 4 ++++ apollo/submissions/api/views.py | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apollo/api/hooks.py b/apollo/api/hooks.py index e12e62617..247dd8b8e 100644 --- a/apollo/api/hooks.py +++ b/apollo/api/hooks.py @@ -3,6 +3,7 @@ from flask import jsonify from flask_babel import gettext as _ +from loguru import logger from apollo.core import red @@ -12,6 +13,7 @@ def process_expired_token(jwt_header, jwt_payload): 'status': _('error'), 'message': _('Token has expired') }) + logger.debug(response) response.status_code = HTTPStatus.UNAUTHORIZED return response @@ -21,6 +23,7 @@ def process_invalid_token(reason): 'status': _('error'), 'message': _(reason) }) + logger.debug(response) response.status_code = HTTPStatus.UNPROCESSABLE_ENTITY return response @@ -30,6 +33,7 @@ def process_revoked_token(jwt_header, jwt_payload): 'status': _('error'), 'message': _('Token has been revoked') }) + logger.debug(response) response.status_code = HTTPStatus.UNAUTHORIZED return response diff --git a/apollo/submissions/api/views.py b/apollo/submissions/api/views.py index e1f878c06..b6b409528 100644 --- a/apollo/submissions/api/views.py +++ b/apollo/submissions/api/views.py @@ -10,6 +10,7 @@ from flask_babel import gettext from flask_jwt_extended import get_jwt_identity, jwt_required from flask_security.decorators import login_required +from loguru import logger from marshmallow import ValidationError from slugify import slugify from sqlalchemy.exc import ProgrammingError @@ -140,6 +141,7 @@ def checklist_qa_status(uuid): 'status': 'error' } + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -152,7 +154,7 @@ def checklist_qa_status(uuid): 'message': gettext('Invalid checklist'), 'status': 'error' } - + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -182,7 +184,7 @@ def submission(): 'message': gettext('Invalid data sent'), 'status': 'error' } - + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -198,7 +200,7 @@ def submission(): 'message': gettext('Invalid form'), 'status': 'error' } - + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -210,7 +212,7 @@ def submission(): 'message': gettext('Invalid participant'), 'status': 'error' } - + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -221,7 +223,7 @@ def submission(): 'message': gettext('Invalid participant'), 'status': 'error' } - + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -238,7 +240,7 @@ def submission(): 'status': 'error', 'errorFields': error_fields, } - + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -294,6 +296,7 @@ def submission(): 'message': gettext('Could not update data. Please check your ID'), 'status': 'error' } + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.BAD_REQUEST return response @@ -435,6 +438,7 @@ def submission(): def get_image_manifest(**kwargs): if not permissions.export_submissions.can(): response_body = {'images': [], 'status': 'error'} + logger.debug(response_body) response = jsonify(response_body) response.status_code = HTTPStatus.FORBIDDEN return response @@ -496,6 +500,7 @@ def _generate_filename(attachment: SubmissionImageAttachment, tag=None): 'images': [], 'status': 'error', }) + logger.debug(response_body) response.status_code = HTTPStatus.UNPROCESSABLE_ENTITY return response