@kedem/okdb 2.6.0 → 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 +18 -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/public/vendor/okjs/ok.esm.min.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-chart.ok.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-doc-viewer.ok.js +1 -1
- package/public/vendor/okjs/toolkit/components/ok-monaco.ok.js +1 -1
- package/public/vendor/okjs/toolkit/core/virtualized.ok.js +1 -1
- package/public/vendor/okjs/toolkit/editor/ok-live-shell.ok.js +1 -1
- package/public/vendor/okjs/toolkit/elements/ok-select.ok.js +1 -1
- package/public/vendor/okjs/toolkit/elements/ok-table.ok.js +1 -1
- package/types/features/queue.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ 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
|
+
|
|
17
|
+
## [2.6.1] - 2026-09-28
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Depends on `@kedem/okjs` `^1.4.0` (was `~1.3.3`, which kept okdb on okjs 1.3.x). okjs 1.4.0 calls a
|
|
22
|
+
function-valued attr `default` once per instance; the admin has no callback defaults, so nothing
|
|
23
|
+
else changes. The `^` range follows future okjs 1.x minors.
|
|
24
|
+
|
|
7
25
|
## [2.6.0] - 2026-09-28
|
|
8
26
|
|
|
9
27
|
### Changed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x411a8a=_0x3360;(function(_0x5d24de,_0x2e375b){const _0x43bc65=_0x3360,_0x51d1cc=_0x5d24de();while(!![]){try{const _0x505d6d=-parseInt(_0x43bc65(0x15b))/0x1+parseInt(_0x43bc65(0x1e1))/0x2+-parseInt(_0x43bc65(0x1c9))/0x3*(parseInt(_0x43bc65(0x174))/0x4)+-parseInt(_0x43bc65(0x18d))/0x5+-parseInt(_0x43bc65(0x14c))/0x6*(parseInt(_0x43bc65(0x204))/0x7)+parseInt(_0x43bc65(0x179))/0x8*(-parseInt(_0x43bc65(0x210))/0x9)+-parseInt(_0x43bc65(0x19f))/0xa*(-parseInt(_0x43bc65(0x1f2))/0xb);if(_0x505d6d===_0x2e375b)break;else _0x51d1cc['push'](_0x51d1cc['shift']());}catch(_0x148a38){_0x51d1cc['push'](_0x51d1cc['shift']());}}}(_0xf898,0x3f4c9));var require$$0$1=require(_0x411a8a(0x206)),require$$0=require('fs'),require$$1=require(_0x411a8a(0x13a)),require$$2=require('os'),require$$3=require('crypto');function getDefaultExportFromCjs(_0xb9f058){const _0x26fe23=_0x411a8a;return _0xb9f058&&_0xb9f058['__esModule']&&Object[_0x26fe23(0x155)][_0x26fe23(0x140)]['call'](_0xb9f058,_0x26fe23(0x144))?_0xb9f058['default']:_0xb9f058;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x3f9bb8=_0x411a8a;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x4c53a2=require$$0,_0x4be99c=require$$1,_0x47663e=require$$2,_0x5b3eef=require$$3;function _0x314cff(){const _0x3a921a=_0x3360;return Date[_0x3a921a(0x1d3)]();}function _0x1c7671(_0x5dd966){const _0x1406fd=_0x3360;try{return _0x4c53a2[_0x1406fd(0x16f)](_0x5dd966);}catch{return![];}}function _0x227608(_0xaff088){const _0x5b4627=_0x3360;try{return _0x4c53a2['readFileSync'](_0xaff088,_0x5b4627(0x1d1));}catch{return null;}}function _0x2b7fea(_0x7ee79a,_0x433d43){const _0x3d1615=_0x3360,_0x4d408b=_0x7ee79a+_0x3d1615(0x167)+_0x5b3eef[_0x3d1615(0x156)](0x6)[_0x3d1615(0x177)]('hex');_0x4c53a2['writeFileSync'](_0x4d408b,_0x433d43),_0x4c53a2['renameSync'](_0x4d408b,_0x7ee79a);}function _0x23a340(_0x58b888,_0x311861=0x10){const _0xdb6f3f=_0x3360,_0x54deaf=String(Math[_0xdb6f3f(0x1fd)](0x0,Math[_0xdb6f3f(0x190)](_0x58b888||0x0)));return _0x54deaf[_0xdb6f3f(0x13e)]>=_0x311861?_0x54deaf:'0'[_0xdb6f3f(0x1c5)](_0x311861-_0x54deaf[_0xdb6f3f(0x13e)])+_0x54deaf;}return snapshotStore=class _0x98bed1{constructor({dir:_0x25d246,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x56c459=_0x3360;if(!_0x25d246)throw new Error(_0x56c459(0x152));this[_0x56c459(0x1b2)]=_0x25d246,this[_0x56c459(0x1b6)]=_0x4be99c['join'](_0x25d246,_0x56c459(0x203)),this['currentPath']=_0x4be99c[_0x56c459(0x1fc)](_0x25d246,'CURRENT'),this[_0x56c459(0x176)]=_0x4be99c['join'](_0x25d246,'SNAPSHOT.LOCK'),this[_0x56c459(0x1b1)]=keepSnapshots,this['log']=log,_0x4c53a2['mkdirSync'](this['dir'],{'recursive':!![]}),_0x4c53a2['mkdirSync'](this[_0x56c459(0x1b6)],{'recursive':!![]});}[_0x3f9bb8(0x146)](_0x3c7e59){const _0x3bf1d5=_0x3f9bb8;return _0x4be99c[_0x3bf1d5(0x1fc)](this[_0x3bf1d5(0x1b6)],_0x3c7e59);}[_0x3f9bb8(0x185)](_0x2ec8a0){const _0x44f4f7=_0x3f9bb8,_0x225a9f=this[_0x44f4f7(0x146)](_0x2ec8a0);return{'dir':_0x225a9f,'index':_0x4be99c[_0x44f4f7(0x1fc)](_0x225a9f,_0x44f4f7(0x19c)),'labels':_0x4be99c[_0x44f4f7(0x1fc)](_0x225a9f,_0x44f4f7(0x18f)),'state':_0x4be99c[_0x44f4f7(0x1fc)](_0x225a9f,_0x44f4f7(0x195))};}[_0x3f9bb8(0x169)](){const _0x11ffd1=_0x3f9bb8;if(!_0x1c7671(this['currentPath']))return null;const _0x2dce65=_0x227608(this['currentPath']);if(!_0x2dce65)return null;const _0x34a23a=String(_0x2dce65)[_0x11ffd1(0x172)]();return _0x34a23a||null;}[_0x3f9bb8(0x1f7)](){const _0x2be7df=_0x3f9bb8,_0x401c68=this[_0x2be7df(0x169)]();if(!_0x401c68)return 0x0;const _0x324b01=Number(_0x401c68);return Number[_0x2be7df(0x137)](_0x324b01)?_0x324b01:0x0;}[_0x3f9bb8(0x1f0)](){const _0x26b299=_0x3f9bb8;try{return _0x4c53a2['readdirSync'](this['snapshotsDir'],{'withFileTypes':!![]})[_0x26b299(0x1bd)](_0x352391=>_0x352391[_0x26b299(0x1b7)]())['map'](_0xc97598=>_0xc97598[_0x26b299(0x187)])[_0x26b299(0x1bd)](_0x6b8892=>!_0x6b8892[_0x26b299(0x20d)](_0x26b299(0x167)))[_0x26b299(0x1bd)](_0x4958b5=>!_0x4958b5[_0x26b299(0x20d)]('_tmp-'))[_0x26b299(0x1e8)]();}catch{return[];}}['latestSnapshotId'](){const _0x2b45d6=_0x3f9bb8,_0x68c4c1=this[_0x2b45d6(0x169)]();if(_0x68c4c1)return _0x68c4c1;const _0x28ea46=this['listSnapshotIds']();if(!_0x28ea46[_0x2b45d6(0x13e)])return null;return _0x28ea46[_0x28ea46[_0x2b45d6(0x13e)]-0x1];}[_0x3f9bb8(0x18a)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x26d7e2=_0x3f9bb8;let _0x5b952b;try{_0x5b952b=_0x4c53a2[_0x26d7e2(0x178)](this['snapshotsDir'],{'withFileTypes':!![]});}catch{return;}const _0x5dcf2b=_0x314cff()-maxAgeMs;for(const _0x20107d of _0x5b952b){if(!_0x20107d[_0x26d7e2(0x1b7)]())continue;const _0x15f42e=_0x20107d['name'];if(!_0x15f42e[_0x26d7e2(0x20d)](_0x26d7e2(0x167))&&!_0x15f42e['startsWith']('_tmp-'))continue;const _0xec5ba0=_0x4be99c['join'](this[_0x26d7e2(0x1b6)],_0x15f42e);try{const _0xee369e=_0x4c53a2[_0x26d7e2(0x1d6)](_0xec5ba0);if(_0xee369e[_0x26d7e2(0x188)]>_0x5dcf2b)continue;}catch{}try{_0x4c53a2[_0x26d7e2(0x19a)](_0xec5ba0,{'recursive':!![],'force':!![]});}catch{}}}[_0x3f9bb8(0x19e)]({keep:keep=null}={}){const _0xca7d=_0x3f9bb8,_0x38c5bd=Math[_0xca7d(0x1fd)](0x1,Math[_0xca7d(0x190)](keep??this[_0xca7d(0x1b1)]??0x3)),_0xb78c83=this[_0xca7d(0x1f0)]();if(_0xb78c83[_0xca7d(0x13e)]<=_0x38c5bd)return;const _0x497e83=this[_0xca7d(0x169)](),_0x5dc50e=_0xb78c83['slice'](0x0,Math[_0xca7d(0x1fd)](0x0,_0xb78c83[_0xca7d(0x13e)]-_0x38c5bd));for(const _0x5d284f of _0x5dc50e){if(_0x497e83&&_0x5d284f===_0x497e83)continue;const _0x459e89=this[_0xca7d(0x146)](_0x5d284f);try{_0x4c53a2[_0xca7d(0x19a)](_0x459e89,{'recursive':!![],'force':!![]});}catch{}}}async[_0x3f9bb8(0x196)](_0x4b42d7,_0x1a75b1){const _0x281b5a=_0x3f9bb8;if(!_0x4b42d7)throw new Error('snapshot\x20id\x20required');const _0x2928c2=this[_0x281b5a(0x185)](_0x4b42d7);if(!_0x1c7671(_0x2928c2[_0x281b5a(0x20f)])||!_0x1c7671(_0x2928c2[_0x281b5a(0x1aa)])||!_0x1c7671(_0x2928c2['state']))throw new Error(_0x281b5a(0x139)+_0x4b42d7);const _0x5d10b5=await _0x1a75b1(_0x2928c2);return _0x5d10b5||{};}async[_0x3f9bb8(0x17b)](_0x50b311,_0x2f7e5e,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0xf8598f=_0x3f9bb8,_0x3cfa61=Number(_0x50b311);if(!Number['isFinite'](_0x3cfa61)||_0x3cfa61<0x0)throw new Error('candidateClock\x20must\x20be\x20finite\x20>=\x200');const _0x51bf80=_0x23a340(_0x3cfa61),_0xa056f=this[_0xf8598f(0x146)](_0x51bf80),_0x5db989=_0x4be99c[_0xf8598f(0x1fc)](this[_0xf8598f(0x1b6)],'.tmp-'+_0x51bf80+'-'+_0x5b3eef[_0xf8598f(0x156)](0x6)[_0xf8598f(0x177)](_0xf8598f(0x16e)));_0x4c53a2['mkdirSync'](_0x5db989,{'recursive':!![]});const _0x9f9f37={'dir':_0x5db989,'index':_0x4be99c[_0xf8598f(0x1fc)](_0x5db989,_0xf8598f(0x19c)),'labels':_0x4be99c[_0xf8598f(0x1fc)](_0x5db989,_0xf8598f(0x18f)),'state':_0x4be99c[_0xf8598f(0x1fc)](_0x5db989,_0xf8598f(0x195))};await _0x2f7e5e(_0x9f9f37,{'id':_0x51bf80,'clock':_0x3cfa61});const _0x5d3161=JSON[_0xf8598f(0x1c1)]({'pid':process[_0xf8598f(0x16d)],'host':_0x47663e[_0xf8598f(0x1e2)](),'at':_0x314cff()}),_0x37e36c=_0x314cff();let _0x43f168=null;const _0x393aa4=()=>{const _0x236cd9=_0xf8598f;try{const _0x4640ce=JSON[_0x236cd9(0x1a5)](_0x4c53a2[_0x236cd9(0x15a)](this[_0x236cd9(0x176)],_0x236cd9(0x1d1)));if(_0x4640ce['at']&&_0x314cff()-_0x4640ce['at']>staleLockMaxAgeMs){const _0x8603cd=_0x314cff()-_0x4640ce['at'],_0xa5adc2=_0x236cd9(0x1ca)+Math[_0x236cd9(0x1df)](_0x8603cd/0x3e8)+'s,\x20pid:\x20'+_0x4640ce[_0x236cd9(0x16d)]+',\x20host:\x20'+_0x4640ce[_0x236cd9(0x1b9)]+_0x236cd9(0x183)+_0x236cd9(0x197);this[_0x236cd9(0x200)]?.['warn']?this[_0x236cd9(0x200)][_0x236cd9(0x15c)](_0xa5adc2):console[_0x236cd9(0x15c)](_0x236cd9(0x1f1),_0xa5adc2);try{_0x4c53a2[_0x236cd9(0x211)](this[_0x236cd9(0x176)]);}catch{}return!![];}}catch{try{_0x4c53a2[_0x236cd9(0x211)](this['lockPath']);}catch{}}return![];},_0x5a7777=()=>{const _0x3bae38=_0xf8598f;try{return _0x43f168=_0x4c53a2[_0x3bae38(0x205)](this[_0x3bae38(0x176)],'wx'),_0x4c53a2[_0x3bae38(0x1a2)](_0x43f168,_0x5d3161),!![];}catch(_0xa4407b){if(_0xa4407b&&_0xa4407b[_0x3bae38(0x1a8)]===_0x3bae38(0x173))return![];throw _0xa4407b;}};if(!_0x5a7777()){_0x393aa4(),_0x5a7777();if(_0x43f168==null&&lockTimeoutMs>0x0)while(_0x314cff()-_0x37e36c<lockTimeoutMs){await new Promise(_0xd326bb=>setTimeout(_0xd326bb,0x19));if(_0x5a7777())break;_0x393aa4();}}if(_0x43f168==null){try{_0x4c53a2[_0xf8598f(0x19a)](_0x5db989,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0xf8598f(0x1a6)};}try{const _0x39d4e8=this['readCurrentClock']();if(_0x3cfa61<=_0x39d4e8){try{_0x4c53a2['rmSync'](_0x5db989,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0xf8598f(0x16b),'currentClock':_0x39d4e8};}if(!_0x1c7671(_0xa056f))_0x4c53a2['renameSync'](_0x5db989,_0xa056f);else try{_0x4c53a2[_0xf8598f(0x19a)](_0x5db989,{'recursive':!![],'force':!![]});}catch{}return _0x2b7fea(this[_0xf8598f(0x1a0)],_0x51bf80+'\x0a'),this[_0xf8598f(0x19e)]({'keep':keep}),{'published':!![],'currentClock':_0x3cfa61};}finally{try{_0x4c53a2[_0xf8598f(0x1c6)](_0x43f168);}catch{}try{_0x4c53a2['unlinkSync'](this[_0xf8598f(0x176)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x59ee78=_0x411a8a;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x457479=require$$0;class _0x566074{constructor(){const _0x2389ff=_0x3360;this[_0x2389ff(0x1d5)]=new Map(),this[_0x2389ff(0x1c2)]=new Map(),this[_0x2389ff(0x1ce)]=0x0,this[_0x2389ff(0x1ab)]=0x0,this[_0x2389ff(0x208)]=new Map(),this[_0x2389ff(0x1ed)]=!![];}async[_0x59ee78(0x158)](){const _0x1cbafd=_0x59ee78;this['keyToLabel']=new Map(),this['labelToKey']=new Map(),this[_0x1cbafd(0x208)]=new Map(),this[_0x1cbafd(0x1ed)]=!![],this[_0x1cbafd(0x1ce)]=0x0,this[_0x1cbafd(0x1ab)]=0x0;}async[_0x59ee78(0x1bc)](_0x53bca9){const _0x2dc9fd=_0x59ee78;if(!_0x53bca9||!_0x457479[_0x2dc9fd(0x16f)](_0x53bca9))return await this[_0x2dc9fd(0x158)](),!![];let _0x252971;try{_0x252971=_0x457479['readFileSync'](_0x53bca9,_0x2dc9fd(0x1d1));}catch{return await this['reset'](),!![];}let _0x28e232;try{_0x28e232=JSON[_0x2dc9fd(0x1a5)](_0x252971);}catch{return await this[_0x2dc9fd(0x158)](),!![];}const _0x596a25=Array[_0x2dc9fd(0x15e)](_0x28e232?.[_0x2dc9fd(0x1f8)])?_0x28e232[_0x2dc9fd(0x1f8)]:[],_0x4d37ae=Number[_0x2dc9fd(0x1cd)](_0x28e232?.[_0x2dc9fd(0x1ce)])?_0x28e232[_0x2dc9fd(0x1ce)]:0x0,_0x33ba0b=new Map(),_0x5cdb6c=new Map(),_0x1c67ec=new Map(),_0x2e692b=_0x28e232?.[_0x2dc9fd(0x1ff)]>=0x2;let _0x2fb4a1=-0x1;for(const _0x365f9c of _0x596a25){if(!Array['isArray'](_0x365f9c)||_0x365f9c[_0x2dc9fd(0x13e)]<0x2)continue;const _0x3bab59=Number(_0x365f9c[0x0]),_0x35060b=String(_0x365f9c[0x1]??'');if(!Number[_0x2dc9fd(0x1cd)](_0x3bab59)||_0x3bab59<0x0)continue;if(!_0x35060b)continue;_0x33ba0b[_0x2dc9fd(0x192)](_0x35060b,_0x3bab59),_0x5cdb6c[_0x2dc9fd(0x192)](_0x3bab59,_0x35060b);if(_0x2e692b&&typeof _0x365f9c[0x2]===_0x2dc9fd(0x1e5))_0x1c67ec['set'](_0x35060b,_0x365f9c[0x2]);if(_0x3bab59>_0x2fb4a1)_0x2fb4a1=_0x3bab59;}return this[_0x2dc9fd(0x1d5)]=_0x33ba0b,this[_0x2dc9fd(0x1c2)]=_0x5cdb6c,this[_0x2dc9fd(0x208)]=_0x1c67ec,this['hasFingerprints']=_0x2e692b,this[_0x2dc9fd(0x1ce)]=Math[_0x2dc9fd(0x1fd)](_0x4d37ae,_0x2fb4a1+0x1,0x0),this['_tombstoneCount']=0x0,!![];}[_0x59ee78(0x1e7)](_0x3a44d5){const _0x19f545=_0x59ee78;return this[_0x19f545(0x1d5)]['get'](_0x3a44d5);}[_0x59ee78(0x17a)](_0x495a32){const _0x321245=_0x59ee78;let _0x374793=this[_0x321245(0x1d5)][_0x321245(0x1de)](_0x495a32);if(_0x374793!==undefined)return _0x374793;return _0x374793=this[_0x321245(0x1ce)]++,this[_0x321245(0x1d5)][_0x321245(0x192)](_0x495a32,_0x374793),this[_0x321245(0x1c2)][_0x321245(0x192)](_0x374793,_0x495a32),_0x374793;}[_0x59ee78(0x141)](_0x521bd0,_0x43e25a){const _0x3dba14=_0x59ee78;if(_0x43e25a==null)this[_0x3dba14(0x208)][_0x3dba14(0x1fa)](_0x521bd0);else this[_0x3dba14(0x208)]['set'](_0x521bd0,_0x43e25a);}['fingerprintOf'](_0x17d5de){const _0x1e3c66=_0x59ee78;return this['keyToFp'][_0x1e3c66(0x1de)](_0x17d5de);}[_0x59ee78(0x1f6)](){const _0x2b8dfb=_0x59ee78;return this['keyToLabel'][_0x2b8dfb(0x1f6)]();}[_0x59ee78(0x19d)](_0x419344){const _0x521e03=_0x59ee78,_0x40390b=this['keyToLabel'][_0x521e03(0x1de)](_0x419344);if(_0x40390b===undefined)return;this[_0x521e03(0x208)][_0x521e03(0x1fa)](_0x419344),this['keyToLabel'][_0x521e03(0x1fa)](_0x419344),this[_0x521e03(0x1c2)][_0x521e03(0x1fa)](_0x40390b),this[_0x521e03(0x1ab)]++;}[_0x59ee78(0x15f)](_0x4e6d15){const _0xc14b9d=_0x59ee78;return this[_0xc14b9d(0x1c2)][_0xc14b9d(0x1de)](_0x4e6d15)??null;}[_0x59ee78(0x1d7)](){const _0x1fa7cf=_0x59ee78;return this[_0x1fa7cf(0x1d5)][_0x1fa7cf(0x1d7)];}[_0x59ee78(0x1ba)](){const _0x418319=_0x59ee78;return this[_0x418319(0x1ab)];}async[_0x59ee78(0x1d9)](_0xb8a06f){const _0x29e7bb=_0x59ee78,_0x1fcb26=_0xb8a06f+_0x29e7bb(0x14e),_0x26edd2=[];for(const [_0x4efbe0,_0x2368d4]of this['labelToKey'][_0x29e7bb(0x1f8)]()){const _0x2beef3=this[_0x29e7bb(0x208)][_0x29e7bb(0x1de)](_0x2368d4);_0x26edd2[_0x29e7bb(0x1db)](_0x2beef3==null?[_0x4efbe0,_0x2368d4]:[_0x4efbe0,_0x2368d4,_0x2beef3]);}_0x26edd2[_0x29e7bb(0x1e8)]((_0x32e39d,_0x3934a0)=>_0x32e39d[0x0]-_0x3934a0[0x0]);const _0xdab971={'version':0x2,'nextLabel':this[_0x29e7bb(0x1ce)],'entries':_0x26edd2};_0x457479['writeFileSync'](_0x1fcb26,JSON['stringify'](_0xdab971)),_0x457479['renameSync'](_0x1fcb26,_0xb8a06f);}}return labelMap=_0x566074,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x45875b(_0x19d9e5){const _0x4cdda8=_0x3360,_0x4bd3c3=new Uint32Array(_0x19d9e5[_0x4cdda8(0x160)],_0x19d9e5[_0x4cdda8(0x193)],_0x19d9e5[_0x4cdda8(0x13e)]);let _0xb16848=0x811c9dc5,_0x3b7b77=0x9747b28c;for(let _0x255208=0x0;_0x255208<_0x4bd3c3['length'];_0x255208++){const _0xf00792=_0x4bd3c3[_0x255208];_0xb16848=Math[_0x4cdda8(0x1c4)](_0xb16848^_0xf00792,0x1000193)>>>0x0;let _0x32a963=Math['imul'](_0xf00792,0xcc9e2d51);_0x32a963=_0x32a963<<0xf|_0x32a963>>>0x11,_0x3b7b77=Math[_0x4cdda8(0x1c4)](_0x3b7b77^Math[_0x4cdda8(0x1c4)](_0x32a963,0x1b873593),0x5)+0xe6546b64,_0x3b7b77>>>=0x0;}return _0x3b7b77=Math['imul'](_0x3b7b77^_0x3b7b77>>>0x10,0x85ebca6b)>>>0x0,(_0xb16848>>>0x0)*0x100000+(_0x3b7b77&0xfffff);}function _0x1cf236(_0x1ee843,_0x4d7168,_0x2c24c4,{upsert:_0x3866ca,remove:_0x80d818}){const _0x439a2e=_0x3360,_0x461013=new Set();let _0x1201e8=0x0,_0x33a711=0x0,_0x4b6d0f=0x0;for(const {key:_0x3a90fd,vector:_0x336ec7}of _0x4d7168){if(!(_0x336ec7 instanceof Float32Array)||_0x336ec7['length']!==_0x2c24c4)continue;_0x461013[_0x439a2e(0x166)](_0x3a90fd);const _0x5570b7=_0x45875b(_0x336ec7),_0xdcba40=_0x1ee843[_0x439a2e(0x1e7)](_0x3a90fd)!==undefined;if(_0xdcba40&&_0x1ee843[_0x439a2e(0x1d2)](_0x3a90fd)===_0x5570b7)continue;_0x3866ca(_0x3a90fd,_0x336ec7,_0x5570b7);if(_0xdcba40)_0x33a711++;else _0x1201e8++;}for(const _0x149a8d of[..._0x1ee843[_0x439a2e(0x1f6)]()]){if(_0x461013['has'](_0x149a8d))continue;_0x80d818(_0x149a8d),_0x4b6d0f++;}return{'added':_0x1201e8,'changed':_0x33a711,'removed':_0x4b6d0f};}return indexConvergence={'fingerprint':_0x45875b,'reconcileIndex':_0x1cf236},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x54f145=requireSnapshotStore(),_0x485af6=requireLabelMap(),{fingerprint:_0x2de35c,reconcileIndex:_0x5e77f0}=requireIndexConvergence(),_0x2d5043=0x1;let _0x35cf99=null;function _0x417f74(){const _0x4b9297=_0x3360;if(_0x35cf99)return _0x35cf99;try{return _0x35cf99=require(_0x4b9297(0x165)),_0x35cf99;}catch(_0x3984a8){const _0x4c8792=new Error(_0x4b9297(0x207)+('for\x20Node\x20'+process[_0x4b9297(0x154)][_0x4b9297(0x1ef)]+_0x4b9297(0x18b)+process[_0x4b9297(0x171)]+'/'+process[_0x4b9297(0x17f)]+'.\x20')+'Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20'+(_0x4b9297(0x209)+(_0x3984a8?.[_0x4b9297(0x194)]||String(_0x3984a8))));_0x4c8792[_0x4b9297(0x1a8)]=_0x4b9297(0x150),_0x4c8792['cause']=_0x3984a8;throw _0x4c8792;}}return hnsw=function _0x37105b(_0x504cb7={},{dims:_0x234f83,dir:_0x3d57de}){const _0x3e2d51=_0x3360,_0x15eb2f=_0x417f74();if(!_0x234f83||_0x234f83<=0x0)throw new Error(_0x3e2d51(0x191));if(!_0x3d57de)throw new Error(_0x3e2d51(0x16a));const _0x12439f={'metric':_0x504cb7[_0x3e2d51(0x1bb)]??_0x3e2d51(0x164),'M':_0x504cb7['M']??0x10,'efConstruction':_0x504cb7[_0x3e2d51(0x17c)]??0xc8,'efSearch':_0x504cb7[_0x3e2d51(0x189)]??0x40,'maxElements':_0x504cb7[_0x3e2d51(0x199)]??0x400,'growFactor':_0x504cb7[_0x3e2d51(0x1a7)]??0x2,'snapshotEveryChanges':_0x504cb7[_0x3e2d51(0x16c)]??0xc350,'keepSnapshots':_0x504cb7[_0x3e2d51(0x1b1)]??0x2,'tmpMaxAgeMs':_0x504cb7[_0x3e2d51(0x14b)]??0x6*0x36ee80},_0x5af97f=new _0x54f145({'dir':_0x3d57de,'keepSnapshots':_0x12439f[_0x3e2d51(0x1b1)]}),_0x4ae3f8=new _0x485af6();let _0x4d2f6f=null,_0x2aad23=0x0,_0x3f94fe=null,_0x3443fb=Promise[_0x3e2d51(0x15d)]();const _0x29d3ee=_0x4c3d30=>{const _0x1b7dac=_0x3e2d51,_0xca8759=_0x3443fb[_0x1b7dac(0x182)](_0x4c3d30);return _0x3443fb=_0xca8759[_0x1b7dac(0x1e3)](()=>{}),_0xca8759;};async function _0x4aa06a(_0x9c3c31){const _0x3a9bf0=_0x3e2d51;await _0x4ae3f8[_0x3a9bf0(0x158)](),_0x9c3c31=_0x9c3c31??[];const _0x2fbec9=Math[_0x3a9bf0(0x1fd)](_0x12439f[_0x3a9bf0(0x199)],Math[_0x3a9bf0(0x1b4)](_0x9c3c31[_0x3a9bf0(0x13e)]*(_0x12439f[_0x3a9bf0(0x1a7)]||1.2)),0x1);_0x4d2f6f=new _0x15eb2f[(_0x3a9bf0(0x20e))](_0x12439f[_0x3a9bf0(0x1bb)],_0x234f83),_0x4d2f6f[_0x3a9bf0(0x212)]({'maxElements':_0x2fbec9,'efConstruction':_0x12439f[_0x3a9bf0(0x17c)],'M':_0x12439f['M']});for(const {key:_0x614cd7,vector:_0x51b01c}of _0x9c3c31){if(!(_0x51b01c instanceof Float32Array)||_0x51b01c[_0x3a9bf0(0x13e)]!==_0x234f83)continue;_0x48794c(_0x614cd7,_0x51b01c);}_0x4d2f6f['setEf'](_0x12439f[_0x3a9bf0(0x189)]),_0x2aad23=0x0;}async function _0x3b1929(_0x5d2d03){return _0x4aa06a(_0x5d2d03?await _0x5d2d03():[]);}function _0x2fe010(){const _0x3fc628=_0x3e2d51;if(_0x4d2f6f[_0x3fc628(0x1a9)]()<_0x4d2f6f[_0x3fc628(0x201)]())return;const _0x2a1f2b=Math[_0x3fc628(0x1b4)](_0x4d2f6f[_0x3fc628(0x201)]()*(_0x12439f[_0x3fc628(0x1a7)]||0x2));_0x4d2f6f[_0x3fc628(0x175)](_0x2a1f2b),_0x12439f[_0x3fc628(0x199)]=_0x2a1f2b;}function _0x48794c(_0x46eea8,_0x2a2574,_0x45e167){const _0x2311d5=_0x3e2d51,_0x68ac10=_0x4ae3f8['labelForEphemeral'](_0x46eea8);try{_0x4d2f6f[_0x2311d5(0x1ac)](_0x68ac10);}catch{}_0x2fe010(),_0x4d2f6f[_0x2311d5(0x1ae)](Array[_0x2311d5(0x159)](_0x2a2574),_0x68ac10),_0x4ae3f8[_0x2311d5(0x141)](_0x46eea8,_0x45e167??_0x2de35c(_0x2a2574));}function _0x3632c3(_0x589f94){const _0x5b1cac=_0x3e2d51,_0x23ffb7=_0x4ae3f8[_0x5b1cac(0x1e7)](_0x589f94);if(_0x23ffb7===undefined)return![];try{_0x4d2f6f[_0x5b1cac(0x1ac)](_0x23ffb7);}catch{}return _0x4ae3f8[_0x5b1cac(0x19d)](_0x589f94),!![];}function _0x1364c1(){const _0x5ac049=_0x3e2d51;return Math[_0x5ac049(0x1fd)](Date[_0x5ac049(0x1d3)](),_0x5af97f[_0x5ac049(0x1f7)]()+0x1);}async function _0x32caba(_0x1e5788){const _0x2135e3=_0x3e2d51;if(!_0x4d2f6f||!_0x1e5788)return![];const _0x208883=await _0x5af97f[_0x2135e3(0x17b)](_0x1e5788,async _0x1cb882=>{const _0x5a8e65=_0x2135e3;_0x4d2f6f[_0x5a8e65(0x13c)](_0x1cb882['index']),await _0x4ae3f8[_0x5a8e65(0x1d9)](_0x1cb882[_0x5a8e65(0x1aa)]);const _0x445bc5=require$$0;_0x445bc5[_0x5a8e65(0x1a2)](_0x1cb882[_0x5a8e65(0x180)],JSON[_0x5a8e65(0x1c1)]({'manifestVersion':_0x2d5043,'dims':_0x234f83,'metric':_0x12439f[_0x5a8e65(0x1bb)],'clock':_0x1e5788,'snapshotAt':Date[_0x5a8e65(0x1d3)]()},null,0x2));},{'keep':_0x12439f['keepSnapshots']});if(_0x208883?.[_0x2135e3(0x170)])_0x2aad23=0x0;return _0x208883?.[_0x2135e3(0x170)]??![];}async function _0x265c82(){const _0x1efb6b=_0x3e2d51,_0x1e1aa2=_0x5af97f[_0x1efb6b(0x169)]()||_0x5af97f[_0x1efb6b(0x1a1)]();if(!_0x1e1aa2)return null;let _0x1111dc,_0x2e3f84=![];return await _0x5af97f[_0x1efb6b(0x196)](_0x1e1aa2,async _0x1c8968=>{const _0x4f1ec1=_0x1efb6b,_0x56b1ce=require$$0;_0x1111dc=JSON[_0x4f1ec1(0x1a5)](_0x56b1ce['readFileSync'](_0x1c8968[_0x4f1ec1(0x180)],_0x4f1ec1(0x1d1)));if(_0x1111dc[_0x4f1ec1(0x14a)]!==_0x2d5043||_0x1111dc['dims']!==_0x234f83||_0x1111dc[_0x4f1ec1(0x1bb)]!==_0x12439f[_0x4f1ec1(0x1bb)]){_0x1111dc=null;return;}await _0x4ae3f8['loadFrom'](_0x1c8968['labels']),_0x4d2f6f=new _0x15eb2f[(_0x4f1ec1(0x20e))](_0x12439f[_0x4f1ec1(0x1bb)],_0x234f83),_0x4d2f6f[_0x4f1ec1(0x13d)](_0x1c8968[_0x4f1ec1(0x20f)]),_0x4d2f6f[_0x4f1ec1(0x147)](_0x12439f[_0x4f1ec1(0x189)]),_0x2e3f84=!![];}),_0x2e3f84?_0x1111dc?.[_0x1efb6b(0x149)]??0x0:null;}return{async 'load'(_0x384906){return _0x29d3ee(async()=>{const _0x6a0cb2=_0x3360;_0x5af97f[_0x6a0cb2(0x18a)]({'maxAgeMs':_0x12439f[_0x6a0cb2(0x14b)]}),_0x3f94fe=_0x384906??null;const _0x129666=await _0x265c82(),_0x10e57d=_0x384906?await _0x384906():null;if(_0x129666!=null){if(_0x10e57d){if(!_0x4ae3f8[_0x6a0cb2(0x1ed)])return await _0x4aa06a(_0x10e57d),null;const _0x3318f3=_0x5e77f0(_0x4ae3f8,_0x10e57d,_0x234f83,{'upsert':_0x48794c,'remove':_0x3632c3});_0x2aad23+=_0x3318f3['added']+_0x3318f3[_0x6a0cb2(0x18c)]+_0x3318f3[_0x6a0cb2(0x1e4)];}return _0x129666;}return await _0x4aa06a(_0x10e57d),null;});},async 'add'(_0x3bb990,_0x35ba64,_0x465b42){return _0x29d3ee(async()=>{const _0x543a82=_0x3360;if(!_0x4d2f6f)return;const _0x426abf=_0x35ba64 instanceof Float32Array?_0x35ba64:new Float32Array(_0x35ba64),_0x127152=_0x2de35c(_0x426abf);if(_0x4ae3f8[_0x543a82(0x1d2)](_0x3bb990)===_0x127152)return;_0x48794c(_0x3bb990,_0x426abf,_0x127152),_0x2aad23++,_0x2aad23>=_0x12439f[_0x543a82(0x16c)]&&await _0x32caba(_0x1364c1());});},async 'remove'(_0x3f5987){return _0x29d3ee(async()=>{if(!_0x4d2f6f)return;if(_0x3632c3(_0x3f5987))_0x2aad23++;});},'search'(_0x2490d1,{limit:limit=0xa,efSearch:_0x1f1d12}={}){const _0x1c0788=_0x3e2d51;if(!_0x4d2f6f)return[];if(Number[_0x1c0788(0x1cd)](_0x1f1d12))_0x4d2f6f[_0x1c0788(0x147)](_0x1f1d12);const _0x5dd90f=Math[_0x1c0788(0x1be)](limit,_0x4d2f6f[_0x1c0788(0x1a9)]()||0x1),{neighbors:_0x59af5c,distances:_0x117a06}=_0x4d2f6f['searchKnn'](Array['from'](_0x2490d1),_0x5dd90f),_0x2c6a55=[];for(let _0x1d2947=0x0;_0x1d2947<_0x59af5c['length'];_0x1d2947++){const _0x1e228e=_0x4ae3f8['keyForLabel'](_0x59af5c[_0x1d2947]);if(!_0x1e228e)continue;const _0x2f27a4=_0x12439f[_0x1c0788(0x1bb)]==='cosine'?Math[_0x1c0788(0x1fd)](0x0,0x1-_0x117a06[_0x1d2947]):0x1/(0x1+_0x117a06[_0x1d2947]);_0x2c6a55[_0x1c0788(0x1db)]({'key':_0x1e228e,'score':_0x2f27a4});}return _0x2c6a55;},async 'snapshot'(_0x535015){return _0x29d3ee(()=>_0x32caba(_0x535015??_0x1364c1()));},async 'rebuild'(_0x2216aa){return _0x29d3ee(()=>{if(_0x2216aa!=null)_0x3f94fe=_0x2216aa;return _0x3b1929(_0x2216aa??_0x3f94fe);});},async 'stop'(){return _0x29d3ee(()=>_0x2aad23>0x0||!_0x5af97f['readCurrentId']()?_0x32caba(_0x1364c1()):![]);},'count'(){const _0x183791=_0x3e2d51;return _0x4ae3f8[_0x183791(0x1d7)]();},'info'(){const _0x1c1c62=_0x3e2d51;return{'algorithm':_0x1c1c62(0x161),'metric':_0x12439f['metric'],'M':_0x12439f['M'],'efConstruction':_0x12439f[_0x1c1c62(0x17c)],'efSearch':_0x12439f['efSearch'],'maxElements':_0x4d2f6f?.[_0x1c1c62(0x201)]()??_0x12439f[_0x1c1c62(0x199)],'count':_0x4ae3f8[_0x1c1c62(0x1d7)](),'changesSince':_0x2aad23,'snapshotDir':_0x3d57de,'latestSnapshot':_0x5af97f[_0x1c1c62(0x169)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x513a18(_0x4ef6b0={}){const _0x52a722=new Map();return{async 'load'(_0x508d61){const _0x10f2e4=_0x3360;_0x52a722[_0x10f2e4(0x1f4)]();if(_0x508d61)for(const {key:_0x1b8429,vector:_0x2bc3d9}of await _0x508d61()){_0x52a722[_0x10f2e4(0x192)](_0x1b8429,_0x2bc3d9);}},async 'add'(_0x3bb4f9,_0xd25fee,_0x15f88b){_0x52a722['set'](_0x3bb4f9,_0xd25fee);},async 'remove'(_0x429e2a){const _0x3a979f=_0x3360;_0x52a722[_0x3a979f(0x1fa)](_0x429e2a);},'search'(_0x3e9127,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x2c3f6d=_0x3360,_0x32b0a0=[];for(const [_0x20ea7d,_0x2b0218]of _0x52a722){const _0x4ace62=_0x3b3f81(_0x3e9127,_0x2b0218);if(_0x4ace62>=threshold)_0x32b0a0[_0x2c3f6d(0x1db)]({'key':_0x20ea7d,'score':_0x4ace62});}return _0x32b0a0[_0x2c3f6d(0x1e8)]((_0x5a390e,_0x413499)=>_0x413499[_0x2c3f6d(0x1b0)]-_0x5a390e[_0x2c3f6d(0x1b0)]),_0x32b0a0[_0x2c3f6d(0x184)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x5b6a08){await this['load'](_0x5b6a08);},async 'stop'(){},'count'(){const _0x4fa636=_0x3360;return _0x52a722[_0x4fa636(0x1d7)];},'info'(){const _0x326fb5=_0x3360;return{'algorithm':'flat','count':_0x52a722[_0x326fb5(0x1d7)]};}};};function _0x3b3f81(_0xc33ad6,_0x32c139){const _0x4074d3=_0x3360;let _0x4fe58f=0x0,_0x57ba46=0x0,_0x4cde42=0x0;for(let _0x57199e=0x0;_0x57199e<_0xc33ad6[_0x4074d3(0x13e)];_0x57199e++){_0x4fe58f+=_0xc33ad6[_0x57199e]*_0x32c139[_0x57199e],_0x57ba46+=_0xc33ad6[_0x57199e]*_0xc33ad6[_0x57199e],_0x4cde42+=_0x32c139[_0x57199e]*_0x32c139[_0x57199e];}const _0x3548bf=Math[_0x4074d3(0x168)](_0x57ba46)*Math['sqrt'](_0x4cde42);return _0x3548bf===0x0?0x0:_0x4fe58f/_0x3548bf;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x21b32d=require$$0,_0x1eba11=require$$1,_0x42d6fb=require$$3;return writerLock=function _0x26572c(_0x191b84,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x58495a=_0x3360,_0x5b46a4=_0x1eba11['join'](_0x191b84,_0x58495a(0x1bf)),_0x202fb8=_0x42d6fb[_0x58495a(0x156)](0x8)[_0x58495a(0x177)](_0x58495a(0x16e));let _0x23738d=![],_0x333818=null;const _0x35c5df=()=>JSON[_0x58495a(0x1c1)]({'pid':process[_0x58495a(0x16d)],'token':_0x202fb8,'at':Date[_0x58495a(0x1d3)]()});function _0x276e6c(){const _0x39ad31=_0x58495a;try{return JSON[_0x39ad31(0x1a5)](_0x21b32d['readFileSync'](_0x5b46a4,'utf8'));}catch(_0x1fa527){return _0x1fa527?.[_0x39ad31(0x1a8)]===_0x39ad31(0x1a3)?null:{'unreadable':!![]};}}function _0x24b572(){const _0x13a988=_0x58495a;try{const _0x443b59=_0x21b32d['openSync'](_0x5b46a4,'wx');try{_0x21b32d['writeFileSync'](_0x443b59,_0x35c5df());}finally{_0x21b32d[_0x13a988(0x1c6)](_0x443b59);}return!![];}catch(_0x151c10){if(_0x151c10?.[_0x13a988(0x1a8)]===_0x13a988(0x173))return![];throw _0x151c10;}}function _0x19f3d9(_0x41771f){const _0x59c296=_0x58495a;if(!_0x41771f)return!![];if(_0x41771f[_0x59c296(0x1c3)])return!![];return Date[_0x59c296(0x1d3)]()-(_0x41771f['at']??0x0)>=maxAgeMs;}function _0x5936fe(){if(_0x333818)clearInterval(_0x333818);_0x333818=null;}function _0x24a783(){_0x5936fe(),_0x333818=setInterval(()=>{const _0x3ed6d7=_0x3360,_0x2c37d3=_0x276e6c();if(_0x2c37d3&&!_0x2c37d3['unreadable']&&_0x2c37d3[_0x3ed6d7(0x1f3)]!==_0x202fb8){_0x23738d=![],_0x5936fe();try{onLost?.();}catch{}return;}try{_0x21b32d[_0x3ed6d7(0x1a2)](_0x5b46a4,_0x35c5df());}catch{}},heartbeatMs),_0x333818['unref']?.();}function _0x378c0a(){const _0x47c563=_0x58495a,_0x1950fc=_0x276e6c();return!!_0x1950fc&&_0x1950fc[_0x47c563(0x1f3)]===_0x202fb8;}return{'path':_0x5b46a4,'token':_0x202fb8,'acquire'(){const _0x1471e1=_0x58495a,_0x323493=_0x276e6c();if(_0x323493&&_0x323493[_0x1471e1(0x1f3)]===_0x202fb8){_0x23738d=!![];if(!_0x333818)_0x24a783();return!![];}let _0x11c64c=_0x24b572();if(!_0x11c64c&&_0x19f3d9(_0x276e6c())){try{_0x21b32d[_0x1471e1(0x211)](_0x5b46a4);}catch{}_0x11c64c=_0x24b572();}if(_0x11c64c&&!_0x378c0a())_0x11c64c=![];_0x23738d=_0x11c64c;if(_0x11c64c)_0x24a783();return _0x11c64c;},'held'(){return _0x23738d;},'isFree'(){const _0x395dfb=_0x58495a,_0xd2d633=_0x276e6c();if(_0xd2d633&&_0xd2d633[_0x395dfb(0x1f3)]===_0x202fb8)return![];return _0x19f3d9(_0xd2d633);},'release'(){const _0x2d49c2=_0x58495a;_0x5936fe();if(!_0x23738d)return;_0x23738d=![];if(_0x378c0a())try{_0x21b32d[_0x2d49c2(0x211)](_0x5b46a4);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x34fdf8=require$$0,_0x4da061=requireSnapshotStore(),_0x1b8eaf=requireLabelMap(),_0x477a91=requireWriterLock(),{fingerprint:_0x600b9d,reconcileIndex:_0x551732}=requireIndexConvergence(),_0x55cb33=0x1;let _0x89b0e1=null;function _0x3a5d57(){const _0x636f8b=_0x3360;if(_0x89b0e1)return _0x89b0e1;try{return _0x89b0e1=require(_0x636f8b(0x1ea)),_0x89b0e1;}catch(_0x21157c){const _0x3142f4=new Error(_0x636f8b(0x1ad)+(_0x636f8b(0x14f)+process[_0x636f8b(0x154)][_0x636f8b(0x1ef)]+_0x636f8b(0x18b)+process[_0x636f8b(0x171)]+'/'+process[_0x636f8b(0x17f)]+'.\x20')+_0x636f8b(0x1cc)+(_0x636f8b(0x209)+(_0x21157c?.['message']||String(_0x21157c))));_0x3142f4['code']=_0x636f8b(0x157),_0x3142f4[_0x636f8b(0x1d0)]=_0x21157c;throw _0x3142f4;}}function _0x53ac1f(_0x189d98,_0x26118d){const _0x86ade4=_0x3360;switch(_0x189d98){case _0x86ade4(0x164):return _0x26118d[_0x86ade4(0x1c7)][_0x86ade4(0x181)];case'l2':return _0x26118d[_0x86ade4(0x1c7)][_0x86ade4(0x1dc)];case'ip':return _0x26118d['MetricKind']['IP'];default:return _0x26118d[_0x86ade4(0x1c7)][_0x86ade4(0x181)];}}return usearch=function _0x5a8de2(_0x185273={},{dims:_0x353d90,dir:_0x148319,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x4eac58=_0x3360,_0x32c73c=_0x3a5d57();if(!_0x353d90||_0x353d90<=0x0)throw new Error(_0x4eac58(0x1c0));if(!_0x148319)throw new Error(_0x4eac58(0x1b5));const _0x3d096e={'metric':_0x185273[_0x4eac58(0x1bb)]??'cosine','connectivity':_0x185273[_0x4eac58(0x18e)]??0x10,'expansionAdd':_0x185273[_0x4eac58(0x142)]??0x80,'expansionSearch':_0x185273['expansionSearch']??0x40,'snapshotEveryChanges':_0x185273[_0x4eac58(0x16c)]??0xc350,'snapshotMaxLagMs':_0x185273[_0x4eac58(0x1da)]??0x2710,'keepSnapshots':_0x185273[_0x4eac58(0x1b1)]??0x2,'tmpMaxAgeMs':_0x185273[_0x4eac58(0x14b)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x185273[_0x4eac58(0x1b8)]??0x1388,'writerLockMaxAgeMs':_0x185273[_0x4eac58(0x1d8)]??0x3a98,'viewRefreshMs':_0x185273['viewRefreshMs']??0x3e8},_0x2265b5=new _0x4da061({'dir':_0x148319,'keepSnapshots':_0x3d096e[_0x4eac58(0x1b1)]}),_0x4c44c7=_0x477a91(_0x148319,{'maxAgeMs':_0x3d096e[_0x4eac58(0x1d8)],'heartbeatMs':_0x3d096e[_0x4eac58(0x1b8)],'onLost':()=>{const _0x27b79d=_0x4eac58;_0x152239(_0x350547)[_0x27b79d(0x1e3)](()=>{});}});let _0x2c882b=new _0x1b8eaf(),_0x1589ee=null,_0x10dc8b=0x0,_0x232238=null,_0x30625d=![],_0x4fa1ff=![],_0xf59148=null,_0x1b3ef5=0x0,_0x1ee4d9=null,_0x26a863=0x0,_0x16d624=![],_0x2cab22=Promise[_0x4eac58(0x15d)]();const _0x152239=_0x141c3c=>{const _0x276faa=_0x4eac58,_0x55b6ca=_0x2cab22[_0x276faa(0x182)](_0x141c3c);return _0x2cab22=_0x55b6ca['catch'](()=>{}),_0x55b6ca;},_0x344d08=()=>{try{onChange?.();}catch{}};function _0x16ad58(){const _0x5965fd=_0x4eac58;return new _0x32c73c[(_0x5965fd(0x145))]({'dimensions':_0x353d90,'metric':_0x53ac1f(_0x3d096e['metric'],_0x32c73c),'quantization':_0x32c73c['ScalarKind'][_0x5965fd(0x14d)],'connectivity':_0x3d096e[_0x5965fd(0x18e)],'expansion_add':_0x3d096e[_0x5965fd(0x142)],'expansion_search':_0x3d096e['expansionSearch'],'multi':![]});}function _0x506f22(_0x568469){return _0x568469 instanceof Float32Array?_0x568469:new Float32Array(_0x568469);}function _0x4e2215(){const _0x29caf8=_0x4eac58;if(fetchAll)return fetchAll();if(_0x232238)return _0x232238();return Promise[_0x29caf8(0x15d)](null);}function _0x1538ce(_0x569297,_0x11b077,_0x39015e){const _0x386ae4=_0x4eac58,_0x5d7af9=_0x2c882b['labelForExisting'](_0x569297);if(_0x5d7af9!==undefined)try{_0x1589ee[_0x386ae4(0x198)](BigInt(_0x5d7af9));}catch{}const _0x454b5a=_0x2c882b[_0x386ae4(0x17a)](_0x569297);_0x1589ee['add'](BigInt(_0x454b5a),_0x11b077),_0x2c882b[_0x386ae4(0x141)](_0x569297,_0x39015e??_0x600b9d(_0x11b077));}function _0x7bdc90(_0x309fdd){const _0xe8ab7d=_0x4eac58,_0x12199a=_0x2c882b[_0xe8ab7d(0x1e7)](_0x309fdd);if(_0x12199a===undefined)return![];try{_0x1589ee[_0xe8ab7d(0x198)](BigInt(_0x12199a));}catch{}return _0x2c882b[_0xe8ab7d(0x19d)](_0x309fdd),!![];}function _0x203455(_0x5b7955){const _0x4f0b8d=_0x4eac58;_0x2c882b=new _0x1b8eaf(),_0x1589ee=_0x16ad58();for(const {key:_0x3e1259,vector:_0x59723a}of _0x5b7955??[]){if(!(_0x59723a instanceof Float32Array)||_0x59723a[_0x4f0b8d(0x13e)]!==_0x353d90)continue;_0x1538ce(_0x3e1259,_0x59723a);}_0x10dc8b=0x0;}function _0x14cd4d(){const _0x493f91=_0x4eac58;return Math[_0x493f91(0x1fd)](Date[_0x493f91(0x1d3)](),_0x2265b5[_0x493f91(0x1f7)]()+0x1);}function _0xf41a60(){if(_0xf59148)clearTimeout(_0xf59148);_0xf59148=null;}function _0x4a5cf0(){const _0x2dce64=_0x4eac58;if(!_0x3d096e[_0x2dce64(0x1da)]||_0xf59148||!_0x4fa1ff||_0x10dc8b<=0x0)return;const _0x39b302=Math[_0x2dce64(0x1fd)](_0x3d096e['snapshotMaxLagMs'],0xa*_0x1b3ef5);_0xf59148=setTimeout(()=>{const _0x572119=_0x2dce64;_0xf59148=null,_0x152239(async()=>{if(_0x4fa1ff&&_0x10dc8b>0x0)await _0x59cb25();_0x4a5cf0(),_0x344d08();})[_0x572119(0x1e3)](()=>{});},_0x39b302),_0xf59148['unref']?.();}async function _0x59cb25(_0x399e9d){const _0x3cff7f=_0x4eac58;if(!_0x1589ee)return![];const _0x1f589b=_0x399e9d??_0x14cd4d(),_0x223fbc=Date[_0x3cff7f(0x1d3)](),_0x5d8800=await _0x2265b5[_0x3cff7f(0x17b)](_0x1f589b,async _0x2952bf=>{const _0x4155e0=_0x3cff7f;_0x1589ee['save'](_0x2952bf[_0x4155e0(0x20f)]),await _0x2c882b[_0x4155e0(0x1d9)](_0x2952bf[_0x4155e0(0x1aa)]),_0x34fdf8[_0x4155e0(0x1a2)](_0x2952bf[_0x4155e0(0x180)],JSON[_0x4155e0(0x1c1)]({'manifestVersion':_0x55cb33,'algorithm':_0x4155e0(0x1ea),'dims':_0x353d90,'metric':_0x3d096e[_0x4155e0(0x1bb)],'clock':_0x1f589b,'snapshotAt':Date[_0x4155e0(0x1d3)]()},null,0x2));},{'keep':_0x3d096e[_0x3cff7f(0x1b1)]});return _0x1b3ef5=Date[_0x3cff7f(0x1d3)]()-_0x223fbc,_0x5d8800?.[_0x3cff7f(0x170)]&&(_0x10dc8b=0x0,_0xf41a60()),_0x5d8800?.['published']??![];}function _0x506b5d(){const _0x3eacd1=_0x4eac58;_0x10dc8b++;if(_0x10dc8b>=_0x3d096e[_0x3eacd1(0x16c)])return _0x59cb25();return _0x4a5cf0(),null;}async function _0xaf012b(){const _0x19bc92=_0x4eac58,_0x474862=_0x2265b5[_0x19bc92(0x169)]()||_0x2265b5[_0x19bc92(0x1a1)]();if(!_0x474862)return null;let _0x18c8e6,_0x5b1e51=![];try{await _0x2265b5['loadSnapshot'](_0x474862,async _0x2ebb0e=>{const _0x51c970=_0x19bc92;_0x18c8e6=JSON[_0x51c970(0x1a5)](_0x34fdf8[_0x51c970(0x15a)](_0x2ebb0e[_0x51c970(0x180)],_0x51c970(0x1d1)));if(_0x18c8e6[_0x51c970(0x14a)]!==_0x55cb33||_0x18c8e6['algorithm']!==_0x51c970(0x1ea)||_0x18c8e6['dims']!==_0x353d90||_0x18c8e6[_0x51c970(0x1bb)]!==_0x3d096e[_0x51c970(0x1bb)]){_0x18c8e6=null;return;}const _0x23bf68=new _0x1b8eaf();await _0x23bf68[_0x51c970(0x1bc)](_0x2ebb0e[_0x51c970(0x1aa)]);const _0x31d84e=_0x16ad58();_0x31d84e['load'](_0x2ebb0e[_0x51c970(0x20f)]),_0x2c882b=_0x23bf68,_0x1589ee=_0x31d84e,_0x5b1e51=!![];});}catch{return null;}return _0x5b1e51?_0x18c8e6?.[_0x19bc92(0x149)]??0x0:null;}async function _0x373334(_0x1b7fa9){const _0x253fbb=_0x4eac58;_0x1ee4d9=null;const _0x3b2aad=await _0xaf012b();if(_0x3b2aad!=null){_0x10dc8b=0x0;if(_0x1b7fa9){if(!_0x2c882b[_0x253fbb(0x1ed)])return _0x203455(_0x1b7fa9),await _0x59cb25(),null;const _0x120d1d=_0x551732(_0x2c882b,_0x1b7fa9,_0x353d90,{'upsert':_0x1538ce,'remove':_0x7bdc90}),_0x539008=_0x120d1d[_0x253fbb(0x148)]+_0x120d1d['changed']+_0x120d1d['removed'];_0x539008>0x0&&(_0x10dc8b+=_0x539008,await _0x59cb25());}return _0x3b2aad;}_0x203455(_0x1b7fa9??[]);if(_0x1589ee[_0x253fbb(0x1d7)]()>0x0)await _0x59cb25();return null;}async function _0x491f0c(){_0x4fa1ff=!![],await _0x373334(await _0x4e2215());}async function _0x350547(){const _0x7d666=_0x4eac58;if(!_0x4fa1ff)return;_0x4fa1ff=![],_0xf41a60(),_0x10dc8b=0x0;const _0x328d32=_0x2265b5['readCurrentId']()||_0x2265b5[_0x7d666(0x1a1)]();await _0x2f108f(_0x328d32),_0x344d08();}async function _0x2f108f(_0x500516){const _0x2b5eff=_0x4eac58;if(!_0x500516)return![];let _0xd86ef0=![];try{await _0x2265b5[_0x2b5eff(0x196)](_0x500516,async _0x5ae4db=>{const _0x3dd516=_0x2b5eff,_0x5621af=JSON[_0x3dd516(0x1a5)](_0x34fdf8['readFileSync'](_0x5ae4db[_0x3dd516(0x180)],_0x3dd516(0x1d1)));if(_0x5621af[_0x3dd516(0x14a)]!==_0x55cb33||_0x5621af[_0x3dd516(0x1cb)]!=='usearch'||_0x5621af[_0x3dd516(0x1dd)]!==_0x353d90||_0x5621af[_0x3dd516(0x1bb)]!==_0x3d096e[_0x3dd516(0x1bb)])return;const _0x4a8c02=new _0x1b8eaf();await _0x4a8c02['loadFrom'](_0x5ae4db[_0x3dd516(0x1aa)]);const _0x586b7d=_0x16ad58();_0x586b7d[_0x3dd516(0x1f5)](_0x5ae4db[_0x3dd516(0x20f)]),_0x1589ee=_0x586b7d,_0x2c882b=_0x4a8c02,_0x1ee4d9=_0x500516,_0xd86ef0=!![];});}catch{}return _0xd86ef0;}function _0x45a2e2(){const _0x90d16f=_0x4eac58,_0x4a5c77=Date[_0x90d16f(0x1d3)]();if(_0x4a5c77-_0x26a863<_0x3d096e[_0x90d16f(0x143)])return;_0x26a863=_0x4a5c77;if(_0x16d624)return;if(_0x4c44c7[_0x90d16f(0x1cf)]()){_0x16d624=!![],_0x152239(async()=>{const _0x5d96ec=_0x90d16f;!_0x4fa1ff&&_0x30625d&&_0x4c44c7[_0x5d96ec(0x1e0)]()&&(await _0x491f0c(),_0x344d08());})['catch'](()=>{})[_0x90d16f(0x20c)](()=>{_0x16d624=![];});return;}const _0x567491=_0x2265b5['readCurrentId']()||_0x2265b5[_0x90d16f(0x1a1)]();if(!_0x567491||_0x567491===_0x1ee4d9)return;_0x16d624=!![],_0x152239(async()=>{if(!_0x4fa1ff&&await _0x2f108f(_0x567491))_0x344d08();})[_0x90d16f(0x1e3)](()=>{})[_0x90d16f(0x20c)](()=>{_0x16d624=![];});}return{async 'load'(_0x2ba566){return _0x152239(async()=>{const _0x2adb2a=_0x3360;_0x2265b5['cleanupTmpDirs']({'maxAgeMs':_0x3d096e[_0x2adb2a(0x14b)]}),_0x232238=_0x2ba566??null,_0x4fa1ff=_0x4c44c7[_0x2adb2a(0x1e0)]();let _0x5097bc=null;if(_0x4fa1ff)_0x5097bc=await _0x373334(_0x2ba566?await _0x2ba566():null);else{const _0xbb28b=_0x2265b5['readCurrentId']()||_0x2265b5[_0x2adb2a(0x1a1)]();await _0x2f108f(_0xbb28b);}return _0x30625d=!![],_0x5097bc;});},async 'add'(_0x4b31de,_0x41fa76,_0x17c45c){return _0x152239(async()=>{const _0x1641a9=_0x3360;if(!_0x30625d)return;const _0x10e6b3=_0x506f22(_0x41fa76);if(!_0x4fa1ff){if(!_0x4c44c7[_0x1641a9(0x1e0)]())return;await _0x491f0c();}if(!_0x1589ee)return;const _0x1656f8=_0x600b9d(_0x10e6b3);if(_0x2c882b[_0x1641a9(0x1d2)](_0x4b31de)===_0x1656f8)return;_0x1538ce(_0x4b31de,_0x10e6b3,_0x1656f8),await _0x506b5d();});},async 'remove'(_0xd0521){return _0x152239(async()=>{const _0x40630a=_0x3360;if(!_0x30625d)return;if(!_0x4fa1ff){if(!_0x4c44c7[_0x40630a(0x1e0)]())return;await _0x491f0c();}if(!_0x1589ee)return;if(_0x7bdc90(_0xd0521))await _0x506b5d();});},'search'(_0x308c9b,{limit:limit=0xa}={}){const _0x46d4e1=_0x4eac58;if(!_0x4fa1ff&&_0x30625d)_0x45a2e2();if(!_0x1589ee)return[];const _0x1c0d6a=_0x1589ee[_0x46d4e1(0x1d7)]();if(_0x1c0d6a===0x0)return[];const _0x15bf2d=Math[_0x46d4e1(0x1be)](limit,_0x1c0d6a),_0x4625f9=_0x1589ee[_0x46d4e1(0x186)](_0x506f22(_0x308c9b),_0x15bf2d,0x0),_0x2c6acf=[],_0x5ccebc=_0x4625f9[_0x46d4e1(0x1f6)],_0xc370e2=_0x4625f9[_0x46d4e1(0x1ec)];for(let _0x2f613a=0x0;_0x2f613a<_0x5ccebc[_0x46d4e1(0x13e)];_0x2f613a++){const _0x32b79e=_0x5ccebc[_0x2f613a];if(_0x32b79e===0xffffffffffffffffn)continue;const _0x2452d0=Number(_0x32b79e),_0x1df56e=_0x2c882b[_0x46d4e1(0x15f)](_0x2452d0);if(!_0x1df56e)continue;const _0x397e38=_0xc370e2[_0x2f613a];let _0x2fdbeb;if(_0x3d096e[_0x46d4e1(0x1bb)]===_0x46d4e1(0x164))_0x2fdbeb=Math[_0x46d4e1(0x1fd)](0x0,0x1-_0x397e38);else{if(_0x3d096e[_0x46d4e1(0x1bb)]==='ip')_0x2fdbeb=-_0x397e38;else _0x2fdbeb=0x1/(0x1+_0x397e38);}_0x2c6acf['push']({'key':_0x1df56e,'score':_0x2fdbeb});}return _0x2c6acf;},async 'snapshot'(_0x1bc1c9){return _0x152239(()=>_0x4fa1ff?_0x59cb25(_0x1bc1c9??undefined):![]);},async 'rebuild'(_0x3fd021){return _0x152239(async()=>{if(_0x3fd021!=null)_0x232238=_0x3fd021;if(!_0x4fa1ff){if(!_0x4c44c7['acquire']())return;_0x4fa1ff=!![];}const _0x1d7ac2=_0x3fd021?await _0x3fd021():await _0x4e2215();_0x203455(_0x1d7ac2??[]),_0x30625d=!![],await _0x59cb25();});},async 'stop'(){return _0x152239(async()=>{const _0x2b6c8c=_0x3360;_0xf41a60();if(_0x4fa1ff){if(_0x10dc8b>0x0||!_0x2265b5[_0x2b6c8c(0x169)]())await _0x59cb25();_0x4c44c7['release']();}_0x4fa1ff=![],_0x30625d=![];});},'count'(){const _0x4f8c4c=_0x4eac58;return _0x2c882b[_0x4f8c4c(0x1d7)]();},'info'(){const _0x50d4d1=_0x4eac58;return{'algorithm':_0x50d4d1(0x1ea),'role':_0x4fa1ff?_0x50d4d1(0x1fe):_0x50d4d1(0x151),'metric':_0x3d096e['metric'],'connectivity':_0x3d096e[_0x50d4d1(0x18e)],'expansionAdd':_0x3d096e[_0x50d4d1(0x142)],'expansionSearch':_0x3d096e[_0x50d4d1(0x1a4)],'snapshotEveryChanges':_0x3d096e[_0x50d4d1(0x16c)],'snapshotMaxLagMs':_0x3d096e[_0x50d4d1(0x1da)],'count':_0x2c882b[_0x50d4d1(0x1d7)](),'size':_0x1589ee?.['size']?.()??0x0,'capacity':_0x1589ee?.[_0x50d4d1(0x17e)]?.()??0x0,'changesSince':_0x4fa1ff?_0x10dc8b:null,'viewedSnapshot':_0x1ee4d9??null,'snapshotDir':_0x148319,'latestSnapshot':_0x2265b5['readCurrentId']()??null};}};},usearch;}function _0x3360(_0x507d4c,_0x4efcc0){_0x507d4c=_0x507d4c-0x137;const _0xf898a6=_0xf898();let _0x336086=_0xf898a6[_0x507d4c];return _0x336086;}var hasRequiredAlgorithmWorkerThread;function _0xf898(){const _0x31d5a2=['state','Cos','then',').\x20','slice','_snapshotPaths','search','name','mtimeMs','efSearch','cleanupTmpDirs','\x20on\x20','changed','343425OUhjUb','connectivity','labels.json','trunc','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','set','byteOffset','message','state.json','loadSnapshot','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','remove','maxElements','rmSync','fetchAll','index.hnsw','tombstone','prune','130yzmpmq','currentPath','latestSnapshotId','writeFileSync','ENOENT','expansionSearch','parse','lock_busy','growFactor','code','getCurrentCount','labels','_tombstoneCount','markDelete','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','addPoint','info','score','keepSnapshots','dir','hasRows','ceil','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','snapshotsDir','isDirectory','heartbeatIntervalMs','host','tombstoneCount','metric','loadFrom','filter','min','WRITER.LOCK','usearch\x20algorithm\x20requires\x20dims\x20>\x200','stringify','labelToKey','unreadable','imul','repeat','closeSync','MetricKind','sync','14307jWvVMa','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','algorithm','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20','isInteger','nextLabel','isFree','cause','utf8','fingerprintOf','now','opts','keyToLabel','statSync','size','writerLockMaxAgeMs','snapshotTo','snapshotMaxLagMs','push','L2sq','dims','get','round','acquire','199972QJUfql','hostname','catch','removed','number','snapshot','labelForExisting','sort','stop','usearch','map','distances','hasFingerprints','memoryUsage','node','listSnapshotIds','[SnapshotStore]','1329691SCCBHz','token','clear','view','keys','readCurrentClock','entries','key','delete','vector','join','max','writer','version','log','getMaxElements','error','snapshots','2114hBOaMP','openSync','worker_threads','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','keyToFp','Original\x20error:\x20','postMessage','rebuild','finally','startsWith','HierarchicalNSW','index','299457guVLyq','unlinkSync','initIndex','isFinite','vectors','snapshot\x20incomplete:\x20','path','count','writeIndexSync','readIndexSync','length','fid','hasOwnProperty','setFingerprint','expansionAdd','viewRefreshMs','default','Index','_snapshotDir','setEf','added','clock','manifestVersion','tmpMaxAgeMs','4314REZsKz','F32','.tmp','for\x20Node\x20','HNSW_BINDINGS_UNAVAILABLE','reader','SnapshotStore\x20requires\x20dir','fetchAllResult','versions','prototype','randomBytes','USEARCH_BINDINGS_UNAVAILABLE','reset','from','readFileSync','321592UbeCpQ','warn','resolve','isArray','keyForLabel','buffer','hnsw','queryVec','load','cosine','hnswlib-node','add','.tmp-','sqrt','readCurrentId','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','stale','snapshotEveryChanges','pid','hex','existsSync','published','platform','trim','EEXIST','368xjBbaS','resizeIndex','lockPath','toString','readdirSync','88ZvsHIg','labelForEphemeral','publishSnapshot','efConstruction','exports','capacity','arch'];_0xf898=function(){return _0x31d5a2;};return _0xf898();}function requireAlgorithmWorkerThread(){const _0x5a9244=_0x411a8a;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x39657c,workerData:_0x2e9a2c}=require$$0$1,{algorithmName:_0x4d9990,algorithmConfig:_0x5d2978,dims:_0x47ab32,dir:_0x367ab9}=_0x2e9a2c;let _0x23ebfc=0x1;const _0x3dbc45=new Map();function _0x30f8ee(){const _0x4ca2da=_0x23ebfc++;return new Promise((_0x45cfd0,_0x2aa460)=>{const _0x5362fb=_0x3360;_0x3dbc45['set'](_0x4ca2da,{'resolve':_0x45cfd0,'reject':_0x2aa460}),_0x39657c[_0x5362fb(0x20a)]({'op':_0x5362fb(0x19b),'fid':_0x4ca2da});});}const _0x1e5994={'dims':_0x47ab32,'dir':_0x367ab9,'fetchAll':_0x30f8ee,'onChange':()=>_0x394040()};let _0x58ede8;if(_0x4d9990==='hnsw')_0x58ede8=requireHnsw()(_0x5d2978,_0x1e5994);else{if(_0x4d9990==='flat')_0x58ede8=requireFlat()(_0x5d2978,_0x1e5994);else{if(_0x4d9990==='usearch')_0x58ede8=requireUsearch()(_0x5d2978,_0x1e5994);else throw new Error('Unknown\x20algorithm:\x20\x22'+_0x4d9990+'\x22');}}function _0x394040(){const _0x2f47eb=_0x3360;try{_0x39657c[_0x2f47eb(0x20a)]({'op':_0x2f47eb(0x1c8),'count':_0x58ede8['count'](),'info':_0x58ede8['info'](),'memory':process[_0x2f47eb(0x1ee)]()});}catch{}}function _0x53cb3d(_0x2f8988){const _0x47e6a0=_0x3360;return(_0x2f8988||[])[_0x47e6a0(0x1eb)](_0x5c4ba4=>({'key':_0x5c4ba4[_0x47e6a0(0x1f9)],'vector':_0x5c4ba4[_0x47e6a0(0x1fb)]instanceof Float32Array?_0x5c4ba4[_0x47e6a0(0x1fb)]:new Float32Array(_0x5c4ba4[_0x47e6a0(0x1fb)])}));}return _0x39657c['on'](_0x5a9244(0x194),async _0x652f4b=>{const _0x4637a0=_0x5a9244;if(_0x652f4b['op']===_0x4637a0(0x153)){const _0x26d255=_0x3dbc45[_0x4637a0(0x1de)](_0x652f4b[_0x4637a0(0x13f)]);if(!_0x26d255)return;_0x3dbc45[_0x4637a0(0x1fa)](_0x652f4b[_0x4637a0(0x13f)]);if(_0x652f4b['error'])_0x26d255['reject'](new Error(_0x652f4b[_0x4637a0(0x202)]));else _0x26d255[_0x4637a0(0x15d)](_0x53cb3d(_0x652f4b[_0x4637a0(0x138)]));return;}const {id:_0x3f5885,op:_0x588d31,args:_0x354909}=_0x652f4b;try{let _0x16369b;switch(_0x588d31){case _0x4637a0(0x163):{_0x16369b=await _0x58ede8[_0x4637a0(0x163)](_0x354909[_0x4637a0(0x1b3)]?_0x30f8ee:null),_0x394040();break;}case _0x4637a0(0x166):{const _0x48cec9=_0x354909[_0x4637a0(0x1fb)]instanceof Float32Array?_0x354909['vector']:new Float32Array(_0x354909['vector']);await _0x58ede8[_0x4637a0(0x166)](_0x354909[_0x4637a0(0x1f9)],_0x48cec9,_0x354909[_0x4637a0(0x149)]??undefined),_0x394040(),_0x16369b=null;break;}case _0x4637a0(0x198):{await _0x58ede8[_0x4637a0(0x198)](_0x354909[_0x4637a0(0x1f9)]),_0x394040(),_0x16369b=null;break;}case'search':{const _0x14087a=_0x354909[_0x4637a0(0x162)]instanceof Float32Array?_0x354909[_0x4637a0(0x162)]:new Float32Array(_0x354909['queryVec']);_0x16369b=_0x58ede8[_0x4637a0(0x186)](_0x14087a,_0x354909[_0x4637a0(0x1d4)]||{});break;}case _0x4637a0(0x1e6):{_0x16369b=await _0x58ede8['snapshot'](_0x354909[_0x4637a0(0x149)]),_0x394040();break;}case'rebuild':{const _0x4ec9e3=_0x53cb3d(_0x354909[_0x4637a0(0x138)]);await _0x58ede8[_0x4637a0(0x20b)](async()=>_0x4ec9e3),_0x394040(),_0x16369b=null;break;}case _0x4637a0(0x1e9):{await _0x58ede8[_0x4637a0(0x1e9)](),_0x394040(),_0x16369b=null;break;}case'count':{_0x16369b=_0x58ede8[_0x4637a0(0x13b)]();break;}case _0x4637a0(0x1af):{_0x16369b=_0x58ede8[_0x4637a0(0x1af)]();break;}default:throw new Error('Unknown\x20op:\x20\x22'+_0x588d31+'\x22');}_0x39657c[_0x4637a0(0x20a)]({'id':_0x3f5885,'result':_0x16369b});}catch(_0x307a2d){_0x39657c[_0x4637a0(0x20a)]({'id':_0x3f5885,'error':{'message':_0x307a2d?.[_0x4637a0(0x194)]||String(_0x307a2d),'code':_0x307a2d?.[_0x4637a0(0x1a8)]}});}}),_0x39657c[_0x5a9244(0x20a)]({'op':'ready'}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0x411a8a(0x17d)]=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;
|