@univer-cli/univer-collaboration-runtime-pool 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/worker-child.mjs +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InstancePoolCacheOptions } from "@univer-cli/generic-keyed-instance-pool";
|
|
2
1
|
import { CollaborationCommitResult, CollaborationCommitResult as CollaborationCommitResult$1, CollaborationFetchResult, CollaborationFetchResult as CollaborationFetchResult$1, CollaborationPullResult, CollaborationPullResult as CollaborationPullResult$1, CollaborationReplaceMutationsResult, CollaborationReplaceMutationsResult as CollaborationReplaceMutationsResult$1, CollaborationRuntimeReadExecution, CollaborationRuntimeReadExecution as CollaborationRuntimeReadExecution$1, CollaborationRuntimeReadResult, CollaborationRuntimeReadResult as CollaborationRuntimeReadResult$1, CollaborationRuntimeState, CollaborationRuntimeState as CollaborationRuntimeState$1, CollaborationRuntimeWriteExecution, CollaborationRuntimeWriteExecution as CollaborationRuntimeWriteExecution$1, CollaborationRuntimeWriteResult, CollaborationRuntimeWriteResult as CollaborationRuntimeWriteResult$1, CollaborationUnitData, CollaborationUnitData as CollaborationUnitData$1, UniverCollaborationRuntime } from "@univer-cli/univer-collaboration-runtime";
|
|
2
|
+
import { InstancePoolCacheOptions } from "@univer-cli/generic-keyed-instance-pool";
|
|
3
3
|
import { IMutation } from "@univerjs/protocol";
|
|
4
4
|
//#region src/errors.d.ts
|
|
5
5
|
type UniverCollaborationRuntimePoolErrorCode = "COLLABORATION_POOL_INVALID_INPUT" | "COLLABORATION_POOL_CLOSED" | "COLLABORATION_POOL_CAPACITY_EXCEEDED" | "COLLABORATION_LEASE_CLOSED" | "COLLABORATION_WORKER_OPEN_TIMEOUT" | "COLLABORATION_WORKER_OPERATION_TIMEOUT" | "COLLABORATION_WORKER_CRASHED" | "COLLABORATION_WORKER_PROTOCOL_ERROR" | "COLLABORATION_WORKER_CLOSED";
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x455690=_0x3990;(function(_0x2d8cb9,_0x49c740){const _0x5c9bae=_0x3990,_0x41a0cb=_0x2d8cb9();while(!![]){try{const _0xc10cd5=parseInt(_0x5c9bae(0xfa))/0x1+parseInt(_0x5c9bae(0xd9))/0x2*(-parseInt(_0x5c9bae(0x111))/0x3)+parseInt(_0x5c9bae(0xea))/0x4+-parseInt(_0x5c9bae(0xce))/0x5*(parseInt(_0x5c9bae(0xc9))/0x6)+parseInt(_0x5c9bae(0xb1))/0x7*(-parseInt(_0x5c9bae(0xa5))/0x8)+parseInt(_0x5c9bae(0xb9))/0x9+parseInt(_0x5c9bae(0x107))/0xa*(parseInt(_0x5c9bae(0x8a))/0xb);if(_0xc10cd5===_0x49c740)break;else _0x41a0cb['push'](_0x41a0cb['shift']());}catch(_0x145187){_0x41a0cb['push'](_0x41a0cb['shift']());}}}(_0x47ac,0xe6858));import{InstancePoolError as _0x864955,createGenericKeyedInstancePool as _0x1d77f1}from'@univer-cli/generic-keyed-instance-pool';import{CollaborationRuntimeError as _0x30582d}from'@univer-cli/univer-collaboration-runtime';import{fork as _0x4a2718}from'node:child_process';import{dirname as _0x693c81,extname as _0x36529f,join as _0x2fdb3c}from'node:path';import{fileURLToPath as _0x1cf822}from'node:url';var c=class extends Error{[_0x455690(0x101)];[_0x455690(0xd5)];constructor(_0x4601a5,_0x3d8d98,_0x2bf840={}){const _0xc19628=_0x455690;super(_0x3d8d98,_0x2bf840),this[_0xc19628(0xd6)]=_0xc19628(0x105),this[_0xc19628(0x101)]=_0x4601a5,this[_0xc19628(0xd5)]=_0x2bf840[_0xc19628(0xd5)]??!0x1;}};async function l(_0x126685){const _0x641816=_0x455690;let _0x4e194f=_0x1cf822(import.meta.url),_0x71c089=_0x693c81(_0x4e194f),_0x3f9316=_0x2fdb3c(_0x71c089,_0x36529f(_0x4e194f)===_0x641816(0xef)?_0x641816(0x93):_0x641816(0xf8)),_0xd497ab=u(_0x4a2718(_0x3f9316,[],{..._0x126685[_0x641816(0x10d)]===void 0x0?{}:{'env':_0x126685[_0x641816(0x10d)]},'serialization':_0x641816(0x9b),'stdio':['ignore',_0x641816(0xc4),_0x641816(0xc4),_0x641816(0xe2)]}),_0x126685[_0x641816(0xb0)]);try{let _0x30a0a5=d(await _0xd497ab[_0x641816(0x114)]({'entry':_0x126685[_0x641816(0xff)],'id':_0xd497ab[_0x641816(0xfb)](),'init':_0x126685[_0x641816(0xe0)],'type':_0x641816(0x10b)},_0x126685['openTimeoutMs'],_0x641816(0xa7))),_0x21c10c,_0x1a1007=async _0x178f98=>await _0xd497ab[_0x641816(0x114)]({..._0x178f98,'id':_0xd497ab[_0x641816(0xfb)]()},_0x126685[_0x641816(0xe8)]);return{..._0x30a0a5,async 'close'(){const _0xb72170=_0x641816;_0x21c10c??=_0xd497ab[_0xb72170(0xc2)](),await _0x21c10c;},async 'getState'(){const _0x2b85ed=_0x641816;return f(await _0x1a1007({'type':_0x2b85ed(0xa4)}));},async 'getPendingMutations'(){let _0x1de10e=await _0x1a1007({'type':'get-pending-mutations'});if(!C(_0x1de10e))throw _('Worker\x20returned\x20invalid\x20pending\x20mutations');return _0x1de10e;},async 'executeReadCode'(_0x29af62){const _0x13db90=_0x641816;let _0x5015fe=p(await _0x1a1007({'code':_0x29af62,'type':'execute-read'}));if(!(_0x13db90(0x94)in _0x5015fe)||!w(_0x5015fe[_0x13db90(0x94)]))throw _(_0x13db90(0x98));return _0x5015fe;},async 'executeWriteCode'(_0x37325e){const _0x4e09c6=_0x641816;let _0x1e14a2=p(await _0x1a1007({'code':_0x37325e,'type':_0x4e09c6(0xed)}));if(!w(_0x1e14a2['value'])||!C(_0x1e14a2[_0x4e09c6(0x106)]))throw _(_0x4e09c6(0x10f));return _0x1e14a2;},async 'replacePendingMutations'(_0x9d16a3){const _0x4b65a0=_0x641816;let _0x3a46f9=p(await _0x1a1007({'mutations':_0x9d16a3,'type':_0x4b65a0(0xdb)}));if(!T(_0x3a46f9[_0x4b65a0(0x9c)])||!T(_0x3a46f9[_0x4b65a0(0xa3)]))throw _(_0x4b65a0(0xf5));return _0x3a46f9;},async 'fetch'(){const _0x300673=_0x641816;return m(await _0x1a1007({'type':'fetch'}),[_0x300673(0xe4),'fetched']);},async 'pull'(){const _0x573567=_0x641816;return m(await _0x1a1007({'type':_0x573567(0x10e)}),[_0x573567(0xc1),_0x573567(0xe9),_0x573567(0xdd)]);},async 'commit'(){const _0x12f1b9=_0x641816;return m(await _0x1a1007({'type':_0x12f1b9(0xd2)}),['nothing-to-commit',_0x12f1b9(0xad),_0x12f1b9(0xf6),_0x12f1b9(0xca),'unknown',_0x12f1b9(0xdd)]);},async 'exportUnitData'(){const _0x309997=_0x641816;let _0x2a17f6=await _0x1a1007({'type':_0x309997(0xbe)});if(!E(_0x2a17f6))throw _(_0x309997(0xcd));return _0x2a17f6;}};}catch(_0x3d6101){throw await _0xd497ab['close'](),_0x3d6101;}}function u(_0x299888,_0x4f1b6e){const _0xe13c1d=_0x455690;let _0x120168=new Map(),_0x3df1e8=0x0,_0x873725,_0x419621=!0x1,_0x38fee1,_0x1a34d1,_0x3ee572=new Promise(_0x3ec7cb=>{_0x1a34d1=_0x3ec7cb;});return _0x299888['on']('message',_0x2b1fd9=>{const _0x227a71=_0x3990;if(!v(_0x2b1fd9))return;let _0x12ac6c=_0x120168[_0x227a71(0xc3)](_0x2b1fd9['id']);_0x12ac6c&&(_0x120168[_0x227a71(0x110)](_0x2b1fd9['id']),_0x12ac6c[_0x227a71(0x88)]&&clearTimeout(_0x12ac6c[_0x227a71(0x88)]),_0x2b1fd9['type']===_0x227a71(0x100)?_0x12ac6c[_0x227a71(0xa0)](h(_0x2b1fd9[_0x227a71(0x100)])):_0x12ac6c['resolve'](_0x2b1fd9['result']));}),_0x299888['on']('error',_0x247829=>_0x20f523(g(_0xe13c1d(0x9f)+_0x4f1b6e+_0xe13c1d(0xaf)+_0x247829[_0xe13c1d(0xac)],_0x247829))),_0x299888['on'](_0xe13c1d(0xf9),(_0x58eb7b,_0x3f4b84)=>{const _0x4f3b9d=_0xe13c1d;_0x419621||_0x20f523(g('Worker\x20'+_0x4f1b6e+'\x20exited\x20unexpectedly\x20with\x20'+(_0x3f4b84?_0x4f3b9d(0xf4)+_0x3f4b84:_0x4f3b9d(0x9e)+String(_0x58eb7b))));}),_0x299888['on']('close',()=>_0x1a34d1()),{async 'close'(){if(_0x38fee1)return await _0x38fee1;_0x38fee1=_0x42ca7c(),await _0x38fee1;},'nextId'(){return++_0x3df1e8;},async 'request'(_0x4ef1bc,_0x513ea9,_0x2743e1='COLLABORATION_WORKER_OPERATION_TIMEOUT'){if(_0x873725)throw _0x873725;return await new Promise((_0x3513e8,_0x1d5f67)=>{const _0x4d4696=_0x3990;let _0xa9349a={'reject':_0x1d5f67,'resolve':_0x3513e8,'timer':setTimeout(()=>{const _0x1cd96b=_0x3990;_0x20f523(new c(_0x2743e1,_0x1cd96b(0xd4)+_0x4f1b6e+'\x20timed\x20out\x20after\x20'+_0x513ea9+'ms',{'invalidatesInstance':!0x0})),_0xa84d87();},_0x513ea9)};_0x120168[_0x4d4696(0xc5)](_0x4ef1bc['id'],_0xa9349a),_0x299888[_0x4d4696(0xb6)](_0x4ef1bc,_0x5c20a8=>{const _0x4d14bf=_0x4d4696;_0x5c20a8&&_0x20f523(g(_0x4d14bf(0xaa)+_0x4f1b6e,_0x5c20a8));});});}};async function _0x42ca7c(){const _0x4faaa0=_0xe13c1d;if(_0x419621=!0x0,!_0x873725&&_0x299888['connected'])try{await Promise[_0x4faaa0(0xd7)]([new Promise((_0x456433,_0x2c6247)=>{const _0x22c4f2=_0x4faaa0;let _0x23ea16=++_0x3df1e8;_0x120168['set'](_0x23ea16,{'reject':_0x2c6247,'resolve':_0x456433}),_0x299888[_0x22c4f2(0xb6)]({'id':_0x23ea16,'type':_0x22c4f2(0xc2)},_0x18618f=>{_0x18618f&&_0x2c6247(_0x18618f);});}),new Promise((_0x58315f,_0x3a54d3)=>{const _0xe83ed7=_0x4faaa0;setTimeout(()=>_0x3a54d3(Error('Worker\x20close\x20timed\x20out')),0x1388)[_0xe83ed7(0xfd)]();})]);}catch{}_0xa84d87(),await _0x3ee572,_0x20f523(new c(_0x4faaa0(0x109),_0x4faaa0(0xd4)+_0x4f1b6e+'\x20is\x20closed',{'invalidatesInstance':!0x0}));}function _0x20f523(_0x15dcad){const _0x1e74b1=_0xe13c1d;_0x873725??=_0x15dcad;for(let _0xa59e5d of _0x120168[_0x1e74b1(0xd8)]())_0xa59e5d[_0x1e74b1(0x88)]&&clearTimeout(_0xa59e5d[_0x1e74b1(0x88)]),_0xa59e5d['reject'](_0x873725);_0x120168[_0x1e74b1(0xf2)]();}function _0xa84d87(){const _0x2d46ef=_0xe13c1d;_0x299888['exitCode']===null&&_0x299888['signalCode']===null&&_0x299888[_0x2d46ef(0xeb)](_0x2d46ef(0x108));}}function d(_0x2b2137){const _0x20d388=_0x455690;if(!E(_0x2b2137)||typeof _0x2b2137[_0x20d388(0xae)]!=_0x20d388(0xdc)||!y(_0x2b2137[_0x20d388(0x104)]))throw _(_0x20d388(0xda));return{'unitId':_0x2b2137['unitId'],'unitType':_0x2b2137[_0x20d388(0x104)]};}function f(_0x166f93){const _0x3df691=_0x455690;if(!E(_0x166f93)||!b(_0x166f93[_0x3df691(0x90)])||!T(_0x166f93[_0x3df691(0xbc)])||!T(_0x166f93[_0x3df691(0x112)])||Number(_0x166f93['knownHeadRevision'])<Number(_0x166f93['baseRevision'])||!T(_0x166f93[_0x3df691(0xa3)])||!T(_0x166f93[_0x3df691(0xf0)])||!x(_0x166f93[_0x3df691(0xcb)])||!S(_0x166f93['conflict']))throw _(_0x3df691(0xcc));return _0x166f93;}function p(_0x3a673d){const _0x154c02=_0x455690;if(!E(_0x3a673d))throw _(_0x154c02(0xa6));return{..._0x3a673d,'state':f(_0x3a673d[_0x154c02(0xab)])};}function m(_0x2fe84b,_0x1b83c1){const _0x526dfc=_0x455690;let _0x4a032c=p(_0x2fe84b);if(typeof _0x4a032c['status']!=_0x526dfc(0xdc)||!_0x1b83c1[_0x526dfc(0xe5)](_0x4a032c['status']))throw _(_0x526dfc(0xe3));return _0x4a032c;}function h(_0x13d7b2){const _0x3599e2=_0x455690;if(_0x13d7b2[_0x3599e2(0x101)]?.['startsWith'](_0x3599e2(0xb5))&&!_0x13d7b2[_0x3599e2(0x101)][_0x3599e2(0xe6)]('COLLABORATION_WORKER_')){let _0x419223=new _0x30582d(_0x13d7b2['code'],_0x13d7b2['message'],{'retryable':_0x13d7b2[_0x3599e2(0x96)]??!0x1});return _0x13d7b2['stack']!==void 0x0&&(_0x419223[_0x3599e2(0xa9)]=_0x13d7b2[_0x3599e2(0xa9)]),_0x13d7b2[_0x3599e2(0xd5)]&&Object[_0x3599e2(0x8f)](_0x419223,{'invalidatesInstance':!0x0}),_0x419223;}let _0x5b9223=Error(_0x13d7b2[_0x3599e2(0xac)]);return _0x5b9223[_0x3599e2(0xd6)]=_0x13d7b2[_0x3599e2(0xd6)],_0x13d7b2[_0x3599e2(0x101)]!==void 0x0&&Object[_0x3599e2(0x8f)](_0x5b9223,{'code':_0x13d7b2[_0x3599e2(0x101)]}),_0x13d7b2['invalidatesInstance']&&Object[_0x3599e2(0x8f)](_0x5b9223,{'invalidatesInstance':!0x0}),_0x13d7b2['stack']!==void 0x0&&(_0x5b9223[_0x3599e2(0xa9)]=_0x13d7b2[_0x3599e2(0xa9)]),_0x5b9223;}function g(_0x3a858f,_0x2c3dba){const _0x492ffc=_0x455690;return new c(_0x492ffc(0xa8),_0x3a858f,{..._0x2c3dba===void 0x0?{}:{'cause':_0x2c3dba},'invalidatesInstance':!0x0});}function _(_0x1234ba){const _0x1183cf=_0x455690;return new c(_0x1183cf(0x103),_0x1234ba,{'invalidatesInstance':!0x0});}function v(_0x507aaf){const _0x53058b=_0x455690;return E(_0x507aaf)&&Number[_0x53058b(0x99)](_0x507aaf['id'])&&(_0x507aaf[_0x53058b(0xd3)]===_0x53058b(0xa1)||_0x507aaf[_0x53058b(0xd3)]===_0x53058b(0x100));}function y(_0x4c0a60){return _0x4c0a60===0x1||_0x4c0a60===0x2||_0x4c0a60===0x3||_0x4c0a60===0x5||_0x4c0a60===0x6;}function b(_0x2105d7){const _0x2a51d7=_0x455690;return _0x2105d7==='online'||_0x2105d7===_0x2a51d7(0x8d)||_0x2105d7===_0x2a51d7(0xa2)||_0x2105d7===_0x2a51d7(0x95);}function x(_0x171af1){const _0x213d71=_0x455690;return _0x171af1===null||E(_0x171af1)&&T(_0x171af1[_0x213d71(0xbc)])&&T(_0x171af1[_0x213d71(0x10a)])&&T(_0x171af1[_0x213d71(0xc8)])&&(_0x171af1['sid']===void 0x0||typeof _0x171af1['sid']==_0x213d71(0xdc))&&(_0x171af1[_0x213d71(0xee)]===void 0x0||T(_0x171af1[_0x213d71(0xee)]));}function S(_0x513f4c){const _0x1bca7b=_0x455690;return _0x513f4c===null||E(_0x513f4c)&&(_0x513f4c[_0x1bca7b(0xfc)]===_0x1bca7b(0x10e)||_0x513f4c[_0x1bca7b(0xfc)]===_0x1bca7b(0xd2))&&(_0x513f4c[_0x1bca7b(0xdf)]==='transform-failed'||_0x513f4c[_0x1bca7b(0xdf)]===_0x1bca7b(0xc6)||_0x513f4c['reason']===_0x1bca7b(0x9d))&&typeof _0x513f4c[_0x1bca7b(0xac)]==_0x1bca7b(0xdc);}function C(_0x2ea4b1){const _0x5b5ae1=_0x455690;return Array[_0x5b5ae1(0xd1)](_0x2ea4b1)&&_0x2ea4b1['every'](_0x507fd1=>E(_0x507fd1)&&typeof _0x507fd1['id']==_0x5b5ae1(0xdc)&&_0x507fd1['id']['length']>0x0&&typeof _0x507fd1['data']=='string');}function w(_0x29696e){const _0x4556d4=_0x455690;return _0x29696e===null||typeof _0x29696e=='boolean'||typeof _0x29696e==_0x4556d4(0xdc)||typeof _0x29696e==_0x4556d4(0xbd)&&Number['isFinite'](_0x29696e)?!0x0:Array[_0x4556d4(0xd1)](_0x29696e)?_0x29696e[_0x4556d4(0xde)](w):E(_0x29696e)&&Object[_0x4556d4(0xd8)](_0x29696e)[_0x4556d4(0xde)](w);}function T(_0x4c1222){const _0x5a5d15=_0x455690;return Number[_0x5a5d15(0x99)](_0x4c1222)&&Number(_0x4c1222)>=0x0;}function E(_0x597e5f){const _0x258b8b=_0x455690;return typeof _0x597e5f==_0x258b8b(0xcf)&&!!_0x597e5f&&!Array['isArray'](_0x597e5f);}var D=0x7530,O=0x7530;function k(_0x54af05){const _0x43ef8a=_0x455690;let _0x28e32f=A(_0x54af05[_0x43ef8a(0xff)]),_0x403f58=_0x54af05[_0x43ef8a(0xfe)]??D,_0x5c1bb4=_0x54af05[_0x43ef8a(0xe8)]??O;j(_0x403f58,'openTimeoutMs'),j(_0x5c1bb4,_0x43ef8a(0xe8));let _0x483156;try{_0x483156=_0x1d77f1({'factory':{async 'create'(_0x339833){const _0xb8fdc7=_0x43ef8a;return await l({'entry':_0x28e32f,..._0x54af05[_0xb8fdc7(0x10d)]===void 0x0?{}:{'env':_0x54af05[_0xb8fdc7(0x10d)]},'init':_0x339833[_0xb8fdc7(0xe0)],'key':_0x339833[_0xb8fdc7(0xb0)],'openTimeoutMs':_0x403f58,'operationTimeoutMs':_0x5c1bb4});},async 'destroy'({instance:_0x4cff39}){const _0x57aae2=_0x43ef8a;await _0x4cff39[_0x57aae2(0xc2)]();}},..._0x54af05[_0x43ef8a(0x10c)]===void 0x0?{}:{'cache':_0x54af05[_0x43ef8a(0x10c)]},'onEvent':_0x2203b1});}catch(_0x31b000){throw M(_0x31b000);}return{async 'acquire'(_0x102426){const _0x510a3f=_0x43ef8a;let _0x386417;try{_0x386417=await _0x483156[_0x510a3f(0xf1)](_0x102426);}catch(_0x25c46a){throw M(_0x25c46a);}return _0x32f4ea(_0x386417);},async 'close'(){try{await _0x483156['close']();}catch(_0x2374f8){throw M(_0x2374f8);}}};function _0x32f4ea(_0x3d2511){const _0x2895fc=_0x43ef8a;let _0x20e702=_0x3d2511['instance'],_0x56a1af=!0x1,_0x5ba04f,_0x360e38=!0x1;return{'key':_0x3d2511[_0x2895fc(0xb0)],'unitId':_0x20e702[_0x2895fc(0xae)],'unitType':_0x20e702[_0x2895fc(0x104)],async 'getState'(){const _0xa08aa9=_0x2895fc;return await _0x3904d3(_0xa08aa9(0xab),async()=>await _0x20e702[_0xa08aa9(0xd0)]());},async 'getPendingMutations'(){const _0x4b8b49=_0x2895fc;return await _0x3904d3(_0x4b8b49(0x89),async()=>await _0x20e702[_0x4b8b49(0xe1)]());},async 'execute'(_0x3b0661){const _0x30cb90=_0x2895fc;return _0x3b0661[_0x30cb90(0xb2)]==='read'?await _0x3904d3(_0x30cb90(0xf7),async()=>await _0x20e702['executeReadCode'](_0x3b0661[_0x30cb90(0x101)])):await _0x3904d3('write',async()=>await _0x20e702[_0x30cb90(0x87)](_0x3b0661['code']));},async 'replacePendingMutations'(_0x87e8bd){const _0x20c017=_0x2895fc;return await _0x3904d3(_0x20c017(0xdb),async()=>await _0x20e702['replacePendingMutations'](_0x87e8bd));},async 'fetch'(){const _0x283c9d=_0x2895fc;return await _0x3904d3(_0x283c9d(0xba),async()=>await _0x20e702['fetch']());},async 'pull'(){const _0x5ba9d0=_0x2895fc;return await _0x3904d3(_0x5ba9d0(0x10e),async()=>await _0x20e702[_0x5ba9d0(0x10e)]());},async 'commit'(){const _0x204bdc=_0x2895fc;return await _0x3904d3('commit',async()=>await _0x20e702[_0x204bdc(0xd2)]());},async 'exportUnitData'(){return await _0x3904d3('export',async()=>await _0x20e702['exportUnitData']());},async 'invalidate'(){_0x56a1af||(_0x56a1af=!0x0,await _0x3d2511['invalidate']());},async 'release'(){const _0x171ac5=_0x2895fc;_0x56a1af||(_0x56a1af=!0x0,_0x360e38?await _0x3d2511[_0x171ac5(0xb3)]():await _0x3d2511[_0x171ac5(0xf3)]());}};async function _0x3904d3(_0x48a536,_0x31aa6e){const _0x4d7138=_0x2895fc;_0x1fdebe();try{return await _0xa81315(_0x3d2511[_0x4d7138(0xb0)],_0x48a536,_0x31aa6e);}catch(_0x46aa87){throw _0x3ef7d7(_0x46aa87),_0x46aa87;}}function _0x1fdebe(){const _0xc4fce1=_0x2895fc;if(_0x56a1af)throw new c(_0xc4fce1(0x113),_0xc4fce1(0x9a)+_0x3d2511[_0xc4fce1(0xb0)]+_0xc4fce1(0xc0));if(_0x5ba04f)throw _0x5ba04f;}function _0x3ef7d7(_0x399822){const _0x39fb8b=_0x2895fc;(_0x399822 instanceof c&&_0x399822['invalidatesInstance']||_0x399822 instanceof _0x30582d&&(_0x399822[_0x39fb8b(0x101)]===_0x39fb8b(0xbf)||_0x399822[_0x39fb8b(0x101)]===_0x39fb8b(0xec)||_0x399822['code']==='COLLABORATION_LOAD_FAILED')||typeof _0x399822==_0x39fb8b(0xcf)&&_0x399822&&_0x39fb8b(0xd5)in _0x399822&&_0x399822['invalidatesInstance']===!0x0)&&(_0x360e38=!0x0,_0x5ba04f=_0x399822,_0x42bc21({'errorCode':N(_0x399822),'key':_0x3d2511['key'],'type':_0x39fb8b(0xbb)}));}}async function _0xa81315(_0x244ca8,_0x6051d6,_0x32e9f3){const _0x911848=_0x43ef8a;let _0x13aaa5=Date[_0x911848(0x91)](),_0x4d44bc=await _0x32e9f3();return _0x42bc21({'durationMs':Date['now']()-_0x13aaa5,'key':_0x244ca8,'operation':_0x6051d6,'type':_0x911848(0x8e)}),_0x4d44bc;}function _0x2203b1(_0x345b6c){_0x42bc21(_0x345b6c);}function _0x42bc21(_0xda1640){const _0x2dc4a8=_0x43ef8a;try{_0x54af05[_0x2dc4a8(0xb7)]?.(_0xda1640);}catch{}}}function A(_0x10feaa){const _0x58c8da=_0x455690;let _0x3b45c3=_0x10feaa instanceof URL?_0x10feaa[_0x58c8da(0xb4)]:_0x10feaa;if(_0x3b45c3['length']===0x0)throw new c(_0x58c8da(0x8c),_0x58c8da(0x97));try{return new URL(_0x3b45c3)['href'];}catch{throw new c('COLLABORATION_POOL_INVALID_INPUT',_0x58c8da(0xe7));}}function j(_0x3d7052,_0x107506){const _0x3b5518=_0x455690;if(!Number[_0x3b5518(0x8b)](_0x3d7052)||_0x3d7052<=0x0)throw new c('COLLABORATION_POOL_INVALID_INPUT',_0x107506+_0x3b5518(0x102));}function _0x3990(_0x4f0bb0,_0x163587){_0x4f0bb0=_0x4f0bb0-0x87;const _0x47ac08=_0x47ac();let _0x399024=_0x47ac08[_0x4f0bb0];return _0x399024;}function M(_0x197d04){const _0x8ac19a=_0x455690;return _0x197d04 instanceof _0x864955?new c(_0x197d04['code']===_0x8ac19a(0xb8)?'COLLABORATION_POOL_CAPACITY_EXCEEDED':_0x197d04['code']===_0x8ac19a(0xc7)?_0x8ac19a(0x92):_0x8ac19a(0x8c),_0x197d04['message'],{'cause':_0x197d04}):_0x197d04;}function _0x47ac(){const _0x52ae73=['getPendingMutations','ipc','Worker\x20returned\x20an\x20invalid\x20operation\x20status','unchanged','includes','startsWith','entry\x20must\x20be\x20an\x20absolute\x20file\x20URL\x20or\x20another\x20importable\x20URL','operationTimeoutMs','pulled','2774964rkQCyz','kill','COLLABORATION_CLOSED','execute-write','reqId','.ts','bufferedChangesetCount','acquire','clear','release','signal\x20','Worker\x20returned\x20an\x20invalid\x20mutation\x20replacement\x20result','confirmed','read','worker-child.mjs','exit','1255710FszxoE','nextId','operation','unref','openTimeoutMs','entry','error','code','\x20must\x20be\x20a\x20finite\x20positive\x20number','COLLABORATION_WORKER_PROTOCOL_ERROR','unitType','UniverCollaborationRuntimePoolError','mutations','132670eUoCaQ','SIGKILL','COLLABORATION_WORKER_CLOSED','revision','open','cache','env','pull','Worker\x20returned\x20an\x20invalid\x20write\x20result','delete','34683Bwtwfy','knownHeadRevision','COLLABORATION_LEASE_CLOSED','request','executeWriteCode','timer','pending-mutations','1001LOCrrv','isFinite','COLLABORATION_POOL_INVALID_INPUT','reconnecting','operation-complete','assign','connection','now','COLLABORATION_POOL_CLOSED','worker-child.ts','value','closed','retryable','entry\x20must\x20not\x20be\x20empty','Worker\x20returned\x20an\x20invalid\x20read\x20value','isSafeInteger','Collaboration\x20runtime\x20lease\x20','advanced','previousMutationCount','permission-rejected','exit\x20code\x20','Worker\x20','reject','result','offline','pendingMutationCount','get-state','19408ubvxks','Worker\x20returned\x20an\x20invalid\x20operation\x20result','COLLABORATION_WORKER_OPEN_TIMEOUT','COLLABORATION_WORKER_CRASHED','stack','Failed\x20to\x20send\x20a\x20request\x20to\x20worker\x20','state','message','pull-required','unitId','\x20failed:\x20','key','5173JSLTcz','mode','invalidate','href','COLLABORATION_','send','onEvent','INSTANCE_POOL_CAPACITY_EXCEEDED','12865365FFRGxN','fetch','instance-failed','baseRevision','number','export','COLLABORATION_PROTOCOL_ERROR','\x20is\x20closed','up-to-date','close','get','ignore','set','changeset-rejected','INSTANCE_POOL_CLOSED','mutationCount','9228CmavkE','retry','awaitingChangeset','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20state','Worker\x20returned\x20invalid\x20UnitData','1915hdpXqR','object','getState','isArray','commit','type','Collaboration\x20worker\x20','invalidatesInstance','name','race','values','218UuiUgJ','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20metadata','replace-mutations','string','conflict','every','reason','init'];_0x47ac=function(){return _0x52ae73;};return _0x47ac();}function N(_0x2e86cf){const _0x581e11=_0x455690;return typeof _0x2e86cf==_0x581e11(0xcf)&&_0x2e86cf&&_0x581e11(0x101)in _0x2e86cf&&typeof _0x2e86cf['code']=='string'?_0x2e86cf[_0x581e11(0x101)]:'UNKNOWN';}function P(_0xf251a4){return _0xf251a4;}export{c as UniverCollaborationRuntimePoolError,k as createUniverCollaborationRuntimePool,P as defineUniverCollaborationRuntimeWorker};
|
|
1
|
+
const _0x28bde0=_0xf86d;(function(_0x2781a0,_0x400265){const _0x1bfd58=_0xf86d,_0x1fdbec=_0x2781a0();while(!![]){try{const _0x2bd671=parseInt(_0x1bfd58(0x1a6))/0x1*(parseInt(_0x1bfd58(0x17b))/0x2)+parseInt(_0x1bfd58(0x177))/0x3+parseInt(_0x1bfd58(0x19b))/0x4+parseInt(_0x1bfd58(0x13e))/0x5+parseInt(_0x1bfd58(0x19e))/0x6*(-parseInt(_0x1bfd58(0x121))/0x7)+-parseInt(_0x1bfd58(0x183))/0x8*(-parseInt(_0x1bfd58(0x15a))/0x9)+-parseInt(_0x1bfd58(0x186))/0xa;if(_0x2bd671===_0x400265)break;else _0x1fdbec['push'](_0x1fdbec['shift']());}catch(_0x222865){_0x1fdbec['push'](_0x1fdbec['shift']());}}}(_0x2544,0xdbdb5));import{InstancePoolError as _0x3dd699,createGenericKeyedInstancePool as _0x57c3e4}from'@univer-cli/generic-keyed-instance-pool';import{fork as _0x45e6bd}from'node:child_process';import{dirname as _0x4a5cd1,extname as _0x2cdc7e,join as _0x52df80}from'node:path';import{fileURLToPath as _0x1a2236}from'node:url';var s=class extends Error{[_0x28bde0(0x19c)];[_0x28bde0(0x1b1)];constructor(_0x45b75a,_0x51a8b9,_0x1a3c88={}){const _0x2fbe5e=_0x28bde0;super(_0x51a8b9,_0x1a3c88),this[_0x2fbe5e(0x178)]=_0x2fbe5e(0x1aa),this[_0x2fbe5e(0x19c)]=_0x45b75a,this[_0x2fbe5e(0x1b1)]=_0x1a3c88[_0x2fbe5e(0x1b1)]??!0x1;}},c=_0x28bde0(0x120);function l(_0x57d81d){const _0x220a94=_0x28bde0;return _0x57d81d instanceof Error&&_0x57d81d[_0x220a94(0x178)]===_0x220a94(0x120)&&_0x220a94(0x19c)in _0x57d81d&&typeof _0x57d81d['code']==_0x220a94(0x1ac);}async function u(_0x25a10f){const _0xe2a74b=_0x28bde0;let _0x320c12=_0x1a2236(import.meta.url),_0xe00363=_0x4a5cd1(_0x320c12),_0x50e89d=_0x52df80(_0xe00363,_0x2cdc7e(_0x320c12)===_0xe2a74b(0x161)?_0xe2a74b(0x136):_0xe2a74b(0x155)),_0xf16e1c=d(_0x45e6bd(_0x50e89d,[],{..._0x25a10f[_0xe2a74b(0x15e)]===void 0x0?{}:{'env':_0x25a10f['env']},'serialization':_0xe2a74b(0x14c),'stdio':[_0xe2a74b(0x165),_0xe2a74b(0x165),'ignore',_0xe2a74b(0x128)]}),_0x25a10f[_0xe2a74b(0x138)]);try{let _0x51796b=f(await _0xf16e1c[_0xe2a74b(0x15b)]({'entry':_0x25a10f[_0xe2a74b(0x18b)],'id':_0xf16e1c[_0xe2a74b(0x17c)](),'init':_0x25a10f[_0xe2a74b(0x199)],'type':_0xe2a74b(0x189)},_0x25a10f['openTimeoutMs'],_0xe2a74b(0x1a1))),_0x56d15d,_0x42f30f=async _0x42d1f2=>await _0xf16e1c[_0xe2a74b(0x15b)]({..._0x42d1f2,'id':_0xf16e1c[_0xe2a74b(0x17c)]()},_0x25a10f[_0xe2a74b(0x1a7)]);return{..._0x51796b,async 'close'(){const _0x1a59a6=_0xe2a74b;_0x56d15d??=_0xf16e1c[_0x1a59a6(0x1a8)](),await _0x56d15d;},async 'getState'(){const _0x40f45f=_0xe2a74b;return p(await _0x42f30f({'type':_0x40f45f(0x12b)}));},async 'getPendingMutations'(){const _0x2d9b85=_0xe2a74b;let _0x444ee1=await _0x42f30f({'type':_0x2d9b85(0x1a3)});if(!w(_0x444ee1))throw v(_0x2d9b85(0x122));return _0x444ee1;},async 'executeReadCode'(_0x3cba4d){const _0x199f90=_0xe2a74b;let _0x14d3b3=m(await _0x42f30f({'code':_0x3cba4d,'type':_0x199f90(0x126)}));if(!(_0x199f90(0x1ae)in _0x14d3b3)||!T(_0x14d3b3['value']))throw v(_0x199f90(0x17f));return _0x14d3b3;},async 'executeWriteCode'(_0x4ce32c){const _0x30cf05=_0xe2a74b;let _0x17cf80=m(await _0x42f30f({'code':_0x4ce32c,'type':_0x30cf05(0x190)}));if(!T(_0x17cf80[_0x30cf05(0x1ae)])||!w(_0x17cf80['mutations']))throw v(_0x30cf05(0x14a));return _0x17cf80;},async 'replacePendingMutations'(_0xe5e97f){const _0x7b4290=_0xe2a74b;let _0x14e8c1=m(await _0x42f30f({'mutations':_0xe5e97f,'type':'replace-mutations'}));if(!E(_0x14e8c1['previousMutationCount'])||!E(_0x14e8c1[_0x7b4290(0x187)]))throw v(_0x7b4290(0x1a9));return _0x14e8c1;},async 'fetch'(){const _0x2e6fe8=_0xe2a74b;return h(await _0x42f30f({'type':_0x2e6fe8(0x140)}),[_0x2e6fe8(0x14b),'fetched']);},async 'pull'(){const _0x3547df=_0xe2a74b;return h(await _0x42f30f({'type':_0x3547df(0x166)}),[_0x3547df(0x146),'pulled',_0x3547df(0x130)]);},async 'commit'(){const _0x3ee8da=_0xe2a74b;return h(await _0x42f30f({'type':'commit'}),[_0x3ee8da(0x1af),_0x3ee8da(0x1a4),'confirmed',_0x3ee8da(0x160),_0x3ee8da(0x14e),'conflict']);},async 'exportUnitData'(){const _0x4bd98a=_0xe2a74b;let _0x449836=await _0x42f30f({'type':_0x4bd98a(0x175)});if(!D(_0x449836))throw v(_0x4bd98a(0x131));return _0x449836;}};}catch(_0x2fbf38){throw await _0xf16e1c['close'](),_0x2fbf38;}}function d(_0x129ebf,_0x8278f8){const _0x3f05c3=_0x28bde0;let _0x2a7774=new Map(),_0x397849=0x0,_0x502ba3,_0x31d860=!0x1,_0x3a5af4,_0x568dc0,_0x12495c=new Promise(_0x33a88b=>{_0x568dc0=_0x33a88b;});return _0x129ebf['on'](_0x3f05c3(0x1a0),_0x4484a2=>{const _0x103edc=_0x3f05c3;if(!y(_0x4484a2))return;let _0x734c57=_0x2a7774[_0x103edc(0x16e)](_0x4484a2['id']);_0x734c57&&(_0x2a7774[_0x103edc(0x1ab)](_0x4484a2['id']),_0x734c57[_0x103edc(0x147)]&&clearTimeout(_0x734c57['timer']),_0x4484a2[_0x103edc(0x168)]===_0x103edc(0x151)?_0x734c57[_0x103edc(0x170)](g(_0x4484a2['error'])):_0x734c57[_0x103edc(0x192)](_0x4484a2[_0x103edc(0x164)]));}),_0x129ebf['on'](_0x3f05c3(0x151),_0x4d237a=>_0x4f3507(_(_0x3f05c3(0x14d)+_0x8278f8+_0x3f05c3(0x127)+_0x4d237a[_0x3f05c3(0x1a0)],_0x4d237a))),_0x129ebf['on'](_0x3f05c3(0x158),(_0x2f5657,_0xfed33a)=>{const _0x251825=_0x3f05c3;_0x31d860||_0x4f3507(_(_0x251825(0x14d)+_0x8278f8+_0x251825(0x17d)+(_0xfed33a?'signal\x20'+_0xfed33a:_0x251825(0x154)+String(_0x2f5657))));}),_0x129ebf['on']('close',()=>_0x568dc0()),{async 'close'(){if(_0x3a5af4)return await _0x3a5af4;_0x3a5af4=_0x39ae81(),await _0x3a5af4;},'nextId'(){return++_0x397849;},async 'request'(_0x25dfe8,_0x671eb9,_0xab6118='COLLABORATION_WORKER_OPERATION_TIMEOUT'){if(_0x502ba3)throw _0x502ba3;return await new Promise((_0x2ea3b4,_0x5c6365)=>{const _0x2d85d8=_0xf86d;let _0x20de21={'reject':_0x5c6365,'resolve':_0x2ea3b4,'timer':setTimeout(()=>{const _0x4e9ee9=_0xf86d;_0x4f3507(new s(_0xab6118,_0x4e9ee9(0x171)+_0x8278f8+'\x20timed\x20out\x20after\x20'+_0x671eb9+'ms',{'invalidatesInstance':!0x0})),_0x36a70b();},_0x671eb9)};_0x2a7774[_0x2d85d8(0x13f)](_0x25dfe8['id'],_0x20de21),_0x129ebf[_0x2d85d8(0x182)](_0x25dfe8,_0x28a68b=>{const _0x2813d1=_0x2d85d8;_0x28a68b&&_0x4f3507(_(_0x2813d1(0x13d)+_0x8278f8,_0x28a68b));});});}};async function _0x39ae81(){const _0x563916=_0x3f05c3;if(_0x31d860=!0x0,!_0x502ba3&&_0x129ebf[_0x563916(0x129)])try{await Promise[_0x563916(0x17a)]([new Promise((_0x442335,_0x4e66d4)=>{const _0x2640eb=_0x563916;let _0x1ac2b9=++_0x397849;_0x2a7774['set'](_0x1ac2b9,{'reject':_0x4e66d4,'resolve':_0x442335}),_0x129ebf[_0x2640eb(0x182)]({'id':_0x1ac2b9,'type':_0x2640eb(0x1a8)},_0x1e5fff=>{_0x1e5fff&&_0x4e66d4(_0x1e5fff);});}),new Promise((_0x58b39c,_0x3f7448)=>{const _0x209b9b=_0x563916;setTimeout(()=>_0x3f7448(Error(_0x209b9b(0x134))),0x1388)['unref']();})]);}catch{}_0x36a70b(),await _0x12495c,_0x4f3507(new s(_0x563916(0x18c),_0x563916(0x171)+_0x8278f8+_0x563916(0x188),{'invalidatesInstance':!0x0}));}function _0x4f3507(_0x53a3f5){const _0xf10b9c=_0x3f05c3;_0x502ba3??=_0x53a3f5;for(let _0x3a800f of _0x2a7774[_0xf10b9c(0x141)]())_0x3a800f['timer']&&clearTimeout(_0x3a800f[_0xf10b9c(0x147)]),_0x3a800f['reject'](_0x502ba3);_0x2a7774[_0xf10b9c(0x15f)]();}function _0x36a70b(){const _0x2e221f=_0x3f05c3;_0x129ebf[_0x2e221f(0x16d)]===null&&_0x129ebf[_0x2e221f(0x123)]===null&&_0x129ebf['kill'](_0x2e221f(0x172));}}function f(_0x15b0c3){const _0x22bf33=_0x28bde0;if(!D(_0x15b0c3)||typeof _0x15b0c3[_0x22bf33(0x12c)]!=_0x22bf33(0x1ac)||!b(_0x15b0c3['unitType']))throw v(_0x22bf33(0x19d));return{'unitId':_0x15b0c3[_0x22bf33(0x12c)],'unitType':_0x15b0c3['unitType']};}function p(_0x2e3fac){const _0xe348ff=_0x28bde0;if(!D(_0x2e3fac)||!x(_0x2e3fac[_0xe348ff(0x169)])||!E(_0x2e3fac[_0xe348ff(0x18a)])||!E(_0x2e3fac['knownHeadRevision'])||Number(_0x2e3fac[_0xe348ff(0x162)])<Number(_0x2e3fac['baseRevision'])||!E(_0x2e3fac['pendingMutationCount'])||!E(_0x2e3fac[_0xe348ff(0x193)])||!S(_0x2e3fac['awaitingChangeset'])||!C(_0x2e3fac[_0xe348ff(0x130)]))throw v(_0xe348ff(0x149));return _0x2e3fac;}function m(_0xa16ab4){const _0x3c2990=_0x28bde0;if(!D(_0xa16ab4))throw v(_0x3c2990(0x180));return{..._0xa16ab4,'state':p(_0xa16ab4[_0x3c2990(0x181)])};}function _0x2544(){const _0x23a372=['includes','COLLABORATION_POOL_CAPACITY_EXCEEDED','COLLABORATION_LEASE_CLOSED','execute-write','stack','resolve','bufferedChangesetCount','length','retryable','isArray','Worker\x20returned\x20an\x20invalid\x20operation\x20status','closed','init','isSafeInteger','393300BXVuaX','code','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20metadata','402UxWjqK','executeReadCode','message','COLLABORATION_WORKER_OPEN_TIMEOUT','Collaboration\x20runtime\x20lease\x20','get-pending-mutations','pull-required','reason','1731813BMXIFP','operationTimeoutMs','close','Worker\x20returned\x20an\x20invalid\x20mutation\x20replacement\x20result','UniverCollaborationRuntimePoolError','delete','string','mode','value','nothing-to-commit','status','invalidatesInstance','operation','CollaborationRuntimeError','163219CxVDrw','Worker\x20returned\x20invalid\x20pending\x20mutations','signalCode','isFinite','COLLABORATION_POOL_CLOSED','execute-read','\x20failed:\x20','ipc','connected','COLLABORATION_WORKER_PROTOCOL_ERROR','get-state','unitId','pending-mutations','COLLABORATION_WORKER_CRASHED','commit','conflict','Worker\x20returned\x20invalid\x20UnitData','acquire','cache','Worker\x20close\x20timed\x20out','onEvent','worker-child.ts','permission-rejected','key','instance-failed','href','every','transform-failed','Failed\x20to\x20send\x20a\x20request\x20to\x20worker\x20','844960sHkQMj','set','fetch','values','exportUnitData','getPendingMutations','invalidate','boolean','up-to-date','timer','executeWriteCode','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20state','Worker\x20returned\x20an\x20invalid\x20write\x20result','unchanged','advanced','Worker\x20','unknown','INSTANCE_POOL_CAPACITY_EXCEEDED','now','error','number','release','exit\x20code\x20','worker-child.mjs','getState','UNKNOWN','exit','COLLABORATION_WORKER_','11767779tdJFpR','request','startsWith','assign','env','clear','retry','.ts','knownHeadRevision','changeset-rejected','result','ignore','pull','replace-mutations','type','connection','COLLABORATION_POOL_INVALID_INPUT','unitType','reqId','exitCode','get','write','reject','Collaboration\x20worker\x20','SIGKILL','isInteger','COLLABORATION_PROTOCOL_ERROR','export','sid','320145CMTEhk','name','COLLABORATION_LOAD_FAILED','race','2tevfmk','nextId','\x20exited\x20unexpectedly\x20with\x20','openTimeoutMs','Worker\x20returned\x20an\x20invalid\x20read\x20value','Worker\x20returned\x20an\x20invalid\x20operation\x20result','state','send','8iiqYVX','object','reconnecting','9506040kFUOKw','pendingMutationCount','\x20is\x20closed','open','baseRevision','entry','COLLABORATION_WORKER_CLOSED'];_0x2544=function(){return _0x23a372;};return _0x2544();}function h(_0x2eac87,_0x447d1d){const _0x5a1761=_0x28bde0;let _0x291618=m(_0x2eac87);if(typeof _0x291618['status']!=_0x5a1761(0x1ac)||!_0x447d1d[_0x5a1761(0x18d)](_0x291618[_0x5a1761(0x1b0)]))throw v(_0x5a1761(0x197));return _0x291618;}function g(_0x144af8){const _0x2be524=_0x28bde0;let _0x23ff9a=Error(_0x144af8[_0x2be524(0x1a0)]);return _0x144af8[_0x2be524(0x19c)]?.[_0x2be524(0x15c)]('COLLABORATION_')&&!_0x144af8['code']['startsWith'](_0x2be524(0x159))?(_0x23ff9a[_0x2be524(0x178)]=c,Object['assign'](_0x23ff9a,{'code':_0x144af8[_0x2be524(0x19c)],'retryable':_0x144af8[_0x2be524(0x195)]??!0x1})):(_0x23ff9a[_0x2be524(0x178)]=_0x144af8['name'],_0x144af8[_0x2be524(0x19c)]!==void 0x0&&Object[_0x2be524(0x15d)](_0x23ff9a,{'code':_0x144af8[_0x2be524(0x19c)]})),_0x144af8[_0x2be524(0x1b1)]&&Object[_0x2be524(0x15d)](_0x23ff9a,{'invalidatesInstance':!0x0}),_0x144af8[_0x2be524(0x191)]!==void 0x0&&(_0x23ff9a[_0x2be524(0x191)]=_0x144af8[_0x2be524(0x191)]),_0x23ff9a;}function _(_0x5281a3,_0x50ff84){const _0x38f301=_0x28bde0;return new s(_0x38f301(0x12e),_0x5281a3,{..._0x50ff84===void 0x0?{}:{'cause':_0x50ff84},'invalidatesInstance':!0x0});}function _0xf86d(_0x16c4b4,_0x34de5c){_0x16c4b4=_0x16c4b4-0x11f;const _0x2544ce=_0x2544();let _0xf86d1b=_0x2544ce[_0x16c4b4];return _0xf86d1b;}function v(_0x1bd6c3){const _0x2283d5=_0x28bde0;return new s(_0x2283d5(0x12a),_0x1bd6c3,{'invalidatesInstance':!0x0});}function y(_0x3e3cd0){const _0x42b411=_0x28bde0;return D(_0x3e3cd0)&&Number[_0x42b411(0x19a)](_0x3e3cd0['id'])&&(_0x3e3cd0[_0x42b411(0x168)]===_0x42b411(0x164)||_0x3e3cd0['type']==='error');}function b(_0x20d69f){return _0x20d69f===0x1||_0x20d69f===0x2||_0x20d69f===0x3||_0x20d69f===0x5||_0x20d69f===0x6;}function x(_0x3fdf01){const _0x5cc9b7=_0x28bde0;return _0x3fdf01==='online'||_0x3fdf01===_0x5cc9b7(0x185)||_0x3fdf01==='offline'||_0x3fdf01===_0x5cc9b7(0x198);}function S(_0xd609f){const _0x29f0f0=_0x28bde0;return _0xd609f===null||D(_0xd609f)&&E(_0xd609f[_0x29f0f0(0x18a)])&&E(_0xd609f['revision'])&&E(_0xd609f['mutationCount'])&&(_0xd609f[_0x29f0f0(0x176)]===void 0x0||typeof _0xd609f[_0x29f0f0(0x176)]==_0x29f0f0(0x1ac))&&(_0xd609f[_0x29f0f0(0x16c)]===void 0x0||E(_0xd609f[_0x29f0f0(0x16c)]));}function C(_0x528e2b){const _0x332d3e=_0x28bde0;return _0x528e2b===null||D(_0x528e2b)&&(_0x528e2b[_0x332d3e(0x11f)]==='pull'||_0x528e2b[_0x332d3e(0x11f)]==='commit')&&(_0x528e2b[_0x332d3e(0x1a5)]===_0x332d3e(0x13c)||_0x528e2b[_0x332d3e(0x1a5)]===_0x332d3e(0x163)||_0x528e2b['reason']===_0x332d3e(0x137))&&typeof _0x528e2b[_0x332d3e(0x1a0)]==_0x332d3e(0x1ac)&&(_0x528e2b[_0x332d3e(0x19c)]===void 0x0||Number[_0x332d3e(0x173)](_0x528e2b['code']));}function w(_0x1498d1){const _0x275a6f=_0x28bde0;return Array[_0x275a6f(0x196)](_0x1498d1)&&_0x1498d1['every'](_0x29d9a8=>D(_0x29d9a8)&&typeof _0x29d9a8['id']=='string'&&_0x29d9a8['id'][_0x275a6f(0x194)]>0x0&&typeof _0x29d9a8['data']==_0x275a6f(0x1ac));}function T(_0x544376){const _0x1311a8=_0x28bde0;return _0x544376===null||typeof _0x544376==_0x1311a8(0x145)||typeof _0x544376=='string'||typeof _0x544376==_0x1311a8(0x152)&&Number[_0x1311a8(0x124)](_0x544376)?!0x0:Array['isArray'](_0x544376)?_0x544376[_0x1311a8(0x13b)](T):D(_0x544376)&&Object['values'](_0x544376)[_0x1311a8(0x13b)](T);}function E(_0x454c88){const _0x558ef6=_0x28bde0;return Number[_0x558ef6(0x19a)](_0x454c88)&&Number(_0x454c88)>=0x0;}function D(_0x53e0b8){const _0x15d029=_0x28bde0;return typeof _0x53e0b8=='object'&&!!_0x53e0b8&&!Array[_0x15d029(0x196)](_0x53e0b8);}var O=0x7530,k=0x7530;function A(_0x11bc17){const _0x3e45bb=_0x28bde0;let _0x284bf2=j(_0x11bc17[_0x3e45bb(0x18b)]),_0x27eb44=_0x11bc17['openTimeoutMs']??O,_0x492b4a=_0x11bc17[_0x3e45bb(0x1a7)]??k;M(_0x27eb44,_0x3e45bb(0x17e)),M(_0x492b4a,_0x3e45bb(0x1a7));let _0x21c84f;try{_0x21c84f=_0x57c3e4({'factory':{async 'create'(_0x4a2da1){const _0x3e8a9d=_0x3e45bb;return await u({'entry':_0x284bf2,..._0x11bc17[_0x3e8a9d(0x15e)]===void 0x0?{}:{'env':_0x11bc17['env']},'init':_0x4a2da1[_0x3e8a9d(0x199)],'key':_0x4a2da1[_0x3e8a9d(0x138)],'openTimeoutMs':_0x27eb44,'operationTimeoutMs':_0x492b4a});},async 'destroy'({instance:_0x453d29}){await _0x453d29['close']();}},..._0x11bc17[_0x3e45bb(0x133)]===void 0x0?{}:{'cache':_0x11bc17[_0x3e45bb(0x133)]},'onEvent':_0x25e9a3});}catch(_0x5e762e){throw N(_0x5e762e);}return{async 'acquire'(_0x5664c3){const _0x43a98c=_0x3e45bb;let _0x66bd50;try{_0x66bd50=await _0x21c84f[_0x43a98c(0x132)](_0x5664c3);}catch(_0x46d5c3){throw N(_0x46d5c3);}return _0x55c775(_0x66bd50);},async 'close'(){const _0x2620bb=_0x3e45bb;try{await _0x21c84f[_0x2620bb(0x1a8)]();}catch(_0x4885bc){throw N(_0x4885bc);}}};function _0x55c775(_0x4139d5){const _0x3a313f=_0x3e45bb;let _0x1fb504=_0x4139d5['instance'],_0x170a00=!0x1,_0x2eba9a,_0x43e9ac=!0x1;return{'key':_0x4139d5['key'],'unitId':_0x1fb504[_0x3a313f(0x12c)],'unitType':_0x1fb504[_0x3a313f(0x16b)],async 'getState'(){const _0x4c5208=_0x3a313f;return await _0x323444(_0x4c5208(0x181),async()=>await _0x1fb504[_0x4c5208(0x156)]());},async 'getPendingMutations'(){const _0x407653=_0x3a313f;return await _0x323444(_0x407653(0x12d),async()=>await _0x1fb504[_0x407653(0x143)]());},async 'execute'(_0x21b39b){const _0x36e5b0=_0x3a313f;return _0x21b39b[_0x36e5b0(0x1ad)]==='read'?await _0x323444('read',async()=>await _0x1fb504[_0x36e5b0(0x19f)](_0x21b39b[_0x36e5b0(0x19c)])):await _0x323444(_0x36e5b0(0x16f),async()=>await _0x1fb504[_0x36e5b0(0x148)](_0x21b39b['code']));},async 'replacePendingMutations'(_0x5900fa){const _0x2547c3=_0x3a313f;return await _0x323444(_0x2547c3(0x167),async()=>await _0x1fb504['replacePendingMutations'](_0x5900fa));},async 'fetch'(){const _0x372fd8=_0x3a313f;return await _0x323444('fetch',async()=>await _0x1fb504[_0x372fd8(0x140)]());},async 'pull'(){const _0x313bb8=_0x3a313f;return await _0x323444('pull',async()=>await _0x1fb504[_0x313bb8(0x166)]());},async 'commit'(){const _0x39d382=_0x3a313f;return await _0x323444(_0x39d382(0x12f),async()=>await _0x1fb504[_0x39d382(0x12f)]());},async 'exportUnitData'(){const _0x2acaa0=_0x3a313f;return await _0x323444(_0x2acaa0(0x175),async()=>await _0x1fb504[_0x2acaa0(0x142)]());},async 'invalidate'(){const _0x1bfb1f=_0x3a313f;_0x170a00||(_0x170a00=!0x0,await _0x4139d5[_0x1bfb1f(0x144)]());},async 'release'(){const _0x2214d5=_0x3a313f;_0x170a00||(_0x170a00=!0x0,_0x43e9ac?await _0x4139d5['invalidate']():await _0x4139d5[_0x2214d5(0x153)]());}};async function _0x323444(_0x1a602a,_0x39231d){_0x20799f();try{return await _0x32b417(_0x4139d5['key'],_0x1a602a,_0x39231d);}catch(_0x553bb9){throw _0x807765(_0x553bb9),_0x553bb9;}}function _0x20799f(){const _0x47a315=_0x3a313f;if(_0x170a00)throw new s(_0x47a315(0x18f),_0x47a315(0x1a2)+_0x4139d5[_0x47a315(0x138)]+_0x47a315(0x188));if(_0x2eba9a)throw _0x2eba9a;}function _0x807765(_0x2027b7){const _0x3c672d=_0x3a313f;(_0x2027b7 instanceof s&&_0x2027b7[_0x3c672d(0x1b1)]||l(_0x2027b7)&&(_0x2027b7[_0x3c672d(0x19c)]===_0x3c672d(0x174)||_0x2027b7[_0x3c672d(0x19c)]==='COLLABORATION_CLOSED'||_0x2027b7['code']===_0x3c672d(0x179))||typeof _0x2027b7==_0x3c672d(0x184)&&_0x2027b7&&_0x3c672d(0x1b1)in _0x2027b7&&_0x2027b7[_0x3c672d(0x1b1)]===!0x0)&&(_0x43e9ac=!0x0,_0x2eba9a=_0x2027b7,_0x52f1ed({'errorCode':P(_0x2027b7),'key':_0x4139d5[_0x3c672d(0x138)],'type':_0x3c672d(0x139)}));}}async function _0x32b417(_0x1203cb,_0x2b2a70,_0x5afe73){const _0x43a9=_0x3e45bb;let _0x486792=Date['now'](),_0xfba4e=await _0x5afe73();return _0x52f1ed({'durationMs':Date[_0x43a9(0x150)]()-_0x486792,'key':_0x1203cb,'operation':_0x2b2a70,'type':'operation-complete'}),_0xfba4e;}function _0x25e9a3(_0x225981){_0x52f1ed(_0x225981);}function _0x52f1ed(_0x2eff43){const _0x1befe4=_0x3e45bb;try{_0x11bc17[_0x1befe4(0x135)]?.(_0x2eff43);}catch{}}}function j(_0x16fe90){const _0x5856e4=_0x28bde0;let _0x251053=_0x16fe90 instanceof URL?_0x16fe90[_0x5856e4(0x13a)]:_0x16fe90;if(_0x251053[_0x5856e4(0x194)]===0x0)throw new s(_0x5856e4(0x16a),'entry\x20must\x20not\x20be\x20empty');try{return new URL(_0x251053)[_0x5856e4(0x13a)];}catch{throw new s(_0x5856e4(0x16a),'entry\x20must\x20be\x20an\x20absolute\x20file\x20URL\x20or\x20another\x20importable\x20URL');}}function M(_0x2f590c,_0x555b40){const _0x50c009=_0x28bde0;if(!Number[_0x50c009(0x124)](_0x2f590c)||_0x2f590c<=0x0)throw new s(_0x50c009(0x16a),_0x555b40+'\x20must\x20be\x20a\x20finite\x20positive\x20number');}function N(_0x2cab26){const _0x7a86ee=_0x28bde0;return _0x2cab26 instanceof _0x3dd699?new s(_0x2cab26[_0x7a86ee(0x19c)]===_0x7a86ee(0x14f)?_0x7a86ee(0x18e):_0x2cab26[_0x7a86ee(0x19c)]==='INSTANCE_POOL_CLOSED'?_0x7a86ee(0x125):_0x7a86ee(0x16a),_0x2cab26['message'],{'cause':_0x2cab26}):_0x2cab26;}function P(_0x328880){const _0x5607ac=_0x28bde0;return typeof _0x328880==_0x5607ac(0x184)&&_0x328880&&_0x5607ac(0x19c)in _0x328880&&typeof _0x328880[_0x5607ac(0x19c)]==_0x5607ac(0x1ac)?_0x328880['code']:_0x5607ac(0x157);}function F(_0x35cb2f){return _0x35cb2f;}export{s as UniverCollaborationRuntimePoolError,A as createUniverCollaborationRuntimePool,F as defineUniverCollaborationRuntimeWorker};
|
package/dist/worker-child.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x4dab(){const _0x3300e7=['init','Collaboration\x20worker\x20entry\x20must\x20default-export\x20a\x20worker\x20definition','retryable','close','2XMFdIY','commit','function','3352086JnDHJw','connected','getPendingMutations','send','get-pending-mutations','type','open','988350REEQEj','4947246wZBMwa','execute','16665HBloCW','replace-mutations','execute-read','unitType','default','getState','object','6789176AUNOzT','1041991PYaxLV','isSafeInteger','Collaboration\x20worker\x20is\x20already\x20open','exportUnitData','fetch','Error','stack','Collaboration\x20worker\x20is\x20not\x20open','84LTjuDz','string','closed','connection','get-state','2752365QILSlG','result','20NnwbnY','message','code','read','createRuntime','boolean','replacePendingMutations','name','write','pull'];_0x4dab=function(){return _0x3300e7;};return _0x4dab();}const _0x3e5d51=_0x1f5e;(function(_0x3462b3,_0x566fa9){const _0x45859a=_0x1f5e,_0x56e938=_0x3462b3();while(!![]){try{const _0x1f5af4=parseInt(_0x45859a(0xe1))/0x1*(parseInt(_0x45859a(0xfe))/0x2)+parseInt(_0x45859a(0xd9))/0x3*(parseInt(_0x45859a(0xe9))/0x4)+-parseInt(_0x45859a(0x108))/0x5+-parseInt(_0x45859a(0x101))/0x6+parseInt(_0x45859a(0xee))/0x7+parseInt(_0x45859a(0xe0))/0x8+parseInt(_0x45859a(0x109))/0x9*(-parseInt(_0x45859a(0xf0))/0xa);if(_0x1f5af4===_0x566fa9)break;else _0x56e938['push'](_0x56e938['shift']());}catch(_0xe8f3ab){_0x56e938['push'](_0x56e938['shift']());}}}(_0x4dab,0x84fed));var e;process['on'](_0x3e5d51(0xf1),_0x1d1e81=>{const _0x100056=_0x3e5d51;a(_0x1d1e81)&&t(_0x1d1e81)['then'](_0x607c13=>s({'id':_0x1d1e81['id'],'result':_0x607c13,'type':_0x100056(0xef)}),_0x205efe=>s({'error':o(_0x205efe,e?.[_0x100056(0xde)]()[_0x100056(0xec)]===_0x100056(0xeb)),'id':_0x1d1e81['id'],'type':'error'}));});async function t(_0x2f80ba){const _0x2c4806=_0x3e5d51;if(_0x2f80ba[_0x2c4806(0x106)]===_0x2c4806(0x107)){if(e!==void 0x0)throw Error(_0x2c4806(0xe3));let _0x58a88=await import(_0x2f80ba.entry);if(!i(_0x58a88[_0x2c4806(0xdd)]))throw Error(_0x2c4806(0xfb));return e=await _0x58a88['default']['createRuntime'](_0x2f80ba[_0x2c4806(0xfa)]),r(e);}if(_0x2f80ba['type']===_0x2c4806(0xfd))return await e?.[_0x2c4806(0xfd)](),e=void 0x0,null;let _0x295736=n();return _0x2f80ba[_0x2c4806(0x106)]===_0x2c4806(0xed)?_0x295736['getState']():_0x2f80ba['type']===_0x2c4806(0x105)?_0x295736[_0x2c4806(0x103)]():_0x2f80ba[_0x2c4806(0x106)]===_0x2c4806(0xdb)?await _0x295736[_0x2c4806(0x10a)]({'code':_0x2f80ba[_0x2c4806(0xf2)],'mode':_0x2c4806(0xf3)}):_0x2f80ba[_0x2c4806(0x106)]==='execute-write'?await _0x295736[_0x2c4806(0x10a)]({'code':_0x2f80ba[_0x2c4806(0xf2)],'mode':_0x2c4806(0xf8)}):_0x2f80ba[_0x2c4806(0x106)]===_0x2c4806(0xda)?await _0x295736[_0x2c4806(0xf6)](_0x2f80ba['mutations']):_0x2f80ba[_0x2c4806(0x106)]==='fetch'?await _0x295736[_0x2c4806(0xe5)]():_0x2f80ba[_0x2c4806(0x106)]===_0x2c4806(0xf9)?await _0x295736[_0x2c4806(0xf9)]():_0x2f80ba[_0x2c4806(0x106)]==='commit'?await _0x295736[_0x2c4806(0xff)]():await _0x295736[_0x2c4806(0xe4)]();}function n(){const _0x5b5312=_0x3e5d51;if(!e)throw Error(_0x5b5312(0xe8));return e;}function r(_0x38376e){const _0x38675b=_0x3e5d51;return{'unitId':_0x38376e['unitId'],'unitType':_0x38376e[_0x38675b(0xdc)]};}function i(_0x47226d){const _0x447392=_0x3e5d51;return typeof _0x47226d==_0x447392(0xdf)&&!!_0x47226d&&_0x447392(0xf4)in _0x47226d&&typeof _0x47226d['createRuntime']==_0x447392(0x100);}function a(_0x325e9b){const _0x3c6624=_0x3e5d51;return typeof _0x325e9b==_0x3c6624(0xdf)&&!!_0x325e9b&&'id'in _0x325e9b&&Number[_0x3c6624(0xe2)](_0x325e9b['id'])&&_0x3c6624(0x106)in _0x325e9b&&typeof _0x325e9b[_0x3c6624(0x106)]==_0x3c6624(0xea);}function _0x1f5e(_0x15e769,_0xc0f38){_0x15e769=_0x15e769-0xd9;const _0x4dab7b=_0x4dab();let _0x1f5e71=_0x4dab7b[_0x15e769];return _0x1f5e71;}function o(_0x5df99a,_0x53fd49){const _0x5ee9c5=_0x3e5d51;if(!(_0x5df99a instanceof Error))return{'invalidatesInstance':_0x53fd49,'message':String(_0x5df99a),'name':_0x5ee9c5(0xe6)};let _0x1aff5e=_0x5df99a;return{...typeof _0x1aff5e[_0x5ee9c5(0xf2)]==_0x5ee9c5(0xea)?{'code':_0x1aff5e[_0x5ee9c5(0xf2)]}:{},..._0x53fd49?{'invalidatesInstance':!0x0}:{},'message':_0x5df99a[_0x5ee9c5(0xf1)],'name':_0x5df99a[_0x5ee9c5(0xf7)],...typeof _0x1aff5e[_0x5ee9c5(0xfc)]==_0x5ee9c5(0xf5)?{'retryable':_0x1aff5e[_0x5ee9c5(0xfc)]}:{},..._0x5df99a[_0x5ee9c5(0xe7)]===void 0x0?{}:{'stack':_0x5df99a[_0x5ee9c5(0xe7)]}};}function s(_0x2b813c){const _0x9bb6c0=_0x3e5d51;process[_0x9bb6c0(0x102)]&&process[_0x9bb6c0(0x104)]?.(_0x2b813c);}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univer-cli/univer-collaboration-runtime-pool",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"README.zh-CN.md"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@univer-cli/generic-keyed-instance-pool": "1.
|
|
22
|
-
"@univer-cli/univer-collaboration-runtime": "1.
|
|
23
|
-
"@univerjs/protocol": "1.
|
|
21
|
+
"@univer-cli/generic-keyed-instance-pool": "1.3.1",
|
|
22
|
+
"@univer-cli/univer-collaboration-runtime": "1.3.1",
|
|
23
|
+
"@univerjs/protocol": "1.3.1"
|
|
24
24
|
}
|
|
25
25
|
}
|