2026-07-25 08:10:48 +00:00
// Module ID: 6366
2026-07-27 11:26:19 +00:00
// Function ID: 57252
2026-07-20 16:05:17 +00:00
// Name: isErrorEvent
2026-07-25 08:10:48 +00:00
// Dependencies: [57, 6, 7, 6358, 6339, 6311, 6365, 6322, 6318, 6334, 6335, 6367, 6354, 6355, 6338, 6360, 6347, 6368, 6351, 6369, 6316]
2026-07-23 10:11:24 +00:00
2026-07-25 08:10:48 +00:00
// Module 6366 (isErrorEvent)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray" ;
import _classCallCheck from "getBaseApiEndpoint" ;
import _defineProperties from "getFirstException" ;
2026-07-20 16:05:17 +00:00
function isErrorEvent ( type ) {
return undefined === type . type ;
}
function isTransactionEvent ( type ) {
return "transaction" === type . type ;
}
2026-07-23 10:11:24 +00:00
export const BaseClient = ( ( ) => {
2026-07-20 16:05:17 +00:00
class BaseClient {
constructor ( arg0 ) {
self = this ;
2026-07-23 10:11:24 +00:00
closure _0 = arg0 ;
tmp = outer1 _3 ( this , closure _0 ) ;
2026-07-20 16:05:17 +00:00
this . _options = arg0 ;
this . _integrations = { } ;
this . _numProcessing = 0 ;
this . _outcomes = { } ;
this . _hooks = { } ;
this . _eventProcessors = [ ] ;
tmp2 = BaseClient ;
2026-07-23 10:11:24 +00:00
tmp3 = outer1 _1 ;
2026-07-20 16:05:17 +00:00
if ( arg0 . dsn ) {
num3 = 3 ;
tmp2Result = tmp2 ( tmp3 [ 3 ] ) ;
self . _dsn = tmp2Result . makeDsn ( arg0 . dsn ) ;
} else {
num = 4 ;
if ( tmp2 ( tmp3 [ 4 ] ) . DEBUG _BUILD ) {
tmp4 = BaseClient ;
2026-07-23 10:11:24 +00:00
tmp5 = outer1 _1 ;
2026-07-20 16:05:17 +00:00
num2 = 5 ;
2026-07-23 10:11:24 +00:00
logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
str = "No DSN provided, client will not send events." ;
warnResult = logger . warn ( "No DSN provided, client will not send events." ) ;
}
}
if ( self . _dsn ) {
tmp7 = BaseClient ;
2026-07-23 10:11:24 +00:00
tmp8 = outer1 _1 ;
2026-07-20 16:05:17 +00:00
num4 = 6 ;
2026-07-23 10:11:24 +00:00
obj2 = BaseClient ( outer1 _1 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
sdk = undefined ;
if ( arg0 . _metadata ) {
sdk = arg0 . _metadata . sdk ;
}
tmp11 = globalThis ;
_Object = Object ;
obj = { } ;
obj . tunnel = self . _options . tunnel ;
recordDroppedEvent = self . recordDroppedEvent ;
envelopeEndpointWithUrlEncodedAuth = obj2 . getEnvelopeEndpointWithUrlEncodedAuth ( self . _dsn , arg0 . tunnel , sdk ) ;
obj . recordDroppedEvent = recordDroppedEvent . bind ( self ) ;
obj1 = { } ;
obj1 . url = envelopeEndpointWithUrlEncodedAuth ;
self . _transport = arg0 . transport ( Object . assign ( obj , arg0 . transportOptions , obj1 ) ) ;
}
2026-07-23 10:11:24 +00:00
items = [ "enableTracing" , "tracesSampleRate" , "tracesSampler" ] ;
2026-07-20 16:05:17 +00:00
found = items . find ( ( arg0 ) => {
2026-07-23 10:11:24 +00:00
let tmp = arg0 in table ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = null == table [ arg0 ] ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ) ;
2026-07-27 11:26:19 +00:00
f57257 = found ;
2026-07-20 16:05:17 +00:00
if ( found ) {
tmp13 = BaseClient ;
2026-07-23 10:11:24 +00:00
tmp14 = outer1 _1 ;
2026-07-20 16:05:17 +00:00
num5 = 5 ;
2026-07-23 10:11:24 +00:00
obj5 = BaseClient ( outer1 _1 [ 5 ] ) ;
2026-07-20 16:05:17 +00:00
consoleSandboxResult = obj5 . consoleSandbox ( ( ) => {
console . warn ( "[Sentry] Deprecation warning: `" + found + "` is set to undefined, which leads to tracing being enabled. In v9, a value of `undefined` will result in tracing being disabled." ) ;
} ) ;
}
return ;
}
}
let obj = {
key : "captureException" ,
value : function captureException ( arg0 , arg1 , arg2 ) {
let self = this ;
2026-07-23 10:11:24 +00:00
let closure _0 = arg2 ;
2026-07-20 16:05:17 +00:00
self = this ;
2026-07-23 10:11:24 +00:00
let obj = BaseClient ( outer1 _1 [ 7 ] ) ;
2026-07-20 16:05:17 +00:00
const uuid4Result = obj . uuid4 ( ) ;
if ( obj2 . checkOrSetAlreadyCaught ( arg0 ) ) {
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . log ( "Not capturing exception because it's already been captured." ) ;
}
return uuid4Result ;
} else {
const _Object = Object ;
obj = { event _id : uuid4Result } ;
const merged = Object . assign ( obj , arg1 ) ;
2026-07-23 10:11:24 +00:00
self . _process ( self . eventFromException ( arg0 , merged ) . then ( ( arg0 ) => self . _captureEvent ( arg0 , merged , closure _0 ) ) ) ;
2026-07-20 16:05:17 +00:00
return merged . event _id ;
}
2026-07-23 10:11:24 +00:00
obj2 = BaseClient ( outer1 _1 [ 7 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "captureMessage" ,
value : function captureMessage ( arg0 , arg1 , arg2 , arg3 ) {
let self = this ;
2026-07-23 10:11:24 +00:00
let closure _0 = arg3 ;
2026-07-20 16:05:17 +00:00
self = this ;
2026-07-23 10:11:24 +00:00
const obj = { event _id : BaseClient ( outer1 _1 [ 7 ] ) . uuid4 ( ) } ;
2026-07-20 16:05:17 +00:00
const merged = Object . assign ( obj , arg2 ) ;
2026-07-23 10:11:24 +00:00
const obj2 = BaseClient ( outer1 _1 [ 7 ] ) ;
2026-07-20 16:05:17 +00:00
let StringResult = arg0 ;
if ( ! obj3 . isParameterizedString ( arg0 ) ) {
const _String = String ;
StringResult = String ( arg0 ) ;
}
2026-07-23 10:11:24 +00:00
obj3 = BaseClient ( outer1 _1 [ 8 ] ) ;
2026-07-20 16:05:17 +00:00
if ( obj4 . isPrimitive ( arg0 ) ) {
let eventFromMessageResult = self . eventFromMessage ( StringResult , arg1 , merged ) ;
} else {
eventFromMessageResult = self . eventFromException ( arg0 , merged ) ;
}
2026-07-23 10:11:24 +00:00
self . _process ( eventFromMessageResult . then ( ( arg0 ) => self . _captureEvent ( arg0 , merged , closure _0 ) ) ) ;
2026-07-20 16:05:17 +00:00
return merged . event _id ;
}
} ;
items [ 1 ] = obj ;
obj = {
key : "captureEvent" ,
value : function captureEvent ( sdkProcessingMetadata , originalException ) {
let _captureEvent ;
let _process ;
const self = this ;
2026-07-23 10:11:24 +00:00
const uuid4Result = BaseClient ( outer1 _1 [ 7 ] ) . uuid4 ( ) ;
2026-07-20 16:05:17 +00:00
if ( originalException ) {
if ( originalException . originalException ) {
if ( obj2 . checkOrSetAlreadyCaught ( originalException . originalException ) ) {
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . log ( "Not capturing exception because it's already been captured." ) ;
}
return uuid4Result ;
}
2026-07-23 10:11:24 +00:00
obj2 = BaseClient ( outer1 _1 [ 7 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
const merged = Object . assign ( { event _id : uuid4Result } , originalException ) ;
let capturedSpanScope = sdkProcessingMetadata . sdkProcessingMetadata || { } . capturedSpanScope ;
( { _process , _captureEvent } = self ) ;
if ( ! capturedSpanScope ) {
capturedSpanScope = arg2 ;
}
_process ( _captureEvent ( sdkProcessingMetadata , merged , capturedSpanScope ) ) ;
return merged . event _id ;
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "captureSession" ,
value : function captureSession ( release ) {
const self = this ;
if ( "string" !== typeof release . release ) {
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . warn ( "Discarded session because of missing or non-string release" ) ;
}
} else {
self . sendSession ( release ) ;
2026-07-23 10:11:24 +00:00
let obj = BaseClient ( outer1 _1 [ 9 ] ) ;
2026-07-20 16:05:17 +00:00
obj = { init : false } ;
obj . updateSession ( release , obj ) ;
}
}
} ;
items [ 4 ] = {
key : "getDsn" ,
value : function getDsn ( ) {
return this . _dsn ;
}
} ;
items [ 5 ] = {
key : "getOptions" ,
value : function getOptions ( ) {
return this . _options ;
}
} ;
items [ 6 ] = {
key : "getSdkMetadata" ,
value : function getSdkMetadata ( ) {
return this . _options . _metadata ;
}
} ;
items [ 7 ] = {
key : "getTransport" ,
value : function getTransport ( ) {
return this . _transport ;
}
} ;
items [ 8 ] = {
key : "flush" ,
value : function flush ( arg0 ) {
const self = this ;
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
2026-07-20 16:05:17 +00:00
const _transport = this . _transport ;
if ( _transport ) {
self . emit ( "flush" ) ;
const result = self . _isClientDoneProcessing ( arg0 ) ;
2026-07-23 10:11:24 +00:00
let nextPromise = result . then ( ( arg0 ) => {
let closure _0 = arg0 ;
return _transport . flush ( closure _0 ) . then ( ( arg0 ) => {
let tmp = closure _0 ;
if ( closure _0 ) {
tmp = arg0 ;
}
return tmp ;
} ) ;
} ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
nextPromise = BaseClient ( outer1 _1 [ 10 ] ) . resolvedSyncPromise ( true ) ;
const obj = BaseClient ( outer1 _1 [ 10 ] ) ;
2026-07-20 16:05:17 +00:00
}
return nextPromise ;
}
} ;
items [ 9 ] = {
key : "close" ,
value : function close ( arg0 ) {
2026-07-23 10:11:24 +00:00
const self = this ;
2026-07-20 16:05:17 +00:00
return this . flush ( arg0 ) . then ( ( arg0 ) => {
self . getOptions ( ) . enabled = false ;
self . emit ( "close" ) ;
return arg0 ;
} ) ;
}
} ;
items [ 10 ] = {
key : "getEventProcessors" ,
value : function getEventProcessors ( ) {
return this . _eventProcessors ;
}
} ;
items [ 11 ] = {
key : "addEventProcessor" ,
value : function addEventProcessor ( arg0 ) {
const _eventProcessors = this . _eventProcessors ;
_eventProcessors . push ( arg0 ) ;
}
} ;
items [ 12 ] = {
key : "init" ,
value : function init ( ) {
const self = this ;
let _isEnabledResult = this . _isEnabled ( ) ;
if ( ! _isEnabledResult ) {
const integrations = self . _options . integrations ;
_isEnabledResult = integrations . some ( ( name ) => {
name = name . name ;
return name . startsWith ( "Spotlight" ) ;
} ) ;
}
if ( _isEnabledResult ) {
self . _setupIntegrations ( ) ;
}
}
} ;
items [ 13 ] = {
key : "getIntegrationByName" ,
value : function getIntegrationByName ( arg0 ) {
return this . _integrations [ arg0 ] ;
}
} ;
items [ 14 ] = {
key : "addIntegration" ,
value : function addIntegration ( arg0 ) {
2026-07-23 10:11:24 +00:00
BaseClient ( outer1 _1 [ 11 ] ) . setupIntegration ( this , arg0 , this . _integrations ) ;
2026-07-20 16:05:17 +00:00
if ( ! this . _integrations [ arg0 . name ] ) {
const items = [ arg0 ] ;
2026-07-23 10:11:24 +00:00
const result = BaseClient ( outer1 _1 [ 11 ] ) . afterSetupIntegrations ( this , items ) ;
const obj2 = BaseClient ( outer1 _1 [ 11 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
items [ 15 ] = {
key : "sendEvent" ,
value : function sendEvent ( arg0 ) {
let self = this ;
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
2026-07-20 16:05:17 +00:00
self = this ;
if ( arguments . length > 1 ) {
if ( undefined !== arguments [ 1 ] ) {
let obj = arguments [ 1 ] ;
}
self . emit ( "beforeSendEvent" , arg0 , obj ) ;
2026-07-23 10:11:24 +00:00
const obj2 = BaseClient ( outer1 _1 [ 12 ] ) ;
2026-07-20 16:05:17 +00:00
let eventEnvelope = obj2 . createEventEnvelope ( arg0 , self . _dsn , self . _options . _metadata , self . _options . tunnel ) ;
const tmp7 = obj . attachments || [ ] ;
const tmp9 = tmp7 [ Symbol . iterator ] ( ) ;
while ( tmp9 !== undefined ) {
let tmp12 = BaseClient ;
2026-07-23 10:11:24 +00:00
let tmp13 = outer1 _1 ;
let obj3 = BaseClient ( outer1 _1 [ 13 ] ) ;
2026-07-20 16:05:17 +00:00
let tmp14 = eventEnvelope ;
2026-07-23 10:11:24 +00:00
let obj4 = BaseClient ( outer1 _1 [ 13 ] ) ;
2026-07-20 16:05:17 +00:00
eventEnvelope = obj3 . addItemToEnvelope ( eventEnvelope , obj4 . createAttachmentEnvelopeItem ( tmp10 ) ) ;
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
const sendEnvelopeResult = self . sendEnvelope ( eventEnvelope ) ;
if ( sendEnvelopeResult ) {
2026-07-23 10:11:24 +00:00
sendEnvelopeResult . then ( ( arg0 ) => self . emit ( "afterSendEvent" , closure _0 , arg0 ) , null ) ;
2026-07-20 16:05:17 +00:00
}
}
obj = { } ;
}
} ;
items [ 16 ] = {
key : "sendSession" ,
value : function sendSession ( arg0 ) {
2026-07-23 10:11:24 +00:00
this . sendEnvelope ( BaseClient ( outer1 _1 [ 12 ] ) . createSessionEnvelope ( arg0 , this . _dsn , this . _options . _metadata , this . _options . tunnel ) ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 17 ] = {
key : "recordDroppedEvent" ,
value : function recordDroppedEvent ( arg0 , arg1 , arg2 ) {
const self = this ;
if ( this . _options . sendClientReports ) {
let num2 = 1 ;
if ( "number" === typeof arg2 ) {
num2 = arg2 ;
}
const _HermesInternal = HermesInternal ;
const combined = "" + arg0 + ":" + arg1 ;
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
let str4 = "" ;
if ( num2 > 1 ) {
const _HermesInternal2 = HermesInternal ;
str4 = " (" + num2 + " times)" ;
}
const _HermesInternal3 = HermesInternal ;
logger . log ( "Recording outcome: \"" + combined + "\"" + str4 ) ;
}
let num5 = self . _outcomes [ combined ] ;
if ( ! num5 ) {
num5 = 0 ;
}
self . _outcomes [ combined ] = num5 + num2 ;
}
}
} ;
items [ 18 ] = {
key : "on" ,
value : function on ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = arg1 ;
2026-07-20 16:05:17 +00:00
let items = this . _hooks [ arg0 ] ;
if ( ! items ) {
items = [ ] ;
}
this . _hooks [ arg0 ] = items ;
items . push ( arg1 ) ;
return ( ) => {
2026-07-23 10:11:24 +00:00
const index = items . indexOf ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
if ( index > - 1 ) {
items . splice ( index , 1 ) ;
}
} ;
}
} ;
items [ 19 ] = {
key : "emit" ,
value : function emit ( arg0 ) {
const length = arguments . length ;
let num = 0 ;
if ( length > 1 ) {
num = length - 1 ;
}
const array = new Array ( num ) ;
for ( let num2 = 1 ; num2 < length ; num2 = num2 + 1 ) {
array [ num2 - 1 ] = arguments [ num2 ] ;
}
2026-07-23 10:11:24 +00:00
if ( this . _hooks [ arg0 ] ) {
2026-07-20 16:05:17 +00:00
const item = arr . forEach ( ( apply ) => apply . apply ( undefined , array ) ) ;
}
}
} ;
items [ 20 ] = {
key : "sendEnvelope" ,
value : function sendEnvelope ( arg0 ) {
const self = this ;
this . emit ( "beforeEnvelope" , arg0 ) ;
if ( this . _isEnabled ( ) ) {
if ( self . _transport ) {
const _transport = self . _transport ;
let nextPromise = _transport . send ( arg0 ) . then ( null , ( arg0 ) => {
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer2 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger = BaseClient ( outer2 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . error ( "Error while sending envelope:" , arg0 ) ;
}
return arg0 ;
} ) ;
const sendResult = _transport . send ( arg0 ) ;
}
return nextPromise ;
}
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
let logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . error ( "Transport disabled" ) ;
}
2026-07-23 10:11:24 +00:00
nextPromise = BaseClient ( outer1 _1 [ 10 ] ) . resolvedSyncPromise ( { } ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 21 ] = {
key : "_setupIntegrations" ,
value : function _setupIntegrations ( ) {
const integrations = this . _options . integrations ;
2026-07-23 10:11:24 +00:00
this . _integrations = BaseClient ( outer1 _1 [ 11 ] ) . setupIntegrations ( this , integrations ) ;
const obj = BaseClient ( outer1 _1 [ 11 ] ) ;
const result = BaseClient ( outer1 _1 [ 11 ] ) . afterSetupIntegrations ( this , integrations ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 22 ] = {
key : "_updateSessionFromEvent" ,
value : function _updateSessionFromEvent ( status , level ) {
const self = this ;
let flag = "fatal" === level . level ;
let flag2 = false ;
if ( level . exception && level . exception . values ) {
const iter = tmp [ Symbol . iterator ] ( ) ;
flag2 = true ;
while ( iter !== undefined ) {
let mechanism = iter . next ( ) . mechanism ;
if ( mechanism ) {
let tmp5 = mechanism ;
if ( false === tmp4 . handled ) {
flag = true ;
iter . return ( ) ;
flag2 = true ;
2026-07-23 10:11:24 +00:00
break ;
2026-07-20 16:05:17 +00:00
}
break ;
}
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
}
let tmp6 = "ok" === status . status ;
let tmp7 = tmp6 ;
if ( tmp6 ) {
tmp7 = 0 === status . errors ;
}
if ( ! tmp7 ) {
if ( tmp6 ) {
tmp6 = flag ;
}
tmp7 = tmp6 ;
}
if ( tmp7 ) {
2026-07-23 10:11:24 +00:00
let obj = BaseClient ( outer1 _1 [ 9 ] ) ;
2026-07-20 16:05:17 +00:00
let tmp11 = flag ;
if ( flag ) {
obj = { status : "crashed" } ;
tmp11 = obj ;
}
obj = { } ;
let errors = status . errors ;
if ( ! errors ) {
if ( ! flag2 ) {
flag2 = flag ;
}
errors = Number ( flag2 ) ;
}
obj . errors = errors ;
obj . updateSession ( status , Object . assign ( { } , tmp11 , obj ) ) ;
self . captureSession ( status ) ;
}
}
} ;
items [ 23 ] = {
key : "_isClientDoneProcessing" ,
value : function _isClientDoneProcessing ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
2026-07-20 16:05:17 +00:00
const self = this ;
2026-07-23 10:11:24 +00:00
return new BaseClient ( outer1 _1 [ 10 ] ) . SyncPromise ( ( arg0 ) => {
let closure _0 = arg0 ;
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
const interval = setInterval ( ( ) => {
if ( 0 == _numProcessing . _numProcessing ) {
const _clearInterval2 = clearInterval ;
clearInterval ( closure _2 ) ;
2026-07-23 10:11:24 +00:00
callback ( true ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
closure _1 = closure _1 + 1 ;
let tmp2 = callback ;
if ( callback ) {
tmp2 = closure _1 >= callback ;
2026-07-20 16:05:17 +00:00
}
if ( tmp2 ) {
const _clearInterval = clearInterval ;
clearInterval ( closure _2 ) ;
2026-07-23 10:11:24 +00:00
callback ( false ) ;
2026-07-20 16:05:17 +00:00
}
}
} , 1 ) ;
} ) ;
}
} ;
items [ 24 ] = {
key : "_isEnabled" ,
value : function _isEnabled ( ) {
let tmp = false !== this . getOptions ( ) . enabled ;
if ( tmp ) {
tmp = undefined !== this . _transport ;
}
return tmp ;
}
} ;
items [ 25 ] = {
key : "_prepareEvent" ,
value : function _prepareEvent ( type , integrations ) {
2026-07-23 10:11:24 +00:00
let self = this ;
self = this ;
2026-07-20 16:05:17 +00:00
if ( arguments . length > 2 ) {
if ( undefined !== arguments [ 2 ] ) {
let currentScope = arguments [ 2 ] ;
}
if ( arguments . length > 3 ) {
if ( undefined !== arguments [ 3 ] ) {
let isolationScope = arguments [ 3 ] ;
}
const options = self . getOptions ( ) ;
2026-07-23 10:11:24 +00:00
let _Object = Object ;
2026-07-20 16:05:17 +00:00
const keys = Object . keys ( self . _integrations ) ;
let tmp6 = ! integrations . integrations ;
if ( tmp6 ) {
tmp6 = keys . length > 0 ;
}
if ( tmp6 ) {
integrations . integrations = keys ;
}
self . emit ( "preprocessEvent" , type , integrations ) ;
if ( ! type . type ) {
let event _id = type . event _id ;
if ( ! event _id ) {
event _id = integrations . event _id ;
}
isolationScope . setLastEventId ( event _id ) ;
}
2026-07-23 10:11:24 +00:00
const obj4 = BaseClient ( outer1 _1 [ 15 ] ) ;
2026-07-20 16:05:17 +00:00
return obj4 . prepareEvent ( options , type , integrations , currentScope , self , isolationScope ) . then ( ( contexts ) => {
if ( null === contexts ) {
return contexts ;
} else {
const _Object = Object ;
2026-07-23 10:11:24 +00:00
let obj = { trace : BaseClient ( outer2 _1 [ 14 ] ) . getTraceContextFromScope ( currentScope ) } ;
2026-07-20 16:05:17 +00:00
contexts . contexts = Object . assign ( obj , contexts . contexts ) ;
2026-07-23 10:11:24 +00:00
const obj2 = BaseClient ( outer2 _1 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
const _Object2 = Object ;
2026-07-23 10:11:24 +00:00
obj = { dynamicSamplingContext : BaseClient ( outer2 _1 [ 16 ] ) . getDynamicSamplingContextFromScope ( self , currentScope ) } ;
2026-07-20 16:05:17 +00:00
contexts . sdkProcessingMetadata = Object . assign ( obj , contexts . sdkProcessingMetadata ) ;
return contexts ;
}
} ) ;
}
2026-07-23 10:11:24 +00:00
isolationScope = BaseClient ( outer1 _1 [ 14 ] ) . getIsolationScope ( ) ;
let obj2 = BaseClient ( outer1 _1 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
currentScope = BaseClient ( outer1 _1 [ 14 ] ) . getCurrentScope ( ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 26 ] = {
key : "_captureEvent" ,
value : function _captureEvent ( arg0 ) {
const self = this ;
if ( arguments . length > 1 ) {
let tmp2 ;
if ( arguments . length > 2 ) {
tmp2 = arguments [ 2 ] ;
}
return self . _processEvent ( arg0 , { } , tmp2 ) . then ( ( event _id ) => event _id . event _id , ( logLevel ) => {
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer2 _1 [ 4 ] ) . DEBUG _BUILD ) {
if ( logLevel instanceof BaseClient ( outer2 _1 [ 17 ] ) . SentryError ) {
2026-07-20 16:05:17 +00:00
if ( "log" === logLevel . logLevel ) {
2026-07-23 10:11:24 +00:00
const logger2 = BaseClient ( outer2 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger2 . log ( logLevel . message ) ;
}
}
2026-07-23 10:11:24 +00:00
const logger = BaseClient ( outer2 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . warn ( logLevel ) ;
}
} ) ;
}
}
} ;
items [ 27 ] = {
key : "_processEvent" ,
value : function _processEvent ( type ) {
let self = this ;
2026-07-23 10:11:24 +00:00
let closure _0 = type ;
let closure _1 = arg1 ;
let closure _2 = arg2 ;
2026-07-20 16:05:17 +00:00
self = this ;
const options = this . getOptions ( ) ;
const sampleRate = options . sampleRate ;
2026-07-23 10:11:24 +00:00
let closure _5 = outer1 _6 ( type ) ;
2026-07-20 16:05:17 +00:00
let str = type . type ;
if ( ! str ) {
str = "error" ;
}
2026-07-23 10:11:24 +00:00
let closure _6 = "before send for type `" + str + "`" ;
2026-07-20 16:05:17 +00:00
if ( undefined !== sampleRate ) {
2026-07-23 10:11:24 +00:00
const parseSampleRateResult = BaseClient ( outer1 _1 [ 18 ] ) . parseSampleRate ( sampleRate ) ;
let obj = BaseClient ( outer1 _1 [ 18 ] ) ;
2026-07-20 16:05:17 +00:00
}
if ( tmp2 ) {
if ( "number" === typeof parseSampleRateResult ) {
const _Math = Math ;
if ( Math . random ( ) > parseSampleRateResult ) {
self . recordDroppedEvent ( "sample_rate" , "error" , type ) ;
2026-07-23 10:11:24 +00:00
let SentryError = BaseClient ( outer1 _1 [ 17 ] ) . SentryError ;
let _HermesInternal = HermesInternal ;
let prototype = SentryError . prototype ;
let sentryError = new SentryError ( "Discarding event because it's not included in the random sample (sampling rate = " + sampleRate + ")" , "log" ) ;
return BaseClient ( outer1 _1 [ 10 ] ) . rejectedSyncPromise ( sentryError ) ;
2026-07-20 16:05:17 +00:00
}
}
}
let str3 = "replay" ;
if ( "replay_event" !== str ) {
str3 = str ;
}
2026-07-23 10:11:24 +00:00
tmp2 = outer1 _5 ( type ) ;
2026-07-20 16:05:17 +00:00
const tmp6 = type . sdkProcessingMetadata || { } ;
const _prepareEventResult = self . _prepareEvent ( type , arg1 , arg2 , type . sdkProcessingMetadata || { } . capturedSpanIsolationScope ) ;
const nextPromise = self . _prepareEvent ( type , arg1 , arg2 , type . sdkProcessingMetadata || { } . capturedSpanIsolationScope ) . then ( ( spans ) => {
let beforeSend ;
let beforeSendSpan ;
let beforeSendTransaction ;
if ( null === spans ) {
2026-07-23 10:11:24 +00:00
self . recordDroppedEvent ( "event_processor" , "event_processor" , closure _0 ) ;
let SentryError = BaseClient ( outer2 _1 [ 17 ] ) . SentryError ;
let prototype = SentryError . prototype ;
let sentryError = new SentryError ( "An event processor returned `null`, will not send event." , "log" ) ;
2026-07-20 16:05:17 +00:00
throw sentryError ;
} else {
2026-07-23 10:11:24 +00:00
if ( closure _1 . data ) {
if ( true === closure _1 . data . _ _sentry _ _ ) {
2026-07-20 16:05:17 +00:00
return spans ;
}
}
let obj = self ;
( { beforeSend , beforeSendTransaction , beforeSendSpan } = options ) ;
2026-07-23 10:11:24 +00:00
if ( outer2 _5 ( spans ) ) {
2026-07-20 16:05:17 +00:00
if ( beforeSend ) {
let beforeSendResult = beforeSend ( spans , tmp4 ) ;
}
2026-07-23 10:11:24 +00:00
return ( function _validateBeforeSendResult ( beforeSendResult , closure _6 ) {
let closure _0 = closure _6 ;
2026-07-20 16:05:17 +00:00
const combined = "" + closure _6 + " must return `null` or a valid event." ;
if ( obj . isThenable ( beforeSendResult ) ) {
return beforeSendResult . then ( ( arg0 ) => {
if ( ! obj . isPlainObject ( arg0 ) ) {
if ( null !== arg0 ) {
2026-07-23 10:11:24 +00:00
const SentryError = BaseClient ( outer4 _1 [ 17 ] ) . SentryError ;
2026-07-20 16:05:17 +00:00
const prototype = SentryError . prototype ;
const sentryError = new SentryError ( combined ) ;
throw sentryError ;
}
}
return arg0 ;
} , ( arg0 ) => {
2026-07-23 10:11:24 +00:00
const sentryError = new BaseClient ( outer4 _1 [ 17 ] ) . SentryError ( "" + closure _0 + " rejected with " + arg0 ) ;
2026-07-20 16:05:17 +00:00
throw sentryError ;
} ) ;
} else {
if ( ! obj2 . isPlainObject ( beforeSendResult ) ) {
if ( null !== beforeSendResult ) {
2026-07-23 10:11:24 +00:00
let SentryError = BaseClient ( outer3 _1 [ 17 ] ) . SentryError ;
let prototype = SentryError . prototype ;
let sentryError = new SentryError ( combined ) ;
2026-07-20 16:05:17 +00:00
throw sentryError ;
}
}
return beforeSendResult ;
}
2026-07-23 10:11:24 +00:00
obj = BaseClient ( outer3 _1 [ 8 ] ) ;
} ) ( beforeSendResult , closure _6 ) ;
2026-07-20 16:05:17 +00:00
}
beforeSendResult = spans ;
2026-07-23 10:11:24 +00:00
if ( outer2 _6 ( spans ) ) {
2026-07-20 16:05:17 +00:00
if ( spans . spans ) {
if ( beforeSendSpan ) {
const items = [ ] ;
spans = spans . spans ;
const tmp10 = spans [ Symbol . iterator ] ( ) ;
while ( tmp10 !== undefined ) {
let tmp13 = beforeSendSpan ;
let beforeSendSpanResult = beforeSendSpan ( tmp11 ) ;
if ( beforeSendSpanResult ) {
let tmp21 = items ;
let tmp22 = beforeSendSpanResult ;
let arr = items . push ( tmp15 ) ;
} else {
2026-07-23 10:11:24 +00:00
let tmp16 = BaseClient ;
let tmp17 = outer2 _1 ;
let obj2 = BaseClient ( outer2 _1 [ 20 ] ) ;
2026-07-20 16:05:17 +00:00
let showSpanDropWarningResult = obj2 . showSpanDropWarning ( ) ;
let tmp19 = tmp2 ;
let recordDroppedEventResult1 = obj . recordDroppedEvent ( "before_send" , "span" ) ;
}
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
spans . spans = items ;
}
}
beforeSendResult = spans ;
if ( beforeSendTransaction ) {
if ( spans . spans ) {
const _Object = Object ;
obj = { spanCountBeforeProcessing : spans . spans . length } ;
spans . sdkProcessingMetadata = Object . assign ( { } , spans . sdkProcessingMetadata , obj ) ;
}
beforeSendResult = beforeSendTransaction ( spans , tmp4 ) ;
}
}
2026-07-23 10:11:24 +00:00
tmp2 = self ;
2026-07-20 16:05:17 +00:00
}
} ) ;
return self . _prepareEvent ( type , arg1 , arg2 , type . sdkProcessingMetadata || { } . capturedSpanIsolationScope ) . then ( ( spans ) => {
let beforeSend ;
let beforeSendSpan ;
let beforeSendTransaction ;
if ( null === spans ) {
2026-07-23 10:11:24 +00:00
self . recordDroppedEvent ( "event_processor" , "event_processor" , closure _0 ) ;
let SentryError = BaseClient ( outer2 _1 [ 17 ] ) . SentryError ;
let prototype = SentryError . prototype ;
let sentryError = new SentryError ( "An event processor returned `null`, will not send event." , "log" ) ;
2026-07-20 16:05:17 +00:00
throw sentryError ;
} else {
2026-07-23 10:11:24 +00:00
if ( closure _1 . data ) {
if ( true === closure _1 . data . _ _sentry _ _ ) {
2026-07-20 16:05:17 +00:00
return spans ;
}
}
let obj = self ;
( { beforeSend , beforeSendTransaction , beforeSendSpan } = options ) ;
2026-07-23 10:11:24 +00:00
if ( outer2 _5 ( spans ) ) {
2026-07-20 16:05:17 +00:00
if ( beforeSend ) {
let beforeSendResult = beforeSend ( spans , tmp4 ) ;
}
2026-07-23 10:11:24 +00:00
return ( function _validateBeforeSendResult ( beforeSendResult , closure _6 ) {
let closure _0 = closure _6 ;
2026-07-20 16:05:17 +00:00
const combined = "" + closure _6 + " must return `null` or a valid event." ;
if ( obj . isThenable ( beforeSendResult ) ) {
return beforeSendResult . then ( ( arg0 ) => {
if ( ! obj . isPlainObject ( arg0 ) ) {
if ( null !== arg0 ) {
2026-07-23 10:11:24 +00:00
const SentryError = BaseClient ( outer4 _1 [ 17 ] ) . SentryError ;
2026-07-20 16:05:17 +00:00
const prototype = SentryError . prototype ;
const sentryError = new SentryError ( combined ) ;
throw sentryError ;
}
}
return arg0 ;
} , ( arg0 ) => {
2026-07-23 10:11:24 +00:00
const sentryError = new BaseClient ( outer4 _1 [ 17 ] ) . SentryError ( "" + closure _0 + " rejected with " + arg0 ) ;
2026-07-20 16:05:17 +00:00
throw sentryError ;
} ) ;
} else {
if ( ! obj2 . isPlainObject ( beforeSendResult ) ) {
if ( null !== beforeSendResult ) {
2026-07-23 10:11:24 +00:00
let SentryError = BaseClient ( outer3 _1 [ 17 ] ) . SentryError ;
let prototype = SentryError . prototype ;
let sentryError = new SentryError ( combined ) ;
2026-07-20 16:05:17 +00:00
throw sentryError ;
}
}
return beforeSendResult ;
}
2026-07-23 10:11:24 +00:00
obj = BaseClient ( outer3 _1 [ 8 ] ) ;
} ) ( beforeSendResult , closure _6 ) ;
2026-07-20 16:05:17 +00:00
}
beforeSendResult = spans ;
2026-07-23 10:11:24 +00:00
if ( outer2 _6 ( spans ) ) {
2026-07-20 16:05:17 +00:00
if ( spans . spans ) {
if ( beforeSendSpan ) {
const items = [ ] ;
spans = spans . spans ;
const tmp10 = spans [ Symbol . iterator ] ( ) ;
while ( tmp10 !== undefined ) {
let tmp13 = beforeSendSpan ;
let beforeSendSpanResult = beforeSendSpan ( tmp11 ) ;
if ( beforeSendSpanResult ) {
let tmp21 = items ;
let tmp22 = beforeSendSpanResult ;
let arr = items . push ( tmp15 ) ;
} else {
2026-07-23 10:11:24 +00:00
let tmp16 = BaseClient ;
let tmp17 = outer2 _1 ;
let obj2 = BaseClient ( outer2 _1 [ 20 ] ) ;
2026-07-20 16:05:17 +00:00
let showSpanDropWarningResult = obj2 . showSpanDropWarning ( ) ;
let tmp19 = tmp2 ;
let recordDroppedEventResult1 = obj . recordDroppedEvent ( "before_send" , "span" ) ;
}
2026-07-23 10:11:24 +00:00
continue ;
2026-07-20 16:05:17 +00:00
}
spans . spans = items ;
}
}
beforeSendResult = spans ;
if ( beforeSendTransaction ) {
if ( spans . spans ) {
const _Object = Object ;
obj = { spanCountBeforeProcessing : spans . spans . length } ;
spans . sdkProcessingMetadata = Object . assign ( { } , spans . sdkProcessingMetadata , obj ) ;
}
beforeSendResult = beforeSendTransaction ( spans , tmp4 ) ;
}
}
2026-07-23 10:11:24 +00:00
tmp2 = self ;
2026-07-20 16:05:17 +00:00
}
} ) . then ( ( sdkProcessingMetadata ) => {
if ( null === sdkProcessingMetadata ) {
2026-07-23 10:11:24 +00:00
self . recordDroppedEvent ( "before_send" , str3 , type ) ;
2026-07-20 16:05:17 +00:00
if ( closure _5 ) {
2026-07-23 10:11:24 +00:00
self . recordDroppedEvent ( "before_send" , "span" , 1 + type . spans || [ ] . length ) ;
const arr = type . spans || [ ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const SentryError = BaseClient ( outer2 _1 [ 17 ] ) . SentryError ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
const prototype = SentryError . prototype ;
const sentryError = new SentryError ( "" + closure _6 + " returned `null`, will not send event." , "log" ) ;
throw sentryError ;
} else {
2026-07-23 10:11:24 +00:00
if ( session ) {
session = session . getSession ( ) ;
2026-07-20 16:05:17 +00:00
}
let tmp4 = ! closure _5 ;
if ( ! closure _5 ) {
tmp4 = session ;
}
if ( tmp4 ) {
const result = self . _updateSessionFromEvent ( session , sdkProcessingMetadata ) ;
}
if ( closure _5 ) {
let num2 = 0 ;
if ( sdkProcessingMetadata . spans ) {
num2 = sdkProcessingMetadata . spans . length ;
}
const diff = ( sdkProcessingMetadata . sdkProcessingMetadata && sdkProcessingMetadata . sdkProcessingMetadata . spanCountBeforeProcessing || 0 ) - num2 ;
if ( diff > 0 ) {
self . recordDroppedEvent ( "before_send" , "span" , diff ) ;
}
const tmp8 = sdkProcessingMetadata . sdkProcessingMetadata && sdkProcessingMetadata . sdkProcessingMetadata . spanCountBeforeProcessing || 0 ;
}
const transaction _info = sdkProcessingMetadata . transaction _info ;
if ( closure _5 ) {
if ( transaction _info ) {
2026-07-23 10:11:24 +00:00
if ( sdkProcessingMetadata . transaction !== type . transaction ) {
2026-07-20 16:05:17 +00:00
const _Object = Object ;
const obj = { source : "custom" } ;
sdkProcessingMetadata . transaction _info = Object . assign ( { } , transaction _info , obj ) ;
}
}
}
2026-07-23 10:11:24 +00:00
self . sendEvent ( sdkProcessingMetadata , closure _1 ) ;
2026-07-20 16:05:17 +00:00
return sdkProcessingMetadata ;
}
} ) . then ( null , ( originalException ) => {
2026-07-23 10:11:24 +00:00
if ( originalException instanceof BaseClient ( outer2 _1 [ 17 ] ) . SentryError ) {
2026-07-20 16:05:17 +00:00
throw originalException ;
} else {
let obj = { } ;
obj = { _ _sentry _ _ : true } ;
obj . data = obj ;
obj . originalException = originalException ;
self . captureException ( originalException , obj ) ;
2026-07-23 10:11:24 +00:00
const SentryError = BaseClient ( outer2 _1 [ 17 ] ) . SentryError ;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal ;
const prototype = SentryError . prototype ;
const sentryError = new SentryError ( "Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: " + originalException ) ;
throw sentryError ;
}
} ) ;
}
} ;
items [ 28 ] = {
key : "_process" ,
value : function _process ( promise ) {
2026-07-23 10:11:24 +00:00
const self = this ;
2026-07-20 16:05:17 +00:00
this . _numProcessing = this . _numProcessing + 1 ;
promise . then ( ( arg0 ) => {
self . _numProcessing = self . _numProcessing - 1 ;
return arg0 ;
} , ( arg0 ) => {
self . _numProcessing = self . _numProcessing - 1 ;
return arg0 ;
} ) ;
}
} ;
items [ 29 ] = {
key : "_clearOutcomes" ,
value : function _clearOutcomes ( ) {
this . _outcomes = { } ;
const entries = Object . entries ( this . _outcomes ) ;
return entries . map ( ( arg0 ) => {
2026-07-23 10:11:24 +00:00
const tmp = outer2 _2 ( arg0 , 2 ) ;
const tmp2 = outer2 _2 ( tmp [ 0 ] . split ( ":" ) , 2 ) ;
2026-07-20 16:05:17 +00:00
return { reason : tmp2 [ 0 ] , category : tmp2 [ 1 ] , quantity : tmp [ 1 ] } ;
} ) ;
}
} ;
items [ 30 ] = {
key : "_flushOutcomes" ,
value : function _flushOutcomes ( ) {
const self = this ;
2026-07-23 10:11:24 +00:00
if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger . log ( "Flushing outcomes..." ) ;
}
const _clearOutcomesResult = self . _clearOutcomes ( ) ;
if ( 0 !== _clearOutcomesResult . length ) {
2026-07-23 10:11:24 +00:00
const DEBUG _BUILD = BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ;
2026-07-20 16:05:17 +00:00
if ( self . _dsn ) {
if ( DEBUG _BUILD ) {
2026-07-23 10:11:24 +00:00
const logger4 = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger4 . log ( "Sending outcomes:" , _clearOutcomesResult ) ;
}
let tunnel = self . _options . tunnel ;
if ( tunnel ) {
2026-07-23 10:11:24 +00:00
tunnel = BaseClient ( outer1 _1 [ 3 ] ) . dsnToString ( self . _dsn ) ;
const obj2 = BaseClient ( outer1 _1 [ 3 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
self . sendEnvelope ( BaseClient ( outer1 _1 [ 19 ] ) . createClientReportEnvelope ( _clearOutcomesResult , tunnel ) ) ;
const obj = BaseClient ( outer1 _1 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
} else if ( DEBUG _BUILD ) {
2026-07-23 10:11:24 +00:00
const logger3 = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger3 . log ( "No dsn provided, will not send outcomes" ) ;
}
2026-07-23 10:11:24 +00:00
} else if ( BaseClient ( outer1 _1 [ 4 ] ) . DEBUG _BUILD ) {
const logger2 = BaseClient ( outer1 _1 [ 5 ] ) . logger ;
2026-07-20 16:05:17 +00:00
logger2 . log ( "No outcomes to send" ) ;
}
}
} ;
2026-07-23 10:11:24 +00:00
return _defineProperties ( BaseClient , items ) ;
} ) ( ) ;