2026-07-20 16:05:17 +00:00
// Module ID: 64
// Function ID: 1414
// Name: MessageQueue
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 6, 7, 69, 70, 71, 44]
2026-07-20 16:05:17 +00:00
// Module 64 (MessageQueue)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray" ;
import invariant from "invariant" ;
import _defineProperties from "_defineProperties" ;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1 ;
export default ( ( ) => {
2026-07-20 16:05:17 +00:00
class MessageQueue {
constructor ( ) {
2026-07-23 10:11:24 +00:00
tmp = outer1 _4 ( this , MessageQueue ) ;
2026-07-20 16:05:17 +00:00
this . _lazyCallableModules = { } ;
items = [ , , , ] ;
items [ 0 ] = [ ] ;
items [ 1 ] = [ ] ;
items [ 2 ] = [ ] ;
items [ 3 ] = 0 ;
this . _queue = items ;
map = new Map ( ) ;
this . _successCallbacks = map ;
map1 = new Map ( ) ;
this . _failureCallbacks = map1 ;
this . _callID = 0 ;
this . _lastFlush = 0 ;
this . _eventLoopStartTime = Date . now ( ) ;
this . _reactNativeMicrotasksCallback = null ;
callFunctionReturnFlushedQueue = this . callFunctionReturnFlushedQueue ;
this . callFunctionReturnFlushedQueue = callFunctionReturnFlushedQueue . bind ( this ) ;
flushedQueue = this . flushedQueue ;
this . flushedQueue = flushedQueue . bind ( this ) ;
invokeCallbackAndReturnFlushedQueue = this . invokeCallbackAndReturnFlushedQueue ;
this . invokeCallbackAndReturnFlushedQueue = invokeCallbackAndReturnFlushedQueue . bind ( this ) ;
return ;
}
}
let obj = {
key : "callFunctionReturnFlushedQueue" ,
value : function callFunctionReturnFlushedQueue ( arg0 , arg1 , arg2 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
let closure _2 = arg2 ;
2026-07-20 16:05:17 +00:00
const self = this ;
this . _ _guard ( ( ) => {
2026-07-23 10:11:24 +00:00
self . _ _callFunction ( closure _0 , closure _1 , closure _2 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
return this . flushedQueue ( ) ;
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , , , , , , , , , , , , , , , , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "invokeCallbackAndReturnFlushedQueue" ,
value : function invokeCallbackAndReturnFlushedQueue ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
let closure _1 = arg1 ;
2026-07-20 16:05:17 +00:00
const self = this ;
this . _ _guard ( ( ) => {
2026-07-23 10:11:24 +00:00
self . _ _invokeCallback ( closure _0 , closure _1 ) ;
2026-07-20 16:05:17 +00:00
} ) ;
return this . flushedQueue ( ) ;
}
} ;
items [ 1 ] = obj ;
obj = {
key : "flushedQueue" ,
value : function flushedQueue ( ) {
2026-07-23 10:11:24 +00:00
const self = this ;
2026-07-20 16:05:17 +00:00
this . _ _guard ( ( ) => {
const result = self . _ _callReactNativeMicrotasks ( ) ;
} ) ;
const _queue = this . _queue ;
const items = [ [ ] , [ ] , [ ] , this . _callID ] ;
this . _queue = items ;
let tmp2 = null ;
if ( _queue [ 0 ] . length ) {
tmp2 = _queue ;
}
return tmp2 ;
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "getEventLoopRunningTime" ,
value : function getEventLoopRunningTime ( ) {
return Date . now ( ) - this . _eventLoopStartTime ;
}
} ;
items [ 4 ] = {
key : "registerCallableModule" ,
2026-07-23 10:11:24 +00:00
value : function registerCallableModule ( MobileVoiceOverlayManager , _defineProperties ) {
let closure _0 = _defineProperties ;
this . _lazyCallableModules [ MobileVoiceOverlayManager ] = ( ) => closure _0 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 5 ] = {
key : "registerLazyCallableModule" ,
2026-07-23 10:11:24 +00:00
value : function registerLazyCallableModule ( MobileVoiceOverlayManager , _defineProperties ) {
let closure _1 = _defineProperties ;
2026-07-20 16:05:17 +00:00
this . _lazyCallableModules [ MobileVoiceOverlayManager ] = ( ) => {
2026-07-23 10:11:24 +00:00
if ( callback ) {
let closure _0 = callback ( ) ;
callback = null ;
2026-07-20 16:05:17 +00:00
}
return closure _0 ;
} ;
}
} ;
items [ 6 ] = {
key : "getCallableModule" ,
2026-07-23 10:11:24 +00:00
value : function getCallableModule ( closure _0 ) {
2026-07-20 16:05:17 +00:00
let tmpResult = null ;
2026-07-23 10:11:24 +00:00
if ( this . _lazyCallableModules [ closure _0 ] ) {
2026-07-20 16:05:17 +00:00
tmpResult = tmp ( ) ;
}
return tmpResult ;
}
} ;
items [ 7 ] = {
key : "callNativeSyncHook" ,
2026-07-23 10:11:24 +00:00
value : function callNativeSyncHook ( closure _0 , closure _1 , substr , arg3 , arg4 ) {
this . processCallbacks ( closure _0 , closure _1 , substr , arg3 , arg4 ) ;
return MessageQueue . nativeCallSyncHook ( closure _0 , closure _1 , substr ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 8 ] = {
key : "processCallbacks" ,
value : function processCallbacks ( arg0 , arg1 , arr ) {
const self = this ;
let tmp = arg3 ;
if ( ! arg3 ) {
tmp = arg4 ;
}
if ( tmp ) {
if ( arg3 ) {
arr . push ( self . _callID << 1 ) ;
}
if ( arg4 ) {
arr . push ( self . _callID << 1 | 1 ) ;
}
const result = self . _successCallbacks . set ( self . _callID , arg4 ) ;
const result1 = self . _failureCallbacks . set ( self . _callID , arg3 ) ;
const _failureCallbacks = self . _failureCallbacks ;
const _successCallbacks = self . _successCallbacks ;
}
self . _callID = self . _callID + 1 ;
}
} ;
items [ 9 ] = {
key : "enqueueNativeCall" ,
2026-07-23 10:11:24 +00:00
value : function enqueueNativeCall ( array , closure _1 , closure _0 , arg3 , arg4 ) {
2026-07-20 16:05:17 +00:00
const self = this ;
2026-07-23 10:11:24 +00:00
this . processCallbacks ( array , closure _1 , closure _0 , arg3 , arg4 ) ;
2026-07-20 16:05:17 +00:00
const first = this . _queue [ 0 ] ;
first . push ( array ) ;
let arr1 = this . _queue [ 1 ] ;
2026-07-23 10:11:24 +00:00
arr1 . push ( closure _1 ) ;
arr1 = this . _queue [ 2 ] . push ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
const timestamp = Date . now ( ) ;
if ( MessageQueue . nativeFlushQueueImmediate ) {
if ( timestamp - self . _lastFlush >= 5 ) {
const items = [ [ ] , [ ] , [ ] , self . _callID ] ;
self . _queue = items ;
self . _lastFlush = timestamp ;
const result = MessageQueue . nativeFlushQueueImmediate ( self . _queue ) ;
}
}
2026-07-23 10:11:24 +00:00
let obj = outer1 _1 ( outer1 _2 [ 3 ] ) ;
2026-07-20 16:05:17 +00:00
obj . counterEvent ( "pending_js_to_native_queue" , self . _queue [ 0 ] . length ) ;
if ( self . _ _spy ) {
2026-07-23 10:11:24 +00:00
obj = { type : 1 , module : "" + array , method : closure _1 , args : closure _0 } ;
2026-07-20 16:05:17 +00:00
self . _ _spy ( obj ) ;
}
}
} ;
items [ 10 ] = {
key : "createDebugLookup" ,
value : function createDebugLookup ( arg0 , arg1 , arg2 ) {
}
} ;
items [ 11 ] = {
key : "setReactNativeMicrotasksCallback" ,
value : function setReactNativeMicrotasksCallback ( callReactNativeMicrotasks ) {
this . _reactNativeMicrotasksCallback = callReactNativeMicrotasks ;
}
} ;
items [ 12 ] = {
key : "__guard" ,
value : function _ _guard ( arg0 ) {
if ( this . _ _shouldPauseOnThrow ( ) ) {
arg0 ( ) ;
} else {
arg0 ( ) ;
}
}
} ;
items [ 13 ] = {
key : "__shouldPauseOnThrow" ,
value : function _ _shouldPauseOnThrow ( ) {
let tmp = "undefined" !== typeof globalThis . DebuggerInternal ;
if ( tmp ) {
tmp = true === globalThis . DebuggerInternal . shouldPauseOnThrow ;
}
return tmp ;
}
} ;
items [ 14 ] = {
key : "__callReactNativeMicrotasks" ,
value : function _ _callReactNativeMicrotasks ( ) {
const self = this ;
2026-07-23 10:11:24 +00:00
outer1 _1 ( outer1 _2 [ 3 ] ) . beginEvent ( "JSTimers.callReactNativeMicrotasks()" ) ;
2026-07-20 16:05:17 +00:00
if ( null != this . _reactNativeMicrotasksCallback ) {
const result = self . _reactNativeMicrotasksCallback ( ) ;
}
2026-07-23 10:11:24 +00:00
const obj = outer1 _1 ( outer1 _2 [ 3 ] ) ;
outer1 _1 ( outer1 _2 [ 3 ] ) . endEvent ( ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 15 ] = {
key : "__callFunction" ,
2026-07-23 10:11:24 +00:00
value : function _ _callFunction ( closure _0 , closure _1 , closure _2 ) {
2026-07-20 16:05:17 +00:00
const self = this ;
this . _lastFlush = Date . now ( ) ;
this . _eventLoopStartTime = this . _lastFlush ;
2026-07-23 10:11:24 +00:00
const beginEvent = outer1 _1 ( outer1 _2 [ 3 ] ) . beginEvent ;
2026-07-20 16:05:17 +00:00
if ( this . _ _spy ) {
const _HermesInternal2 = HermesInternal ;
2026-07-23 10:11:24 +00:00
beginEvent ( "" + tmp4 + "." + tmp5 + "(" + tmp ( tmp2 [ 5 ] ) . default ( closure _2 ) + ")" ) ;
2026-07-20 16:05:17 +00:00
const tmpResult = tmp ( tmp2 [ 5 ] ) ;
} else {
const _HermesInternal = HermesInternal ;
beginEvent ( "" + tmp4 + "." + tmp5 + "(...)" ) ;
}
if ( self . _ _spy ) {
2026-07-23 10:11:24 +00:00
const obj = { type : 0 , module : closure _0 , method : closure _1 , args : closure _2 } ;
2026-07-20 16:05:17 +00:00
self . _ _spy ( obj ) ;
}
2026-07-23 10:11:24 +00:00
const callableModule = self . getCallableModule ( closure _0 ) ;
2026-07-20 16:05:17 +00:00
if ( ! callableModule ) {
const _Object = Object ;
const keys = Object . keys ( self . _lazyCallableModules ) ;
const joined = keys . join ( ", " ) ;
let str9 = "false" ;
if ( true === MessageQueue . RN$Bridgeless ) {
str9 = "true" ;
}
const _HermesInternal3 = HermesInternal ;
2026-07-23 10:11:24 +00:00
outer1 _1 ( outer1 _2 [ 6 ] ) ( false , "Failed to call into JavaScript module method " + closure _0 + "." + closure _1 + "(). Module has not been registered as callable. Bridgeless Mode: " + str9 + ". Registered callable JavaScript modules (n = " + keys . length + "): " + joined + ".\n A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native." ) ;
const tmp23 = outer1 _1 ( outer1 _2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! callableModule [ closure _1 ] ) {
2026-07-20 16:05:17 +00:00
const _HermesInternal4 = HermesInternal ;
2026-07-23 10:11:24 +00:00
outer1 _1 ( outer1 _2 [ 6 ] ) ( false , "Failed to call into JavaScript module method " + closure _0 + "." + closure _1 + "(). Module exists, but the method is undefined." ) ;
const tmp32 = outer1 _1 ( outer1 _2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
callableModule [ closure _1 ] . apply ( callableModule , closure _2 ) ;
const obj3 = callableModule [ closure _1 ] ;
tmp = outer1 _1 ;
tmp2 = outer1 _2 ;
const tmp3 = outer1 _1 ( outer1 _2 [ 3 ] ) ;
outer1 _1 ( outer1 _2 [ 3 ] ) . endEvent ( ) ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 16 ] = {
key : "__invokeCallback" ,
2026-07-23 10:11:24 +00:00
value : function _ _invokeCallback ( closure _0 , closure _1 ) {
2026-07-20 16:05:17 +00:00
const self = this ;
this . _lastFlush = Date . now ( ) ;
this . _eventLoopStartTime = this . _lastFlush ;
2026-07-23 10:11:24 +00:00
if ( 1 & closure _0 ) {
2026-07-20 16:05:17 +00:00
let value = self . _successCallbacks . get ( tmp ) ;
const _successCallbacks = self . _successCallbacks ;
} else {
value = self . _failureCallbacks . get ( tmp ) ;
const _failureCallbacks = self . _failureCallbacks ;
}
if ( value ) {
self . _successCallbacks . delete ( tmp ) ;
self . _failureCallbacks . delete ( tmp ) ;
2026-07-23 10:11:24 +00:00
obj . apply ( undefined , outer1 _3 ( closure _1 ) ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = value ;
2026-07-20 16:05:17 +00:00
}
} ;
const items1 = [
{
key : "spy" ,
value : function spy ( arg0 ) {
if ( true === arg0 ) {
let tmp = ( type ) => {
let str = "JS->N" ;
if ( 0 === type . type ) {
str = "N->JS" ;
}
let str2 = "" ;
if ( null != type . module ) {
str2 = ` ${ type . module } . ` ;
}
const text = ` ${ str } : ${ "" + str2 + type . method } ` ;
console . log ( text + "(" + JSON . stringify ( type . args ) + ")" ) ;
} ;
} else {
tmp = null ;
if ( false !== arg0 ) {
tmp = arg0 ;
}
}
MessageQueue . prototype . _ _spy = tmp ;
}
}
] ;
return callback ( MessageQueue , items , items1 ) ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;