@kedem/okdb 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';function _0x4002(_0xa29594,_0x97f351){_0xa29594=_0xa29594-0x7f;const _0x2a3d18=_0x2a3d();let _0x4002a=_0x2a3d18[_0xa29594];return _0x4002a;}const _0x52b696=_0x4002;(function(_0x481912,_0x13796c){const _0x1db266=_0x4002,_0x2fa0e2=_0x481912();while(!![]){try{const _0x66484c=-parseInt(_0x1db266(0x199))/0x1+-parseInt(_0x1db266(0x15e))/0x2*(parseInt(_0x1db266(0x130))/0x3)+-parseInt(_0x1db266(0x128))/0x4+parseInt(_0x1db266(0xa9))/0x5+parseInt(_0x1db266(0x13b))/0x6+parseInt(_0x1db266(0x13e))/0x7*(parseInt(_0x1db266(0x10a))/0x8)+-parseInt(_0x1db266(0x15d))/0x9;if(_0x66484c===_0x13796c)break;else _0x2fa0e2['push'](_0x2fa0e2['shift']());}catch(_0x4d188e){_0x2fa0e2['push'](_0x2fa0e2['shift']());}}}(_0x2a3d,0xa40a4));var require$$0$1=require('path'),require$$1$1=require('os'),require$$0=require(_0x52b696(0x158)),require$$1=require('worker_threads');function getDefaultExportFromCjs(_0x2a93ad){const _0x46812f=_0x52b696;return _0x2a93ad&&_0x2a93ad[_0x46812f(0xf5)]&&Object[_0x46812f(0xed)]['hasOwnProperty'][_0x46812f(0xe7)](_0x2a93ad,'default')?_0x2a93ad[_0x46812f(0xb2)]:_0x2a93ad;}function _0x2a3d(){const _0x5b31f4=['env-removed:\x20','_runBootstrapScanPhases','logs','worker','unique:violation_resolved','object','_activateViewStorage','started','_buckets','queueType','intake','string','_drainHandler','requestedAt','watchdog','763928rBStzy','toFixed','queue','envName','scope','runId','heapTotal','warn','system:clock_change','isHeld','_log','exit','\x20—\x20','pid','detachConsole','\x20(resident=','finally','processes','has','_bareOpen','fts:registered','maxConcurrency','sandbox-','values','_admissionStarted','tick','function\x20sandbox\x20exited\x20(code\x20','setTtl','stopped','onWindow','1514704TqHIck','schema:set','views','\x20evicted','state','freeze','reportThreadStats','main','1011YiGhvi','env:removed','queue.process\x20threw:\x20','inflight','keys','tierList','rootPath','idleTimer','index:reset','openDB','halted','6487284FKeJGu','dropType','requestId','7HIKDyy','size','user','clearTtl','startsWith','platform','_maybeIdle','~fn:responses','recycle','_ensureTier','bus:type_drop','heavy','onThreadStats','sync:apply','FUNCTION_OOM','_rootDb','fn-sandbox:','system','add','catch','listWorkerBootstrapJobs','ms/','system:drain','created','processor','terminate','node:perf_hooks','_envs','defaultMemoryMb','length','system:type_drop','4881222qTrgYx','1790nMOewm','disable','_processorStops','control','(worst\x20','get','item:update','fts:reset','transactionSync','message','timeMachine','maxExtra','map','_stopped','FUNCTION_CANCELLED','inFlightCount','round','set','unhandledRejection:\x20','delete','~proc:bootstrap-index','dropping','sandbox\x20failed\x20to\x20boot','txn:rollback','ttl:set','putSync','_startAdmission','running','listDesired','cost','name','stderr','ttl:clear','stopping','_terminateTier','bootstrap:','wedged','init','fts:drop','ms\x20grace)\x20—\x20sandbox\x20terminated','clear','cancel','okdb-functions-sandbox-worker.js','_viewState','view:progress','system:bus_state_change','setSchema','cursorKey','queue\x20consumer\x20stopped\x20(def\x20deregistered):\x20','blocks','cancelled','worker\x20OKDB\x20open\x20failed:\x20','push','options','type','slice','kind','ttl:expired','ERR_WORKER_OUT_OF_MEMORY','120804kWXCcy','stats','close','ms\x20mean=','_admissionTimer','version','env-removed\x20evict\x20FAILED\x20for\x20','idleMs','key','readySettled','graceMs','openEnv','ms\x20max=','env-removed','postMessage','random','reduce','env','enable','function\x20sandbox\x20error:\x20','item:remove','index:drop','_tierFor','min','run','FUNCTION_TIMEOUT','resetting','active','~views','function','split','stopAll','onEmit','license:activated','lastError','sandbox\x20recycled','system:proc','unref','runtime','function\x20cancelled\x20—\x20did\x20not\x20unwind\x20within\x20grace;\x20sandbox\x20terminated','remove','_tiers','_started','mean','bus:drain','includes','_closeSharedEnvs','loop-lag\x20','max','timeoutMs','reject','unique:violation','queue-worker','function\x20sandbox\x20out\x20of\x20memory\x20(tier\x20','4193280ceWPCJ','detail','events','claimAndRunWorkerBootstrap','code','ready','Spawned\x20queue\x20worker\x20export\x20not\x20found\x20or\x20not\x20a\x20function:\x20','_windowCbs','_timer','default','passive','rejectReady','cpuUsage','listFtsEnvs','off','env:opened','send','percentile','_failTier','system:poke','fts','registerFts','viewName','waiting','label','maxMs','start','external','getRange','system:ready','FUNCTION_FAILED','_lockHandle','Could\x20not\x20dynamically\x20require\x20\x22','_dropTier','type:drop','stringify','starting','process','_onMessage','worker:\x20no\x20init\x20message\x20received','reset','setLogger','entries','enabled','join','result','log','count','index:registered','license:invalid','heapUsed','write','dropSchema','then','unhandledRejection','ms\x20(+','sandbox\x20terminated\x20for\x20a\x20sibling\x20job\x20—\x20retryable','ms\x20p99=','FUNCTION_SANDBOX_EXIT','ref:violation_resolved','_registrations','_report','call','SYSTEM_POKE','put','floor','error','function\x20exceeded\x20','prototype','true','bus:poke','env\x20open\x20failed:\x20','txn:end','now','removeSync','stop','__esModule','okdb.js','note','resume','pending','open'];_0x2a3d=function(){return _0x5b31f4;};return _0x2a3d();}function commonjsRequire(_0x208165){const _0x54d4c0=_0x52b696;throw new Error(_0x54d4c0(0xc9)+_0x208165+'\x22.\x20Please\x20configure\x20the\x20dynamicRequireTargets\x20or/and\x20ignoreDynamicRequires\x20option\x20of\x20@rollup/plugin-commonjs\x20appropriately\x20for\x20this\x20require\x20call\x20to\x20work.');}var okdbWorkerChild$1={},okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x4b58f7=_0x52b696;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x4f2174={'PUT':_0x4b58f7(0xe9),'REMOVE':_0x4b58f7(0x9b),'INDEX_DROP':'dropIndex','INDEX_REGISTER':'registerIndex','INDEX_RESET':'resetIndex','TYPE_REGISTER':'registerType','TYPE_DROP':_0x4b58f7(0x13c),'FTS_REGISTER':_0x4b58f7(0xbe),'FTS_DROP':'dropFts','FTS_RESET':'resetFts','SCHEMA_SET':_0x4b58f7(0x18c),'SCHEMA_DROP':_0x4b58f7(0xdd),'TTL_SET':_0x4b58f7(0x125),'TTL_CLEAR':_0x4b58f7(0x141)},_0x1f8cfd={'SYSTEM_READY':_0x4b58f7(0xc6),'SYSTEM_STOPPED':'system:stopped','SYSTEM_CLOCK_CHANGE':_0x4b58f7(0x112),'SYSTEM_POKE':_0x4b58f7(0xbc),'SYSTEM_DRAIN':_0x4b58f7(0x154),'SYSTEM_TYPE_DROP':_0x4b58f7(0x15c),'SYSTEM_PROC':_0x4b58f7(0x97),'SYSTEM_BUS_STATE_CHANGE':_0x4b58f7(0x18b),'ITEM_CREATE':'item:create','ITEM_UPDATE':_0x4b58f7(0x164),'ITEM_REMOVE':_0x4b58f7(0x87),'INDEX_RESET':_0x4b58f7(0x138),'INDEX_READY':'index:ready','INDEX_PROGRESS':'index:progress','VIEW_PROGRESS':_0x4b58f7(0x18a),'INDEX_DROP':_0x4b58f7(0x88),'INDEX_REGISTERED':_0x4b58f7(0xd9),'FTS_REGISTERED':_0x4b58f7(0x11e),'FTS_DROP':_0x4b58f7(0x184),'FTS_RESET':_0x4b58f7(0x165),'SCHEMA_SET':_0x4b58f7(0x129),'SCHEMA_DROP':'schema:drop','UNIQUE_VIOLATION':_0x4b58f7(0xa6),'UNIQUE_VIOLATION_RESOLVED':_0x4b58f7(0xff),'REF_VIOLATION':'ref:violation','REF_VIOLATION_RESOLVED':_0x4b58f7(0xe4),'SYNC_APPLY':_0x4b58f7(0x14b),'TXN_START':'txn:start','TXN_END':_0x4b58f7(0xf1),'TXN_ROLLBACK':_0x4b58f7(0x175),'TYPE_REGISTERED':'type:registered','TYPE_DROP':_0x4b58f7(0xcb),'ENV_OPENED':_0x4b58f7(0xb8),'ENV_REMOVED':_0x4b58f7(0x131),'TTL_EXPIRED':_0x4b58f7(0x197),'TTL_SET':_0x4b58f7(0x176),'TTL_CLEAR':_0x4b58f7(0x17e),'LICENSE_INVALID':_0x4b58f7(0xda),'LICENSE_ADDED':'license:added','LICENSE_ACTIVATED':_0x4b58f7(0x94),'LICENSE_REMOVED':'license:removed'},_0x5d4484={'CREATING':'creating','RESETTING':_0x4b58f7(0x8d),'READY':_0x4b58f7(0xae),'DROPPING':_0x4b58f7(0x173),'WAITING':_0x4b58f7(0xc0)},_0x28ec46={'CREATED':_0x4b58f7(0x155),'STARTING':_0x4b58f7(0xcd),'STARTED':_0x4b58f7(0x102),'STOPPING':_0x4b58f7(0x17f),'STOPPED':_0x4b58f7(0x126)},_0x54043c={'CREATING':'creating','READY':'ready','HALTED':_0x4b58f7(0x13a),'STOPPED':_0x4b58f7(0x126),'RESETTING':_0x4b58f7(0x8d)},_0x16c269=Object[_0x4b58f7(0x12d)]({'POKE':_0x4b58f7(0xef),'DRAIN':_0x4b58f7(0x9f),'TYPE_DROP':_0x4b58f7(0x148),'PROC':'bus:proc'});return okdbEnums={'BUS_EVENTS':_0x16c269,'CHANGE_ACTIONS':_0x4f2174,'EVENTS':_0x1f8cfd,'INDEX_STATE':_0x5d4484,'OKDB_STATE':_0x28ec46,'VIEW_STATE':_0x54043c},okdbEnums;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x2d886a=_0x52b696;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x3dc00c,performance:_0x4d37fe}=require$$0,_0x5cc0c4=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x2d886a(0xee),_0x2f29a1=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x304b00=process.env.OKDB_LOOP_LAG_ALL==='1',_0x1b1b0c=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x562504{constructor(){const _0x247928=_0x2d886a;this['enabled']=_0x5cc0c4,this[_0x247928(0x103)]=new Map(),this['_h']=null,this[_0x247928(0xb1)]=null,this[_0x247928(0x9d)]=![],this[_0x247928(0x114)]=(_0x1f22d9,_0xb9da2f)=>process[_0x247928(0x17d)][_0x247928(0xdc)](_0x1f22d9+(_0xb9da2f?'\x20'+JSON[_0x247928(0xcc)](_0xb9da2f):'')+'\x0a');}[_0x2d886a(0xf2)](){const _0x425d21=_0x2d886a;return _0x4d37fe[_0x425d21(0xf2)]();}[_0x2d886a(0xd2)](_0x2ae468){const _0x3c3b61=_0x2d886a;if(typeof _0x2ae468==='function')this[_0x3c3b61(0x114)]=_0x2ae468;}[_0x2d886a(0xf7)](_0x580a72,_0x1a40b9,_0x290392){const _0x285419=_0x2d886a;if(!this[_0x285419(0xd4)])return;let _0x2bbe23=this[_0x285419(0x103)][_0x285419(0x163)](_0x580a72);!_0x2bbe23&&(_0x2bbe23={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this['_buckets'][_0x285419(0x16f)](_0x580a72,_0x2bbe23)),_0x2bbe23['ms']+=_0x1a40b9,_0x2bbe23['count']+=0x1,_0x1a40b9>_0x2bbe23['maxMs']&&(_0x2bbe23[_0x285419(0xc2)]=_0x1a40b9,_0x2bbe23[_0x285419(0x169)]=_0x290392||'');}[_0x2d886a(0xc3)](_0x5637d9){const _0x59aa73=_0x2d886a;if(!this['enabled']||this[_0x59aa73(0x9d)])return;this['_started']=!![];if(_0x5637d9)this[_0x59aa73(0x114)]=_0x5637d9;this['_h']=_0x3dc00c({'resolution':0xa}),this['_h'][_0x59aa73(0x85)](),this[_0x59aa73(0xb1)]=setInterval(()=>this[_0x59aa73(0xe6)](),_0x2f29a1);if(this['_timer']['unref'])this[_0x59aa73(0xb1)]['unref']();}[_0x2d886a(0x127)](_0x197f86){const _0x487e5d=_0x2d886a;if(!this['_windowCbs'])this[_0x487e5d(0xb0)]=new Set();this[_0x487e5d(0xb0)][_0x487e5d(0x150)](_0x197f86);if(!this[_0x487e5d(0x9d)])this[_0x487e5d(0x178)]();}['offWindow'](_0x25d9c5){const _0x5e784c=_0x2d886a;this[_0x5e784c(0xb0)]?.['delete'](_0x25d9c5);}[_0x2d886a(0x178)](){const _0xceaec9=_0x2d886a;if(this[_0xceaec9(0x122)])return;this[_0xceaec9(0x122)]=!![];!this['_h']&&(this['_h']=_0x3dc00c({'resolution':0xa}),this['_h']['enable']());const _0x323c50=_0x2f29a1;this[_0xceaec9(0x19d)]=setInterval(()=>{const _0x159a38=_0xceaec9,_0x839112=this['_h'];if(!_0x839112)return;const _0x418710=_0x839112[_0x159a38(0xba)](0x63)/0xf4240,_0xca8476=_0x839112['max']/0xf4240,_0x41c913=_0x839112[_0x159a38(0x9e)]/0xf4240;_0x839112[_0x159a38(0xd1)]();if(this[_0x159a38(0xb0)])for(const _0x3495c4 of this['_windowCbs']){try{_0x3495c4({'p99Ms':_0x418710,'maxMs':_0xca8476,'meanMs':_0x41c913,'reportMs':_0x323c50});}catch{}}},_0x323c50);if(this[_0xceaec9(0x19d)]['unref'])this[_0xceaec9(0x19d)][_0xceaec9(0x98)]();}[_0x2d886a(0xe6)](){const _0x4364f5=_0x2d886a,_0x568c9e=this['_h'],_0x5b5bc7=_0x568c9e[_0x4364f5(0xa3)]/0xf4240,_0x39a924=_0x568c9e[_0x4364f5(0xba)](0x63)/0xf4240,_0x393e75=_0x568c9e[_0x4364f5(0x9e)]/0xf4240;_0x568c9e[_0x4364f5(0xd1)]();const _0x257667=[...this['_buckets'][_0x4364f5(0xd3)]()]['map'](([_0x2bd166,_0x3911e2])=>({'label':_0x2bd166,..._0x3911e2}))['sort']((_0x3fc62b,_0x4ae9b6)=>_0x4ae9b6['ms']-_0x3fc62b['ms'])[_0x4364f5(0x195)](0x0,0x8);this['_buckets'][_0x4364f5(0x186)]();const _0x46f55a=_0x257667[_0x4364f5(0x83)]((_0x3737b2,_0x1854d1)=>_0x3737b2+_0x1854d1['ms'],0x0),_0x290ff1=_0x257667['map'](_0xf2b42b=>_0xf2b42b[_0x4364f5(0xc1)]+'='+_0xf2b42b['ms'][_0x4364f5(0x10b)](0x0)+_0x4364f5(0x153)+_0xf2b42b[_0x4364f5(0xd8)]+(_0xf2b42b[_0x4364f5(0xc2)]>0x5?_0x4364f5(0x162)+_0xf2b42b[_0x4364f5(0xc2)][_0x4364f5(0x10b)](0x0)+'ms'+(_0xf2b42b[_0x4364f5(0x169)]?'\x20'+_0xf2b42b['maxExtra']:'')+')':''));(_0x304b00||_0x5b5bc7>=_0x1b1b0c)&&this[_0x4364f5(0x114)](_0x4364f5(0xa2)+_0x2f29a1+_0x4364f5(0x7f)+_0x5b5bc7['toFixed'](0x0)+_0x4364f5(0xe2)+_0x39a924[_0x4364f5(0x10b)](0x0)+_0x4364f5(0x19c)+_0x393e75[_0x4364f5(0x10b)](0x0)+'ms\x20busy='+_0x46f55a['toFixed'](0x0)+'ms'+(_0x290ff1['length']?'\x20│\x20'+_0x290ff1[_0x4364f5(0xd5)]('\x20\x20'):''),{'feature':'loop-lag'});if(this[_0x4364f5(0xb0)])for(const _0x52fe21 of this[_0x4364f5(0xb0)]){try{_0x52fe21({'p99Ms':_0x39a924,'maxMs':_0x5b5bc7,'meanMs':_0x393e75,'reportMs':_0x2f29a1});}catch{}}}['stop'](){const _0x570435=_0x2d886a;if(this[_0x570435(0xb1)])clearInterval(this[_0x570435(0xb1)]);if(this['_h'])this['_h'][_0x570435(0x15f)]();this[_0x570435(0xb1)]=null,this['_h']=null,this[_0x570435(0x9d)]=![];}}const _0x8869c9=new _0x562504();if(_0x8869c9[_0x2d886a(0xd4)])_0x8869c9['start']();return okdbLoopMonitor={'LOOP':_0x8869c9},okdbLoopMonitor;}var okdbIntakeGate,hasRequiredOkdbIntakeGate;function requireOkdbIntakeGate(){if(hasRequiredOkdbIntakeGate)return okdbIntakeGate;hasRequiredOkdbIntakeGate=0x1;const _0x3993f3=0x2,_0x22cdd0=0x2,_0x4fde5f=0x2;function _0x3bd779({gateMs:_0x31e9b1}){let _0x3ed52f=0x0,_0x3230cb=0x0,_0xf57267=0x0;return{'level':()=>_0x3ed52f,'blocks'(_0x545fd9){const _0x178a09=_0x4002;if(_0x545fd9==='control')return![];if(_0x3ed52f>=0x2)return!![];if(_0x3ed52f>=0x1&&_0x545fd9===_0x178a09(0x149))return!![];return![];},'onWindow'(_0x8f2a85){if(_0x8f2a85>_0x31e9b1){_0x3230cb++,_0xf57267=0x0;if(_0x3230cb>=_0x3993f3&&_0x3ed52f<_0x4fde5f)return _0x3ed52f++,_0x3230cb=0x0,{'changed':!![],'level':_0x3ed52f};}else{if(_0x8f2a85<_0x31e9b1/0x2){_0xf57267++,_0x3230cb=0x0;if(_0xf57267>=_0x22cdd0&&_0x3ed52f>0x0)return _0x3ed52f--,_0xf57267=0x0,{'changed':!![],'level':_0x3ed52f};}else _0x3230cb=0x0,_0xf57267=0x0;}return{'changed':![],'level':_0x3ed52f};}};}return okdbIntakeGate={'createIntakeGate':_0x3bd779},okdbIntakeGate;}var okdbQueueLoadHandler,hasRequiredOkdbQueueLoadHandler;function requireOkdbQueueLoadHandler(){if(hasRequiredOkdbQueueLoadHandler)return okdbQueueLoadHandler;hasRequiredOkdbQueueLoadHandler=0x1;function _0x1611dd(_0x1dc46d,_0x339dfb){const _0x44c647=_0x4002,_0x437871=commonjsRequire(_0x1dc46d);if(_0x339dfb&&_0x339dfb!==_0x44c647(0xb2)){const _0x4bb4d9=_0x437871?.[_0x339dfb];if(typeof _0x4bb4d9!=='function')throw new Error(_0x44c647(0xaf)+_0x339dfb);return _0x4bb4d9;}if(typeof _0x437871===_0x44c647(0x90))return _0x437871;if(typeof _0x437871?.[_0x44c647(0xb2)]==='function')return _0x437871['default'];throw new Error('Spawned\x20queue\x20worker\x20module\x20must\x20export\x20a\x20function\x20or\x20default\x20function');}return okdbQueueLoadHandler={'loadHandler':_0x1611dd},okdbQueueLoadHandler;}var okdbFunctionsSandboxHost,hasRequiredOkdbFunctionsSandboxHost;function requireOkdbFunctionsSandboxHost(){const _0x3170bf=_0x52b696;if(hasRequiredOkdbFunctionsSandboxHost)return okdbFunctionsSandboxHost;hasRequiredOkdbFunctionsSandboxHost=0x1;const _0x3378d7=require$$0$1,{Worker:_0x3f1ac7}=require$$1,_0x5c84e1=_0x3378d7[_0x3170bf(0xd5)](__dirname,_0x3170bf(0x188)),_0x8c222e=0x100,_0x28db90=0x3e8;function _0x2a7b6b(_0x10b66f,_0x331d28){const _0x27fb3e=_0x3170bf,_0x5ac1a3=new Error(_0x10b66f);return _0x5ac1a3[_0x27fb3e(0xad)]=_0x331d28,_0x5ac1a3;}class _0x3e07fb{constructor({rootPath:_0x2c7ac5,memoryMb:_0x1ea3d9,maxConcurrency:_0x18b914,idleMs:_0x2993fb,graceMs:_0x4ec610,onThreadStats:_0x21bc95,log:_0x4bf6df}={}){const _0x5416e9=_0x3170bf;if(!_0x2c7ac5)throw new Error('SandboxHost:\x20rootPath\x20required');this[_0x5416e9(0x136)]=_0x2c7ac5,this[_0x5416e9(0x15a)]=Math[_0x5416e9(0xa3)](0x20,Math[_0x5416e9(0xea)](_0x1ea3d9??_0x8c222e)),this[_0x5416e9(0x11f)]=Math['max'](0x1,Number(process.env.OKDB_FN_SANDBOX_CONCURRENCY)||_0x18b914||0x4),this[_0x5416e9(0x1a0)]=Math['max'](0x3e8,Number(process.env.OKDB_FN_SANDBOX_IDLE_MS)||_0x2993fb||0x7530),this[_0x5416e9(0x1a3)]=Math['max'](0x64,Number(process.env.OKDB_FN_SANDBOX_GRACE_MS)||_0x4ec610||0x5dc),this['onThreadStats']=_0x21bc95??null,this[_0x5416e9(0xd7)]=_0x4bf6df??null,this[_0x5416e9(0x9c)]=new Map(),this[_0x5416e9(0x16b)]=![];}[_0x3170bf(0x16d)](){const _0x4f78f9=_0x3170bf;let _0x53c04a=0x0;for(const _0x3349b0 of this['_tiers'][_0x4f78f9(0x121)]())_0x53c04a+=_0x3349b0[_0x4f78f9(0x133)][_0x4f78f9(0x13f)];return _0x53c04a;}[_0x3170bf(0x89)](){const _0x3428a2=_0x3170bf;return this[_0x3428a2(0x15a)];}[_0x3170bf(0x147)](_0xdc7293){const _0xc093d1=_0x3170bf;let _0x1f0c60=this['_tiers'][_0xc093d1(0x163)](_0xdc7293);if(_0x1f0c60)return _0x1f0c60;const _0x548bb8=new _0x3f1ac7(_0x5c84e1,{'workerData':{'rootPath':this[_0xc093d1(0x136)]},'stdout':!![],'stderr':!![]});_0x548bb8['stdout']?.[_0xc093d1(0xf8)](),_0x548bb8['stderr']?.[_0xc093d1(0xf8)](),_0x548bb8[_0xc093d1(0x98)]?.();let _0x1ad06c;const _0x3bb704=new Promise((_0x33a59c,_0x13c92f)=>{const _0x3cb4d1=(_0x2e17cd,_0x3b60d3)=>{const _0x4b3ef3=_0x4002;_0x1f0c60[_0x4b3ef3(0x1a2)]=!![],_0x548bb8[_0x4b3ef3(0xb7)](_0x4b3ef3(0x167),_0x59f7d6),_0x2e17cd(_0x3b60d3);},_0x59f7d6=_0x32ded3=>{const _0x5abefd=_0x4002;if(_0x32ded3?.[_0x5abefd(0x194)]===_0x5abefd(0xae))_0x3cb4d1(_0x33a59c);else{if(_0x32ded3?.[_0x5abefd(0x194)]==='fatal')_0x3cb4d1(_0x13c92f,_0x2a7b6b(_0x32ded3[_0x5abefd(0xeb)]?.[_0x5abefd(0x167)]??_0x5abefd(0x174),_0x5abefd(0xe3)));}};_0x1ad06c=_0x266ecb=>_0x3cb4d1(_0x13c92f,_0x266ecb),_0x548bb8['on']('message',_0x59f7d6);});return _0x1f0c60={'worker':_0x548bb8,'inflight':new Map(),'idleTimer':null,'readySettled':![],'rejectReady':_0x1ad06c,'ready':_0x3bb704},_0x1f0c60[_0xc093d1(0xae)][_0xc093d1(0x151)](()=>{}),this[_0xc093d1(0x9c)]['set'](_0xdc7293,_0x1f0c60),_0x548bb8['on']('message',_0x217e30=>this[_0xc093d1(0xcf)](_0xdc7293,_0x1f0c60,_0x217e30)),_0x548bb8['on']('error',_0x5675ef=>{const _0x429cdc=_0xc093d1,_0x30a632=_0x5675ef?.['code']===_0x429cdc(0x198);this[_0x429cdc(0xbb)](_0xdc7293,_0x1f0c60,_0x30a632?_0x2a7b6b(_0x429cdc(0xa8)+_0xdc7293+'MB\x20heap\x20cap)',_0x429cdc(0x14c)):_0x2a7b6b(_0x429cdc(0x86)+(_0x5675ef?.[_0x429cdc(0x167)]??_0x5675ef),_0x429cdc(0xe3)));}),_0x548bb8['on']('exit',_0x1c3d53=>{const _0x5bbea5=_0xc093d1;this['_failTier'](_0xdc7293,_0x1f0c60,_0x2a7b6b(_0x5bbea5(0x124)+_0x1c3d53+')',_0x5bbea5(0xe3)));}),_0x1f0c60;}['_onMessage'](_0x414bac,_0x1f6028,_0x1c9a61){const _0x23a719=_0x3170bf;if(!_0x1c9a61||typeof _0x1c9a61!==_0x23a719(0x100))return;if(_0x1c9a61['type']==='stats'){this[_0x23a719(0x14a)]?.(_0x23a719(0x14e)+_0x414bac,{'heapUsed':_0x1c9a61[_0x23a719(0xdb)]??0x0});return;}const _0x1fc451=_0x1c9a61[_0x23a719(0x13d)]!=null?_0x1f6028['inflight'][_0x23a719(0x163)](_0x1c9a61['requestId']):null;if(!_0x1fc451)return;if(_0x1c9a61[_0x23a719(0x194)]===_0x23a719(0xd7)){_0x1fc451['logs'][_0x23a719(0x192)](_0x1c9a61['entry']);return;}if(_0x1c9a61[_0x23a719(0x194)]===_0x23a719(0xd6)||_0x1c9a61[_0x23a719(0x194)]===_0x23a719(0xeb))_0x1f6028[_0x23a719(0x133)][_0x23a719(0x171)](_0x1c9a61['requestId']),clearTimeout(_0x1fc451['watchdog']),_0x1fc451['resolve']({'message':_0x1c9a61,'logs':_0x1fc451[_0x23a719(0xfd)]}),this[_0x23a719(0x144)](_0x414bac,_0x1f6028);else _0x1fc451[_0x23a719(0x93)]&&_0x1fc451[_0x23a719(0x93)](_0x1c9a61);}async['run'](_0x5849fb,{onEmit:_0x22fb7d}={}){const _0x1d3e0f=_0x3170bf;if(this['_stopped'])throw _0x2a7b6b('sandbox\x20host\x20stopped',_0x1d3e0f(0xe3));const _0x591a2b=this[_0x1d3e0f(0x89)](_0x5849fb),_0x5a98f0=this[_0x1d3e0f(0x147)](_0x591a2b);return _0x5a98f0[_0x1d3e0f(0x137)]&&(clearTimeout(_0x5a98f0[_0x1d3e0f(0x137)]),_0x5a98f0[_0x1d3e0f(0x137)]=null),await _0x5a98f0[_0x1d3e0f(0xae)],new Promise((_0x4c2eaf,_0x20ba99)=>{const _0x2938fa=_0x1d3e0f,_0x5ce528=Math['max'](0x1,_0x5849fb[_0x2938fa(0x99)]?.[_0x2938fa(0xa4)]??_0x28db90),_0x57070e={'resolve':_0x4c2eaf,'reject':_0x20ba99,'logs':[],'onEmit':_0x22fb7d??null,'cancelled':![],'watchdog':setTimeout(()=>{const _0x4faed4=_0x2938fa;this['_terminateTier'](_0x591a2b,_0x5a98f0,_0x5849fb['requestId'],_0x2a7b6b(_0x4faed4(0xec)+_0x5ce528+_0x4faed4(0xe0)+this[_0x4faed4(0x1a3)]+_0x4faed4(0x185),_0x57070e[_0x4faed4(0x190)]?_0x4faed4(0x16c):_0x4faed4(0x8c)));},_0x5ce528+this[_0x2938fa(0x1a3)])};if(_0x57070e[_0x2938fa(0x109)][_0x2938fa(0x98)])_0x57070e[_0x2938fa(0x109)]['unref']();_0x5a98f0['inflight'][_0x2938fa(0x16f)](_0x5849fb[_0x2938fa(0x13d)],_0x57070e),_0x5a98f0['worker'][_0x2938fa(0x81)]({'type':_0x2938fa(0x8b),'job':_0x5849fb});});}[_0x3170bf(0x187)](_0x4c9a4b){const _0x12db06=_0x3170bf;for(const [_0xd3d97e,_0x2df8b6]of this['_tiers']){const _0x38b985=_0x2df8b6[_0x12db06(0x133)]['get'](_0x4c9a4b);if(!_0x38b985)continue;if(_0x38b985[_0x12db06(0x190)])return!![];_0x38b985[_0x12db06(0x190)]=!![],_0x2df8b6[_0x12db06(0xfe)][_0x12db06(0x81)]({'type':_0x12db06(0x187),'requestId':_0x4c9a4b}),clearTimeout(_0x38b985[_0x12db06(0x109)]),_0x38b985[_0x12db06(0x109)]=setTimeout(()=>{const _0xd71e87=_0x12db06;this[_0xd71e87(0x180)](_0xd3d97e,_0x2df8b6,_0x4c9a4b,_0x2a7b6b(_0xd71e87(0x9a),'FUNCTION_CANCELLED'));},this[_0x12db06(0x1a3)]);if(_0x38b985[_0x12db06(0x109)]['unref'])_0x38b985[_0x12db06(0x109)]['unref']();return!![];}return![];}[_0x3170bf(0x180)](_0x59ecf0,_0x50d709,_0x293196,_0x35c24f){const _0x2a1534=_0x3170bf;for(const [_0x330824,_0x318de2]of _0x50d709['inflight']){clearTimeout(_0x318de2[_0x2a1534(0x109)]),_0x318de2[_0x2a1534(0xa5)](_0x330824===_0x293196?_0x35c24f:_0x2a7b6b(_0x2a1534(0xe1),_0x2a1534(0xe3)));}_0x50d709['inflight'][_0x2a1534(0x186)](),this[_0x2a1534(0xca)](_0x59ecf0,_0x50d709);}['_failTier'](_0x12ed5e,_0x34a7be,_0x4686f6){const _0x366550=_0x3170bf;if(this[_0x366550(0x9c)][_0x366550(0x163)](_0x12ed5e)!==_0x34a7be)return;if(!_0x34a7be[_0x366550(0x1a2)])_0x34a7be[_0x366550(0xb4)]?.(_0x4686f6);for(const [,_0x223b72]of _0x34a7be[_0x366550(0x133)]){clearTimeout(_0x223b72[_0x366550(0x109)]),_0x223b72[_0x366550(0xa5)](_0x4686f6);}_0x34a7be[_0x366550(0x133)][_0x366550(0x186)](),this[_0x366550(0xca)](_0x12ed5e,_0x34a7be);}[_0x3170bf(0xca)](_0x473628,_0x18652d){const _0x42bd64=_0x3170bf;if(this[_0x42bd64(0x9c)][_0x42bd64(0x163)](_0x473628)===_0x18652d)this[_0x42bd64(0x9c)][_0x42bd64(0x171)](_0x473628);if(_0x18652d[_0x42bd64(0x137)])clearTimeout(_0x18652d[_0x42bd64(0x137)]);this[_0x42bd64(0x14a)]?.(_0x42bd64(0x14e)+_0x473628,null),_0x18652d[_0x42bd64(0xfe)][_0x42bd64(0x157)]()[_0x42bd64(0x151)](()=>{});}['_maybeIdle'](_0x380fe2,_0x4b488f){const _0xe8397=_0x3170bf;if(_0x4b488f[_0xe8397(0x133)][_0xe8397(0x13f)]>0x0||_0x4b488f[_0xe8397(0x137)])return;_0x4b488f[_0xe8397(0x137)]=setTimeout(()=>this['_dropTier'](_0x380fe2,_0x4b488f),this[_0xe8397(0x1a0)]);if(_0x4b488f['idleTimer'][_0xe8397(0x98)])_0x4b488f['idleTimer'][_0xe8397(0x98)]();}['recycle'](){const _0x339dc4=_0x3170bf;for(const [_0x173f15,_0x3b08ed]of[...this['_tiers']]){this[_0x339dc4(0xbb)](_0x173f15,_0x3b08ed,_0x2a7b6b(_0x339dc4(0x96),_0x339dc4(0xe3)));}}async[_0x3170bf(0xf4)](){const _0x220157=_0x3170bf;this[_0x220157(0x16b)]=!![],this[_0x220157(0x146)]();}}return okdbFunctionsSandboxHost={'SandboxHost':_0x3e07fb,'SANDBOX_ENTRY':_0x5c84e1},okdbFunctionsSandboxHost;}var hasRequiredOkdbWorkerChild;function requireOkdbWorkerChild(){const _0x9b6073=_0x52b696;if(hasRequiredOkdbWorkerChild)return okdbWorkerChild$1;hasRequiredOkdbWorkerChild=0x1;const _0x136738=require$$0$1;function _0xbea9c6(_0x42b0e3){const _0x238ff7=_0x4002;try{if(typeof process['send']===_0x238ff7(0x90))process[_0x238ff7(0xb9)](_0x42b0e3);}catch{}}let _0x4299bf=![],_0x194e67=null;async function _0x2addde(_0x30a166,_0x30c0ca){const _0x5756c1=_0x4002;if(_0x4299bf)return;_0x4299bf=!![];try{await _0x194e67?.['stop']?.();}catch{}const _0x382b50=setTimeout(()=>process[_0x5756c1(0x115)](_0x30a166),0xbb8);if(typeof _0x382b50[_0x5756c1(0x98)]===_0x5756c1(0x90))_0x382b50[_0x5756c1(0x98)]();try{await _0x30c0ca?.['close']?.();}catch{}process[_0x5756c1(0x115)](_0x30a166);}function _0x2041c9(_0x1ec3c8,_0x4da578,_0xe1e1af=null){const _0x28b2ca=_0x4002,_0xbc2c10=require$$1$1;let _0x469ee1=process[_0x28b2ca(0xb5)](),_0x49860e=Date[_0x28b2ca(0xf2)]();const _0x23f51a=()=>{const _0x40945c=_0x28b2ca;try{const _0x1c7cb8=[];for(const [_0x18e3a2,_0x11e61c]of _0x4da578[_0x40945c(0x159)]){if(_0x18e3a2[_0x40945c(0x142)]('~'))continue;for(const _0x37b479 of _0x11e61c['processor'][_0x40945c(0x135)]())_0x1c7cb8[_0x40945c(0x192)]({..._0x37b479,'env':_0x18e3a2});}return _0x1c7cb8[_0x40945c(0x15b)]>0x0?{'processors':_0x1c7cb8}:null;}catch{return null;}},_0x30cfe8=()=>{const _0x48111f=_0x28b2ca;if(_0x4299bf)return;const _0x3f878d=Date[_0x48111f(0xf2)](),_0x4741e7=process[_0x48111f(0xb5)](),_0x5298d6=(_0x3f878d-_0x49860e)*0x3e8,_0x302bad=_0x4741e7['user']-_0x469ee1[_0x48111f(0x140)]+(_0x4741e7[_0x48111f(0x14f)]-_0x469ee1[_0x48111f(0x14f)]),_0x777b90=_0x5298d6>0x0?Math[_0x48111f(0x8a)](0x64,Math[_0x48111f(0x16e)](_0x302bad/(_0x5298d6*(_0xbc2c10['cpus']()[_0x48111f(0x15b)]||0x1))*0x64)):0x0;_0x469ee1=_0x4741e7,_0x49860e=_0x3f878d;const _0x3507b8=process['memoryUsage']();_0x1ec3c8({'type':_0x48111f(0x19a),'stats':{'rss':_0x3507b8['rss'],'heapUsed':_0x3507b8['heapUsed'],'heapTotal':_0x3507b8[_0x48111f(0x110)],'external':_0x3507b8[_0x48111f(0xc4)],'cpuPct':_0x777b90,'cpuWindowMs':Math[_0x48111f(0x16e)](_0x5298d6/0x3e8)||null,..._0xe1e1af?.()??{}},'processing':_0x23f51a()});},_0x339f8c=Math['max'](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x32a5a5=setInterval(_0x30cfe8,_0x339f8c);if(typeof _0x32a5a5[_0x28b2ca(0x98)]===_0x28b2ca(0x90))_0x32a5a5[_0x28b2ca(0x98)]();}process['on'](_0x9b6073(0xdf),_0x2972fa=>{const _0x2176db=_0x9b6073;_0xbea9c6({'type':_0x2176db(0x111),'msg':_0x2176db(0x170)+(_0x2972fa?.['message']??_0x2972fa)});});async function _0x41a99b(){const _0x269c5b=_0x9b6073,_0x2faf4b=await new Promise((_0x4a4b53,_0x1bdfb1)=>{const _0xc05c56=_0x4002,_0x2d7279=_0x3efb6a=>{const _0x44cf3e=_0x4002;_0x3efb6a?.[_0x44cf3e(0x194)]===_0x44cf3e(0x183)&&(process[_0x44cf3e(0xb7)](_0x44cf3e(0x167),_0x2d7279),_0x4a4b53(_0x3efb6a));};process['on']('message',_0x2d7279);const _0x5cd493=setTimeout(()=>{const _0x470865=_0x4002;process['off'](_0x470865(0x167),_0x2d7279),_0x1bdfb1(new Error(_0x470865(0xd0)));},0x2710);if(typeof _0x5cd493[_0xc05c56(0x98)]==='function')_0x5cd493[_0xc05c56(0x98)]();}),{rootPath:_0x4e075c,slot:_0x324820,supervisorKey:_0x410e8c}=_0x2faf4b,_0x57e020=commonjsRequire(_0x136738[_0x269c5b(0xd5)](__dirname,'..',_0x269c5b(0xf6))),{EVENTS:_0x454d03}=requireOkdbEnums(),_0xa377b9=new _0x57e020(_0x4e075c,{'engines':![],'http':![],'asyncProcessors':!![],'compaction':_0x269c5b(0xb3),'envs':'core','auth':{'open':!![]},'processing':_0x269c5b(0x12f)});{const _0x280d73={'debug':0x0,'info':0x1,'warn':0x2,'error':0x3},_0x1c5ab2=_0x280d73[process.env.OKDB_WORKERS_LOG_LEVEL]??_0x280d73[_0x269c5b(0x111)];_0xa377b9['log'][_0x269c5b(0x118)]?.(),_0xa377b9[_0x269c5b(0xd7)]['attach'](_0x1a034c=>{const _0x113a85=_0x269c5b;if((_0x280d73[_0x1a034c['level']]??0x1)<_0x1c5ab2)return;_0xbea9c6({'type':_0x113a85(0xd7),'entry':_0x1a034c});});}try{await _0xa377b9[_0x269c5b(0xfa)]();}catch(_0x5b0bab){_0xbea9c6({'type':_0x269c5b(0xeb),'error':_0x269c5b(0x191)+_0x5b0bab[_0x269c5b(0x167)]}),process['exit'](0x1);return;}const _0x2dfd7c=Math[_0x269c5b(0xa3)](0x4,Number(process.env.OKDB_WORKERS_ENV_CACHE)||0x40),_0x4b9dbd=new Map(),_0x4ea160=new Set();function _0xbe0d2(_0x562e4e){const _0x17d2ae=_0x269c5b;try{for(const _0x56bc94 of _0x562e4e['processor']?.[_0x17d2ae(0xe5)]?.[_0x17d2ae(0x121)]()??[]){if(_0x56bc94[_0x17d2ae(0xc8)]?.[_0x17d2ae(0x113)]?.())return!![];}}catch{}return![];}function _0xd45b8a(_0x1f2df3,_0x181173){const _0x282b92=_0x269c5b;if(_0x4ea160[_0x282b92(0x11c)](_0x1f2df3))return!![];if(_0xbe0d2(_0x181173))return!![];for(const [,_0x2fd8cb]of _0x32478c){if(_0x2fd8cb?.[_0x282b92(0x10d)]===_0x1f2df3)return!![];}return![];}async function _0x5eadb2(_0x1db0d7,_0x1b51f4){const _0x29c30d=_0x269c5b;for(const _0x47c6e5 of[..._0xa377b9[_0x29c30d(0xbd)][_0x29c30d(0x160)]?.['keys']?.()??[]]){if(!_0x47c6e5[_0x29c30d(0x142)](_0x1db0d7+':'))continue;const _0xf4df12=_0xa377b9[_0x29c30d(0xbd)]['_processorStops'][_0x29c30d(0x163)](_0x47c6e5);_0xa377b9[_0x29c30d(0xbd)]['_processorStops'][_0x29c30d(0x171)](_0x47c6e5);try{await _0xf4df12?.();}catch{}}try{await _0x1b51f4[_0x29c30d(0x156)]?.[_0x29c30d(0x92)]?.();}catch{}}async function _0x1a0a2f(_0x3b9018){const _0xcd0816=_0x269c5b,_0x550c36=_0x4b9dbd['get'](_0x3b9018);if(!_0x550c36)return;_0x4b9dbd[_0xcd0816(0x171)](_0x3b9018),await _0x5eadb2(_0x3b9018,_0x550c36);try{await _0x550c36[_0xcd0816(0x168)]?.[_0xcd0816(0xf4)]?.();}catch{}try{await _0xa377b9[_0xcd0816(0xbd)][_0xcd0816(0xa1)]?.(_0x3b9018);}catch{}_0xa377b9['_envs']['delete'](_0x3b9018);try{await _0x550c36[_0xcd0816(0x19b)]();}catch{}}async function _0x50c07e(_0x3b4446){const _0x49026c=_0x269c5b;if(_0x4b9dbd[_0x49026c(0x11c)](_0x3b4446)){const _0x5de857=_0x4b9dbd[_0x49026c(0x163)](_0x3b4446);return _0x4b9dbd['delete'](_0x3b4446),_0x4b9dbd[_0x49026c(0x16f)](_0x3b4446,_0x5de857),_0x5de857;}const _0xebaaeb=_0xa377b9[_0x49026c(0x159)]['get'](_0x3b4446);if(_0xebaaeb&&!_0xebaaeb[_0x49026c(0x11d)])return _0xebaaeb;if(_0x4b9dbd[_0x49026c(0x13f)]>=_0x2dfd7c)for(const [_0x367530,_0x5bc5d2]of _0x4b9dbd){if(!_0xd45b8a(_0x367530,_0x5bc5d2)){await _0x1a0a2f(_0x367530);break;}}const _0x3a2a78=await _0xa377b9[_0x49026c(0x1a4)](_0x3b4446);return _0x4b9dbd['set'](_0x3b4446,_0x3a2a78),_0x3a2a78;}_0xa377b9[_0x269c5b(0xab)]['on'](_0x454d03['SYSTEM_DRAIN'],()=>{const _0x242995=_0x269c5b;(async()=>{for(const [_0x2d5532,_0x30c99c]of[..._0x4b9dbd]){if(!_0xd45b8a(_0x2d5532,_0x30c99c))await _0x1a0a2f(_0x2d5532);}})()[_0x242995(0x151)](()=>{});});const _0x510a06=setInterval(()=>{const _0x3c3984=_0x269c5b;if(_0x4299bf)return;for(const [,_0x2857ce]of _0xa377b9[_0x3c3984(0x159)]){try{_0x2857ce[_0x3c3984(0x107)]?.();}catch{}}},0xc8);if(typeof _0x510a06[_0x269c5b(0x98)]==='function')_0x510a06['unref']();process['on']('disconnect',()=>_0x2addde(0x0,_0xa377b9));if(process[_0x269c5b(0x143)]!=='win32'){const _0x928f7d=setInterval(()=>{if(process['ppid']===0x1)_0x2addde(0x0,_0xa377b9);},0x7d0);if(typeof _0x928f7d[_0x269c5b(0x98)]==='function')_0x928f7d[_0x269c5b(0x98)]();}process['on'](_0x269c5b(0x167),_0x5eae95=>{const _0x29194d=_0x269c5b;if(_0x5eae95?.[_0x29194d(0x194)]===_0x29194d(0xf4))_0x2addde(0x0,_0xa377b9);});const {LOOP:_0x1135ee}=requireOkdbLoopMonitor(),{createIntakeGate:_0x59f803}=requireOkdbIntakeGate(),_0x4eb0cc=Number(process.env.OKDB_WORKERS_MAX_LEASES)||0x20,_0x202a52=Number(process.env.OKDB_WORKERS_LAG_GATE_MS)||0xc8,_0x16ab84=Number(process.env.OKDB_WORKERS_WEDGE_MS)||0x7530,_0x40acad=_0x59f803({'gateMs':_0x202a52});_0x1135ee[_0x269c5b(0x127)](({p99Ms:_0x24c775,maxMs:_0x2231d4})=>{const _0x5117b3=_0x269c5b;_0x2231d4>_0x16ab84&&_0xbea9c6({'type':_0x5117b3(0x182),'maxMs':_0x2231d4});const {changed:_0x827956,level:_0x24e7e2}=_0x40acad[_0x5117b3(0x127)](_0x24c775);if(_0x827956)_0xbea9c6({'type':_0x5117b3(0x105),'level':_0x24e7e2,'p99Ms':_0x24c775});});const {loadHandler:_0x44a6f3}=requireOkdbQueueLoadHandler(),_0x32478c=new Map();let _0x52e526=![],_0x596813={'defsSeen':-0x1,'lastError':null,'at':0x0};const _0x18beff=new Set(),_0x4f6acf=(_0x2a789a,_0x56b1af)=>{const _0x19b7a7=_0x269c5b,_0x40964f=_0x2a789a+'::'+_0x56b1af;if(_0x18beff['has'](_0x40964f))return;_0x18beff[_0x19b7a7(0x150)](_0x40964f),_0xbea9c6({'type':'warn','msg':'queue\x20definition\x20SKIPPED:\x20'+_0x2a789a+_0x19b7a7(0x116)+_0x56b1af});},_0x4a5407={'name':_0x269c5b(0x10c),'cost':'control','inFlight':()=>_0x32478c[_0x269c5b(0x13f)],'detail':()=>({'consumers':[..._0x32478c[_0x269c5b(0x134)]()],'tick':_0x596813}),async 'tick'(){const _0x525f8c=_0x269c5b;if(_0x52e526||_0x4299bf)return;_0x52e526=!![];try{const _0x44a288=_0xa377b9[_0x525f8c(0x11b)][_0x525f8c(0x17a)]?.(_0x525f8c(0xa7))??[];_0x596813={'defsSeen':_0x44a288[_0x525f8c(0x15b)],'lastError':null,'at':Date[_0x525f8c(0xf2)]()};const _0x4ff7cb=new Set();for(const {key:_0x15254a,value:_0xbcb1ec}of _0x44a288){if(!_0xbcb1ec||_0xbcb1ec[_0x525f8c(0x8e)]===![])continue;_0x4ff7cb[_0x525f8c(0x150)](_0x15254a);const _0xbbfd00=_0x32478c[_0x525f8c(0x163)](_0x15254a);if(_0xbbfd00){if(_0xbbfd00[_0x525f8c(0x19e)]===_0xbcb1ec[_0x525f8c(0x19e)])continue;_0x32478c['delete'](_0x15254a);try{await _0xbbfd00[_0x525f8c(0xfe)]?.[_0x525f8c(0xf4)]?.();}catch{}}const _0x66ccd1=_0xbcb1ec[_0x525f8c(0x10d)]??_0x15254a['split']('::')[0x0];let _0xaa0892;try{_0xaa0892=await _0x50c07e(_0x66ccd1);}catch(_0x109b61){_0x4f6acf(_0x15254a,_0x525f8c(0xf0)+_0x109b61?.['message']);continue;}if(!_0xaa0892?.[_0x525f8c(0x10c)]){_0x4f6acf(_0x15254a,'env\x20has\x20no\x20queue\x20feature\x20attached');continue;}let _0x4e9b9a;try{_0x4e9b9a=_0x44a6f3(_0xbcb1ec['modulePath'],_0xbcb1ec['exportName']);}catch(_0x4fdf8b){_0x4f6acf(_0x15254a,'handler\x20module\x20failed\x20to\x20load:\x20'+_0x4fdf8b?.[_0x525f8c(0x167)]);continue;}let _0x3c8e51;try{_0x3c8e51=_0xaa0892[_0x525f8c(0x10c)][_0x525f8c(0xce)](_0xbcb1ec[_0x525f8c(0x104)]??_0x15254a[_0x525f8c(0x91)]('::')[0x1],_0x4e9b9a,_0xbcb1ec[_0x525f8c(0x193)]??{});}catch(_0x21631d){_0x4f6acf(_0x15254a,_0x525f8c(0x132)+_0x21631d?.['message']);continue;}_0x32478c[_0x525f8c(0x16f)](_0x15254a,{'worker':_0x3c8e51,'version':_0xbcb1ec[_0x525f8c(0x19e)],'envName':_0x66ccd1});}for(const [_0x3c4c78,_0x2b646a]of[..._0x32478c]){if(!_0x4ff7cb['has'](_0x3c4c78)){_0x32478c[_0x525f8c(0x171)](_0x3c4c78),_0xbea9c6({'type':_0x525f8c(0x111),'msg':_0x525f8c(0x18e)+_0x3c4c78});try{await _0x2b646a[_0x525f8c(0xfe)]?.[_0x525f8c(0xf4)]?.();}catch{}}}}catch(_0x53eeb6){_0x596813[_0x525f8c(0x95)]=_0x53eeb6?.['message']??String(_0x53eeb6);throw _0x53eeb6;}finally{_0x52e526=![];}}};let _0x1cf73b;{const {SandboxHost:_0x1a4685}=requireOkdbFunctionsSandboxHost(),_0x214467=_0xa377b9[_0x269c5b(0x14d)][_0x269c5b(0x139)]('~fn:requests',{'dupSort':![]}),_0x4abf43=_0xa377b9['_rootDb'][_0x269c5b(0x139)](_0x269c5b(0x145),{'dupSort':![]}),_0x4c4683=Number(process.env.OKDB_FN_STALE_MS)||0xea60,_0x10f904=new _0x1a4685({'rootPath':_0x4e075c,'log':_0xa377b9[_0x269c5b(0xd7)],'onThreadStats':(_0x66089c,_0x6cd0ad)=>{const _0x20c015=_0x269c5b;if(_0x6cd0ad)_0xa377b9[_0x20c015(0x11b)]?.[_0x20c015(0x12e)]?.(_0x66089c,_0x6cd0ad);else _0xa377b9['processes']?.['clearThreadStats']?.(_0x66089c);}});_0x194e67=_0x10f904;const _0x563ecd=new Set(),_0x2e0a98=(_0x412195,_0x403828)=>{const _0x3cf1e6=_0x269c5b,_0x1c8ae5=_0x214467[_0x3cf1e6(0x163)](_0x412195);if(!_0x1c8ae5||_0x1c8ae5[_0x3cf1e6(0x12c)]==='cancelled'){try{_0x214467[_0x3cf1e6(0xf3)](_0x412195);}catch{}return;}_0x4abf43[_0x3cf1e6(0x177)](_0x412195,_0x403828);try{_0x214467[_0x3cf1e6(0xf3)](_0x412195);}catch{}},_0x5c4941=(_0x762b39,_0x358402)=>{const _0x4b5aad=_0x269c5b;_0x563ecd['add'](_0x762b39),_0x10f904[_0x4b5aad(0x8b)]({..._0x358402,'requestId':_0x762b39})[_0x4b5aad(0xde)](({message:_0x5ece61,logs:_0x65d100})=>_0x2e0a98(_0x762b39,{'message':_0x5ece61,'logs':_0x65d100}))[_0x4b5aad(0x151)](_0x30c9e9=>{const _0x53cefb=_0x4b5aad;if(_0x30c9e9?.['code']===_0x53cefb(0xe3)){try{const _0x31855c=_0x214467[_0x53cefb(0x163)](_0x762b39);_0x31855c&&_0x31855c[_0x53cefb(0x12c)]==='running'&&_0x31855c['claimedBy']===process[_0x53cefb(0x117)]&&_0x214467[_0x53cefb(0x177)](_0x762b39,{..._0x31855c,'state':'pending','requestedAt':Date[_0x53cefb(0xf2)]()});}catch{}return;}_0x2e0a98(_0x762b39,{'message':{'type':_0x53cefb(0xeb),'requestId':_0x762b39,'runId':_0x358402[_0x53cefb(0x10f)],'error':{'message':_0x30c9e9?.[_0x53cefb(0x167)]??String(_0x30c9e9),'code':_0x30c9e9?.[_0x53cefb(0xad)]??_0x53cefb(0xc7)},'meta':{'runnerId':_0x53cefb(0x120)+process[_0x53cefb(0x117)]}},'logs':[]});})[_0x4b5aad(0x11a)](()=>_0x563ecd[_0x4b5aad(0x171)](_0x762b39));};_0x1cf73b={'name':'fn','cost':_0x269c5b(0x161),'inFlight':()=>_0x10f904[_0x269c5b(0x16d)](),async 'tick'(){const _0x59a778=_0x269c5b;if(_0x4299bf)return;for(const _0x4e651b of[..._0x563ecd]){const _0x5704c9=_0x214467['get'](_0x4e651b);if(!_0x5704c9||_0x5704c9[_0x59a778(0x12c)]===_0x59a778(0x190))_0x10f904[_0x59a778(0x187)](_0x4e651b);}for(const {key:_0x3b2b4a,value:_0x5dcc5d}of _0x214467[_0x59a778(0xc5)]({})){if(_0x4299bf)break;if(_0x10f904[_0x59a778(0x16d)]()>=_0x10f904['maxConcurrency'])break;if(!_0x5dcc5d||_0x5dcc5d[_0x59a778(0x12c)]!==_0x59a778(0xf9))continue;if(_0x5dcc5d[_0x59a778(0x108)]&&Date[_0x59a778(0xf2)]()-_0x5dcc5d['requestedAt']>_0x4c4683){try{_0x214467[_0x59a778(0x166)](()=>{const _0x560b2c=_0x59a778,_0x593b31=_0x214467['get'](_0x3b2b4a);if(_0x593b31?.[_0x560b2c(0x12c)]===_0x560b2c(0xf9)&&_0x593b31[_0x560b2c(0x108)]&&Date[_0x560b2c(0xf2)]()-_0x593b31['requestedAt']>_0x4c4683)_0x214467[_0x560b2c(0x9b)](_0x3b2b4a);});}catch{}continue;}let _0x29a2e5=![];_0x214467['transactionSync'](()=>{const _0x3522e5=_0x59a778,_0x4fbc0c=_0x214467[_0x3522e5(0x163)](_0x3b2b4a);_0x4fbc0c?.['state']===_0x3522e5(0xf9)&&(_0x214467[_0x3522e5(0xe9)](_0x3b2b4a,{..._0x4fbc0c,'state':_0x3522e5(0x179),'claimedBy':process[_0x3522e5(0x117)],'claimedAt':Date[_0x3522e5(0xf2)]()}),_0x29a2e5=!![]);});if(!_0x29a2e5)continue;_0x5c4941(_0x3b2b4a,_0x5dcc5d);}}};}let _0x3546bb=0x0;const _0x5b99e5=_0xa377b9['_rootDb'][_0x269c5b(0x139)](_0x269c5b(0x172),{'dupSort':![]}),_0xd57de2={'name':'bootstrap','cost':_0x269c5b(0x149),'inFlight':()=>_0x3546bb,async 'tick'(){const _0x2d98fc=_0x269c5b;if(_0x4299bf||_0x3546bb>=0x1)return;const _0x1b9226=[];try{for(const {key:_0x5b0752,value:_0x1810e9}of _0x5b99e5['getRange']({})){if(typeof _0x5b0752===_0x2d98fc(0x106)&&_0x1810e9?.[_0x2d98fc(0x84)]&&!_0x1810e9[_0x2d98fc(0x84)]['startsWith']('~'))_0x1b9226[_0x2d98fc(0x192)](_0x1810e9);}}catch{}for(const _0x30fad6 of _0x1b9226){if(_0x4299bf||_0x3546bb>=0x1)return;let _0x2ed6f9;try{_0x2ed6f9=await _0x50c07e(_0x30fad6[_0x2d98fc(0x84)]);}catch{continue;}if(_0x30fad6[_0x2d98fc(0x196)]==='view'&&_0x30fad6[_0x2d98fc(0xbf)]){const _0x466a8d=_0x2ed6f9[_0x2d98fc(0x163)]?.(_0x2d98fc(0x8f),_0x30fad6[_0x2d98fc(0xbf)]);if(!_0x466a8d)continue;let _0x48ed5e=![];_0x4ea160['add'](_0x30fad6['env']);const _0x4e4603=_0x2ed6f9['processor']['claimRoutedBootstrap']({'rowKey':_0x2d98fc(0x181)+_0x30fad6[_0x2d98fc(0x18d)],'cursorKey':_0x30fad6[_0x2d98fc(0x18d)]},async()=>{const _0x2f0e56=_0x2d98fc;!_0x2ed6f9[_0x2f0e56(0x12a)][_0x2f0e56(0x189)]['has'](_0x30fad6[_0x2f0e56(0xbf)])&&_0x2ed6f9[_0x2f0e56(0x12a)][_0x2f0e56(0x101)](_0x30fad6[_0x2f0e56(0xbf)],_0x466a8d),await _0x2ed6f9['views'][_0x2f0e56(0xfc)](_0x30fad6['viewName'],_0x466a8d);},{'onClaimed':()=>{_0x48ed5e=!![],_0x3546bb++;}})[_0x2d98fc(0x151)](()=>{})['finally'](()=>{const _0x42b6fe=_0x2d98fc;if(_0x48ed5e)_0x3546bb--;_0x4ea160[_0x42b6fe(0x171)](_0x30fad6[_0x42b6fe(0x84)]);});if(_0x48ed5e)return;await _0x4e4603;continue;}try{await _0xa377b9['fts'][_0x2d98fc(0xce)]({'envs':[_0x30fad6[_0x2d98fc(0x84)]],'types':_0x30fad6['type']?[_0x30fad6[_0x2d98fc(0x194)]]:'*'});}catch{continue;}let _0x5cb5e4=[];try{_0x5cb5e4=_0x2ed6f9[_0x2d98fc(0x156)][_0x2d98fc(0x152)]();}catch{}for(const _0x12beed of _0x5cb5e4){if(_0x4299bf||_0x3546bb>=0x1)return;let _0x378004=![];_0x4ea160[_0x2d98fc(0x150)](_0x30fad6[_0x2d98fc(0x84)]);const _0x188e04=_0x2ed6f9[_0x2d98fc(0x156)][_0x2d98fc(0xac)](_0x12beed,{'onClaimed':()=>{_0x378004=!![],_0x3546bb++;}})[_0x2d98fc(0x151)](()=>{})[_0x2d98fc(0x11a)](()=>{const _0x16e4b8=_0x2d98fc;if(_0x378004)_0x3546bb--;_0x4ea160['delete'](_0x30fad6[_0x16e4b8(0x84)]);});if(_0x378004)return;await _0x188e04;}}}},_0x277eb7=Math[_0x269c5b(0xa3)](0x1,Number(process.env.OKDB_WORKERS_PROBE_PER_TICK)||0x2),_0x3fc370=Math['max'](0x1,Number(process.env.OKDB_WORKERS_PROBE_GRACE_TICKS)||0x3);let _0x1ac521=Math[_0x269c5b(0xea)](Math[_0x269c5b(0x82)]()*0x1000);const _0x5e710a=new Set(),_0x43060e=new Map(),_0x515bbe=Math[_0x269c5b(0xa3)](0x3e8,Number(process.env.OKDB_WORKERS_PROBE_COOLDOWN_MS)||0x7530),_0x506bc5=new Map(),_0xfe8725={'name':'fts','cost':'light','inFlight':()=>{let _0x12087a=0x0;for(const [,_0x1e5032]of _0x4b9dbd)if(_0xbe0d2(_0x1e5032))_0x12087a++;return _0x12087a;},async 'tick'(){const _0x23c364=_0x269c5b;if(_0x4299bf)return;const _0xab4c17=_0xa377b9[_0x23c364(0xbd)][_0x23c364(0xb6)]();if(_0xab4c17['length']===0x0)return;const _0x4519f0=new Map();for(const _0xf22dc8 of _0xab4c17){if(!_0x4519f0[_0x23c364(0x11c)](_0xf22dc8[_0x23c364(0x84)]))_0x4519f0[_0x23c364(0x16f)](_0xf22dc8['env'],[]);_0x4519f0[_0x23c364(0x163)](_0xf22dc8[_0x23c364(0x84)])['push'](_0xf22dc8['type']);}const _0x4575cd=[..._0x4519f0[_0x23c364(0x134)]()],_0x3d54c8=Date[_0x23c364(0xf2)](),_0x5ae7a1=[];for(const _0x57daac of _0x5e710a){_0x4519f0[_0x23c364(0x11c)](_0x57daac)&&!_0x5ae7a1[_0x23c364(0xa0)](_0x57daac)&&(_0x506bc5['delete'](_0x57daac),_0x5ae7a1[_0x23c364(0x192)](_0x57daac));}_0x5e710a[_0x23c364(0x186)]();for(let _0x156ef7=0x0;_0x5ae7a1[_0x23c364(0x15b)]<_0x277eb7&&_0x156ef7<_0x4575cd[_0x23c364(0x15b)];_0x156ef7++){const _0x44a027=_0x4575cd[(_0x1ac521+_0x156ef7)%_0x4575cd[_0x23c364(0x15b)]];if(_0x5ae7a1[_0x23c364(0xa0)](_0x44a027))continue;if((_0x506bc5[_0x23c364(0x163)](_0x44a027)??0x0)>_0x3d54c8)continue;_0x5ae7a1[_0x23c364(0x192)](_0x44a027);}_0x1ac521=(_0x1ac521+_0x277eb7)%Math['max'](0x1,_0x4575cd['length']);for(const _0x4ca7a9 of _0x5ae7a1){if(_0x4299bf)return;try{await _0x50c07e(_0x4ca7a9),await _0xa377b9[_0x23c364(0xbd)]['process']({'envs':[_0x4ca7a9],'types':_0x4519f0['get'](_0x4ca7a9)});}catch{}}for(const [_0x4e8110,_0x53d06a]of[..._0x4b9dbd]){if(_0xd45b8a(_0x4e8110,_0x53d06a)){_0x43060e[_0x23c364(0x171)](_0x4e8110);continue;}const _0xa48d29=(_0x43060e[_0x23c364(0x163)](_0x4e8110)??0x0)+0x1;_0xa48d29>=_0x3fc370?(_0x43060e[_0x23c364(0x171)](_0x4e8110),_0x506bc5['set'](_0x4e8110,Date[_0x23c364(0xf2)]()+_0x515bbe),await _0x1a0a2f(_0x4e8110)):_0x43060e[_0x23c364(0x16f)](_0x4e8110,_0xa48d29);}}};_0xa377b9[_0x269c5b(0xab)]['on'](_0x454d03[_0x269c5b(0xe8)],_0x1e73f6=>{const _0x1968e6=_0x269c5b,_0x4c0d49=_0x1e73f6?.[_0x1968e6(0x84)];if(typeof _0x4c0d49===_0x1968e6(0x106)&&_0x4c0d49&&!_0x4c0d49['startsWith']('~'))_0x5e710a['add'](_0x4c0d49);});const _0xdd223b=Math[_0x269c5b(0xa3)](0x64,Number(process.env.OKDB_WORKERS_CLAIM_TICK_MS)||0x3e8),_0x153710=[_0x1cf73b,_0x4a5407,_0xd57de2,_0xfe8725],_0x678b45=[_0x4a5407,_0xd57de2,_0xfe8725];let _0x55d075=0x0;const _0x312fba=_0x12fed9=>{const _0x1b33e4=_0x269c5b;if(_0x4299bf||_0x40acad['blocks'](_0x12fed9[_0x1b33e4(0x17b)]))return;_0x12fed9[_0x1b33e4(0x123)]()[_0x1b33e4(0x151)](()=>{});},_0x552fc1=setInterval(()=>{const _0x53da23=_0x269c5b;_0x312fba(_0x1cf73b);for(let _0x1632cb=0x0;_0x1632cb<_0x678b45[_0x53da23(0x15b)];_0x1632cb++){_0x312fba(_0x678b45[(_0x55d075+_0x1632cb)%_0x678b45[_0x53da23(0x15b)]]);}_0x55d075=(_0x55d075+0x1)%_0x678b45['length'];},_0xdd223b);if(typeof _0x552fc1[_0x269c5b(0x98)]===_0x269c5b(0x90))_0x552fc1[_0x269c5b(0x98)]();_0xa377b9[_0x269c5b(0xab)]['on'](_0x454d03['SYSTEM_PROC'],_0x96bf10=>{const _0x19fb17=_0x269c5b;if(_0x96bf10?.[_0x19fb17(0x10e)]==='fn')_0x312fba(_0x1cf73b);else{if(_0x96bf10?.[_0x19fb17(0x10e)]==='bootstrap')_0x312fba(_0xd57de2);else{if(_0x96bf10?.[_0x19fb17(0x10e)]===_0x19fb17(0xa7))_0x312fba(_0x4a5407);else{if(_0x96bf10?.['scope']===_0x19fb17(0x80)&&typeof _0x96bf10[_0x19fb17(0x1a1)]===_0x19fb17(0x106)){const _0x49711a=_0x96bf10[_0x19fb17(0x1a1)];_0xbea9c6({'type':'warn','msg':'env-removed\x20hint:\x20force-evicting\x20'+_0x49711a+_0x19fb17(0x119)+_0x4b9dbd[_0x19fb17(0x11c)](_0x49711a)+')'}),(async()=>{const _0x11e151=_0x19fb17;for(const [_0x25fbdd,_0x119f72]of[..._0x32478c]){if(_0x119f72?.[_0x11e151(0x10d)]!==_0x49711a)continue;_0x32478c[_0x11e151(0x171)](_0x25fbdd);try{await _0x119f72[_0x11e151(0xfe)]?.[_0x11e151(0xf4)]?.();}catch{}}_0x4ea160[_0x11e151(0x171)](_0x49711a),_0x5e710a[_0x11e151(0x171)](_0x49711a),_0x506bc5[_0x11e151(0x16f)](_0x49711a,Date[_0x11e151(0xf2)]()+0x1d4c0),await _0x1a0a2f(_0x49711a),_0xbea9c6({'type':_0x11e151(0x111),'msg':_0x11e151(0xfb)+_0x49711a+_0x11e151(0x12b)});})()[_0x19fb17(0x151)](_0x34e81e=>{const _0x227b1e=_0x19fb17;_0xbea9c6({'type':_0x227b1e(0x111),'msg':_0x227b1e(0x19f)+_0x49711a+':\x20'+_0x34e81e?.['message']});});}}}}});for(const _0x2ea73b of _0x153710)_0x312fba(_0x2ea73b);_0x2041c9(_0xbea9c6,_0xa377b9,()=>({'claims':_0x153710[_0x269c5b(0x16a)](_0x3e0d14=>({'name':_0x3e0d14[_0x269c5b(0x17c)],'inFlight':_0x3e0d14['inFlight'](),'gated':_0x40acad[_0x269c5b(0x18f)](_0x3e0d14[_0x269c5b(0x17b)]),..._0x3e0d14[_0x269c5b(0xaa)]?{'detail':_0x3e0d14[_0x269c5b(0xaa)]()}:{}})),'envsOpen':_0xa377b9['_envs'][_0x269c5b(0x13f)]})),_0xbea9c6({'type':_0x269c5b(0xae),'pid':process['pid'],'slot':_0x324820,'supervisorKey':_0x410e8c,'maxLeases':_0x4eb0cc});}return _0x41a99b()['catch'](_0x2c1979=>{const _0x83d28d=_0x9b6073;_0xbea9c6({'type':_0x83d28d(0xeb),'error':_0x2c1979[_0x83d28d(0x167)]}),process[_0x83d28d(0x115)](0x1);}),okdbWorkerChild$1;}var okdbWorkerChildExports=requireOkdbWorkerChild(),okdbWorkerChild=getDefaultExportFromCjs(okdbWorkerChildExports);module['exports']=okdbWorkerChild;
1
+ 'use strict';const _0x275d88=_0x3fcd;(function(_0x489f47,_0x158e35){const _0x28483a=_0x3fcd,_0xdf56c4=_0x489f47();while(!![]){try{const _0x279877=parseInt(_0x28483a(0x254))/0x1*(-parseInt(_0x28483a(0x26d))/0x2)+-parseInt(_0x28483a(0x1cf))/0x3*(-parseInt(_0x28483a(0x1ca))/0x4)+parseInt(_0x28483a(0x211))/0x5*(-parseInt(_0x28483a(0x18b))/0x6)+parseInt(_0x28483a(0x2bb))/0x7*(parseInt(_0x28483a(0x1f8))/0x8)+-parseInt(_0x28483a(0x24e))/0x9*(-parseInt(_0x28483a(0x1ef))/0xa)+-parseInt(_0x28483a(0x1e1))/0xb*(-parseInt(_0x28483a(0x223))/0xc)+-parseInt(_0x28483a(0x2ae))/0xd*(-parseInt(_0x28483a(0x24a))/0xe);if(_0x279877===_0x158e35)break;else _0xdf56c4['push'](_0xdf56c4['shift']());}catch(_0x16a59b){_0xdf56c4['push'](_0xdf56c4['shift']());}}}(_0x33bb,0x9f5ed));function _0x3fcd(_0x1ab090,_0xb6640f){_0x1ab090=_0x1ab090-0x189;const _0x33bb37=_0x33bb();let _0x3fcd38=_0x33bb37[_0x1ab090];return _0x3fcd38;}var require$$0$1=require('path'),require$$1$1=require('os'),require$$0=require(_0x275d88(0x1a9)),require$$1=require(_0x275d88(0x27c));function getDefaultExportFromCjs(_0x912fa){const _0x2d597c=_0x275d88;return _0x912fa&&_0x912fa[_0x2d597c(0x239)]&&Object['prototype'][_0x2d597c(0x1b8)]['call'](_0x912fa,_0x2d597c(0x1f5))?_0x912fa[_0x2d597c(0x1f5)]:_0x912fa;}function commonjsRequire(_0x2353d9){const _0x4640ee=_0x275d88;throw new Error(_0x4640ee(0x21b)+_0x2353d9+'\x22.\x20Please\x20configure\x20the\x20dynamicRequireTargets\x20or/and\x20ignoreDynamicRequires\x20option\x20of\x20@rollup/plugin-commonjs\x20appropriately\x20for\x20this\x20require\x20call\x20to\x20work.');}var okdbWorkerChild$1={},okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x396ce2=_0x275d88;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x14b7d3={'PUT':_0x396ce2(0x274),'REMOVE':'remove','INDEX_DROP':'dropIndex','INDEX_REGISTER':_0x396ce2(0x1e2),'INDEX_RESET':_0x396ce2(0x1bb),'TYPE_REGISTER':_0x396ce2(0x195),'TYPE_DROP':_0x396ce2(0x289),'FTS_REGISTER':'registerFts','FTS_DROP':_0x396ce2(0x1b5),'FTS_RESET':'resetFts','SCHEMA_SET':_0x396ce2(0x1df),'SCHEMA_DROP':_0x396ce2(0x1a3),'TTL_SET':_0x396ce2(0x1d7),'TTL_CLEAR':_0x396ce2(0x1de)},_0x3cc775={'SYSTEM_READY':_0x396ce2(0x1d9),'SYSTEM_STOPPED':_0x396ce2(0x2b1),'SYSTEM_CLOCK_CHANGE':_0x396ce2(0x1eb),'SYSTEM_POKE':_0x396ce2(0x1ea),'SYSTEM_DRAIN':_0x396ce2(0x287),'SYSTEM_TYPE_DROP':_0x396ce2(0x25c),'SYSTEM_PROC':_0x396ce2(0x266),'SYSTEM_BUS_STATE_CHANGE':'system:bus_state_change','ITEM_CREATE':_0x396ce2(0x272),'ITEM_UPDATE':_0x396ce2(0x18a),'ITEM_REMOVE':_0x396ce2(0x232),'INDEX_RESET':_0x396ce2(0x1e3),'INDEX_READY':_0x396ce2(0x27d),'INDEX_PROGRESS':_0x396ce2(0x297),'VIEW_PROGRESS':_0x396ce2(0x21f),'INDEX_DROP':'index:drop','INDEX_REGISTERED':_0x396ce2(0x21c),'FTS_REGISTERED':_0x396ce2(0x1f6),'FTS_DROP':_0x396ce2(0x1b3),'FTS_RESET':_0x396ce2(0x224),'SCHEMA_SET':_0x396ce2(0x276),'SCHEMA_DROP':_0x396ce2(0x1d1),'UNIQUE_VIOLATION':_0x396ce2(0x1c0),'UNIQUE_VIOLATION_RESOLVED':_0x396ce2(0x256),'REF_VIOLATION':_0x396ce2(0x2bf),'REF_VIOLATION_RESOLVED':_0x396ce2(0x1e4),'SYNC_APPLY':_0x396ce2(0x20d),'TXN_START':'txn:start','TXN_END':_0x396ce2(0x1ba),'TXN_ROLLBACK':_0x396ce2(0x1b9),'TYPE_REGISTERED':_0x396ce2(0x19c),'TYPE_DROP':'type:drop','ENV_OPENED':_0x396ce2(0x194),'ENV_REMOVED':_0x396ce2(0x207),'TTL_EXPIRED':_0x396ce2(0x290),'TTL_SET':'ttl:set','TTL_CLEAR':_0x396ce2(0x18e),'LICENSE_INVALID':_0x396ce2(0x1a1),'LICENSE_ADDED':_0x396ce2(0x1cd),'LICENSE_ACTIVATED':_0x396ce2(0x216),'LICENSE_REMOVED':_0x396ce2(0x1e5)},_0x3bc718={'CREATING':_0x396ce2(0x197),'RESETTING':_0x396ce2(0x2be),'READY':_0x396ce2(0x1c6),'DROPPING':_0x396ce2(0x275),'WAITING':'waiting'},_0x4b6744={'CREATED':'created','STARTING':_0x396ce2(0x201),'STARTED':_0x396ce2(0x1fb),'STOPPING':_0x396ce2(0x22e),'STOPPED':_0x396ce2(0x2b2)},_0x2fd3aa={'CREATING':_0x396ce2(0x197),'READY':_0x396ce2(0x1c6),'HALTED':_0x396ce2(0x1dd),'STOPPED':_0x396ce2(0x2b2),'RESETTING':'resetting'},_0x35b09f=Object[_0x396ce2(0x2ad)]({'POKE':_0x396ce2(0x24d),'DRAIN':_0x396ce2(0x2bd),'TYPE_DROP':'bus:type_drop','PROC':'bus:proc'});return okdbEnums={'BUS_EVENTS':_0x35b09f,'CHANGE_ACTIONS':_0x14b7d3,'EVENTS':_0x3cc775,'INDEX_STATE':_0x3bc718,'OKDB_STATE':_0x4b6744,'VIEW_STATE':_0x2fd3aa},okdbEnums;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x4bcbd1=_0x275d88;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x149e5e,performance:_0x4ce206}=require$$0,_0x558c9e=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG==='true',_0xe778a=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x2ee5db=process.env.OKDB_LOOP_LAG_ALL==='1',_0x1093dd=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x3bf88c{constructor(){const _0x5a21c9=_0x3fcd;this[_0x5a21c9(0x1c4)]=_0x558c9e,this[_0x5a21c9(0x244)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x5a21c9(0x1d2)]=![],this[_0x5a21c9(0x29c)]=(_0x440692,_0x38a57f)=>process[_0x5a21c9(0x1bd)][_0x5a21c9(0x231)](_0x440692+(_0x38a57f?'\x20'+JSON[_0x5a21c9(0x2ba)](_0x38a57f):'')+'\x0a');}[_0x4bcbd1(0x247)](){const _0x4de07e=_0x4bcbd1;return _0x4ce206[_0x4de07e(0x247)]();}[_0x4bcbd1(0x273)](_0x59f649){if(typeof _0x59f649==='function')this['_log']=_0x59f649;}[_0x4bcbd1(0x200)](_0x53fa29,_0x1103af,_0x2abfa1){const _0x41509b=_0x4bcbd1;if(!this[_0x41509b(0x1c4)])return;let _0x3f4f55=this[_0x41509b(0x244)][_0x41509b(0x23b)](_0x53fa29);!_0x3f4f55&&(_0x3f4f55={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x41509b(0x244)][_0x41509b(0x1be)](_0x53fa29,_0x3f4f55)),_0x3f4f55['ms']+=_0x1103af,_0x3f4f55[_0x41509b(0x2b8)]+=0x1,_0x1103af>_0x3f4f55[_0x41509b(0x1bc)]&&(_0x3f4f55[_0x41509b(0x1bc)]=_0x1103af,_0x3f4f55[_0x41509b(0x1dc)]=_0x2abfa1||'');}[_0x4bcbd1(0x26a)](_0x1f510c){const _0x42897e=_0x4bcbd1;if(!this[_0x42897e(0x1c4)]||this[_0x42897e(0x1d2)])return;this[_0x42897e(0x1d2)]=!![];if(_0x1f510c)this[_0x42897e(0x29c)]=_0x1f510c;this['_h']=_0x149e5e({'resolution':0xa}),this['_h'][_0x42897e(0x1b6)](),this[_0x42897e(0x2a2)]=setInterval(()=>this['_report'](),_0xe778a);if(this[_0x42897e(0x2a2)]['unref'])this[_0x42897e(0x2a2)][_0x42897e(0x2b6)]();}[_0x4bcbd1(0x1fe)](_0x468879){const _0x50b488=_0x4bcbd1;if(!this[_0x50b488(0x240)])this['_windowCbs']=new Set();this['_windowCbs']['add'](_0x468879);if(!this['_started'])this[_0x50b488(0x1d8)]();}[_0x4bcbd1(0x1a0)](_0x1b79f8){const _0x5e6ac4=_0x4bcbd1;this[_0x5e6ac4(0x240)]?.[_0x5e6ac4(0x27e)](_0x1b79f8);}[_0x4bcbd1(0x1d8)](){const _0x4480eb=_0x4bcbd1;if(this['_admissionStarted'])return;this['_admissionStarted']=!![];!this['_h']&&(this['_h']=_0x149e5e({'resolution':0xa}),this['_h'][_0x4480eb(0x1b6)]());const _0x2302d2=_0xe778a;this['_admissionTimer']=setInterval(()=>{const _0x23031e=_0x4480eb,_0x54c704=this['_h'];if(!_0x54c704)return;const _0x4171b7=_0x54c704[_0x23031e(0x2a6)](0x63)/0xf4240,_0x3eb897=_0x54c704[_0x23031e(0x270)]/0xf4240,_0x3f34f0=_0x54c704[_0x23031e(0x191)]/0xf4240;_0x54c704[_0x23031e(0x1b1)]();if(this[_0x23031e(0x240)])for(const _0xaf5786 of this['_windowCbs']){try{_0xaf5786({'p99Ms':_0x4171b7,'maxMs':_0x3eb897,'meanMs':_0x3f34f0,'reportMs':_0x2302d2});}catch{}}},_0x2302d2);if(this['_admissionTimer'][_0x4480eb(0x2b6)])this['_admissionTimer'][_0x4480eb(0x2b6)]();}['_report'](){const _0x6685c9=_0x4bcbd1,_0x2c29d9=this['_h'],_0x39a60f=_0x2c29d9[_0x6685c9(0x270)]/0xf4240,_0x4d5bc2=_0x2c29d9[_0x6685c9(0x2a6)](0x63)/0xf4240,_0x2feb16=_0x2c29d9[_0x6685c9(0x191)]/0xf4240;_0x2c29d9[_0x6685c9(0x1b1)]();const _0xd759ef=[...this[_0x6685c9(0x244)][_0x6685c9(0x1aa)]()]['map'](([_0x235a2d,_0x4ad099])=>({'label':_0x235a2d,..._0x4ad099}))[_0x6685c9(0x1fa)]((_0x545d3d,_0x5de3ee)=>_0x5de3ee['ms']-_0x545d3d['ms'])[_0x6685c9(0x25d)](0x0,0x8);this[_0x6685c9(0x244)]['clear']();const _0x37dd3e=_0xd759ef[_0x6685c9(0x269)]((_0x41b9c1,_0x187c51)=>_0x41b9c1+_0x187c51['ms'],0x0),_0x3d0542=_0xd759ef[_0x6685c9(0x1a6)](_0x4bfdbe=>_0x4bfdbe[_0x6685c9(0x192)]+'='+_0x4bfdbe['ms'][_0x6685c9(0x26f)](0x0)+_0x6685c9(0x1c5)+_0x4bfdbe[_0x6685c9(0x2b8)]+(_0x4bfdbe[_0x6685c9(0x1bc)]>0x5?_0x6685c9(0x1af)+_0x4bfdbe[_0x6685c9(0x1bc)][_0x6685c9(0x26f)](0x0)+'ms'+(_0x4bfdbe[_0x6685c9(0x1dc)]?'\x20'+_0x4bfdbe[_0x6685c9(0x1dc)]:'')+')':''));(_0x2ee5db||_0x39a60f>=_0x1093dd)&&this[_0x6685c9(0x29c)](_0x6685c9(0x29a)+_0xe778a+_0x6685c9(0x250)+_0x39a60f['toFixed'](0x0)+_0x6685c9(0x292)+_0x4d5bc2['toFixed'](0x0)+_0x6685c9(0x222)+_0x2feb16[_0x6685c9(0x26f)](0x0)+_0x6685c9(0x1c9)+_0x37dd3e[_0x6685c9(0x26f)](0x0)+'ms'+(_0x3d0542[_0x6685c9(0x23e)]?'\x20│\x20'+_0x3d0542[_0x6685c9(0x271)]('\x20\x20'):''),{'feature':_0x6685c9(0x28f)});if(this[_0x6685c9(0x240)])for(const _0x43af05 of this[_0x6685c9(0x240)]){try{_0x43af05({'p99Ms':_0x4d5bc2,'maxMs':_0x39a60f,'meanMs':_0x2feb16,'reportMs':_0xe778a});}catch{}}}[_0x4bcbd1(0x1d6)](){const _0x2bd108=_0x4bcbd1;if(this[_0x2bd108(0x2a2)])clearInterval(this['_timer']);if(this['_h'])this['_h'][_0x2bd108(0x1e9)]();this['_timer']=null,this['_h']=null,this['_started']=![];}}const _0x4cfd09=new _0x3bf88c();if(_0x4cfd09[_0x4bcbd1(0x1c4)])_0x4cfd09[_0x4bcbd1(0x26a)]();return okdbLoopMonitor={'LOOP':_0x4cfd09},okdbLoopMonitor;}function _0x33bb(){const _0x2fc3d8=['loop-lag\x20','resolve','_log','queue\x20definition\x20SKIPPED:\x20','recycle','~views','detachConsole','env-removed\x20evict\x20FAILED\x20for\x20','_timer','_tiers','error','string','percentile','modulePath','main','_dropTier','close','rootPath','sandbox-','freeze','611ziiULa','random','exit','system:stopped','stopped','env','requestedAt','size','unref','add','count','ms\x20(+','stringify','3395zwTdIP','terminate','bus:drain','resetting','ref:violation','attach','logs','sandbox\x20host\x20stopped','_rootDb','item:update','1025112yzfIru','onEmit','putSync','ttl:clear','_lockHandle','system','mean','label','pending','env:opened','registerType','reject','creating','remove','_runBootstrapScanPhases','version','_terminateTier','type:registered','includes','transactionSync','win32','offWindow','license:invalid','log','dropSchema','object','envName','map','removeSync','view','node:perf_hooks','entries','getRange','FUNCTION_OOM','entry','user','(worst\x20','unhandledRejection','reset','cursorKey','fts:drop','state','dropFts','enable','inflight','hasOwnProperty','txn:rollback','txn:end','resetIndex','maxMs','stderr','set','tick','unique:violation','resume','_stopped','claimRoutedBootstrap','enabled','ms/','ready','run','ms\x20grace)\x20—\x20sandbox\x20terminated','ms\x20busy=','3880732ONaDoW','claimedBy','detail','license:added','_maybeIdle','3IGrUTF','queue.process\x20threw:\x20','schema:drop','_started','control','has','queue','stop','setTtl','_startAdmission','system:ready','clear','env-removed\x20hint:\x20force-evicting\x20','maxExtra','halted','clearTtl','setSchema','cancelled','11xfMfbZ','registerIndex','index:reset','ref:violation_resolved','license:removed','_drainHandler','core','send','disable','system:poke','system:clock_change','stdout','type','options','450BxWjdS','_closeSharedEnvs','cpuUsage','exports','FUNCTION_CANCELLED','postMessage','default','fts:registered','stats','8632qKpsCe','open','sort','started','cancel','timeoutMs','onWindow','worker\x20OKDB\x20open\x20failed:\x20','note','starting','external','rss','SYSTEM_PROC','_tierFor','defaultMemoryMb','env:removed','then','heapTotal','pid','Spawned\x20queue\x20worker\x20export\x20not\x20found\x20or\x20not\x20a\x20function:\x20','openEnv','sync:apply','requestId','runId','worker:\x20no\x20init\x20message\x20received','30HVOOmD','warn','maxConcurrency','ppid','key','license:activated','queue-worker','MB\x20heap\x20cap)','handler\x20module\x20failed\x20to\x20load:\x20','processor','Could\x20not\x20dynamically\x20require\x20\x22','index:registered','SYSTEM_DRAIN','platform','view:progress','function\x20exceeded\x20','openDB','ms\x20mean=','3625788cCJKqe','fts:reset','inFlightCount','viewName','rejectReady','claimAndRunWorkerBootstrap','graceMs','views','okdb.js','events','startsWith','stopping','function\x20sandbox\x20out\x20of\x20memory\x20(tier\x20','isHeld','write','item:remove','function','_envs','sandbox\x20terminated\x20for\x20a\x20sibling\x20job\x20—\x20retryable','result','idleTimer','fn-sandbox:','__esModule','~proc:bootstrap-index','get','round','watchdog','length','worker','_windowCbs','blocks','passive','memoryUsage','_buckets','env\x20has\x20no\x20queue\x20feature\x20attached','_onMessage','now','\x20evicted','values','588judiWh','bootstrap','tierList','bus:poke','164862tgVJNt','Spawned\x20queue\x20worker\x20module\x20must\x20export\x20a\x20function\x20or\x20default\x20function','ms\x20max=','disconnect','catch','FUNCTION_SANDBOX_EXIT','2JAGoED','scope','unique:violation_resolved','function\x20cancelled\x20—\x20did\x20not\x20unwind\x20within\x20grace;\x20sandbox\x20terminated','_failTier','ERR_WORKER_OUT_OF_MEMORY','FUNCTION_FAILED','~fn:requests','system:type_drop','slice','code','_bareOpen','stopAll','off','lastError','\x20(resident=','env-removed','fts','system:proc','clearThreadStats','onThreadStats','reduce','start','unhandledRejection:\x20','active','944038BpOhtZ','reportThreadStats','toFixed','max','join','item:create','setLogger','put','dropping','schema:set','keys','SYSTEM_POKE','processes','finally','listDesired','worker_threads','index:ready','delete','cost','idleMs','fatal','init','message','push','wedged','_viewState','system:drain','exportName','dropType','SandboxHost:\x20rootPath\x20required','name','running','_ensureTier','process','loop-lag','ttl:expired','inFlight','ms\x20p99=','queueType','heapUsed','_processorStops','split','index:progress','level','heavy'];_0x33bb=function(){return _0x2fc3d8;};return _0x33bb();}var okdbIntakeGate,hasRequiredOkdbIntakeGate;function requireOkdbIntakeGate(){if(hasRequiredOkdbIntakeGate)return okdbIntakeGate;hasRequiredOkdbIntakeGate=0x1;const _0x3337fe=0x2,_0x1eea73=0x2,_0x415017=0x2;function _0x59293d({gateMs:_0x281b90}){let _0x24ae0e=0x0,_0x8431b=0x0,_0x1873e5=0x0;return{'level':()=>_0x24ae0e,'blocks'(_0x50c3ce){const _0x4fd271=_0x3fcd;if(_0x50c3ce==='control')return![];if(_0x24ae0e>=0x2)return!![];if(_0x24ae0e>=0x1&&_0x50c3ce===_0x4fd271(0x299))return!![];return![];},'onWindow'(_0x10fa56){if(_0x10fa56>_0x281b90){_0x8431b++,_0x1873e5=0x0;if(_0x8431b>=_0x3337fe&&_0x24ae0e<_0x415017)return _0x24ae0e++,_0x8431b=0x0,{'changed':!![],'level':_0x24ae0e};}else{if(_0x10fa56<_0x281b90/0x2){_0x1873e5++,_0x8431b=0x0;if(_0x1873e5>=_0x1eea73&&_0x24ae0e>0x0)return _0x24ae0e--,_0x1873e5=0x0,{'changed':!![],'level':_0x24ae0e};}else _0x8431b=0x0,_0x1873e5=0x0;}return{'changed':![],'level':_0x24ae0e};}};}return okdbIntakeGate={'createIntakeGate':_0x59293d},okdbIntakeGate;}var okdbQueueLoadHandler,hasRequiredOkdbQueueLoadHandler;function requireOkdbQueueLoadHandler(){if(hasRequiredOkdbQueueLoadHandler)return okdbQueueLoadHandler;hasRequiredOkdbQueueLoadHandler=0x1;function _0x9b1cd9(_0x219665,_0x30ab2f){const _0x9372a9=_0x3fcd,_0x1f8644=commonjsRequire(_0x219665);if(_0x30ab2f&&_0x30ab2f!==_0x9372a9(0x1f5)){const _0xc9346=_0x1f8644?.[_0x30ab2f];if(typeof _0xc9346!=='function')throw new Error(_0x9372a9(0x20b)+_0x30ab2f);return _0xc9346;}if(typeof _0x1f8644===_0x9372a9(0x233))return _0x1f8644;if(typeof _0x1f8644?.[_0x9372a9(0x1f5)]===_0x9372a9(0x233))return _0x1f8644[_0x9372a9(0x1f5)];throw new Error(_0x9372a9(0x24f));}return okdbQueueLoadHandler={'loadHandler':_0x9b1cd9},okdbQueueLoadHandler;}var okdbFunctionsSandboxHost,hasRequiredOkdbFunctionsSandboxHost;function requireOkdbFunctionsSandboxHost(){const _0x2f3b32=_0x275d88;if(hasRequiredOkdbFunctionsSandboxHost)return okdbFunctionsSandboxHost;hasRequiredOkdbFunctionsSandboxHost=0x1;const _0x549994=require$$0$1,{Worker:_0x5aa049}=require$$1,_0x55000f=_0x549994[_0x2f3b32(0x271)](__dirname,'okdb-functions-sandbox-worker.js'),_0x374141=0x100,_0x54e465=0x3e8;function _0x14900d(_0x3c8ffe,_0x425476){const _0x3a5b30=_0x2f3b32,_0x7be452=new Error(_0x3c8ffe);return _0x7be452[_0x3a5b30(0x25e)]=_0x425476,_0x7be452;}class _0x34bbf2{constructor({rootPath:_0x426c15,memoryMb:_0x13c2f1,maxConcurrency:_0x1e7a57,idleMs:_0x45e585,graceMs:_0xc73f9b,onThreadStats:_0xf245ea,log:_0x2998c8}={}){const _0x130c48=_0x2f3b32;if(!_0x426c15)throw new Error(_0x130c48(0x28a));this[_0x130c48(0x2ab)]=_0x426c15,this[_0x130c48(0x206)]=Math[_0x130c48(0x270)](0x20,Math['floor'](_0x13c2f1??_0x374141)),this[_0x130c48(0x213)]=Math[_0x130c48(0x270)](0x1,Number(process.env.OKDB_FN_SANDBOX_CONCURRENCY)||_0x1e7a57||0x4),this['idleMs']=Math['max'](0x3e8,Number(process.env.OKDB_FN_SANDBOX_IDLE_MS)||_0x45e585||0x7530),this['graceMs']=Math['max'](0x64,Number(process.env.OKDB_FN_SANDBOX_GRACE_MS)||_0xc73f9b||0x5dc),this[_0x130c48(0x268)]=_0xf245ea??null,this[_0x130c48(0x1a2)]=_0x2998c8??null,this[_0x130c48(0x2a3)]=new Map(),this[_0x130c48(0x1c2)]=![];}[_0x2f3b32(0x225)](){const _0x200d0a=_0x2f3b32;let _0x4dc506=0x0;for(const _0x279ff0 of this[_0x200d0a(0x2a3)]['values']())_0x4dc506+=_0x279ff0[_0x200d0a(0x1b7)][_0x200d0a(0x2b5)];return _0x4dc506;}['_tierFor'](){const _0x4fa5c7=_0x2f3b32;return this[_0x4fa5c7(0x206)];}[_0x2f3b32(0x28d)](_0xdc0173){const _0x511c8d=_0x2f3b32;let _0x41c4f9=this[_0x511c8d(0x2a3)][_0x511c8d(0x23b)](_0xdc0173);if(_0x41c4f9)return _0x41c4f9;const _0xe18d5b=new _0x5aa049(_0x55000f,{'workerData':{'rootPath':this[_0x511c8d(0x2ab)]},'stdout':!![],'stderr':!![]});_0xe18d5b[_0x511c8d(0x1ec)]?.[_0x511c8d(0x1c1)](),_0xe18d5b['stderr']?.[_0x511c8d(0x1c1)](),_0xe18d5b[_0x511c8d(0x2b6)]?.();let _0x66cba4;const _0x46a4f1=new Promise((_0x5522aa,_0x4c8aae)=>{const _0xe64233=_0x511c8d,_0x1063e2=(_0x596b15,_0x424ded)=>{const _0x57e77b=_0x3fcd;_0x41c4f9['readySettled']=!![],_0xe18d5b['off'](_0x57e77b(0x283),_0x469b9c),_0x596b15(_0x424ded);},_0x469b9c=_0x18497d=>{const _0x5bdab4=_0x3fcd;if(_0x18497d?.[_0x5bdab4(0x1ed)]===_0x5bdab4(0x1c6))_0x1063e2(_0x5522aa);else{if(_0x18497d?.[_0x5bdab4(0x1ed)]===_0x5bdab4(0x281))_0x1063e2(_0x4c8aae,_0x14900d(_0x18497d[_0x5bdab4(0x2a4)]?.[_0x5bdab4(0x283)]??'sandbox\x20failed\x20to\x20boot',_0x5bdab4(0x253)));}};_0x66cba4=_0x3ed5ad=>_0x1063e2(_0x4c8aae,_0x3ed5ad),_0xe18d5b['on'](_0xe64233(0x283),_0x469b9c);});return _0x41c4f9={'worker':_0xe18d5b,'inflight':new Map(),'idleTimer':null,'readySettled':![],'rejectReady':_0x66cba4,'ready':_0x46a4f1},_0x41c4f9[_0x511c8d(0x1c6)][_0x511c8d(0x252)](()=>{}),this[_0x511c8d(0x2a3)][_0x511c8d(0x1be)](_0xdc0173,_0x41c4f9),_0xe18d5b['on'](_0x511c8d(0x283),_0x4889f2=>this[_0x511c8d(0x246)](_0xdc0173,_0x41c4f9,_0x4889f2)),_0xe18d5b['on']('error',_0x38eb05=>{const _0x381e9b=_0x511c8d,_0x410771=_0x38eb05?.[_0x381e9b(0x25e)]===_0x381e9b(0x259);this[_0x381e9b(0x258)](_0xdc0173,_0x41c4f9,_0x410771?_0x14900d(_0x381e9b(0x22f)+_0xdc0173+_0x381e9b(0x218),_0x381e9b(0x1ac)):_0x14900d('function\x20sandbox\x20error:\x20'+(_0x38eb05?.[_0x381e9b(0x283)]??_0x38eb05),_0x381e9b(0x253)));}),_0xe18d5b['on'](_0x511c8d(0x2b0),_0x4d974b=>{const _0x4d6fe9=_0x511c8d;this[_0x4d6fe9(0x258)](_0xdc0173,_0x41c4f9,_0x14900d('function\x20sandbox\x20exited\x20(code\x20'+_0x4d974b+')',_0x4d6fe9(0x253)));}),_0x41c4f9;}[_0x2f3b32(0x246)](_0x163362,_0x48d7bf,_0x5c42cb){const _0x9e561b=_0x2f3b32;if(!_0x5c42cb||typeof _0x5c42cb!==_0x9e561b(0x1a4))return;if(_0x5c42cb[_0x9e561b(0x1ed)]==='stats'){this[_0x9e561b(0x268)]?.(_0x9e561b(0x238)+_0x163362,{'heapUsed':_0x5c42cb[_0x9e561b(0x294)]??0x0});return;}const _0x5dfcd6=_0x5c42cb[_0x9e561b(0x20e)]!=null?_0x48d7bf[_0x9e561b(0x1b7)][_0x9e561b(0x23b)](_0x5c42cb[_0x9e561b(0x20e)]):null;if(!_0x5dfcd6)return;if(_0x5c42cb[_0x9e561b(0x1ed)]===_0x9e561b(0x1a2)){_0x5dfcd6[_0x9e561b(0x2c1)][_0x9e561b(0x284)](_0x5c42cb[_0x9e561b(0x1ad)]);return;}if(_0x5c42cb[_0x9e561b(0x1ed)]===_0x9e561b(0x236)||_0x5c42cb[_0x9e561b(0x1ed)]===_0x9e561b(0x2a4))_0x48d7bf[_0x9e561b(0x1b7)][_0x9e561b(0x27e)](_0x5c42cb['requestId']),clearTimeout(_0x5dfcd6[_0x9e561b(0x23d)]),_0x5dfcd6[_0x9e561b(0x29b)]({'message':_0x5c42cb,'logs':_0x5dfcd6[_0x9e561b(0x2c1)]}),this[_0x9e561b(0x1ce)](_0x163362,_0x48d7bf);else _0x5dfcd6['onEmit']&&_0x5dfcd6[_0x9e561b(0x18c)](_0x5c42cb);}async[_0x2f3b32(0x1c7)](_0x60b654,{onEmit:_0x116a66}={}){const _0x43fb1a=_0x2f3b32;if(this[_0x43fb1a(0x1c2)])throw _0x14900d(_0x43fb1a(0x2c2),'FUNCTION_SANDBOX_EXIT');const _0x234855=this[_0x43fb1a(0x205)](_0x60b654),_0x5f479c=this[_0x43fb1a(0x28d)](_0x234855);return _0x5f479c['idleTimer']&&(clearTimeout(_0x5f479c[_0x43fb1a(0x237)]),_0x5f479c[_0x43fb1a(0x237)]=null),await _0x5f479c[_0x43fb1a(0x1c6)],new Promise((_0x4e25ad,_0x5c2df7)=>{const _0x2dfc8f=_0x43fb1a,_0x2de8ce=Math[_0x2dfc8f(0x270)](0x1,_0x60b654['runtime']?.[_0x2dfc8f(0x1fd)]??_0x54e465),_0x453308={'resolve':_0x4e25ad,'reject':_0x5c2df7,'logs':[],'onEmit':_0x116a66??null,'cancelled':![],'watchdog':setTimeout(()=>{const _0x4d2376=_0x2dfc8f;this[_0x4d2376(0x19b)](_0x234855,_0x5f479c,_0x60b654['requestId'],_0x14900d(_0x4d2376(0x220)+_0x2de8ce+_0x4d2376(0x2b9)+this[_0x4d2376(0x229)]+_0x4d2376(0x1c8),_0x453308[_0x4d2376(0x1e0)]?'FUNCTION_CANCELLED':'FUNCTION_TIMEOUT'));},_0x2de8ce+this[_0x2dfc8f(0x229)])};if(_0x453308[_0x2dfc8f(0x23d)][_0x2dfc8f(0x2b6)])_0x453308['watchdog'][_0x2dfc8f(0x2b6)]();_0x5f479c['inflight'][_0x2dfc8f(0x1be)](_0x60b654[_0x2dfc8f(0x20e)],_0x453308),_0x5f479c['worker'][_0x2dfc8f(0x1f4)]({'type':_0x2dfc8f(0x1c7),'job':_0x60b654});});}[_0x2f3b32(0x1fc)](_0x4052b5){const _0x405b83=_0x2f3b32;for(const [_0xe69efe,_0x25cfe9]of this['_tiers']){const _0x4c5de2=_0x25cfe9[_0x405b83(0x1b7)][_0x405b83(0x23b)](_0x4052b5);if(!_0x4c5de2)continue;if(_0x4c5de2[_0x405b83(0x1e0)])return!![];_0x4c5de2['cancelled']=!![],_0x25cfe9[_0x405b83(0x23f)][_0x405b83(0x1f4)]({'type':'cancel','requestId':_0x4052b5}),clearTimeout(_0x4c5de2[_0x405b83(0x23d)]),_0x4c5de2[_0x405b83(0x23d)]=setTimeout(()=>{const _0x2f6fe8=_0x405b83;this[_0x2f6fe8(0x19b)](_0xe69efe,_0x25cfe9,_0x4052b5,_0x14900d(_0x2f6fe8(0x257),_0x2f6fe8(0x1f3)));},this[_0x405b83(0x229)]);if(_0x4c5de2['watchdog'][_0x405b83(0x2b6)])_0x4c5de2[_0x405b83(0x23d)][_0x405b83(0x2b6)]();return!![];}return![];}[_0x2f3b32(0x19b)](_0xe85e34,_0x49852e,_0x54bb10,_0x8ca10b){const _0x56be72=_0x2f3b32;for(const [_0x830f91,_0x44e8dd]of _0x49852e['inflight']){clearTimeout(_0x44e8dd['watchdog']),_0x44e8dd[_0x56be72(0x196)](_0x830f91===_0x54bb10?_0x8ca10b:_0x14900d(_0x56be72(0x235),_0x56be72(0x253)));}_0x49852e[_0x56be72(0x1b7)][_0x56be72(0x1da)](),this[_0x56be72(0x2a9)](_0xe85e34,_0x49852e);}[_0x2f3b32(0x258)](_0x20a137,_0x1062ef,_0x1e362e){const _0x5ac98f=_0x2f3b32;if(this['_tiers'][_0x5ac98f(0x23b)](_0x20a137)!==_0x1062ef)return;if(!_0x1062ef['readySettled'])_0x1062ef[_0x5ac98f(0x227)]?.(_0x1e362e);for(const [,_0x4fd045]of _0x1062ef[_0x5ac98f(0x1b7)]){clearTimeout(_0x4fd045[_0x5ac98f(0x23d)]),_0x4fd045[_0x5ac98f(0x196)](_0x1e362e);}_0x1062ef[_0x5ac98f(0x1b7)][_0x5ac98f(0x1da)](),this['_dropTier'](_0x20a137,_0x1062ef);}['_dropTier'](_0x41d4ab,_0xd491fa){const _0x28ce67=_0x2f3b32;if(this[_0x28ce67(0x2a3)]['get'](_0x41d4ab)===_0xd491fa)this['_tiers']['delete'](_0x41d4ab);if(_0xd491fa[_0x28ce67(0x237)])clearTimeout(_0xd491fa['idleTimer']);this[_0x28ce67(0x268)]?.('fn-sandbox:'+_0x41d4ab,null),_0xd491fa['worker'][_0x28ce67(0x2bc)]()[_0x28ce67(0x252)](()=>{});}[_0x2f3b32(0x1ce)](_0x593ef4,_0x16ca37){const _0x5a1d92=_0x2f3b32;if(_0x16ca37[_0x5a1d92(0x1b7)][_0x5a1d92(0x2b5)]>0x0||_0x16ca37[_0x5a1d92(0x237)])return;_0x16ca37['idleTimer']=setTimeout(()=>this[_0x5a1d92(0x2a9)](_0x593ef4,_0x16ca37),this[_0x5a1d92(0x280)]);if(_0x16ca37[_0x5a1d92(0x237)][_0x5a1d92(0x2b6)])_0x16ca37[_0x5a1d92(0x237)]['unref']();}[_0x2f3b32(0x29e)](){const _0x4bb180=_0x2f3b32;for(const [_0x26ede3,_0x453947]of[...this[_0x4bb180(0x2a3)]]){this[_0x4bb180(0x258)](_0x26ede3,_0x453947,_0x14900d('sandbox\x20recycled',_0x4bb180(0x253)));}}async[_0x2f3b32(0x1d6)](){const _0x5efd41=_0x2f3b32;this[_0x5efd41(0x1c2)]=!![],this[_0x5efd41(0x29e)]();}}return okdbFunctionsSandboxHost={'SandboxHost':_0x34bbf2,'SANDBOX_ENTRY':_0x55000f},okdbFunctionsSandboxHost;}var hasRequiredOkdbWorkerChild;function requireOkdbWorkerChild(){const _0x328e3b=_0x275d88;if(hasRequiredOkdbWorkerChild)return okdbWorkerChild$1;hasRequiredOkdbWorkerChild=0x1;const _0x16a176=require$$0$1;function _0x34a535(_0x34a0eb){const _0x23554d=_0x3fcd;try{if(typeof process[_0x23554d(0x1e8)]===_0x23554d(0x233))process[_0x23554d(0x1e8)](_0x34a0eb);}catch{}}let _0x3e9c98=![],_0x1f69bb=null;async function _0x1bd3b1(_0x288f2c,_0x4ae721){const _0x316c79=_0x3fcd;if(_0x3e9c98)return;_0x3e9c98=!![];try{await _0x1f69bb?.['stop']?.();}catch{}const _0x15853a=setTimeout(()=>process[_0x316c79(0x2b0)](_0x288f2c),0xbb8);if(typeof _0x15853a['unref']===_0x316c79(0x233))_0x15853a['unref']();try{await _0x4ae721?.[_0x316c79(0x2aa)]?.();}catch{}process['exit'](_0x288f2c);}function _0x453185(_0x425760,_0x43723c,_0x22f8b8=null){const _0x247b67=_0x3fcd,_0x361de3=require$$1$1;let _0x3d3007=process[_0x247b67(0x1f1)](),_0x3c97be=Date[_0x247b67(0x247)]();const _0x4f60ba=()=>{const _0x45fd38=_0x247b67;try{const _0x259c19=[];for(const [_0x3ce171,_0x49de41]of _0x43723c[_0x45fd38(0x234)]){if(_0x3ce171[_0x45fd38(0x22d)]('~'))continue;for(const _0x52a1fd of _0x49de41[_0x45fd38(0x21a)][_0x45fd38(0x24c)]())_0x259c19[_0x45fd38(0x284)]({..._0x52a1fd,'env':_0x3ce171});}return _0x259c19['length']>0x0?{'processors':_0x259c19}:null;}catch{return null;}},_0x4f43da=()=>{const _0xde47=_0x247b67;if(_0x3e9c98)return;const _0x128f15=Date[_0xde47(0x247)](),_0x51cb2d=process[_0xde47(0x1f1)](),_0x1c148f=(_0x128f15-_0x3c97be)*0x3e8,_0x23d73c=_0x51cb2d[_0xde47(0x1ae)]-_0x3d3007[_0xde47(0x1ae)]+(_0x51cb2d[_0xde47(0x190)]-_0x3d3007[_0xde47(0x190)]),_0x5035c3=_0x1c148f>0x0?Math['min'](0x64,Math[_0xde47(0x23c)](_0x23d73c/(_0x1c148f*(_0x361de3['cpus']()[_0xde47(0x23e)]||0x1))*0x64)):0x0;_0x3d3007=_0x51cb2d,_0x3c97be=_0x128f15;const _0x4d7b35=process[_0xde47(0x243)]();_0x425760({'type':_0xde47(0x1f7),'stats':{'rss':_0x4d7b35[_0xde47(0x203)],'heapUsed':_0x4d7b35[_0xde47(0x294)],'heapTotal':_0x4d7b35[_0xde47(0x209)],'external':_0x4d7b35[_0xde47(0x202)],'cpuPct':_0x5035c3,'cpuWindowMs':Math[_0xde47(0x23c)](_0x1c148f/0x3e8)||null,..._0x22f8b8?.()??{}},'processing':_0x4f60ba()});},_0x509020=Math['max'](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x277efe=setInterval(_0x4f43da,_0x509020);if(typeof _0x277efe[_0x247b67(0x2b6)]===_0x247b67(0x233))_0x277efe[_0x247b67(0x2b6)]();}process['on'](_0x328e3b(0x1b0),_0x3a0915=>{const _0x258ca0=_0x328e3b;_0x34a535({'type':_0x258ca0(0x212),'msg':_0x258ca0(0x26b)+(_0x3a0915?.[_0x258ca0(0x283)]??_0x3a0915)});});async function _0x13d282(){const _0x55f329=_0x328e3b,_0x2fd1d5=await new Promise((_0x3644b0,_0xbdb00a)=>{const _0x500fcf=_0x3fcd,_0x2b3ddb=_0xf98c32=>{const _0x5ef6c6=_0x3fcd;_0xf98c32?.[_0x5ef6c6(0x1ed)]===_0x5ef6c6(0x282)&&(process[_0x5ef6c6(0x261)](_0x5ef6c6(0x283),_0x2b3ddb),_0x3644b0(_0xf98c32));};process['on'](_0x500fcf(0x283),_0x2b3ddb);const _0x1459c1=setTimeout(()=>{const _0x1705ea=_0x500fcf;process[_0x1705ea(0x261)](_0x1705ea(0x283),_0x2b3ddb),_0xbdb00a(new Error(_0x1705ea(0x210)));},0x2710);if(typeof _0x1459c1['unref']===_0x500fcf(0x233))_0x1459c1[_0x500fcf(0x2b6)]();}),{rootPath:_0xa5a48f,slot:_0x2d9485,supervisorKey:_0x5f96e2}=_0x2fd1d5,_0x5ecd13=commonjsRequire(_0x16a176[_0x55f329(0x271)](__dirname,'..',_0x55f329(0x22b))),{EVENTS:_0x2e5d86}=requireOkdbEnums(),_0x167555=new _0x5ecd13(_0xa5a48f,{'engines':![],'http':![],'asyncProcessors':!![],'compaction':_0x55f329(0x242),'envs':_0x55f329(0x1e7),'auth':{'open':!![]},'processing':_0x55f329(0x2a8)});{const _0x5abf06={'debug':0x0,'info':0x1,'warn':0x2,'error':0x3},_0x160a78=_0x5abf06[process.env.OKDB_WORKERS_LOG_LEVEL]??_0x5abf06[_0x55f329(0x212)];_0x167555[_0x55f329(0x1a2)][_0x55f329(0x2a0)]?.(),_0x167555['log'][_0x55f329(0x2c0)](_0x24a3a1=>{const _0x522a5e=_0x55f329;if((_0x5abf06[_0x24a3a1[_0x522a5e(0x298)]]??0x1)<_0x160a78)return;_0x34a535({'type':_0x522a5e(0x1a2),'entry':_0x24a3a1});});}try{await _0x167555[_0x55f329(0x1f9)]();}catch(_0x183785){_0x34a535({'type':_0x55f329(0x2a4),'error':_0x55f329(0x1ff)+_0x183785['message']}),process[_0x55f329(0x2b0)](0x1);return;}const _0x3a529e=Math[_0x55f329(0x270)](0x4,Number(process.env.OKDB_WORKERS_ENV_CACHE)||0x40),_0x5787bb=new Map(),_0x403685=new Set();function _0x2570e2(_0x3260bb){const _0x31f7b3=_0x55f329;try{for(const _0xe89462 of _0x3260bb[_0x31f7b3(0x21a)]?.['_registrations']?.[_0x31f7b3(0x249)]()??[]){if(_0xe89462[_0x31f7b3(0x18f)]?.[_0x31f7b3(0x230)]?.())return!![];}}catch{}return![];}function _0x197315(_0x12f9cb,_0x414506){const _0x2124bb=_0x55f329;if(_0x403685[_0x2124bb(0x1d4)](_0x12f9cb))return!![];if(_0x2570e2(_0x414506))return!![];for(const [,_0x45d4c7]of _0x411e51){if(_0x45d4c7?.[_0x2124bb(0x1a5)]===_0x12f9cb)return!![];}return![];}async function _0x302423(_0x4784b1,_0x5c2965){const _0xe49c65=_0x55f329;for(const _0x3120b9 of[..._0x167555['fts'][_0xe49c65(0x295)]?.[_0xe49c65(0x277)]?.()??[]]){if(!_0x3120b9[_0xe49c65(0x22d)](_0x4784b1+':'))continue;const _0x27c9d2=_0x167555[_0xe49c65(0x265)][_0xe49c65(0x295)][_0xe49c65(0x23b)](_0x3120b9);_0x167555[_0xe49c65(0x265)][_0xe49c65(0x295)][_0xe49c65(0x27e)](_0x3120b9);try{await _0x27c9d2?.();}catch{}}try{await _0x5c2965[_0xe49c65(0x21a)]?.[_0xe49c65(0x260)]?.();}catch{}}async function _0x11b83b(_0x450b99){const _0x26fdb8=_0x55f329,_0x3584f8=_0x5787bb['get'](_0x450b99);if(!_0x3584f8)return;_0x5787bb['delete'](_0x450b99),await _0x302423(_0x450b99,_0x3584f8);try{await _0x3584f8['timeMachine']?.[_0x26fdb8(0x1d6)]?.();}catch{}try{await _0x167555['fts'][_0x26fdb8(0x1f0)]?.(_0x450b99);}catch{}_0x167555[_0x26fdb8(0x234)][_0x26fdb8(0x27e)](_0x450b99);try{await _0x3584f8[_0x26fdb8(0x2aa)]();}catch{}}async function _0x3c9051(_0x202526){const _0x5aad65=_0x55f329;if(_0x5787bb[_0x5aad65(0x1d4)](_0x202526)){const _0xd2ed13=_0x5787bb[_0x5aad65(0x23b)](_0x202526);return _0x5787bb['delete'](_0x202526),_0x5787bb[_0x5aad65(0x1be)](_0x202526,_0xd2ed13),_0xd2ed13;}const _0x10b868=_0x167555[_0x5aad65(0x234)][_0x5aad65(0x23b)](_0x202526);if(_0x10b868&&!_0x10b868[_0x5aad65(0x25f)])return _0x10b868;if(_0x5787bb['size']>=_0x3a529e)for(const [_0x53f91d,_0x5e73d7]of _0x5787bb){if(!_0x197315(_0x53f91d,_0x5e73d7)){await _0x11b83b(_0x53f91d);break;}}const _0x4e88bd=await _0x167555[_0x5aad65(0x20c)](_0x202526);return _0x5787bb['set'](_0x202526,_0x4e88bd),_0x4e88bd;}_0x167555['events']['on'](_0x2e5d86[_0x55f329(0x21d)],()=>{const _0x4aadc3=_0x55f329;(async()=>{for(const [_0x30bfd3,_0x35d438]of[..._0x5787bb]){if(!_0x197315(_0x30bfd3,_0x35d438))await _0x11b83b(_0x30bfd3);}})()[_0x4aadc3(0x252)](()=>{});});const _0xc54753=setInterval(()=>{const _0x29e4e2=_0x55f329;if(_0x3e9c98)return;for(const [,_0x520fb6]of _0x167555['_envs']){try{_0x520fb6[_0x29e4e2(0x1e6)]?.();}catch{}}},0xc8);if(typeof _0xc54753['unref']===_0x55f329(0x233))_0xc54753['unref']();process['on'](_0x55f329(0x251),()=>_0x1bd3b1(0x0,_0x167555));if(process[_0x55f329(0x21e)]!==_0x55f329(0x19f)){const _0x40e029=setInterval(()=>{const _0xf10a34=_0x55f329;if(process[_0xf10a34(0x214)]===0x1)_0x1bd3b1(0x0,_0x167555);},0x7d0);if(typeof _0x40e029['unref']===_0x55f329(0x233))_0x40e029[_0x55f329(0x2b6)]();}process['on']('message',_0x18a5c6=>{const _0xc4b97b=_0x55f329;if(_0x18a5c6?.['type']===_0xc4b97b(0x1d6))_0x1bd3b1(0x0,_0x167555);});const {LOOP:_0x39b1b8}=requireOkdbLoopMonitor(),{createIntakeGate:_0x4422a4}=requireOkdbIntakeGate(),_0x224253=Number(process.env.OKDB_WORKERS_MAX_LEASES)||0x20,_0xdd52e9=Number(process.env.OKDB_WORKERS_LAG_GATE_MS)||0xc8,_0x4b384e=Number(process.env.OKDB_WORKERS_WEDGE_MS)||0x7530,_0x1c225e=_0x4422a4({'gateMs':_0xdd52e9});_0x39b1b8[_0x55f329(0x1fe)](({p99Ms:_0x5c7406,maxMs:_0x592db2})=>{const _0x330d83=_0x55f329;_0x592db2>_0x4b384e&&_0x34a535({'type':_0x330d83(0x285),'maxMs':_0x592db2});const {changed:_0x31110d,level:_0x4d4d4f}=_0x1c225e[_0x330d83(0x1fe)](_0x5c7406);if(_0x31110d)_0x34a535({'type':'intake','level':_0x4d4d4f,'p99Ms':_0x5c7406});});const {loadHandler:_0x10d862}=requireOkdbQueueLoadHandler(),_0x411e51=new Map();let _0x3898c9=![],_0x12e641={'defsSeen':-0x1,'lastError':null,'at':0x0};const _0x33cd9f=new Set(),_0x2ab6df=(_0x4abdca,_0x94832e)=>{const _0x226d08=_0x55f329,_0x585676=_0x4abdca+'::'+_0x94832e;if(_0x33cd9f[_0x226d08(0x1d4)](_0x585676))return;_0x33cd9f[_0x226d08(0x2b7)](_0x585676),_0x34a535({'type':'warn','msg':_0x226d08(0x29d)+_0x4abdca+'\x20—\x20'+_0x94832e});},_0x29990d={'name':'queue','cost':_0x55f329(0x1d3),'inFlight':()=>_0x411e51['size'],'detail':()=>({'consumers':[..._0x411e51['keys']()],'tick':_0x12e641}),async 'tick'(){const _0x368aee=_0x55f329;if(_0x3898c9||_0x3e9c98)return;_0x3898c9=!![];try{const _0x3eef53=_0x167555[_0x368aee(0x279)][_0x368aee(0x27b)]?.('queue-worker')??[];_0x12e641={'defsSeen':_0x3eef53['length'],'lastError':null,'at':Date[_0x368aee(0x247)]()};const _0x28cf6a=new Set();for(const {key:_0xdc3b05,value:_0x357cff}of _0x3eef53){if(!_0x357cff||_0x357cff[_0x368aee(0x26c)]===![])continue;_0x28cf6a[_0x368aee(0x2b7)](_0xdc3b05);const _0x4edfed=_0x411e51[_0x368aee(0x23b)](_0xdc3b05);if(_0x4edfed){if(_0x4edfed['version']===_0x357cff[_0x368aee(0x19a)])continue;_0x411e51[_0x368aee(0x27e)](_0xdc3b05);try{await _0x4edfed[_0x368aee(0x23f)]?.['stop']?.();}catch{}}const _0x3cc472=_0x357cff[_0x368aee(0x1a5)]??_0xdc3b05['split']('::')[0x0];let _0x47e9f7;try{_0x47e9f7=await _0x3c9051(_0x3cc472);}catch(_0xe13fda){_0x2ab6df(_0xdc3b05,'env\x20open\x20failed:\x20'+_0xe13fda?.[_0x368aee(0x283)]);continue;}if(!_0x47e9f7?.[_0x368aee(0x1d5)]){_0x2ab6df(_0xdc3b05,_0x368aee(0x245));continue;}let _0x4e1d98;try{_0x4e1d98=_0x10d862(_0x357cff[_0x368aee(0x2a7)],_0x357cff[_0x368aee(0x288)]);}catch(_0x5f1b72){_0x2ab6df(_0xdc3b05,_0x368aee(0x219)+_0x5f1b72?.[_0x368aee(0x283)]);continue;}let _0x575df7;try{_0x575df7=_0x47e9f7['queue'][_0x368aee(0x28e)](_0x357cff[_0x368aee(0x293)]??_0xdc3b05[_0x368aee(0x296)]('::')[0x1],_0x4e1d98,_0x357cff[_0x368aee(0x1ee)]??{});}catch(_0x3d9b4f){_0x2ab6df(_0xdc3b05,_0x368aee(0x1d0)+_0x3d9b4f?.[_0x368aee(0x283)]);continue;}_0x411e51['set'](_0xdc3b05,{'worker':_0x575df7,'version':_0x357cff['version'],'envName':_0x3cc472});}for(const [_0x58661f,_0x291bfd]of[..._0x411e51]){if(!_0x28cf6a['has'](_0x58661f)){_0x411e51[_0x368aee(0x27e)](_0x58661f),_0x34a535({'type':_0x368aee(0x212),'msg':'queue\x20consumer\x20stopped\x20(def\x20deregistered):\x20'+_0x58661f});try{await _0x291bfd['worker']?.[_0x368aee(0x1d6)]?.();}catch{}}}}catch(_0x40731b){_0x12e641[_0x368aee(0x262)]=_0x40731b?.[_0x368aee(0x283)]??String(_0x40731b);throw _0x40731b;}finally{_0x3898c9=![];}}};let _0x4afc6e;{const {SandboxHost:_0x41943f}=requireOkdbFunctionsSandboxHost(),_0x554414=_0x167555[_0x55f329(0x189)][_0x55f329(0x221)](_0x55f329(0x25b),{'dupSort':![]}),_0x2e3d7b=_0x167555[_0x55f329(0x189)][_0x55f329(0x221)]('~fn:responses',{'dupSort':![]}),_0x3efdfd=Number(process.env.OKDB_FN_STALE_MS)||0xea60,_0x94eec6=new _0x41943f({'rootPath':_0xa5a48f,'log':_0x167555[_0x55f329(0x1a2)],'onThreadStats':(_0x40010a,_0x1910c4)=>{const _0x116555=_0x55f329;if(_0x1910c4)_0x167555[_0x116555(0x279)]?.[_0x116555(0x26e)]?.(_0x40010a,_0x1910c4);else _0x167555[_0x116555(0x279)]?.[_0x116555(0x267)]?.(_0x40010a);}});_0x1f69bb=_0x94eec6;const _0x48053d=new Set(),_0x30df13=(_0x296918,_0x2a3f12)=>{const _0x8b82c1=_0x55f329,_0x3ba75d=_0x554414[_0x8b82c1(0x23b)](_0x296918);if(!_0x3ba75d||_0x3ba75d[_0x8b82c1(0x1b4)]===_0x8b82c1(0x1e0)){try{_0x554414[_0x8b82c1(0x1a7)](_0x296918);}catch{}return;}_0x2e3d7b[_0x8b82c1(0x18d)](_0x296918,_0x2a3f12);try{_0x554414[_0x8b82c1(0x1a7)](_0x296918);}catch{}},_0xd78ba0=(_0x286b50,_0x3902e7)=>{const _0x2eef95=_0x55f329;_0x48053d[_0x2eef95(0x2b7)](_0x286b50),_0x94eec6[_0x2eef95(0x1c7)]({..._0x3902e7,'requestId':_0x286b50})[_0x2eef95(0x208)](({message:_0x20d744,logs:_0x1b02eb})=>_0x30df13(_0x286b50,{'message':_0x20d744,'logs':_0x1b02eb}))[_0x2eef95(0x252)](_0x1e55c3=>{const _0x1cee6a=_0x2eef95;if(_0x1e55c3?.[_0x1cee6a(0x25e)]===_0x1cee6a(0x253)){try{const _0x112595=_0x554414['get'](_0x286b50);_0x112595&&_0x112595['state']===_0x1cee6a(0x28c)&&_0x112595[_0x1cee6a(0x1cb)]===process[_0x1cee6a(0x20a)]&&_0x554414[_0x1cee6a(0x18d)](_0x286b50,{..._0x112595,'state':_0x1cee6a(0x193),'requestedAt':Date[_0x1cee6a(0x247)]()});}catch{}return;}_0x30df13(_0x286b50,{'message':{'type':'error','requestId':_0x286b50,'runId':_0x3902e7[_0x1cee6a(0x20f)],'error':{'message':_0x1e55c3?.[_0x1cee6a(0x283)]??String(_0x1e55c3),'code':_0x1e55c3?.['code']??_0x1cee6a(0x25a)},'meta':{'runnerId':_0x1cee6a(0x2ac)+process[_0x1cee6a(0x20a)]}},'logs':[]});})[_0x2eef95(0x27a)](()=>_0x48053d['delete'](_0x286b50));};_0x4afc6e={'name':'fn','cost':_0x55f329(0x1d3),'inFlight':()=>_0x94eec6[_0x55f329(0x225)](),async 'tick'(){const _0x1c9875=_0x55f329;if(_0x3e9c98)return;for(const _0x2eec94 of[..._0x48053d]){const _0x18b740=_0x554414[_0x1c9875(0x23b)](_0x2eec94);if(!_0x18b740||_0x18b740[_0x1c9875(0x1b4)]===_0x1c9875(0x1e0))_0x94eec6[_0x1c9875(0x1fc)](_0x2eec94);}for(const {key:_0x430aa6,value:_0x1ec4bc}of _0x554414[_0x1c9875(0x1ab)]({})){if(_0x3e9c98)break;if(_0x94eec6[_0x1c9875(0x225)]()>=_0x94eec6[_0x1c9875(0x213)])break;if(!_0x1ec4bc||_0x1ec4bc['state']!==_0x1c9875(0x193))continue;if(_0x1ec4bc[_0x1c9875(0x2b4)]&&Date['now']()-_0x1ec4bc[_0x1c9875(0x2b4)]>_0x3efdfd){try{_0x554414['transactionSync'](()=>{const _0x488210=_0x1c9875,_0x1b20fe=_0x554414[_0x488210(0x23b)](_0x430aa6);if(_0x1b20fe?.[_0x488210(0x1b4)]==='pending'&&_0x1b20fe[_0x488210(0x2b4)]&&Date[_0x488210(0x247)]()-_0x1b20fe[_0x488210(0x2b4)]>_0x3efdfd)_0x554414[_0x488210(0x198)](_0x430aa6);});}catch{}continue;}let _0xbe859d=![];_0x554414[_0x1c9875(0x19e)](()=>{const _0x2b2b85=_0x1c9875,_0x435736=_0x554414[_0x2b2b85(0x23b)](_0x430aa6);_0x435736?.[_0x2b2b85(0x1b4)]==='pending'&&(_0x554414[_0x2b2b85(0x274)](_0x430aa6,{..._0x435736,'state':_0x2b2b85(0x28c),'claimedBy':process[_0x2b2b85(0x20a)],'claimedAt':Date['now']()}),_0xbe859d=!![]);});if(!_0xbe859d)continue;_0xd78ba0(_0x430aa6,_0x1ec4bc);}}};}let _0x3a39ca=0x0;const _0x73b1eb=_0x167555[_0x55f329(0x189)][_0x55f329(0x221)](_0x55f329(0x23a),{'dupSort':![]}),_0x223a2a={'name':'bootstrap','cost':'heavy','inFlight':()=>_0x3a39ca,async 'tick'(){const _0xfea844=_0x55f329;if(_0x3e9c98||_0x3a39ca>=0x1)return;const _0x585288=[];try{for(const {key:_0x1ab1de,value:_0x22a249}of _0x73b1eb[_0xfea844(0x1ab)]({})){if(typeof _0x1ab1de===_0xfea844(0x2a5)&&_0x22a249?.[_0xfea844(0x2b3)]&&!_0x22a249[_0xfea844(0x2b3)]['startsWith']('~'))_0x585288['push'](_0x22a249);}}catch{}for(const _0x40a84c of _0x585288){if(_0x3e9c98||_0x3a39ca>=0x1)return;let _0x16b9c9;try{_0x16b9c9=await _0x3c9051(_0x40a84c['env']);}catch{continue;}if(_0x40a84c['kind']===_0xfea844(0x1a8)&&_0x40a84c[_0xfea844(0x226)]){const _0x34ce60=_0x16b9c9['get']?.(_0xfea844(0x29f),_0x40a84c[_0xfea844(0x226)]);if(!_0x34ce60)continue;let _0x2bf69b=![];_0x403685['add'](_0x40a84c[_0xfea844(0x2b3)]);const _0x4803de=_0x16b9c9[_0xfea844(0x21a)][_0xfea844(0x1c3)]({'rowKey':'bootstrap:'+_0x40a84c['cursorKey'],'cursorKey':_0x40a84c[_0xfea844(0x1b2)]},async()=>{const _0x4c7126=_0xfea844;!_0x16b9c9[_0x4c7126(0x22a)][_0x4c7126(0x286)][_0x4c7126(0x1d4)](_0x40a84c[_0x4c7126(0x226)])&&_0x16b9c9[_0x4c7126(0x22a)]['_activateViewStorage'](_0x40a84c['viewName'],_0x34ce60),await _0x16b9c9['views'][_0x4c7126(0x199)](_0x40a84c[_0x4c7126(0x226)],_0x34ce60);},{'onClaimed':()=>{_0x2bf69b=!![],_0x3a39ca++;}})[_0xfea844(0x252)](()=>{})[_0xfea844(0x27a)](()=>{const _0x13d807=_0xfea844;if(_0x2bf69b)_0x3a39ca--;_0x403685[_0x13d807(0x27e)](_0x40a84c[_0x13d807(0x2b3)]);});if(_0x2bf69b)return;await _0x4803de;continue;}try{await _0x167555[_0xfea844(0x265)]['process']({'envs':[_0x40a84c['env']],'types':_0x40a84c[_0xfea844(0x1ed)]?[_0x40a84c['type']]:'*'});}catch{continue;}let _0x2333a5=[];try{_0x2333a5=_0x16b9c9[_0xfea844(0x21a)]['listWorkerBootstrapJobs']();}catch{}for(const _0xba152c of _0x2333a5){if(_0x3e9c98||_0x3a39ca>=0x1)return;let _0x4895f6=![];_0x403685['add'](_0x40a84c[_0xfea844(0x2b3)]);const _0x2fb4aa=_0x16b9c9[_0xfea844(0x21a)][_0xfea844(0x228)](_0xba152c,{'onClaimed':()=>{_0x4895f6=!![],_0x3a39ca++;}})['catch'](()=>{})[_0xfea844(0x27a)](()=>{const _0x771d48=_0xfea844;if(_0x4895f6)_0x3a39ca--;_0x403685['delete'](_0x40a84c[_0x771d48(0x2b3)]);});if(_0x4895f6)return;await _0x2fb4aa;}}}},_0x476855=Math[_0x55f329(0x270)](0x1,Number(process.env.OKDB_WORKERS_PROBE_PER_TICK)||0x2),_0x584e9b=Math[_0x55f329(0x270)](0x1,Number(process.env.OKDB_WORKERS_PROBE_GRACE_TICKS)||0x3);let _0x29031=Math['floor'](Math[_0x55f329(0x2af)]()*0x1000);const _0x50a762=new Set(),_0x3d7808=new Map(),_0x2ac78d=Math['max'](0x3e8,Number(process.env.OKDB_WORKERS_PROBE_COOLDOWN_MS)||0x7530),_0x17b345=new Map(),_0x4c458a={'name':_0x55f329(0x265),'cost':'light','inFlight':()=>{let _0x371735=0x0;for(const [,_0x4662c3]of _0x5787bb)if(_0x2570e2(_0x4662c3))_0x371735++;return _0x371735;},async 'tick'(){const _0x2b8dca=_0x55f329;if(_0x3e9c98)return;const _0x20a37c=_0x167555[_0x2b8dca(0x265)]['listFtsEnvs']();if(_0x20a37c['length']===0x0)return;const _0x590d09=new Map();for(const _0x152827 of _0x20a37c){if(!_0x590d09[_0x2b8dca(0x1d4)](_0x152827['env']))_0x590d09[_0x2b8dca(0x1be)](_0x152827['env'],[]);_0x590d09[_0x2b8dca(0x23b)](_0x152827['env'])['push'](_0x152827[_0x2b8dca(0x1ed)]);}const _0x2e3e5b=[..._0x590d09['keys']()],_0x213292=Date[_0x2b8dca(0x247)](),_0x19b3d0=[];for(const _0x59e433 of _0x50a762){_0x590d09[_0x2b8dca(0x1d4)](_0x59e433)&&!_0x19b3d0[_0x2b8dca(0x19d)](_0x59e433)&&(_0x17b345[_0x2b8dca(0x27e)](_0x59e433),_0x19b3d0[_0x2b8dca(0x284)](_0x59e433));}_0x50a762[_0x2b8dca(0x1da)]();for(let _0x3a27a3=0x0;_0x19b3d0['length']<_0x476855&&_0x3a27a3<_0x2e3e5b['length'];_0x3a27a3++){const _0x2ff9b0=_0x2e3e5b[(_0x29031+_0x3a27a3)%_0x2e3e5b[_0x2b8dca(0x23e)]];if(_0x19b3d0[_0x2b8dca(0x19d)](_0x2ff9b0))continue;if((_0x17b345[_0x2b8dca(0x23b)](_0x2ff9b0)??0x0)>_0x213292)continue;_0x19b3d0[_0x2b8dca(0x284)](_0x2ff9b0);}_0x29031=(_0x29031+_0x476855)%Math[_0x2b8dca(0x270)](0x1,_0x2e3e5b[_0x2b8dca(0x23e)]);for(const _0x251aef of _0x19b3d0){if(_0x3e9c98)return;try{await _0x3c9051(_0x251aef),await _0x167555['fts'][_0x2b8dca(0x28e)]({'envs':[_0x251aef],'types':_0x590d09[_0x2b8dca(0x23b)](_0x251aef)});}catch{}}for(const [_0x507d42,_0x4f14d9]of[..._0x5787bb]){if(_0x197315(_0x507d42,_0x4f14d9)){_0x3d7808[_0x2b8dca(0x27e)](_0x507d42);continue;}const _0x29f2cf=(_0x3d7808[_0x2b8dca(0x23b)](_0x507d42)??0x0)+0x1;_0x29f2cf>=_0x584e9b?(_0x3d7808['delete'](_0x507d42),_0x17b345['set'](_0x507d42,Date[_0x2b8dca(0x247)]()+_0x2ac78d),await _0x11b83b(_0x507d42)):_0x3d7808[_0x2b8dca(0x1be)](_0x507d42,_0x29f2cf);}}};_0x167555[_0x55f329(0x22c)]['on'](_0x2e5d86[_0x55f329(0x278)],_0x53ffd8=>{const _0x29d2c4=_0x55f329,_0x3f12de=_0x53ffd8?.[_0x29d2c4(0x2b3)];if(typeof _0x3f12de===_0x29d2c4(0x2a5)&&_0x3f12de&&!_0x3f12de[_0x29d2c4(0x22d)]('~'))_0x50a762[_0x29d2c4(0x2b7)](_0x3f12de);});const _0x4b9a98=Math[_0x55f329(0x270)](0x64,Number(process.env.OKDB_WORKERS_CLAIM_TICK_MS)||0x3e8),_0x4c3c8f=[_0x4afc6e,_0x29990d,_0x223a2a,_0x4c458a],_0x45c69d=[_0x29990d,_0x223a2a,_0x4c458a];let _0x13f7f2=0x0;const _0x41f70b=_0x147e50=>{const _0x32fdc9=_0x55f329;if(_0x3e9c98||_0x1c225e[_0x32fdc9(0x241)](_0x147e50[_0x32fdc9(0x27f)]))return;_0x147e50[_0x32fdc9(0x1bf)]()[_0x32fdc9(0x252)](()=>{});},_0x2a64d7=setInterval(()=>{const _0x1b76af=_0x55f329;_0x41f70b(_0x4afc6e);for(let _0x222613=0x0;_0x222613<_0x45c69d[_0x1b76af(0x23e)];_0x222613++){_0x41f70b(_0x45c69d[(_0x13f7f2+_0x222613)%_0x45c69d[_0x1b76af(0x23e)]]);}_0x13f7f2=(_0x13f7f2+0x1)%_0x45c69d[_0x1b76af(0x23e)];},_0x4b9a98);if(typeof _0x2a64d7['unref']===_0x55f329(0x233))_0x2a64d7[_0x55f329(0x2b6)]();_0x167555[_0x55f329(0x22c)]['on'](_0x2e5d86[_0x55f329(0x204)],_0x3c82ea=>{const _0x22e0e3=_0x55f329;if(_0x3c82ea?.[_0x22e0e3(0x255)]==='fn')_0x41f70b(_0x4afc6e);else{if(_0x3c82ea?.[_0x22e0e3(0x255)]===_0x22e0e3(0x24b))_0x41f70b(_0x223a2a);else{if(_0x3c82ea?.[_0x22e0e3(0x255)]===_0x22e0e3(0x217))_0x41f70b(_0x29990d);else{if(_0x3c82ea?.[_0x22e0e3(0x255)]===_0x22e0e3(0x264)&&typeof _0x3c82ea[_0x22e0e3(0x215)]===_0x22e0e3(0x2a5)){const _0x5d28f2=_0x3c82ea[_0x22e0e3(0x215)];_0x34a535({'type':'warn','msg':_0x22e0e3(0x1db)+_0x5d28f2+_0x22e0e3(0x263)+_0x5787bb['has'](_0x5d28f2)+')'}),(async()=>{const _0x5a3ce0=_0x22e0e3;for(const [_0x545092,_0x4029a7]of[..._0x411e51]){if(_0x4029a7?.[_0x5a3ce0(0x1a5)]!==_0x5d28f2)continue;_0x411e51[_0x5a3ce0(0x27e)](_0x545092);try{await _0x4029a7[_0x5a3ce0(0x23f)]?.[_0x5a3ce0(0x1d6)]?.();}catch{}}_0x403685[_0x5a3ce0(0x27e)](_0x5d28f2),_0x50a762[_0x5a3ce0(0x27e)](_0x5d28f2),_0x17b345[_0x5a3ce0(0x1be)](_0x5d28f2,Date[_0x5a3ce0(0x247)]()+0x1d4c0),await _0x11b83b(_0x5d28f2),_0x34a535({'type':_0x5a3ce0(0x212),'msg':'env-removed:\x20'+_0x5d28f2+_0x5a3ce0(0x248)});})()['catch'](_0x29553f=>{const _0x209cbe=_0x22e0e3;_0x34a535({'type':_0x209cbe(0x212),'msg':_0x209cbe(0x2a1)+_0x5d28f2+':\x20'+_0x29553f?.['message']});});}}}}});for(const _0x44c68d of _0x4c3c8f)_0x41f70b(_0x44c68d);_0x453185(_0x34a535,_0x167555,()=>({'claims':_0x4c3c8f[_0x55f329(0x1a6)](_0x1acfd1=>({'name':_0x1acfd1[_0x55f329(0x28b)],'inFlight':_0x1acfd1[_0x55f329(0x291)](),'gated':_0x1c225e[_0x55f329(0x241)](_0x1acfd1[_0x55f329(0x27f)]),..._0x1acfd1[_0x55f329(0x1cc)]?{'detail':_0x1acfd1[_0x55f329(0x1cc)]()}:{}})),'envsOpen':_0x167555[_0x55f329(0x234)]['size']})),_0x34a535({'type':_0x55f329(0x1c6),'pid':process[_0x55f329(0x20a)],'slot':_0x2d9485,'supervisorKey':_0x5f96e2,'maxLeases':_0x224253});}return _0x13d282()[_0x328e3b(0x252)](_0x3f43b6=>{const _0x197eb8=_0x328e3b;_0x34a535({'type':_0x197eb8(0x2a4),'error':_0x3f43b6[_0x197eb8(0x283)]}),process[_0x197eb8(0x2b0)](0x1);}),okdbWorkerChild$1;}var okdbWorkerChildExports=requireOkdbWorkerChild(),okdbWorkerChild=getDefaultExportFromCjs(okdbWorkerChildExports);module[_0x275d88(0x1f2)]=okdbWorkerChild;