2026-07-29 08:29:29 +00:00
// Module ID: 1613
// Function ID: 1614
// Name: runWorkletOnJS
// Dependencies: [1609, 1614, 1636, 1631]
// Exports: executeOnUIRuntimeSync, runOnJS, runOnUI, runOnUIImmediately, setupMicrotasks
// Module 1613 (runWorkletOnJS)
import isJest from "isJest" ;
import isJest from "isJest" ;
function runWorkletOnJS ( arg0 ) {
arg0 ( ... HermesBuiltin . copyRestArgs ( ) ) ;
}
isJest = isJest . isJest ( ) ;
isJest = isJest . shouldBeUseWeb ( ) ;
let closure _5 = [ ] ;
function setupMicrotasks ( ) {
let closure _0 = [ ] ;
let c1 = false ;
closure _0 . queueMicrotask = ( arg0 ) => {
} ;
closure _0 . _ _callMicrotasks = ( ) => {
let length ;
let sum ;
if ( ! c1 ) {
try {
c1 = true ;
let num2 = 0 ;
if ( 0 < arr . length ) {
do {
let tmp2 = arr ;
let tmp3 = num2 ;
let tmp4 = arr [ num2 ] ( ) ;
sum = num2 + 1 ;
num2 = sum ;
let tmp6 = arr ;
length = arr . length ;
} while ( sum < length ) ;
}
arr = [ ] ;
const result = arr . _maybeFlushUIUpdatesQueue ( ) ;
c1 = false ;
} catch ( tmp9 ) {
c1 = false ;
throw tmp9 ;
}
}
} ;
}
setupMicrotasks . _ _closure = { } ;
setupMicrotasks . _ _workletHash = 2487728156345 ;
setupMicrotasks . _ _initData = { code : "function setupMicrotasks_Pnpm_threadsTs1(){let microtasksQueue=[];let isExecutingMicrotasksQueue=false;global.queueMicrotask=function(callback){microtasksQueue.push(callback);};global.__callMicrotasks=function(){if(isExecutingMicrotasksQueue){return;}try{isExecutingMicrotasksQueue=true;for(let index=0;index<microtasksQueue.length;index+=1){microtasksQueue[index]();}microtasksQueue=[];global._maybeFlushUIUpdatesQueue();}finally{isExecutingMicrotasksQueue=false;}};}" } ;
function callMicrotasksOnUIThread ( ) {
global . _ _callMicrotasks ( ) ;
}
callMicrotasksOnUIThread . _ _closure = { } ;
callMicrotasksOnUIThread . _ _workletHash = 741957556389 ;
callMicrotasksOnUIThread . _ _initData = { code : "function callMicrotasksOnUIThread_Pnpm_threadsTs2(){global.__callMicrotasks();}" } ;
if ( isJest ) {
callMicrotasksOnUIThread = ( ) => {
} ;
}
let closure _7 = { code : "function pnpm_threadsTs4(){const{worklet,args}=this.__closure;worklet(...args);}" } ;
let closure _8 = { code : "function pnpm_threadsTs5(){const{queue,callMicrotasks}=this.__closure;queue.forEach(function([worklet,args]){worklet(...args);});callMicrotasks();}" } ;
function runOnUI ( fn ) {
let closure _0 = fn ;
return ( ) => {
const items = [ ... arguments ] ;
if ( outer1 _3 ) {
let ReanimatedModule = outer1 _1 ( outer1 _2 [ 1 ] ) . ReanimatedModule ;
let obj = outer1 _1 ( outer1 _2 [ 2 ] ) ;
let fn = function s ( ) {
items ( ... items ) ;
} ;
obj = { worklet : null , args : null } ;
obj [ 0 ] = items ;
obj [ 1 ] = items ;
fn . _ _closure = obj ;
fn . _ _workletHash = 10268384484340 ;
fn . _ _initData = outer1 _7 ;
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( fn ) ) ;
} else {
const items1 = [ items , items ] ;
outer1 _5 . push ( items1 ) ;
if ( 1 === outer1 _5 . length ) {
const _queueMicrotask = queueMicrotask ;
queueMicrotask ( ( ) => {
let closure _0 = closure _5 ;
closure _5 = [ ] ;
const ReanimatedModule = callback ( 1614 ) . ReanimatedModule ;
let obj = callback ( 1636 ) ;
const fn = function n ( ) {
const item = closure _0 . forEach ( ( arg0 ) => {
let tmp ;
let tmp2 ;
[ tmp , tmp2 ] = arg0 ;
tmp ( ... tmp2 ) ;
} ) ;
outer1 _6 ( ) ;
} ;
obj = { queue : closure _5 , callMicrotasks : closure _6 } ;
fn . _ _closure = obj ;
fn . _ _workletHash = 2773761092576 ;
fn . _ _initData = closure _8 ;
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( fn ) ) ;
} ) ;
}
}
} ;
}
let obj = { _ _DEV _ _ : false , SHOULD _BE _USE _WEB : isJest , isWorkletFunction : require ( "isWorkletFunction" ) . isWorkletFunction , IS _JEST : isJest , ReanimatedModule : require ( "ReanimatedModule" ) . ReanimatedModule , makeShareableCloneRecursive : require ( "freezeObjectInDev" ) . makeShareableCloneRecursive , callMicrotasks : callMicrotasksOnUIThread } ;
runOnUI . _ _closure = obj ;
runOnUI . _ _workletHash = 8710271011487 ;
runOnUI . _ _initData = { code : "function runOnUI_Pnpm_threadsTs3(worklet){const{__DEV__,SHOULD_BE_USE_WEB,isWorkletFunction,IS_JEST,ReanimatedModule,makeShareableCloneRecursive,callMicrotasks}=this.__closure;if(__DEV__&&!SHOULD_BE_USE_WEB&&_WORKLET){throw new ReanimatedError('`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.');}if(__DEV__&&!SHOULD_BE_USE_WEB&&!isWorkletFunction(worklet)){throw new ReanimatedError('`runOnUI` can only be used with worklets.');}return function(...args){if(IS_JEST){ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';worklet(...args);}));return;}if(__DEV__){makeShareableCloneRecursive(worklet);makeShareableCloneRecursive(args);}_runOnUIQueue.push([worklet,args]);if(_runOnUIQueue.length===1){queueMicrotask(function(){const queue=_runOnUIQueue;_runOnUIQueue=[];ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';queue.forEach(function([worklet,args]){worklet(...args);});callMicrotasks();}));});}};}" } ;
let closure _9 = { code : "function pnpm_threadsTs6(){const{worklet,args,makeShareableCloneOnUIRecursive}=this.__closure;const result=worklet(...args);return makeShareableCloneOnUIRecursive(result);}" } ;
let closure _10 = { code : "function pnpm_threadsTs8(){const{worklet,args}=this.__closure;worklet(...args);}" } ;
function runOnUIImmediately ( fn ) {
let closure _0 = fn ;
return ( ) => {
const items = [ ... arguments ] ;
const ReanimatedModule = outer1 _1 ( outer1 _2 [ 1 ] ) . ReanimatedModule ;
let obj = outer1 _1 ( outer1 _2 [ 2 ] ) ;
const fn = function u ( ) {
items ( ... items ) ;
} ;
obj = { worklet : items , args : items } ;
fn . _ _closure = obj ;
fn . _ _workletHash = 6969436050040 ;
fn . _ _initData = outer1 _10 ;
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( fn ) ) ;
} ;
}
obj = { _ _DEV _ _ : false , SHOULD _BE _USE _WEB : isJest , isWorkletFunction : require ( "isWorkletFunction" ) . isWorkletFunction , ReanimatedModule : require ( "ReanimatedModule" ) . ReanimatedModule , makeShareableCloneRecursive : require ( "freezeObjectInDev" ) . makeShareableCloneRecursive } ;
runOnUIImmediately . _ _closure = obj ;
runOnUIImmediately . _ _workletHash = 3385146413149 ;
runOnUIImmediately . _ _initData = { code : "function runOnUIImmediately_Pnpm_threadsTs7(worklet){const{__DEV__,SHOULD_BE_USE_WEB,isWorkletFunction,ReanimatedModule,makeShareableCloneRecursive}=this.__closure;if(__DEV__&&!SHOULD_BE_USE_WEB&&_WORKLET){throw new ReanimatedError('`runOnUIImmediately` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.');}if(__DEV__&&!SHOULD_BE_USE_WEB&&!isWorkletFunction(worklet)){throw new ReanimatedError('`runOnUIImmediately` can only be used with worklets.');}return function(...args){ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';worklet(...args);}));};}" } ;
function runOnJS ( _ _remoteFunction ) {
if ( ! isJest ) {
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( _ _remoteFunction ) ) {
return ( ) => {
let items = [ ... arguments ] ;
let _ _remoteFunction = outer1 _11 ;
let _scheduleRemoteFunctionOnJS ;
if ( ! outer1 _4 ) {
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( tmp ) ) {
let fn = ( ) => {
let items = [ ... arguments ] ;
let _ _remoteFunction = outer1 _11 ;
let _scheduleRemoteFunctionOnJS ;
if ( ! outer1 _4 ) {
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( tmp ) ) {
let fn = ( ) => {
let items = [ ... arguments ] ;
let _ _remoteFunction = outer1 _11 ;
let _scheduleRemoteFunctionOnJS ;
if ( ! outer1 _4 ) {
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( tmp ) ) {
let fn = ( ) => {
let items = [ ... arguments ] ;
let _ _remoteFunction = outer1 _11 ;
let _scheduleRemoteFunctionOnJS ;
if ( ! outer1 _4 ) {
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( tmp ) ) {
let fn = ( ) => { ... } ;
} else {
let tmp5 = tmp ;
if ( tmp . _ _remoteFunction ) {
_ _remoteFunction = tmp . _ _remoteFunction ;
tmp5 = _ _remoteFunction ;
}
2026-08-04 21:03:28 +00:00
if ( typeof tmp5 === "function" ) {
2026-07-29 08:29:29 +00:00
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleHostFunctionOnJS ;
} else {
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleRemoteFunctionOnJS ;
}
fn = ( ) => { ... } ;
}
obj = outer1 _1 ( outer1 _2 [ 3 ] ) ;
}
let items1 = [ _ _remoteFunction ] ;
HermesBuiltin . arraySpread ( items , 1 ) ;
return HermesBuiltin . apply ( items1 , undefined ) ;
}
fn = ( ) => { ... } ;
} ;
} else {
let tmp5 = tmp ;
if ( tmp . _ _remoteFunction ) {
_ _remoteFunction = tmp . _ _remoteFunction ;
tmp5 = _ _remoteFunction ;
}
2026-08-04 21:03:28 +00:00
if ( typeof tmp5 === "function" ) {
2026-07-29 08:29:29 +00:00
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleHostFunctionOnJS ;
} else {
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleRemoteFunctionOnJS ;
}
fn = ( ) => {
const items = [ ... arguments ] ;
let shareableCloneOnUIRecursive ;
if ( items . length > 0 ) {
shareableCloneOnUIRecursive = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) . makeShareableCloneOnUIRecursive ( items ) ;
const obj = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) ;
}
_scheduleRemoteFunctionOnJS ( _ _remoteFunction , shareableCloneOnUIRecursive ) ;
} ;
}
obj = outer1 _1 ( outer1 _2 [ 3 ] ) ;
}
let items1 = [ _ _remoteFunction ] ;
HermesBuiltin . arraySpread ( items , 1 ) ;
return HermesBuiltin . apply ( items1 , undefined ) ;
}
fn = ( ) => {
const items = [ ... arguments ] ;
return queueMicrotask ( items . length ? ( ( ) => { ... } ) : items ) ;
} ;
} ;
} else {
let tmp5 = tmp ;
if ( tmp . _ _remoteFunction ) {
_ _remoteFunction = tmp . _ _remoteFunction ;
tmp5 = _ _remoteFunction ;
}
2026-08-04 21:03:28 +00:00
if ( typeof tmp5 === "function" ) {
2026-07-29 08:29:29 +00:00
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleHostFunctionOnJS ;
} else {
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleRemoteFunctionOnJS ;
}
fn = ( ) => {
const items = [ ... arguments ] ;
let shareableCloneOnUIRecursive ;
if ( items . length > 0 ) {
shareableCloneOnUIRecursive = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) . makeShareableCloneOnUIRecursive ( items ) ;
const obj = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) ;
}
_scheduleRemoteFunctionOnJS ( _ _remoteFunction , shareableCloneOnUIRecursive ) ;
} ;
}
obj = outer1 _1 ( outer1 _2 [ 3 ] ) ;
}
let items1 = [ _ _remoteFunction ] ;
HermesBuiltin . arraySpread ( items , 1 ) ;
return HermesBuiltin . apply ( items1 , undefined ) ;
}
fn = ( ) => {
const items = [ ... arguments ] ;
return queueMicrotask ( items . length ? ( ( ) => items ( ... items ) ) : items ) ;
} ;
} ;
} else {
let tmp5 = tmp ;
if ( tmp . _ _remoteFunction ) {
_ _remoteFunction = tmp . _ _remoteFunction ;
tmp5 = _ _remoteFunction ;
}
2026-08-04 21:03:28 +00:00
if ( typeof tmp5 === "function" ) {
2026-07-29 08:29:29 +00:00
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleHostFunctionOnJS ;
} else {
_scheduleRemoteFunctionOnJS = outer1 _0 . _scheduleRemoteFunctionOnJS ;
}
fn = ( ) => {
const items = [ ... arguments ] ;
let shareableCloneOnUIRecursive ;
if ( items . length > 0 ) {
shareableCloneOnUIRecursive = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) . makeShareableCloneOnUIRecursive ( items ) ;
const obj = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) ;
}
_scheduleRemoteFunctionOnJS ( _ _remoteFunction , shareableCloneOnUIRecursive ) ;
} ;
}
obj = outer1 _1 ( outer1 _2 [ 3 ] ) ;
}
let items1 = [ _ _remoteFunction ] ;
HermesBuiltin . arraySpread ( items , 1 ) ;
return HermesBuiltin . apply ( items1 , undefined ) ;
}
fn = ( ) => {
const items = [ ... arguments ] ;
return queueMicrotask ( items . length ? ( ( ) => items ( ... items ) ) : items ) ;
} ;
} ;
} else {
let tmp4 = _ _remoteFunction ;
if ( _ _remoteFunction . _ _remoteFunction ) {
_ _remoteFunction = _ _remoteFunction . _ _remoteFunction ;
tmp4 = _ _remoteFunction ;
}
2026-08-04 21:03:28 +00:00
if ( typeof tmp4 === "function" ) {
2026-07-29 08:29:29 +00:00
let _scheduleRemoteFunctionOnJS = _ _remoteFunction . _scheduleHostFunctionOnJS ;
} else {
_scheduleRemoteFunctionOnJS = _ _remoteFunction . _scheduleRemoteFunctionOnJS ;
}
return ( ) => {
const items = [ ... arguments ] ;
let shareableCloneOnUIRecursive ;
if ( items . length > 0 ) {
shareableCloneOnUIRecursive = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) . makeShareableCloneOnUIRecursive ( items ) ;
const obj = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 2 ] ) ;
}
_scheduleRemoteFunctionOnJS ( _ _remoteFunction , shareableCloneOnUIRecursive ) ;
} ;
}
obj = _scheduleRemoteFunctionOnJS ( 1631 ) ;
}
}
return ( ) => {
const items = [ ... arguments ] ;
return queueMicrotask ( items . length ? ( ( ) => items ( ... items ) ) : items ) ;
} ;
}
runOnJS . _ _closure = { SHOULD _BE _USE _WEB : isJest , isWorkletFunction : require ( "isWorkletFunction" ) . isWorkletFunction , runWorkletOnJS , makeShareableCloneOnUIRecursive : require ( "freezeObjectInDev" ) . makeShareableCloneOnUIRecursive } ;
runOnJS . _ _workletHash = 4576792393858 ;
runOnJS . _ _initData = { code : "function runOnJS_Pnpm_threadsTs9(fun){const runOnJS_Pnpm_threadsTs9=this._recur;const{SHOULD_BE_USE_WEB,isWorkletFunction,runWorkletOnJS,makeShareableCloneOnUIRecursive}=this.__closure;if(SHOULD_BE_USE_WEB||!_WORKLET){return function(...args){return queueMicrotask(args.length?function(){return fun(...args);}:fun);};}if(isWorkletFunction(fun)){return function(...args){return runOnJS_Pnpm_threadsTs9(runWorkletOnJS)(fun,...args);};}if(fun.__remoteFunction){fun=fun.__remoteFunction;}const scheduleOnJS=typeof fun==='function'?global._scheduleHostFunctionOnJS:global._scheduleRemoteFunctionOnJS;return function(...args){scheduleOnJS(fun,args.length>0?makeShareableCloneOnUIRecursive(args):undefined);};}" } ;
export { setupMicrotasks } ;
export const callMicrotasks = callMicrotasksOnUIThread ;
export { runOnUI } ;
export function executeOnUIRuntimeSync ( arg0 ) {
let closure _0 = arg0 ;
return ( ) => {
const items = [ ... arguments ] ;
const ReanimatedModule = outer1 _1 ( outer1 _2 [ 1 ] ) . ReanimatedModule ;
let obj = outer1 _1 ( outer1 _2 [ 2 ] ) ;
const fn = function u ( ) {
const tmp = items ( ... items ) ;
return outer2 _1 ( outer2 _2 [ 2 ] ) . makeShareableCloneOnUIRecursive ( tmp ) ;
} ;
obj = { worklet : items , args : items , makeShareableCloneOnUIRecursive : outer1 _1 ( outer1 _2 [ 2 ] ) . makeShareableCloneOnUIRecursive } ;
fn . _ _closure = obj ;
fn . _ _workletHash = 6038069575410 ;
fn . _ _initData = outer1 _9 ;
return ReanimatedModule . executeOnUIRuntimeSync ( obj . makeShareableCloneRecursive ( fn ) ) ;
} ;
}
export { runOnUIImmediately } ;
export { runOnJS } ;