@kedem/okdb 2.6.1 → 2.6.2
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.
- package/CHANGELOG.md +10 -0
- package/algorithm-worker-thread.js +1 -1
- package/bin/okdb.js +1 -1
- package/docs/queue.md +6 -0
- package/okdb-functions-sandbox-worker.js +1 -1
- package/okdb-http-worker-child.js +1 -1
- package/okdb-views-bootstrap-worker.js +1 -1
- package/okdb.js +1 -1
- package/package.json +1 -1
- package/types/features/queue.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to `@kedem/okdb` are documented here. Format loosely follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/); versions follow [SemVer](https://semver.org/).
|
|
5
5
|
Dates are release dates.
|
|
6
6
|
|
|
7
|
+
## [2.6.2] - 2026-10-04
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **Transactional `queue.enqueue(type, payload, { txn })`** now behaves like the non-txn path: `queue:enqueued` fires
|
|
12
|
+
after the caller's commit (never on rollback or a failed commit), a live `idempotency_key` returns the
|
|
13
|
+
existing job's id instead of failing with `UNIQUE_CONSTRAINT` at commit, and a closed or other-env
|
|
14
|
+
transaction is rejected (`TXN_CLOSED` / `TXN_ENV_MISMATCH`). `{ txn }` is now documented in
|
|
15
|
+
`docs/queue.md` and the typings.
|
|
16
|
+
|
|
7
17
|
## [2.6.1] - 2026-09-28
|
|
8
18
|
|
|
9
19
|
### Changed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x32915a=_0x2ae3;(function(_0x1df81f,_0x3ebcb9){const _0x41de4d=_0x2ae3,_0x451717=_0x1df81f();while(!![]){try{const _0x52d290=-parseInt(_0x41de4d(0x213))/0x1*(parseInt(_0x41de4d(0x20e))/0x2)+-parseInt(_0x41de4d(0x205))/0x3*(-parseInt(_0x41de4d(0x1ec))/0x4)+-parseInt(_0x41de4d(0x1dd))/0x5*(-parseInt(_0x41de4d(0x1e8))/0x6)+parseInt(_0x41de4d(0x1f2))/0x7+parseInt(_0x41de4d(0x15e))/0x8*(-parseInt(_0x41de4d(0x1ef))/0x9)+-parseInt(_0x41de4d(0x182))/0xa+parseInt(_0x41de4d(0x1f0))/0xb;if(_0x52d290===_0x3ebcb9)break;else _0x451717['push'](_0x451717['shift']());}catch(_0x3cf8b4){_0x451717['push'](_0x451717['shift']());}}}(_0x45b2,0x9696f));var require$$0$1=require('worker_threads'),require$$0=require('fs'),require$$1=require(_0x32915a(0x1d7)),require$$2=require('os'),require$$3=require(_0x32915a(0x184));function getDefaultExportFromCjs(_0x18e4fc){const _0x5b95c8=_0x32915a;return _0x18e4fc&&_0x18e4fc[_0x5b95c8(0x226)]&&Object[_0x5b95c8(0x1ee)]['hasOwnProperty'][_0x5b95c8(0x1db)](_0x18e4fc,'default')?_0x18e4fc['default']:_0x18e4fc;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x548126=_0x32915a;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x1ed5eb=require$$0,_0x4920a1=require$$1,_0x245f8d=require$$2,_0x1eee95=require$$3;function _0x4a1110(){return Date['now']();}function _0x258fc3(_0x3c76af){try{return _0x1ed5eb['existsSync'](_0x3c76af);}catch{return![];}}function _0x718d27(_0x7659b6){const _0xf9e39f=_0x2ae3;try{return _0x1ed5eb[_0xf9e39f(0x1aa)](_0x7659b6,_0xf9e39f(0x1e7));}catch{return null;}}function _0x1ceb6a(_0x5d3a31,_0x3e1645){const _0x3abea1=_0x2ae3,_0x3a697f=_0x5d3a31+_0x3abea1(0x172)+_0x1eee95[_0x3abea1(0x1b8)](0x6)[_0x3abea1(0x1dc)]('hex');_0x1ed5eb[_0x3abea1(0x1e6)](_0x3a697f,_0x3e1645),_0x1ed5eb[_0x3abea1(0x1d1)](_0x3a697f,_0x5d3a31);}function _0x540748(_0x283935,_0x1238d3=0x10){const _0x2ff74d=_0x2ae3,_0x2e8055=String(Math[_0x2ff74d(0x1f3)](0x0,Math['trunc'](_0x283935||0x0)));return _0x2e8055['length']>=_0x1238d3?_0x2e8055:'0'[_0x2ff74d(0x1b4)](_0x1238d3-_0x2e8055[_0x2ff74d(0x220)])+_0x2e8055;}return snapshotStore=class _0xb17d2b{constructor({dir:_0x25ae81,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x174605=_0x2ae3;if(!_0x25ae81)throw new Error('SnapshotStore\x20requires\x20dir');this[_0x174605(0x171)]=_0x25ae81,this['snapshotsDir']=_0x4920a1[_0x174605(0x1e9)](_0x25ae81,'snapshots'),this[_0x174605(0x1a3)]=_0x4920a1[_0x174605(0x1e9)](_0x25ae81,_0x174605(0x1fb)),this['lockPath']=_0x4920a1[_0x174605(0x1e9)](_0x25ae81,_0x174605(0x16d)),this[_0x174605(0x1f5)]=keepSnapshots,this[_0x174605(0x18e)]=log,_0x1ed5eb['mkdirSync'](this[_0x174605(0x171)],{'recursive':!![]}),_0x1ed5eb[_0x174605(0x203)](this[_0x174605(0x165)],{'recursive':!![]});}[_0x548126(0x1b0)](_0x184646){return _0x4920a1['join'](this['snapshotsDir'],_0x184646);}[_0x548126(0x212)](_0x596518){const _0x4507ea=_0x548126,_0x3e48f0=this[_0x4507ea(0x1b0)](_0x596518);return{'dir':_0x3e48f0,'index':_0x4920a1[_0x4507ea(0x1e9)](_0x3e48f0,_0x4507ea(0x17e)),'labels':_0x4920a1[_0x4507ea(0x1e9)](_0x3e48f0,'labels.json'),'state':_0x4920a1[_0x4507ea(0x1e9)](_0x3e48f0,_0x4507ea(0x187))};}[_0x548126(0x168)](){const _0x240ace=_0x548126;if(!_0x258fc3(this[_0x240ace(0x1a3)]))return null;const _0x5ad268=_0x718d27(this[_0x240ace(0x1a3)]);if(!_0x5ad268)return null;const _0x54bc46=String(_0x5ad268)['trim']();return _0x54bc46||null;}[_0x548126(0x217)](){const _0x46c819=_0x548126,_0x19c760=this[_0x46c819(0x168)]();if(!_0x19c760)return 0x0;const _0x4b5644=Number(_0x19c760);return Number[_0x46c819(0x1a0)](_0x4b5644)?_0x4b5644:0x0;}[_0x548126(0x21a)](){const _0xf3597b=_0x548126;try{return _0x1ed5eb[_0xf3597b(0x14d)](this[_0xf3597b(0x165)],{'withFileTypes':!![]})[_0xf3597b(0x1fd)](_0x2b38ce=>_0x2b38ce[_0xf3597b(0x1ab)]())[_0xf3597b(0x1c5)](_0x513e7b=>_0x513e7b[_0xf3597b(0x1c9)])[_0xf3597b(0x1fd)](_0x430e5e=>!_0x430e5e[_0xf3597b(0x189)](_0xf3597b(0x172)))[_0xf3597b(0x1fd)](_0x262422=>!_0x262422[_0xf3597b(0x189)](_0xf3597b(0x1e0)))[_0xf3597b(0x197)]();}catch{return[];}}['latestSnapshotId'](){const _0x4c3bc1=_0x548126,_0x5e3402=this['readCurrentId']();if(_0x5e3402)return _0x5e3402;const _0x52a6f0=this[_0x4c3bc1(0x21a)]();if(!_0x52a6f0[_0x4c3bc1(0x220)])return null;return _0x52a6f0[_0x52a6f0[_0x4c3bc1(0x220)]-0x1];}[_0x548126(0x209)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x56c5b5=_0x548126;let _0x4684cb;try{_0x4684cb=_0x1ed5eb[_0x56c5b5(0x14d)](this[_0x56c5b5(0x165)],{'withFileTypes':!![]});}catch{return;}const _0x447359=_0x4a1110()-maxAgeMs;for(const _0x2920d6 of _0x4684cb){if(!_0x2920d6[_0x56c5b5(0x1ab)]())continue;const _0x86aaba=_0x2920d6[_0x56c5b5(0x1c9)];if(!_0x86aaba[_0x56c5b5(0x189)](_0x56c5b5(0x172))&&!_0x86aaba['startsWith'](_0x56c5b5(0x1e0)))continue;const _0x151ea2=_0x4920a1[_0x56c5b5(0x1e9)](this['snapshotsDir'],_0x86aaba);try{const _0x1fea57=_0x1ed5eb[_0x56c5b5(0x21c)](_0x151ea2);if(_0x1fea57[_0x56c5b5(0x1c6)]>_0x447359)continue;}catch{}try{_0x1ed5eb[_0x56c5b5(0x198)](_0x151ea2,{'recursive':!![],'force':!![]});}catch{}}}[_0x548126(0x1d4)]({keep:keep=null}={}){const _0x15b35c=_0x548126,_0x19670e=Math['max'](0x1,Math[_0x15b35c(0x15d)](keep??this['keepSnapshots']??0x3)),_0x82d43c=this[_0x15b35c(0x21a)]();if(_0x82d43c[_0x15b35c(0x220)]<=_0x19670e)return;const _0x3dfd52=this[_0x15b35c(0x168)](),_0x39c399=_0x82d43c[_0x15b35c(0x166)](0x0,Math[_0x15b35c(0x1f3)](0x0,_0x82d43c[_0x15b35c(0x220)]-_0x19670e));for(const _0xdd249c of _0x39c399){if(_0x3dfd52&&_0xdd249c===_0x3dfd52)continue;const _0x2683f2=this[_0x15b35c(0x1b0)](_0xdd249c);try{_0x1ed5eb[_0x15b35c(0x198)](_0x2683f2,{'recursive':!![],'force':!![]});}catch{}}}async[_0x548126(0x17c)](_0x3927c2,_0x21045a){const _0x422f81=_0x548126;if(!_0x3927c2)throw new Error(_0x422f81(0x17a));const _0x24d778=this[_0x422f81(0x212)](_0x3927c2);if(!_0x258fc3(_0x24d778[_0x422f81(0x1de)])||!_0x258fc3(_0x24d778['labels'])||!_0x258fc3(_0x24d778[_0x422f81(0x188)]))throw new Error('snapshot\x20incomplete:\x20'+_0x3927c2);const _0x5bc28b=await _0x21045a(_0x24d778);return _0x5bc28b||{};}async['publishSnapshot'](_0xa201ff,_0x59c06a,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x589530=_0x548126,_0x52106e=Number(_0xa201ff);if(!Number[_0x589530(0x1a0)](_0x52106e)||_0x52106e<0x0)throw new Error('candidateClock\x20must\x20be\x20finite\x20>=\x200');const _0x100918=_0x540748(_0x52106e),_0x1da536=this[_0x589530(0x1b0)](_0x100918),_0x13b842=_0x4920a1[_0x589530(0x1e9)](this[_0x589530(0x165)],_0x589530(0x172)+_0x100918+'-'+_0x1eee95[_0x589530(0x1b8)](0x6)[_0x589530(0x1dc)](_0x589530(0x216)));_0x1ed5eb[_0x589530(0x203)](_0x13b842,{'recursive':!![]});const _0xbab257={'dir':_0x13b842,'index':_0x4920a1[_0x589530(0x1e9)](_0x13b842,'index.hnsw'),'labels':_0x4920a1[_0x589530(0x1e9)](_0x13b842,_0x589530(0x1bd)),'state':_0x4920a1[_0x589530(0x1e9)](_0x13b842,_0x589530(0x187))};await _0x59c06a(_0xbab257,{'id':_0x100918,'clock':_0x52106e});const _0xbf6d05=JSON[_0x589530(0x18c)]({'pid':process[_0x589530(0x1c1)],'host':_0x245f8d[_0x589530(0x20b)](),'at':_0x4a1110()}),_0x34660f=_0x4a1110();let _0x7baf93=null;const _0x5117ce=()=>{const _0x3b8b19=_0x589530;try{const _0x107fae=JSON[_0x3b8b19(0x1ad)](_0x1ed5eb[_0x3b8b19(0x1aa)](this['lockPath'],'utf8'));if(_0x107fae['at']&&_0x4a1110()-_0x107fae['at']>staleLockMaxAgeMs){const _0x1fbf96=_0x4a1110()-_0x107fae['at'],_0x4f620e='Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20'+Math[_0x3b8b19(0x158)](_0x1fbf96/0x3e8)+_0x3b8b19(0x1b7)+_0x107fae[_0x3b8b19(0x1c1)]+_0x3b8b19(0x194)+_0x107fae['host']+_0x3b8b19(0x185)+_0x3b8b19(0x207);this[_0x3b8b19(0x18e)]?.[_0x3b8b19(0x1f7)]?this['log'][_0x3b8b19(0x1f7)](_0x4f620e):console[_0x3b8b19(0x1f7)](_0x3b8b19(0x1f1),_0x4f620e);try{_0x1ed5eb['unlinkSync'](this['lockPath']);}catch{}return!![];}}catch{try{_0x1ed5eb[_0x3b8b19(0x1e4)](this[_0x3b8b19(0x191)]);}catch{}}return![];},_0x6cc1ae=()=>{const _0x5b8656=_0x589530;try{return _0x7baf93=_0x1ed5eb['openSync'](this[_0x5b8656(0x191)],'wx'),_0x1ed5eb['writeFileSync'](_0x7baf93,_0xbf6d05),!![];}catch(_0x3d3c6c){if(_0x3d3c6c&&_0x3d3c6c[_0x5b8656(0x1ba)]===_0x5b8656(0x21f))return![];throw _0x3d3c6c;}};if(!_0x6cc1ae()){_0x5117ce(),_0x6cc1ae();if(_0x7baf93==null&&lockTimeoutMs>0x0)while(_0x4a1110()-_0x34660f<lockTimeoutMs){await new Promise(_0x1c4cd4=>setTimeout(_0x1c4cd4,0x19));if(_0x6cc1ae())break;_0x5117ce();}}if(_0x7baf93==null){try{_0x1ed5eb['rmSync'](_0x13b842,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':'lock_busy'};}try{const _0x1f3c35=this['readCurrentClock']();if(_0x52106e<=_0x1f3c35){try{_0x1ed5eb[_0x589530(0x198)](_0x13b842,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x589530(0x1df),'currentClock':_0x1f3c35};}if(!_0x258fc3(_0x1da536))_0x1ed5eb[_0x589530(0x1d1)](_0x13b842,_0x1da536);else try{_0x1ed5eb['rmSync'](_0x13b842,{'recursive':!![],'force':!![]});}catch{}return _0x1ceb6a(this[_0x589530(0x1a3)],_0x100918+'\x0a'),this[_0x589530(0x1d4)]({'keep':keep}),{'published':!![],'currentClock':_0x52106e};}finally{try{_0x1ed5eb[_0x589530(0x1d6)](_0x7baf93);}catch{}try{_0x1ed5eb['unlinkSync'](this[_0x589530(0x191)]);}catch{}}}},snapshotStore;}function _0x45b2(){const _0x3da40b=['mtimeMs','tombstone','isArray','name','reader','loadFrom','efConstruction','publishSnapshot','unreadable','Original\x20error:\x20','vectors','renameSync','MetricKind','imul','prune','get','closeSync','path','growFactor','efSearch','remove','call','toString','40905KgdwRb','index','stale','_tmp-','snapshotEveryChanges','metric','changed','unlinkSync','addPoint','writeFileSync','utf8','132YNefxC','join','usearch\x20algorithm\x20requires\x20dims\x20>\x200','vector','119108rudVqS','token','prototype','3159909WNaaMm','9421225NWXjSf','[SnapshotStore]','4660012eRqCKP','max','buffer','keepSnapshots','queryVec','warn','manifestVersion','fingerprintOf','reset','CURRENT','writer','filter','acquire','usearch','getMaxElements','finally','byteOffset','mkdirSync','exports','99DraHah','version','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','F32','cleanupTmpDirs','key','hostname','labelForEphemeral','stop','994EGuEXQ','snapshotMaxLagMs','release','keys','_snapshotPaths','203TvBJbY','maxElements','initIndex','hex','readCurrentClock','tmpMaxAgeMs','.tmp','listSnapshotIds','clock','statSync','delete','labelToKey','EEXIST','length','published','arch','WRITER.LOCK','score','hasFingerprints','__esModule','expansionSearch','ceil','expansionAdd','readdirSync','catch','getCurrentCount','snapshotTo','message','USEARCH_BINDINGS_UNAVAILABLE','added','platform','hnsw','viewRefreshMs','sqrt','round','keyToLabel','heartbeatIntervalMs','latestSnapshotId','_tombstoneCount','trunc','24exclUt','setEf','cause','info','setFingerprint','labels','size','snapshotsDir','slice','resolve','readCurrentId','algorithm','rebuild','load','isFree','SNAPSHOT.LOCK','isInteger','node','keyForLabel','dir','.tmp-','save','tombstoneCount','dims','fid','count','HierarchicalNSW','nextLabel','snapshot\x20id\x20required','set','loadSnapshot','readIndexSync','index.hnsw','HNSW_BINDINGS_UNAVAILABLE','flat','cosine','9138050dSAoTg','existsSync','crypto',').\x20','error','state.json','state','startsWith','\x20on\x20','entries','stringify','Unknown\x20algorithm:\x20\x22','log','min','Index','lockPath','distances','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20',',\x20host:\x20','fetchAllResult','searchKnn','sort','rmSync','removed','connectivity','Cos','postMessage','snapshot','push','L2sq','isFinite','now','clear','currentPath','unref','versions','Unknown\x20op:\x20\x22','from','keyToFp','hasRows','readFileSync','isDirectory','ENOENT','parse','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','has','_snapshotDir','opts','sync','view','repeat','then','labelForExisting','s,\x20pid:\x20','randomBytes','writerLockMaxAgeMs','code','openSync','search','labels.json','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','ScalarKind','pid','ready','markDelete','add','map'];_0x45b2=function(){return _0x3da40b;};return _0x45b2();}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x17acc9=_0x32915a;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x360809=require$$0;class _0x2fb9fb{constructor(){const _0x5c28fc=_0x2ae3;this[_0x5c28fc(0x159)]=new Map(),this[_0x5c28fc(0x21e)]=new Map(),this['nextLabel']=0x0,this[_0x5c28fc(0x15c)]=0x0,this['keyToFp']=new Map(),this[_0x5c28fc(0x225)]=!![];}async['reset'](){const _0x44dc5d=_0x2ae3;this['keyToLabel']=new Map(),this['labelToKey']=new Map(),this['keyToFp']=new Map(),this[_0x44dc5d(0x225)]=!![],this[_0x44dc5d(0x179)]=0x0,this['_tombstoneCount']=0x0;}async[_0x17acc9(0x1cb)](_0x50249b){const _0x11da58=_0x17acc9;if(!_0x50249b||!_0x360809[_0x11da58(0x183)](_0x50249b))return await this['reset'](),!![];let _0x1b4c7b;try{_0x1b4c7b=_0x360809[_0x11da58(0x1aa)](_0x50249b,_0x11da58(0x1e7));}catch{return await this['reset'](),!![];}let _0x11c2ab;try{_0x11c2ab=JSON[_0x11da58(0x1ad)](_0x1b4c7b);}catch{return await this[_0x11da58(0x1fa)](),!![];}const _0x5d33b2=Array['isArray'](_0x11c2ab?.[_0x11da58(0x18b)])?_0x11c2ab['entries']:[],_0x3c6c0c=Number[_0x11da58(0x16e)](_0x11c2ab?.['nextLabel'])?_0x11c2ab[_0x11da58(0x179)]:0x0,_0x26b5cc=new Map(),_0x101884=new Map(),_0xc2d1ee=new Map(),_0x5acf4d=_0x11c2ab?.[_0x11da58(0x206)]>=0x2;let _0x27ef7e=-0x1;for(const _0x225090 of _0x5d33b2){if(!Array[_0x11da58(0x1c8)](_0x225090)||_0x225090['length']<0x2)continue;const _0x5f4124=Number(_0x225090[0x0]),_0x4714bb=String(_0x225090[0x1]??'');if(!Number[_0x11da58(0x16e)](_0x5f4124)||_0x5f4124<0x0)continue;if(!_0x4714bb)continue;_0x26b5cc[_0x11da58(0x17b)](_0x4714bb,_0x5f4124),_0x101884[_0x11da58(0x17b)](_0x5f4124,_0x4714bb);if(_0x5acf4d&&typeof _0x225090[0x2]==='number')_0xc2d1ee[_0x11da58(0x17b)](_0x4714bb,_0x225090[0x2]);if(_0x5f4124>_0x27ef7e)_0x27ef7e=_0x5f4124;}return this['keyToLabel']=_0x26b5cc,this['labelToKey']=_0x101884,this['keyToFp']=_0xc2d1ee,this[_0x11da58(0x225)]=_0x5acf4d,this[_0x11da58(0x179)]=Math[_0x11da58(0x1f3)](_0x3c6c0c,_0x27ef7e+0x1,0x0),this[_0x11da58(0x15c)]=0x0,!![];}[_0x17acc9(0x1b6)](_0x598f68){const _0x16021a=_0x17acc9;return this[_0x16021a(0x159)]['get'](_0x598f68);}['labelForEphemeral'](_0x8e8e81){const _0x24168b=_0x17acc9;let _0x3965cb=this[_0x24168b(0x159)]['get'](_0x8e8e81);if(_0x3965cb!==undefined)return _0x3965cb;return _0x3965cb=this['nextLabel']++,this[_0x24168b(0x159)][_0x24168b(0x17b)](_0x8e8e81,_0x3965cb),this[_0x24168b(0x21e)][_0x24168b(0x17b)](_0x3965cb,_0x8e8e81),_0x3965cb;}[_0x17acc9(0x162)](_0x354d3f,_0x7e954c){const _0x174b88=_0x17acc9;if(_0x7e954c==null)this[_0x174b88(0x1a8)][_0x174b88(0x21d)](_0x354d3f);else this[_0x174b88(0x1a8)]['set'](_0x354d3f,_0x7e954c);}[_0x17acc9(0x1f9)](_0x273804){const _0x59794a=_0x17acc9;return this['keyToFp'][_0x59794a(0x1d5)](_0x273804);}[_0x17acc9(0x211)](){const _0x3bdc3a=_0x17acc9;return this[_0x3bdc3a(0x159)][_0x3bdc3a(0x211)]();}[_0x17acc9(0x1c7)](_0x495b72){const _0x1a554d=_0x17acc9,_0x5b9dc7=this[_0x1a554d(0x159)][_0x1a554d(0x1d5)](_0x495b72);if(_0x5b9dc7===undefined)return;this[_0x1a554d(0x1a8)]['delete'](_0x495b72),this[_0x1a554d(0x159)][_0x1a554d(0x21d)](_0x495b72),this['labelToKey']['delete'](_0x5b9dc7),this['_tombstoneCount']++;}['keyForLabel'](_0x42de17){const _0x187518=_0x17acc9;return this['labelToKey'][_0x187518(0x1d5)](_0x42de17)??null;}[_0x17acc9(0x164)](){const _0x11a848=_0x17acc9;return this['keyToLabel'][_0x11a848(0x164)];}[_0x17acc9(0x174)](){const _0x1da980=_0x17acc9;return this[_0x1da980(0x15c)];}async[_0x17acc9(0x150)](_0x2a4d5e){const _0xde470d=_0x17acc9,_0x4da0a0=_0x2a4d5e+_0xde470d(0x219),_0x44e6f2=[];for(const [_0x32e9f7,_0x318bba]of this[_0xde470d(0x21e)]['entries']()){const _0x2c5ea9=this['keyToFp'][_0xde470d(0x1d5)](_0x318bba);_0x44e6f2['push'](_0x2c5ea9==null?[_0x32e9f7,_0x318bba]:[_0x32e9f7,_0x318bba,_0x2c5ea9]);}_0x44e6f2[_0xde470d(0x197)]((_0x5a450b,_0x2e6e7c)=>_0x5a450b[0x0]-_0x2e6e7c[0x0]);const _0x1ca6ee={'version':0x2,'nextLabel':this[_0xde470d(0x179)],'entries':_0x44e6f2};_0x360809['writeFileSync'](_0x4da0a0,JSON['stringify'](_0x1ca6ee)),_0x360809['renameSync'](_0x4da0a0,_0x2a4d5e);}}return labelMap=_0x2fb9fb,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x5a804f(_0x4d1333){const _0x41408c=_0x2ae3,_0x4416cc=new Uint32Array(_0x4d1333[_0x41408c(0x1f4)],_0x4d1333[_0x41408c(0x202)],_0x4d1333[_0x41408c(0x220)]);let _0x3dd85e=0x811c9dc5,_0x2e6cc0=0x9747b28c;for(let _0x1d24f3=0x0;_0x1d24f3<_0x4416cc[_0x41408c(0x220)];_0x1d24f3++){const _0x237df1=_0x4416cc[_0x1d24f3];_0x3dd85e=Math['imul'](_0x3dd85e^_0x237df1,0x1000193)>>>0x0;let _0x7b0e2f=Math[_0x41408c(0x1d3)](_0x237df1,0xcc9e2d51);_0x7b0e2f=_0x7b0e2f<<0xf|_0x7b0e2f>>>0x11,_0x2e6cc0=Math[_0x41408c(0x1d3)](_0x2e6cc0^Math[_0x41408c(0x1d3)](_0x7b0e2f,0x1b873593),0x5)+0xe6546b64,_0x2e6cc0>>>=0x0;}return _0x2e6cc0=Math[_0x41408c(0x1d3)](_0x2e6cc0^_0x2e6cc0>>>0x10,0x85ebca6b)>>>0x0,(_0x3dd85e>>>0x0)*0x100000+(_0x2e6cc0&0xfffff);}function _0x337c54(_0x5aac3b,_0x54c115,_0x4a0401,{upsert:_0x3bc055,remove:_0x10b731}){const _0x3c858e=_0x2ae3,_0x6491f3=new Set();let _0x1d78fd=0x0,_0x41b551=0x0,_0x590fa7=0x0;for(const {key:_0x5d4e39,vector:_0x1ccb57}of _0x54c115){if(!(_0x1ccb57 instanceof Float32Array)||_0x1ccb57[_0x3c858e(0x220)]!==_0x4a0401)continue;_0x6491f3['add'](_0x5d4e39);const _0xd574a0=_0x5a804f(_0x1ccb57),_0x6fac46=_0x5aac3b[_0x3c858e(0x1b6)](_0x5d4e39)!==undefined;if(_0x6fac46&&_0x5aac3b['fingerprintOf'](_0x5d4e39)===_0xd574a0)continue;_0x3bc055(_0x5d4e39,_0x1ccb57,_0xd574a0);if(_0x6fac46)_0x41b551++;else _0x1d78fd++;}for(const _0x225e10 of[..._0x5aac3b[_0x3c858e(0x211)]()]){if(_0x6491f3[_0x3c858e(0x1af)](_0x225e10))continue;_0x10b731(_0x225e10),_0x590fa7++;}return{'added':_0x1d78fd,'changed':_0x41b551,'removed':_0x590fa7};}return indexConvergence={'fingerprint':_0x5a804f,'reconcileIndex':_0x337c54},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x53101e=requireSnapshotStore(),_0x279357=requireLabelMap(),{fingerprint:_0x27d122,reconcileIndex:_0x5df7d9}=requireIndexConvergence(),_0x5e55ff=0x1;let _0x1dc935=null;function _0x4ffab2(){const _0x4fc9f4=_0x2ae3;if(_0x1dc935)return _0x1dc935;try{return _0x1dc935=require('hnswlib-node'),_0x1dc935;}catch(_0x15fc06){const _0x944bcb=new Error(_0x4fc9f4(0x193)+('for\x20Node\x20'+process['versions'][_0x4fc9f4(0x16f)]+'\x20on\x20'+process[_0x4fc9f4(0x154)]+'/'+process['arch']+'.\x20')+_0x4fc9f4(0x1be)+(_0x4fc9f4(0x1cf)+(_0x15fc06?.[_0x4fc9f4(0x151)]||String(_0x15fc06))));_0x944bcb[_0x4fc9f4(0x1ba)]=_0x4fc9f4(0x17f),_0x944bcb[_0x4fc9f4(0x160)]=_0x15fc06;throw _0x944bcb;}}return hnsw=function _0x2ec8e6(_0x125cb8={},{dims:_0x426e9c,dir:_0x1756b2}){const _0x3c51e6=_0x2ae3,_0x178c4d=_0x4ffab2();if(!_0x426e9c||_0x426e9c<=0x0)throw new Error('hnsw\x20algorithm\x20requires\x20dims\x20>\x200');if(!_0x1756b2)throw new Error(_0x3c51e6(0x1bf));const _0x8200e5={'metric':_0x125cb8[_0x3c51e6(0x1e2)]??_0x3c51e6(0x181),'M':_0x125cb8['M']??0x10,'efConstruction':_0x125cb8[_0x3c51e6(0x1cc)]??0xc8,'efSearch':_0x125cb8[_0x3c51e6(0x1d9)]??0x40,'maxElements':_0x125cb8[_0x3c51e6(0x214)]??0x400,'growFactor':_0x125cb8[_0x3c51e6(0x1d8)]??0x2,'snapshotEveryChanges':_0x125cb8['snapshotEveryChanges']??0xc350,'keepSnapshots':_0x125cb8['keepSnapshots']??0x2,'tmpMaxAgeMs':_0x125cb8[_0x3c51e6(0x218)]??0x6*0x36ee80},_0x2231b5=new _0x53101e({'dir':_0x1756b2,'keepSnapshots':_0x8200e5[_0x3c51e6(0x1f5)]}),_0x4c605f=new _0x279357();let _0x1f3350=null,_0x1efaaa=0x0,_0x5d6ce4=null,_0x4908a1=Promise[_0x3c51e6(0x167)]();const _0x3e9f4f=_0x53514e=>{const _0x56fe34=_0x3c51e6,_0x2c20f9=_0x4908a1[_0x56fe34(0x1b5)](_0x53514e);return _0x4908a1=_0x2c20f9[_0x56fe34(0x14e)](()=>{}),_0x2c20f9;};async function _0x494d2d(_0x229e1c){const _0x15d26d=_0x3c51e6;await _0x4c605f['reset'](),_0x229e1c=_0x229e1c??[];const _0xd56b3=Math['max'](_0x8200e5['maxElements'],Math[_0x15d26d(0x14b)](_0x229e1c[_0x15d26d(0x220)]*(_0x8200e5[_0x15d26d(0x1d8)]||1.2)),0x1);_0x1f3350=new _0x178c4d[(_0x15d26d(0x178))](_0x8200e5[_0x15d26d(0x1e2)],_0x426e9c),_0x1f3350[_0x15d26d(0x215)]({'maxElements':_0xd56b3,'efConstruction':_0x8200e5[_0x15d26d(0x1cc)],'M':_0x8200e5['M']});for(const {key:_0x288827,vector:_0x1006ff}of _0x229e1c){if(!(_0x1006ff instanceof Float32Array)||_0x1006ff[_0x15d26d(0x220)]!==_0x426e9c)continue;_0x38664a(_0x288827,_0x1006ff);}_0x1f3350[_0x15d26d(0x15f)](_0x8200e5[_0x15d26d(0x1d9)]),_0x1efaaa=0x0;}async function _0x2427ce(_0x1a3ebd){return _0x494d2d(_0x1a3ebd?await _0x1a3ebd():[]);}function _0x902404(){const _0x622bd2=_0x3c51e6;if(_0x1f3350['getCurrentCount']()<_0x1f3350['getMaxElements']())return;const _0x9e64c=Math['ceil'](_0x1f3350[_0x622bd2(0x200)]()*(_0x8200e5[_0x622bd2(0x1d8)]||0x2));_0x1f3350['resizeIndex'](_0x9e64c),_0x8200e5[_0x622bd2(0x214)]=_0x9e64c;}function _0x38664a(_0x383195,_0x580eed,_0x13dd4c){const _0x22dedd=_0x3c51e6,_0x5c89c1=_0x4c605f[_0x22dedd(0x20c)](_0x383195);try{_0x1f3350[_0x22dedd(0x1c3)](_0x5c89c1);}catch{}_0x902404(),_0x1f3350[_0x22dedd(0x1e5)](Array[_0x22dedd(0x1a7)](_0x580eed),_0x5c89c1),_0x4c605f['setFingerprint'](_0x383195,_0x13dd4c??_0x27d122(_0x580eed));}function _0x78e5f8(_0x4c916d){const _0x22d756=_0x3c51e6,_0x2c9185=_0x4c605f[_0x22d756(0x1b6)](_0x4c916d);if(_0x2c9185===undefined)return![];try{_0x1f3350[_0x22d756(0x1c3)](_0x2c9185);}catch{}return _0x4c605f[_0x22d756(0x1c7)](_0x4c916d),!![];}function _0x47d220(){const _0x2ce7db=_0x3c51e6;return Math[_0x2ce7db(0x1f3)](Date[_0x2ce7db(0x1a1)](),_0x2231b5['readCurrentClock']()+0x1);}async function _0x41d1ec(_0x1a75fb){const _0x5bf9a4=_0x3c51e6;if(!_0x1f3350||!_0x1a75fb)return![];const _0x37a5c5=await _0x2231b5[_0x5bf9a4(0x1cd)](_0x1a75fb,async _0x3f4c6b=>{const _0x1f5e8e=_0x5bf9a4;_0x1f3350['writeIndexSync'](_0x3f4c6b[_0x1f5e8e(0x1de)]),await _0x4c605f[_0x1f5e8e(0x150)](_0x3f4c6b['labels']);const _0x1444e7=require$$0;_0x1444e7[_0x1f5e8e(0x1e6)](_0x3f4c6b[_0x1f5e8e(0x188)],JSON['stringify']({'manifestVersion':_0x5e55ff,'dims':_0x426e9c,'metric':_0x8200e5[_0x1f5e8e(0x1e2)],'clock':_0x1a75fb,'snapshotAt':Date[_0x1f5e8e(0x1a1)]()},null,0x2));},{'keep':_0x8200e5[_0x5bf9a4(0x1f5)]});if(_0x37a5c5?.[_0x5bf9a4(0x221)])_0x1efaaa=0x0;return _0x37a5c5?.[_0x5bf9a4(0x221)]??![];}async function _0x35c75d(){const _0x4043e7=_0x3c51e6,_0x3eeb7=_0x2231b5[_0x4043e7(0x168)]()||_0x2231b5[_0x4043e7(0x15b)]();if(!_0x3eeb7)return null;let _0x548a18,_0x5487ab=![];return await _0x2231b5['loadSnapshot'](_0x3eeb7,async _0x5b510b=>{const _0x8663b4=_0x4043e7,_0x79508a=require$$0;_0x548a18=JSON[_0x8663b4(0x1ad)](_0x79508a[_0x8663b4(0x1aa)](_0x5b510b[_0x8663b4(0x188)],'utf8'));if(_0x548a18[_0x8663b4(0x1f8)]!==_0x5e55ff||_0x548a18['dims']!==_0x426e9c||_0x548a18[_0x8663b4(0x1e2)]!==_0x8200e5[_0x8663b4(0x1e2)]){_0x548a18=null;return;}await _0x4c605f['loadFrom'](_0x5b510b[_0x8663b4(0x163)]),_0x1f3350=new _0x178c4d[(_0x8663b4(0x178))](_0x8200e5['metric'],_0x426e9c),_0x1f3350[_0x8663b4(0x17d)](_0x5b510b[_0x8663b4(0x1de)]),_0x1f3350['setEf'](_0x8200e5[_0x8663b4(0x1d9)]),_0x5487ab=!![];}),_0x5487ab?_0x548a18?.[_0x4043e7(0x21b)]??0x0:null;}return{async 'load'(_0xfc1a92){return _0x3e9f4f(async()=>{const _0x4c7da7=_0x2ae3;_0x2231b5[_0x4c7da7(0x209)]({'maxAgeMs':_0x8200e5[_0x4c7da7(0x218)]}),_0x5d6ce4=_0xfc1a92??null;const _0x1a4887=await _0x35c75d(),_0x3c5eb1=_0xfc1a92?await _0xfc1a92():null;if(_0x1a4887!=null){if(_0x3c5eb1){if(!_0x4c605f[_0x4c7da7(0x225)])return await _0x494d2d(_0x3c5eb1),null;const _0x4202ad=_0x5df7d9(_0x4c605f,_0x3c5eb1,_0x426e9c,{'upsert':_0x38664a,'remove':_0x78e5f8});_0x1efaaa+=_0x4202ad['added']+_0x4202ad[_0x4c7da7(0x1e3)]+_0x4202ad[_0x4c7da7(0x199)];}return _0x1a4887;}return await _0x494d2d(_0x3c5eb1),null;});},async 'add'(_0x7dfe03,_0x2aaecb,_0x3b0aab){return _0x3e9f4f(async()=>{const _0x1c7b8c=_0x2ae3;if(!_0x1f3350)return;const _0x7e0b6b=_0x2aaecb instanceof Float32Array?_0x2aaecb:new Float32Array(_0x2aaecb),_0x47535e=_0x27d122(_0x7e0b6b);if(_0x4c605f[_0x1c7b8c(0x1f9)](_0x7dfe03)===_0x47535e)return;_0x38664a(_0x7dfe03,_0x7e0b6b,_0x47535e),_0x1efaaa++,_0x1efaaa>=_0x8200e5['snapshotEveryChanges']&&await _0x41d1ec(_0x47d220());});},async 'remove'(_0x2f7eba){return _0x3e9f4f(async()=>{if(!_0x1f3350)return;if(_0x78e5f8(_0x2f7eba))_0x1efaaa++;});},'search'(_0x537d8e,{limit:limit=0xa,efSearch:_0x4e8e6b}={}){const _0xfc0c53=_0x3c51e6;if(!_0x1f3350)return[];if(Number[_0xfc0c53(0x16e)](_0x4e8e6b))_0x1f3350[_0xfc0c53(0x15f)](_0x4e8e6b);const _0x14ea70=Math[_0xfc0c53(0x18f)](limit,_0x1f3350[_0xfc0c53(0x14f)]()||0x1),{neighbors:_0x5c66c2,distances:_0x4bfe06}=_0x1f3350[_0xfc0c53(0x196)](Array[_0xfc0c53(0x1a7)](_0x537d8e),_0x14ea70),_0x3c9568=[];for(let _0x260286=0x0;_0x260286<_0x5c66c2[_0xfc0c53(0x220)];_0x260286++){const _0x572dab=_0x4c605f[_0xfc0c53(0x170)](_0x5c66c2[_0x260286]);if(!_0x572dab)continue;const _0x53ae12=_0x8200e5['metric']==='cosine'?Math[_0xfc0c53(0x1f3)](0x0,0x1-_0x4bfe06[_0x260286]):0x1/(0x1+_0x4bfe06[_0x260286]);_0x3c9568[_0xfc0c53(0x19e)]({'key':_0x572dab,'score':_0x53ae12});}return _0x3c9568;},async 'snapshot'(_0x336c5d){return _0x3e9f4f(()=>_0x41d1ec(_0x336c5d??_0x47d220()));},async 'rebuild'(_0x544a45){return _0x3e9f4f(()=>{if(_0x544a45!=null)_0x5d6ce4=_0x544a45;return _0x2427ce(_0x544a45??_0x5d6ce4);});},async 'stop'(){return _0x3e9f4f(()=>_0x1efaaa>0x0||!_0x2231b5['readCurrentId']()?_0x41d1ec(_0x47d220()):![]);},'count'(){const _0x22388f=_0x3c51e6;return _0x4c605f[_0x22388f(0x164)]();},'info'(){const _0x1de7b4=_0x3c51e6;return{'algorithm':_0x1de7b4(0x155),'metric':_0x8200e5[_0x1de7b4(0x1e2)],'M':_0x8200e5['M'],'efConstruction':_0x8200e5[_0x1de7b4(0x1cc)],'efSearch':_0x8200e5['efSearch'],'maxElements':_0x1f3350?.[_0x1de7b4(0x200)]()??_0x8200e5[_0x1de7b4(0x214)],'count':_0x4c605f[_0x1de7b4(0x164)](),'changesSince':_0x1efaaa,'snapshotDir':_0x1756b2,'latestSnapshot':_0x2231b5[_0x1de7b4(0x168)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function _0x2ae3(_0x20a140,_0x36cdf4){_0x20a140=_0x20a140-0x14b;const _0x45b2bb=_0x45b2();let _0x2ae303=_0x45b2bb[_0x20a140];return _0x2ae303;}function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x23b635(_0x46f692={}){const _0x1c85d6=new Map();return{async 'load'(_0xbc5441){const _0x4f6f2e=_0x2ae3;_0x1c85d6[_0x4f6f2e(0x1a2)]();if(_0xbc5441)for(const {key:_0x9c0e61,vector:_0x44e736}of await _0xbc5441()){_0x1c85d6['set'](_0x9c0e61,_0x44e736);}},async 'add'(_0x5cdfdc,_0x4248f0,_0x3b90ce){_0x1c85d6['set'](_0x5cdfdc,_0x4248f0);},async 'remove'(_0x3cbbfa){const _0x5a5d0f=_0x2ae3;_0x1c85d6[_0x5a5d0f(0x21d)](_0x3cbbfa);},'search'(_0x310c00,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x333a7e=_0x2ae3,_0x1550c2=[];for(const [_0x3e83a1,_0xa0b248]of _0x1c85d6){const _0xfae984=_0x19c989(_0x310c00,_0xa0b248);if(_0xfae984>=threshold)_0x1550c2[_0x333a7e(0x19e)]({'key':_0x3e83a1,'score':_0xfae984});}return _0x1550c2[_0x333a7e(0x197)]((_0x7a0ca1,_0x443dbc)=>_0x443dbc['score']-_0x7a0ca1[_0x333a7e(0x224)]),_0x1550c2[_0x333a7e(0x166)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0xeb912b){const _0x5c4c4b=_0x2ae3;await this[_0x5c4c4b(0x16b)](_0xeb912b);},async 'stop'(){},'count'(){return _0x1c85d6['size'];},'info'(){const _0x545930=_0x2ae3;return{'algorithm':_0x545930(0x180),'count':_0x1c85d6[_0x545930(0x164)]};}};};function _0x19c989(_0x5abefc,_0x7160bc){const _0x53305f=_0x2ae3;let _0x46b7bb=0x0,_0x586a7d=0x0,_0x258e0b=0x0;for(let _0x47661f=0x0;_0x47661f<_0x5abefc[_0x53305f(0x220)];_0x47661f++){_0x46b7bb+=_0x5abefc[_0x47661f]*_0x7160bc[_0x47661f],_0x586a7d+=_0x5abefc[_0x47661f]*_0x5abefc[_0x47661f],_0x258e0b+=_0x7160bc[_0x47661f]*_0x7160bc[_0x47661f];}const _0x10699e=Math[_0x53305f(0x157)](_0x586a7d)*Math[_0x53305f(0x157)](_0x258e0b);return _0x10699e===0x0?0x0:_0x46b7bb/_0x10699e;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x116da4=require$$0,_0x364306=require$$1,_0x3a86ca=require$$3;return writerLock=function _0x29b072(_0xf21bfb,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x4700c0=_0x2ae3,_0x59bebb=_0x364306['join'](_0xf21bfb,_0x4700c0(0x223)),_0x9f1274=_0x3a86ca[_0x4700c0(0x1b8)](0x8)['toString'](_0x4700c0(0x216));let _0x49550f=![],_0x2f4384=null;const _0x32d6ef=()=>JSON[_0x4700c0(0x18c)]({'pid':process[_0x4700c0(0x1c1)],'token':_0x9f1274,'at':Date[_0x4700c0(0x1a1)]()});function _0x1f671a(){const _0x2729a1=_0x4700c0;try{return JSON[_0x2729a1(0x1ad)](_0x116da4[_0x2729a1(0x1aa)](_0x59bebb,'utf8'));}catch(_0x1e4aa3){return _0x1e4aa3?.[_0x2729a1(0x1ba)]===_0x2729a1(0x1ac)?null:{'unreadable':!![]};}}function _0x955afd(){const _0x383ff4=_0x4700c0;try{const _0x15f9e0=_0x116da4[_0x383ff4(0x1bb)](_0x59bebb,'wx');try{_0x116da4[_0x383ff4(0x1e6)](_0x15f9e0,_0x32d6ef());}finally{_0x116da4[_0x383ff4(0x1d6)](_0x15f9e0);}return!![];}catch(_0x58550a){if(_0x58550a?.[_0x383ff4(0x1ba)]===_0x383ff4(0x21f))return![];throw _0x58550a;}}function _0x25d031(_0x2d771f){const _0x56add3=_0x4700c0;if(!_0x2d771f)return!![];if(_0x2d771f[_0x56add3(0x1ce)])return!![];return Date[_0x56add3(0x1a1)]()-(_0x2d771f['at']??0x0)>=maxAgeMs;}function _0x3342f4(){if(_0x2f4384)clearInterval(_0x2f4384);_0x2f4384=null;}function _0x39e34f(){const _0x45a533=_0x4700c0;_0x3342f4(),_0x2f4384=setInterval(()=>{const _0x25230c=_0x2ae3,_0x5958e4=_0x1f671a();if(_0x5958e4&&!_0x5958e4[_0x25230c(0x1ce)]&&_0x5958e4[_0x25230c(0x1ed)]!==_0x9f1274){_0x49550f=![],_0x3342f4();try{onLost?.();}catch{}return;}try{_0x116da4[_0x25230c(0x1e6)](_0x59bebb,_0x32d6ef());}catch{}},heartbeatMs),_0x2f4384[_0x45a533(0x1a4)]?.();}function _0x167835(){const _0x365dc5=_0x4700c0,_0x4d363b=_0x1f671a();return!!_0x4d363b&&_0x4d363b[_0x365dc5(0x1ed)]===_0x9f1274;}return{'path':_0x59bebb,'token':_0x9f1274,'acquire'(){const _0x3c772e=_0x4700c0,_0x1214af=_0x1f671a();if(_0x1214af&&_0x1214af[_0x3c772e(0x1ed)]===_0x9f1274){_0x49550f=!![];if(!_0x2f4384)_0x39e34f();return!![];}let _0x34b409=_0x955afd();if(!_0x34b409&&_0x25d031(_0x1f671a())){try{_0x116da4[_0x3c772e(0x1e4)](_0x59bebb);}catch{}_0x34b409=_0x955afd();}if(_0x34b409&&!_0x167835())_0x34b409=![];_0x49550f=_0x34b409;if(_0x34b409)_0x39e34f();return _0x34b409;},'held'(){return _0x49550f;},'isFree'(){const _0x3a8795=_0x1f671a();if(_0x3a8795&&_0x3a8795['token']===_0x9f1274)return![];return _0x25d031(_0x3a8795);},'release'(){const _0x541f36=_0x4700c0;_0x3342f4();if(!_0x49550f)return;_0x49550f=![];if(_0x167835())try{_0x116da4[_0x541f36(0x1e4)](_0x59bebb);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x5a43de=require$$0,_0x2a16a7=requireSnapshotStore(),_0x523c2e=requireLabelMap(),_0x1c0792=requireWriterLock(),{fingerprint:_0x3ede1e,reconcileIndex:_0x191cf8}=requireIndexConvergence(),_0x559b58=0x1;let _0xfe5fb3=null;function _0x1cd05b(){const _0x3863c7=_0x2ae3;if(_0xfe5fb3)return _0xfe5fb3;try{return _0xfe5fb3=require(_0x3863c7(0x1ff)),_0xfe5fb3;}catch(_0x23cb08){const _0x5c92eb=new Error(_0x3863c7(0x1ae)+('for\x20Node\x20'+process[_0x3863c7(0x1a5)]['node']+_0x3863c7(0x18a)+process[_0x3863c7(0x154)]+'/'+process[_0x3863c7(0x222)]+'.\x20')+'Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20'+(_0x3863c7(0x1cf)+(_0x23cb08?.[_0x3863c7(0x151)]||String(_0x23cb08))));_0x5c92eb[_0x3863c7(0x1ba)]=_0x3863c7(0x152),_0x5c92eb['cause']=_0x23cb08;throw _0x5c92eb;}}function _0x13bb08(_0x28ede8,_0xaec556){const _0x3ca4b4=_0x2ae3;switch(_0x28ede8){case _0x3ca4b4(0x181):return _0xaec556[_0x3ca4b4(0x1d2)][_0x3ca4b4(0x19b)];case'l2':return _0xaec556[_0x3ca4b4(0x1d2)][_0x3ca4b4(0x19f)];case'ip':return _0xaec556[_0x3ca4b4(0x1d2)]['IP'];default:return _0xaec556[_0x3ca4b4(0x1d2)][_0x3ca4b4(0x19b)];}}return usearch=function _0x457858(_0x1116ff={},{dims:_0x2e7d8f,dir:_0xa7b5e7,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x1a2e9f=_0x2ae3,_0x4851ee=_0x1cd05b();if(!_0x2e7d8f||_0x2e7d8f<=0x0)throw new Error(_0x1a2e9f(0x1ea));if(!_0xa7b5e7)throw new Error('usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage');const _0x463dff={'metric':_0x1116ff[_0x1a2e9f(0x1e2)]??_0x1a2e9f(0x181),'connectivity':_0x1116ff[_0x1a2e9f(0x19a)]??0x10,'expansionAdd':_0x1116ff['expansionAdd']??0x80,'expansionSearch':_0x1116ff[_0x1a2e9f(0x227)]??0x40,'snapshotEveryChanges':_0x1116ff['snapshotEveryChanges']??0xc350,'snapshotMaxLagMs':_0x1116ff[_0x1a2e9f(0x20f)]??0x2710,'keepSnapshots':_0x1116ff[_0x1a2e9f(0x1f5)]??0x2,'tmpMaxAgeMs':_0x1116ff[_0x1a2e9f(0x218)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x1116ff['heartbeatIntervalMs']??0x1388,'writerLockMaxAgeMs':_0x1116ff[_0x1a2e9f(0x1b9)]??0x3a98,'viewRefreshMs':_0x1116ff[_0x1a2e9f(0x156)]??0x3e8},_0x57ab0b=new _0x2a16a7({'dir':_0xa7b5e7,'keepSnapshots':_0x463dff[_0x1a2e9f(0x1f5)]}),_0x5c3b98=_0x1c0792(_0xa7b5e7,{'maxAgeMs':_0x463dff[_0x1a2e9f(0x1b9)],'heartbeatMs':_0x463dff[_0x1a2e9f(0x15a)],'onLost':()=>{_0x547400(_0x10cf55)['catch'](()=>{});}});let _0x5f53c0=new _0x523c2e(),_0x386485=null,_0x1f36f3=0x0,_0x46522c=null,_0x759f25=![],_0x552ccc=![],_0x5d2ce8=null,_0x79d82f=0x0,_0x3575fc=null,_0x2902cf=0x0,_0x1286f5=![],_0x428ddf=Promise[_0x1a2e9f(0x167)]();const _0x547400=_0x49cc14=>{const _0x357178=_0x1a2e9f,_0x553ca=_0x428ddf[_0x357178(0x1b5)](_0x49cc14);return _0x428ddf=_0x553ca[_0x357178(0x14e)](()=>{}),_0x553ca;},_0x2f6144=()=>{try{onChange?.();}catch{}};function _0x259fd7(){const _0x546b78=_0x1a2e9f;return new _0x4851ee[(_0x546b78(0x190))]({'dimensions':_0x2e7d8f,'metric':_0x13bb08(_0x463dff[_0x546b78(0x1e2)],_0x4851ee),'quantization':_0x4851ee[_0x546b78(0x1c0)][_0x546b78(0x208)],'connectivity':_0x463dff[_0x546b78(0x19a)],'expansion_add':_0x463dff[_0x546b78(0x14c)],'expansion_search':_0x463dff['expansionSearch'],'multi':![]});}function _0x347006(_0x403957){return _0x403957 instanceof Float32Array?_0x403957:new Float32Array(_0x403957);}function _0x22e641(){const _0x1591eb=_0x1a2e9f;if(fetchAll)return fetchAll();if(_0x46522c)return _0x46522c();return Promise[_0x1591eb(0x167)](null);}function _0x2e200b(_0xa882d0,_0x49f550,_0x47ce42){const _0x4175d9=_0x1a2e9f,_0x379bf6=_0x5f53c0['labelForExisting'](_0xa882d0);if(_0x379bf6!==undefined)try{_0x386485[_0x4175d9(0x1da)](BigInt(_0x379bf6));}catch{}const _0x5e7ccd=_0x5f53c0[_0x4175d9(0x20c)](_0xa882d0);_0x386485[_0x4175d9(0x1c4)](BigInt(_0x5e7ccd),_0x49f550),_0x5f53c0[_0x4175d9(0x162)](_0xa882d0,_0x47ce42??_0x3ede1e(_0x49f550));}function _0x2607fe(_0x4c51e9){const _0x5a0cf5=_0x1a2e9f,_0x3bb70f=_0x5f53c0['labelForExisting'](_0x4c51e9);if(_0x3bb70f===undefined)return![];try{_0x386485[_0x5a0cf5(0x1da)](BigInt(_0x3bb70f));}catch{}return _0x5f53c0[_0x5a0cf5(0x1c7)](_0x4c51e9),!![];}function _0x14b688(_0x237bb2){_0x5f53c0=new _0x523c2e(),_0x386485=_0x259fd7();for(const {key:_0xb9ba2e,vector:_0x454c67}of _0x237bb2??[]){if(!(_0x454c67 instanceof Float32Array)||_0x454c67['length']!==_0x2e7d8f)continue;_0x2e200b(_0xb9ba2e,_0x454c67);}_0x1f36f3=0x0;}function _0xdb7604(){const _0x3fbae1=_0x1a2e9f;return Math[_0x3fbae1(0x1f3)](Date[_0x3fbae1(0x1a1)](),_0x57ab0b['readCurrentClock']()+0x1);}function _0x23b9f1(){if(_0x5d2ce8)clearTimeout(_0x5d2ce8);_0x5d2ce8=null;}function _0x56c481(){const _0x4f2a65=_0x1a2e9f;if(!_0x463dff[_0x4f2a65(0x20f)]||_0x5d2ce8||!_0x552ccc||_0x1f36f3<=0x0)return;const _0x572541=Math[_0x4f2a65(0x1f3)](_0x463dff[_0x4f2a65(0x20f)],0xa*_0x79d82f);_0x5d2ce8=setTimeout(()=>{const _0x1adc57=_0x4f2a65;_0x5d2ce8=null,_0x547400(async()=>{if(_0x552ccc&&_0x1f36f3>0x0)await _0x3725c7();_0x56c481(),_0x2f6144();})[_0x1adc57(0x14e)](()=>{});},_0x572541),_0x5d2ce8[_0x4f2a65(0x1a4)]?.();}async function _0x3725c7(_0xfc37a2){const _0x488233=_0x1a2e9f;if(!_0x386485)return![];const _0x30aeba=_0xfc37a2??_0xdb7604(),_0x2d93a5=Date['now'](),_0x546fbb=await _0x57ab0b[_0x488233(0x1cd)](_0x30aeba,async _0x1a7544=>{const _0x58288a=_0x488233;_0x386485[_0x58288a(0x173)](_0x1a7544[_0x58288a(0x1de)]),await _0x5f53c0['snapshotTo'](_0x1a7544[_0x58288a(0x163)]),_0x5a43de['writeFileSync'](_0x1a7544['state'],JSON[_0x58288a(0x18c)]({'manifestVersion':_0x559b58,'algorithm':_0x58288a(0x1ff),'dims':_0x2e7d8f,'metric':_0x463dff[_0x58288a(0x1e2)],'clock':_0x30aeba,'snapshotAt':Date['now']()},null,0x2));},{'keep':_0x463dff[_0x488233(0x1f5)]});return _0x79d82f=Date[_0x488233(0x1a1)]()-_0x2d93a5,_0x546fbb?.[_0x488233(0x221)]&&(_0x1f36f3=0x0,_0x23b9f1()),_0x546fbb?.[_0x488233(0x221)]??![];}function _0x1c8484(){const _0x57ce5d=_0x1a2e9f;_0x1f36f3++;if(_0x1f36f3>=_0x463dff[_0x57ce5d(0x1e1)])return _0x3725c7();return _0x56c481(),null;}async function _0x388689(){const _0x7a981d=_0x1a2e9f,_0xa9ff37=_0x57ab0b[_0x7a981d(0x168)]()||_0x57ab0b[_0x7a981d(0x15b)]();if(!_0xa9ff37)return null;let _0x1bc35b,_0x42bbf0=![];try{await _0x57ab0b[_0x7a981d(0x17c)](_0xa9ff37,async _0x6c0321=>{const _0xdcfd52=_0x7a981d;_0x1bc35b=JSON[_0xdcfd52(0x1ad)](_0x5a43de[_0xdcfd52(0x1aa)](_0x6c0321[_0xdcfd52(0x188)],_0xdcfd52(0x1e7)));if(_0x1bc35b['manifestVersion']!==_0x559b58||_0x1bc35b[_0xdcfd52(0x169)]!==_0xdcfd52(0x1ff)||_0x1bc35b[_0xdcfd52(0x175)]!==_0x2e7d8f||_0x1bc35b[_0xdcfd52(0x1e2)]!==_0x463dff['metric']){_0x1bc35b=null;return;}const _0x4c75de=new _0x523c2e();await _0x4c75de['loadFrom'](_0x6c0321[_0xdcfd52(0x163)]);const _0x56e2a6=_0x259fd7();_0x56e2a6['load'](_0x6c0321[_0xdcfd52(0x1de)]),_0x5f53c0=_0x4c75de,_0x386485=_0x56e2a6,_0x42bbf0=!![];});}catch{return null;}return _0x42bbf0?_0x1bc35b?.[_0x7a981d(0x21b)]??0x0:null;}async function _0x31f902(_0x395e79){const _0x38888b=_0x1a2e9f;_0x3575fc=null;const _0x2bad56=await _0x388689();if(_0x2bad56!=null){_0x1f36f3=0x0;if(_0x395e79){if(!_0x5f53c0['hasFingerprints'])return _0x14b688(_0x395e79),await _0x3725c7(),null;const _0x3257fc=_0x191cf8(_0x5f53c0,_0x395e79,_0x2e7d8f,{'upsert':_0x2e200b,'remove':_0x2607fe}),_0x88c38a=_0x3257fc[_0x38888b(0x153)]+_0x3257fc[_0x38888b(0x1e3)]+_0x3257fc[_0x38888b(0x199)];_0x88c38a>0x0&&(_0x1f36f3+=_0x88c38a,await _0x3725c7());}return _0x2bad56;}_0x14b688(_0x395e79??[]);if(_0x386485[_0x38888b(0x164)]()>0x0)await _0x3725c7();return null;}async function _0x3fa17b(){_0x552ccc=!![],await _0x31f902(await _0x22e641());}async function _0x10cf55(){const _0x2ba427=_0x1a2e9f;if(!_0x552ccc)return;_0x552ccc=![],_0x23b9f1(),_0x1f36f3=0x0;const _0x302639=_0x57ab0b[_0x2ba427(0x168)]()||_0x57ab0b['latestSnapshotId']();await _0x4deb4b(_0x302639),_0x2f6144();}async function _0x4deb4b(_0x100711){if(!_0x100711)return![];let _0x348ba7=![];try{await _0x57ab0b['loadSnapshot'](_0x100711,async _0x52d3c5=>{const _0x1a9f05=_0x2ae3,_0x2a72a4=JSON[_0x1a9f05(0x1ad)](_0x5a43de[_0x1a9f05(0x1aa)](_0x52d3c5['state'],_0x1a9f05(0x1e7)));if(_0x2a72a4[_0x1a9f05(0x1f8)]!==_0x559b58||_0x2a72a4[_0x1a9f05(0x169)]!==_0x1a9f05(0x1ff)||_0x2a72a4[_0x1a9f05(0x175)]!==_0x2e7d8f||_0x2a72a4['metric']!==_0x463dff[_0x1a9f05(0x1e2)])return;const _0x14afbb=new _0x523c2e();await _0x14afbb['loadFrom'](_0x52d3c5[_0x1a9f05(0x163)]);const _0x22d821=_0x259fd7();_0x22d821[_0x1a9f05(0x1b3)](_0x52d3c5[_0x1a9f05(0x1de)]),_0x386485=_0x22d821,_0x5f53c0=_0x14afbb,_0x3575fc=_0x100711,_0x348ba7=!![];});}catch{}return _0x348ba7;}function _0xf6a125(){const _0x31f720=_0x1a2e9f,_0x39cb76=Date[_0x31f720(0x1a1)]();if(_0x39cb76-_0x2902cf<_0x463dff[_0x31f720(0x156)])return;_0x2902cf=_0x39cb76;if(_0x1286f5)return;if(_0x5c3b98[_0x31f720(0x16c)]()){_0x1286f5=!![],_0x547400(async()=>{const _0x1586b5=_0x31f720;!_0x552ccc&&_0x759f25&&_0x5c3b98[_0x1586b5(0x1fe)]()&&(await _0x3fa17b(),_0x2f6144());})[_0x31f720(0x14e)](()=>{})['finally'](()=>{_0x1286f5=![];});return;}const _0x1c0409=_0x57ab0b[_0x31f720(0x168)]()||_0x57ab0b[_0x31f720(0x15b)]();if(!_0x1c0409||_0x1c0409===_0x3575fc)return;_0x1286f5=!![],_0x547400(async()=>{if(!_0x552ccc&&await _0x4deb4b(_0x1c0409))_0x2f6144();})[_0x31f720(0x14e)](()=>{})[_0x31f720(0x201)](()=>{_0x1286f5=![];});}return{async 'load'(_0x3317d1){return _0x547400(async()=>{const _0x5e060f=_0x2ae3;_0x57ab0b[_0x5e060f(0x209)]({'maxAgeMs':_0x463dff[_0x5e060f(0x218)]}),_0x46522c=_0x3317d1??null,_0x552ccc=_0x5c3b98[_0x5e060f(0x1fe)]();let _0x5d2601=null;if(_0x552ccc)_0x5d2601=await _0x31f902(_0x3317d1?await _0x3317d1():null);else{const _0x13d8fb=_0x57ab0b[_0x5e060f(0x168)]()||_0x57ab0b[_0x5e060f(0x15b)]();await _0x4deb4b(_0x13d8fb);}return _0x759f25=!![],_0x5d2601;});},async 'add'(_0x1a5f8c,_0x46a731,_0x27811f){return _0x547400(async()=>{const _0x556928=_0x2ae3;if(!_0x759f25)return;const _0x7ff633=_0x347006(_0x46a731);if(!_0x552ccc){if(!_0x5c3b98[_0x556928(0x1fe)]())return;await _0x3fa17b();}if(!_0x386485)return;const _0xc5cea3=_0x3ede1e(_0x7ff633);if(_0x5f53c0['fingerprintOf'](_0x1a5f8c)===_0xc5cea3)return;_0x2e200b(_0x1a5f8c,_0x7ff633,_0xc5cea3),await _0x1c8484();});},async 'remove'(_0x2a580c){return _0x547400(async()=>{if(!_0x759f25)return;if(!_0x552ccc){if(!_0x5c3b98['acquire']())return;await _0x3fa17b();}if(!_0x386485)return;if(_0x2607fe(_0x2a580c))await _0x1c8484();});},'search'(_0xe4cbf5,{limit:limit=0xa}={}){const _0xf7d16c=_0x1a2e9f;if(!_0x552ccc&&_0x759f25)_0xf6a125();if(!_0x386485)return[];const _0x56b693=_0x386485[_0xf7d16c(0x164)]();if(_0x56b693===0x0)return[];const _0x276d00=Math['min'](limit,_0x56b693),_0x51c4b9=_0x386485[_0xf7d16c(0x1bc)](_0x347006(_0xe4cbf5),_0x276d00,0x0),_0x38ec94=[],_0x58ebff=_0x51c4b9[_0xf7d16c(0x211)],_0x562ce0=_0x51c4b9[_0xf7d16c(0x192)];for(let _0x6f74d0=0x0;_0x6f74d0<_0x58ebff[_0xf7d16c(0x220)];_0x6f74d0++){const _0x4b6263=_0x58ebff[_0x6f74d0];if(_0x4b6263===0xffffffffffffffffn)continue;const _0xe48fde=Number(_0x4b6263),_0x15b1c1=_0x5f53c0[_0xf7d16c(0x170)](_0xe48fde);if(!_0x15b1c1)continue;const _0x27ac6f=_0x562ce0[_0x6f74d0];let _0x4c6c36;if(_0x463dff[_0xf7d16c(0x1e2)]===_0xf7d16c(0x181))_0x4c6c36=Math[_0xf7d16c(0x1f3)](0x0,0x1-_0x27ac6f);else{if(_0x463dff['metric']==='ip')_0x4c6c36=-_0x27ac6f;else _0x4c6c36=0x1/(0x1+_0x27ac6f);}_0x38ec94[_0xf7d16c(0x19e)]({'key':_0x15b1c1,'score':_0x4c6c36});}return _0x38ec94;},async 'snapshot'(_0x5dcd1e){return _0x547400(()=>_0x552ccc?_0x3725c7(_0x5dcd1e??undefined):![]);},async 'rebuild'(_0x87f41e){return _0x547400(async()=>{if(_0x87f41e!=null)_0x46522c=_0x87f41e;if(!_0x552ccc){if(!_0x5c3b98['acquire']())return;_0x552ccc=!![];}const _0x4baf96=_0x87f41e?await _0x87f41e():await _0x22e641();_0x14b688(_0x4baf96??[]),_0x759f25=!![],await _0x3725c7();});},async 'stop'(){return _0x547400(async()=>{const _0x27660a=_0x2ae3;_0x23b9f1();if(_0x552ccc){if(_0x1f36f3>0x0||!_0x57ab0b[_0x27660a(0x168)]())await _0x3725c7();_0x5c3b98[_0x27660a(0x210)]();}_0x552ccc=![],_0x759f25=![];});},'count'(){return _0x5f53c0['size']();},'info'(){const _0x20f966=_0x1a2e9f;return{'algorithm':'usearch','role':_0x552ccc?_0x20f966(0x1fc):_0x20f966(0x1ca),'metric':_0x463dff[_0x20f966(0x1e2)],'connectivity':_0x463dff[_0x20f966(0x19a)],'expansionAdd':_0x463dff[_0x20f966(0x14c)],'expansionSearch':_0x463dff[_0x20f966(0x227)],'snapshotEveryChanges':_0x463dff[_0x20f966(0x1e1)],'snapshotMaxLagMs':_0x463dff[_0x20f966(0x20f)],'count':_0x5f53c0['size'](),'size':_0x386485?.['size']?.()??0x0,'capacity':_0x386485?.['capacity']?.()??0x0,'changesSince':_0x552ccc?_0x1f36f3:null,'viewedSnapshot':_0x3575fc??null,'snapshotDir':_0xa7b5e7,'latestSnapshot':_0x57ab0b[_0x20f966(0x168)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x3254b8=_0x32915a;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x5a9f04,workerData:_0x5dd5c2}=require$$0$1,{algorithmName:_0x5b8e3b,algorithmConfig:_0x503a97,dims:_0x568561,dir:_0x31a30a}=_0x5dd5c2;let _0x3bbd46=0x1;const _0x12fde1=new Map();function _0x1407aa(){const _0x497fa3=_0x3bbd46++;return new Promise((_0x1b7008,_0x36a10c)=>{const _0x4a3053=_0x2ae3;_0x12fde1[_0x4a3053(0x17b)](_0x497fa3,{'resolve':_0x1b7008,'reject':_0x36a10c}),_0x5a9f04['postMessage']({'op':'fetchAll','fid':_0x497fa3});});}const _0x1fbf2c={'dims':_0x568561,'dir':_0x31a30a,'fetchAll':_0x1407aa,'onChange':()=>_0x192b04()};let _0x424660;if(_0x5b8e3b===_0x3254b8(0x155))_0x424660=requireHnsw()(_0x503a97,_0x1fbf2c);else{if(_0x5b8e3b==='flat')_0x424660=requireFlat()(_0x503a97,_0x1fbf2c);else{if(_0x5b8e3b===_0x3254b8(0x1ff))_0x424660=requireUsearch()(_0x503a97,_0x1fbf2c);else throw new Error(_0x3254b8(0x18d)+_0x5b8e3b+'\x22');}}function _0x192b04(){const _0x59ffd4=_0x3254b8;try{_0x5a9f04[_0x59ffd4(0x19c)]({'op':_0x59ffd4(0x1b2),'count':_0x424660[_0x59ffd4(0x177)](),'info':_0x424660[_0x59ffd4(0x161)](),'memory':process['memoryUsage']()});}catch{}}function _0x1a519e(_0x1a52d6){const _0x401a38=_0x3254b8;return(_0x1a52d6||[])[_0x401a38(0x1c5)](_0x2c1a64=>({'key':_0x2c1a64[_0x401a38(0x20a)],'vector':_0x2c1a64['vector']instanceof Float32Array?_0x2c1a64[_0x401a38(0x1eb)]:new Float32Array(_0x2c1a64[_0x401a38(0x1eb)])}));}return _0x5a9f04['on'](_0x3254b8(0x151),async _0x2e98ff=>{const _0x2c0033=_0x3254b8;if(_0x2e98ff['op']===_0x2c0033(0x195)){const _0x45a615=_0x12fde1[_0x2c0033(0x1d5)](_0x2e98ff[_0x2c0033(0x176)]);if(!_0x45a615)return;_0x12fde1['delete'](_0x2e98ff[_0x2c0033(0x176)]);if(_0x2e98ff[_0x2c0033(0x186)])_0x45a615['reject'](new Error(_0x2e98ff['error']));else _0x45a615[_0x2c0033(0x167)](_0x1a519e(_0x2e98ff[_0x2c0033(0x1d0)]));return;}const {id:_0x3c93a6,op:_0x3dab34,args:_0x34f973}=_0x2e98ff;try{let _0x185be2;switch(_0x3dab34){case _0x2c0033(0x16b):{_0x185be2=await _0x424660[_0x2c0033(0x16b)](_0x34f973[_0x2c0033(0x1a9)]?_0x1407aa:null),_0x192b04();break;}case _0x2c0033(0x1c4):{const _0x355003=_0x34f973[_0x2c0033(0x1eb)]instanceof Float32Array?_0x34f973[_0x2c0033(0x1eb)]:new Float32Array(_0x34f973[_0x2c0033(0x1eb)]);await _0x424660[_0x2c0033(0x1c4)](_0x34f973[_0x2c0033(0x20a)],_0x355003,_0x34f973[_0x2c0033(0x21b)]??undefined),_0x192b04(),_0x185be2=null;break;}case _0x2c0033(0x1da):{await _0x424660[_0x2c0033(0x1da)](_0x34f973[_0x2c0033(0x20a)]),_0x192b04(),_0x185be2=null;break;}case'search':{const _0x5d2adf=_0x34f973[_0x2c0033(0x1f6)]instanceof Float32Array?_0x34f973[_0x2c0033(0x1f6)]:new Float32Array(_0x34f973[_0x2c0033(0x1f6)]);_0x185be2=_0x424660[_0x2c0033(0x1bc)](_0x5d2adf,_0x34f973[_0x2c0033(0x1b1)]||{});break;}case _0x2c0033(0x19d):{_0x185be2=await _0x424660[_0x2c0033(0x19d)](_0x34f973['clock']),_0x192b04();break;}case _0x2c0033(0x16a):{const _0x2df0ff=_0x1a519e(_0x34f973[_0x2c0033(0x1d0)]);await _0x424660[_0x2c0033(0x16a)](async()=>_0x2df0ff),_0x192b04(),_0x185be2=null;break;}case _0x2c0033(0x20d):{await _0x424660[_0x2c0033(0x20d)](),_0x192b04(),_0x185be2=null;break;}case _0x2c0033(0x177):{_0x185be2=_0x424660[_0x2c0033(0x177)]();break;}case _0x2c0033(0x161):{_0x185be2=_0x424660[_0x2c0033(0x161)]();break;}default:throw new Error(_0x2c0033(0x1a6)+_0x3dab34+'\x22');}_0x5a9f04[_0x2c0033(0x19c)]({'id':_0x3c93a6,'result':_0x185be2});}catch(_0x5cf521){_0x5a9f04[_0x2c0033(0x19c)]({'id':_0x3c93a6,'error':{'message':_0x5cf521?.['message']||String(_0x5cf521),'code':_0x5cf521?.[_0x2c0033(0x1ba)]}});}}),_0x5a9f04[_0x3254b8(0x19c)]({'op':_0x3254b8(0x1c2)}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0x32915a(0x204)]=algorithmWorkerThread;
|
|
1
|
+
'use strict';const _0xa33854=_0x3d0f;(function(_0x282f84,_0x37ce99){const _0x70f41=_0x3d0f,_0x5c097f=_0x282f84();while(!![]){try{const _0x1b2c1c=parseInt(_0x70f41(0xae))/0x1+-parseInt(_0x70f41(0xa2))/0x2*(-parseInt(_0x70f41(0xf5))/0x3)+-parseInt(_0x70f41(0xfb))/0x4+-parseInt(_0x70f41(0x135))/0x5+parseInt(_0x70f41(0x10d))/0x6*(-parseInt(_0x70f41(0x13a))/0x7)+parseInt(_0x70f41(0xe6))/0x8*(-parseInt(_0x70f41(0xb2))/0x9)+-parseInt(_0x70f41(0xc9))/0xa*(-parseInt(_0x70f41(0x134))/0xb);if(_0x1b2c1c===_0x37ce99)break;else _0x5c097f['push'](_0x5c097f['shift']());}catch(_0x380310){_0x5c097f['push'](_0x5c097f['shift']());}}}(_0x29d7,0x4630b));var require$$0$1=require(_0xa33854(0x142)),require$$0=require('fs'),require$$1=require('path'),require$$2=require('os'),require$$3=require(_0xa33854(0x167));function getDefaultExportFromCjs(_0x34eded){const _0x781de6=_0xa33854;return _0x34eded&&_0x34eded['__esModule']&&Object['prototype'][_0x781de6(0x120)][_0x781de6(0x129)](_0x34eded,_0x781de6(0x138))?_0x34eded[_0x781de6(0x138)]:_0x34eded;}function _0x29d7(){const _0x25b20d=['heartbeatIntervalMs','metric','tombstoneCount','search','size','isDirectory','message','lock_busy','fetchAllResult','resizeIndex','max','clear','host','keyToLabel','then','efSearch','arch','698CplldV','_tmp-','map','.tmp-','add','mkdirSync','\x20on\x20','token','snapshotEveryChanges','_tombstoneCount','load','startsWith','72343DvtEOy','memoryUsage','currentPath','L2sq','9huSMke','release','loadSnapshot','candidateClock\x20must\x20be\x20finite\x20>=\x200','vector','published','searchKnn','stale','info','snapshotTo','has','manifestVersion','resolve','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','queryVec','viewRefreshMs','capacity','entries','hostname','version','length','error','SnapshotStore\x20requires\x20dir','74960pphhcM','isFinite','sync','prune','platform','imul','tombstone','snapshot\x20id\x20required','connectivity','repeat','hasFingerprints','reset','writer','lockPath','unref','now','usearch\x20algorithm\x20requires\x20dims\x20>\x200','cause','Cos','sort','key','node','rebuild','_snapshotDir','stop','join','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','randomBytes','labelForEphemeral','2998864WDqthW','labelToKey','snapshot\x20incomplete:\x20','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20','Unknown\x20algorithm:\x20\x22',',\x20host:\x20','removed','state.json','expansionSearch','round','save','sqrt','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','flat','pid','3684jtnAvT','vectors','set','snapshotMaxLagMs','readCurrentClock','exports','1403392OasTiA','warn','fetchAll','buffer','postMessage','writerLockMaxAgeMs','distances','code','toString','count','HNSW_BINDINGS_UNAVAILABLE','growFactor','nextLabel','ENOENT','usearch','get','HierarchicalNSW','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','6IHrLeV','labelForExisting','algorithm','changed','setEf','added','CURRENT','Original\x20error:\x20','hex',').\x20','hnsw','readFileSync','score','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','push','keyForLabel','existsSync','parse','renameSync','hasOwnProperty','efConstruction','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','MetricKind','isInteger','name','snapshotsDir','SNAPSHOT.LOCK','latestSnapshotId','call','readCurrentId','index.hnsw','initIndex','keyToFp','EEXIST','index','Index','remove','fingerprintOf','snapshots','1518IUbnrJ','980925mJftsk','publishSnapshot','USEARCH_BINDINGS_UNAVAILABLE','default','unlinkSync','2281811sDszne','versions','hnswlib-node','delete','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','getCurrentCount','keys','expansionAdd','worker_threads','log','[SnapshotStore]','trunc','writeFileSync','F32','tmpMaxAgeMs','filter','utf8','unreadable','openSync','for\x20Node\x20','dims','cosine','dir','hasRows','labels','labels.json','writeIndexSync','keepSnapshots','catch','finally','getMaxElements','state','setFingerprint','snapshot','fid','acquire','listSnapshotIds','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','loadFrom','ready','cleanupTmpDirs','ScalarKind','rmSync','closeSync','Unknown\x20op:\x20\x22','crypto','isArray','maxElements','byteOffset','markDelete','stringify','clock'];_0x29d7=function(){return _0x25b20d;};return _0x29d7();}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x3f1d44=_0xa33854;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x112520=require$$0,_0x541df2=require$$1,_0x25c4b3=require$$2,_0x425693=require$$3;function _0x4dab1e(){const _0x49e910=_0x3d0f;return Date[_0x49e910(0xd8)]();}function _0x3af5e5(_0x562f82){const _0xe462aa=_0x3d0f;try{return _0x112520[_0xe462aa(0x11d)](_0x562f82);}catch{return![];}}function _0x597b92(_0x266f9a){try{return _0x112520['readFileSync'](_0x266f9a,'utf8');}catch{return null;}}function _0x3ab688(_0x1b70a2,_0x250821){const _0x32e700=_0x3d0f,_0x34ee47=_0x1b70a2+'.tmp-'+_0x425693[_0x32e700(0xe4)](0x6)[_0x32e700(0x103)](_0x32e700(0x115));_0x112520[_0x32e700(0x146)](_0x34ee47,_0x250821),_0x112520['renameSync'](_0x34ee47,_0x1b70a2);}function _0x4c6be7(_0x554f3a,_0xbc01bf=0x10){const _0xe59913=_0x3d0f,_0x960c71=String(Math[_0xe59913(0x9b)](0x0,Math[_0xe59913(0x145)](_0x554f3a||0x0)));return _0x960c71[_0xe59913(0xc6)]>=_0xbc01bf?_0x960c71:'0'[_0xe59913(0xd2)](_0xbc01bf-_0x960c71[_0xe59913(0xc6)])+_0x960c71;}return snapshotStore=class _0x29ff03{constructor({dir:_0x4f86d5,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x13e121=_0x3d0f;if(!_0x4f86d5)throw new Error(_0x13e121(0xc8));this[_0x13e121(0x150)]=_0x4f86d5,this[_0x13e121(0x126)]=_0x541df2[_0x13e121(0xe2)](_0x4f86d5,_0x13e121(0x133)),this['currentPath']=_0x541df2[_0x13e121(0xe2)](_0x4f86d5,_0x13e121(0x113)),this[_0x13e121(0xd6)]=_0x541df2[_0x13e121(0xe2)](_0x4f86d5,_0x13e121(0x127)),this[_0x13e121(0x155)]=keepSnapshots,this['log']=log,_0x112520[_0x13e121(0xa7)](this[_0x13e121(0x150)],{'recursive':!![]}),_0x112520[_0x13e121(0xa7)](this[_0x13e121(0x126)],{'recursive':!![]});}[_0x3f1d44(0xe0)](_0x148d3a){return _0x541df2['join'](this['snapshotsDir'],_0x148d3a);}['_snapshotPaths'](_0x45cc4b){const _0x38c10e=_0x3f1d44,_0x27a0c5=this[_0x38c10e(0xe0)](_0x45cc4b);return{'dir':_0x27a0c5,'index':_0x541df2[_0x38c10e(0xe2)](_0x27a0c5,_0x38c10e(0x12b)),'labels':_0x541df2[_0x38c10e(0xe2)](_0x27a0c5,_0x38c10e(0x153)),'state':_0x541df2[_0x38c10e(0xe2)](_0x27a0c5,_0x38c10e(0xed))};}[_0x3f1d44(0x12a)](){const _0x30bc23=_0x3f1d44;if(!_0x3af5e5(this[_0x30bc23(0xb0)]))return null;const _0x3b4dbd=_0x597b92(this[_0x30bc23(0xb0)]);if(!_0x3b4dbd)return null;const _0x55d74f=String(_0x3b4dbd)['trim']();return _0x55d74f||null;}[_0x3f1d44(0xf9)](){const _0x522d0b=_0x3f1d44,_0x2e58fd=this['readCurrentId']();if(!_0x2e58fd)return 0x0;const _0x18d927=Number(_0x2e58fd);return Number[_0x522d0b(0xca)](_0x18d927)?_0x18d927:0x0;}[_0x3f1d44(0x15e)](){const _0x38e25a=_0x3f1d44;try{return _0x112520['readdirSync'](this[_0x38e25a(0x126)],{'withFileTypes':!![]})['filter'](_0x132e5a=>_0x132e5a['isDirectory']())[_0x38e25a(0xa4)](_0x579b1b=>_0x579b1b[_0x38e25a(0x125)])[_0x38e25a(0x149)](_0x296d07=>!_0x296d07[_0x38e25a(0xad)]('.tmp-'))[_0x38e25a(0x149)](_0x5a7c2a=>!_0x5a7c2a[_0x38e25a(0xad)](_0x38e25a(0xa3)))[_0x38e25a(0xdc)]();}catch{return[];}}['latestSnapshotId'](){const _0x2e14c9=_0x3f1d44,_0x670667=this[_0x2e14c9(0x12a)]();if(_0x670667)return _0x670667;const _0x28a34e=this['listSnapshotIds']();if(!_0x28a34e[_0x2e14c9(0xc6)])return null;return _0x28a34e[_0x28a34e[_0x2e14c9(0xc6)]-0x1];}[_0x3f1d44(0x162)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x115aa2=_0x3f1d44;let _0x38ca16;try{_0x38ca16=_0x112520['readdirSync'](this[_0x115aa2(0x126)],{'withFileTypes':!![]});}catch{return;}const _0x410e11=_0x4dab1e()-maxAgeMs;for(const _0x57602a of _0x38ca16){if(!_0x57602a[_0x115aa2(0x96)]())continue;const _0x1ad8a4=_0x57602a['name'];if(!_0x1ad8a4['startsWith'](_0x115aa2(0xa5))&&!_0x1ad8a4[_0x115aa2(0xad)](_0x115aa2(0xa3)))continue;const _0x2008d4=_0x541df2[_0x115aa2(0xe2)](this[_0x115aa2(0x126)],_0x1ad8a4);try{const _0x47a879=_0x112520['statSync'](_0x2008d4);if(_0x47a879['mtimeMs']>_0x410e11)continue;}catch{}try{_0x112520['rmSync'](_0x2008d4,{'recursive':!![],'force':!![]});}catch{}}}[_0x3f1d44(0xcc)]({keep:keep=null}={}){const _0x769f55=_0x3f1d44,_0x239953=Math['max'](0x1,Math[_0x769f55(0x145)](keep??this[_0x769f55(0x155)]??0x3)),_0x146a20=this[_0x769f55(0x15e)]();if(_0x146a20['length']<=_0x239953)return;const _0x3942df=this[_0x769f55(0x12a)](),_0x4e9d69=_0x146a20['slice'](0x0,Math['max'](0x0,_0x146a20[_0x769f55(0xc6)]-_0x239953));for(const _0x402fa7 of _0x4e9d69){if(_0x3942df&&_0x402fa7===_0x3942df)continue;const _0x1b2700=this['_snapshotDir'](_0x402fa7);try{_0x112520[_0x769f55(0x164)](_0x1b2700,{'recursive':!![],'force':!![]});}catch{}}}async['loadSnapshot'](_0x120e52,_0x5d719f){const _0x2ffbf6=_0x3f1d44;if(!_0x120e52)throw new Error(_0x2ffbf6(0xd0));const _0x3ff073=this['_snapshotPaths'](_0x120e52);if(!_0x3af5e5(_0x3ff073[_0x2ffbf6(0x12f)])||!_0x3af5e5(_0x3ff073[_0x2ffbf6(0x152)])||!_0x3af5e5(_0x3ff073['state']))throw new Error(_0x2ffbf6(0xe8)+_0x120e52);const _0x1f79fd=await _0x5d719f(_0x3ff073);return _0x1f79fd||{};}async['publishSnapshot'](_0x21cf38,_0x58979c,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x3fd280=_0x3f1d44,_0x2ebd72=Number(_0x21cf38);if(!Number['isFinite'](_0x2ebd72)||_0x2ebd72<0x0)throw new Error(_0x3fd280(0xb5));const _0x4d6947=_0x4c6be7(_0x2ebd72),_0x54d0d6=this[_0x3fd280(0xe0)](_0x4d6947),_0xf5508f=_0x541df2[_0x3fd280(0xe2)](this['snapshotsDir'],'.tmp-'+_0x4d6947+'-'+_0x425693[_0x3fd280(0xe4)](0x6)[_0x3fd280(0x103)]('hex'));_0x112520[_0x3fd280(0xa7)](_0xf5508f,{'recursive':!![]});const _0x187220={'dir':_0xf5508f,'index':_0x541df2['join'](_0xf5508f,_0x3fd280(0x12b)),'labels':_0x541df2['join'](_0xf5508f,_0x3fd280(0x153)),'state':_0x541df2[_0x3fd280(0xe2)](_0xf5508f,_0x3fd280(0xed))};await _0x58979c(_0x187220,{'id':_0x4d6947,'clock':_0x2ebd72});const _0x45d976=JSON[_0x3fd280(0x8f)]({'pid':process[_0x3fd280(0xf4)],'host':_0x25c4b3[_0x3fd280(0xc4)](),'at':_0x4dab1e()}),_0x166c18=_0x4dab1e();let _0x284f8c=null;const _0x4e048c=()=>{const _0x5f3fa2=_0x3fd280;try{const _0x2f7bb2=JSON[_0x5f3fa2(0x11e)](_0x112520['readFileSync'](this[_0x5f3fa2(0xd6)],'utf8'));if(_0x2f7bb2['at']&&_0x4dab1e()-_0x2f7bb2['at']>staleLockMaxAgeMs){const _0x307524=_0x4dab1e()-_0x2f7bb2['at'],_0x1d6fb1=_0x5f3fa2(0x13e)+Math[_0x5f3fa2(0xef)](_0x307524/0x3e8)+'s,\x20pid:\x20'+_0x2f7bb2['pid']+_0x5f3fa2(0xeb)+_0x2f7bb2[_0x5f3fa2(0x9d)]+_0x5f3fa2(0x116)+_0x5f3fa2(0xf2);this[_0x5f3fa2(0x143)]?.[_0x5f3fa2(0xfc)]?this['log']['warn'](_0x1d6fb1):console[_0x5f3fa2(0xfc)](_0x5f3fa2(0x144),_0x1d6fb1);try{_0x112520[_0x5f3fa2(0x139)](this['lockPath']);}catch{}return!![];}}catch{try{_0x112520[_0x5f3fa2(0x139)](this[_0x5f3fa2(0xd6)]);}catch{}}return![];},_0x31a340=()=>{const _0x125813=_0x3fd280;try{return _0x284f8c=_0x112520[_0x125813(0x14c)](this[_0x125813(0xd6)],'wx'),_0x112520[_0x125813(0x146)](_0x284f8c,_0x45d976),!![];}catch(_0x2a8697){if(_0x2a8697&&_0x2a8697[_0x125813(0x102)]===_0x125813(0x12e))return![];throw _0x2a8697;}};if(!_0x31a340()){_0x4e048c(),_0x31a340();if(_0x284f8c==null&&lockTimeoutMs>0x0)while(_0x4dab1e()-_0x166c18<lockTimeoutMs){await new Promise(_0x10a3ba=>setTimeout(_0x10a3ba,0x19));if(_0x31a340())break;_0x4e048c();}}if(_0x284f8c==null){try{_0x112520[_0x3fd280(0x164)](_0xf5508f,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x3fd280(0x98)};}try{const _0x48a321=this[_0x3fd280(0xf9)]();if(_0x2ebd72<=_0x48a321){try{_0x112520[_0x3fd280(0x164)](_0xf5508f,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x3fd280(0xb9),'currentClock':_0x48a321};}if(!_0x3af5e5(_0x54d0d6))_0x112520[_0x3fd280(0x11f)](_0xf5508f,_0x54d0d6);else try{_0x112520[_0x3fd280(0x164)](_0xf5508f,{'recursive':!![],'force':!![]});}catch{}return _0x3ab688(this[_0x3fd280(0xb0)],_0x4d6947+'\x0a'),this[_0x3fd280(0xcc)]({'keep':keep}),{'published':!![],'currentClock':_0x2ebd72};}finally{try{_0x112520[_0x3fd280(0x165)](_0x284f8c);}catch{}try{_0x112520['unlinkSync'](this[_0x3fd280(0xd6)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x2780b2=_0xa33854;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0xffc7d3=require$$0;class _0x1532c0{constructor(){const _0x4e0a39=_0x3d0f;this[_0x4e0a39(0x9e)]=new Map(),this[_0x4e0a39(0xe7)]=new Map(),this[_0x4e0a39(0x107)]=0x0,this[_0x4e0a39(0xab)]=0x0,this[_0x4e0a39(0x12d)]=new Map(),this['hasFingerprints']=!![];}async[_0x2780b2(0xd4)](){const _0x4857b0=_0x2780b2;this['keyToLabel']=new Map(),this[_0x4857b0(0xe7)]=new Map(),this[_0x4857b0(0x12d)]=new Map(),this[_0x4857b0(0xd3)]=!![],this[_0x4857b0(0x107)]=0x0,this[_0x4857b0(0xab)]=0x0;}async[_0x2780b2(0x160)](_0x23cc09){const _0x22c72c=_0x2780b2;if(!_0x23cc09||!_0xffc7d3[_0x22c72c(0x11d)](_0x23cc09))return await this[_0x22c72c(0xd4)](),!![];let _0x307ff1;try{_0x307ff1=_0xffc7d3[_0x22c72c(0x118)](_0x23cc09,_0x22c72c(0x14a));}catch{return await this[_0x22c72c(0xd4)](),!![];}let _0x5b7944;try{_0x5b7944=JSON['parse'](_0x307ff1);}catch{return await this[_0x22c72c(0xd4)](),!![];}const _0x5383b8=Array[_0x22c72c(0x8b)](_0x5b7944?.['entries'])?_0x5b7944[_0x22c72c(0xc3)]:[],_0x47bb29=Number['isInteger'](_0x5b7944?.[_0x22c72c(0x107)])?_0x5b7944[_0x22c72c(0x107)]:0x0,_0x53d0cc=new Map(),_0x5a838a=new Map(),_0xc5b98b=new Map(),_0xb61f6a=_0x5b7944?.[_0x22c72c(0xc5)]>=0x2;let _0x47b57a=-0x1;for(const _0x4f0f62 of _0x5383b8){if(!Array[_0x22c72c(0x8b)](_0x4f0f62)||_0x4f0f62[_0x22c72c(0xc6)]<0x2)continue;const _0xaf8ab5=Number(_0x4f0f62[0x0]),_0x3996cc=String(_0x4f0f62[0x1]??'');if(!Number['isInteger'](_0xaf8ab5)||_0xaf8ab5<0x0)continue;if(!_0x3996cc)continue;_0x53d0cc['set'](_0x3996cc,_0xaf8ab5),_0x5a838a[_0x22c72c(0xf7)](_0xaf8ab5,_0x3996cc);if(_0xb61f6a&&typeof _0x4f0f62[0x2]==='number')_0xc5b98b[_0x22c72c(0xf7)](_0x3996cc,_0x4f0f62[0x2]);if(_0xaf8ab5>_0x47b57a)_0x47b57a=_0xaf8ab5;}return this[_0x22c72c(0x9e)]=_0x53d0cc,this[_0x22c72c(0xe7)]=_0x5a838a,this['keyToFp']=_0xc5b98b,this[_0x22c72c(0xd3)]=_0xb61f6a,this[_0x22c72c(0x107)]=Math[_0x22c72c(0x9b)](_0x47bb29,_0x47b57a+0x1,0x0),this[_0x22c72c(0xab)]=0x0,!![];}[_0x2780b2(0x10e)](_0x5e51b6){return this['keyToLabel']['get'](_0x5e51b6);}[_0x2780b2(0xe5)](_0x166fda){const _0x44a66e=_0x2780b2;let _0x2bd4eb=this[_0x44a66e(0x9e)]['get'](_0x166fda);if(_0x2bd4eb!==undefined)return _0x2bd4eb;return _0x2bd4eb=this[_0x44a66e(0x107)]++,this[_0x44a66e(0x9e)][_0x44a66e(0xf7)](_0x166fda,_0x2bd4eb),this[_0x44a66e(0xe7)][_0x44a66e(0xf7)](_0x2bd4eb,_0x166fda),_0x2bd4eb;}[_0x2780b2(0x15a)](_0x3a36c0,_0x8c2bbb){const _0x2bcec5=_0x2780b2;if(_0x8c2bbb==null)this['keyToFp']['delete'](_0x3a36c0);else this[_0x2bcec5(0x12d)][_0x2bcec5(0xf7)](_0x3a36c0,_0x8c2bbb);}[_0x2780b2(0x132)](_0xc4a8dc){const _0x4609d0=_0x2780b2;return this[_0x4609d0(0x12d)][_0x4609d0(0x10a)](_0xc4a8dc);}[_0x2780b2(0x140)](){const _0x4d63e8=_0x2780b2;return this[_0x4d63e8(0x9e)][_0x4d63e8(0x140)]();}[_0x2780b2(0xcf)](_0x266097){const _0x3b0afe=_0x2780b2,_0x1e2acb=this[_0x3b0afe(0x9e)][_0x3b0afe(0x10a)](_0x266097);if(_0x1e2acb===undefined)return;this[_0x3b0afe(0x12d)][_0x3b0afe(0x13d)](_0x266097),this[_0x3b0afe(0x9e)][_0x3b0afe(0x13d)](_0x266097),this['labelToKey']['delete'](_0x1e2acb),this['_tombstoneCount']++;}[_0x2780b2(0x11c)](_0x50b8ce){return this['labelToKey']['get'](_0x50b8ce)??null;}[_0x2780b2(0x95)](){const _0x42a4cb=_0x2780b2;return this[_0x42a4cb(0x9e)]['size'];}[_0x2780b2(0x93)](){const _0x43f29a=_0x2780b2;return this[_0x43f29a(0xab)];}async[_0x2780b2(0xbb)](_0x25fcbc){const _0x55573d=_0x2780b2,_0x2035cf=_0x25fcbc+'.tmp',_0x568f0d=[];for(const [_0x420761,_0x298eba]of this['labelToKey'][_0x55573d(0xc3)]()){const _0x3b10e7=this[_0x55573d(0x12d)]['get'](_0x298eba);_0x568f0d[_0x55573d(0x11b)](_0x3b10e7==null?[_0x420761,_0x298eba]:[_0x420761,_0x298eba,_0x3b10e7]);}_0x568f0d[_0x55573d(0xdc)]((_0x3d70b4,_0x2d94a7)=>_0x3d70b4[0x0]-_0x2d94a7[0x0]);const _0x2fa41b={'version':0x2,'nextLabel':this['nextLabel'],'entries':_0x568f0d};_0xffc7d3[_0x55573d(0x146)](_0x2035cf,JSON['stringify'](_0x2fa41b)),_0xffc7d3[_0x55573d(0x11f)](_0x2035cf,_0x25fcbc);}}return labelMap=_0x1532c0,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x36e87f(_0x31c2a3){const _0x4f6073=_0x3d0f,_0x1b1ab2=new Uint32Array(_0x31c2a3[_0x4f6073(0xfe)],_0x31c2a3[_0x4f6073(0x8d)],_0x31c2a3[_0x4f6073(0xc6)]);let _0x155296=0x811c9dc5,_0xc3caa8=0x9747b28c;for(let _0x310929=0x0;_0x310929<_0x1b1ab2[_0x4f6073(0xc6)];_0x310929++){const _0x1bfc00=_0x1b1ab2[_0x310929];_0x155296=Math[_0x4f6073(0xce)](_0x155296^_0x1bfc00,0x1000193)>>>0x0;let _0x277bd1=Math[_0x4f6073(0xce)](_0x1bfc00,0xcc9e2d51);_0x277bd1=_0x277bd1<<0xf|_0x277bd1>>>0x11,_0xc3caa8=Math[_0x4f6073(0xce)](_0xc3caa8^Math[_0x4f6073(0xce)](_0x277bd1,0x1b873593),0x5)+0xe6546b64,_0xc3caa8>>>=0x0;}return _0xc3caa8=Math[_0x4f6073(0xce)](_0xc3caa8^_0xc3caa8>>>0x10,0x85ebca6b)>>>0x0,(_0x155296>>>0x0)*0x100000+(_0xc3caa8&0xfffff);}function _0xf43ef3(_0xe5b4cd,_0x1b9f44,_0x528283,{upsert:_0x1db66e,remove:_0x3a755e}){const _0x41c7ac=_0x3d0f,_0x23c378=new Set();let _0x3b1dfd=0x0,_0x40b7e3=0x0,_0x41de41=0x0;for(const {key:_0x5bec18,vector:_0x4e9cd0}of _0x1b9f44){if(!(_0x4e9cd0 instanceof Float32Array)||_0x4e9cd0['length']!==_0x528283)continue;_0x23c378[_0x41c7ac(0xa6)](_0x5bec18);const _0x1dfa4d=_0x36e87f(_0x4e9cd0),_0xfecf2=_0xe5b4cd[_0x41c7ac(0x10e)](_0x5bec18)!==undefined;if(_0xfecf2&&_0xe5b4cd[_0x41c7ac(0x132)](_0x5bec18)===_0x1dfa4d)continue;_0x1db66e(_0x5bec18,_0x4e9cd0,_0x1dfa4d);if(_0xfecf2)_0x40b7e3++;else _0x3b1dfd++;}for(const _0x13e3f4 of[..._0xe5b4cd[_0x41c7ac(0x140)]()]){if(_0x23c378[_0x41c7ac(0xbc)](_0x13e3f4))continue;_0x3a755e(_0x13e3f4),_0x41de41++;}return{'added':_0x3b1dfd,'changed':_0x40b7e3,'removed':_0x41de41};}return indexConvergence={'fingerprint':_0x36e87f,'reconcileIndex':_0xf43ef3},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x5d03b3=requireSnapshotStore(),_0x206cdb=requireLabelMap(),{fingerprint:_0x11b244,reconcileIndex:_0x21caf6}=requireIndexConvergence(),_0xf93af9=0x1;let _0x5d86c8=null;function _0x1a1d33(){const _0x46b0d1=_0x3d0f;if(_0x5d86c8)return _0x5d86c8;try{return _0x5d86c8=require(_0x46b0d1(0x13c)),_0x5d86c8;}catch(_0x1e4536){const _0x47f989=new Error(_0x46b0d1(0x11a)+(_0x46b0d1(0x14d)+process[_0x46b0d1(0x13b)]['node']+_0x46b0d1(0xa8)+process[_0x46b0d1(0xcd)]+'/'+process[_0x46b0d1(0xa1)]+'.\x20')+_0x46b0d1(0x10c)+(_0x46b0d1(0x114)+(_0x1e4536?.[_0x46b0d1(0x97)]||String(_0x1e4536))));_0x47f989[_0x46b0d1(0x102)]=_0x46b0d1(0x105),_0x47f989[_0x46b0d1(0xda)]=_0x1e4536;throw _0x47f989;}}return hnsw=function _0x1c01fe(_0x2a417e={},{dims:_0x2a6536,dir:_0x397d02}){const _0x49ef6f=_0x3d0f,_0x19dcef=_0x1a1d33();if(!_0x2a6536||_0x2a6536<=0x0)throw new Error(_0x49ef6f(0x15f));if(!_0x397d02)throw new Error(_0x49ef6f(0xbf));const _0x5ce526={'metric':_0x2a417e[_0x49ef6f(0x92)]??_0x49ef6f(0x14f),'M':_0x2a417e['M']??0x10,'efConstruction':_0x2a417e['efConstruction']??0xc8,'efSearch':_0x2a417e[_0x49ef6f(0xa0)]??0x40,'maxElements':_0x2a417e[_0x49ef6f(0x8c)]??0x400,'growFactor':_0x2a417e[_0x49ef6f(0x106)]??0x2,'snapshotEveryChanges':_0x2a417e[_0x49ef6f(0xaa)]??0xc350,'keepSnapshots':_0x2a417e[_0x49ef6f(0x155)]??0x2,'tmpMaxAgeMs':_0x2a417e[_0x49ef6f(0x148)]??0x6*0x36ee80},_0x28cce3=new _0x5d03b3({'dir':_0x397d02,'keepSnapshots':_0x5ce526[_0x49ef6f(0x155)]}),_0x6edab3=new _0x206cdb();let _0x1d4a81=null,_0x2f050f=0x0,_0x590df0=null,_0x36684a=Promise[_0x49ef6f(0xbe)]();const _0x36e768=_0xd215d1=>{const _0x13e914=_0x49ef6f,_0x5d344d=_0x36684a[_0x13e914(0x9f)](_0xd215d1);return _0x36684a=_0x5d344d[_0x13e914(0x156)](()=>{}),_0x5d344d;};async function _0x3e9cdd(_0x37f784){const _0x57b730=_0x49ef6f;await _0x6edab3[_0x57b730(0xd4)](),_0x37f784=_0x37f784??[];const _0x976d55=Math[_0x57b730(0x9b)](_0x5ce526[_0x57b730(0x8c)],Math['ceil'](_0x37f784[_0x57b730(0xc6)]*(_0x5ce526[_0x57b730(0x106)]||1.2)),0x1);_0x1d4a81=new _0x19dcef[(_0x57b730(0x10b))](_0x5ce526[_0x57b730(0x92)],_0x2a6536),_0x1d4a81[_0x57b730(0x12c)]({'maxElements':_0x976d55,'efConstruction':_0x5ce526[_0x57b730(0x121)],'M':_0x5ce526['M']});for(const {key:_0x43573b,vector:_0x41f375}of _0x37f784){if(!(_0x41f375 instanceof Float32Array)||_0x41f375['length']!==_0x2a6536)continue;_0x1891c1(_0x43573b,_0x41f375);}_0x1d4a81[_0x57b730(0x111)](_0x5ce526['efSearch']),_0x2f050f=0x0;}async function _0x3d8d0a(_0x26da44){return _0x3e9cdd(_0x26da44?await _0x26da44():[]);}function _0x102041(){const _0x32e1d2=_0x49ef6f;if(_0x1d4a81[_0x32e1d2(0x13f)]()<_0x1d4a81[_0x32e1d2(0x158)]())return;const _0x49ed7c=Math['ceil'](_0x1d4a81[_0x32e1d2(0x158)]()*(_0x5ce526['growFactor']||0x2));_0x1d4a81[_0x32e1d2(0x9a)](_0x49ed7c),_0x5ce526[_0x32e1d2(0x8c)]=_0x49ed7c;}function _0x1891c1(_0x2f725c,_0x16163d,_0x3b15b1){const _0x4e0707=_0x49ef6f,_0xd7d896=_0x6edab3[_0x4e0707(0xe5)](_0x2f725c);try{_0x1d4a81[_0x4e0707(0x8e)](_0xd7d896);}catch{}_0x102041(),_0x1d4a81['addPoint'](Array['from'](_0x16163d),_0xd7d896),_0x6edab3[_0x4e0707(0x15a)](_0x2f725c,_0x3b15b1??_0x11b244(_0x16163d));}function _0x14d671(_0x510e94){const _0x5460d0=_0x49ef6f,_0x5a1961=_0x6edab3[_0x5460d0(0x10e)](_0x510e94);if(_0x5a1961===undefined)return![];try{_0x1d4a81[_0x5460d0(0x8e)](_0x5a1961);}catch{}return _0x6edab3['tombstone'](_0x510e94),!![];}function _0x433d95(){const _0x5222da=_0x49ef6f;return Math[_0x5222da(0x9b)](Date[_0x5222da(0xd8)](),_0x28cce3[_0x5222da(0xf9)]()+0x1);}async function _0x135b02(_0x37cba5){const _0x173444=_0x49ef6f;if(!_0x1d4a81||!_0x37cba5)return![];const _0x3e154b=await _0x28cce3[_0x173444(0x136)](_0x37cba5,async _0x6ff0c=>{const _0x4c7877=_0x173444;_0x1d4a81[_0x4c7877(0x154)](_0x6ff0c[_0x4c7877(0x12f)]),await _0x6edab3[_0x4c7877(0xbb)](_0x6ff0c[_0x4c7877(0x152)]);const _0x46bd3a=require$$0;_0x46bd3a[_0x4c7877(0x146)](_0x6ff0c[_0x4c7877(0x159)],JSON[_0x4c7877(0x8f)]({'manifestVersion':_0xf93af9,'dims':_0x2a6536,'metric':_0x5ce526[_0x4c7877(0x92)],'clock':_0x37cba5,'snapshotAt':Date[_0x4c7877(0xd8)]()},null,0x2));},{'keep':_0x5ce526[_0x173444(0x155)]});if(_0x3e154b?.[_0x173444(0xb7)])_0x2f050f=0x0;return _0x3e154b?.['published']??![];}async function _0x2ca65a(){const _0x6a9e21=_0x49ef6f,_0x220a27=_0x28cce3[_0x6a9e21(0x12a)]()||_0x28cce3['latestSnapshotId']();if(!_0x220a27)return null;let _0x3daa30,_0x5e467a=![];return await _0x28cce3[_0x6a9e21(0xb4)](_0x220a27,async _0x2276d9=>{const _0x11bffc=_0x6a9e21,_0x2eeb30=require$$0;_0x3daa30=JSON['parse'](_0x2eeb30['readFileSync'](_0x2276d9['state'],_0x11bffc(0x14a)));if(_0x3daa30[_0x11bffc(0xbd)]!==_0xf93af9||_0x3daa30[_0x11bffc(0x14e)]!==_0x2a6536||_0x3daa30[_0x11bffc(0x92)]!==_0x5ce526[_0x11bffc(0x92)]){_0x3daa30=null;return;}await _0x6edab3[_0x11bffc(0x160)](_0x2276d9[_0x11bffc(0x152)]),_0x1d4a81=new _0x19dcef[(_0x11bffc(0x10b))](_0x5ce526[_0x11bffc(0x92)],_0x2a6536),_0x1d4a81['readIndexSync'](_0x2276d9[_0x11bffc(0x12f)]),_0x1d4a81[_0x11bffc(0x111)](_0x5ce526[_0x11bffc(0xa0)]),_0x5e467a=!![];}),_0x5e467a?_0x3daa30?.[_0x6a9e21(0x90)]??0x0:null;}return{async 'load'(_0x2f95b4){return _0x36e768(async()=>{const _0x3d5668=_0x3d0f;_0x28cce3[_0x3d5668(0x162)]({'maxAgeMs':_0x5ce526[_0x3d5668(0x148)]}),_0x590df0=_0x2f95b4??null;const _0x27cc9d=await _0x2ca65a(),_0x83dd3c=_0x2f95b4?await _0x2f95b4():null;if(_0x27cc9d!=null){if(_0x83dd3c){if(!_0x6edab3[_0x3d5668(0xd3)])return await _0x3e9cdd(_0x83dd3c),null;const _0x10e791=_0x21caf6(_0x6edab3,_0x83dd3c,_0x2a6536,{'upsert':_0x1891c1,'remove':_0x14d671});_0x2f050f+=_0x10e791[_0x3d5668(0x112)]+_0x10e791[_0x3d5668(0x110)]+_0x10e791[_0x3d5668(0xec)];}return _0x27cc9d;}return await _0x3e9cdd(_0x83dd3c),null;});},async 'add'(_0x5958ba,_0x52671f,_0x3f2b13){return _0x36e768(async()=>{const _0x4a1722=_0x3d0f;if(!_0x1d4a81)return;const _0x229026=_0x52671f instanceof Float32Array?_0x52671f:new Float32Array(_0x52671f),_0x2e825a=_0x11b244(_0x229026);if(_0x6edab3[_0x4a1722(0x132)](_0x5958ba)===_0x2e825a)return;_0x1891c1(_0x5958ba,_0x229026,_0x2e825a),_0x2f050f++,_0x2f050f>=_0x5ce526[_0x4a1722(0xaa)]&&await _0x135b02(_0x433d95());});},async 'remove'(_0x129eb6){return _0x36e768(async()=>{if(!_0x1d4a81)return;if(_0x14d671(_0x129eb6))_0x2f050f++;});},'search'(_0x578482,{limit:limit=0xa,efSearch:_0x32808f}={}){const _0x178489=_0x49ef6f;if(!_0x1d4a81)return[];if(Number[_0x178489(0x124)](_0x32808f))_0x1d4a81[_0x178489(0x111)](_0x32808f);const _0x3cae1f=Math['min'](limit,_0x1d4a81[_0x178489(0x13f)]()||0x1),{neighbors:_0x204da4,distances:_0xced56b}=_0x1d4a81[_0x178489(0xb8)](Array['from'](_0x578482),_0x3cae1f),_0x1ba2a3=[];for(let _0x576a03=0x0;_0x576a03<_0x204da4['length'];_0x576a03++){const _0x282298=_0x6edab3['keyForLabel'](_0x204da4[_0x576a03]);if(!_0x282298)continue;const _0x33cee9=_0x5ce526[_0x178489(0x92)]===_0x178489(0x14f)?Math[_0x178489(0x9b)](0x0,0x1-_0xced56b[_0x576a03]):0x1/(0x1+_0xced56b[_0x576a03]);_0x1ba2a3['push']({'key':_0x282298,'score':_0x33cee9});}return _0x1ba2a3;},async 'snapshot'(_0x1d5552){return _0x36e768(()=>_0x135b02(_0x1d5552??_0x433d95()));},async 'rebuild'(_0x892a00){return _0x36e768(()=>{if(_0x892a00!=null)_0x590df0=_0x892a00;return _0x3d8d0a(_0x892a00??_0x590df0);});},async 'stop'(){const _0x3a0294=_0x49ef6f;return _0x36e768(()=>_0x2f050f>0x0||!_0x28cce3[_0x3a0294(0x12a)]()?_0x135b02(_0x433d95()):![]);},'count'(){const _0x5099f0=_0x49ef6f;return _0x6edab3[_0x5099f0(0x95)]();},'info'(){const _0x4562da=_0x49ef6f;return{'algorithm':_0x4562da(0x117),'metric':_0x5ce526[_0x4562da(0x92)],'M':_0x5ce526['M'],'efConstruction':_0x5ce526['efConstruction'],'efSearch':_0x5ce526[_0x4562da(0xa0)],'maxElements':_0x1d4a81?.[_0x4562da(0x158)]()??_0x5ce526[_0x4562da(0x8c)],'count':_0x6edab3[_0x4562da(0x95)](),'changesSince':_0x2f050f,'snapshotDir':_0x397d02,'latestSnapshot':_0x28cce3[_0x4562da(0x12a)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x2d3225(_0x29d448={}){const _0x56aa8a=new Map();return{async 'load'(_0x57666e){const _0x41ab1d=_0x3d0f;_0x56aa8a[_0x41ab1d(0x9c)]();if(_0x57666e)for(const {key:_0x39d1db,vector:_0x591889}of await _0x57666e()){_0x56aa8a[_0x41ab1d(0xf7)](_0x39d1db,_0x591889);}},async 'add'(_0x1e8eaf,_0x844247,_0x1bc3d6){_0x56aa8a['set'](_0x1e8eaf,_0x844247);},async 'remove'(_0x300a8f){_0x56aa8a['delete'](_0x300a8f);},'search'(_0x40ab17,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x3feae5=_0x3d0f,_0x196ca0=[];for(const [_0x285421,_0x4ea337]of _0x56aa8a){const _0x5cdf41=_0x1a9980(_0x40ab17,_0x4ea337);if(_0x5cdf41>=threshold)_0x196ca0[_0x3feae5(0x11b)]({'key':_0x285421,'score':_0x5cdf41});}return _0x196ca0['sort']((_0x207421,_0x1ecf46)=>_0x1ecf46[_0x3feae5(0x119)]-_0x207421[_0x3feae5(0x119)]),_0x196ca0['slice'](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x36891e){const _0x598a95=_0x3d0f;await this[_0x598a95(0xac)](_0x36891e);},async 'stop'(){},'count'(){return _0x56aa8a['size'];},'info'(){const _0x4979b7=_0x3d0f;return{'algorithm':_0x4979b7(0xf3),'count':_0x56aa8a[_0x4979b7(0x95)]};}};};function _0x1a9980(_0x1ceaed,_0x272fad){const _0x2ae7a2=_0x3d0f;let _0x5ec60a=0x0,_0x467ec0=0x0,_0x31ce53=0x0;for(let _0x328dc2=0x0;_0x328dc2<_0x1ceaed[_0x2ae7a2(0xc6)];_0x328dc2++){_0x5ec60a+=_0x1ceaed[_0x328dc2]*_0x272fad[_0x328dc2],_0x467ec0+=_0x1ceaed[_0x328dc2]*_0x1ceaed[_0x328dc2],_0x31ce53+=_0x272fad[_0x328dc2]*_0x272fad[_0x328dc2];}const _0x3a3d15=Math['sqrt'](_0x467ec0)*Math[_0x2ae7a2(0xf1)](_0x31ce53);return _0x3a3d15===0x0?0x0:_0x5ec60a/_0x3a3d15;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x2fa2a0=require$$0,_0x2829c9=require$$1,_0x4ef694=require$$3;return writerLock=function _0x5bb7da(_0x4fbd6b,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x22adfb=_0x3d0f,_0x10ae6c=_0x2829c9['join'](_0x4fbd6b,'WRITER.LOCK'),_0x38527e=_0x4ef694[_0x22adfb(0xe4)](0x8)[_0x22adfb(0x103)](_0x22adfb(0x115));let _0x1bde8d=![],_0x1d97b1=null;const _0x347f28=()=>JSON[_0x22adfb(0x8f)]({'pid':process[_0x22adfb(0xf4)],'token':_0x38527e,'at':Date[_0x22adfb(0xd8)]()});function _0x36160e(){const _0x58e3dc=_0x22adfb;try{return JSON['parse'](_0x2fa2a0[_0x58e3dc(0x118)](_0x10ae6c,_0x58e3dc(0x14a)));}catch(_0x467bce){return _0x467bce?.['code']===_0x58e3dc(0x108)?null:{'unreadable':!![]};}}function _0x5def90(){const _0x13856f=_0x22adfb;try{const _0x27220c=_0x2fa2a0[_0x13856f(0x14c)](_0x10ae6c,'wx');try{_0x2fa2a0[_0x13856f(0x146)](_0x27220c,_0x347f28());}finally{_0x2fa2a0['closeSync'](_0x27220c);}return!![];}catch(_0x2ebf11){if(_0x2ebf11?.[_0x13856f(0x102)]==='EEXIST')return![];throw _0x2ebf11;}}function _0x3fdc8b(_0x347386){const _0x20db43=_0x22adfb;if(!_0x347386)return!![];if(_0x347386[_0x20db43(0x14b)])return!![];return Date['now']()-(_0x347386['at']??0x0)>=maxAgeMs;}function _0x8bf0dd(){if(_0x1d97b1)clearInterval(_0x1d97b1);_0x1d97b1=null;}function _0x4e7d58(){_0x8bf0dd(),_0x1d97b1=setInterval(()=>{const _0x1e31e7=_0x3d0f,_0x5c96b0=_0x36160e();if(_0x5c96b0&&!_0x5c96b0['unreadable']&&_0x5c96b0['token']!==_0x38527e){_0x1bde8d=![],_0x8bf0dd();try{onLost?.();}catch{}return;}try{_0x2fa2a0[_0x1e31e7(0x146)](_0x10ae6c,_0x347f28());}catch{}},heartbeatMs),_0x1d97b1['unref']?.();}function _0x508cbe(){const _0x128fed=_0x22adfb,_0x378a6e=_0x36160e();return!!_0x378a6e&&_0x378a6e[_0x128fed(0xa9)]===_0x38527e;}return{'path':_0x10ae6c,'token':_0x38527e,'acquire'(){const _0x19d83f=_0x22adfb,_0xa17a54=_0x36160e();if(_0xa17a54&&_0xa17a54['token']===_0x38527e){_0x1bde8d=!![];if(!_0x1d97b1)_0x4e7d58();return!![];}let _0x294bee=_0x5def90();if(!_0x294bee&&_0x3fdc8b(_0x36160e())){try{_0x2fa2a0[_0x19d83f(0x139)](_0x10ae6c);}catch{}_0x294bee=_0x5def90();}if(_0x294bee&&!_0x508cbe())_0x294bee=![];_0x1bde8d=_0x294bee;if(_0x294bee)_0x4e7d58();return _0x294bee;},'held'(){return _0x1bde8d;},'isFree'(){const _0x476418=_0x22adfb,_0x31e44f=_0x36160e();if(_0x31e44f&&_0x31e44f[_0x476418(0xa9)]===_0x38527e)return![];return _0x3fdc8b(_0x31e44f);},'release'(){const _0x41c341=_0x22adfb;_0x8bf0dd();if(!_0x1bde8d)return;_0x1bde8d=![];if(_0x508cbe())try{_0x2fa2a0[_0x41c341(0x139)](_0x10ae6c);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x4dc3f6=require$$0,_0x324197=requireSnapshotStore(),_0x400c79=requireLabelMap(),_0x54f2ce=requireWriterLock(),{fingerprint:_0x4e79c7,reconcileIndex:_0x1266f3}=requireIndexConvergence(),_0x1b3cb0=0x1;let _0x86f9c3=null;function _0x29313e(){const _0x564b3b=_0x3d0f;if(_0x86f9c3)return _0x86f9c3;try{return _0x86f9c3=require('usearch'),_0x86f9c3;}catch(_0x369bf2){const _0x3634a1=new Error(_0x564b3b(0xe3)+('for\x20Node\x20'+process['versions'][_0x564b3b(0xde)]+_0x564b3b(0xa8)+process[_0x564b3b(0xcd)]+'/'+process['arch']+'.\x20')+_0x564b3b(0xe9)+(_0x564b3b(0x114)+(_0x369bf2?.[_0x564b3b(0x97)]||String(_0x369bf2))));_0x3634a1[_0x564b3b(0x102)]=_0x564b3b(0x137),_0x3634a1[_0x564b3b(0xda)]=_0x369bf2;throw _0x3634a1;}}function _0x4992d8(_0x1d710a,_0xfa54fc){const _0x2220fe=_0x3d0f;switch(_0x1d710a){case _0x2220fe(0x14f):return _0xfa54fc['MetricKind'][_0x2220fe(0xdb)];case'l2':return _0xfa54fc[_0x2220fe(0x123)][_0x2220fe(0xb1)];case'ip':return _0xfa54fc['MetricKind']['IP'];default:return _0xfa54fc['MetricKind'][_0x2220fe(0xdb)];}}return usearch=function _0x1961f5(_0x2f8b96={},{dims:_0x3d75a1,dir:_0x3c72cb,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x26a76a=_0x3d0f,_0x12dd0d=_0x29313e();if(!_0x3d75a1||_0x3d75a1<=0x0)throw new Error(_0x26a76a(0xd9));if(!_0x3c72cb)throw new Error(_0x26a76a(0x122));const _0xeeb71a={'metric':_0x2f8b96[_0x26a76a(0x92)]??'cosine','connectivity':_0x2f8b96[_0x26a76a(0xd1)]??0x10,'expansionAdd':_0x2f8b96[_0x26a76a(0x141)]??0x80,'expansionSearch':_0x2f8b96[_0x26a76a(0xee)]??0x40,'snapshotEveryChanges':_0x2f8b96[_0x26a76a(0xaa)]??0xc350,'snapshotMaxLagMs':_0x2f8b96[_0x26a76a(0xf8)]??0x2710,'keepSnapshots':_0x2f8b96[_0x26a76a(0x155)]??0x2,'tmpMaxAgeMs':_0x2f8b96[_0x26a76a(0x148)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x2f8b96[_0x26a76a(0x91)]??0x1388,'writerLockMaxAgeMs':_0x2f8b96[_0x26a76a(0x100)]??0x3a98,'viewRefreshMs':_0x2f8b96['viewRefreshMs']??0x3e8},_0x21b4b0=new _0x324197({'dir':_0x3c72cb,'keepSnapshots':_0xeeb71a['keepSnapshots']}),_0xb43eae=_0x54f2ce(_0x3c72cb,{'maxAgeMs':_0xeeb71a[_0x26a76a(0x100)],'heartbeatMs':_0xeeb71a['heartbeatIntervalMs'],'onLost':()=>{const _0x358486=_0x26a76a;_0x5ced85(_0x4cd5ae)[_0x358486(0x156)](()=>{});}});let _0x36b68e=new _0x400c79(),_0x57c625=null,_0x39d1d0=0x0,_0x2f3097=null,_0x2a1474=![],_0x2341a0=![],_0x49abeb=null,_0x46e2d2=0x0,_0x10bc10=null,_0x3b619c=0x0,_0x493ea4=![],_0x1d7f67=Promise[_0x26a76a(0xbe)]();const _0x5ced85=_0x3d1d21=>{const _0x271127=_0x26a76a,_0x34587a=_0x1d7f67['then'](_0x3d1d21);return _0x1d7f67=_0x34587a[_0x271127(0x156)](()=>{}),_0x34587a;},_0x2e4854=()=>{try{onChange?.();}catch{}};function _0x3d27f6(){const _0x35ade0=_0x26a76a;return new _0x12dd0d[(_0x35ade0(0x130))]({'dimensions':_0x3d75a1,'metric':_0x4992d8(_0xeeb71a[_0x35ade0(0x92)],_0x12dd0d),'quantization':_0x12dd0d[_0x35ade0(0x163)][_0x35ade0(0x147)],'connectivity':_0xeeb71a[_0x35ade0(0xd1)],'expansion_add':_0xeeb71a[_0x35ade0(0x141)],'expansion_search':_0xeeb71a[_0x35ade0(0xee)],'multi':![]});}function _0x293701(_0x581d29){return _0x581d29 instanceof Float32Array?_0x581d29:new Float32Array(_0x581d29);}function _0x16b8b2(){if(fetchAll)return fetchAll();if(_0x2f3097)return _0x2f3097();return Promise['resolve'](null);}function _0x8aa389(_0x1f9ab7,_0x4f7bfe,_0x3422dd){const _0x18ca17=_0x26a76a,_0x36f236=_0x36b68e[_0x18ca17(0x10e)](_0x1f9ab7);if(_0x36f236!==undefined)try{_0x57c625[_0x18ca17(0x131)](BigInt(_0x36f236));}catch{}const _0x234764=_0x36b68e[_0x18ca17(0xe5)](_0x1f9ab7);_0x57c625[_0x18ca17(0xa6)](BigInt(_0x234764),_0x4f7bfe),_0x36b68e['setFingerprint'](_0x1f9ab7,_0x3422dd??_0x4e79c7(_0x4f7bfe));}function _0x478721(_0x138b55){const _0x3ae149=_0x26a76a,_0x5ceb99=_0x36b68e['labelForExisting'](_0x138b55);if(_0x5ceb99===undefined)return![];try{_0x57c625['remove'](BigInt(_0x5ceb99));}catch{}return _0x36b68e[_0x3ae149(0xcf)](_0x138b55),!![];}function _0x56ebff(_0x2ea6b9){const _0x21f61e=_0x26a76a;_0x36b68e=new _0x400c79(),_0x57c625=_0x3d27f6();for(const {key:_0x4bd5f8,vector:_0x4e9a3b}of _0x2ea6b9??[]){if(!(_0x4e9a3b instanceof Float32Array)||_0x4e9a3b[_0x21f61e(0xc6)]!==_0x3d75a1)continue;_0x8aa389(_0x4bd5f8,_0x4e9a3b);}_0x39d1d0=0x0;}function _0x42b7cf(){const _0x16a153=_0x26a76a;return Math[_0x16a153(0x9b)](Date[_0x16a153(0xd8)](),_0x21b4b0['readCurrentClock']()+0x1);}function _0x493718(){if(_0x49abeb)clearTimeout(_0x49abeb);_0x49abeb=null;}function _0x49b1a1(){const _0x1d0ea4=_0x26a76a;if(!_0xeeb71a[_0x1d0ea4(0xf8)]||_0x49abeb||!_0x2341a0||_0x39d1d0<=0x0)return;const _0xdb4275=Math[_0x1d0ea4(0x9b)](_0xeeb71a['snapshotMaxLagMs'],0xa*_0x46e2d2);_0x49abeb=setTimeout(()=>{_0x49abeb=null,_0x5ced85(async()=>{if(_0x2341a0&&_0x39d1d0>0x0)await _0x300e23();_0x49b1a1(),_0x2e4854();})['catch'](()=>{});},_0xdb4275),_0x49abeb[_0x1d0ea4(0xd7)]?.();}async function _0x300e23(_0x578ee4){const _0x2bbee8=_0x26a76a;if(!_0x57c625)return![];const _0x920efd=_0x578ee4??_0x42b7cf(),_0x210209=Date[_0x2bbee8(0xd8)](),_0x2a7283=await _0x21b4b0['publishSnapshot'](_0x920efd,async _0x5ea4c3=>{const _0x36846b=_0x2bbee8;_0x57c625[_0x36846b(0xf0)](_0x5ea4c3[_0x36846b(0x12f)]),await _0x36b68e[_0x36846b(0xbb)](_0x5ea4c3[_0x36846b(0x152)]),_0x4dc3f6[_0x36846b(0x146)](_0x5ea4c3['state'],JSON[_0x36846b(0x8f)]({'manifestVersion':_0x1b3cb0,'algorithm':_0x36846b(0x109),'dims':_0x3d75a1,'metric':_0xeeb71a[_0x36846b(0x92)],'clock':_0x920efd,'snapshotAt':Date[_0x36846b(0xd8)]()},null,0x2));},{'keep':_0xeeb71a['keepSnapshots']});return _0x46e2d2=Date[_0x2bbee8(0xd8)]()-_0x210209,_0x2a7283?.[_0x2bbee8(0xb7)]&&(_0x39d1d0=0x0,_0x493718()),_0x2a7283?.['published']??![];}function _0x2679cb(){const _0x5df766=_0x26a76a;_0x39d1d0++;if(_0x39d1d0>=_0xeeb71a[_0x5df766(0xaa)])return _0x300e23();return _0x49b1a1(),null;}async function _0x459b25(){const _0x304250=_0x26a76a,_0x1ba6b0=_0x21b4b0[_0x304250(0x12a)]()||_0x21b4b0[_0x304250(0x128)]();if(!_0x1ba6b0)return null;let _0x5c5c1d,_0x21e458=![];try{await _0x21b4b0[_0x304250(0xb4)](_0x1ba6b0,async _0x44259e=>{const _0x1da3de=_0x304250;_0x5c5c1d=JSON[_0x1da3de(0x11e)](_0x4dc3f6[_0x1da3de(0x118)](_0x44259e[_0x1da3de(0x159)],_0x1da3de(0x14a)));if(_0x5c5c1d['manifestVersion']!==_0x1b3cb0||_0x5c5c1d['algorithm']!==_0x1da3de(0x109)||_0x5c5c1d[_0x1da3de(0x14e)]!==_0x3d75a1||_0x5c5c1d[_0x1da3de(0x92)]!==_0xeeb71a[_0x1da3de(0x92)]){_0x5c5c1d=null;return;}const _0x5a8f36=new _0x400c79();await _0x5a8f36[_0x1da3de(0x160)](_0x44259e[_0x1da3de(0x152)]);const _0x15c4db=_0x3d27f6();_0x15c4db[_0x1da3de(0xac)](_0x44259e[_0x1da3de(0x12f)]),_0x36b68e=_0x5a8f36,_0x57c625=_0x15c4db,_0x21e458=!![];});}catch{return null;}return _0x21e458?_0x5c5c1d?.['clock']??0x0:null;}async function _0x3fb210(_0x46cb02){const _0x45da4c=_0x26a76a;_0x10bc10=null;const _0x3c0ac6=await _0x459b25();if(_0x3c0ac6!=null){_0x39d1d0=0x0;if(_0x46cb02){if(!_0x36b68e['hasFingerprints'])return _0x56ebff(_0x46cb02),await _0x300e23(),null;const _0x458568=_0x1266f3(_0x36b68e,_0x46cb02,_0x3d75a1,{'upsert':_0x8aa389,'remove':_0x478721}),_0x20a1dd=_0x458568[_0x45da4c(0x112)]+_0x458568[_0x45da4c(0x110)]+_0x458568[_0x45da4c(0xec)];_0x20a1dd>0x0&&(_0x39d1d0+=_0x20a1dd,await _0x300e23());}return _0x3c0ac6;}_0x56ebff(_0x46cb02??[]);if(_0x57c625['size']()>0x0)await _0x300e23();return null;}async function _0x1755b2(){_0x2341a0=!![],await _0x3fb210(await _0x16b8b2());}async function _0x4cd5ae(){const _0x182b44=_0x26a76a;if(!_0x2341a0)return;_0x2341a0=![],_0x493718(),_0x39d1d0=0x0;const _0x23148b=_0x21b4b0[_0x182b44(0x12a)]()||_0x21b4b0['latestSnapshotId']();await _0x1a0240(_0x23148b),_0x2e4854();}async function _0x1a0240(_0x3e4306){const _0x18d2e1=_0x26a76a;if(!_0x3e4306)return![];let _0x1b68f1=![];try{await _0x21b4b0[_0x18d2e1(0xb4)](_0x3e4306,async _0x245c9d=>{const _0x4562db=_0x18d2e1,_0x52988d=JSON[_0x4562db(0x11e)](_0x4dc3f6['readFileSync'](_0x245c9d[_0x4562db(0x159)],_0x4562db(0x14a)));if(_0x52988d['manifestVersion']!==_0x1b3cb0||_0x52988d[_0x4562db(0x10f)]!==_0x4562db(0x109)||_0x52988d[_0x4562db(0x14e)]!==_0x3d75a1||_0x52988d[_0x4562db(0x92)]!==_0xeeb71a[_0x4562db(0x92)])return;const _0x4dbf89=new _0x400c79();await _0x4dbf89[_0x4562db(0x160)](_0x245c9d['labels']);const _0x5965be=_0x3d27f6();_0x5965be['view'](_0x245c9d['index']),_0x57c625=_0x5965be,_0x36b68e=_0x4dbf89,_0x10bc10=_0x3e4306,_0x1b68f1=!![];});}catch{}return _0x1b68f1;}function _0xf850ac(){const _0x19f9d9=_0x26a76a,_0x80a8f2=Date[_0x19f9d9(0xd8)]();if(_0x80a8f2-_0x3b619c<_0xeeb71a[_0x19f9d9(0xc1)])return;_0x3b619c=_0x80a8f2;if(_0x493ea4)return;if(_0xb43eae['isFree']()){_0x493ea4=!![],_0x5ced85(async()=>{const _0x2c22ff=_0x19f9d9;!_0x2341a0&&_0x2a1474&&_0xb43eae[_0x2c22ff(0x15d)]()&&(await _0x1755b2(),_0x2e4854());})['catch'](()=>{})[_0x19f9d9(0x157)](()=>{_0x493ea4=![];});return;}const _0x156fa7=_0x21b4b0[_0x19f9d9(0x12a)]()||_0x21b4b0['latestSnapshotId']();if(!_0x156fa7||_0x156fa7===_0x10bc10)return;_0x493ea4=!![],_0x5ced85(async()=>{if(!_0x2341a0&&await _0x1a0240(_0x156fa7))_0x2e4854();})['catch'](()=>{})['finally'](()=>{_0x493ea4=![];});}return{async 'load'(_0x38b6ae){return _0x5ced85(async()=>{const _0x515927=_0x3d0f;_0x21b4b0['cleanupTmpDirs']({'maxAgeMs':_0xeeb71a['tmpMaxAgeMs']}),_0x2f3097=_0x38b6ae??null,_0x2341a0=_0xb43eae['acquire']();let _0x45cfb4=null;if(_0x2341a0)_0x45cfb4=await _0x3fb210(_0x38b6ae?await _0x38b6ae():null);else{const _0x292f20=_0x21b4b0['readCurrentId']()||_0x21b4b0[_0x515927(0x128)]();await _0x1a0240(_0x292f20);}return _0x2a1474=!![],_0x45cfb4;});},async 'add'(_0x98f0b7,_0x4ce5b6,_0x1eb088){return _0x5ced85(async()=>{const _0x566740=_0x3d0f;if(!_0x2a1474)return;const _0x109998=_0x293701(_0x4ce5b6);if(!_0x2341a0){if(!_0xb43eae[_0x566740(0x15d)]())return;await _0x1755b2();}if(!_0x57c625)return;const _0x4309d7=_0x4e79c7(_0x109998);if(_0x36b68e[_0x566740(0x132)](_0x98f0b7)===_0x4309d7)return;_0x8aa389(_0x98f0b7,_0x109998,_0x4309d7),await _0x2679cb();});},async 'remove'(_0x2f15fc){return _0x5ced85(async()=>{const _0x255b80=_0x3d0f;if(!_0x2a1474)return;if(!_0x2341a0){if(!_0xb43eae[_0x255b80(0x15d)]())return;await _0x1755b2();}if(!_0x57c625)return;if(_0x478721(_0x2f15fc))await _0x2679cb();});},'search'(_0x277784,{limit:limit=0xa}={}){const _0x5c57e1=_0x26a76a;if(!_0x2341a0&&_0x2a1474)_0xf850ac();if(!_0x57c625)return[];const _0x109682=_0x57c625[_0x5c57e1(0x95)]();if(_0x109682===0x0)return[];const _0x3bdbcb=Math['min'](limit,_0x109682),_0x5c97a6=_0x57c625[_0x5c57e1(0x94)](_0x293701(_0x277784),_0x3bdbcb,0x0),_0x543b65=[],_0x6fcce8=_0x5c97a6[_0x5c57e1(0x140)],_0x14ced3=_0x5c97a6[_0x5c57e1(0x101)];for(let _0x234952=0x0;_0x234952<_0x6fcce8[_0x5c57e1(0xc6)];_0x234952++){const _0x4aafa3=_0x6fcce8[_0x234952];if(_0x4aafa3===0xffffffffffffffffn)continue;const _0x593c95=Number(_0x4aafa3),_0x492f0b=_0x36b68e[_0x5c57e1(0x11c)](_0x593c95);if(!_0x492f0b)continue;const _0x376456=_0x14ced3[_0x234952];let _0x146668;if(_0xeeb71a[_0x5c57e1(0x92)]==='cosine')_0x146668=Math[_0x5c57e1(0x9b)](0x0,0x1-_0x376456);else{if(_0xeeb71a[_0x5c57e1(0x92)]==='ip')_0x146668=-_0x376456;else _0x146668=0x1/(0x1+_0x376456);}_0x543b65[_0x5c57e1(0x11b)]({'key':_0x492f0b,'score':_0x146668});}return _0x543b65;},async 'snapshot'(_0x5219ea){return _0x5ced85(()=>_0x2341a0?_0x300e23(_0x5219ea??undefined):![]);},async 'rebuild'(_0x3ef5e6){return _0x5ced85(async()=>{const _0xeaa06a=_0x3d0f;if(_0x3ef5e6!=null)_0x2f3097=_0x3ef5e6;if(!_0x2341a0){if(!_0xb43eae[_0xeaa06a(0x15d)]())return;_0x2341a0=!![];}const _0x25370b=_0x3ef5e6?await _0x3ef5e6():await _0x16b8b2();_0x56ebff(_0x25370b??[]),_0x2a1474=!![],await _0x300e23();});},async 'stop'(){return _0x5ced85(async()=>{const _0x1b7f4d=_0x3d0f;_0x493718();if(_0x2341a0){if(_0x39d1d0>0x0||!_0x21b4b0[_0x1b7f4d(0x12a)]())await _0x300e23();_0xb43eae[_0x1b7f4d(0xb3)]();}_0x2341a0=![],_0x2a1474=![];});},'count'(){return _0x36b68e['size']();},'info'(){const _0x543c5c=_0x26a76a;return{'algorithm':_0x543c5c(0x109),'role':_0x2341a0?_0x543c5c(0xd5):'reader','metric':_0xeeb71a[_0x543c5c(0x92)],'connectivity':_0xeeb71a[_0x543c5c(0xd1)],'expansionAdd':_0xeeb71a[_0x543c5c(0x141)],'expansionSearch':_0xeeb71a[_0x543c5c(0xee)],'snapshotEveryChanges':_0xeeb71a[_0x543c5c(0xaa)],'snapshotMaxLagMs':_0xeeb71a['snapshotMaxLagMs'],'count':_0x36b68e['size'](),'size':_0x57c625?.[_0x543c5c(0x95)]?.()??0x0,'capacity':_0x57c625?.[_0x543c5c(0xc2)]?.()??0x0,'changesSince':_0x2341a0?_0x39d1d0:null,'viewedSnapshot':_0x10bc10??null,'snapshotDir':_0x3c72cb,'latestSnapshot':_0x21b4b0[_0x543c5c(0x12a)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x1e55f8=_0xa33854;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x4871d4,workerData:_0x655cb0}=require$$0$1,{algorithmName:_0x171d36,algorithmConfig:_0x2b8386,dims:_0x41c4f3,dir:_0xcffcf8}=_0x655cb0;let _0x1de107=0x1;const _0x3dad0b=new Map();function _0x42bd3f(){const _0x181a28=_0x1de107++;return new Promise((_0x11a06b,_0x59f49d)=>{const _0x5251a3=_0x3d0f;_0x3dad0b[_0x5251a3(0xf7)](_0x181a28,{'resolve':_0x11a06b,'reject':_0x59f49d}),_0x4871d4['postMessage']({'op':_0x5251a3(0xfd),'fid':_0x181a28});});}const _0x24f9a4={'dims':_0x41c4f3,'dir':_0xcffcf8,'fetchAll':_0x42bd3f,'onChange':()=>_0x3623f6()};let _0x341376;if(_0x171d36===_0x1e55f8(0x117))_0x341376=requireHnsw()(_0x2b8386,_0x24f9a4);else{if(_0x171d36===_0x1e55f8(0xf3))_0x341376=requireFlat()(_0x2b8386,_0x24f9a4);else{if(_0x171d36===_0x1e55f8(0x109))_0x341376=requireUsearch()(_0x2b8386,_0x24f9a4);else throw new Error(_0x1e55f8(0xea)+_0x171d36+'\x22');}}function _0x3623f6(){const _0x140c55=_0x1e55f8;try{_0x4871d4[_0x140c55(0xff)]({'op':_0x140c55(0xcb),'count':_0x341376['count'](),'info':_0x341376['info'](),'memory':process[_0x140c55(0xaf)]()});}catch{}}function _0x32cdb1(_0xe74f7c){const _0x5efe43=_0x1e55f8;return(_0xe74f7c||[])['map'](_0x224f3f=>({'key':_0x224f3f[_0x5efe43(0xdd)],'vector':_0x224f3f['vector']instanceof Float32Array?_0x224f3f[_0x5efe43(0xb6)]:new Float32Array(_0x224f3f[_0x5efe43(0xb6)])}));}return _0x4871d4['on'](_0x1e55f8(0x97),async _0x2390dd=>{const _0x4ff493=_0x1e55f8;if(_0x2390dd['op']===_0x4ff493(0x99)){const _0x1a7abc=_0x3dad0b[_0x4ff493(0x10a)](_0x2390dd['fid']);if(!_0x1a7abc)return;_0x3dad0b[_0x4ff493(0x13d)](_0x2390dd[_0x4ff493(0x15c)]);if(_0x2390dd[_0x4ff493(0xc7)])_0x1a7abc['reject'](new Error(_0x2390dd['error']));else _0x1a7abc[_0x4ff493(0xbe)](_0x32cdb1(_0x2390dd[_0x4ff493(0xf6)]));return;}const {id:_0x3c221d,op:_0x1645ba,args:_0x306bd4}=_0x2390dd;try{let _0x283d75;switch(_0x1645ba){case'load':{_0x283d75=await _0x341376['load'](_0x306bd4[_0x4ff493(0x151)]?_0x42bd3f:null),_0x3623f6();break;}case'add':{const _0xf865e8=_0x306bd4[_0x4ff493(0xb6)]instanceof Float32Array?_0x306bd4[_0x4ff493(0xb6)]:new Float32Array(_0x306bd4[_0x4ff493(0xb6)]);await _0x341376['add'](_0x306bd4[_0x4ff493(0xdd)],_0xf865e8,_0x306bd4[_0x4ff493(0x90)]??undefined),_0x3623f6(),_0x283d75=null;break;}case'remove':{await _0x341376[_0x4ff493(0x131)](_0x306bd4[_0x4ff493(0xdd)]),_0x3623f6(),_0x283d75=null;break;}case _0x4ff493(0x94):{const _0x5395f3=_0x306bd4[_0x4ff493(0xc0)]instanceof Float32Array?_0x306bd4[_0x4ff493(0xc0)]:new Float32Array(_0x306bd4[_0x4ff493(0xc0)]);_0x283d75=_0x341376[_0x4ff493(0x94)](_0x5395f3,_0x306bd4['opts']||{});break;}case _0x4ff493(0x15b):{_0x283d75=await _0x341376[_0x4ff493(0x15b)](_0x306bd4['clock']),_0x3623f6();break;}case _0x4ff493(0xdf):{const _0x51c5fb=_0x32cdb1(_0x306bd4['vectors']);await _0x341376[_0x4ff493(0xdf)](async()=>_0x51c5fb),_0x3623f6(),_0x283d75=null;break;}case _0x4ff493(0xe1):{await _0x341376['stop'](),_0x3623f6(),_0x283d75=null;break;}case _0x4ff493(0x104):{_0x283d75=_0x341376[_0x4ff493(0x104)]();break;}case _0x4ff493(0xba):{_0x283d75=_0x341376[_0x4ff493(0xba)]();break;}default:throw new Error(_0x4ff493(0x166)+_0x1645ba+'\x22');}_0x4871d4[_0x4ff493(0xff)]({'id':_0x3c221d,'result':_0x283d75});}catch(_0x1b8757){_0x4871d4['postMessage']({'id':_0x3c221d,'error':{'message':_0x1b8757?.[_0x4ff493(0x97)]||String(_0x1b8757),'code':_0x1b8757?.[_0x4ff493(0x102)]}});}}),_0x4871d4[_0x1e55f8(0xff)]({'op':_0x1e55f8(0x161)}),algorithmWorkerThread$1;}function _0x3d0f(_0x1b75eb,_0x49f2ba){_0x1b75eb=_0x1b75eb-0x8b;const _0x29d71f=_0x29d7();let _0x3d0f6e=_0x29d71f[_0x1b75eb];return _0x3d0f6e;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0xa33854(0xfa)]=algorithmWorkerThread;
|