@univerjs-pro/collaboration-client 0.22.0 → 0.22.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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3b1eba=_0x428e;(function(_0x3d742c,_0x162225){const _0x268863=_0x428e,_0x561d0c=_0x3d742c();while(!![]){try{const _0xc4204a=parseInt(_0x268863(0x1d1))/0x1+-parseInt(_0x268863(0x216))/0x2+parseInt(_0x268863(0x24b))/0x3*(-parseInt(_0x268863(0x359))/0x4)+-parseInt(_0x268863(0x1d4))/0x5+parseInt(_0x268863(0x3cf))/0x6+-parseInt(_0x268863(0x346))/0x7+-parseInt(_0x268863(0x32f))/0x8*(-parseInt(_0x268863(0x368))/0x9);if(_0xc4204a===_0x162225)break;else _0x561d0c['push'](_0x561d0c['shift']());}catch(_0x2a9db2){_0x561d0c['push'](_0x561d0c['shift']());}}}(_0x14c3,0x3f324));import{CollaborationEvent,CompressMutationService,EmptyMutationInfo,ISnapshotServerService,ITransformService,RevisionService,SnapshotService,UniverCollaborationPlugin,b64DecodeUnicode,isTransformChangesetsSuccess,isTransformMutationsWithChangesetFailure,isTransformMutationsWithChangesetSuccess,mapDocumentTypeToUniverInstanceType,parseChangesetToProtocol,parseProtocolChangeset,textEncoder,uuidv4}from'@univerjs-pro/collaboration';import{CommandType,DependentOn,Disposable,DisposableCollection,IAuthzIoService,ICommandService,IConfigService,IContextService,ILogService,IMentionIOService,IPermissionService,IUndoRedoService,IUniverInstanceService,Inject,Injector,JSONX,LocalUndoRedoService,LocaleService,MentionType,Optional,Plugin,Quantity,Rectangle,RxDisposable,Tools,UniverInstanceType,UserManagerService,Workbook,createIdentifier,generateRandomId,isInternalEditorID,merge,mergeOverrideWithDependencies,registerDependencies,resolveWithBasePath,sequenceExecute,toDisposable,touchDependencies}from'@univerjs/core';import{RichTextEditingMutation}from'@univerjs/docs';import{InsertSheetMutation,SetSelectionsOperation,SheetPermissionInitController,SheetsSelectionsService,WorkbookEditablePermission}from'@univerjs/sheets';import{BehaviorSubject,ReplaySubject,Subject,concatMap,firstValueFrom,map,merge as _0x320b7e,of,shareReplay,take,takeUntil}from'rxjs';import{CmdRspCode,CombCmd,ErrorCode,FileSource}from'@univerjs/protocol';import{ITelemetryService}from'@univerjs/telemetry';import{delay,filter,map as _0x30c3d0,take as _0x4732e1,takeUntil as _0x29ea2e}from'rxjs/operators';import{HTTPRequest,HTTPService,ISocketService,MergeInterceptorFactory,ThresholdInterceptorFactory,UniverNetworkPlugin}from'@univerjs/network';import{UniverLicensePlugin,getGlobalObject}from'@univerjs-pro/license';import{DRAWING_IMAGE_ALLOW_IMAGE_LIST,IImageIoService,ImageSourceType,ImageUploadStatusType,getDrawingImageAllowSize}from'@univerjs/drawing';import{cbc}from'@noble/ciphers/aes.js';import{concatBytes,randomBytes,utf8ToBytes}from'@noble/ciphers/utils.js';function _0x14c3(){const _0x508237=['_config','size','not_collab','_collaborationTimeoutTimer','_commandService','range','UNIVER_DOC','_submitChangeset','localeService','[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!','onTransformRemoteChangesetByStateCache','CHANGESET_REJ','RECV','onTransformState','_httpService','_eventService','_snapshotServerService','encrypt','conflict','_cfgEnableObjInherit','authzUrl','JOIN_ROOM_FAILED','_onConnectionFailed','cfgEnableObjInherit','findIndex','/-/object/-/batch_allowed','PSEUDO_FETCH_MISSING_RESULT','getMember','{fileID}','filter','reqId','_acknowledgedAwaitingRevision','missingChangesets','LIVESHARE_TERMINATE','socket$','JOIN_ROOM_PERMISSION_DENIED','onCommentUpdate','fetchThroughInterceptors','/universer-api/authz','collaborators','onStateChange','onMutationExecutedForCollab','/object/','packageName','[PendingState]:\x20received\x20acknowledgement.','deepClone','_collaborationUIEventService','objects','_onRemoteChangeset','post','_rescheduleHeartbeat','_getUploadFileURL','loadUnitOfRevision','onRemoteRej','DEFAULT_FILE_NAME','onSendChangeset','appendMutation','online$','[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.','[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20','getUnit','readAsDataURL','SUBMIT_CHANGESET_TIMEOUT','reduce','_schedule','withCredentials','addHandlerCallback','_injector','_roomMembers','_onRemoteRejected','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','update','put','sessionStatus$','CHANGESET_SHOULD_RETRY','get','_initUnitPermissionChange','message$','JOIN_ROOM_FULL','_retryCount','commentUpdateEvent','executeCommand','_resendWithTimeout','method','_unitInfo$','transformUndoRedo','asObservable','_revisionService','_commentUpdate$','CONFLICT','from','_createSocket','getSheetBlock','_unitID','_clearRetryConnectingTimer','apply','ERROR_IMAGE','uniscriptRunEvent','patch','HEARTBEAT_INTERVAL','_imageSourceCache','add','onLocalMutation','_status$','LIVESHARE_FETCH_OPERATIONS','HEARTBEAT_TIMEOUT','allowed','_getRedoStack','_onRemoteRetry','stopTime','_awaitingChangeset','session.room-full','_unlockTransition','listRoles','_memberService','unsubscribe','LEAVE','loadSheet','fetching\x20the\x20latest\x20document\x20from\x20the\x20server.','slice','newCsEvent','deleteCollaborator','emitEvent','version','_networkConditionService','_init','_updateLocalCache','downloadEndpointUrl','POST','subUnitId','_event$','startsWith','HELLO','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','_fetchMissChangesets','_initDependencies','_socketMessageSubscription','_getLoginPath','/role','c1Prime','responseType','getCollabEntity','updatePermissionPoint','/-/object/list','_queuedRemoteChangesets','/fetchmissing?from=','UNIVER_SHEET','SHOULD_CLOSE_CONN','getCurrentUser','confirm','awaitingChangeset','getTypeOfUnitDisposed$','_sendHeartbeat','[CollaborationEntity]','JOINING','actions','pauseCollaboration','[SyncedState]:\x20received\x20acknowledgement.','open$','_handleRemoteChangesets','prototype','defineProperty','waitForRoom$','onSyncEditingCollabCursor','_disableEditing','getCollabEntity$','onRemoteAck','_getSendChangesetTimeout','_getUndoStack','/unit/','_createHandler','getTypeOfUnitAdded$','_waitForHeartbeatResponse','transformSelections','isPermissionRej','_showConflictNotification','onRemoteChangeset','x-univer-host','_sessions','transformStack\x20failed!','SOCKET_FAILED','_decreaseWaiting','UNIVER_COLLABORATION_CLIENT_PLUGIN','[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.','init','[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.','getFocusedUnit','10376HJxGub','now','awaiting','startTime','function','has','debug','editing\x20status\x20changed\x20to','_resendTimeout','[PendingState]:\x20received\x20rejection.','[CollaborationSession]','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','resend','shouldCloseConn','/universer-api/stream/file/upload','saveSheetBlock','_substituteUndoStack','ERROR_EXCEED_SIZE','_initCloseConn','_onUserLeave','baseRev','getMemberID','enableOfflineEditing','772772HZUHEd','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','fetch_missing','_toggleOffline','_permissionService','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!','disposeWithMe','next','reject','Failed\x20to\x20update\x20permission\x20point','_listenToNetworkCondition','_updateState','_incrementRevisionNumber','_waitCount','onTransformIME','unitId','length','getActiveSheet','event$','60012ZRmcsv','body','PERMISSION_DENIED','_initRequestHeader','onTransformSelections','delete','objectType','Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','objectID','collabSubmitChangesetUrl','_singleActiveUnitService','getResourcesRequest','LIVESHARE_OPERATION','encodeURIComponent','1791mxwrwy','_snapshotService','_clearScheduledTask','_stopTelemetryCollaborationNewChangeset','telemetry\x20info\x20is\x20not\x20initialized','unit-cache-','SNAPSHOT_URL_KEY','/object','PERMISSION_REJ','fromCharCode','onMissingChangesets','sendChangesetTimeout','_logService','_changesetReqId','[OfflineState]:\x20received\x20rejection.','splice','HEARTBEAT','socket\x20open.','close$','_clearCollaborationTimeoutTimer','removeMember','@univerjs-pro/collaboration-client','setWaitCount','COMPRESS_MUTATION_SEND','_instanceService','send','sort','_sender','_onJoinRoomEvent','code','[DataLoaderService]','forEach','title','reconnect','_throwTelemetryCollaborationNewChangeset','url','[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!','_undoStacks','USERS_ENTER','catch','_scheduleCollaborationTimeoutTimer','_updateStatus','updateOfflineData','/collaborator','_HTTPService','subscribe','sessionStatus','clear','getLatestCsReqIdBySid','_getDownloadEndpointURL','SOCKET_FAILED_RETRY','capture','_createInitialState','session','_collaborationSessionService','failed\x20to\x20apply\x20missed\x20changesets!','/allowed','rev','univer-pro.collaboration-client-socket-service','incrementRevOfUnit','synced','duration','_getCurrentRevision','isArray','sid','_joinRoom','GLOBAL_ROOMS_CNT_EXCEEDS','LOCAL_CACHE_INTERVAL','unitID','subject','textRanges','unit','object','getCfgEnableObjInherit','_onMessage','transformMutationsWithChangeset','state$','commentUpdate$','[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.','AWAITING','SUBMIT_CHANGESET','_clearUndo','max','UPDATE_PERMISSION_OBJ','createSocket','[CollaborationUndoRedoService]','collaboration-client.config','saveImage','toString','_undoRedoService','_applyRemoteChangeset','_onUserJoin','parse','_maxTotalRetryTimeout','focused$','setConfig','_createInitialStateImpl','onStarting','entityInit$','close','MUTATION','_socket','_onFetchMissResult','1814076lwEyJk','PENDING','requireSession','/resources','objectActions','revision','onload','_onCombEvent','_entityInit$','routeKey','fetchMiss','_transformUndoredo','BASE64','pipe','loadDoc','LIVESHARE_REQUEST_HOST','enableAuthServer','[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!','/universer-api/snapshot','floor','_executeRemoteChangeset','FETCH_MISSING','_compressMutationService','userID','UPDATE_CURSOR','stringify','_clearRedo','refreshPermission','collaMsg','OFFLINE','_sendHeartbeatTimer','_configService','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','_state','session.join-failed','[PendingState]:\x20unhandled\x20univer\x20type:\x20','editingUnit','_userManagerService','MSG_FOR_ERROR','_substituteRedoStack','submit\x20changeset\x20error!','_transformRemoteChangesetByIMECache','CLOSE_ROOM','Error\x20on\x20receiving\x20event','_tryReconnect','resourceIDs','snapshotServerUrl','includes','type','_shouldReportTelemetry','members','_clearLocalCache','_replaceFileID','_timeoutTimer','_commentService','roomInfos','_changesetSessionId','getInterceptPoints','[CollaborationState]:\x20apply\x20error!','_registerDependencies','list','unitInfo$','/new_changes','unknown','_localCacheService','univer-pro.collaboration-client.network-condition.service','cmd','state','_onConflict','OTHER_CLIENTS_EDITING','getUnitId','_exhaustRemoteChangesetQueue','disableLocalCache','_onLocalMutation','_getCtorByUniverInstanceType','?size=','/block/','socket\x20close','_onConnectionOpen','interceptor','[SyncedState]:\x20received\x20rejection.','_replayCachedMutations','getUnitType','data','[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!','originalMeta','name','closeSession','memberID','toggleOffline','_pendingMutations','/universer-api/user/session-ticket','auth.needGotoLoginAlert','_candidateSocket','initWorkbookPermissionChange','NEW_CHANGESETS','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','_socketReady','getTime','_univerInstanceService','_localeService','_collaborationPaused','/universer-api/snapshot/','create','values','headers','FETCH_MISS','joinEvent','UnitEmbedded','push','_roomCreated$','decorate','NO_OTHER_CLIENTS_EDITING','332354YwnfjQ','dispose','transformChangesets','628515JcJNfl','_transformStateCache','loadOfflineData','localCacheService','dispose$','_transitionLocked','csAckEvent','_transformSelections','_startCollaboration','encode','[CollaborationEntity]:\x20cannot\x20lock\x20transition\x20twice!\x20This\x20is\x20an\x20implementation\x20error,\x20meaning\x20you\x20transit\x20the\x20collaboration\x20state\x20again\x20in\x20the\x20process\x20of\x20a\x20previous\x20transition.\x20This\x20should\x20never\x20happen.','_transformStack','connection\x20error','Univer','univer-pro.collaboration-client.single-active-unit-service','_syncEditingCollabCursor','socketService','RETRY_CONNECTING_MAX_COUNT','_remoteChangesetQueue','updateMember','\x20to\x20','_clearTimeoutTimer','m2Prime','_getAPIPrefix','session.room-cnt-exceeds','INGEST','toPrimitive','error','set','NOT_COLLAB','undefined','joinRsp','addImageSourceCache','complete','_transformRemoteChangesetByStateCache','_retryConnectingTimer','setCfgEnableObjInherit','members$','href','awaiting_with_pending','JOIN','_clearHeartbeatTimer','fetching\x20missing\x20changesets\x20from\x20','registerHTTPInterceptor','fetchMissingChangesets','[CollaborationSessionService]','_change$','COMPRESS_MUTATION_APPLY','_acknowledgeAwaiting','updatePermissionObjEvent','OTHER_CLIENT_EDITING','_scheduleCompleteTimestamp','onTransformRemoteChangesetByIMECache','_resendTimer','_transformAndApplyRemoteChangeset','pending','_emitMembers','min','&to=','fromCollab','liveShareOperation','_lockTransition','_entities','_transformIMECache','workbook','batchAllowed','375620DsBnNh','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','createCollaborator','onlyLocal','COMMENT_UPDATE','_getSignURL','getConfig','IDLE','_tryEnsureSocket','requestParams','/rev/','\x20-\x20','roles','call','&source=','error$','save\x20fail\x20reason\x20is\x20','eventID','UUID','toggleOnline','[OfflineState]:\x20received\x20changeset.','liveShareNewHost','_state$','_transformService','_isPermissionRej','__splitChunk__','_initMergeInterceptor','updateCollaborator','params','_sessionStatus$','loginUrlKey','avatar','map','_members$','equals','_toggleOnline','append','getSnapshotAPIPath','_socketService','ONLINE','CHANGESET_ACK','updateCursorEvent','_sendingTimer','unitId\x20is\x20not\x20found','_acknowledgeAwaitingIfReady','[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.','[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.','origin','string','infoRsp','location','_onOffline','_telemetryInfo','42kgwczT','getDeserializedSheetBlock','_getAPIPrefixPath','_sheetTransformSelectionsService','createInstance','_telemetryService','_redoStacks','_checkMissing','LIVESHARE_NEW_HOST','getCurrentRevOfUnit','symbol','getImageSourceCache','_socket$','_members','_handlerCallback','mutations','[OfflineState]:\x20received\x20acknowledgement.','AWAITING_WITH_PENDING','\x0aCurrent:\x20','onMissedChangesetFetched','readyForCollab','reverse','offline','getRoom','_onRemoteACK','updateSnapshot','getValue','find','USERS_LEAVE','_handler','_type','file','iterator','_onRecvEvent','status$','enableCollaboration','setCurrentUser','collaboratorID','onRemoteRetry','getAllMembers','status'];_0x14c3=function(){return _0x508237;};return _0x14c3();}const DEFAULT_SNAPSHOT_SERVER_URL=_0x3b1eba(0x3e1),SNAPSHOT_URL_KEY=_0x3b1eba(0x36e),DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL='ws://127.0.0.1:8000/universer-api/comb/connect',DEFAULT_WS_SESSION_TICKET_URL=_0x3b1eba(0x1bb),HEARTBEAT_INTERVAL_KEY=_0x3b1eba(0x2d7),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY=_0x3b1eba(0x2dd),DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x3b1eba(0x1e5),LOCAL_CACHE_INTERVAL_KEY=_0x3b1eba(0x3ab),LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL='/universer-api/comb',DEFAULT_LOGIN_URL='/universer-api/oidc/authpage',REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x3b1eba(0x2ba),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT='/universer-api/uniscript',TELEMETRY_COLLABORATION_NEW_CHANGESET='collaboration_new_changeset';function summaryChangesetSize(_0x3de147){const _0x5eaceb=_0x3b1eba;return JSON['stringify'](_0x3de147)[_0x5eaceb(0x356)];}function _typeof(_0x2ff7d5){'@babel/helpers - typeof';const _0x2029eb=_0x3b1eba;return _typeof=_0x2029eb(0x333)==typeof Symbol&&'symbol'==typeof Symbol[_0x2029eb(0x26b)]?function(_0x35e0c9){return typeof _0x35e0c9;}:function(_0x5ece5b){const _0x15610a=_0x2029eb;return _0x5ece5b&&_0x15610a(0x333)==typeof Symbol&&_0x5ece5b['constructor']===Symbol&&_0x5ece5b!==Symbol[_0x15610a(0x314)]?_0x15610a(0x255):typeof _0x5ece5b;},_typeof(_0x2ff7d5);}function toPrimitive(_0x17e3a6,_0x294c28){const _0x5d8882=_0x3b1eba;if('object'!=_typeof(_0x17e3a6)||!_0x17e3a6)return _0x17e3a6;var _0x57e3cd=_0x17e3a6[Symbol[_0x5d8882(0x1ee)]];if(void 0x0!==_0x57e3cd){var _0x5a501b=_0x57e3cd[_0x5d8882(0x223)](_0x17e3a6,_0x294c28||'default');if(_0x5d8882(0x3b0)!=_typeof(_0x5a501b))return _0x5a501b;throw new TypeError(_0x5d8882(0x3ef));}return(_0x5d8882(0x246)===_0x294c28?String:Number)(_0x17e3a6);}function toPropertyKey(_0x4eff7f){const _0x37103c=_0x3b1eba;var _0x30f3bf=toPrimitive(_0x4eff7f,_0x37103c(0x246));return _0x37103c(0x255)==_typeof(_0x30f3bf)?_0x30f3bf:_0x30f3bf+'';}function _defineProperty(_0x1a7993,_0x2e9ccd,_0x5ba6ff){const _0x104855=_0x3b1eba;return(_0x2e9ccd=toPropertyKey(_0x2e9ccd))in _0x1a7993?Object[_0x104855(0x315)](_0x1a7993,_0x2e9ccd,{'value':_0x5ba6ff,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1a7993[_0x2e9ccd]=_0x5ba6ff,_0x1a7993;}let CollaborationUIEventId=function(_0x5660f3){const _0x4c0fe0=_0x3b1eba;return _0x5660f3[_0x4c0fe0(0x206)]=_0x4c0fe0(0x206),_0x5660f3[_0x4c0fe0(0x35b)]=_0x4c0fe0(0x35b),_0x5660f3['CONFLICT']=_0x4c0fe0(0x2cd),_0x5660f3[_0x4c0fe0(0x3f9)]=_0x4c0fe0(0x3f9),_0x5660f3['JOIN_ROOM_FAILED']=_0x4c0fe0(0x289),_0x5660f3[_0x4c0fe0(0x39a)]=_0x4c0fe0(0x39a),_0x5660f3[_0x4c0fe0(0x328)]='SOCKET_FAILED',_0x5660f3[_0x4c0fe0(0x2b2)]=_0x4c0fe0(0x2b2),_0x5660f3;}({});var CollaborationUIEventService=class{constructor(){const _0x46daf9=_0x3b1eba;_defineProperty(this,_0x46daf9(0x2f6),new Subject()),_defineProperty(this,'event$',this[_0x46daf9(0x2f6)]['asObservable']());}[_0x3b1eba(0x2ee)](_0x3ad5c4){const _0x1bbe5d=_0x3b1eba;this['_event$'][_0x1bbe5d(0x34d)](_0x3ad5c4);}},CommentService=class{constructor(){const _0x37e45a=_0x3b1eba;_defineProperty(this,_0x37e45a(0x2cc),new Subject()),_defineProperty(this,_0x37e45a(0x3b5),this[_0x37e45a(0x2cc)][_0x37e45a(0x2ca)]());}['onCommentUpdate'](_0x49e92b){const _0x5931fd=_0x3b1eba;this[_0x5931fd(0x2cc)][_0x5931fd(0x34d)](_0x49e92b);}};function __decorateParam(_0xf13c9c,_0x39c235){return function(_0x523e70,_0x36445e){_0x39c235(_0x523e70,_0x36445e,_0xf13c9c);};}function __decorate(_0x3323b9,_0x6e2094,_0x1857de,_0xbf1f2b){const _0x3e0041=_0x3b1eba;var _0x31cbd4=arguments[_0x3e0041(0x356)],_0x282938=_0x31cbd4<0x3?_0x6e2094:_0xbf1f2b===null?_0xbf1f2b=Object['getOwnPropertyDescriptor'](_0x6e2094,_0x1857de):_0xbf1f2b,_0x437d0d;if(typeof Reflect===_0x3e0041(0x3b0)&&typeof Reflect[_0x3e0041(0x1cf)]===_0x3e0041(0x333))_0x282938=Reflect['decorate'](_0x3323b9,_0x6e2094,_0x1857de,_0xbf1f2b);else{for(var _0x73784d=_0x3323b9['length']-0x1;_0x73784d>=0x0;_0x73784d--)if(_0x437d0d=_0x3323b9[_0x73784d])_0x282938=(_0x31cbd4<0x3?_0x437d0d(_0x282938):_0x31cbd4>0x3?_0x437d0d(_0x6e2094,_0x1857de,_0x282938):_0x437d0d(_0x6e2094,_0x1857de))||_0x282938;}return _0x31cbd4>0x3&&_0x282938&&Object[_0x3e0041(0x315)](_0x6e2094,_0x1857de,_0x282938),_0x282938;}let MemberService=class MemberService extends Disposable{constructor(_0x25263e,_0x18214d){const _0x47877d=_0x3b1eba;super(),this[_0x47877d(0x1c3)]=_0x25263e,this[_0x47877d(0x3f4)]=_0x18214d,_defineProperty(this,_0x47877d(0x2b8),new Map()),_defineProperty(this,_0x47877d(0x1ce),new Subject()),this[_0x47877d(0x34c)](_0x320b7e(this['_univerInstanceService'][_0x47877d(0x30b)](UniverInstanceType[_0x47877d(0x306)])['pipe'](_0x30c3d0(_0x46f568=>_0x46f568[_0x47877d(0x1a6)]())),this[_0x47877d(0x1c3)][_0x47877d(0x30b)](UniverInstanceType[_0x47877d(0x27a)])['pipe'](_0x30c3d0(_0x551b2d=>_0x551b2d['getUnitId']())))['subscribe'](_0x5707d6=>this['_removeRoom'](_0x5707d6)));}[_0x3b1eba(0x316)](_0x3fb719){const _0x3d5617=_0x3b1eba;if(this[_0x3d5617(0x2b8)][_0x3d5617(0x334)](_0x3fb719))return of(this[_0x3d5617(0x2b8)][_0x3d5617(0x2bf)](_0x3fb719));return this[_0x3d5617(0x1ce)][_0x3d5617(0x3dc)](_0x30c3d0(_0x494e31=>{const _0x2b95d2=_0x3d5617;if(_0x494e31===_0x3fb719)return this['_roomMembers'][_0x2b95d2(0x2bf)](_0x494e31);}));}[_0x3b1eba(0x26f)](_0x4d356c){const _0x3c9d44=_0x3b1eba;this[_0x3c9d44(0x3f4)]['setCurrentUser'](_0x4d356c);}[_0x3b1eba(0x308)](){const _0x31b526=_0x3b1eba;return this[_0x31b526(0x3f4)]['getCurrentUser']();}[_0x3b1eba(0x1e7)](_0x48940b,_0x1b808f){const _0x21a8f1=_0x3b1eba;let _0x120c3=this['_roomMembers'][_0x21a8f1(0x2bf)](_0x48940b);!_0x120c3&&(_0x120c3=new RoomMember(),this['_roomMembers'][_0x21a8f1(0x1f0)](_0x48940b,_0x120c3),this[_0x21a8f1(0x1ce)][_0x21a8f1(0x34d)](_0x48940b)),_0x120c3[_0x21a8f1(0x1e7)](_0x1b808f);}[_0x3b1eba(0x37c)](_0x324cd6,_0x4409c0){const _0x262fef=_0x3b1eba,_0x2922af=this[_0x262fef(0x2b8)][_0x262fef(0x2bf)](_0x324cd6);if(_0x2922af)_0x2922af[_0x262fef(0x37c)](_0x4409c0);}[_0x3b1eba(0x262)](_0x3ce882){return this['_roomMembers']['get'](_0x3ce882);}[_0x3b1eba(0x28f)](_0x463dab,_0x5b56a6){const _0x5b0d97=_0x3b1eba,_0x8cca78=this['_roomMembers'][_0x5b0d97(0x2bf)](_0x463dab);if(_0x8cca78)return _0x8cca78['getMember'](_0x5b56a6);}['_removeRoom'](_0x2fbdf4){const _0x231104=_0x3b1eba,_0x189a22=this[_0x231104(0x2b8)]['get'](_0x2fbdf4);_0x189a22&&(_0x189a22[_0x231104(0x1d2)](),this[_0x231104(0x2b8)][_0x231104(0x35e)](_0x2fbdf4));}['dispose'](){const _0x12bd30=_0x3b1eba;this[_0x12bd30(0x2b8)][_0x12bd30(0x387)](_0x176082=>_0x176082[_0x12bd30(0x1d2)]()),this[_0x12bd30(0x2b8)][_0x12bd30(0x397)](),this[_0x12bd30(0x1ce)]['complete']();}};MemberService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(UserManagerService))],MemberService);var RoomMember=class extends Disposable{constructor(..._0x10307a){const _0x3216e8=_0x3b1eba;super(..._0x10307a),_defineProperty(this,_0x3216e8(0x258),new Map()),_defineProperty(this,_0x3216e8(0x237),new BehaviorSubject(this[_0x3216e8(0x258)])),_defineProperty(this,_0x3216e8(0x1f9),this[_0x3216e8(0x237)][_0x3216e8(0x2ca)]());}[_0x3b1eba(0x1d2)](){const _0x22ce39=_0x3b1eba;this[_0x22ce39(0x258)][_0x22ce39(0x397)](),this['_members$'][_0x22ce39(0x1f5)]();}['updateMember'](_0x56a4ac){const _0x551ffe=_0x3b1eba;this[_0x551ffe(0x258)]['set'](_0x56a4ac[_0x551ffe(0x1b8)],_0x56a4ac),this['_emitMembers']();}[_0x3b1eba(0x37c)](_0x2b8c99){const _0x5b282a=_0x3b1eba;this[_0x5b282a(0x258)][_0x5b282a(0x35e)](_0x2b8c99),this[_0x5b282a(0x20c)]();}[_0x3b1eba(0x28f)](_0x21b167){const _0x3ba888=_0x3b1eba;return this[_0x3ba888(0x258)][_0x3ba888(0x2bf)](_0x21b167);}[_0x3b1eba(0x272)](){const _0x531b0d=_0x3b1eba;return Array[_0x531b0d(0x2ce)](this[_0x531b0d(0x258)][_0x531b0d(0x1c8)]());}[_0x3b1eba(0x20c)](){const _0x116bf0=_0x3b1eba;this['_members$'][_0x116bf0(0x34d)](this[_0x116bf0(0x258)]);}};let SessionStatus=function(_0x149ed2){const _0x5a8414=_0x3b1eba;return _0x149ed2[_0x149ed2[_0x5a8414(0x21d)]=0x0]=_0x5a8414(0x21d),_0x149ed2[_0x149ed2[_0x5a8414(0x30e)]=0x1]=_0x5a8414(0x30e),_0x149ed2[_0x149ed2[_0x5a8414(0x3ec)]=0x2]=_0x5a8414(0x3ec),_0x149ed2[_0x149ed2[_0x5a8414(0x23d)]=0x3]=_0x5a8414(0x23d),_0x149ed2;}({});const FailedReason={[CmdRspCode['FAIL']]:_0x3b1eba(0x3f1),[CmdRspCode[_0x3b1eba(0x2c2)]]:_0x3b1eba(0x2e3),[CmdRspCode['JOIN_ROOM_NOT_EXISTS']]:'session.room-not-exists',[CmdRspCode[_0x3b1eba(0x297)]]:'session.room-permission-denied',[CmdRspCode[_0x3b1eba(0x3aa)]]:_0x3b1eba(0x1ec)};let CollaborationSession=class CollaborationSession extends RxDisposable{get[_0x3b1eba(0x396)](){const _0x472e4f=_0x3b1eba;return this[_0x472e4f(0x233)][_0x472e4f(0x265)]();}constructor(_0x362ae8,_0x4dfd41,_0x143846,_0x4d8a78,_0x1f017b,_0x48a220,_0x5ab118,_0x106fd1){const _0x45081c=_0x3b1eba;super(),this[_0x45081c(0x2d1)]=_0x362ae8,this[_0x45081c(0x374)]=_0x143846,this[_0x45081c(0x3ee)]=_0x4d8a78,this[_0x45081c(0x2e6)]=_0x1f017b,this[_0x45081c(0x405)]=_0x48a220,this[_0x45081c(0x2a2)]=_0x5ab118,this['_telemetryService']=_0x106fd1,_defineProperty(this,_0x45081c(0x233),new BehaviorSubject(0x0)),_defineProperty(this,_0x45081c(0x2bd),this['_sessionStatus$'][_0x45081c(0x2ca)]()),_defineProperty(this,'_event$',new Subject()),_defineProperty(this,'event$',this[_0x45081c(0x2f6)]['asObservable']()),_defineProperty(this,_0x45081c(0x3cd),void 0x0),_defineProperty(this,_0x45081c(0x2fc),void 0x0),_defineProperty(this,_0x45081c(0x277),void 0x0),_defineProperty(this,_0x45081c(0x400),![]),_defineProperty(this,_0x45081c(0x24a),null),this[_0x45081c(0x400)]=!!this[_0x45081c(0x250)],_0x4dfd41[_0x45081c(0x3dc)](takeUntil(this[_0x45081c(0x1d8)]))['subscribe'](_0x4d7254=>{const _0x86ac6a=_0x45081c;if(typeof _0x4d7254===_0x86ac6a(0x1f2))return;this[_0x86ac6a(0x3cd)]=_0x4d7254;if(_0x4d7254)this[_0x86ac6a(0x3a9)](_0x4d7254),this[_0x86ac6a(0x2fc)]=_0x4d7254[_0x86ac6a(0x2c1)][_0x86ac6a(0x395)](_0x56470f=>{const _0x3230c9=_0x86ac6a;if(_0x56470f[_0x3230c9(0x3d8)]!==this[_0x3230c9(0x2d1)])return;this['_onCombEvent'](_0x56470f);});else{var _0x3022a5;this['_throwTelemetryCollaborationNewChangeset'](),this[_0x86ac6a(0x233)][_0x86ac6a(0x34d)](0x2),(_0x3022a5=this[_0x86ac6a(0x2fc)])===null||_0x3022a5===void 0x0||_0x3022a5[_0x86ac6a(0x2e7)](),this[_0x86ac6a(0x2fc)]=null;}});}['getMemberID'](){const _0x3e2ba9=_0x3b1eba;var _0x306d9b,_0x4d1c76;return(_0x306d9b=(_0x4d1c76=this['_socket'])===null||_0x4d1c76===void 0x0?void 0x0:_0x4d1c76[_0x3e2ba9(0x1b8)])!==null&&_0x306d9b!==void 0x0?_0x306d9b:null;}[_0x3b1eba(0x1d2)](){const _0xdea0f1=_0x3b1eba;super[_0xdea0f1(0x1d2)](),this[_0xdea0f1(0x3cb)](),this['dispose$']['next'](),this[_0xdea0f1(0x1d8)][_0xdea0f1(0x1f5)]();}[_0x3b1eba(0x3cb)](){const _0x3c845d=_0x3b1eba;var _0x51d165,_0x1eb0b6;this[_0x3c845d(0x38a)](),(_0x51d165=this['_socket'])===null||_0x51d165===void 0x0||_0x51d165[_0x3c845d(0x381)]({'cmd':CombCmd[_0x3c845d(0x2e8)],'data':{'roomID':this['_unitID']}}),(_0x1eb0b6=this['_socket'])===null||_0x1eb0b6===void 0x0||_0x1eb0b6['close'](),this[_0x3c845d(0x2f6)][_0x3c845d(0x1f5)](),this[_0x3c845d(0x233)][_0x3c845d(0x1f5)]();}[_0x3b1eba(0x3d6)](_0x278cd8){const _0x5a9631=_0x3b1eba;if(_0x278cd8[_0x5a9631(0x1a2)]===CombCmd[_0x5a9631(0x1fc)])this[_0x5a9631(0x384)](_0x278cd8);else{if(_0x278cd8[_0x5a9631(0x1a2)]===CombCmd[_0x5a9631(0x280)])this[_0x5a9631(0x26c)](_0x278cd8);}}[_0x3b1eba(0x3a9)](_0x14d60c){const _0x80d5b1=_0x3b1eba;this[_0x80d5b1(0x233)]['next'](0x1),_0x14d60c[_0x80d5b1(0x381)]({'cmd':CombCmd[_0x80d5b1(0x1fc)],'routeKey':this[_0x80d5b1(0x2d1)],'routeType':'','data':{'rooms':[{'roomID':this['_unitID']}]}});}['_onJoinRoomEvent'](_0x2dd3a9){const _0x1f23c1=_0x3b1eba;var _0x1cee70;if(_0x2dd3a9[_0x1f23c1(0x385)]in FailedReason){this[_0x1f23c1(0x2a2)]['emitEvent']({'id':'JOIN_ROOM_FAILED','data':FailedReason[_0x2dd3a9['code']]}),this['_sessionStatus$'][_0x1f23c1(0x34d)](0x2);return;}this[_0x1f23c1(0x233)][_0x1f23c1(0x34d)](0x3);const _0x1fc432=(_0x1cee70=_0x2dd3a9['data'][_0x1f23c1(0x406)][this['_unitID']])===null||_0x1cee70===void 0x0?void 0x0:_0x1cee70[_0x1f23c1(0x401)];if(_0x1fc432)_0x1fc432[_0x1f23c1(0x387)](_0x368094=>this['_memberService'][_0x1f23c1(0x1e7)](this[_0x1f23c1(0x2d1)],_0x368094));}[_0x3b1eba(0x26c)](_0x405cae){const _0x1ab428=_0x3b1eba;try{const _0x1bfb13=_0x405cae['data'];switch(_0x1bfb13[_0x1ab428(0x227)]){case CollaborationEvent[_0x1ab428(0x38e)]:this[_0x1ab428(0x3c3)](_0x1bfb13),this['_event$']['next'](_0x1bfb13);break;case CollaborationEvent[_0x1ab428(0x267)]:this[_0x1ab428(0x342)](_0x1bfb13),this['_event$']['next'](_0x1bfb13);break;case CollaborationEvent[_0x1ab428(0x23e)]:case CollaborationEvent[_0x1ab428(0x2be)]:this[_0x1ab428(0x36b)](),this[_0x1ab428(0x37b)](),this['_event$']['next'](_0x1bfb13);break;case CollaborationEvent[_0x1ab428(0x3f5)]:this[_0x1ab428(0x374)][_0x1ab428(0x1ef)](_0x1ab428(0x226)+JSON['stringify'](_0x1bfb13)),this[_0x1ab428(0x2f6)][_0x1ab428(0x34d)](_0x1bfb13);break;case CollaborationEvent[_0x1ab428(0x21a)]:this[_0x1ab428(0x405)][_0x1ab428(0x298)](_0x1bfb13['data']),this['_event$'][_0x1ab428(0x34d)](_0x1bfb13);break;default:this[_0x1ab428(0x2f6)][_0x1ab428(0x34d)](_0x1bfb13);}}catch(_0xdabcb4){this[_0x1ab428(0x374)][_0x1ab428(0x1ef)](_0xdabcb4,_0x405cae);}}['_onUserJoin'](_0xc369b7){const _0x5e841f=_0x3b1eba;this[_0x5e841f(0x2e6)]['updateMember'](this[_0x5e841f(0x2d1)],_0xc369b7[_0x5e841f(0x1b3)]);}[_0x3b1eba(0x342)](_0x2e4a4c){const _0xbd5234=_0x3b1eba;this[_0xbd5234(0x2e6)][_0xbd5234(0x37c)](this[_0xbd5234(0x2d1)],_0x2e4a4c[_0xbd5234(0x1b3)][_0xbd5234(0x1b8)]);}async[_0x3b1eba(0x381)](_0x4b566f,_0x405041){const _0xf3b030=_0x3b1eba;if(this[_0xf3b030(0x396)]!==0x3||!this[_0xf3b030(0x3cd)])throw new Error(_0xf3b030(0x33a));try{_0x4b566f['eventID']===CollaborationEvent['SUBMIT_CHANGESET']&&(this[_0xf3b030(0x390)](),this['_startTelemetryCollaborationNewChangeset'](_0x4b566f)),this[_0xf3b030(0x3cd)][_0xf3b030(0x381)]({'cmd':CombCmd[_0xf3b030(0x1ed)],'routeKey':_0x405041,'routeType':'','data':_0x4b566f});}catch(_0x4d6d4f){this['_logService'][_0xf3b030(0x1ef)](_0x4d6d4f);}}[_0x3b1eba(0x390)](){const _0x456f9a=_0x3b1eba;var _0x24bd0d;this[_0x456f9a(0x277)]=setTimeout(()=>{this['_collaborationTimeoutTimer']=null,this['_collaborationUIEventService']['emitEvent']({'id':'SUBMIT_CHANGESET_TIMEOUT'});},(_0x24bd0d=this[_0x456f9a(0x3ee)][_0x456f9a(0x21c)](_0x456f9a(0x2dd)))!==null&&_0x24bd0d!==void 0x0?_0x24bd0d:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x3b1eba(0x37b)](){const _0x10a823=_0x3b1eba;this[_0x10a823(0x277)]&&(clearTimeout(this['_collaborationTimeoutTimer']),this['_collaborationTimeoutTimer']=null);}['_startTelemetryCollaborationNewChangeset'](_0x12dfdf){const _0x3b96b3=_0x3b1eba;if(!this[_0x3b96b3(0x400)])return;const {data:_0x5887cf}=_0x12dfdf,{unitID:_0x33c2af,changeset:_0x1ec25e}=_0x5887cf,{mutations:_0x15e368,type:_0x1b74b5}=_0x1ec25e;this[_0x3b96b3(0x24a)]={'unitId':_0x33c2af,'type':_0x1b74b5,'startTime':performance[_0x3b96b3(0x330)](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0x15e368)};}[_0x3b1eba(0x36b)](){const _0x245d1a=_0x3b1eba;if(!this[_0x245d1a(0x400)])return;if(!this[_0x245d1a(0x24a)]){this[_0x245d1a(0x374)][_0x245d1a(0x1ef)](_0x245d1a(0x339),_0x245d1a(0x36c));return;}this[_0x245d1a(0x24a)][_0x245d1a(0x2e1)]=performance[_0x245d1a(0x330)](),this['_telemetryInfo'][_0x245d1a(0x3a5)]=this['_telemetryInfo'][_0x245d1a(0x2e1)]-this['_telemetryInfo'][_0x245d1a(0x332)],this['_telemetryService'][_0x245d1a(0x39b)](TELEMETRY_COLLABORATION_NEW_CHANGESET,this['_telemetryInfo']),this['_telemetryInfo']=null;}[_0x3b1eba(0x38a)](){this['_telemetryInfo']=null;}};CollaborationSession=__decorate([__decorateParam(0x2,ILogService),__decorateParam(0x3,IConfigService),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,Inject(CommentService)),__decorateParam(0x6,Inject(CollaborationUIEventService)),__decorateParam(0x7,Optional(ITelemetryService))],CollaborationSession);const ILocalCacheService=createIdentifier('collaboration-client.local-cache-service');function getLocalCacheKey(_0x4462ce){const _0x3c0236=_0x3b1eba;return _0x3c0236(0x36d)+_0x4462ce;}function extractTargetFromFirstChangeset(_0x92d050){const _0x59720a=_0x3b1eba,{unitID:_0x50716b,mutations:_0x640844}=_0x92d050;return{'unitId':_0x50716b,'subUnitId':_0x640844[_0x59720a(0x356)]>0x0?_0x640844[0x0][_0x59720a(0x232)][_0x59720a(0x2f5)]:null};}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x1a3a00,_0x1719d2,_0x582451){const _0x54095b=_0x3b1eba;this[_0x54095b(0x2b7)]=_0x1a3a00,this['_transformService']=_0x1719d2,this[_0x54095b(0x380)]=_0x582451;}[_0x3b1eba(0x321)](_0xd11346){const _0x27707d=_0x3b1eba;var _0x5c84dc,_0x1b00f0;const _0x41fe66=this[_0x27707d(0x2b7)]['get'](SheetsSelectionsService),{unitId:_0x4d05ab,subUnitId:_0x426894}=extractTargetFromFirstChangeset(_0xd11346),_0x19d65b=_0x41fe66===null||_0x41fe66===void 0x0?void 0x0:_0x41fe66['getWorkbookSelections'](_0x4d05ab)['getCurrentSelections'](),_0x4cfc76=(_0x5c84dc=this[_0x27707d(0x380)][_0x27707d(0x2b0)](_0x4d05ab))===null||_0x5c84dc===void 0x0||(_0x5c84dc=_0x5c84dc[_0x27707d(0x357)]())===null||_0x5c84dc===void 0x0?void 0x0:_0x5c84dc['getSheetId']();if(_0x19d65b['length']===0x0||!_0x4d05ab||!_0x426894)return;const _0x42ff4c=[{'id':SetSelectionsOperation['id'],'params':{'unitId':_0x4d05ab,'subUnitId':_0x4cfc76,'selections':Tools[_0x27707d(0x2a1)](_0x19d65b)}}],_0x5569cf=this[_0x27707d(0x22d)][_0x27707d(0x3b3)](_0xd11346,_0x42ff4c);if(!isTransformMutationsWithChangesetSuccess(_0x5569cf))throw _0x5569cf[_0x27707d(0x1ef)];const _0x29a057=(_0x1b00f0=_0x5569cf[_0x27707d(0x1ea)][0x0])===null||_0x1b00f0===void 0x0||(_0x1b00f0=_0x1b00f0[_0x27707d(0x232)])===null||_0x1b00f0===void 0x0?void 0x0:_0x1b00f0['selections'];if(Array[_0x27707d(0x3a7)](_0x29a057)&&_0x29a057[_0x27707d(0x356)]){if(_0x29a057[_0x27707d(0x356)]===_0x42ff4c[0x0][_0x27707d(0x232)]['selections'][_0x27707d(0x356)]&&_0x29a057['every']((_0x8a0aa6,_0x279776)=>Rectangle[_0x27707d(0x238)](_0x8a0aa6['range'],_0x42ff4c[0x0]['params']['selections'][_0x279776][_0x27707d(0x279)])))return;this[_0x27707d(0x2b7)][_0x27707d(0x2bf)](ICommandService)[_0x27707d(0x2c5)](SetSelectionsOperation['id'],{'unitId':_0x4d05ab,'subUnitId':_0x4cfc76,'selections':_0x29a057});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService),__decorateParam(0x2,IUniverInstanceService)],SheetTransformSelectionsService);const ISingleActiveUnitService=createIdentifier(_0x3b1eba(0x1e2));let UnitStatus=function(_0x5230e9){const _0x3992e9=_0x3b1eba;return _0x5230e9[_0x5230e9['NO_OTHER_CLIENTS_EDITING']=0x0]=_0x3992e9(0x1d0),_0x5230e9[_0x5230e9[_0x3992e9(0x1a5)]=0x1]=_0x3992e9(0x1a5),_0x5230e9;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY=_0x3b1eba(0x3be),configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x478dfa){const _0xf33084=_0x3b1eba;var _0xcc08df;return!!((_0xcc08df=_0x478dfa['params'])===null||_0xcc08df===void 0x0?void 0x0:_0xcc08df[_0xf33084(0x22f)]);}const SINGLE_CHANGESET_MUTATIONS=new Set([InsertSheetMutation['id']]);function assembleSheetChangeset(_0x47f307,_0x120dac,_0x497f43,_0x1b3340,_0x499712){const _0x5cc8ce=_0x3b1eba;var _0x46e74f,_0x3cf207,_0x1a7ecc,_0xfd0b0f;const _0x2b0d66=[];for(const _0x4947ac of _0x47f307){if(SINGLE_CHANGESET_MUTATIONS[_0x5cc8ce(0x334)](_0x4947ac['id'])){if(_0x2b0d66['length']>0x0)break;_0x2b0d66[_0x5cc8ce(0x1cd)](_0x4947ac);break;}if(isSplitChunkMutation(_0x4947ac)){if(_0x2b0d66[_0x5cc8ce(0x356)]>0x0)break;_0x2b0d66[_0x5cc8ce(0x1cd)](_0x4947ac);break;}_0x2b0d66[_0x5cc8ce(0x1cd)](_0x4947ac);}const _0x23796b=(_0x46e74f=(_0x3cf207=_0x499712[_0x5cc8ce(0x308)]())===null||_0x3cf207===void 0x0?void 0x0:_0x3cf207['userID'])!==null&&_0x46e74f!==void 0x0?_0x46e74f:_0x5cc8ce(0x19f),_0x58abb5=(_0x1a7ecc=(_0xfd0b0f=_0x499712[_0x5cc8ce(0x308)]())===null||_0xfd0b0f===void 0x0?void 0x0:_0xfd0b0f['memberID'])!==null&&_0x1a7ecc!==void 0x0?_0x1a7ecc:_0x5cc8ce(0x19f);return{'changeset':{'unitID':_0x120dac,'type':mapDocumentTypeToUniverInstanceType(_0x497f43[_0x5cc8ce(0x1b2)](_0x120dac)),'baseRev':_0x1b3340['getCurrentRevOfUnit'](_0x120dac),'revision':0x0,'userID':_0x23796b,'memberID':_0x58abb5,'mutations':_0x2b0d66},'pendingMutations':_0x47f307[_0x5cc8ce(0x2eb)](_0x2b0d66[_0x5cc8ce(0x356)])};}function assembleDocChangeset(_0x38558e,_0x12630a,_0x4c1334,_0x3576e1,_0x59e8f0){const _0x4bc962=_0x3b1eba;var _0x2849d5,_0x30d7ce,_0x2880ba,_0x5ba3eb;const _0x40c45c=[_0x38558e[_0x4bc962(0x2b3)]((_0x53bdfb,_0x22820d)=>{const _0xc9fa39=_0x4bc962;var _0xbca3c6;const {id:_0x87140a}=_0x53bdfb,{id:_0x37f511,type:_0x122c96}=_0x22820d,_0x5bf035=(_0xbca3c6=_0x53bdfb[_0xc9fa39(0x232)])!==null&&_0xbca3c6!==void 0x0?_0xbca3c6:{'actions':null},_0x4ff687=_0x22820d[_0xc9fa39(0x232)];if(_0x87140a&&_0x87140a!==_0x37f511)throw new Error(_0xc9fa39(0x360)+_0x87140a+_0xc9fa39(0x221)+_0x37f511+'.');return{..._0x53bdfb,'id':_0x37f511,'type':_0x122c96,'params':{'unitId':_0x4ff687['unitId'],'textRanges':_0x4ff687[_0xc9fa39(0x3ae)],'actions':JSONX['compose'](_0x5bf035[_0xc9fa39(0x30f)],_0x4ff687[_0xc9fa39(0x30f)])}};},{})],_0x13f7be=(_0x2849d5=(_0x30d7ce=_0x59e8f0[_0x4bc962(0x308)]())===null||_0x30d7ce===void 0x0?void 0x0:_0x30d7ce[_0x4bc962(0x3e6)])!==null&&_0x2849d5!==void 0x0?_0x2849d5:_0x4bc962(0x19f),_0x5dc6ec=(_0x2880ba=(_0x5ba3eb=_0x59e8f0[_0x4bc962(0x308)]())===null||_0x5ba3eb===void 0x0?void 0x0:_0x5ba3eb[_0x4bc962(0x1b8)])!==null&&_0x2880ba!==void 0x0?_0x2880ba:'unknown';return{'changeset':{'unitID':_0x12630a,'type':mapDocumentTypeToUniverInstanceType(_0x4c1334[_0x4bc962(0x1b2)](_0x12630a)),'baseRev':_0x3576e1['getCurrentRevOfUnit'](_0x12630a),'revision':0x0,'userID':_0x13f7be,'memberID':_0x5dc6ec,'mutations':_0x40c45c},'pendingMutations':[]};}function createTimerObservable$(_0x4ee494,_0x458687){const _0x32b809=_0x3b1eba,_0x41a3bf=new ReplaySubject(0x1);return setTimeout(()=>_0x41a3bf[_0x32b809(0x34d)](_0x458687),_0x4ee494),_0x41a3bf[_0x32b809(0x2ca)]()[_0x32b809(0x3dc)](take(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0x213a47){const _0x47aa05=_0x3b1eba;return _0x213a47[_0x47aa05(0x1f1)]=_0x47aa05(0x276),_0x213a47['SYNCED']=_0x47aa05(0x3a4),_0x213a47[_0x47aa05(0x3d0)]=_0x47aa05(0x20b),_0x213a47[_0x47aa05(0x3b7)]=_0x47aa05(0x331),_0x213a47[_0x47aa05(0x25c)]=_0x47aa05(0x1fb),_0x213a47[_0x47aa05(0x1ca)]=_0x47aa05(0x348),_0x213a47[_0x47aa05(0x2cd)]=_0x47aa05(0x286),_0x213a47[_0x47aa05(0x3ec)]=_0x47aa05(0x261),_0x213a47;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x461e36,_0x570733,_0x472a59,_0x19beb3,_0x5888e7,_0x6d36c8,_0x221753,_0x5fb36e,_0x15692d){const _0xe51ab7=_0x3b1eba;this[_0xe51ab7(0x3ac)]=_0x461e36,this[_0xe51ab7(0x3ff)]=_0x570733,this[_0xe51ab7(0x268)]=_0x5888e7,this[_0xe51ab7(0x278)]=_0x6d36c8,this[_0xe51ab7(0x3c1)]=_0x221753,this[_0xe51ab7(0x2cb)]=_0x5fb36e,this[_0xe51ab7(0x1a0)]=_0x15692d,_defineProperty(this,_0xe51ab7(0x2e2),null),_defineProperty(this,_0xe51ab7(0x1ba),[]),this['_awaitingChangeset']=_0x472a59,this['_pendingMutations']=_0x19beb3;}[_0x3b1eba(0x252)](_0xd61e66){const _0x4d7b76=_0x3b1eba,_0x1f23e5=this[_0x4d7b76(0x2cb)]['getCurrentRevOfUnit'](this[_0x4d7b76(0x3ac)]);if(_0xd61e66[_0x4d7b76(0x3d4)]>_0x1f23e5+0x1)return this[_0x4d7b76(0x268)]['onMissingChangesets']({'from':_0x1f23e5,'to':_0xd61e66[_0x4d7b76(0x3d4)]-0x1}),!![];return![];}[_0x3b1eba(0x3da)](_0x39696d){const _0x6e0ab6=_0x3b1eba;this['_undoRedoService'][_0x6e0ab6(0x2c9)](this[_0x6e0ab6(0x3ac)],_0x39696d);}[_0x3b1eba(0x1db)](_0x2df810){const _0x1d6c10=_0x3b1eba;var _0x28076b,_0x35e71d;(_0x28076b=(_0x35e71d=this[_0x1d6c10(0x268)])[_0x1d6c10(0x35d)])===null||_0x28076b===void 0x0||_0x28076b['call'](_0x35e71d,_0x2df810);}['_transformIMECache'](_0x2edfde){const _0x298319=_0x3b1eba;var _0xd9635d,_0x2f4992;return(_0xd9635d=(_0x2f4992=this[_0x298319(0x268)])[_0x298319(0x354)])===null||_0xd9635d===void 0x0?void 0x0:_0xd9635d[_0x298319(0x223)](_0x2f4992,_0x2edfde);}[_0x3b1eba(0x1d5)](_0xc07f7e){const _0x57defd=_0x3b1eba;var _0x366dbb,_0x3a848e;return(_0x366dbb=(_0x3a848e=this[_0x57defd(0x268)])[_0x57defd(0x281)])===null||_0x366dbb===void 0x0?void 0x0:_0x366dbb[_0x57defd(0x223)](_0x3a848e,_0xc07f7e);}[_0x3b1eba(0x3f8)](_0x3b96f7){const _0x16b73c=_0x3b1eba;var _0x1a638c,_0x30ac84,_0x1b22f5;return(_0x1a638c=(_0x30ac84=(_0x1b22f5=this[_0x16b73c(0x268)])[_0x16b73c(0x208)])===null||_0x30ac84===void 0x0?void 0x0:_0x30ac84[_0x16b73c(0x223)](_0x1b22f5,_0x3b96f7))!==null&&_0x1a638c!==void 0x0?_0x1a638c:_0x3b96f7;}['_transformRemoteChangesetByStateCache'](_0x249278){const _0x2e01ac=_0x3b1eba;var _0x588fd5,_0x55dd2c,_0x13ef27;return(_0x588fd5=(_0x55dd2c=(_0x13ef27=this[_0x2e01ac(0x268)])[_0x2e01ac(0x27e)])===null||_0x55dd2c===void 0x0?void 0x0:_0x55dd2c[_0x2e01ac(0x223)](_0x13ef27,_0x249278))!==null&&_0x588fd5!==void 0x0?_0x588fd5:_0x249278;}['_syncEditingCollabCursor'](_0x2582d4){const _0x351459=_0x3b1eba;if(this['type']===UniverInstanceType[_0x351459(0x27a)]){const {unitID:_0x2ce5ae,mutations:_0x515e35,memberID:_0x59040e}=_0x2582d4,_0x38bc05=_0x515e35['length']>0x0?_0x515e35[0x0][_0x351459(0x232)][_0x351459(0x3ae)]:[];if(Array[_0x351459(0x3a7)](_0x38bc05)&&_0x38bc05[_0x351459(0x356)]>0x0){var _0x3bd2bd,_0x59c71a;(_0x3bd2bd=(_0x59c71a=this[_0x351459(0x268)])['onSyncEditingCollabCursor'])===null||_0x3bd2bd===void 0x0||_0x3bd2bd[_0x351459(0x223)](_0x59c71a,{'unitID':_0x2ce5ae,'memberID':_0x59040e,'textRanges':_0x38bc05});}}}['_updateLocalCache'](){const _0x18c206=_0x3b1eba;var _0x31a25b;(_0x31a25b=this['_localCacheService'])===null||_0x31a25b===void 0x0||_0x31a25b[_0x18c206(0x392)](this[_0x18c206(0x3ac)],this[_0x18c206(0x3ff)],this[_0x18c206(0x2e2)],this['_pendingMutations']);}['_getCurrentRevision'](){const _0x5853fc=_0x3b1eba;return this['_revisionService'][_0x5853fc(0x254)](this[_0x5853fc(0x3ac)]);}[_0x3b1eba(0x352)](){const _0x146d87=_0x3b1eba;this[_0x146d87(0x2cb)][_0x146d87(0x3a3)](this[_0x146d87(0x3ac)]);}[_0x3b1eba(0x3e3)](_0x174001){const _0x1ccacd=_0x3b1eba;let _0x5b06aa=this[_0x1ccacd(0x3f8)](_0x174001);_0x5b06aa=this[_0x1ccacd(0x1f6)](_0x5b06aa);const _0x509a91=sequenceExecute(_0x5b06aa[_0x1ccacd(0x25a)],this['_commandService'],{'fromCollab':!![]});if(!_0x509a91['result']){var _0x17132f;if(_0x509a91[_0x1ccacd(0x1ef)]instanceof Error)throw _0x509a91[_0x1ccacd(0x1ef)];throw new Error((_0x17132f=_0x509a91['error'])!==null&&_0x17132f!==void 0x0?_0x17132f:_0x1ccacd(0x19a));}this[_0x1ccacd(0x213)](_0x5b06aa),this[_0x1ccacd(0x1d5)](_0x5b06aa),this[_0x1ccacd(0x3da)](_0x174001),this[_0x1ccacd(0x1db)](_0x5b06aa),this[_0x1ccacd(0x1e3)](_0x5b06aa),this['_incrementRevisionNumber']();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x29e4a8,_0x107d10,_0x2c9ad9,_0x476664,_0x346449,_0x5aec0c,_0x537665,_0x2752cd,_0x199d4a,_0xe9d88e){const _0xda4444=_0x3b1eba;super(_0x29e4a8,_0x107d10,null,[],_0x2c9ad9,_0x537665,_0x5aec0c,_0x476664,_0xe9d88e),this[_0xda4444(0x2b7)]=_0x346449,this[_0xda4444(0x374)]=_0x2752cd,this['_transformService']=_0x199d4a,this[_0xda4444(0x1d7)]=_0xe9d88e,_defineProperty(this,_0xda4444(0x273),_0xda4444(0x3a4));}[_0x3b1eba(0x2ac)](_0x452864){const _0x4b25db=_0x3b1eba,_0x4eed30=this['_injector'][_0x4b25db(0x24f)](PendingState,this[_0x4b25db(0x3ac)],this[_0x4b25db(0x3ff)],[_0x452864],this[_0x4b25db(0x268)]);return _0x4eed30['_schedule'](),_0x4eed30[_0x4b25db(0x2f2)](),_0x4eed30;}[_0x3b1eba(0x324)](_0x2dfebd){const _0x151f7a=_0x3b1eba;if(this[_0x151f7a(0x252)](_0x2dfebd))return this[_0x151f7a(0x2b7)][_0x151f7a(0x24f)](FetchingMissState,this[_0x151f7a(0x3ac)],this['type'],null,[],null,[_0x2dfebd],this[_0x151f7a(0x268)]);try{const _0x37d65b=this['_transformService'][_0x151f7a(0x3b3)](_0x2dfebd,[EmptyMutationInfo]);if(isTransformMutationsWithChangesetSuccess(_0x37d65b)){const {c1Prime:_0x596785}=_0x37d65b;return this['_executeRemoteChangeset'](_0x596785),this;}throw _0x37d65b['error'];}catch(_0x6077f1){return this[_0x151f7a(0x374)][_0x151f7a(0x1ef)](_0x6077f1),this[_0x151f7a(0x1a4)](![]);}}[_0x3b1eba(0x1a4)](_0x4ae110){const _0x2f96ba=_0x3b1eba;return this['_injector']['createInstance'](ConflictState,this[_0x2f96ba(0x3ac)],this['type'],null,[],this[_0x2f96ba(0x268)],_0x4ae110);}['onRemoteAck'](_0x39f60e){const _0x3761d7=_0x3b1eba;if(_0x39f60e[_0x3761d7(0x3d4)]<=this[_0x3761d7(0x3a6)]())return this;throw new Error(_0x3761d7(0x311));}['onRemoteRej'](){const _0x242edd=_0x3b1eba;throw new Error(_0x242edd(0x1b0));}[_0x3b1eba(0x271)](){return this;}['toggleOffline'](){const _0x3cfb46=_0x3b1eba;return this[_0x3cfb46(0x2b7)][_0x3cfb46(0x24f)](OfflineState,this[_0x3cfb46(0x3ac)],this[_0x3cfb46(0x3ff)],null,[],this[_0x3cfb46(0x268)]);}[_0x3b1eba(0x229)](){return this;}[_0x3b1eba(0x33b)](){const _0x46ade7=_0x3b1eba;throw new Error(_0x46ade7(0x32b));}[_0x3b1eba(0x3d9)](){const _0x6ec793=_0x3b1eba,_0x2217f1=this[_0x6ec793(0x2cb)]['getCurrentRevOfUnit'](this[_0x6ec793(0x3ac)]);return this['_handler'][_0x6ec793(0x372)]({'from':_0x2217f1,'to':0x0}),this[_0x6ec793(0x2b7)]['createInstance'](FetchingMissState,this[_0x6ec793(0x3ac)],this['type'],null,[],null,[],this['_handler']);}};SyncedState=__decorate([__decorateParam(0x3,Inject(RevisionService)),__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,IUndoRedoService),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,Optional(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x144455,_0x10fe4a,_0x56251c,_0x5f31ce,_0x32ddc5,_0x8c93f6,_0x38699c,_0x1f216a,_0x469115,_0x53b260,_0x3e8eee,_0x86bf6f,_0x56fc31,_0x15d446){const _0x150ab5=_0x3b1eba;super(_0x144455,_0x10fe4a,null,_0x56251c,_0x5f31ce,_0x469115,_0x56fc31,_0x8c93f6,_0x15d446),this[_0x150ab5(0x2b7)]=_0x32ddc5,this[_0x150ab5(0x2e6)]=_0x38699c,this[_0x150ab5(0x374)]=_0x1f216a,this[_0x150ab5(0x3ee)]=_0x53b260,this[_0x150ab5(0x22d)]=_0x3e8eee,this[_0x150ab5(0x1c3)]=_0x86bf6f,_defineProperty(this,_0x150ab5(0x273),_0x150ab5(0x20b)),_defineProperty(this,'_scheduleCompleteTimestamp',null),_defineProperty(this,_0x150ab5(0x240),null);}['appendMutation'](_0x5bc0e3){const _0x4f5f0f=_0x3b1eba;return this[_0x4f5f0f(0x1ba)]['push'](_0x5bc0e3),this[_0x4f5f0f(0x2f2)](),this;}[_0x3b1eba(0x324)](_0x43932c){const _0x1db7de=_0x3b1eba;if(this[_0x1db7de(0x252)](_0x43932c))return this[_0x1db7de(0x36a)](),this['_injector']['createInstance'](FetchingMissState,this[_0x1db7de(0x3ac)],this[_0x1db7de(0x3ff)],null,this[_0x1db7de(0x1ba)],null,[_0x43932c],this['_handler']);try{const _0x3fcfaa=this[_0x1db7de(0x22d)]['transformMutationsWithChangeset'](_0x43932c,this[_0x1db7de(0x1ba)]);if(isTransformMutationsWithChangesetSuccess(_0x3fcfaa)){const {c1Prime:_0x563ada,m2Prime:_0x281cef}=_0x3fcfaa;this[_0x1db7de(0x3e3)](_0x563ada);const _0x2bab7f=this['_injector'][_0x1db7de(0x24f)](_PendingState,this['unitID'],this['type'],_0x281cef,this[_0x1db7de(0x268)]);this[_0x1db7de(0x36a)]();const _0x17caf4=new Date()['getTime'](),_0x375da7=this[_0x1db7de(0x207)]?Math[_0x1db7de(0x3ba)](this[_0x1db7de(0x207)]-_0x17caf4,0x0):this[_0x1db7de(0x31b)]();return _0x2bab7f[_0x1db7de(0x2b4)](_0x375da7),_0x2bab7f;}throw _0x3fcfaa[_0x1db7de(0x1ef)];}catch(_0x5c3452){return this[_0x1db7de(0x374)][_0x1db7de(0x1ef)](_0x5c3452),this['_onConflict'](![]);}}[_0x3b1eba(0x31a)](_0x405fee){const _0x483d30=_0x3b1eba;if(_0x405fee['revision']<=this[_0x483d30(0x3a6)]())return this;throw new Error(_0x483d30(0x2a0));}[_0x3b1eba(0x2a9)](){const _0x9fcfbd=_0x3b1eba;throw new Error(_0x9fcfbd(0x338));}[_0x3b1eba(0x271)](){return this;}['toggleOffline'](){const _0x54f26f=_0x3b1eba;return this[_0x54f26f(0x36a)](),this[_0x54f26f(0x2b7)]['createInstance'](OfflineState,this[_0x54f26f(0x3ac)],this[_0x54f26f(0x3ff)],null,this['_pendingMutations'],this['_handler']);}[_0x3b1eba(0x229)](){return this;}[_0x3b1eba(0x2b4)](_0x1c801b){const _0x3cd87b=_0x3b1eba,_0x2af71a=_0x1c801b!==null&&_0x1c801b!==void 0x0?_0x1c801b:this[_0x3cd87b(0x31b)]();this[_0x3cd87b(0x207)]=new Date()[_0x3cd87b(0x1c2)]()+_0x2af71a,this['_sendingTimer']=setTimeout(()=>{const _0x367e56=_0x3cd87b;this[_0x367e56(0x36a)]();let _0x188f36=null;switch(this['type']){case UniverInstanceType[_0x367e56(0x306)]:_0x188f36=assembleSheetChangeset(this[_0x367e56(0x1ba)],this[_0x367e56(0x3ac)],this[_0x367e56(0x1c3)],this[_0x367e56(0x2cb)],this[_0x367e56(0x2e6)]);break;case UniverInstanceType[_0x367e56(0x27a)]:if(this[_0x367e56(0x1ba)]['every'](_0x27f38e=>_0x27f38e['id']===RichTextEditingMutation['id']))_0x188f36=assembleDocChangeset(this[_0x367e56(0x1ba)],this[_0x367e56(0x3ac)],this[_0x367e56(0x1c3)],this['_revisionService'],this[_0x367e56(0x2e6)]);else _0x188f36=assembleSheetChangeset(this[_0x367e56(0x1ba)],this[_0x367e56(0x3ac)],this['_univerInstanceService'],this['_revisionService'],this['_memberService']);break;default:throw new Error(_0x367e56(0x3f2)+this[_0x367e56(0x3ff)]+'\x20in\x20_schedule.');}const {changeset:_0x85e47f,pendingMutations:_0x3d1aad}=_0x188f36;this['_handler'][_0x367e56(0x2ab)](_0x85e47f);const _0x1652ef=_0x3d1aad[_0x367e56(0x356)]?this[_0x367e56(0x2b7)][_0x367e56(0x24f)](AwaitingWithPendingState,this[_0x367e56(0x3ac)],this[_0x367e56(0x3ff)],_0x85e47f,_0x3d1aad,this[_0x367e56(0x268)],void 0x0):this[_0x367e56(0x2b7)][_0x367e56(0x24f)](AwaitingState,this[_0x367e56(0x3ac)],this['type'],_0x85e47f,this[_0x367e56(0x268)]);_0x1652ef[_0x367e56(0x2f2)](),this[_0x367e56(0x268)][_0x367e56(0x29c)](this,_0x1652ef);},_0x2af71a);}['_getSendChangesetTimeout'](){const _0x54218d=_0x3b1eba;var _0xb6ffc1;const _0x5c9bd3=this[_0x54218d(0x3ee)][_0x54218d(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0xb6ffc1=_0x5c9bd3===null||_0x5c9bd3===void 0x0?void 0x0:_0x5c9bd3[_0x54218d(0x373)])!==null&&_0xb6ffc1!==void 0x0?_0xb6ffc1:DEFAULT_SEND_CHANGESET_TIMEOUT;}[_0x3b1eba(0x33b)](){const _0x43a26a=_0x3b1eba;throw new Error(_0x43a26a(0x244));}['_clearScheduledTask'](){const _0x4ed507=_0x3b1eba;this[_0x4ed507(0x240)]!=null&&(clearTimeout(this[_0x4ed507(0x240)]),this[_0x4ed507(0x240)]=null);}['_onConflict'](_0x3051e7){const _0x1ab49a=_0x3b1eba;return this[_0x1ab49a(0x36a)](),this['_injector']['createInstance'](ConflictState,this[_0x1ab49a(0x3ac)],this[_0x1ab49a(0x3ff)],null,this[_0x1ab49a(0x1ba)],this[_0x1ab49a(0x268)],_0x3051e7);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,Inject(MemberService)),__decorateParam(0x7,ILogService),__decorateParam(0x8,ICommandService),__decorateParam(0x9,IConfigService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUniverInstanceService),__decorateParam(0xc,IUndoRedoService),__decorateParam(0xd,Optional(ILocalCacheService))],PendingState);let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x40b113,_0x5b55e2,_0x4e1ed4,_0x13ffd4,_0x2a8ef1,_0x29be16,_0x25ad1c,_0x45ee2d,_0x144dda,_0x15bc90,_0x5d620d){const _0x4cc39=_0x3b1eba;super(_0x40b113,_0x5b55e2,_0x4e1ed4,[],_0x13ffd4,_0x25ad1c,_0x15bc90,_0x29be16,_0x5d620d),this[_0x4cc39(0x2b7)]=_0x2a8ef1,this[_0x4cc39(0x374)]=_0x45ee2d,this[_0x4cc39(0x22d)]=_0x144dda,_defineProperty(this,_0x4cc39(0x273),_0x4cc39(0x331)),_defineProperty(this,_0x4cc39(0x337),0x0),_defineProperty(this,_0x4cc39(0x3c5),0x0),_defineProperty(this,'_resendTimer',void 0x0),_defineProperty(this,_0x4cc39(0x383),void 0x0);}[_0x3b1eba(0x2ac)](_0x895b01){const _0x3406f4=_0x3b1eba;this['_clearScheduledTask']();const _0x202309=this['_injector'][_0x3406f4(0x24f)](AwaitingWithPendingState,this[_0x3406f4(0x3ac)],this[_0x3406f4(0x3ff)],this[_0x3406f4(0x2e2)],[_0x895b01],this[_0x3406f4(0x268)],this[_0x3406f4(0x209)]);return _0x202309[_0x3406f4(0x2f2)](),_0x202309;}['onRemoteChangeset'](_0x1f2a6c){const _0x4fde01=_0x3b1eba;if(this[_0x4fde01(0x252)](_0x1f2a6c))return this[_0x4fde01(0x36a)](),this[_0x4fde01(0x2b7)][_0x4fde01(0x24f)](FetchingMissState,this[_0x4fde01(0x3ac)],this[_0x4fde01(0x3ff)],this['_awaitingChangeset'],[],null,[_0x1f2a6c],this[_0x4fde01(0x268)]);try{const _0x1404fb=this[_0x4fde01(0x22d)][_0x4fde01(0x1d3)]([_0x1f2a6c],[this[_0x4fde01(0x2e2)]],![]);if(isTransformChangesetsSuccess(_0x1404fb)){const {c1Prime:_0x36c1ec,c2Prime:_0x285d4b}=_0x1404fb;this['_executeRemoteChangeset'](_0x36c1ec[0x0]),_0x285d4b[0x0][_0x4fde01(0x343)]=this[_0x4fde01(0x3a6)](),this[_0x4fde01(0x36a)]();const _0x2c89b4=this[_0x4fde01(0x2b7)][_0x4fde01(0x24f)](_AwaitingState,this[_0x4fde01(0x3ac)],this['type'],_0x285d4b[0x0],this[_0x4fde01(0x268)]);return _0x2c89b4['_updateLocalCache'](),_0x2c89b4;}throw _0x1404fb[_0x4fde01(0x1ef)];}catch(_0x264733){return this[_0x4fde01(0x374)][_0x4fde01(0x1ef)](_0x264733),this[_0x4fde01(0x1a4)](![]);}}[_0x3b1eba(0x31a)](_0x3b8059){const _0x2d5b48=_0x3b1eba;this[_0x2d5b48(0x36a)]();const _0xdb2826=this[_0x2d5b48(0x2cb)][_0x2d5b48(0x254)](this[_0x2d5b48(0x3ac)]);if(_0x3b8059[_0x2d5b48(0x3d4)]<=_0xdb2826)return this;if(this[_0x2d5b48(0x252)](_0x3b8059))return this['_injector']['createInstance'](FetchingMissState,this[_0x2d5b48(0x3ac)],this[_0x2d5b48(0x3ff)],this[_0x2d5b48(0x2e2)],[],_0x3b8059[_0x2d5b48(0x3d4)],[],this[_0x2d5b48(0x268)]);this['_incrementRevisionNumber']();const _0x553646=this[_0x2d5b48(0x2b7)]['createInstance'](SyncedState,this[_0x2d5b48(0x3ac)],this[_0x2d5b48(0x3ff)],this[_0x2d5b48(0x268)]);return _0x553646[_0x2d5b48(0x2f2)](),_0x553646;}['onRemoteRej'](_0x2ff474){const _0x3461b2=_0x3b1eba;return this[_0x3461b2(0x1a4)](!!(_0x2ff474===null||_0x2ff474===void 0x0?void 0x0:_0x2ff474['isPermissionRej']));}[_0x3b1eba(0x271)](_0x2dd738){const _0x2d9a6c=_0x3b1eba;if(this[_0x2d9a6c(0x3c5)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x2d9a6c(0x1b9)]();return this[_0x2d9a6c(0x209)]=createTimerObservable$(this[_0x2d9a6c(0x337)],{'timeout':this[_0x2d9a6c(0x337)],'reqId':_0x2dd738[_0x2d9a6c(0x292)]}),this[_0x2d9a6c(0x383)]=this[_0x2d9a6c(0x209)]['subscribe'](({reqId:_0x320c07,timeout:_0x3efc50})=>{this['_resendWithTimeout'](_0x320c07,_0x3efc50);}),this;}[_0x3b1eba(0x1b9)](){const _0xf0f5d5=_0x3b1eba;return this[_0xf0f5d5(0x36a)](),this[_0xf0f5d5(0x2b7)]['createInstance'](OfflineState,this['unitID'],this[_0xf0f5d5(0x3ff)],this[_0xf0f5d5(0x2e2)],[],this[_0xf0f5d5(0x268)]);}[_0x3b1eba(0x229)](){return this;}[_0x3b1eba(0x33b)](){const _0x393dd7=_0x3b1eba;this[_0x393dd7(0x268)][_0x393dd7(0x2ab)](this['_awaitingChangeset']);}[_0x3b1eba(0x1a4)](_0x14117a){const _0x4905ea=_0x3b1eba;return this[_0x4905ea(0x36a)](),this[_0x4905ea(0x2b7)][_0x4905ea(0x24f)](ConflictState,this[_0x4905ea(0x3ac)],this[_0x4905ea(0x3ff)],this['_awaitingChangeset'],[],this[_0x4905ea(0x268)],_0x14117a);}[_0x3b1eba(0x2c6)](_0x13d12f,_0x325df6){const _0x5733ac=_0x3b1eba;var _0x5d3382;_0x13d12f===((_0x5d3382=this[_0x5733ac(0x2e2)])===null||_0x5d3382===void 0x0?void 0x0:_0x5d3382['reqId'])&&(this['resend'](),this['_resendTimeout']=_0x325df6===0x0?0x3e8:Math[_0x5733ac(0x20d)](_0x325df6*0x2,MAX_RETRY_TIMEOUT),this['_maxTotalRetryTimeout']+=this[_0x5733ac(0x337)]);}[_0x3b1eba(0x36a)](){const _0x3bec1c=_0x3b1eba;var _0x9c8655;(_0x9c8655=this[_0x3bec1c(0x383)])===null||_0x9c8655===void 0x0||_0x9c8655['unsubscribe'](),this[_0x3bec1c(0x337)]=0x0,this[_0x3bec1c(0x3c5)]=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,IUndoRedoService),__decorateParam(0xa,Optional(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x4d17fd,_0x102902,_0x190b53,_0xc87480,_0x52b5ae,_0x156c54,_0x14c917,_0x167484,_0x13caa3,_0x7da802,_0x42082e,_0x2f1aab,_0x398187){const _0x18bdd0=_0x3b1eba;super(_0x4d17fd,_0x102902,_0x190b53,_0xc87480,_0x52b5ae,_0x13caa3,_0x2f1aab,_0x167484,_0x398187),this['_injector']=_0x14c917,this['_logService']=_0x7da802,this[_0x18bdd0(0x22d)]=_0x42082e,this[_0x18bdd0(0x1d7)]=_0x398187,_defineProperty(this,_0x18bdd0(0x273),'awaiting_with_pending'),_defineProperty(this,_0x18bdd0(0x337),0x0),_defineProperty(this,_0x18bdd0(0x3c5),0x0),_defineProperty(this,_0x18bdd0(0x209),void 0x0),_defineProperty(this,'_sender',void 0x0),_0x156c54&&(this[_0x18bdd0(0x209)]=_0x156c54,this[_0x18bdd0(0x383)]=this['_resendTimer'][_0x18bdd0(0x395)](({reqId:_0x3f30bc,timeout:_0x3b0248})=>{const _0x382c35=_0x18bdd0;this[_0x382c35(0x2c6)](_0x3f30bc,_0x3b0248);}));}[_0x3b1eba(0x2ac)](_0x5867d4){const _0x385bde=_0x3b1eba;return this[_0x385bde(0x1ba)][_0x385bde(0x1cd)](_0x5867d4),this;}[_0x3b1eba(0x324)](_0x5a80d9){const _0xf2e750=_0x3b1eba;if(this[_0xf2e750(0x252)](_0x5a80d9))return this[_0xf2e750(0x36a)](),this[_0xf2e750(0x2b7)][_0xf2e750(0x24f)](FetchingMissState,this['unitID'],this[_0xf2e750(0x3ff)],this[_0xf2e750(0x2e2)],this['_pendingMutations'],null,[_0x5a80d9],this[_0xf2e750(0x268)]);try{const _0x30d6a4=this[_0xf2e750(0x22d)]['transformChangesets']([_0x5a80d9],[this['_awaitingChangeset']],![]);if(isTransformChangesetsSuccess(_0x30d6a4)){const {c1Prime:_0x544d3e,c2Prime:_0x1ba7de}=_0x30d6a4,_0x44e4fe=this['_transformService'][_0xf2e750(0x3b3)](_0x544d3e[0x0],this[_0xf2e750(0x1ba)]);if(isTransformMutationsWithChangesetSuccess(_0x44e4fe)){const {c1Prime:_0x433f80,m2Prime:_0x552443}=_0x44e4fe;return this[_0xf2e750(0x3e3)](_0x433f80),_0x1ba7de[0x0][_0xf2e750(0x343)]=this[_0xf2e750(0x3a6)](),this['_clearScheduledTask'](),this[_0xf2e750(0x2b7)][_0xf2e750(0x24f)](_AwaitingWithPendingState,this['unitID'],this[_0xf2e750(0x3ff)],_0x1ba7de[0x0],_0x552443,this[_0xf2e750(0x268)],void 0x0);}throw _0x44e4fe[_0xf2e750(0x1ef)];}throw _0x30d6a4[_0xf2e750(0x1ef)];}catch(_0x5536de){return this['_logService'][_0xf2e750(0x1ef)](_0x5536de),this[_0xf2e750(0x1a4)](![]);}}[_0x3b1eba(0x31a)](_0x16843e){const _0x3febe5=_0x3b1eba;this[_0x3febe5(0x36a)]();const _0x26908c=this['_getCurrentRevision']();if(_0x16843e[_0x3febe5(0x3d4)]<=_0x26908c)return this;if(this[_0x3febe5(0x252)](_0x16843e))return this[_0x3febe5(0x2b7)][_0x3febe5(0x24f)](FetchingMissState,this[_0x3febe5(0x3ac)],this['type'],this['_awaitingChangeset'],this[_0x3febe5(0x1ba)],_0x16843e[_0x3febe5(0x3d4)],[],this['_handler']);this[_0x3febe5(0x352)]();const _0x5cb68d=this['_injector'][_0x3febe5(0x24f)](PendingState,this[_0x3febe5(0x3ac)],this['type'],this[_0x3febe5(0x1ba)],this[_0x3febe5(0x268)]);return _0x5cb68d[_0x3febe5(0x2b4)](),_0x5cb68d['_updateLocalCache'](),_0x5cb68d;}[_0x3b1eba(0x2a9)](_0x4c1fcb){const _0x5b47e7=_0x3b1eba;return this[_0x5b47e7(0x1a4)](!!(_0x4c1fcb===null||_0x4c1fcb===void 0x0?void 0x0:_0x4c1fcb[_0x5b47e7(0x322)]));}[_0x3b1eba(0x271)](_0x50507c){const _0xd58197=_0x3b1eba;if(this[_0xd58197(0x3c5)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0xd58197(0x1b9)]();return this[_0xd58197(0x209)]=createTimerObservable$(this[_0xd58197(0x337)],{'timeout':this[_0xd58197(0x337)],'reqId':_0x50507c['reqId']}),this['_sender']=this[_0xd58197(0x209)][_0xd58197(0x395)](({reqId:_0x4638ae,timeout:_0x2228ca})=>{const _0x833845=_0xd58197;this[_0x833845(0x2c6)](_0x4638ae,_0x2228ca);}),this;}[_0x3b1eba(0x1b9)](){const _0x28a069=_0x3b1eba;return this[_0x28a069(0x36a)](),this[_0x28a069(0x2b7)]['createInstance'](OfflineState,this[_0x28a069(0x3ac)],this[_0x28a069(0x3ff)],this[_0x28a069(0x2e2)],this[_0x28a069(0x1ba)],this[_0x28a069(0x268)]);}[_0x3b1eba(0x229)](){return this;}[_0x3b1eba(0x33b)](){const _0x48206c=_0x3b1eba;this[_0x48206c(0x268)]['onSendChangeset'](this[_0x48206c(0x2e2)]);}['_onConflict'](_0x31529a){const _0x1bb3d4=_0x3b1eba;return this[_0x1bb3d4(0x36a)](),this[_0x1bb3d4(0x2b7)][_0x1bb3d4(0x24f)](ConflictState,this[_0x1bb3d4(0x3ac)],this[_0x1bb3d4(0x3ff)],null,this[_0x1bb3d4(0x1ba)],this[_0x1bb3d4(0x268)],_0x31529a);}[_0x3b1eba(0x2c6)](_0x67371b,_0x3bbb81){const _0x54d75b=_0x3b1eba;var _0x3fcd32;_0x67371b===((_0x3fcd32=this[_0x54d75b(0x2e2)])===null||_0x3fcd32===void 0x0?void 0x0:_0x3fcd32['reqId'])&&(this[_0x54d75b(0x33b)](),this['_resendTimeout']=_0x3bbb81===0x0?0x3e8:Math[_0x54d75b(0x20d)](_0x3bbb81*0x2,MAX_RETRY_TIMEOUT),this[_0x54d75b(0x3c5)]+=this[_0x54d75b(0x337)]);}[_0x3b1eba(0x36a)](){const _0x139c35=_0x3b1eba;var _0x27d658;(_0x27d658=this[_0x139c35(0x383)])===null||_0x27d658===void 0x0||_0x27d658[_0x139c35(0x2e7)](),this[_0x139c35(0x337)]=0x0,this[_0x139c35(0x3c5)]=0x0;}};AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,Inject(Injector)),__decorateParam(0x7,Inject(RevisionService)),__decorateParam(0x8,ICommandService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,Optional(ILocalCacheService))],AwaitingWithPendingState);let ConflictState=class ConflictState extends CollaborationState{constructor(_0x287f44,_0x4aadf1,_0x271a7d,_0x26d774,_0x12ca6e,_0x20008b=![],_0x1c0316,_0x358ced,_0x1fbc64,_0x4973a0,_0x46cf26,_0xcaa580,_0x2c8b61){const _0x53eb0d=_0x3b1eba;super(_0x287f44,_0x4aadf1,_0x271a7d,_0x26d774,_0x12ca6e,_0x358ced,_0x1fbc64,_0x4973a0,_0x2c8b61),this[_0x53eb0d(0x22e)]=_0x20008b,this[_0x53eb0d(0x34a)]=_0x1c0316,this[_0x53eb0d(0x1c4)]=_0x46cf26,this[_0x53eb0d(0x2a2)]=_0xcaa580,this['localCacheService']=_0x2c8b61,_defineProperty(this,_0x53eb0d(0x273),'conflict'),this[_0x53eb0d(0x323)](),this[_0x53eb0d(0x402)](),this[_0x53eb0d(0x318)]();}[_0x3b1eba(0x2ac)](){return this;}[_0x3b1eba(0x324)](){return this;}[_0x3b1eba(0x31a)](){return this;}[_0x3b1eba(0x2a9)](){return this;}[_0x3b1eba(0x271)](){return this;}[_0x3b1eba(0x1b9)](){return this;}[_0x3b1eba(0x229)](){return this;}['resend'](){const _0x3de59b=_0x3b1eba;throw new Error(_0x3de59b(0x3b6));}[_0x3b1eba(0x402)](){const _0x84b7a9=_0x3b1eba;var _0x19bffc;(_0x19bffc=this[_0x84b7a9(0x1a0)])===null||_0x19bffc===void 0x0||_0x19bffc[_0x84b7a9(0x392)](this[_0x84b7a9(0x3ac)],this[_0x84b7a9(0x3ff)],null,[]);}[_0x3b1eba(0x323)](){const _0x11e264=_0x3b1eba;if(this[_0x11e264(0x22e)])this[_0x11e264(0x2a2)]['emitEvent']({'id':_0x11e264(0x35b)});else this[_0x11e264(0x2a2)][_0x11e264(0x2ee)]({'id':_0x11e264(0x2cd)});}[_0x3b1eba(0x318)](){const _0x242bed=_0x3b1eba;this[_0x242bed(0x34a)][_0x242bed(0x302)](new WorkbookEditablePermission(this['unitID'])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,Inject(IPermissionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Inject(RevisionService)),__decorateParam(0xa,Inject(LocaleService)),__decorateParam(0xb,Inject(CollaborationUIEventService)),__decorateParam(0xc,Optional(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x1fdcda,_0x20709d,_0x2989ea,_0x59d0f8,_0x4f6c57,_0xcb43f9,_0x4177e0,_0x159f00,_0x2cdfde,_0x5d8e9d){const _0x1215cb=_0x3b1eba;super(_0x1fdcda,_0x20709d,_0x2989ea,_0x59d0f8,_0x4f6c57,_0x159f00,_0x2cdfde,_0x4177e0,_0x5d8e9d),this[_0x1215cb(0x2b7)]=_0xcb43f9,_defineProperty(this,_0x1215cb(0x273),_0x1215cb(0x261));}[_0x3b1eba(0x2ac)](_0x8dd6c3){const _0x4a23c5=_0x3b1eba;return this[_0x4a23c5(0x1ba)][_0x4a23c5(0x1cd)](_0x8dd6c3),this['_updateLocalCache'](),this;}[_0x3b1eba(0x324)](_0x51c718){const _0x7f3ace=_0x3b1eba;throw new Error(_0x7f3ace(0x22a));}[_0x3b1eba(0x31a)](){const _0x2f7052=_0x3b1eba;throw new Error(_0x2f7052(0x25b));}['onRemoteRej'](){const _0x5b2efd=_0x3b1eba;throw new Error(_0x5b2efd(0x376));}[_0x3b1eba(0x271)](){return this;}['toggleOffline'](){return this;}[_0x3b1eba(0x229)](){const _0x343549=_0x3b1eba,{_injector:_0xfd96de,_pendingMutations:_0x4928e8,_awaitingChangeset:_0x3282c1,unitID:_0x17d415,_handler:_0x102d7d,type:_0x2c58cc}=this,_0x484315=createOnlineState(_0xfd96de,_0x17d415,_0x2c58cc,_0x3282c1,_0x4928e8,_0x102d7d);if(_0x484315 instanceof PendingState)_0x484315[_0x343549(0x2b4)]();else{if(_0x484315 instanceof AwaitingWithPendingState||_0x484315 instanceof AwaitingState)_0x484315[_0x343549(0x33b)]();}return _0x484315;}[_0x3b1eba(0x33b)](){const _0x300b9b=_0x3b1eba;throw new Error(_0x300b9b(0x2ae));}};OfflineState=__decorate([__decorateParam(0x5,Inject(Injector)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Optional(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0x1fefd7,_0x237ded,_0x60663e,_0x18cef8,_0x4f382f,_0x41dafa,_0x3eeb45,_0x33feb7,_0x1881df,_0x320308,_0x17474c,_0x4512df,_0x52cdc3,_0x25fff4){const _0x2c1578=_0x3b1eba;super(_0x1fefd7,_0x237ded,_0x60663e,_0x18cef8,_0x3eeb45,_0x17474c,_0x4512df,_0x1881df,_0x25fff4),this[_0x2c1578(0x293)]=_0x4f382f,this[_0x2c1578(0x304)]=_0x41dafa,this['_injector']=_0x33feb7,this[_0x2c1578(0x374)]=_0x320308,this[_0x2c1578(0x22d)]=_0x52cdc3,this[_0x2c1578(0x1d7)]=_0x25fff4,_defineProperty(this,_0x2c1578(0x273),_0x2c1578(0x348));}[_0x3b1eba(0x25e)](_0x4681de){const _0x414c90=_0x3b1eba;try{if(this['_handleRemoteChangesets'](_0x4681de)[_0x414c90(0x294)])throw new Error('[FetchMissState]:\x20missing\x20changesets\x20response\x20still\x20has\x20revision\x20gaps.');if(this[_0x414c90(0x313)]([...this['_queuedRemoteChangesets']][_0x414c90(0x382)]((_0x13ac03,_0x5559c7)=>_0x13ac03[_0x414c90(0x3d4)]-_0x5559c7['revision']))[_0x414c90(0x294)])return this[_0x414c90(0x304)]=[],this['_updateLocalCache'](),this[_0x414c90(0x268)]['onMissingChangesets']({'from':this['_getCurrentRevision'](),'to':0x0}),this;const _0xc21e21=this[_0x414c90(0x2e2)],_0x302d88=this[_0x414c90(0x1ba)];let _0x402fd2;if(_0xc21e21&&_0x302d88['length']!==0x0)_0x402fd2=this[_0x414c90(0x2b7)][_0x414c90(0x24f)](AwaitingWithPendingState,this[_0x414c90(0x3ac)],this[_0x414c90(0x3ff)],_0xc21e21,_0x302d88,this['_handler'],void 0x0);else{if(_0xc21e21&&_0x302d88['length']===0x0)_0xc21e21[_0x414c90(0x343)]=this['_getCurrentRevision'](),_0x402fd2=this[_0x414c90(0x2b7)][_0x414c90(0x24f)](AwaitingState,this[_0x414c90(0x3ac)],this[_0x414c90(0x3ff)],_0xc21e21,this[_0x414c90(0x268)]);else{if(_0x302d88['length']!==0x0){const _0x4c4852=this[_0x414c90(0x2b7)][_0x414c90(0x24f)](PendingState,this['unitID'],this['type'],_0x302d88,this[_0x414c90(0x268)]);_0x4c4852[_0x414c90(0x2b4)](),_0x402fd2=_0x4c4852;}else _0x402fd2=this['_injector']['createInstance'](SyncedState,this[_0x414c90(0x3ac)],this['type'],this[_0x414c90(0x268)]);}}return _0x402fd2[_0x414c90(0x2f2)](),_0x402fd2;}catch(_0x4a4014){return this['_logService'][_0x414c90(0x1ef)]('[FetchMissState]',_0x414c90(0x39f),_0x4a4014),this[_0x414c90(0x2b7)][_0x414c90(0x24f)](ConflictState,this[_0x414c90(0x3ac)],this[_0x414c90(0x3ff)],this[_0x414c90(0x2e2)],this[_0x414c90(0x1ba)],this[_0x414c90(0x268)],![]);}}[_0x3b1eba(0x313)](_0x31e6ca){const _0x210a7e=_0x3b1eba;this[_0x210a7e(0x242)]();for(let _0x598ebb=0x0;_0x598ebb<_0x31e6ca[_0x210a7e(0x356)];_0x598ebb++){const _0x409d10=_0x31e6ca[_0x598ebb],_0x9363e6=this[_0x210a7e(0x3a6)]();if(_0x409d10[_0x210a7e(0x3d4)]<=_0x9363e6)continue;if(_0x409d10[_0x210a7e(0x3d4)]>_0x9363e6+0x1)return{'missingChangesets':!![]};if(this['_isEchoedAwaitingChangeset'](_0x409d10)){this[_0x210a7e(0x204)]();continue;}this[_0x210a7e(0x20a)](_0x409d10),this[_0x210a7e(0x242)]();}return{'missingChangesets':![]};}['_transformAndApplyRemoteChangeset'](_0x363a80){const _0x5702e0=_0x3b1eba;let _0x43c26d=_0x363a80,_0x5c87e5=this['_awaitingChangeset'];if(_0x5c87e5){const _0x3a1faf=this[_0x5702e0(0x22d)][_0x5702e0(0x1d3)]([_0x363a80],[_0x5c87e5],![]);if(!isTransformChangesetsSuccess(_0x3a1faf))throw _0x3a1faf['error'];_0x43c26d=_0x3a1faf[_0x5702e0(0x2ff)][0x0],_0x5c87e5=_0x3a1faf['c2Prime'][0x0];}let _0x29064a=this[_0x5702e0(0x1ba)];if(_0x29064a[_0x5702e0(0x356)]){const _0x2195b3=this['_transformService'][_0x5702e0(0x3b3)](_0x43c26d,_0x29064a);if(!isTransformMutationsWithChangesetSuccess(_0x2195b3))throw _0x2195b3[_0x5702e0(0x1ef)];_0x43c26d=_0x2195b3['c1Prime'],_0x29064a=_0x2195b3[_0x5702e0(0x1ea)];}this[_0x5702e0(0x3e3)](_0x43c26d);if(_0x5c87e5)_0x5c87e5['baseRev']=this[_0x5702e0(0x3a6)]();this[_0x5702e0(0x2e2)]=_0x5c87e5,this[_0x5702e0(0x1ba)]=_0x29064a;}[_0x3b1eba(0x242)](){const _0x1cddd8=_0x3b1eba;if(!this[_0x1cddd8(0x2e2)]||this[_0x1cddd8(0x293)]==null)return;const _0x5a6222=this[_0x1cddd8(0x3a6)]();if(this[_0x1cddd8(0x293)]<=_0x5a6222)throw new Error('[FetchingMissState]:\x20received\x20stale\x20ack\x20revision:\x20'+this[_0x1cddd8(0x293)]+'.');if(this['_acknowledgedAwaitingRevision']===_0x5a6222+0x1)this[_0x1cddd8(0x204)]();}['_acknowledgeAwaiting'](){const _0x2d0f08=_0x3b1eba;this[_0x2d0f08(0x352)](),this[_0x2d0f08(0x2e2)]=null,this[_0x2d0f08(0x293)]=null;}['_isEchoedAwaitingChangeset'](_0xb1c729){const _0x43adb9=_0x3b1eba,_0x69908e=this[_0x43adb9(0x2e2)];if(!_0x69908e)return![];if(!_0x69908e[_0x43adb9(0x3a8)]||_0x69908e[_0x43adb9(0x292)]===null||_0x69908e[_0x43adb9(0x292)]===void 0x0)return![];return _0xb1c729[_0x43adb9(0x3ac)]===_0x69908e[_0x43adb9(0x3ac)]&&_0xb1c729[_0x43adb9(0x3a8)]===_0x69908e[_0x43adb9(0x3a8)]&&_0xb1c729[_0x43adb9(0x292)]===_0x69908e[_0x43adb9(0x292)];}['resend'](){const _0x523dd0=_0x3b1eba;throw new Error(_0x523dd0(0x1c0));}[_0x3b1eba(0x2ac)](_0x446a2e){const _0x4b2a06=_0x3b1eba;return this[_0x4b2a06(0x1ba)][_0x4b2a06(0x1cd)](_0x446a2e),this;}[_0x3b1eba(0x324)](_0x43f57c){const _0x4412c6=_0x3b1eba;return this[_0x4412c6(0x304)][_0x4412c6(0x1cd)](_0x43f57c),this;}[_0x3b1eba(0x31a)](_0x4832bb){const _0x5812d7=_0x3b1eba;if(this[_0x5812d7(0x2e2)]){const _0x1f76e0=this[_0x5812d7(0x3a6)]();if(_0x4832bb[_0x5812d7(0x3d4)]<=_0x1f76e0)return this;else{if(_0x1f76e0+0x1===_0x4832bb[_0x5812d7(0x3d4)])this[_0x5812d7(0x352)](),this['_awaitingChangeset']=null,this[_0x5812d7(0x293)]=null;else this[_0x5812d7(0x293)]=_0x4832bb['revision'];}return this;}if(_0x4832bb[_0x5812d7(0x3d4)]<=this[_0x5812d7(0x3a6)]())return this;throw new Error(_0x5812d7(0x361));}[_0x3b1eba(0x2a9)](_0x313f9d){const _0x82ebce=_0x3b1eba;return this[_0x82ebce(0x1a4)](!!(_0x313f9d===null||_0x313f9d===void 0x0?void 0x0:_0x313f9d['isPermissionRej']));}[_0x3b1eba(0x271)](){return this;}[_0x3b1eba(0x1b9)](){const _0x361310=_0x3b1eba;return this[_0x361310(0x2b7)][_0x361310(0x24f)](OfflineState,this[_0x361310(0x3ac)],this[_0x361310(0x3ff)],this[_0x361310(0x2e2)],this['_pendingMutations'],this[_0x361310(0x268)]);}['toggleOnline'](){return this;}[_0x3b1eba(0x1a4)](_0x56f9aa){const _0x3906f6=_0x3b1eba;return this[_0x3906f6(0x2b7)][_0x3906f6(0x24f)](ConflictState,this[_0x3906f6(0x3ac)],this[_0x3906f6(0x3ff)],this['_awaitingChangeset'],this[_0x3906f6(0x1ba)],this[_0x3906f6(0x268)],_0x56f9aa);}};FetchingMissState=__decorate([__decorateParam(0x7,Inject(Injector)),__decorateParam(0x8,Inject(RevisionService)),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,ITransformService),__decorateParam(0xd,Optional(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x580e7f,_0x19d7bb,_0x210c8a,_0x4da51b,_0x30be6e,_0x5b5c0e){const _0x64ee14=_0x3b1eba;if(_0x4da51b&&_0x30be6e[_0x64ee14(0x356)])return _0x580e7f[_0x64ee14(0x24f)](AwaitingWithPendingState,_0x19d7bb,_0x210c8a,_0x4da51b,_0x30be6e,_0x5b5c0e,void 0x0);if(_0x4da51b)return _0x580e7f[_0x64ee14(0x24f)](AwaitingState,_0x19d7bb,_0x210c8a,_0x4da51b,_0x5b5c0e);if(_0x30be6e[_0x64ee14(0x356)])return _0x580e7f[_0x64ee14(0x24f)](PendingState,_0x19d7bb,_0x210c8a,_0x30be6e,_0x5b5c0e);return _0x580e7f[_0x64ee14(0x24f)](SyncedState,_0x19d7bb,_0x210c8a,_0x5b5c0e);}let CollaborationEntity=class CollaborationEntity extends RxDisposable{get[_0x3b1eba(0x1a3)](){const _0x35ed93=_0x3b1eba;return this[_0x35ed93(0x3f0)];}constructor(_0x46e0e3,_0x238d39,_0x2a6694,_0x56098f,_0xf19175,_0x13c0ba,_0x4c8d05,_0x65582b,_0x25aeaa,_0x414371,_0x3e9df8,_0x283ebf,_0x2d8d82,_0x1e68ea){const _0x4c17be=_0x3b1eba;super(),this['unitID']=_0x46e0e3,this[_0x4c17be(0x39d)]=_0x238d39,this['_type']=_0x2a6694,this[_0x4c17be(0x2b7)]=_0x56098f,this[_0x4c17be(0x3e5)]=_0xf19175,this[_0x4c17be(0x1c4)]=_0x13c0ba,this['_revisionService']=_0x4c8d05,this[_0x4c17be(0x283)]=_0x65582b,this[_0x4c17be(0x1c3)]=_0x25aeaa,this[_0x4c17be(0x374)]=_0x414371,this[_0x4c17be(0x278)]=_0x3e9df8,this[_0x4c17be(0x34a)]=_0x283ebf,this[_0x4c17be(0x364)]=_0x2d8d82,this[_0x4c17be(0x1a0)]=_0x1e68ea,_defineProperty(this,_0x4c17be(0x22c),new BehaviorSubject(null)),_defineProperty(this,_0x4c17be(0x3b4),this['_state$'][_0x4c17be(0x2ca)]()),_defineProperty(this,_0x4c17be(0x3f0),void 0x0),_defineProperty(this,_0x4c17be(0x1c5),![]),_defineProperty(this,_0x4c17be(0x407),''),_defineProperty(this,'_changesetReqId',0x0),_defineProperty(this,_0x4c17be(0x26d),this['state$']['pipe'](map(_0x4b0462=>{if(_0x4b0462)return _0x4b0462['status'];return'offline';}),shareReplay(0x1))),_defineProperty(this,_0x4c17be(0x1d9),![]),_defineProperty(this,_0x4c17be(0x1e6),[]);}async[_0x3b1eba(0x32c)](){const _0x1eea1b=_0x3b1eba;if(this[_0x1eea1b(0x1a3)])throw new Error(_0x1eea1b(0x243));await this[_0x1eea1b(0x2f1)]();}[_0x3b1eba(0x310)](){const _0x203c71=_0x3b1eba;return this[_0x203c71(0x1c5)]=!![],toDisposable(()=>{const _0x272ac7=_0x203c71;this[_0x272ac7(0x1c5)]=![],this[_0x272ac7(0x1a7)]();});}[_0x3b1eba(0x2da)](_0x4f2a08){const _0x1fad53=_0x3b1eba;this[_0x1fad53(0x1a9)](_0x4f2a08);}[_0x3b1eba(0x351)](_0x4e5e90){const _0x26c7a9=_0x3b1eba;this[_0x26c7a9(0x3f0)]=_0x4e5e90,this['_state$'][_0x26c7a9(0x34d)](_0x4e5e90);}async[_0x3b1eba(0x2f1)](){const _0x53758f=_0x3b1eba;this[_0x53758f(0x351)](await this[_0x53758f(0x39c)]());if(this[_0x53758f(0x364)]){var _0x1843c8;(_0x1843c8=this[_0x53758f(0x364)])===null||_0x1843c8===void 0x0||_0x1843c8[_0x53758f(0x3f3)](this[_0x53758f(0x3ac)]),this[_0x53758f(0x34c)](this['_singleActiveUnitService']['getUnitStatus$'](this[_0x53758f(0x3ac)])[_0x53758f(0x395)](_0x5c08df=>{const _0x107f82=_0x53758f;this[_0x107f82(0x374)][_0x107f82(0x335)](_0x107f82(0x30d),_0x107f82(0x336),_0x5c08df),_0x5c08df===0x1?(this[_0x107f82(0x283)][_0x107f82(0x2ee)]({'id':_0x107f82(0x206)}),this[_0x107f82(0x34a)][_0x107f82(0x302)](new WorkbookEditablePermission(this['unitID'])['id'],![]),this['_permissionService']['setShowComponents'](![])):(this[_0x107f82(0x34a)]['updatePermissionPoint'](new WorkbookEditablePermission(this['unitID'])['id'],!![]),this[_0x107f82(0x34a)]['setShowComponents'](!![]));}));}let _0x1a5d20=![];return this[_0x53758f(0x34c)](this[_0x53758f(0x39d)][_0x53758f(0x2bd)]['subscribe'](_0x1aec0f=>{const _0x4ef133=_0x53758f;if(_0x1aec0f===0x3)this['_toggleOnline'](_0x1a5d20);else _0x1aec0f===0x2&&(_0x1a5d20=!![],this[_0x4ef133(0x349)]());})),this['disposeWithMe'](this[_0x53758f(0x39d)][_0x53758f(0x358)][_0x53758f(0x395)](_0x4685fa=>{const _0x140cd2=_0x53758f;try{switch(_0x4685fa[_0x140cd2(0x227)]){case CollaborationEvent['NEW_CHANGESETS']:this['_onRemoteChangeset'](parseProtocolChangeset(_0x4685fa[_0x140cd2(0x1b3)]));break;case CollaborationEvent['CHANGESET_ACK']:this[_0x140cd2(0x263)](_0x4685fa[_0x140cd2(0x1b3)]);break;case CollaborationEvent[_0x140cd2(0x27f)]:this['_onRemoteRejected']();break;case CollaborationEvent[_0x140cd2(0x2be)]:this[_0x140cd2(0x2e0)](_0x4685fa[_0x140cd2(0x1b3)]);break;case CollaborationEvent[_0x140cd2(0x28e)]:this[_0x140cd2(0x3ce)](_0x4685fa[_0x140cd2(0x1b3)]['changesets'][_0x140cd2(0x236)](_0x4ea23c=>parseProtocolChangeset(_0x4ea23c)));break;case CollaborationEvent[_0x140cd2(0x370)]:this['_onRemoteRejected']({'isPermissionRej':!![]});break;case CollaborationEvent['UNISCRIPT_RUN']:break;}}catch(_0x53a2f8){console[_0x140cd2(0x1ef)](_0x140cd2(0x3fa),_0x53a2f8);throw _0x53a2f8;}})),this[_0x53758f(0x3f0)];}[_0x3b1eba(0x2e4)](){const _0x2d1742=_0x3b1eba;this[_0x2d1742(0x1d9)]=![];}[_0x3b1eba(0x211)](){const _0x24bc59=_0x3b1eba;if(this[_0x24bc59(0x1d9)])throw new Error(_0x24bc59(0x1de));this[_0x24bc59(0x1d9)]=!![];}['_onLocalMutation'](_0x231133){const _0x1c6570=_0x3b1eba;this[_0x1c6570(0x211)](),this[_0x1c6570(0x351)](this[_0x1c6570(0x3f0)][_0x1c6570(0x2ac)](_0x231133)),this[_0x1c6570(0x2e4)]();}[_0x3b1eba(0x2a4)](_0xacfbd6){const _0xe7765d=_0x3b1eba;if(_0xacfbd6['revision']<=this[_0xe7765d(0x2cb)]['getCurrentRevOfUnit'](this[_0xe7765d(0x3ac)]))return;if(this[_0xe7765d(0x1c5)]){this['_remoteChangesetQueue'][_0xe7765d(0x1cd)](_0xacfbd6);return;}this[_0xe7765d(0x3c2)](_0xacfbd6);}['_exhaustRemoteChangesetQueue'](){const _0x1b23e4=_0x3b1eba;this[_0x1b23e4(0x1e6)][_0x1b23e4(0x387)](_0x16030f=>this[_0x1b23e4(0x3c2)](_0x16030f)),this[_0x1b23e4(0x1e6)]=[];}[_0x3b1eba(0x3c2)](_0x3e30a5){const _0x59e7ef=_0x3b1eba,_0x3b9637=this[_0x59e7ef(0x3e5)][_0x59e7ef(0x1af)][_0x59e7ef(0x299)](this[_0x59e7ef(0x3e5)][_0x59e7ef(0x1af)][_0x59e7ef(0x199)]()['COMPRESS_MUTATION_APPLY'])(_0x3e30a5['mutations'],null)||_0x3e30a5['mutations'],_0x2506a6={..._0x3e30a5,'mutations':_0x3b9637};this[_0x59e7ef(0x211)](),this[_0x59e7ef(0x351)](this['_state'][_0x59e7ef(0x324)](_0x2506a6)),this['_unlockTransition']();}['_onRemoteACK'](_0x4cd619){const _0x1c75ce=_0x3b1eba;this[_0x1c75ce(0x211)](),this[_0x1c75ce(0x351)](this['_state'][_0x1c75ce(0x31a)](_0x4cd619)),this[_0x1c75ce(0x2e4)]();}[_0x3b1eba(0x2b9)](_0x29c9ec){const _0x422a69=_0x3b1eba;this[_0x422a69(0x211)](),this[_0x422a69(0x351)](this[_0x422a69(0x3f0)][_0x422a69(0x2a9)](_0x29c9ec)),this[_0x422a69(0x2e4)]();}[_0x3b1eba(0x2e0)](_0x56c211){const _0x197e84=_0x3b1eba;this['_lockTransition'](),this[_0x197e84(0x351)](this['_state']['onRemoteRetry'](_0x56c211)),this[_0x197e84(0x2e4)]();}[_0x3b1eba(0x3ce)](_0x2c66d2){const _0x1e2c60=_0x3b1eba;if(!(this[_0x1e2c60(0x3f0)]instanceof FetchingMissState))throw new TypeError(_0x1e2c60(0x1b4));const _0xee9f01=_0x2c66d2[_0x1e2c60(0x236)](_0x2664f7=>{const _0x13392d=_0x1e2c60,_0x4fc8e2=this[_0x13392d(0x3e5)]['interceptor'][_0x13392d(0x299)](this[_0x13392d(0x3e5)][_0x13392d(0x1af)]['getInterceptPoints']()['COMPRESS_MUTATION_APPLY'])(_0x2664f7['mutations'],null)||_0x2664f7[_0x13392d(0x25a)];return{..._0x2664f7,'mutations':_0x4fc8e2};});this['_lockTransition'](),this[_0x1e2c60(0x351)](this[_0x1e2c60(0x3f0)][_0x1e2c60(0x25e)](_0xee9f01)),this[_0x1e2c60(0x2e4)]();}[_0x3b1eba(0x349)](){const _0x39cdf5=_0x3b1eba;this[_0x39cdf5(0x211)](),this[_0x39cdf5(0x351)](this[_0x39cdf5(0x3f0)][_0x39cdf5(0x1b9)]()),this[_0x39cdf5(0x2e4)]();}[_0x3b1eba(0x239)](_0x478a8c=![]){const _0x52ed62=_0x3b1eba;this['_lockTransition'](),this[_0x52ed62(0x351)](this[_0x52ed62(0x3f0)]['toggleOnline']()),this[_0x52ed62(0x2e4)]();const _0xc0e523=this[_0x52ed62(0x3f0)];_0x478a8c&&_0xc0e523 instanceof SyncedState&&(this[_0x52ed62(0x211)](),this[_0x52ed62(0x351)](_0xc0e523[_0x52ed62(0x3d9)]()),this[_0x52ed62(0x2e4)]());}async['_createInitialState'](){return new Promise(_0x42a647=>{const _0x30609f=_0x428e;this['session'][_0x30609f(0x2bd)][_0x30609f(0x3dc)](take(0x1))[_0x30609f(0x395)](async _0x1901e7=>{const _0x348ccc=_0x30609f;_0x42a647(await this[_0x348ccc(0x3c8)](_0x1901e7===0x3));});});}[_0x3b1eba(0x31e)](){const _0x4ba138=this['unitID'];return{'onStateChange':(_0x344026,_0xce8c9b)=>{const _0x1c9f77=_0x428e;if(_0x344026!==this[_0x1c9f77(0x3f0)])throw new Error(_0x1c9f77(0x2af)+_0x344026['status']+'\x0aAfter:\x20'+_0xce8c9b['status']+_0x1c9f77(0x25d)+this[_0x1c9f77(0x3f0)][_0x1c9f77(0x273)]);this[_0x1c9f77(0x351)](_0xce8c9b);},'onSendChangeset':_0x59de66=>{const _0x3dbc33=_0x428e;!_0x59de66[_0x3dbc33(0x3a8)]&&(_0x59de66['sid']=this['_changesetSessionId'],_0x59de66[_0x3dbc33(0x292)]=++this[_0x3dbc33(0x375)]);const _0x148c00={'eventID':CollaborationEvent['SUBMIT_CHANGESET'],'data':{'unitID':_0x59de66[_0x3dbc33(0x3ac)],'unitType':this[_0x3dbc33(0x269)],'changeset':_0x59de66,'memberID':this[_0x3dbc33(0x39d)][_0x3dbc33(0x344)]()}};this['session'][_0x3dbc33(0x381)](_0x148c00,this[_0x3dbc33(0x3ac)]);},'onMissingChangesets':({from:_0x42860f,to:_0x32588b})=>{const _0x51410d=_0x428e;this['_logService'][_0x51410d(0x335)](_0x51410d(0x30d),_0x51410d(0x1fe)+_0x42860f+_0x51410d(0x1e8)+_0x32588b);const _0x1b2f2b={'eventID':CollaborationEvent['FETCH_MISSING'],'data':{'unitID':_0x4ba138,'unitType':this[_0x51410d(0x269)],'from':_0x42860f,'to':_0x32588b}};this[_0x51410d(0x39d)]['send'](_0x1b2f2b,this[_0x51410d(0x3ac)]);}};}async[_0x3b1eba(0x3c8)](_0x3cd01a){const _0x4abc12=_0x3b1eba;var _0x361ff5,_0x24fd87,_0x4f24b7;const _0xf36830=await((_0x361ff5=this[_0x4abc12(0x1a0)])===null||_0x361ff5===void 0x0?void 0x0:_0x361ff5[_0x4abc12(0x1d6)](this[_0x4abc12(0x3ac)])),_0x4865c3=(_0x24fd87=_0xf36830===null||_0xf36830===void 0x0?void 0x0:_0xf36830[_0x4abc12(0x25a)])!==null&&_0x24fd87!==void 0x0?_0x24fd87:[],_0x24d6d7=(_0x4f24b7=_0xf36830===null||_0xf36830===void 0x0?void 0x0:_0xf36830[_0x4abc12(0x30a)])!==null&&_0x4f24b7!==void 0x0?_0x4f24b7:null,_0x42ff29=!!(_0x24d6d7===null||_0x24d6d7===void 0x0?void 0x0:_0x24d6d7[_0x4abc12(0x3a8)])&&!!(_0x24d6d7===null||_0x24d6d7===void 0x0?void 0x0:_0x24d6d7[_0x4abc12(0x292)]);this[_0x4abc12(0x407)]=_0x42ff29?_0x24d6d7[_0x4abc12(0x3a8)]:uuidv4(),this[_0x4abc12(0x375)]=_0x42ff29?_0x24d6d7[_0x4abc12(0x292)]:0x0;const _0x5f4130=this[_0x4abc12(0x3ac)];try{this[_0x4abc12(0x1b1)](_0x24d6d7,_0x4865c3);}catch(_0x48377c){this[_0x4abc12(0x374)][_0x4abc12(0x1ef)](_0x48377c);}const _0x78f290=this[_0x4abc12(0x31e)]();if(_0x3cd01a){const _0x58854c=createOnlineState(this[_0x4abc12(0x2b7)],_0x5f4130,this['_type'],_0x24d6d7,_0x4865c3,_0x78f290);if(_0x58854c instanceof PendingState)_0x58854c['_schedule']();else{if(_0x58854c instanceof AwaitingWithPendingState||_0x58854c instanceof AwaitingState)_0x58854c['resend']();}return _0x58854c;}return this['_injector']['createInstance'](OfflineState,_0x5f4130,this[_0x4abc12(0x269)],_0x24d6d7,_0x4865c3,_0x78f290);}[_0x3b1eba(0x1b1)](_0x3bedf4,_0x35f2fc){const _0x1673af=_0x3b1eba;var _0x3baebf,_0x1b7b76;const _0xa68872=this['_compressMutationService']['interceptor'][_0x1673af(0x299)](this[_0x1673af(0x3e5)]['interceptor']['getInterceptPoints']()[_0x1673af(0x203)]);(_0x3baebf=_0xa68872((_0x3bedf4===null||_0x3bedf4===void 0x0?void 0x0:_0x3bedf4['mutations'])||[],null))===null||_0x3baebf===void 0x0||_0x3baebf['forEach'](_0x49e816=>this['_commandService'][_0x1673af(0x2c5)](_0x49e816['id'],_0x49e816['params'])),(_0x1b7b76=_0xa68872(_0x35f2fc||[],null))===null||_0x1b7b76===void 0x0||_0x1b7b76[_0x1673af(0x387)](_0x546b21=>this[_0x1673af(0x278)][_0x1673af(0x2c5)](_0x546b21['id'],_0x546b21[_0x1673af(0x232)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x323dd6,_0x1ecd98,_0x24e2f1,_0xac4e84,_0x1e36f5,_0x3142c1,_0x1608eb,_0x2d6efa,_0x2bf49f,_0x1a9230,_0x1702ce,_0x1266b8,_0x90867d,_0x384fdb){const _0x3483f3=_0x3b1eba;super(_0x323dd6,_0x24e2f1,_0x1ecd98,_0xac4e84,_0x1e36f5,_0x3142c1,_0x1608eb,_0x2d6efa,_0x2bf49f,_0x1a9230,_0x1702ce,_0x1266b8,_0x90867d,_0x384fdb),this[_0x3483f3(0x3ac)]=_0x323dd6,this['type']=_0x1ecd98,_defineProperty(this,_0x3483f3(0x259),null);}[_0x3b1eba(0x2b6)](_0x3eb2fa){this['_handlerCallback']=_0x3eb2fa;}[_0x3b1eba(0x1d2)](){const _0x346a6f=_0x3b1eba;this[_0x346a6f(0x259)]=null,super['dispose']();}[_0x3b1eba(0x31e)](){const _0x120526=_0x3b1eba,_0x1b2e38=super[_0x120526(0x31e)]();return _0x1b2e38[_0x120526(0x354)]=_0x119b6f=>{const _0x304056=_0x120526;var _0x49fb79,_0x40209a;return(_0x49fb79=this[_0x304056(0x259)])===null||_0x49fb79===void 0x0||(_0x40209a=_0x49fb79['onTransformIME'])===null||_0x40209a===void 0x0?void 0x0:_0x40209a[_0x304056(0x223)](_0x49fb79,_0x119b6f);},_0x1b2e38['onTransformState']=_0x484e72=>{const _0x5075cb=_0x120526;var _0x36206a,_0x463de9;return(_0x36206a=this[_0x5075cb(0x259)])===null||_0x36206a===void 0x0||(_0x463de9=_0x36206a[_0x5075cb(0x281)])===null||_0x463de9===void 0x0?void 0x0:_0x463de9[_0x5075cb(0x223)](_0x36206a,_0x484e72);},_0x1b2e38[_0x120526(0x35d)]=_0x54fef2=>{const _0x223d77=_0x120526;var _0x4fbae4,_0x53f58f;return(_0x4fbae4=this[_0x223d77(0x259)])===null||_0x4fbae4===void 0x0||(_0x53f58f=_0x4fbae4[_0x223d77(0x35d)])===null||_0x53f58f===void 0x0?void 0x0:_0x53f58f[_0x223d77(0x223)](_0x4fbae4,_0x54fef2);},_0x1b2e38['onSyncEditingCollabCursor']=_0x4d002d=>{const _0x4cd6dd=_0x120526;var _0x13d314,_0x43ff6f;return(_0x13d314=this[_0x4cd6dd(0x259)])===null||_0x13d314===void 0x0||(_0x43ff6f=_0x13d314[_0x4cd6dd(0x317)])===null||_0x43ff6f===void 0x0?void 0x0:_0x43ff6f[_0x4cd6dd(0x223)](_0x13d314,_0x4d002d);},_0x1b2e38[_0x120526(0x208)]=_0x1bdd0b=>{const _0x1f001a=_0x120526;var _0x4f67e0,_0x1965d4,_0x505c44;if(!((_0x4f67e0=this[_0x1f001a(0x259)])===null||_0x4f67e0===void 0x0?void 0x0:_0x4f67e0[_0x1f001a(0x208)]))throw new Error(_0x1f001a(0x347));return(_0x1965d4=this[_0x1f001a(0x259)])===null||_0x1965d4===void 0x0||(_0x505c44=_0x1965d4[_0x1f001a(0x208)])===null||_0x505c44===void 0x0?void 0x0:_0x505c44[_0x1f001a(0x223)](_0x1965d4,_0x1bdd0b);},_0x1b2e38[_0x120526(0x27e)]=_0x5c3bf2=>{const _0x53c630=_0x120526;var _0x576d3d,_0x421386,_0x50e7ed;if(!((_0x576d3d=this[_0x53c630(0x259)])===null||_0x576d3d===void 0x0?void 0x0:_0x576d3d[_0x53c630(0x27e)]))throw new Error('onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.');return(_0x421386=this['_handlerCallback'])===null||_0x421386===void 0x0||(_0x50e7ed=_0x421386[_0x53c630(0x27e)])===null||_0x50e7ed===void 0x0?void 0x0:_0x50e7ed['call'](_0x421386,_0x5c3bf2);},_0x1b2e38;}async['_init'](){const _0x179212=_0x3b1eba,_0x26495f=await super[_0x179212(0x2f1)]();return this[_0x179212(0x34c)](this[_0x179212(0x278)][_0x179212(0x29d)]((_0x17814b,_0x91f7d2)=>{const _0x1bdb1e=_0x179212;if(_0x17814b[_0x1bdb1e(0x3ff)]!==CommandType[_0x1bdb1e(0x3cc)]||(_0x91f7d2===null||_0x91f7d2===void 0x0?void 0x0:_0x91f7d2[_0x1bdb1e(0x20f)])||(_0x91f7d2===null||_0x91f7d2===void 0x0?void 0x0:_0x91f7d2[_0x1bdb1e(0x219)]))return;if(_0x17814b['id']===RichTextEditingMutation['id'])return;const _0xe48dce=_0x17814b['params'];if((_0xe48dce===null||_0xe48dce===void 0x0?void 0x0:_0xe48dce[_0x1bdb1e(0x355)])!==this[_0x1bdb1e(0x3ac)])return;const _0x165417=_0x17814b,_0x59282b=this[_0x1bdb1e(0x3e5)][_0x1bdb1e(0x1af)]['fetchThroughInterceptors'](this['_compressMutationService']['interceptor']['getInterceptPoints']()[_0x1bdb1e(0x37f)])([_0x165417],this[_0x1bdb1e(0x1c3)])||[_0x165417];this['_onLocalMutation'](_0x59282b[0x0]);})),_0x26495f;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],DocCollaborationEntity);function _0x428e(_0x4ee4fa,_0x169f45){_0x4ee4fa=_0x4ee4fa-0x199;const _0x14c343=_0x14c3();let _0x428e73=_0x14c343[_0x4ee4fa];return _0x428e73;}let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x34f00c,_0x58ee1f,_0x555cde,_0x3901a5,_0x4ca1d8,_0x33b59a,_0x262149,_0x13e1f4,_0x2cb536,_0x51e10e,_0x21b3b2,_0x595110,_0x5e0c60,_0x357cef,_0x254940){const _0x495d73=_0x3b1eba;super(_0x34f00c,_0x555cde,_0x58ee1f,_0x3901a5,_0x4ca1d8,_0x33b59a,_0x262149,_0x2cb536,_0x51e10e,_0x21b3b2,_0x595110,_0x5e0c60,_0x357cef,_0x254940),this[_0x495d73(0x3ac)]=_0x34f00c,this[_0x495d73(0x3ff)]=_0x58ee1f,this[_0x495d73(0x24e)]=_0x13e1f4;}[_0x3b1eba(0x31e)](){const _0x31c9cc=_0x3b1eba,_0x329558=super[_0x31c9cc(0x31e)]();return _0x329558[_0x31c9cc(0x35d)]=_0x55f209=>this[_0x31c9cc(0x24e)][_0x31c9cc(0x321)](_0x55f209),_0x329558;}async[_0x3b1eba(0x2f1)](){const _0x2a3cb9=_0x3b1eba,_0x3a56ba=await super['_init']();return this[_0x2a3cb9(0x34c)](this[_0x2a3cb9(0x278)]['onMutationExecutedForCollab']((_0x1a6a36,_0x4d7e94)=>{const _0x117b80=_0x2a3cb9;if(_0x1a6a36['type']!==CommandType[_0x117b80(0x3cc)]||(_0x4d7e94===null||_0x4d7e94===void 0x0?void 0x0:_0x4d7e94[_0x117b80(0x20f)])||(_0x4d7e94===null||_0x4d7e94===void 0x0?void 0x0:_0x4d7e94['onlyLocal']))return;const _0x119dca=_0x1a6a36[_0x117b80(0x232)];if((_0x119dca===null||_0x119dca===void 0x0?void 0x0:_0x119dca[_0x117b80(0x355)])!==this['unitID'])return;const _0x52977c=_0x1a6a36,_0x44d6c5=this[_0x117b80(0x3e5)][_0x117b80(0x1af)][_0x117b80(0x299)](this['_compressMutationService'][_0x117b80(0x1af)][_0x117b80(0x199)]()[_0x117b80(0x37f)])([_0x52977c],this[_0x117b80(0x1c3)])||[_0x52977c];this[_0x117b80(0x1a9)](_0x44d6c5[0x0]);})),_0x3a56ba;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(SheetTransformSelectionsService)),__decorateParam(0x8,Inject(CollaborationUIEventService)),__decorateParam(0x9,IUniverInstanceService),__decorateParam(0xa,ILogService),__decorateParam(0xb,ICommandService),__decorateParam(0xc,IPermissionService),__decorateParam(0xd,Optional(ISingleActiveUnitService)),__decorateParam(0xe,Optional(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=createIdentifier(_0x3b1eba(0x1a1));function deserializeToCombResponse(_0x2874dd){const _0x38840b=_0x3b1eba,_0xa88b4d=_0x2874dd[_0x38840b(0x1b3)],_0x1719b8=JSON[_0x38840b(0x3c4)](_0xa88b4d);switch(_0x1719b8[_0x38840b(0x1a2)]){case CombCmd[_0x38840b(0x378)]:case CombCmd[_0x38840b(0x2f8)]:{const _0x4ec3ec=_0x1719b8[_0x38840b(0x247)];return{..._0x1719b8,'data':_0x4ec3ec,'cmd':_0x1719b8[_0x38840b(0x1a2)]};}case CombCmd[_0x38840b(0x1fc)]:{const _0x1e606a=_0x1719b8[_0x38840b(0x1f3)];return{..._0x1719b8,'data':_0x1e606a,'cmd':_0x1719b8[_0x38840b(0x1a2)]};}case CombCmd[_0x38840b(0x280)]:{const _0x2f02ba=_0x1719b8[_0x38840b(0x3eb)];switch(_0x2f02ba['eventID']){case CollaborationEvent[_0x38840b(0x370)]:var _0x4ec909;return{..._0x1719b8,'data':{..._0x2f02ba,'data':(_0x4ec909=_0x2f02ba['permissionRejEvent'])===null||_0x4ec909===void 0x0?void 0x0:_0x4ec909['cs']},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x23e)]:var _0x12229f;return{..._0x1719b8,'data':{..._0x2f02ba,'data':(_0x12229f=_0x2f02ba[_0x38840b(0x1da)])===null||_0x12229f===void 0x0?void 0x0:_0x12229f['cs']},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x1bf)]:var _0x5ab9a0;return{..._0x1719b8,'data':{..._0x2f02ba,'data':(_0x5ab9a0=_0x2f02ba[_0x38840b(0x2ec)])===null||_0x5ab9a0===void 0x0?void 0x0:_0x5ab9a0['cs']},'cmd':_0x1719b8['cmd']};case CollaborationEvent['CHANGESET_REJ']:var _0x57a7db;return{..._0x1719b8,'data':{..._0x2f02ba,'data':(_0x57a7db=_0x2f02ba['csRejEvent'])===null||_0x57a7db===void 0x0?void 0x0:_0x57a7db['cs']},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x2be)]:var _0xa8abf6;return{..._0x1719b8,'data':{..._0x2f02ba,'data':(_0xa8abf6=_0x2f02ba['csShouldRetryEvent'])===null||_0xa8abf6===void 0x0?void 0x0:_0xa8abf6['cs']},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x3e7)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x23f)]},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x38e)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x1cb)]},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x267)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba['leaveEvent']},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent['LIVESHARE_NEW_HOST']:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x22b)]},'cmd':_0x1719b8['cmd']};case CollaborationEvent[_0x38840b(0x2dc)]:case CollaborationEvent[_0x38840b(0x366)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x210)]},'cmd':_0x1719b8['cmd']};case CollaborationEvent[_0x38840b(0x295)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x22b)]},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x3f5)]:return{..._0x1719b8,'data':_0x2f02ba,'cmd':_0x1719b8['cmd']};case CollaborationEvent['COMMENT_UPDATE']:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x2c4)]},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x3bb)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x205)]},'cmd':_0x1719b8[_0x38840b(0x1a2)]};case CollaborationEvent[_0x38840b(0x307)]:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x33c)]},'cmd':_0x1719b8['cmd']};case CollaborationEvent['UNISCRIPT_RUN']:return{..._0x1719b8,'data':{..._0x2f02ba,'data':_0x2f02ba[_0x38840b(0x2d5)]},'cmd':_0x1719b8[_0x38840b(0x1a2)]};default:return _0x1719b8;}}default:return _0x1719b8;}}function serializeCombRequest(_0x93543e){const _0x1f1d29=_0x3b1eba;switch(_0x93543e[_0x1f1d29(0x1a2)]){case CombCmd[_0x1f1d29(0x378)]:case CombCmd[_0x1f1d29(0x2f8)]:return JSON['stringify']({'cmd':_0x93543e[_0x1f1d29(0x1a2)],'routeKey':_0x93543e[_0x1f1d29(0x3d8)]});case CombCmd[_0x1f1d29(0x1ed)]:{let _0x25c10c;switch(_0x93543e[_0x1f1d29(0x1b3)][_0x1f1d29(0x227)]){case CollaborationEvent[_0x1f1d29(0x3e7)]:_0x25c10c={'eventID':CollaborationEvent[_0x1f1d29(0x3e7)],'updateCursorEvent':_0x93543e[_0x1f1d29(0x1b3)][_0x1f1d29(0x1b3)]};break;case CollaborationEvent[_0x1f1d29(0x267)]:_0x25c10c={'eventID':CollaborationEvent[_0x1f1d29(0x267)],'leaveEvent':_0x93543e[_0x1f1d29(0x1b3)][_0x1f1d29(0x1b3)]};break;case CollaborationEvent[_0x1f1d29(0x38e)]:_0x25c10c={'eventID':CollaborationEvent['USERS_ENTER'],'joinEvent':_0x93543e[_0x1f1d29(0x1b3)][_0x1f1d29(0x1b3)]};break;case CollaborationEvent[_0x1f1d29(0x253)]:_0x25c10c={'eventID':CollaborationEvent['LIVESHARE_NEW_HOST'],'liveShareNewHost':_0x93543e[_0x1f1d29(0x1b3)]['data']};break;case CollaborationEvent[_0x1f1d29(0x366)]:_0x25c10c={'eventID':CollaborationEvent[_0x1f1d29(0x366)],'liveShareOperation':_0x93543e[_0x1f1d29(0x1b3)][_0x1f1d29(0x1b3)]};break;case CollaborationEvent[_0x1f1d29(0x295)]:_0x25c10c={'eventID':CollaborationEvent[_0x1f1d29(0x295)],'liveShareTerminate':_0x93543e[_0x1f1d29(0x1b3)]['data']};break;case CollaborationEvent[_0x1f1d29(0x3de)]:_0x25c10c={'eventID':CollaborationEvent[_0x1f1d29(0x3de)],'liveShareRequestHost':_0x93543e[_0x1f1d29(0x1b3)][_0x1f1d29(0x1b3)]};break;case CollaborationEvent[_0x1f1d29(0x2dc)]:_0x25c10c={'eventID':CollaborationEvent[_0x1f1d29(0x2dc)]};break;default:_0x25c10c={'eventID':_0x93543e[_0x1f1d29(0x1b3)]['eventID']};}return JSON[_0x1f1d29(0x3e8)]({'cmd':_0x93543e[_0x1f1d29(0x1a2)],'routeKey':_0x93543e[_0x1f1d29(0x3d8)],'collaMsg':_0x25c10c});}case CombCmd[_0x1f1d29(0x1fc)]:return JSON[_0x1f1d29(0x3e8)]({'cmd':_0x93543e[_0x1f1d29(0x1a2)],'routeKey':_0x93543e[_0x1f1d29(0x3d8)],'joinReq':_0x93543e[_0x1f1d29(0x1b3)]});case CombCmd[_0x1f1d29(0x2e8)]:return JSON[_0x1f1d29(0x3e8)]({'cmd':_0x93543e[_0x1f1d29(0x1a2)],'routeKey':_0x93543e[_0x1f1d29(0x3d8)],'leaveReq':_0x93543e[_0x1f1d29(0x1b3)]});default:throw new Error(_0x1f1d29(0x2f9));}}const ICollaborationSocketService=createIdentifier(_0x3b1eba(0x3a2));function generateSubmitChangesPath(_0x487056,_0x46f842,_0x3e544a){const _0x55063d=_0x3b1eba;return _0x487056+'/'+_0x46f842+_0x55063d(0x31d)+_0x3e544a+_0x55063d(0x19e);}let CollaborationSocketService=class CollaborationSocketService extends Disposable{constructor(_0x114c52,_0x15bf7c,_0x21c73a,_0x3e3c18,_0x26b1a1){const _0x18fb62=_0x3b1eba;super(),this['_injector']=_0x114c52,this['_httpService']=_0x15bf7c,this[_0x18fb62(0x3ee)]=_0x21c73a,this[_0x18fb62(0x374)]=_0x3e3c18,this['_snapshotServerService']=_0x26b1a1;}['_doCreateSocket'](_0x2fbfd1){const _0x249843=_0x3b1eba,_0x297e4c=this[_0x249843(0x2b7)][_0x249843(0x2bf)](ISocketService);if(!_0x297e4c)throw new Error(_0x249843(0x27d));const _0x58205f=_0x297e4c[_0x249843(0x3bc)](_0x2fbfd1);if(!_0x58205f)throw new Error(_0x249843(0x38c));const _0x15bbf6=new DisposableCollection(),_0x41acae=new Subject();_0x15bbf6[_0x249843(0x2d9)](_0x58205f[_0x249843(0x37a)][_0x249843(0x395)](_0x2169fe=>_0x41acae[_0x249843(0x34d)](_0x2169fe))),_0x15bbf6[_0x249843(0x2d9)](toDisposable(()=>_0x41acae[_0x249843(0x1f5)]()));const _0x4e845c=new Subject();_0x15bbf6[_0x249843(0x2d9)](_0x58205f['error$']['subscribe'](_0x5df2ad=>_0x4e845c[_0x249843(0x34d)](_0x5df2ad))),_0x15bbf6[_0x249843(0x2d9)](toDisposable(()=>_0x4e845c[_0x249843(0x1f5)]()));const _0x24b070=new Subject();_0x15bbf6[_0x249843(0x2d9)](_0x58205f[_0x249843(0x2c1)][_0x249843(0x395)](_0x458f80=>{const _0x7c594b=_0x249843,_0x3a78fd=deserializeToCombResponse(_0x458f80);_0x24b070[_0x7c594b(0x34d)](_0x3a78fd);})),_0x15bbf6[_0x249843(0x2d9)](toDisposable(()=>_0x24b070[_0x249843(0x1f5)]()));let _0x3688a8;const _0x2fcf0a=()=>{const _0x1f0763=_0x249843;_0x4e845c[_0x1f0763(0x34d)](new Event(_0x1f0763(0x1e0))),_0x41acae[_0x1f0763(0x34d)](new Event(_0x1f0763(0x1e0))),_0x3688a8[_0x1f0763(0x3cb)]();};return _0x3688a8={'memberID':'','close$':_0x41acae[_0x249843(0x2ca)](),'error$':_0x4e845c[_0x249843(0x2ca)](),'open$':_0x58205f[_0x249843(0x312)],'message$':_0x24b070[_0x249843(0x2ca)](),'send':_0x5eff3c=>{const _0x1f0934=_0x249843;if(_0x5eff3c[_0x1f0934(0x1a2)]===CombCmd[_0x1f0934(0x1ed)]){if(_0x5eff3c[_0x1f0934(0x1b3)][_0x1f0934(0x227)]===CollaborationEvent[_0x1f0934(0x3b8)]){this[_0x1f0934(0x27b)](_0x3688a8,_0x5eff3c[_0x1f0934(0x1b3)])[_0x1f0934(0x38f)](_0x1d35d3=>{const _0x4a0f8c=_0x1f0934;this['_logService'][_0x4a0f8c(0x1ef)](_0x1d35d3),_0x2fcf0a();});return;}if(_0x5eff3c[_0x1f0934(0x1b3)][_0x1f0934(0x227)]===CollaborationEvent[_0x1f0934(0x3e4)]){const _0x531f5c=_0x5eff3c[_0x1f0934(0x1b3)];this[_0x1f0934(0x2fa)](_0x531f5c)['then'](_0x59b582=>{const _0x50a372=_0x1f0934;_0x24b070[_0x50a372(0x34d)]({'cmd':CombCmd['RECV'],'code':CmdRspCode['OK'],'routeKey':_0x531f5c[_0x50a372(0x1b3)]['unitID'],'routeType':'','data':{'eventID':CollaborationEvent[_0x50a372(0x28e)],'data':{'changesets':_0x59b582}}});})[_0x1f0934(0x38f)](_0x4ec4ce=>{const _0x9fc8b8=_0x1f0934;this[_0x9fc8b8(0x374)]['error'](_0x4ec4ce),_0x2fcf0a();});return;}}_0x58205f[_0x1f0934(0x381)](serializeCombRequest(_0x5eff3c));},'close':()=>{const _0x141c46=_0x249843;_0x58205f[_0x141c46(0x3cb)](),_0x15bbf6[_0x141c46(0x1d2)]();}},_0x3688a8;}async[_0x3b1eba(0x27b)](_0x7a8774,_0x2312eb){const _0xa567dc=_0x3b1eba;var _0x4eeb91;const {unitType:_0x3444e1,unitID:_0x5c106e,changeset:_0x32599a}=_0x2312eb[_0xa567dc(0x1b3)],_0x195b34={'unitID':_0x5c106e,'memberID':_0x7a8774['memberID'],'type':_0x3444e1,'changeset':parseChangesetToProtocol(_0x32599a)},_0x43e1b6=this[_0xa567dc(0x3ee)][_0xa567dc(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x43925a=generateSubmitChangesPath((_0x4eeb91=_0x43e1b6===null||_0x43e1b6===void 0x0?void 0x0:_0x43e1b6[_0xa567dc(0x363)])!==null&&_0x4eeb91!==void 0x0?_0x4eeb91:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0x3444e1,_0x5c106e);try{await this[_0xa567dc(0x282)]['post'](_0x43925a,{'body':_0x195b34});}catch(_0x468dc5){this['_logService']['error'](_0xa567dc(0x339),_0xa567dc(0x3f7));throw _0x468dc5;}}async[_0x3b1eba(0x2fa)](_0x27a1ff){const _0x180954=_0x3b1eba,{unitID:_0x3db7b8,from:_0x5efb51,to:_0xe4e605,unitType:_0x257ff5}=_0x27a1ff['data'];return(await this[_0x180954(0x284)][_0x180954(0x200)]({'metadata':void 0x0},{'unitID':_0x3db7b8,'type':_0x257ff5,'from':_0x5efb51,'to':_0xe4e605}))['changesets'][_0x180954(0x236)](_0x33a7f8=>{const _0x262263=_0x180954;if(_0x33a7f8[_0x262263(0x25a)]===null||_0x33a7f8[_0x262263(0x25a)]===void 0x0)_0x33a7f8['mutations']=[];return _0x33a7f8;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ILogService),__decorateParam(0x4,ISnapshotServerService)],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends Disposable{get['_socket'](){const _0x505cf9=_0x3b1eba;return this[_0x505cf9(0x257)][_0x505cf9(0x265)]();}constructor(_0x4f2c0c,_0x406c97,_0xb1ae42,_0x58d8d8,_0x5c9f68,_0x438e64){const _0x10cd73=_0x3b1eba;super(),this['_injector']=_0x4f2c0c,this[_0x10cd73(0x374)]=_0x406c97,this[_0x10cd73(0x3ee)]=_0xb1ae42,this[_0x10cd73(0x23c)]=_0x58d8d8,this['_collaborationUIEventService']=_0x5c9f68,this['_networkConditionService']=_0x438e64,_defineProperty(this,_0x10cd73(0x257),new BehaviorSubject(void 0x0)),_defineProperty(this,_0x10cd73(0x296),this[_0x10cd73(0x257)][_0x10cd73(0x2ca)]()),_defineProperty(this,_0x10cd73(0x1bd),null),_defineProperty(this,'_sessions',new Map()),_defineProperty(this,'_status$',new BehaviorSubject(0x0)),_defineProperty(this,'status$',this[_0x10cd73(0x2db)][_0x10cd73(0x2ca)]()),_defineProperty(this,_0x10cd73(0x1c1),![]),_defineProperty(this,'_retryConnectingTimer',void 0x0),_defineProperty(this,_0x10cd73(0x2c3),0x0),_defineProperty(this,'_sendHeartbeatTimer',void 0x0),_defineProperty(this,_0x10cd73(0x404),void 0x0),this['_listenToNetworkCondition']();}[_0x3b1eba(0x350)](){const _0x24d3ca=_0x3b1eba;if(!this[_0x24d3ca(0x2f0)])return;this[_0x24d3ca(0x34c)](this['_networkConditionService'][_0x24d3ca(0x2ad)]['subscribe'](_0x50e09f=>{const _0x63a3f6=_0x24d3ca;if(_0x50e09f&&!this[_0x63a3f6(0x3cd)])this[_0x63a3f6(0x389)]();if(!_0x50e09f)this[_0x63a3f6(0x249)]();}));}['dispose'](){const _0x3562b0=_0x3b1eba;super[_0x3562b0(0x1d2)](),this['_clearRetryConnectingTimer'](),this['_clearTimeoutTimer'](),this[_0x3562b0(0x1fd)](),this[_0x3562b0(0x326)][_0x3562b0(0x387)](_0x3fb44c=>_0x3fb44c['dispose']()),this[_0x3562b0(0x326)][_0x3562b0(0x397)](),this[_0x3562b0(0x2db)][_0x3562b0(0x1f5)]();}async[_0x3b1eba(0x3d1)](_0x261d34){const _0x24886a=_0x3b1eba;if(this[_0x24886a(0x326)]['has'](_0x261d34))return this[_0x24886a(0x326)][_0x24886a(0x2bf)](_0x261d34);this['_tryEnsureSocket']();const _0x209c49=this['_injector'][_0x24886a(0x24f)](CollaborationSession,_0x261d34,this[_0x24886a(0x257)][_0x24886a(0x2ca)]());return this[_0x24886a(0x326)][_0x24886a(0x1f0)](_0x261d34,_0x209c49),_0x209c49;}[_0x3b1eba(0x1b7)](_0x3d1b9d){const _0x1dddd9=_0x3b1eba,_0x3ea658=this[_0x1dddd9(0x326)][_0x1dddd9(0x2bf)](_0x3d1b9d);_0x3ea658&&(this['_sessions'][_0x1dddd9(0x35e)](_0x3d1b9d),_0x3ea658[_0x1dddd9(0x3cb)]());if(!this[_0x1dddd9(0x326)][_0x1dddd9(0x275)]){var _0x4e7f3c;(_0x4e7f3c=this['_socket'])===null||_0x4e7f3c===void 0x0||_0x4e7f3c[_0x1dddd9(0x3cb)]();}}[_0x3b1eba(0x389)](){const _0x2851c6=_0x3b1eba;this[_0x2851c6(0x2c3)]=0x0,this[_0x2851c6(0x2d2)](),this[_0x2851c6(0x3fb)]();}[_0x3b1eba(0x2d2)](){const _0x44f960=_0x3b1eba;this['_retryConnectingTimer']!=null&&(clearTimeout(this['_retryConnectingTimer']),this[_0x44f960(0x1f7)]=null);}async[_0x3b1eba(0x2cf)](){const _0x54ff92=_0x3b1eba;var _0x31dac5;const _0x16b76c=this[_0x54ff92(0x3ee)][_0x54ff92(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x2a8564=(_0x31dac5=_0x16b76c===null||_0x16b76c===void 0x0?void 0x0:_0x16b76c['collabWebSocketUrl'])!==null&&_0x31dac5!==void 0x0?_0x31dac5:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x24f2df=await this[_0x54ff92(0x23c)][_0x54ff92(0x3bc)](_0x2a8564);return this[_0x54ff92(0x1bd)]=_0x24f2df,_0x24f2df;}async['_tryEnsureSocket'](){const _0x579f39=_0x3b1eba;try{var _0x4278dd,_0x2b1062;const _0x42e1a2=(_0x4278dd=(_0x2b1062=this[_0x579f39(0x3cd)])!==null&&_0x2b1062!==void 0x0?_0x2b1062:this[_0x579f39(0x1bd)])!==null&&_0x4278dd!==void 0x0?_0x4278dd:await this[_0x579f39(0x2cf)]();if(_0x42e1a2){const _0x649a5f=_0x42e1a2['send'];_0x42e1a2[_0x579f39(0x381)]=_0x3cba81=>{const _0xb3be1c=_0x579f39;if(_0x3cba81[_0xb3be1c(0x1a2)]!==CombCmd[_0xb3be1c(0x2e8)])this['_rescheduleHeartbeat']();return _0x649a5f[_0xb3be1c(0x2d3)](_0x42e1a2,[_0x3cba81]);},_0x42e1a2[_0x579f39(0x2c1)][_0x579f39(0x395)](_0x46e0b7=>this[_0x579f39(0x3b2)](_0x42e1a2,_0x46e0b7)),_0x42e1a2[_0x579f39(0x225)]['pipe'](_0x4732e1(0x1))[_0x579f39(0x395)](_0xab5b88=>this[_0x579f39(0x374)][_0x579f39(0x1ef)]('[CollaborationSessionService]:\x20socket\x20error',_0xab5b88)),_0x42e1a2[_0x579f39(0x312)][_0x579f39(0x3dc)](_0x4732e1(0x1))[_0x579f39(0x395)](()=>{const _0x573963=_0x579f39;this[_0x573963(0x1ae)](_0x42e1a2);}),_0x42e1a2[_0x579f39(0x37a)][_0x579f39(0x3dc)](_0x4732e1(0x1))[_0x579f39(0x395)](_0x3b644d=>{const _0x3ba89f=_0x579f39;this['_logService'][_0x3ba89f(0x335)]('[CollaborationSessionService]',_0x3ba89f(0x1ad),_0x3b644d),this[_0x3ba89f(0x28a)]();});}}catch(_0xdd73db){this['_logService'][_0x579f39(0x1ef)](_0xdd73db),this[_0x579f39(0x28a)]();}}[_0x3b1eba(0x1ae)](_0x34013e){const _0x6ef5ca=_0x3b1eba;this[_0x6ef5ca(0x374)][_0x6ef5ca(0x335)](_0x6ef5ca(0x201),_0x6ef5ca(0x379)),_0x34013e[_0x6ef5ca(0x381)]({'cmd':CombCmd[_0x6ef5ca(0x2f8)]}),this[_0x6ef5ca(0x2a6)]();}['_onOffline'](){const _0x25103d=_0x3b1eba;this[_0x25103d(0x1c1)]=![],this[_0x25103d(0x1bd)]=null,this[_0x25103d(0x2db)][_0x25103d(0x34d)](0x2),this['_socket$'][_0x25103d(0x34d)](null),this[_0x25103d(0x1e9)](),this[_0x25103d(0x1fd)]();}['_onConnectionFailed'](){const _0x270d29=_0x3b1eba;var _0x2053f1;this['_onOffline']();if(this[_0x270d29(0x2c3)]<((_0x2053f1=this['_configService'][_0x270d29(0x21c)](_0x270d29(0x1e5)))!==null&&_0x2053f1!==void 0x0?_0x2053f1:0x3))this[_0x270d29(0x2a2)][_0x270d29(0x2ee)]({'id':_0x270d29(0x39a)}),this[_0x270d29(0x3fb)]();else this[_0x270d29(0x2a2)][_0x270d29(0x2ee)]({'id':_0x270d29(0x328)});}['_tryReconnect'](){const _0x3b130a=_0x3b1eba;var _0xfa861;const _0x221a42=this['_retryCount'],_0x35e217=this['_configService'][_0x3b130a(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x77ea=_0x221a42===0x0?0x0:((_0xfa861=_0x35e217===null||_0x35e217===void 0x0?void 0x0:_0x35e217['retryConnectingInterval'])!==null&&_0xfa861!==void 0x0?_0xfa861:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x221a42;this['_retryConnectingTimer']=setTimeout(()=>{const _0x298dc3=_0x3b130a;clearTimeout(this[_0x298dc3(0x1f7)]),this[_0x298dc3(0x1f7)]=null,this[_0x298dc3(0x21e)]();},_0x77ea),this['_retryCount']+=0x1;}['_onMessage'](_0x19518c,_0x208641){const _0x314111=_0x3b1eba,{cmd:_0x40bda7}=_0x208641;_0x40bda7===CombCmd[_0x314111(0x2f8)]&&!this[_0x314111(0x1c1)]&&(_0x19518c[_0x314111(0x1b8)]=_0x208641['data']['memberID'],this[_0x314111(0x257)][_0x314111(0x34d)](_0x19518c),this[_0x314111(0x2db)][_0x314111(0x34d)](0x3),this[_0x314111(0x1c1)]=!![],this['_candidateSocket']=null);if(_0x40bda7===CombCmd[_0x314111(0x378)])this[_0x314111(0x1e9)]();this['_rescheduleHeartbeat']();}[_0x3b1eba(0x2a6)](){const _0x366067=_0x3b1eba;var _0x5178df;this[_0x366067(0x1fd)](),this[_0x366067(0x3ed)]=setTimeout(()=>this['_sendHeartbeat'](),(_0x5178df=this[_0x366067(0x3ee)][_0x366067(0x21c)](_0x366067(0x2d7)))!==null&&_0x5178df!==void 0x0?_0x5178df:DEFAULT_HEARTBEAT_INTERVAL);}[_0x3b1eba(0x30c)](){const _0x1d1d7d=_0x3b1eba;this[_0x1d1d7d(0x3cd)][_0x1d1d7d(0x381)]({'cmd':CombCmd[_0x1d1d7d(0x378)]}),this[_0x1d1d7d(0x320)]();}[_0x3b1eba(0x320)](){const _0x160a42=_0x3b1eba;var _0x4bd757;this['_timeoutTimer']=setTimeout(()=>this[_0x160a42(0x28a)](),(_0x4bd757=this[_0x160a42(0x3ee)]['getConfig']('HEARTBEAT_TIMEOUT'))!==null&&_0x4bd757!==void 0x0?_0x4bd757:DEFAULT_HEARTBEAT_TIMEOUT);}['_clearHeartbeatTimer'](){const _0x4ab5de=_0x3b1eba;this[_0x4ab5de(0x3ed)]!=null&&(clearTimeout(this['_sendHeartbeatTimer']),this[_0x4ab5de(0x3ed)]=null);}[_0x3b1eba(0x1e9)](){const _0x5cfa49=_0x3b1eba;this[_0x5cfa49(0x404)]!=null&&(clearTimeout(this[_0x5cfa49(0x404)]),this['_timeoutTimer']=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ILogService),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,Inject(CollaborationUIEventService)),__decorateParam(0x5,Optional(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends RxDisposable{constructor(_0x37f4fd,_0x3854f7,_0x52d817,_0x1a1190){const _0x41db27=_0x3b1eba;var _0x933700;super(),this['_injector']=_0x37f4fd,this['_collabSessionService']=_0x3854f7,this[_0x41db27(0x3ee)]=_0x52d817,this[_0x41db27(0x1c3)]=_0x1a1190,_defineProperty(this,'_entities',new Map()),_defineProperty(this,'_entityInit$',new Subject()),_defineProperty(this,_0x41db27(0x3ca),this[_0x41db27(0x3d7)][_0x41db27(0x2ca)]());if(((_0x933700=this[_0x41db27(0x3ee)][_0x41db27(0x21c)](_0x41db27(0x3be)))===null||_0x933700===void 0x0?void 0x0:_0x933700[_0x41db27(0x26e)])!==![])this['_init']();}['dispose'](){const _0x481b79=_0x3b1eba;super[_0x481b79(0x1d2)](),this[_0x481b79(0x212)][_0x481b79(0x387)](_0x1a6760=>_0x1a6760[_0x481b79(0x1d2)]()),this['_entities'][_0x481b79(0x397)]();}['getCollabEntity'](_0x38fa77){const _0x351583=_0x3b1eba;var _0x5b0705;return(_0x5b0705=this[_0x351583(0x212)][_0x351583(0x2bf)](_0x38fa77))!==null&&_0x5b0705!==void 0x0?_0x5b0705:null;}[_0x3b1eba(0x319)](_0x5a0e14){const _0x5aed91=_0x3b1eba,_0x232251=this[_0x5aed91(0x301)](_0x5a0e14);if(_0x232251)return of(_0x232251);return this['_entityInit$']['pipe'](filter(_0x4374db=>_0x4374db[_0x5aed91(0x3ac)]===_0x5a0e14));}[_0x3b1eba(0x25f)](_0x82ee80){const _0x37fc8b=_0x3b1eba;return firstValueFrom(this[_0x37fc8b(0x319)](_0x82ee80)['pipe'](_0x30c3d0(()=>void 0x0)));}[_0x3b1eba(0x2f1)](){const _0x25e58d=_0x3b1eba,_0x15a37b=0x10;this[_0x25e58d(0x1c3)]['getTypeOfUnitAdded$'](UniverInstanceType['UNIVER_SHEET'])[_0x25e58d(0x3dc)](takeUntil(this[_0x25e58d(0x1d8)]),delay(_0x15a37b))['subscribe'](async _0x36312f=>{const _0x17fff4=_0x25e58d,_0x54dafa=_0x36312f[_0x17fff4(0x3af)][_0x17fff4(0x1a6)](),_0x3c9fa9=await this[_0x17fff4(0x1dc)](_0x54dafa,UniverInstanceType['UNIVER_SHEET']);this[_0x17fff4(0x212)][_0x17fff4(0x1f0)](_0x54dafa,_0x3c9fa9);}),this[_0x25e58d(0x1c3)]['getTypeOfUnitAdded$'](UniverInstanceType[_0x25e58d(0x27a)])[_0x25e58d(0x3dc)](takeUntil(this[_0x25e58d(0x1d8)]),delay(_0x15a37b))[_0x25e58d(0x3dc)](filter(_0x55976b=>{const _0x4318e3=_0x25e58d;return!_0x55976b[_0x4318e3(0x3af)][_0x4318e3(0x1a6)]()[_0x4318e3(0x2f7)]('__');}))[_0x25e58d(0x395)](async _0x3a4992=>{const _0x4810ae=_0x25e58d,_0x20fce7=_0x3a4992[_0x4810ae(0x3af)][_0x4810ae(0x1a6)](),_0x569c38=await this['_startCollaboration'](_0x20fce7,UniverInstanceType['UNIVER_DOC']);this['_entities'][_0x4810ae(0x1f0)](_0x20fce7,_0x569c38);}),_0x320b7e(this[_0x25e58d(0x1c3)]['getTypeOfUnitDisposed$'](UniverInstanceType[_0x25e58d(0x306)]),this['_univerInstanceService'][_0x25e58d(0x30b)](UniverInstanceType[_0x25e58d(0x27a)]))[_0x25e58d(0x3dc)](takeUntil(this[_0x25e58d(0x1d8)]))['subscribe'](_0x56e44a=>{const _0x3e985c=_0x25e58d,_0x3594b2=_0x56e44a[_0x3e985c(0x1a6)](),_0x196abe=this[_0x3e985c(0x212)][_0x3e985c(0x2bf)](_0x3594b2);_0x196abe&&(_0x196abe['dispose'](),this['_entities']['delete'](_0x3594b2));});}async[_0x3b1eba(0x1dc)](_0x3306c8,_0x33637e){const _0x565bb1=_0x3b1eba,_0x480401=await this['_collabSessionService'][_0x565bb1(0x3d1)](_0x3306c8),_0xf27bd7=this[_0x565bb1(0x2b7)]['createInstance'](this[_0x565bb1(0x1aa)](_0x33637e),_0x3306c8,_0x33637e,_0x480401);return await _0xf27bd7[_0x565bb1(0x32c)](),this[_0x565bb1(0x3d7)][_0x565bb1(0x34d)](_0xf27bd7),_0xf27bd7;}[_0x3b1eba(0x1aa)](_0x2b9063){const _0xcc2e06=_0x3b1eba;switch(_0x2b9063){case UniverInstanceType[_0xcc2e06(0x27a)]:return DocCollaborationEntity;case UniverInstanceType[_0xcc2e06(0x306)]:return SheetCollaborationEntity;default:throw new Error('[CollaborationController]:\x20invalid\x20univer\x20type:\x20'+_0x2b9063);}}};CollaborationController=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(CollaborationSessionService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,IUniverInstanceService)],CollaborationController);var name=_0x3b1eba(0x37d),version='0.22.0';const DEFAULT_FILE_NAME_KEY=_0x3b1eba(0x2aa),UNIVER_DEFAULT_FILE_NAME=_0x3b1eba(0x1e1);let FileNameController=class FileNameController extends Disposable{constructor(_0x47aa5e,_0x52b91f){const _0x472daa=_0x3b1eba;super(),this[_0x472daa(0x1c3)]=_0x47aa5e,this[_0x472daa(0x3ee)]=_0x52b91f,this['_init']();}['_init'](){const _0x35a3b2=_0x3b1eba;this[_0x35a3b2(0x34c)](this[_0x35a3b2(0x1c3)][_0x35a3b2(0x3c6)]['subscribe'](()=>{const _0xd96509=_0x35a3b2;var _0x4de64f;const _0xe01eed=this[_0xd96509(0x1c3)][_0xd96509(0x32e)]();let _0x51a291=(_0x4de64f=this['_configService'][_0xd96509(0x21c)]('DEFAULT_FILE_NAME'))!==null&&_0x4de64f!==void 0x0?_0x4de64f:UNIVER_DEFAULT_FILE_NAME;if(_0xe01eed instanceof Workbook)_0x51a291=_0xe01eed[_0xd96509(0x1b6)];document[_0xd96509(0x388)]=_0x51a291;}));}};FileNameController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,IConfigService)],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x17d729,_0x1208be,_0x273be8){const _0x4abe3e=_0x3b1eba;this['_configService']=_0x17d729,this[_0x4abe3e(0x282)]=_0x1208be,this['localeService']=_0x273be8,this['init']();}[_0x3b1eba(0x32c)](){const _0x16fb5f=_0x3b1eba;this[_0x16fb5f(0x282)][_0x16fb5f(0x1ff)]({'priority':0x1,'interceptor':(_0x64255f,_0x22ac43)=>{return _0x22ac43(_0x64255f)['pipe'](concatMap(async _0x5a5300=>{const _0x18f10f=_0x428e,_0x20a38c=_0x5a5300;if(_0x20a38c[_0x18f10f(0x273)]===0x191){if(typeof window===_0x18f10f(0x1f2))throw new Error(_0x18f10f(0x32d));if(window[_0x18f10f(0x309)](this[_0x18f10f(0x27c)]['t'](_0x18f10f(0x1bc)))){const _0xd13852=window[_0x18f10f(0x367)](window[_0x18f10f(0x248)][_0x18f10f(0x1fa)]);window[_0x18f10f(0x248)]['href']=this[_0x18f10f(0x2fd)]()+'?url='+_0xd13852;}}return _0x20a38c;}));}});}[_0x3b1eba(0x2fd)](){const _0x577fdb=_0x3b1eba;var _0x2c0423;const _0x3f0b04=this[_0x577fdb(0x3ee)][_0x577fdb(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x2c0423=_0x3f0b04===null||_0x3f0b04===void 0x0?void 0x0:_0x3f0b04[_0x577fdb(0x234)])!==null&&_0x2c0423!==void 0x0?_0x2c0423:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,Inject(LocaleService))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1='/universer-api/authz';let AuthzIoHttpService=class AuthzIoHttpService extends Disposable{constructor(_0x554da7,_0xe0a429){const _0x1444f1=_0x3b1eba;super(),this['_HTTPService']=_0x554da7,this['_configService']=_0xe0a429,_defineProperty(this,_0x1444f1(0x287),![]),this[_0x1444f1(0x230)]();}[_0x3b1eba(0x230)](){const _0x4875f0=_0x3b1eba,_0x136e00=this;this[_0x4875f0(0x34c)](this[_0x4875f0(0x394)][_0x4875f0(0x1ff)]({'priority':0x3e7,'interceptor':MergeInterceptorFactory({'isMatch'(_0xd83c81){const _0x1b67e5=_0x4875f0;var _0x70915c;if(_0xd83c81[_0x1b67e5(0x2c7)]===_0x1b67e5(0x2f4)&&((_0x70915c=_0xd83c81[_0x1b67e5(0x21f)])===null||_0x70915c===void 0x0?void 0x0:_0x70915c[_0x1b67e5(0x35a)])){const {objectID:_0x29088c,objectType:_0x3e9020}=_0xd83c81[_0x1b67e5(0x21f)][_0x1b67e5(0x35a)]||{};if(!_0x29088c||_0x3e9020===void 0x0)return![];const _0x4291d9=_0x136e00[_0x1b67e5(0x24d)]()+'/'+_0x3e9020+_0x1b67e5(0x29e)+_0x29088c+_0x1b67e5(0x3a0);if(_0xd83c81['url']===_0x4291d9)return!![];}return![];},'getParamsFromRequest'(_0x39e2d6){const _0x3396a1=_0x4875f0;var _0x40f073;return(_0x40f073=_0x39e2d6['requestParams'])===null||_0x40f073===void 0x0?void 0x0:_0x40f073[_0x3396a1(0x35a)];},'mergeParamsToRequest'(_0x17f9f8,_0x892d5e){const _0x4e1a7c=_0x4875f0,_0x2ae7a8=_0x136e00[_0x4e1a7c(0x24d)]()+_0x4e1a7c(0x28d),_0x344d8f=_0x17f9f8[_0x4e1a7c(0x2b3)]((_0x2d4352,_0x3356c2)=>{const _0x4dac0a=_0x4e1a7c,{unitID:_0x7dc99b,objectID:_0x5c61de,objectType:_0x244d67,actions:_0x58b507}=_0x3356c2;if(!_0x2d4352[_0x7dc99b])_0x2d4352[_0x7dc99b]={};if(!_0x2d4352[_0x7dc99b][_0x5c61de])_0x2d4352[_0x7dc99b][_0x5c61de]={'objectID':_0x5c61de,'objectType':_0x244d67,'actions':[]};return _0x2d4352[_0x7dc99b][_0x5c61de][_0x4dac0a(0x30f)][_0x4dac0a(0x1cd)](..._0x58b507),_0x2d4352;},{}),_0x22785e=[];for(const _0x487e78 in _0x344d8f)for(const _0x16cc1c in _0x344d8f[_0x487e78]){const {actions:_0x5526ee,objectType:_0x4a7004}=_0x344d8f[_0x487e78][_0x16cc1c],_0x46577f=[...new Set(_0x5526ee)];_0x22785e['push']({'unitID':_0x487e78,'objectID':_0x16cc1c,'objectType':_0x4a7004,'actions':_0x46577f});}return new HTTPRequest(_0x4e1a7c(0x2f4),_0x2ae7a8,{'headers':_0x892d5e[_0x4e1a7c(0x1c9)],'withCredentials':_0x892d5e[_0x4e1a7c(0x2b5)],'responseType':_0x892d5e[_0x4e1a7c(0x300)],'body':{'requests':_0x22785e}});}},{'distributeResult'(_0x5ee6d9,_0x2e5205){const _0xd958db=_0x4875f0,{objectActions:_0x196743}=_0x5ee6d9;return _0x2e5205[_0xd958db(0x236)](_0x1bc4d1=>{const _0x11a615=_0xd958db,{unitID:_0x313c80,objectID:_0x47ae72,actions:_0x27cc84}=_0x1bc4d1,_0x148cca=_0x196743[_0x11a615(0x266)](_0x1b4c7f=>_0x1b4c7f[_0x11a615(0x3ac)]===_0x313c80&&_0x1b4c7f[_0x11a615(0x362)]===_0x47ae72);return{'config':_0x1bc4d1,'result':{'actions':_0x27cc84[_0x11a615(0x236)](_0x528ad0=>_0x148cca===null||_0x148cca===void 0x0?void 0x0:_0x148cca['actions'][_0x11a615(0x266)](_0x71a162=>_0x71a162['action']===_0x528ad0))[_0x11a615(0x291)](_0x13703c=>!!_0x13703c),'error':_0x5ee6d9[_0x11a615(0x1ef)]}};});}})}));}['_getAPIPrefixPath'](){const _0x266d0e=_0x3b1eba;var _0x29ca40;const _0xd5fa2d=this['_configService'][_0x266d0e(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x29ca40=_0xd5fa2d===null||_0xd5fa2d===void 0x0?void 0x0:_0xd5fa2d[_0x266d0e(0x288)])!==null&&_0x29ca40!==void 0x0?_0x29ca40:DEFAULT_AUTHZ_URL_KEY$1;}async[_0x3b1eba(0x1c7)](_0x2d5b21){const _0x2890a6=_0x3b1eba,_0x2ee6e8=this[_0x2890a6(0x24d)]()+'/'+_0x2d5b21[_0x2890a6(0x35f)]+_0x2890a6(0x36f);return(await this[_0x2890a6(0x394)][_0x2890a6(0x2a5)](_0x2ee6e8,{'body':_0x2d5b21}))['body'][_0x2890a6(0x362)]||'';}async[_0x3b1eba(0x19c)](_0x21be7f){const _0x474a20=_0x3b1eba,_0x1eab39=this[_0x474a20(0x24d)]()+_0x474a20(0x303);return(await this[_0x474a20(0x394)]['post'](_0x1eab39,{'body':_0x21be7f}))['body'][_0x474a20(0x2a3)];}async[_0x3b1eba(0x2bb)](_0x1b9df3){const _0x1bdd59=_0x3b1eba;var _0x526a3e;const _0x5f0db2=this[_0x1bdd59(0x24d)]()+'/'+_0x1b9df3['objectType']+_0x1bdd59(0x29e)+_0x1b9df3[_0x1bdd59(0x362)],_0x459382=await this[_0x1bdd59(0x394)]['put'](_0x5f0db2,{'body':_0x1b9df3});if((_0x459382===null||_0x459382===void 0x0||(_0x526a3e=_0x459382['body'])===null||_0x526a3e===void 0x0||(_0x526a3e=_0x526a3e['error'])===null||_0x526a3e===void 0x0?void 0x0:_0x526a3e[_0x1bdd59(0x385)])!==0x1)throw new Error(_0x1bdd59(0x34f));}async[_0x3b1eba(0x2de)](_0x42a8b1){const _0x2d2a7f=_0x3b1eba,_0x4180f3=this['_getAPIPrefixPath']()+'/'+_0x42a8b1[_0x2d2a7f(0x35f)]+'/object/'+_0x42a8b1[_0x2d2a7f(0x362)]+'/allowed';return(await this['_HTTPService'][_0x2d2a7f(0x2a5)](_0x4180f3,{'body':_0x42a8b1}))[_0x2d2a7f(0x35a)]['actions'];}async[_0x3b1eba(0x215)](_0x3f45a1){const _0x424aa9=_0x3b1eba,_0x5cf464=this[_0x424aa9(0x24d)]()+_0x424aa9(0x28d);return(await this[_0x424aa9(0x394)][_0x424aa9(0x2a5)](_0x5cf464,{'body':{'requests':_0x3f45a1}}))[_0x424aa9(0x35a)][_0x424aa9(0x3d3)];}async[_0x3b1eba(0x2e5)](_0x4c5b18){const _0x1fcaa0=_0x3b1eba,_0x215f33=this[_0x1fcaa0(0x24d)]()+'/'+_0x4c5b18['objectType']+_0x1fcaa0(0x2fe),_0x17bb33=await this['_HTTPService'][_0x1fcaa0(0x2a5)](_0x215f33,{'body':_0x4c5b18});return{'roles':_0x17bb33[_0x1fcaa0(0x35a)][_0x1fcaa0(0x222)],'actions':_0x17bb33['body'][_0x1fcaa0(0x30f)]};}async[_0x3b1eba(0x2ed)](_0x49fa46){const _0x14f180=_0x3b1eba,_0x40d5e9=this['_getAPIPrefixPath']()+_0x14f180(0x393);await this[_0x14f180(0x394)][_0x14f180(0x35e)](_0x40d5e9,{'params':{'collaboratorID':_0x49fa46[_0x14f180(0x270)],'objectID':_0x49fa46[_0x14f180(0x362)],'unitID':_0x49fa46['unitID']}});}async[_0x3b1eba(0x231)](_0x439237){const _0x5b6b4c=_0x3b1eba,_0x3ef512=this['_getAPIPrefixPath']()+_0x5b6b4c(0x393);await this[_0x5b6b4c(0x394)][_0x5b6b4c(0x2d6)](_0x3ef512,{'body':_0x439237});}async[_0x3b1eba(0x218)](_0x5bceb1){const _0x4cc3b6=_0x3b1eba,_0x4e750b=this[_0x4cc3b6(0x24d)]()+'/collaborator';await this[_0x4cc3b6(0x394)][_0x4cc3b6(0x2a5)](_0x4e750b,{'body':_0x5bceb1});}async['listCollaborators'](_0x2645cb){const _0x10c0e1=_0x3b1eba;var _0x4b88ce;const _0xf31656=this[_0x10c0e1(0x24d)]()+'/collaborator',_0x3db4d0=await this[_0x10c0e1(0x394)][_0x10c0e1(0x2bf)](_0xf31656,{'params':{'objectID':_0x2645cb[_0x10c0e1(0x362)],'unitID':_0x2645cb[_0x10c0e1(0x3ac)]}});return this[_0x10c0e1(0x1f8)]((_0x4b88ce=_0x3db4d0[_0x10c0e1(0x35a)][_0x10c0e1(0x28b)])!==null&&_0x4b88ce!==void 0x0?_0x4b88ce:![]),_0x3db4d0['body'][_0x10c0e1(0x29b)];}async['putCollaborators'](_0x256d19){const _0x2ad9bd=_0x3b1eba,_0x248760=this[_0x2ad9bd(0x24d)]()+_0x2ad9bd(0x393);await this[_0x2ad9bd(0x394)][_0x2ad9bd(0x2bc)](_0x248760,{'body':_0x256d19});}['setCfgEnableObjInherit'](_0x358c45){const _0x3cafef=_0x3b1eba;this[_0x3cafef(0x287)]=_0x358c45;}[_0x3b1eba(0x3b1)](){const _0x23765a=_0x3b1eba;return this[_0x23765a(0x287)];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,Inject(IConfigService))],AuthzIoHttpService);function base64ToBytes(_0x4786e5){const _0x7f9820=_0x3b1eba,_0x4976c4=atob(_0x4786e5),_0x4a0d45=new Uint8Array(_0x4976c4['length']);for(let _0x3db80c=0x0;_0x3db80c<_0x4976c4[_0x7f9820(0x356)];_0x3db80c++)_0x4a0d45[_0x3db80c]=_0x4976c4['charCodeAt'](_0x3db80c);return _0x4a0d45;}function bytesToBase64(_0x3c8aa2){const _0x45d780=_0x3b1eba;let _0x4c3081='';for(let _0x2f7bb4=0x0;_0x2f7bb4<_0x3c8aa2[_0x45d780(0x356)];_0x2f7bb4++)_0x4c3081+=String[_0x45d780(0x371)](_0x3c8aa2[_0x2f7bb4]);return btoa(_0x4c3081);}function encrypt(_0x422c15,_0x6716d1){const _0x2afb2b=_0x3b1eba,_0x16b99a=base64ToBytes(_0x6716d1),_0x5b3da0=randomBytes(0x10);return bytesToBase64(concatBytes(_0x5b3da0,cbc(_0x16b99a,_0x5b3da0)[_0x2afb2b(0x285)](utf8ToBytes(_0x422c15))));}function getAttachHeader(){const _0x376f3=_0x3b1eba,_0x4983ea=getGlobalObject()['__Key__'];if(typeof window!==_0x376f3(0x1f2)&&typeof window[_0x376f3(0x248)]!==_0x376f3(0x1f2)&&_0x4983ea){const _0x3cf5a8={'time':Math[_0x376f3(0x3e2)](Date[_0x376f3(0x330)]()/0x3e8),'domain':location['hostname']};return encrypt(JSON['stringify'](_0x3cf5a8),_0x4983ea);}}let DomainRequestService=class DomainRequestService{constructor(_0x3fb74c){const _0x2b83f5=_0x3b1eba;this['_httpService']=_0x3fb74c,this[_0x2b83f5(0x35c)]();}['_initRequestHeader'](){const _0x48dda6=_0x3b1eba;this['_httpService'][_0x48dda6(0x1ff)]({'interceptor':(_0xc0375e,_0x2bf976)=>{const _0x2f753a=_0x48dda6,_0x4db3d9=getAttachHeader();if(_0x4db3d9)_0xc0375e[_0x2f753a(0x1c9)]['set'](_0x2f753a(0x325),_0x4db3d9);return _0x2bf976(_0xc0375e);}});}};DomainRequestService=__decorate([__decorateParam(0x0,Inject(HTTPService))],DomainRequestService);let DataLoaderService=class DataLoaderService extends RxDisposable{constructor(_0x5e37f4,_0x496016,_0x312b98){const _0x4c6ecf=_0x3b1eba;super(),this['_logService']=_0x5e37f4,this['_snapshotService']=_0x496016,this[_0x4c6ecf(0x1a0)]=_0x312b98,_defineProperty(this,_0x4c6ecf(0x2c8),new BehaviorSubject(null)),_defineProperty(this,_0x4c6ecf(0x19d),this[_0x4c6ecf(0x2c8)]['asObservable']());}async[_0x3b1eba(0x2a8)](_0x5e80cc,_0x36d20d,_0x1db725){const _0x1d8777=_0x3b1eba;this[_0x1d8777(0x2c8)]['next']({'unitId':_0x5e80cc,'type':_0x36d20d});let _0x9f3213=null;switch(_0x36d20d){case UniverInstanceType['UNIVER_SHEET']:_0x9f3213=await this[_0x1d8777(0x369)][_0x1d8777(0x2e9)](_0x5e80cc,_0x1db725);break;case UniverInstanceType[_0x1d8777(0x27a)]:_0x9f3213=await this[_0x1d8777(0x369)][_0x1d8777(0x3dd)](_0x5e80cc,_0x1db725);break;default:this[_0x1d8777(0x374)][_0x1d8777(0x1ef)](_0x1d8777(0x386),'Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.');break;}return _0x9f3213;}async['loadUnit'](_0x10fa95,_0x12fa6f,_0xf4908a){const _0x182f94=_0x3b1eba;var _0xbf49e7;this['_unitInfo$'][_0x182f94(0x34d)]({'unitId':_0x10fa95,'type':_0x12fa6f,'subUnitId':_0xf4908a});let _0x220af2=0x0;const _0x57c7cd=await((_0xbf49e7=this['_localCacheService'])===null||_0xbf49e7===void 0x0?void 0x0:_0xbf49e7['loadOfflineData'](_0x10fa95));if(_0x57c7cd&&(_0x57c7cd[_0x182f94(0x30a)]||_0x57c7cd['mutations'][_0x182f94(0x356)]!==0x0))_0x220af2=_0x57c7cd[_0x182f94(0x3a1)];if(_0x220af2===0x0)this[_0x182f94(0x374)][_0x182f94(0x335)](_0x182f94(0x386),_0x182f94(0x2ea));return this['loadUnitOfRevision'](_0x10fa95,_0x12fa6f,_0x220af2);}};DataLoaderService=__decorate([__decorateParam(0x0,ILogService),__decorateParam(0x1,Inject(SnapshotService)),__decorateParam(0x2,Optional(ILocalCacheService))],DataLoaderService);const DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY=_0x3b1eba(0x33d),DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY='/universer-api/file/{fileID}/sign-url';let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x45b022,_0x22f620,_0x448358){const _0x57aded=_0x3b1eba;this[_0x57aded(0x282)]=_0x45b022,this[_0x57aded(0x3ee)]=_0x22f620,this['_univerInstanceService']=_0x448358,_defineProperty(this,_0x57aded(0x353),0x0),_defineProperty(this,_0x57aded(0x202),new Subject()),_defineProperty(this,'change$',this[_0x57aded(0x202)]),_defineProperty(this,_0x57aded(0x2d8),new Map());}[_0x3b1eba(0x37e)](_0x46c1e5){const _0x1206d8=_0x3b1eba;this[_0x1206d8(0x353)]=_0x46c1e5,this[_0x1206d8(0x202)][_0x1206d8(0x34d)](_0x46c1e5);}[_0x3b1eba(0x256)](_0x516558,_0x107f56){const _0x43eaf7=_0x3b1eba;if(_0x107f56===ImageSourceType[_0x43eaf7(0x3db)]){const _0x1398ae=new Image();return _0x1398ae['src']=_0x516558,_0x1398ae;}return this[_0x43eaf7(0x2d8)][_0x43eaf7(0x2bf)](_0x516558);}[_0x3b1eba(0x1f4)](_0x303ea6,_0xeb43f7,_0x511059){const _0x58b7b2=_0x3b1eba;if(_0xeb43f7===ImageSourceType[_0x58b7b2(0x3db)]||_0x511059==null)return;this['_imageSourceCache'][_0x58b7b2(0x1f0)](_0x303ea6,_0x511059);}async['getImage'](_0x5663a){const _0x126e37=_0x3b1eba;try{const _0x1be2a8=this['_replaceFileID'](this[_0x126e37(0x21b)](),''+_0x5663a),_0x17d467=(await this['_httpService'][_0x126e37(0x2bf)](_0x1be2a8))[_0x126e37(0x35a)];if(_0x17d467['error']&&_0x17d467[_0x126e37(0x1ef)][_0x126e37(0x385)]===ErrorCode['OK']){const _0xe85f7c=resolveWithBasePath(_0x17d467[_0x126e37(0x38b)],this['_getDownloadEndpointURL']());return Promise['resolve'](_0xe85f7c);}return Promise[_0x126e37(0x34e)](_0x17d467[_0x126e37(0x1ef)]);}catch(_0x5a926d){return Promise['reject'](_0x5a926d);}}async[_0x3b1eba(0x3bf)](_0x3a3728){const _0x1f28b2=_0x3b1eba;let _0x2333d6='';if(!DRAWING_IMAGE_ALLOW_IMAGE_LIST[_0x1f28b2(0x3fe)](_0x3a3728[_0x1f28b2(0x3ff)]))return this[_0x1f28b2(0x329)](),Promise['reject'](new Error(ImageUploadStatusType['ERROR_IMAGE_TYPE']));if(_0x3a3728[_0x1f28b2(0x275)]>getDrawingImageAllowSize())return this['_decreaseWaiting'](),Promise[_0x1f28b2(0x34e)](new Error(ImageUploadStatusType[_0x1f28b2(0x340)]));try{const _0xe25a1f=new FormData();_0xe25a1f[_0x1f28b2(0x23a)](_0x1f28b2(0x26a),_0x3a3728);const _0x1a6e2b=this[_0x1f28b2(0x1c3)][_0x1f28b2(0x32e)](),_0x24f720=_0x1a6e2b===null||_0x1a6e2b===void 0x0?void 0x0:_0x1a6e2b[_0x1f28b2(0x1a6)]();if(!_0x24f720)throw new Error(_0x1f28b2(0x241));const _0x42ea55=this[_0x1f28b2(0x2a7)]()+_0x1f28b2(0x1ab)+_0x3a3728[_0x1f28b2(0x275)][_0x1f28b2(0x3c0)]()+_0x1f28b2(0x224)+FileSource[_0x1f28b2(0x1cc)]+'&assign='+encodeURIComponent(_0x24f720),_0x4b3b8f={'body':_0xe25a1f},_0xd004f8=(await this[_0x1f28b2(0x282)][_0x1f28b2(0x2a5)](_0x42ea55,_0x4b3b8f))[_0x1f28b2(0x35a)];if(typeof _0xd004f8['FileId']!==_0x1f28b2(0x246))return this[_0x1f28b2(0x329)](),Promise[_0x1f28b2(0x34e)](new Error(ImageUploadStatusType['ERROR_IMAGE']));_0x2333d6=_0xd004f8['FileId'];}catch(_0x2ff124){return this[_0x1f28b2(0x329)](),Promise[_0x1f28b2(0x34e)](new Error(ImageUploadStatusType[_0x1f28b2(0x2d4)]));}return new Promise((_0x31396c,_0x8c4746)=>{const _0x3cacc2=_0x1f28b2,_0x1a05ba=new FileReader();_0x1a05ba[_0x3cacc2(0x2b1)](_0x3a3728),_0x1a05ba[_0x3cacc2(0x3d5)]=_0x184fae=>{const _0x145943=_0x3cacc2;var _0x2e6ea1;const _0x3890aa=(_0x2e6ea1=_0x184fae['target'])===null||_0x2e6ea1===void 0x0?void 0x0:_0x2e6ea1['result'];if(_0x3890aa==null){this[_0x145943(0x329)](),_0x8c4746(new Error(ImageUploadStatusType[_0x145943(0x2d4)]));return;}_0x31396c({'imageId':generateRandomId(0x6),'imageSourceType':ImageSourceType[_0x145943(0x228)],'source':_0x2333d6,'base64Cache':_0x3890aa,'status':ImageUploadStatusType['SUCCUSS']}),this['_decreaseWaiting']();};});}['_getUploadFileURL'](){const _0x517a69=_0x3b1eba;var _0x24175d;const _0x1cd539=this[_0x517a69(0x3ee)][_0x517a69(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x24175d=_0x1cd539===null||_0x1cd539===void 0x0?void 0x0:_0x1cd539['uploadFileServerUrl'])!==null&&_0x24175d!==void 0x0?_0x24175d:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x3b1eba(0x21b)](){var _0x55c82a;const _0x37d4b1=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x55c82a=_0x37d4b1===null||_0x37d4b1===void 0x0?void 0x0:_0x37d4b1['signUrlServerUrl'])!==null&&_0x55c82a!==void 0x0?_0x55c82a:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}[_0x3b1eba(0x399)](){const _0x397b02=_0x3b1eba;var _0x1a4945;const _0x3dfe19=this['_configService'][_0x397b02(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x1a4945=_0x3dfe19===null||_0x3dfe19===void 0x0?void 0x0:_0x3dfe19[_0x397b02(0x2f3)])!==null&&_0x1a4945!==void 0x0?_0x1a4945:location[_0x397b02(0x245)];}[_0x3b1eba(0x403)](_0x15f6d7,_0x54662a){const _0x79fa69=_0x3b1eba;return _0x15f6d7['replace'](_0x79fa69(0x290),_0x54662a);}['_decreaseWaiting'](){const _0xbcddca=_0x3b1eba;this['_waitCount']-=0x1,this[_0xbcddca(0x202)][_0xbcddca(0x34d)](this['_waitCount']);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,IConfigService),__decorateParam(0x2,Inject(IUniverInstanceService))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY=_0x3b1eba(0x29a);let MentionIoHttpService=class MentionIoHttpService{constructor(_0x57c79d,_0x126392){const _0x514d96=_0x3b1eba;this['_configService']=_0x57c79d,this[_0x514d96(0x394)]=_0x126392;}['_getAPIPrefixPath'](){const _0x1e8de7=_0x3b1eba;var _0x4c579c;const _0x2a3418=this[_0x1e8de7(0x3ee)][_0x1e8de7(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x4c579c=_0x2a3418===null||_0x2a3418===void 0x0?void 0x0:_0x2a3418[_0x1e8de7(0x288)])!==null&&_0x4c579c!==void 0x0?_0x4c579c:DEFAULT_AUTHZ_URL_KEY;}async[_0x3b1eba(0x19c)](_0x10f25d){const _0x5759a7=_0x3b1eba,_0xb45d54=this['_getAPIPrefixPath']()+_0x5759a7(0x393);return{'list':[{'title':'People','mentions':(await this[_0x5759a7(0x394)][_0x5759a7(0x2bf)](_0xb45d54,{'params':{'objectID':_0x10f25d['unitId'],'unitID':_0x10f25d[_0x5759a7(0x355)]}}))[_0x5759a7(0x35a)][_0x5759a7(0x29b)][_0x5759a7(0x236)](_0x1f8e6e=>({'objectId':_0x1f8e6e['id'],'name':_0x1f8e6e[_0x5759a7(0x3ad)]['name'],'metadata':{'icon':_0x1f8e6e[_0x5759a7(0x3ad)][_0x5759a7(0x235)]},'label':_0x1f8e6e[_0x5759a7(0x3ad)]['name'],'objectType':MentionType['PERSON']})),'metadata':{},'type':MentionType['PERSON']}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,Inject(IConfigService)),__decorateParam(0x1,Inject(HTTPService))],MentionIoHttpService);let PermissionService=class PermissionService extends RxDisposable{constructor(_0x55c380,_0xc416d7,_0x2c5d0f,_0xb05efb,_0x1bf2d8){const _0x4513b0=_0x3b1eba;super(),this[_0x4513b0(0x2b7)]=_0x55c380,this[_0x4513b0(0x1c3)]=_0xc416d7,this[_0x4513b0(0x34a)]=_0x2c5d0f,this['_collaborationSessionService']=_0xb05efb,this['_collaborationUIEventService']=_0x1bf2d8,this[_0x4513b0(0x2c0)](),this[_0x4513b0(0x341)]();}[_0x3b1eba(0x341)](){const _0x5c60e8=_0x3b1eba,_0x3de291=async _0x2dfcdb=>{const _0x28e3d3=_0x428e;(await this['_collaborationSessionService'][_0x28e3d3(0x3d1)](_0x2dfcdb))[_0x28e3d3(0x358)][_0x28e3d3(0x3dc)](filter(_0x86d4f9=>_0x86d4f9[_0x28e3d3(0x227)]===CollaborationEvent[_0x28e3d3(0x307)]),_0x29ea2e(this[_0x28e3d3(0x1d8)]))['subscribe'](_0x327d3c=>{const _0x4b37a7=_0x28e3d3,{reason:_0x4ce570}=_0x327d3c['data'];this[_0x4b37a7(0x2a2)]['emitEvent']({'id':'CLOSE_ROOM','data':_0x4ce570}),this['_permissionService']['updatePermissionPoint'](new WorkbookEditablePermission(_0x2dfcdb)['id'],![]),this[_0x4b37a7(0x39e)]['closeSession'](_0x2dfcdb);});};_0x320b7e(this[_0x5c60e8(0x1c3)][_0x5c60e8(0x31f)](UniverInstanceType[_0x5c60e8(0x306)]),this[_0x5c60e8(0x1c3)][_0x5c60e8(0x31f)](UniverInstanceType['UNIVER_DOC']))[_0x5c60e8(0x3dc)](_0x30c3d0(_0x9d5fa6=>_0x9d5fa6['unit'][_0x5c60e8(0x1a6)]()),filter(_0x4e6d18=>!isInternalEditorID(_0x4e6d18)),_0x29ea2e(this['dispose$']))['subscribe'](_0x6966c6=>{_0x3de291(_0x6966c6);});}['_initUnitPermissionChange'](){const _0x586c96=_0x3b1eba,_0x198501=async _0x4a7f5d=>{const _0x11b106=_0x428e,_0x2bdd1e=await this[_0x11b106(0x39e)][_0x11b106(0x3d1)](_0x4a7f5d),_0x1aba74=this['_injector'][_0x11b106(0x2bf)](SheetPermissionInitController);_0x2bdd1e[_0x11b106(0x358)]['pipe'](filter(_0x17794b=>_0x17794b['eventID']===CollaborationEvent[_0x11b106(0x3bb)]),_0x29ea2e(this[_0x11b106(0x1d8)]))[_0x11b106(0x395)](_0x545b58=>{const _0x4e0296=_0x11b106,{objectId:_0x5b4c54}=_0x545b58[_0x4e0296(0x1b3)];if(_0x5b4c54===_0x4a7f5d)_0x1aba74[_0x4e0296(0x1be)](_0x4a7f5d);else _0x1aba74[_0x4e0296(0x3ea)](_0x4a7f5d,_0x5b4c54);});};_0x320b7e(this[_0x586c96(0x1c3)]['getTypeOfUnitAdded$'](UniverInstanceType['UNIVER_SHEET']))[_0x586c96(0x3dc)](_0x30c3d0(_0xbf6dab=>_0xbf6dab[_0x586c96(0x3af)][_0x586c96(0x1a6)]()),filter(_0x4e16ce=>!isInternalEditorID(_0x4e16ce)),_0x29ea2e(this[_0x586c96(0x1d8)]))[_0x586c96(0x395)](_0x5514db=>{_0x198501(_0x5514db);});}};PermissionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,IUniverInstanceService),__decorateParam(0x2,IPermissionService),__decorateParam(0x3,Inject(CollaborationSessionService)),__decorateParam(0x4,Inject(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x4a483c,_0x1dfc77){const _0x2d6511=_0x3b1eba;this[_0x2d6511(0x3ee)]=_0x4a483c,this['_httpService']=_0x1dfc77;}async['getUnitOnRev'](_0x1ed9a9,_0x22fc65){const _0x3704ed=_0x3b1eba;var _0x49b00d;const {unitID:_0x96882,type:_0x1975df,revision:revision=0x0}=_0x22fc65,_0x15573c=this[_0x3704ed(0x23b)]()+'/'+_0x1975df+_0x3704ed(0x31d)+_0x96882+_0x3704ed(0x220)+revision,_0xf65a77=(await this[_0x3704ed(0x282)][_0x3704ed(0x2bf)](_0x15573c))[_0x3704ed(0x35a)],_0x227472=(_0x49b00d=_0xf65a77['snapshot'])===null||_0x49b00d===void 0x0?void 0x0:_0x49b00d[_0x3704ed(0x214)];if(_0x227472){const _0x4dc107=_0x227472===null||_0x227472===void 0x0?void 0x0:_0x227472[_0x3704ed(0x1b5)];_0x227472['originalMeta']=textEncoder[_0x3704ed(0x1dd)](b64DecodeUnicode(_0x4dc107)),Object['entries'](_0x227472['sheets'])[_0x3704ed(0x387)](([,_0x5b8733])=>{const _0x41d803=_0x3704ed,_0x185f08=_0x5b8733[_0x41d803(0x1b5)];_0x5b8733[_0x41d803(0x1b5)]=textEncoder[_0x41d803(0x1dd)](b64DecodeUnicode(_0x185f08));});}return _0xf65a77;}async[_0x3b1eba(0x2d0)](_0x266100,_0x364549){const _0x24a375=_0x3b1eba,{unitID:_0x395c8d,type:_0x30fac8,blockID:_0x9adf1}=_0x364549,_0x3d11fa=this['_getAPIPrefix']()+'/'+_0x30fac8+_0x24a375(0x31d)+_0x395c8d+'/block/'+_0x9adf1;return(await this['_httpService'][_0x24a375(0x2bf)](_0x3d11fa))[_0x24a375(0x35a)];}async[_0x3b1eba(0x24c)](_0x5bd9c9,_0x323f31){const _0x34113f=_0x3b1eba,{unitID:_0x25a6b9,type:_0x48dffc,blockID:_0x225643}=_0x323f31,_0x3a66ac=this['_getAPIPrefix']()+_0x34113f(0x1ac)+_0x48dffc+_0x34113f(0x31d)+_0x25a6b9+_0x34113f(0x1ac)+_0x225643;return(await this[_0x34113f(0x282)]['get'](_0x3a66ac))['body'];}async[_0x3b1eba(0x200)](_0x5589ed,_0x552e8e){const _0x1eb9a6=_0x3b1eba,{unitID:_0x46432f,type:_0x21c32f,from:_0x3cb3d3,to:_0x599814}=_0x552e8e,_0x3b0c98=this[_0x1eb9a6(0x1eb)]()+'/'+_0x21c32f+'/unit/'+_0x46432f+_0x1eb9a6(0x305)+_0x3cb3d3+_0x1eb9a6(0x20e)+_0x599814;return(await this['_httpService'][_0x1eb9a6(0x2bf)](_0x3b0c98))[_0x1eb9a6(0x35a)];}[_0x3b1eba(0x23b)](){const _0x2feaf0=_0x3b1eba;var _0x10892e;return(_0x10892e=this[_0x2feaf0(0x3ee)][_0x2feaf0(0x21c)](_0x2feaf0(0x36e)))!==null&&_0x10892e!==void 0x0?_0x10892e:this['_getAPIPrefix']();}[_0x3b1eba(0x1eb)](){const _0x1e6a64=_0x3b1eba;var _0x121b9a;const _0x17a94b=this[_0x1e6a64(0x3ee)][_0x1e6a64(0x21c)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x121b9a=_0x17a94b===null||_0x17a94b===void 0x0?void 0x0:_0x17a94b[_0x1e6a64(0x3fd)])!==null&&_0x121b9a!==void 0x0?_0x121b9a:DEFAULT_SNAPSHOT_SERVER_URL;}async[_0x3b1eba(0x365)](_0x4468c4,_0x40c400){const _0x478132=_0x3b1eba,_0x1ea187=_0x478132(0x1c6)+_0x40c400[_0x478132(0x3ff)]+_0x478132(0x31d)+_0x40c400[_0x478132(0x3ac)]+_0x478132(0x3d2);return(await this[_0x478132(0x282)][_0x478132(0x2bf)](_0x1ea187,{'params':{'resourceId':JSON[_0x478132(0x3e8)](_0x40c400[_0x478132(0x3fc)])}}))[_0x478132(0x35a)];}['saveSnapshot'](){const _0x27a654=_0x3b1eba;throw new Error(_0x27a654(0x217));}[_0x3b1eba(0x264)](){const _0x139bb5=_0x3b1eba;throw new Error(_0x139bb5(0x217));}[_0x3b1eba(0x33e)](){const _0x3cf66d=_0x3b1eba;throw new Error(_0x3cf66d(0x217));}['saveChangeset'](){const _0x37f80d=_0x3b1eba;throw new Error(_0x37f80d(0x217));}['copyFileMeta'](){const _0x296d07=_0x3b1eba;throw new Error(_0x296d07(0x217));}[_0x3b1eba(0x398)](){const _0x4e855a=_0x3b1eba;throw new Error(_0x4e855a(0x217));}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends LocalUndoRedoService{constructor(_0xc5fdbe,_0x59ca8c,_0x3bd8de,_0x4bc425,_0x4bd181){const _0x489f91=_0x3b1eba;super(_0xc5fdbe,_0x59ca8c,_0x3bd8de),this['_transformService']=_0x4bc425,this[_0x489f91(0x374)]=_0x4bd181;}[_0x3b1eba(0x2c9)](_0xe2b15d,_0x407457){const _0x3e7998=_0x3b1eba,_0xfbe213=this['_getUndoStack'](_0xe2b15d);if(_0xfbe213)try{const _0x1380a8=this[_0x3e7998(0x1df)](_0xfbe213,_0x407457);this[_0x3e7998(0x33f)](_0xe2b15d,_0x1380a8);}catch(_0x44b331){this[_0x3e7998(0x374)][_0x3e7998(0x1ef)](_0x3e7998(0x3bd),_0x44b331),this['_clearUndo'](_0xe2b15d);}const _0x24b5fb=this[_0x3e7998(0x2df)](_0xe2b15d);if(_0x24b5fb)try{const _0x4201d6=this[_0x3e7998(0x1df)](_0x24b5fb,_0x407457);this[_0x3e7998(0x3f6)](_0xe2b15d,_0x4201d6);}catch(_0x2983c7){this[_0x3e7998(0x374)][_0x3e7998(0x1ef)](_0x2983c7),this[_0x3e7998(0x3e9)](_0xe2b15d);}}[_0x3b1eba(0x3b9)](_0x2ac78b){const _0x4b3030=_0x3b1eba,_0x37a019=this[_0x4b3030(0x31c)](_0x2ac78b);_0x37a019&&(_0x37a019[_0x4b3030(0x356)]=0x0,this[_0x4b3030(0x391)]());}['_clearRedo'](_0x4078c2){const _0xc24730=_0x3b1eba,_0x329e17=this[_0xc24730(0x2df)](_0x4078c2);_0x329e17&&(_0x329e17['length']=0x0,this[_0xc24730(0x391)]());}[_0x3b1eba(0x33f)](_0x5200d6,_0x2798ff){const _0x432605=_0x3b1eba;this[_0x432605(0x38d)][_0x432605(0x1f0)](_0x5200d6,_0x2798ff),this[_0x432605(0x391)]();}[_0x3b1eba(0x3f6)](_0x400b51,_0x2b3d64){const _0x37c791=_0x3b1eba;this[_0x37c791(0x251)][_0x37c791(0x1f0)](_0x400b51,_0x2b3d64),this[_0x37c791(0x391)]();}[_0x3b1eba(0x1df)](_0xc504ad,_0x24a896){const _0x375d30=_0x3b1eba,_0x3b7b68=[];let _0x56b4df=_0x24a896,_0x16cdd7=_0x24a896;for(let _0x95558a=_0xc504ad['length']-0x1;_0x95558a>=0x0;_0x95558a--){const {unitID:_0x2980dc,undoMutations:_0x4497a1,redoMutations:_0x118a49}=_0xc504ad[_0x95558a],_0x1610de=this['_transformService'][_0x375d30(0x3b3)](_0x56b4df,_0x4497a1),_0x5d507b=this['_transformService']['transformMutationsWithChangeset'](_0x16cdd7,_0x118a49);if(isTransformMutationsWithChangesetFailure(_0x1610de)||isTransformMutationsWithChangesetFailure(_0x5d507b)){this[_0x375d30(0x374)][_0x375d30(0x1ef)](_0x375d30(0x3bd),_0x375d30(0x327),_0x1610de,_0x5d507b);break;}_0x56b4df=_0x1610de[_0x375d30(0x2ff)],_0x16cdd7=_0x5d507b[_0x375d30(0x2ff)],_0x3b7b68['push']({'unitID':_0x2980dc,'undoMutations':_0x1610de[_0x375d30(0x1ea)],'redoMutations':_0x5d507b[_0x375d30(0x1ea)]});}return _0x3b7b68[_0x375d30(0x260)]();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,ICommandService),__decorateParam(0x2,IContextService),__decorateParam(0x3,ITransformService),__decorateParam(0x4,ILogService)],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends Plugin{constructor(_0xaaefc3={},_0x39aa32,_0x563e7e,_0x592590){const _0x1ea8bd=_0x3b1eba;super(),this[_0x1ea8bd(0x274)]=_0xaaefc3,this[_0x1ea8bd(0x374)]=_0x39aa32,this[_0x1ea8bd(0x2b7)]=_0x563e7e,this[_0x1ea8bd(0x3ee)]=_0x592590;const {..._0x887733}=merge({},defaultPluginConfig,_0xaaefc3);if(!_0x887733[_0x1ea8bd(0x1e4)])throw new Error(_0x1ea8bd(0x3e0));this['_config']=_0x887733,this[_0x1ea8bd(0x3ee)][_0x1ea8bd(0x3c7)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0x887733);}[_0x3b1eba(0x3c9)](){const _0x10dda4=_0x3b1eba;this[_0x10dda4(0x19b)](),this[_0x10dda4(0x2fb)]();}[_0x3b1eba(0x19b)](){const _0x4b0852=_0x3b1eba;var _0x4133f7,_0x3a22f5;if(this[_0x4b0852(0x2b7)]['has'](IUndoRedoService))this[_0x4b0852(0x374)][_0x4b0852(0x1ef)]('[UniverCollaborationClientPlugin]',_0x4b0852(0x34b));const _0x3439d9=mergeOverrideWithDependencies([[IUndoRedoService,{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this[_0x4b0852(0x274)][_0x4b0852(0x1e4)]}],[ISnapshotServerService,{'useClass':SnapshotServerOverHTTPService}],[IAuthzIoService,{'useClass':AuthzIoHttpService}],[IImageIoService,{'useClass':CollaborationImageIoService}],[IMentionIOService,{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x4133f7=this['_config'])===null||_0x4133f7===void 0x0?void 0x0:_0x4133f7['override']);if(!((_0x3a22f5=this[_0x4b0852(0x274)])===null||_0x3a22f5===void 0x0?void 0x0:_0x3a22f5['enableSingleActiveInstanceLock'])){const _0x585694=_0x3439d9[_0x4b0852(0x28c)](([_0x16ff78])=>_0x16ff78===ISingleActiveUnitService);if(_0x585694!==-0x1)_0x3439d9[_0x4b0852(0x377)](_0x585694,0x1);}registerDependencies(this['_injector'],_0x3439d9);}['_initDependencies'](){const _0x3089ad=_0x3b1eba;var _0x3624c2,_0x633f98;this[_0x3089ad(0x2b7)][_0x3089ad(0x2bf)](HTTPService)[_0x3089ad(0x1ff)]({'priority':0x14,'interceptor':ThresholdInterceptorFactory({'maxParallel':0x6})});if(!((_0x3624c2=this['_config'])===null||_0x3624c2===void 0x0?void 0x0:_0x3624c2[_0x3089ad(0x345)])){var _0x48efeb;(_0x48efeb=this['_injector'][_0x3089ad(0x2bf)](ILocalCacheService,Quantity['OPTIONAL']))===null||_0x48efeb===void 0x0||_0x48efeb[_0x3089ad(0x1a8)]();}if((_0x633f98=this[_0x3089ad(0x274)])===null||_0x633f98===void 0x0?void 0x0:_0x633f98[_0x3089ad(0x3df)])touchDependencies(this[_0x3089ad(0x2b7)],[[AuthServerService]]);touchDependencies(this[_0x3089ad(0x2b7)],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,'pluginName',_0x3b1eba(0x32a)),_defineProperty(UniverCollaborationClientPlugin,_0x3b1eba(0x29f),name),_defineProperty(UniverCollaborationClientPlugin,_0x3b1eba(0x2ef),version),UniverCollaborationClientPlugin=__decorate([DependentOn(UniverLicensePlugin,UniverCollaborationPlugin,UniverNetworkPlugin),__decorateParam(0x1,ILogService),__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,IConfigService)],UniverCollaborationClientPlugin);export{AuthzIoHttpService,AwaitingState,AwaitingWithPendingState,COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,CollaborationController,CollaborationEntity,CollaborationImageIoService,CollaborationSession,CollaborationSessionService,CollaborationSocketService,CollaborationStatus,CollaborationUIEventId,CollaborationUIEventService,CollaborativeUndoRedoService,CommentService,ConflictState,DEFAULT_COLLAB_WEB_SOCKET_URL,DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,DEFAULT_WS_SESSION_TICKET_URL,DataLoaderService,DocCollaborationEntity,FetchingMissState,HEARTBEAT_INTERVAL_KEY,HEARTBEAT_TIMEOUT_KEY,ICollaborationSocketService,ILocalCacheService,INetworkConditionService,ISingleActiveUnitService,LOCAL_CACHE_INTERVAL,LOCAL_CACHE_INTERVAL_KEY,MemberService,MentionIoHttpService,OfflineState,PendingState,REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,RETRY_CONNECTING_MAX_COUNT_KEY,SessionStatus,SheetCollaborationEntity,SheetTransformSelectionsService,SnapshotServerOverHTTPService,SyncedState,UnitStatus,UniverCollaborationClientPlugin,deserializeToCombResponse,getLocalCacheKey,serializeCombRequest};
|
|
1
|
+
const _0x37a288=_0x378b;(function(_0x4602ef,_0x49d109){const _0x43eabc=_0x378b,_0x52a6c3=_0x4602ef();while(!![]){try{const _0xcf45c7=parseInt(_0x43eabc(0x2e3))/0x1+parseInt(_0x43eabc(0x27d))/0x2+-parseInt(_0x43eabc(0x2db))/0x3+parseInt(_0x43eabc(0x1a5))/0x4+-parseInt(_0x43eabc(0x2a4))/0x5*(-parseInt(_0x43eabc(0x268))/0x6)+parseInt(_0x43eabc(0x35e))/0x7+parseInt(_0x43eabc(0x337))/0x8*(-parseInt(_0x43eabc(0x224))/0x9);if(_0xcf45c7===_0x49d109)break;else _0x52a6c3['push'](_0x52a6c3['shift']());}catch(_0x3f9b5c){_0x52a6c3['push'](_0x52a6c3['shift']());}}}(_0x1522,0x65051));import{CollaborationEvent,CompressMutationService,EmptyMutationInfo,ISnapshotServerService,ITransformService,RevisionService,SnapshotService,UniverCollaborationPlugin,b64DecodeUnicode,isTransformChangesetsSuccess,isTransformMutationsWithChangesetFailure,isTransformMutationsWithChangesetSuccess,mapDocumentTypeToUniverInstanceType,parseChangesetToProtocol,parseProtocolChangeset,textEncoder,uuidv4}from'@univerjs-pro/collaboration';import{CommandType,DependentOn,Disposable,DisposableCollection,IAuthzIoService,ICommandService,IConfigService,IContextService,ILogService,IMentionIOService,IPermissionService,IUndoRedoService,IUniverInstanceService,Inject,Injector,JSONX,LocalUndoRedoService,LocaleService,MentionType,Optional,Plugin,Quantity,Rectangle,RxDisposable,Tools,UniverInstanceType,UserManagerService,Workbook,createIdentifier,generateRandomId,isInternalEditorID,merge,mergeOverrideWithDependencies,registerDependencies,resolveWithBasePath,sequenceExecute,toDisposable,touchDependencies}from'@univerjs/core';import{RichTextEditingMutation}from'@univerjs/docs';import{InsertSheetMutation,SetSelectionsOperation,SheetPermissionInitController,SheetsSelectionsService,WorkbookEditablePermission}from'@univerjs/sheets';import{BehaviorSubject,ReplaySubject,Subject,concatMap,firstValueFrom,map,merge as _0x5de48a,of,shareReplay,take,takeUntil}from'rxjs';import{CmdRspCode,CombCmd,ErrorCode,FileSource}from'@univerjs/protocol';import{ITelemetryService}from'@univerjs/telemetry';import{delay,filter,map as _0x23341b,take as _0x8aa908,takeUntil as _0x2ed60a}from'rxjs/operators';import{HTTPRequest,HTTPService,ISocketService,MergeInterceptorFactory,ThresholdInterceptorFactory,UniverNetworkPlugin}from'@univerjs/network';import{UniverLicensePlugin,getGlobalObject}from'@univerjs-pro/license';import{DRAWING_IMAGE_ALLOW_IMAGE_LIST,IImageIoService,ImageSourceType,ImageUploadStatusType,getDrawingImageAllowSize}from'@univerjs/drawing';function _0x378b(_0xba0a8b,_0x11496e){_0xba0a8b=_0xba0a8b-0x146;const _0x15224a=_0x1522();let _0x378bbd=_0x15224a[_0xba0a8b];return _0x378bbd;}import{cbc}from'@noble/ciphers/aes.js';import{concatBytes,randomBytes,utf8ToBytes}from'@noble/ciphers/utils.js';const DEFAULT_SNAPSHOT_SERVER_URL=_0x37a288(0x1fd),SNAPSHOT_URL_KEY='SNAPSHOT_URL_KEY',DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL=_0x37a288(0x2b7),DEFAULT_WS_SESSION_TICKET_URL=_0x37a288(0x15a),HEARTBEAT_INTERVAL_KEY=_0x37a288(0x155),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY=_0x37a288(0x1e1),DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x37a288(0x288),LOCAL_CACHE_INTERVAL_KEY='LOCAL_CACHE_INTERVAL',LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL=_0x37a288(0x24e),DEFAULT_LOGIN_URL=_0x37a288(0x147),REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x37a288(0x182),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT=_0x37a288(0x242),TELEMETRY_COLLABORATION_NEW_CHANGESET=_0x37a288(0x2a3);function summaryChangesetSize(_0x779b81){const _0x1cba4d=_0x37a288;return JSON[_0x1cba4d(0x24a)](_0x779b81)[_0x1cba4d(0x1a6)];}function _typeof(_0x404f3a){'@babel/helpers - typeof';const _0x4419ff=_0x37a288;return _typeof=_0x4419ff(0x317)==typeof Symbol&&_0x4419ff(0x3a3)==typeof Symbol['iterator']?function(_0x312b73){return typeof _0x312b73;}:function(_0x5234b7){const _0x5317bd=_0x4419ff;return _0x5234b7&&_0x5317bd(0x317)==typeof Symbol&&_0x5234b7[_0x5317bd(0x1b2)]===Symbol&&_0x5234b7!==Symbol[_0x5317bd(0x187)]?_0x5317bd(0x3a3):typeof _0x5234b7;},_typeof(_0x404f3a);}function toPrimitive(_0x2f8f4b,_0x2f79d1){const _0x11220d=_0x37a288;if(_0x11220d(0x21f)!=_typeof(_0x2f8f4b)||!_0x2f8f4b)return _0x2f8f4b;var _0x1945b6=_0x2f8f4b[Symbol[_0x11220d(0x1ed)]];if(void 0x0!==_0x1945b6){var _0x238310=_0x1945b6[_0x11220d(0x2b8)](_0x2f8f4b,_0x2f79d1||_0x11220d(0x24d));if(_0x11220d(0x21f)!=_typeof(_0x238310))return _0x238310;throw new TypeError(_0x11220d(0x3ae));}return(_0x11220d(0x3a1)===_0x2f79d1?String:Number)(_0x2f8f4b);}function toPropertyKey(_0x1af6bd){const _0x4d66ec=_0x37a288;var _0x1cf727=toPrimitive(_0x1af6bd,'string');return _0x4d66ec(0x3a3)==_typeof(_0x1cf727)?_0x1cf727:_0x1cf727+'';}function _defineProperty(_0x25d6e0,_0x48a781,_0x4025ae){const _0x1a00f3=_0x37a288;return(_0x48a781=toPropertyKey(_0x48a781))in _0x25d6e0?Object[_0x1a00f3(0x389)](_0x25d6e0,_0x48a781,{'value':_0x4025ae,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x25d6e0[_0x48a781]=_0x4025ae,_0x25d6e0;}let CollaborationUIEventId=function(_0x273187){const _0x38d3a0=_0x37a288;return _0x273187['OTHER_CLIENT_EDITING']=_0x38d3a0(0x327),_0x273187[_0x38d3a0(0x18a)]=_0x38d3a0(0x18a),_0x273187[_0x38d3a0(0x2ab)]=_0x38d3a0(0x2ab),_0x273187[_0x38d3a0(0x379)]='CLOSE_ROOM',_0x273187[_0x38d3a0(0x161)]='JOIN_ROOM_FAILED',_0x273187[_0x38d3a0(0x1f7)]=_0x38d3a0(0x1f7),_0x273187[_0x38d3a0(0x388)]=_0x38d3a0(0x388),_0x273187[_0x38d3a0(0x180)]='SUBMIT_CHANGESET_TIMEOUT',_0x273187;}({});var CollaborationUIEventService=class{constructor(){const _0x5cb46c=_0x37a288;_defineProperty(this,'_event$',new Subject()),_defineProperty(this,_0x5cb46c(0x35a),this[_0x5cb46c(0x292)][_0x5cb46c(0x16b)]());}['emitEvent'](_0x5396f8){const _0x17afed=_0x37a288;this[_0x17afed(0x292)][_0x17afed(0x1b0)](_0x5396f8);}},CommentService=class{constructor(){const _0x5e3475=_0x37a288;_defineProperty(this,_0x5e3475(0x255),new Subject()),_defineProperty(this,_0x5e3475(0x39f),this[_0x5e3475(0x255)]['asObservable']());}[_0x37a288(0x234)](_0x1881b6){const _0x36f003=_0x37a288;this[_0x36f003(0x255)][_0x36f003(0x1b0)](_0x1881b6);}};function __decorateParam(_0x6f4d,_0x1c4ae4){return function(_0x437bf7,_0x19c3d5){_0x1c4ae4(_0x437bf7,_0x19c3d5,_0x6f4d);};}function __decorate(_0x2556b2,_0xd882e6,_0x83f34b,_0x34ca8d){const _0x789b13=_0x37a288;var _0x552b1e=arguments['length'],_0x492738=_0x552b1e<0x3?_0xd882e6:_0x34ca8d===null?_0x34ca8d=Object[_0x789b13(0x252)](_0xd882e6,_0x83f34b):_0x34ca8d,_0x1c25c0;if(typeof Reflect==='object'&&typeof Reflect['decorate']===_0x789b13(0x317))_0x492738=Reflect[_0x789b13(0x186)](_0x2556b2,_0xd882e6,_0x83f34b,_0x34ca8d);else{for(var _0x5f5c25=_0x2556b2[_0x789b13(0x1a6)]-0x1;_0x5f5c25>=0x0;_0x5f5c25--)if(_0x1c25c0=_0x2556b2[_0x5f5c25])_0x492738=(_0x552b1e<0x3?_0x1c25c0(_0x492738):_0x552b1e>0x3?_0x1c25c0(_0xd882e6,_0x83f34b,_0x492738):_0x1c25c0(_0xd882e6,_0x83f34b))||_0x492738;}return _0x552b1e>0x3&&_0x492738&&Object[_0x789b13(0x389)](_0xd882e6,_0x83f34b,_0x492738),_0x492738;}let MemberService=class MemberService extends Disposable{constructor(_0x11775b,_0x52bd12){const _0x5d89fa=_0x37a288;super(),this[_0x5d89fa(0x229)]=_0x11775b,this[_0x5d89fa(0x283)]=_0x52bd12,_defineProperty(this,'_roomMembers',new Map()),_defineProperty(this,'_roomCreated$',new Subject()),this[_0x5d89fa(0x2f4)](_0x5de48a(this[_0x5d89fa(0x229)][_0x5d89fa(0x264)](UniverInstanceType[_0x5d89fa(0x362)])[_0x5d89fa(0x39b)](_0x23341b(_0x23dea0=>_0x23dea0['getUnitId']())),this[_0x5d89fa(0x229)]['getTypeOfUnitDisposed$'](UniverInstanceType['UNIVER_DOC'])['pipe'](_0x23341b(_0x4349ee=>_0x4349ee[_0x5d89fa(0x15e)]())))[_0x5d89fa(0x2ae)](_0x45ce48=>this[_0x5d89fa(0x14e)](_0x45ce48)));}[_0x37a288(0x171)](_0x45929a){const _0x4904be=_0x37a288;if(this['_roomMembers'][_0x4904be(0x315)](_0x45929a))return of(this[_0x4904be(0x257)][_0x4904be(0x213)](_0x45929a));return this[_0x4904be(0x3ab)][_0x4904be(0x39b)](_0x23341b(_0x48b1af=>{const _0x54298d=_0x4904be;if(_0x48b1af===_0x45929a)return this[_0x54298d(0x257)][_0x54298d(0x213)](_0x48b1af);}));}[_0x37a288(0x391)](_0x1b215e){const _0x5bafdf=_0x37a288;this[_0x5bafdf(0x283)]['setCurrentUser'](_0x1b215e);}[_0x37a288(0x1e3)](){const _0x36989c=_0x37a288;return this['_userManagerService'][_0x36989c(0x1e3)]();}['updateMember'](_0x2d403c,_0x2add21){const _0x54f26b=_0x37a288;let _0x3e68df=this['_roomMembers'][_0x54f26b(0x213)](_0x2d403c);!_0x3e68df&&(_0x3e68df=new RoomMember(),this[_0x54f26b(0x257)][_0x54f26b(0x2c4)](_0x2d403c,_0x3e68df),this['_roomCreated$'][_0x54f26b(0x1b0)](_0x2d403c)),_0x3e68df[_0x54f26b(0x1cf)](_0x2add21);}[_0x37a288(0x397)](_0x35d4a1,_0x5d9fe3){const _0x13a801=_0x37a288,_0x497978=this[_0x13a801(0x257)]['get'](_0x35d4a1);if(_0x497978)_0x497978['removeMember'](_0x5d9fe3);}[_0x37a288(0x3ac)](_0x318660){const _0x245e34=_0x37a288;return this[_0x245e34(0x257)][_0x245e34(0x213)](_0x318660);}[_0x37a288(0x26d)](_0x121eab,_0x3628c){const _0x2f173b=_0x37a288,_0x2b7317=this['_roomMembers'][_0x2f173b(0x213)](_0x121eab);if(_0x2b7317)return _0x2b7317[_0x2f173b(0x26d)](_0x3628c);}[_0x37a288(0x14e)](_0x2b4103){const _0x4d3ab4=_0x37a288,_0x5d3aeb=this['_roomMembers'][_0x4d3ab4(0x213)](_0x2b4103);_0x5d3aeb&&(_0x5d3aeb['dispose'](),this['_roomMembers']['delete'](_0x2b4103));}[_0x37a288(0x16a)](){const _0x49bfaf=_0x37a288;this['_roomMembers'][_0x49bfaf(0x25e)](_0x316554=>_0x316554[_0x49bfaf(0x16a)]()),this[_0x49bfaf(0x257)][_0x49bfaf(0x2fe)](),this[_0x49bfaf(0x3ab)][_0x49bfaf(0x39e)]();}};MemberService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(UserManagerService))],MemberService);var RoomMember=class extends Disposable{constructor(..._0x519401){const _0x3582cc=_0x37a288;super(..._0x519401),_defineProperty(this,_0x3582cc(0x1ad),new Map()),_defineProperty(this,_0x3582cc(0x2c3),new BehaviorSubject(this[_0x3582cc(0x1ad)])),_defineProperty(this,_0x3582cc(0x384),this[_0x3582cc(0x2c3)][_0x3582cc(0x16b)]());}[_0x37a288(0x16a)](){const _0x173520=_0x37a288;this[_0x173520(0x1ad)]['clear'](),this[_0x173520(0x2c3)][_0x173520(0x39e)]();}[_0x37a288(0x1cf)](_0xa5f9ed){const _0x1f91e5=_0x37a288;this['_members'][_0x1f91e5(0x2c4)](_0xa5f9ed['memberID'],_0xa5f9ed),this[_0x1f91e5(0x23f)]();}['removeMember'](_0x5965d9){const _0x36573a=_0x37a288;this[_0x36573a(0x1ad)][_0x36573a(0x377)](_0x5965d9),this[_0x36573a(0x23f)]();}[_0x37a288(0x26d)](_0x1287e4){const _0x12ba17=_0x37a288;return this['_members'][_0x12ba17(0x213)](_0x1287e4);}['getAllMembers'](){const _0x62a45a=_0x37a288;return Array[_0x62a45a(0x2f0)](this[_0x62a45a(0x1ad)][_0x62a45a(0x359)]());}['_emitMembers'](){const _0x2010f2=_0x37a288;this['_members$']['next'](this[_0x2010f2(0x1ad)]);}};let SessionStatus=function(_0x892f68){const _0xf0999d=_0x37a288;return _0x892f68[_0x892f68[_0xf0999d(0x31d)]=0x0]='IDLE',_0x892f68[_0x892f68[_0xf0999d(0x340)]=0x1]='JOINING',_0x892f68[_0x892f68[_0xf0999d(0x29c)]=0x2]=_0xf0999d(0x29c),_0x892f68[_0x892f68[_0xf0999d(0x3a9)]=0x3]='ONLINE',_0x892f68;}({});const FailedReason={[CmdRspCode[_0x37a288(0x32b)]]:'session.join-failed',[CmdRspCode[_0x37a288(0x375)]]:_0x37a288(0x382),[CmdRspCode[_0x37a288(0x290)]]:_0x37a288(0x2a0),[CmdRspCode[_0x37a288(0x390)]]:_0x37a288(0x336),[CmdRspCode[_0x37a288(0x218)]]:'session.room-cnt-exceeds'};let CollaborationSession=class CollaborationSession extends RxDisposable{get['sessionStatus'](){const _0x3f9152=_0x37a288;return this[_0x3f9152(0x1ee)][_0x3f9152(0x30f)]();}constructor(_0x38be43,_0x5730fa,_0x377ce1,_0x3ede00,_0x9e1c8a,_0x1ece3d,_0x5cfd46,_0x14c609){const _0x417a27=_0x37a288;super(),this['_unitID']=_0x38be43,this[_0x417a27(0x270)]=_0x377ce1,this[_0x417a27(0x1ec)]=_0x3ede00,this[_0x417a27(0x17f)]=_0x9e1c8a,this[_0x417a27(0x296)]=_0x1ece3d,this[_0x417a27(0x1e4)]=_0x5cfd46,this[_0x417a27(0x2b5)]=_0x14c609,_defineProperty(this,_0x417a27(0x1ee),new BehaviorSubject(0x0)),_defineProperty(this,_0x417a27(0x19d),this['_sessionStatus$'][_0x417a27(0x16b)]()),_defineProperty(this,_0x417a27(0x292),new Subject()),_defineProperty(this,'event$',this[_0x417a27(0x292)][_0x417a27(0x16b)]()),_defineProperty(this,_0x417a27(0x1c7),void 0x0),_defineProperty(this,'_socketMessageSubscription',void 0x0),_defineProperty(this,_0x417a27(0x21e),void 0x0),_defineProperty(this,_0x417a27(0x295),![]),_defineProperty(this,_0x417a27(0x2dd),null),this[_0x417a27(0x295)]=!!this[_0x417a27(0x2b5)],_0x5730fa['pipe'](takeUntil(this[_0x417a27(0x2d8)]))['subscribe'](_0x31584c=>{const _0x57b7ba=_0x417a27;if(typeof _0x31584c==='undefined')return;this[_0x57b7ba(0x1c7)]=_0x31584c;if(_0x31584c)this[_0x57b7ba(0x152)](_0x31584c),this[_0x57b7ba(0x2a9)]=_0x31584c[_0x57b7ba(0x250)]['subscribe'](_0x4576c3=>{const _0x125c75=_0x57b7ba;if(_0x4576c3[_0x125c75(0x304)]!==this[_0x125c75(0x321)])return;this[_0x125c75(0x151)](_0x4576c3);});else{var _0x3e1f30;this[_0x57b7ba(0x247)](),this[_0x57b7ba(0x1ee)][_0x57b7ba(0x1b0)](0x2),(_0x3e1f30=this['_socketMessageSubscription'])===null||_0x3e1f30===void 0x0||_0x3e1f30['unsubscribe'](),this[_0x57b7ba(0x2a9)]=null;}});}[_0x37a288(0x358)](){const _0x139a7d=_0x37a288;var _0x1a9752,_0x5546cc;return(_0x1a9752=(_0x5546cc=this[_0x139a7d(0x1c7)])===null||_0x5546cc===void 0x0?void 0x0:_0x5546cc[_0x139a7d(0x32d)])!==null&&_0x1a9752!==void 0x0?_0x1a9752:null;}[_0x37a288(0x16a)](){const _0x142e9a=_0x37a288;super[_0x142e9a(0x16a)](),this['close'](),this[_0x142e9a(0x2d8)][_0x142e9a(0x1b0)](),this[_0x142e9a(0x2d8)][_0x142e9a(0x39e)]();}[_0x37a288(0x2e5)](){const _0x2101f4=_0x37a288;var _0x1f768f,_0x425b3f;this[_0x2101f4(0x247)](),(_0x1f768f=this['_socket'])===null||_0x1f768f===void 0x0||_0x1f768f[_0x2101f4(0x316)]({'cmd':CombCmd[_0x2101f4(0x160)],'data':{'roomID':this[_0x2101f4(0x321)]}}),(_0x425b3f=this[_0x2101f4(0x1c7)])===null||_0x425b3f===void 0x0||_0x425b3f[_0x2101f4(0x2e5)](),this['_event$'][_0x2101f4(0x39e)](),this[_0x2101f4(0x1ee)][_0x2101f4(0x39e)]();}[_0x37a288(0x151)](_0x2e1c64){const _0x1735b8=_0x37a288;if(_0x2e1c64[_0x1735b8(0x301)]===CombCmd[_0x1735b8(0x22e)])this['_onJoinRoomEvent'](_0x2e1c64);else{if(_0x2e1c64[_0x1735b8(0x301)]===CombCmd[_0x1735b8(0x156)])this[_0x1735b8(0x308)](_0x2e1c64);}}[_0x37a288(0x152)](_0x1491f1){const _0x43f587=_0x37a288;this['_sessionStatus$']['next'](0x1),_0x1491f1['send']({'cmd':CombCmd['JOIN'],'routeKey':this[_0x43f587(0x321)],'routeType':'','data':{'rooms':[{'roomID':this[_0x43f587(0x321)]}]}});}[_0x37a288(0x1e7)](_0x495321){const _0xf80df5=_0x37a288;var _0x4b7665;if(_0x495321[_0xf80df5(0x25c)]in FailedReason){this[_0xf80df5(0x1e4)][_0xf80df5(0x294)]({'id':'JOIN_ROOM_FAILED','data':FailedReason[_0x495321[_0xf80df5(0x25c)]]}),this[_0xf80df5(0x1ee)]['next'](0x2);return;}this[_0xf80df5(0x1ee)][_0xf80df5(0x1b0)](0x3);const _0x37841b=(_0x4b7665=_0x495321[_0xf80df5(0x346)][_0xf80df5(0x37e)][this['_unitID']])===null||_0x4b7665===void 0x0?void 0x0:_0x4b7665[_0xf80df5(0x177)];if(_0x37841b)_0x37841b[_0xf80df5(0x25e)](_0x465e07=>this[_0xf80df5(0x17f)]['updateMember'](this[_0xf80df5(0x321)],_0x465e07));}[_0x37a288(0x308)](_0x2917d1){const _0x50b78a=_0x37a288;try{const _0x4eeba5=_0x2917d1[_0x50b78a(0x346)];switch(_0x4eeba5[_0x50b78a(0x1f3)]){case CollaborationEvent[_0x50b78a(0x2b3)]:this[_0x50b78a(0x2aa)](_0x4eeba5),this[_0x50b78a(0x292)]['next'](_0x4eeba5);break;case CollaborationEvent['USERS_LEAVE']:this[_0x50b78a(0x2c2)](_0x4eeba5),this[_0x50b78a(0x292)]['next'](_0x4eeba5);break;case CollaborationEvent[_0x50b78a(0x1d3)]:case CollaborationEvent[_0x50b78a(0x259)]:this[_0x50b78a(0x1c9)](),this[_0x50b78a(0x2b6)](),this[_0x50b78a(0x292)][_0x50b78a(0x1b0)](_0x4eeba5);break;case CollaborationEvent['MSG_FOR_ERROR']:this[_0x50b78a(0x270)][_0x50b78a(0x1cd)](_0x50b78a(0x349)+JSON['stringify'](_0x4eeba5)),this[_0x50b78a(0x292)][_0x50b78a(0x1b0)](_0x4eeba5);break;case CollaborationEvent[_0x50b78a(0x36a)]:this[_0x50b78a(0x296)][_0x50b78a(0x234)](_0x4eeba5[_0x50b78a(0x346)]),this[_0x50b78a(0x292)]['next'](_0x4eeba5);break;default:this[_0x50b78a(0x292)][_0x50b78a(0x1b0)](_0x4eeba5);}}catch(_0x26a92c){this['_logService']['error'](_0x26a92c,_0x2917d1);}}[_0x37a288(0x2aa)](_0x3c1051){const _0x3beff3=_0x37a288;this[_0x3beff3(0x17f)][_0x3beff3(0x1cf)](this['_unitID'],_0x3c1051[_0x3beff3(0x346)]);}[_0x37a288(0x2c2)](_0x5f41dc){const _0x306010=_0x37a288;this['_memberService'][_0x306010(0x397)](this[_0x306010(0x321)],_0x5f41dc[_0x306010(0x346)]['memberID']);}async[_0x37a288(0x316)](_0x478294,_0x519f66){const _0x423a19=_0x37a288;if(this[_0x423a19(0x2f7)]!==0x3||!this[_0x423a19(0x1c7)])throw new Error(_0x423a19(0x38c));try{_0x478294[_0x423a19(0x1f3)]===CollaborationEvent[_0x423a19(0x179)]&&(this[_0x423a19(0x2ef)](),this[_0x423a19(0x3b0)](_0x478294)),this['_socket'][_0x423a19(0x316)]({'cmd':CombCmd[_0x423a19(0x1c6)],'routeKey':_0x519f66,'routeType':'','data':_0x478294});}catch(_0x1e8b2c){this[_0x423a19(0x270)][_0x423a19(0x1cd)](_0x1e8b2c);}}[_0x37a288(0x2ef)](){const _0x2e9a82=_0x37a288;var _0x3c3d37;this[_0x2e9a82(0x21e)]=setTimeout(()=>{const _0x43f7c4=_0x2e9a82;this[_0x43f7c4(0x21e)]=null,this[_0x43f7c4(0x1e4)]['emitEvent']({'id':'SUBMIT_CHANGESET_TIMEOUT'});},(_0x3c3d37=this[_0x2e9a82(0x1ec)][_0x2e9a82(0x38e)]('HEARTBEAT_TIMEOUT'))!==null&&_0x3c3d37!==void 0x0?_0x3c3d37:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x37a288(0x2b6)](){const _0x53671f=_0x37a288;this[_0x53671f(0x21e)]&&(clearTimeout(this[_0x53671f(0x21e)]),this[_0x53671f(0x21e)]=null);}[_0x37a288(0x3b0)](_0x4aab26){const _0x11e229=_0x37a288;if(!this['_shouldReportTelemetry'])return;const {data:_0x22cb5a}=_0x4aab26,{unitID:_0x3f9c4c,changeset:_0x437d7d}=_0x22cb5a,{mutations:_0x2273e9,type:_0x4ee7d7}=_0x437d7d;this['_telemetryInfo']={'unitId':_0x3f9c4c,'type':_0x4ee7d7,'startTime':performance[_0x11e229(0x2b0)](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0x2273e9)};}['_stopTelemetryCollaborationNewChangeset'](){const _0x589409=_0x37a288;if(!this[_0x589409(0x295)])return;if(!this[_0x589409(0x2dd)]){this[_0x589409(0x270)]['error'](_0x589409(0x2bd),_0x589409(0x2ba));return;}this[_0x589409(0x2dd)][_0x589409(0x1be)]=performance[_0x589409(0x2b0)](),this[_0x589409(0x2dd)][_0x589409(0x353)]=this[_0x589409(0x2dd)][_0x589409(0x1be)]-this[_0x589409(0x2dd)]['startTime'],this[_0x589409(0x2b5)][_0x589409(0x29b)](TELEMETRY_COLLABORATION_NEW_CHANGESET,this[_0x589409(0x2dd)]),this[_0x589409(0x2dd)]=null;}[_0x37a288(0x247)](){const _0x5ba7e9=_0x37a288;this[_0x5ba7e9(0x2dd)]=null;}};CollaborationSession=__decorate([__decorateParam(0x2,ILogService),__decorateParam(0x3,IConfigService),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,Inject(CommentService)),__decorateParam(0x6,Inject(CollaborationUIEventService)),__decorateParam(0x7,Optional(ITelemetryService))],CollaborationSession);const ILocalCacheService=createIdentifier(_0x37a288(0x269));function getLocalCacheKey(_0x10f707){const _0x52a751=_0x37a288;return _0x52a751(0x28f)+_0x10f707;}function extractTargetFromFirstChangeset(_0x5d37e7){const {unitID:_0x2c04e3,mutations:_0x276e8d}=_0x5d37e7;return{'unitId':_0x2c04e3,'subUnitId':_0x276e8d['length']>0x0?_0x276e8d[0x0]['params']['subUnitId']:null};}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x488311,_0x3aa910,_0x5aad6b){const _0x109de4=_0x37a288;this['_injector']=_0x488311,this[_0x109de4(0x37c)]=_0x3aa910,this[_0x109de4(0x165)]=_0x5aad6b;}[_0x37a288(0x325)](_0x7d6b11){const _0x44254e=_0x37a288;var _0x40533c,_0x498afa;const _0x19b30d=this[_0x44254e(0x299)]['get'](SheetsSelectionsService),{unitId:_0x442c79,subUnitId:_0x211de7}=extractTargetFromFirstChangeset(_0x7d6b11),_0x878614=_0x19b30d===null||_0x19b30d===void 0x0?void 0x0:_0x19b30d[_0x44254e(0x208)](_0x442c79)[_0x44254e(0x1f8)](),_0x10944b=(_0x40533c=this[_0x44254e(0x165)][_0x44254e(0x261)](_0x442c79))===null||_0x40533c===void 0x0||(_0x40533c=_0x40533c[_0x44254e(0x1b6)]())===null||_0x40533c===void 0x0?void 0x0:_0x40533c[_0x44254e(0x2cd)]();if(_0x878614[_0x44254e(0x1a6)]===0x0||!_0x442c79||!_0x211de7)return;const _0x292dfa=[{'id':SetSelectionsOperation['id'],'params':{'unitId':_0x442c79,'subUnitId':_0x10944b,'selections':Tools['deepClone'](_0x878614)}}],_0x2ef910=this['_transformService'][_0x44254e(0x230)](_0x7d6b11,_0x292dfa);if(!isTransformMutationsWithChangesetSuccess(_0x2ef910))throw _0x2ef910[_0x44254e(0x1cd)];const _0x42fe0d=(_0x498afa=_0x2ef910['m2Prime'][0x0])===null||_0x498afa===void 0x0||(_0x498afa=_0x498afa[_0x44254e(0x2eb)])===null||_0x498afa===void 0x0?void 0x0:_0x498afa[_0x44254e(0x1b1)];if(Array[_0x44254e(0x207)](_0x42fe0d)&&_0x42fe0d['length']){if(_0x42fe0d[_0x44254e(0x1a6)]===_0x292dfa[0x0][_0x44254e(0x2eb)][_0x44254e(0x1b1)][_0x44254e(0x1a6)]&&_0x42fe0d[_0x44254e(0x29d)]((_0x56db11,_0x1fbbd7)=>Rectangle[_0x44254e(0x343)](_0x56db11[_0x44254e(0x30e)],_0x292dfa[0x0][_0x44254e(0x2eb)]['selections'][_0x1fbbd7][_0x44254e(0x30e)])))return;this['_injector'][_0x44254e(0x213)](ICommandService)[_0x44254e(0x246)](SetSelectionsOperation['id'],{'unitId':_0x442c79,'subUnitId':_0x10944b,'selections':_0x42fe0d});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService),__decorateParam(0x2,IUniverInstanceService)],SheetTransformSelectionsService);const ISingleActiveUnitService=createIdentifier(_0x37a288(0x32a));let UnitStatus=function(_0x349d8b){const _0x27af42=_0x37a288;return _0x349d8b[_0x349d8b[_0x27af42(0x27e)]=0x0]=_0x27af42(0x27e),_0x349d8b[_0x349d8b[_0x27af42(0x1c0)]=0x1]=_0x27af42(0x1c0),_0x349d8b;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY=_0x37a288(0x324),configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x10b997){const _0x91cbe8=_0x37a288;var _0x2a7fda;return!!((_0x2a7fda=_0x10b997[_0x91cbe8(0x2eb)])===null||_0x2a7fda===void 0x0?void 0x0:_0x2a7fda['__splitChunk__']);}const SINGLE_CHANGESET_MUTATIONS=new Set([InsertSheetMutation['id']]);function assembleSheetChangeset(_0x26bf57,_0x3e8f09,_0x2b8257,_0x5d3fad,_0x10049b){const _0xb8761b=_0x37a288;var _0x137b3f,_0x3283fa,_0x218023,_0x39d8e1;const _0x2fb638=[];for(const _0x2d1cc3 of _0x26bf57){if(SINGLE_CHANGESET_MUTATIONS['has'](_0x2d1cc3['id'])){if(_0x2fb638['length']>0x0)break;_0x2fb638[_0xb8761b(0x344)](_0x2d1cc3);break;}if(isSplitChunkMutation(_0x2d1cc3)){if(_0x2fb638['length']>0x0)break;_0x2fb638['push'](_0x2d1cc3);break;}_0x2fb638[_0xb8761b(0x344)](_0x2d1cc3);}const _0x2b8d44=(_0x137b3f=(_0x3283fa=_0x10049b[_0xb8761b(0x1e3)]())===null||_0x3283fa===void 0x0?void 0x0:_0x3283fa[_0xb8761b(0x172)])!==null&&_0x137b3f!==void 0x0?_0x137b3f:_0xb8761b(0x200),_0x5cd50f=(_0x218023=(_0x39d8e1=_0x10049b[_0xb8761b(0x1e3)]())===null||_0x39d8e1===void 0x0?void 0x0:_0x39d8e1[_0xb8761b(0x32d)])!==null&&_0x218023!==void 0x0?_0x218023:_0xb8761b(0x200);return{'changeset':{'unitID':_0x3e8f09,'type':mapDocumentTypeToUniverInstanceType(_0x2b8257[_0xb8761b(0x307)](_0x3e8f09)),'baseRev':_0x5d3fad['getCurrentRevOfUnit'](_0x3e8f09),'revision':0x0,'userID':_0x2b8d44,'memberID':_0x5cd50f,'mutations':_0x2fb638},'pendingMutations':_0x26bf57[_0xb8761b(0x1a3)](_0x2fb638[_0xb8761b(0x1a6)])};}function assembleDocChangeset(_0x303f54,_0x1c9d4a,_0x44ee12,_0x2d2d6b,_0x296685){const _0x37220c=_0x37a288;var _0x5ac05e,_0x5caa57,_0x240aa4,_0x367ea3;const _0x440954=[_0x303f54['reduce']((_0x5bf72d,_0x4c5a5f)=>{const _0x3db619=_0x378b;var _0x1ae0eb;const {id:_0x5630b1}=_0x5bf72d,{id:_0x1a2130,type:_0x42212d}=_0x4c5a5f,_0x3e4849=(_0x1ae0eb=_0x5bf72d[_0x3db619(0x2eb)])!==null&&_0x1ae0eb!==void 0x0?_0x1ae0eb:{'actions':null},_0x1d722f=_0x4c5a5f[_0x3db619(0x2eb)];if(_0x5630b1&&_0x5630b1!==_0x1a2130)throw new Error(_0x3db619(0x376)+_0x5630b1+'\x20-\x20'+_0x1a2130+'.');return{..._0x5bf72d,'id':_0x1a2130,'type':_0x42212d,'params':{'unitId':_0x1d722f[_0x3db619(0x17e)],'textRanges':_0x1d722f[_0x3db619(0x2b4)],'actions':JSONX[_0x3db619(0x278)](_0x3e4849[_0x3db619(0x164)],_0x1d722f[_0x3db619(0x164)])}};},{})],_0x40bcfd=(_0x5ac05e=(_0x5caa57=_0x296685['getCurrentUser']())===null||_0x5caa57===void 0x0?void 0x0:_0x5caa57['userID'])!==null&&_0x5ac05e!==void 0x0?_0x5ac05e:_0x37220c(0x200),_0x29791e=(_0x240aa4=(_0x367ea3=_0x296685[_0x37220c(0x1e3)]())===null||_0x367ea3===void 0x0?void 0x0:_0x367ea3[_0x37220c(0x32d)])!==null&&_0x240aa4!==void 0x0?_0x240aa4:_0x37220c(0x200);return{'changeset':{'unitID':_0x1c9d4a,'type':mapDocumentTypeToUniverInstanceType(_0x44ee12['getUnitType'](_0x1c9d4a)),'baseRev':_0x2d2d6b[_0x37220c(0x1b5)](_0x1c9d4a),'revision':0x0,'userID':_0x40bcfd,'memberID':_0x29791e,'mutations':_0x440954},'pendingMutations':[]};}function createTimerObservable$(_0x266845,_0x20a875){const _0x2e8ed2=_0x37a288,_0x1ca496=new ReplaySubject(0x1);return setTimeout(()=>_0x1ca496[_0x2e8ed2(0x1b0)](_0x20a875),_0x266845),_0x1ca496[_0x2e8ed2(0x16b)]()[_0x2e8ed2(0x39b)](take(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0xa4cc6a){const _0x33eefc=_0x37a288;return _0xa4cc6a['NOT_COLLAB']=_0x33eefc(0x275),_0xa4cc6a[_0x33eefc(0x35c)]=_0x33eefc(0x372),_0xa4cc6a[_0x33eefc(0x1f0)]='pending',_0xa4cc6a['AWAITING']='awaiting',_0xa4cc6a['AWAITING_WITH_PENDING']=_0x33eefc(0x210),_0xa4cc6a[_0x33eefc(0x37d)]=_0x33eefc(0x185),_0xa4cc6a['CONFLICT']=_0x33eefc(0x2ed),_0xa4cc6a[_0x33eefc(0x29c)]='offline',_0xa4cc6a;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x15bb62,_0x5bf842,_0x51468a,_0x284967,_0x25990d,_0x25e0ca,_0x31278d,_0xb02f42,_0x2b53ff){const _0x3507ff=_0x37a288;this['unitID']=_0x15bb62,this[_0x3507ff(0x2b9)]=_0x5bf842,this['_handler']=_0x25990d,this[_0x3507ff(0x36d)]=_0x25e0ca,this['_undoRedoService']=_0x31278d,this[_0x3507ff(0x2c0)]=_0xb02f42,this[_0x3507ff(0x2a1)]=_0x2b53ff,_defineProperty(this,_0x3507ff(0x36c),null),_defineProperty(this,_0x3507ff(0x212),[]),this[_0x3507ff(0x36c)]=_0x51468a,this[_0x3507ff(0x212)]=_0x284967;}[_0x37a288(0x3a8)](_0x222667){const _0x438971=_0x37a288,_0x5ba0cf=this[_0x438971(0x2c0)]['getCurrentRevOfUnit'](this['unitID']);if(_0x222667[_0x438971(0x319)]>_0x5ba0cf+0x1)return this['_handler'][_0x438971(0x3a6)]({'from':_0x5ba0cf,'to':_0x222667[_0x438971(0x319)]-0x1}),!![];return![];}[_0x37a288(0x30a)](_0x26a2c1){const _0x1ffe05=_0x37a288;this['_undoRedoService'][_0x1ffe05(0x154)](this['unitID'],_0x26a2c1);}[_0x37a288(0x18e)](_0xd56923){const _0x407fdf=_0x37a288;var _0x25acc4,_0x2ffb88;(_0x25acc4=(_0x2ffb88=this[_0x407fdf(0x297)])[_0x407fdf(0x371)])===null||_0x25acc4===void 0x0||_0x25acc4[_0x407fdf(0x2b8)](_0x2ffb88,_0xd56923);}[_0x37a288(0x27f)](_0x56db88){const _0x4517b3=_0x37a288;var _0x4ad2e0,_0x32b1de;return(_0x4ad2e0=(_0x32b1de=this[_0x4517b3(0x297)])['onTransformIME'])===null||_0x4ad2e0===void 0x0?void 0x0:_0x4ad2e0[_0x4517b3(0x2b8)](_0x32b1de,_0x56db88);}[_0x37a288(0x219)](_0x496734){const _0x226489=_0x37a288;var _0x20505a,_0x34e19f;return(_0x20505a=(_0x34e19f=this[_0x226489(0x297)])['onTransformState'])===null||_0x20505a===void 0x0?void 0x0:_0x20505a[_0x226489(0x2b8)](_0x34e19f,_0x496734);}[_0x37a288(0x2d2)](_0x12b050){const _0x57e368=_0x37a288;var _0x3d5c2c,_0x16076f,_0x3c0c92;return(_0x3d5c2c=(_0x16076f=(_0x3c0c92=this[_0x57e368(0x297)])[_0x57e368(0x148)])===null||_0x16076f===void 0x0?void 0x0:_0x16076f['call'](_0x3c0c92,_0x12b050))!==null&&_0x3d5c2c!==void 0x0?_0x3d5c2c:_0x12b050;}[_0x37a288(0x1c4)](_0x250e89){const _0x58a7e0=_0x37a288;var _0x276bfb,_0x53eae5,_0xd93ec7;return(_0x276bfb=(_0x53eae5=(_0xd93ec7=this[_0x58a7e0(0x297)])['onTransformRemoteChangesetByStateCache'])===null||_0x53eae5===void 0x0?void 0x0:_0x53eae5[_0x58a7e0(0x2b8)](_0xd93ec7,_0x250e89))!==null&&_0x276bfb!==void 0x0?_0x276bfb:_0x250e89;}[_0x37a288(0x330)](_0x309ebc){const _0x3e8a86=_0x37a288;if(this[_0x3e8a86(0x2b9)]===UniverInstanceType[_0x3e8a86(0x3a2)]){const {unitID:_0x1c445a,mutations:_0x3cd868,memberID:_0x47f58b}=_0x309ebc,_0x4d9148=_0x3cd868[_0x3e8a86(0x1a6)]>0x0?_0x3cd868[0x0][_0x3e8a86(0x2eb)][_0x3e8a86(0x2b4)]:[];if(Array['isArray'](_0x4d9148)&&_0x4d9148[_0x3e8a86(0x1a6)]>0x0){var _0x51591a,_0x131521;(_0x51591a=(_0x131521=this[_0x3e8a86(0x297)])['onSyncEditingCollabCursor'])===null||_0x51591a===void 0x0||_0x51591a[_0x3e8a86(0x2b8)](_0x131521,{'unitID':_0x1c445a,'memberID':_0x47f58b,'textRanges':_0x4d9148});}}}[_0x37a288(0x365)](){const _0x268b19=_0x37a288;var _0x122d12;(_0x122d12=this[_0x268b19(0x2a1)])===null||_0x122d12===void 0x0||_0x122d12[_0x268b19(0x17b)](this['unitID'],this[_0x268b19(0x2b9)],this['_awaitingChangeset'],this['_pendingMutations']);}[_0x37a288(0x360)](){const _0x45c218=_0x37a288;return this[_0x45c218(0x2c0)][_0x45c218(0x1b5)](this[_0x45c218(0x196)]);}[_0x37a288(0x258)](){const _0x8cce6e=_0x37a288;this[_0x8cce6e(0x2c0)][_0x8cce6e(0x2e0)](this[_0x8cce6e(0x196)]);}['_executeRemoteChangeset'](_0x133e3b){const _0x52ab31=_0x37a288;let _0xa5047a=this[_0x52ab31(0x2d2)](_0x133e3b);_0xa5047a=this[_0x52ab31(0x1c4)](_0xa5047a);const _0x40c8b1=sequenceExecute(_0xa5047a[_0x52ab31(0x1ef)],this[_0x52ab31(0x36d)],{'fromCollab':!![]});if(!_0x40c8b1[_0x52ab31(0x1ae)]){var _0x5e233a;if(_0x40c8b1[_0x52ab31(0x1cd)]instanceof Error)throw _0x40c8b1[_0x52ab31(0x1cd)];throw new Error((_0x5e233a=_0x40c8b1['error'])!==null&&_0x5e233a!==void 0x0?_0x5e233a:'[CollaborationState]:\x20apply\x20error!');}this[_0x52ab31(0x27f)](_0xa5047a),this['_transformStateCache'](_0xa5047a),this[_0x52ab31(0x30a)](_0x133e3b),this[_0x52ab31(0x18e)](_0xa5047a),this[_0x52ab31(0x330)](_0xa5047a),this[_0x52ab31(0x258)]();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x514146,_0x224103,_0x2770e9,_0x5f4d3c,_0x32e9d4,_0x42896c,_0x266750,_0x12b443,_0x6ba040,_0x3f83ae){const _0x48d715=_0x37a288;super(_0x514146,_0x224103,null,[],_0x2770e9,_0x266750,_0x42896c,_0x5f4d3c,_0x3f83ae),this[_0x48d715(0x299)]=_0x32e9d4,this['_logService']=_0x12b443,this[_0x48d715(0x37c)]=_0x6ba040,this[_0x48d715(0x1bc)]=_0x3f83ae,_defineProperty(this,_0x48d715(0x2cb),_0x48d715(0x372));}[_0x37a288(0x326)](_0x21b841){const _0x2e3fc3=_0x37a288,_0xc13331=this[_0x2e3fc3(0x299)][_0x2e3fc3(0x21a)](PendingState,this[_0x2e3fc3(0x196)],this['type'],[_0x21b841],this[_0x2e3fc3(0x297)]);return _0xc13331['_schedule'](),_0xc13331[_0x2e3fc3(0x365)](),_0xc13331;}[_0x37a288(0x342)](_0x4bbd92){const _0x2fbbef=_0x37a288;if(this[_0x2fbbef(0x3a8)](_0x4bbd92))return this[_0x2fbbef(0x299)][_0x2fbbef(0x21a)](FetchingMissState,this[_0x2fbbef(0x196)],this[_0x2fbbef(0x2b9)],null,[],null,[_0x4bbd92],this[_0x2fbbef(0x297)]);try{const _0x1d9410=this['_transformService']['transformMutationsWithChangeset'](_0x4bbd92,[EmptyMutationInfo]);if(isTransformMutationsWithChangesetSuccess(_0x1d9410)){const {c1Prime:_0xf2b6d}=_0x1d9410;return this[_0x2fbbef(0x1c5)](_0xf2b6d),this;}throw _0x1d9410[_0x2fbbef(0x1cd)];}catch(_0x34ed93){return this[_0x2fbbef(0x270)][_0x2fbbef(0x1cd)](_0x34ed93),this[_0x2fbbef(0x1ac)](![]);}}[_0x37a288(0x1ac)](_0x1419c2){const _0x4859b1=_0x37a288;return this[_0x4859b1(0x299)][_0x4859b1(0x21a)](ConflictState,this[_0x4859b1(0x196)],this['type'],null,[],this[_0x4859b1(0x297)],_0x1419c2);}[_0x37a288(0x217)](_0x25a802){const _0x2c4ae3=_0x37a288;if(_0x25a802[_0x2c4ae3(0x319)]<=this[_0x2c4ae3(0x360)]())return this;throw new Error(_0x2c4ae3(0x374));}['onRemoteRej'](){const _0x26d6c1=_0x37a288;throw new Error(_0x26d6c1(0x25f));}[_0x37a288(0x30b)](){return this;}[_0x37a288(0x167)](){const _0x4704c2=_0x37a288;return this[_0x4704c2(0x299)]['createInstance'](OfflineState,this[_0x4704c2(0x196)],this['type'],null,[],this[_0x4704c2(0x297)]);}['toggleOnline'](){return this;}[_0x37a288(0x2d5)](){const _0x5c8cfe=_0x37a288;throw new Error(_0x5c8cfe(0x237));}['fetchMiss'](){const _0x40ef74=_0x37a288,_0x552e53=this['_revisionService'][_0x40ef74(0x1b5)](this['unitID']);return this[_0x40ef74(0x297)]['onMissingChangesets']({'from':_0x552e53,'to':0x0}),this['_injector'][_0x40ef74(0x21a)](FetchingMissState,this['unitID'],this[_0x40ef74(0x2b9)],null,[],null,[],this['_handler']);}};SyncedState=__decorate([__decorateParam(0x3,Inject(RevisionService)),__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,IUndoRedoService),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,Optional(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x34cb99,_0x2c115f,_0x22edf3,_0x4c2164,_0x10300d,_0x23444d,_0x34ed82,_0x5913f0,_0x4033f9,_0x407d9b,_0x5d81f6,_0x368471,_0x22881c,_0x26554f){const _0x4ffbc9=_0x37a288;super(_0x34cb99,_0x2c115f,null,_0x22edf3,_0x4c2164,_0x4033f9,_0x22881c,_0x23444d,_0x26554f),this[_0x4ffbc9(0x299)]=_0x10300d,this[_0x4ffbc9(0x17f)]=_0x34ed82,this[_0x4ffbc9(0x270)]=_0x5913f0,this[_0x4ffbc9(0x1ec)]=_0x407d9b,this[_0x4ffbc9(0x37c)]=_0x5d81f6,this[_0x4ffbc9(0x229)]=_0x368471,_defineProperty(this,_0x4ffbc9(0x2cb),_0x4ffbc9(0x1cb)),_defineProperty(this,_0x4ffbc9(0x2e1),null),_defineProperty(this,_0x4ffbc9(0x20f),null);}[_0x37a288(0x326)](_0x13f4a7){const _0x395f47=_0x37a288;return this[_0x395f47(0x212)]['push'](_0x13f4a7),this[_0x395f47(0x365)](),this;}[_0x37a288(0x342)](_0x3ed1c7){const _0x53d3c0=_0x37a288;if(this[_0x53d3c0(0x3a8)](_0x3ed1c7))return this[_0x53d3c0(0x251)](),this[_0x53d3c0(0x299)]['createInstance'](FetchingMissState,this[_0x53d3c0(0x196)],this['type'],null,this[_0x53d3c0(0x212)],null,[_0x3ed1c7],this[_0x53d3c0(0x297)]);try{const _0x22e55f=this[_0x53d3c0(0x37c)][_0x53d3c0(0x230)](_0x3ed1c7,this['_pendingMutations']);if(isTransformMutationsWithChangesetSuccess(_0x22e55f)){const {c1Prime:_0x3fdbcf,m2Prime:_0x2f63f3}=_0x22e55f;this['_executeRemoteChangeset'](_0x3fdbcf);const _0x34875d=this['_injector'][_0x53d3c0(0x21a)](_PendingState,this['unitID'],this['type'],_0x2f63f3,this[_0x53d3c0(0x297)]);this[_0x53d3c0(0x251)]();const _0xee80b8=new Date()[_0x53d3c0(0x191)](),_0x504c62=this['_scheduleCompleteTimestamp']?Math['max'](this[_0x53d3c0(0x2e1)]-_0xee80b8,0x0):this[_0x53d3c0(0x23d)]();return _0x34875d['_schedule'](_0x504c62),_0x34875d;}throw _0x22e55f[_0x53d3c0(0x1cd)];}catch(_0x5a82fc){return this[_0x53d3c0(0x270)]['error'](_0x5a82fc),this[_0x53d3c0(0x1ac)](![]);}}[_0x37a288(0x217)](_0x598655){const _0x21351d=_0x37a288;if(_0x598655[_0x21351d(0x319)]<=this[_0x21351d(0x360)]())return this;throw new Error(_0x21351d(0x2fb));}[_0x37a288(0x298)](){const _0x25796e=_0x37a288;throw new Error(_0x25796e(0x33f));}['onRemoteRetry'](){return this;}[_0x37a288(0x167)](){const _0x29931d=_0x37a288;return this['_clearScheduledTask'](),this[_0x29931d(0x299)]['createInstance'](OfflineState,this['unitID'],this['type'],null,this[_0x29931d(0x212)],this[_0x29931d(0x297)]);}['toggleOnline'](){return this;}['_schedule'](_0x332e13){const _0xa5477e=_0x37a288,_0x15bc2b=_0x332e13!==null&&_0x332e13!==void 0x0?_0x332e13:this[_0xa5477e(0x23d)]();this['_scheduleCompleteTimestamp']=new Date()[_0xa5477e(0x191)]()+_0x15bc2b,this[_0xa5477e(0x20f)]=setTimeout(()=>{const _0x2336f6=_0xa5477e;this[_0x2336f6(0x251)]();let _0x5b9416=null;switch(this[_0x2336f6(0x2b9)]){case UniverInstanceType['UNIVER_SHEET']:_0x5b9416=assembleSheetChangeset(this[_0x2336f6(0x212)],this[_0x2336f6(0x196)],this[_0x2336f6(0x229)],this[_0x2336f6(0x2c0)],this[_0x2336f6(0x17f)]);break;case UniverInstanceType[_0x2336f6(0x3a2)]:if(this[_0x2336f6(0x212)][_0x2336f6(0x29d)](_0x37a314=>_0x37a314['id']===RichTextEditingMutation['id']))_0x5b9416=assembleDocChangeset(this[_0x2336f6(0x212)],this['unitID'],this[_0x2336f6(0x229)],this['_revisionService'],this[_0x2336f6(0x17f)]);else _0x5b9416=assembleSheetChangeset(this[_0x2336f6(0x212)],this['unitID'],this[_0x2336f6(0x229)],this[_0x2336f6(0x2c0)],this[_0x2336f6(0x17f)]);break;default:throw new Error(_0x2336f6(0x260)+this[_0x2336f6(0x2b9)]+'\x20in\x20_schedule.');}const {changeset:_0x285b41,pendingMutations:_0x505c9f}=_0x5b9416;this[_0x2336f6(0x297)][_0x2336f6(0x265)](_0x285b41);const _0x30ace4=_0x505c9f[_0x2336f6(0x1a6)]?this[_0x2336f6(0x299)][_0x2336f6(0x21a)](AwaitingWithPendingState,this['unitID'],this[_0x2336f6(0x2b9)],_0x285b41,_0x505c9f,this[_0x2336f6(0x297)],void 0x0):this['_injector'][_0x2336f6(0x21a)](AwaitingState,this[_0x2336f6(0x196)],this[_0x2336f6(0x2b9)],_0x285b41,this[_0x2336f6(0x297)]);_0x30ace4[_0x2336f6(0x365)](),this[_0x2336f6(0x297)][_0x2336f6(0x14b)](this,_0x30ace4);},_0x15bc2b);}['_getSendChangesetTimeout'](){const _0x13db95=_0x37a288;var _0x1878f1;const _0x3c64d6=this[_0x13db95(0x1ec)][_0x13db95(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x1878f1=_0x3c64d6===null||_0x3c64d6===void 0x0?void 0x0:_0x3c64d6[_0x13db95(0x37f)])!==null&&_0x1878f1!==void 0x0?_0x1878f1:DEFAULT_SEND_CHANGESET_TIMEOUT;}[_0x37a288(0x2d5)](){const _0x8bcbc5=_0x37a288;throw new Error(_0x8bcbc5(0x183));}[_0x37a288(0x251)](){const _0x383ced=_0x37a288;this[_0x383ced(0x20f)]!=null&&(clearTimeout(this[_0x383ced(0x20f)]),this[_0x383ced(0x20f)]=null);}['_onConflict'](_0x40741c){const _0x35e264=_0x37a288;return this[_0x35e264(0x251)](),this[_0x35e264(0x299)][_0x35e264(0x21a)](ConflictState,this['unitID'],this[_0x35e264(0x2b9)],null,this['_pendingMutations'],this['_handler'],_0x40741c);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,Inject(MemberService)),__decorateParam(0x7,ILogService),__decorateParam(0x8,ICommandService),__decorateParam(0x9,IConfigService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUniverInstanceService),__decorateParam(0xc,IUndoRedoService),__decorateParam(0xd,Optional(ILocalCacheService))],PendingState);function _0x1522(){const _0xc241ea=['_onOffline','routeKey','_socketReady','_sendHeartbeat','getUnitType','_onRecvEvent','state','_transformUndoredo','onRemoteRetry','_change$','_applyRemoteChangeset','range','getValue','_changesetSessionId','encrypt','DEFAULT_FILE_NAME','_snapshotServerService','state$','has','send','function','onload','revision','UPDATE_CURSOR','undefined','auth.needGotoLoginAlert','IDLE','saveSnapshot','put','CHANGESET_REJ','_unitID','?url=','close$','collaboration-client.config','transformSelections','appendMutation','OTHER_CLIENT_EDITING','[UniverCollaborationClientPlugin]','[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!','univer-pro.collaboration-client.single-active-unit-service','FAIL','unsubscribe','memberID','_HTTPService','USERS_LEAVE','_syncEditingCollabCursor','_decreaseWaiting','getResourcesRequest','_init','leaveEvent','_onMessage','session.room-permission-denied','7999312pLKKJL','submit\x20changeset\x20error!','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','UNISCRIPT_RUN','_clearTimeoutTimer','updateCursorEvent','objectType','onTransformIME','[PendingState]:\x20received\x20rejection.','JOINING','sid','onRemoteChangeset','equals','push','headers','data','_status$','_permissionService','save\x20fail\x20reason\x20is\x20','open$','rev','/unit/','_getLoginPath','catch','update','_socketService','_networkConditionService','_resendTimeout','duration','loginUrlKey','COMPRESS_MUTATION_SEND','getUnitOnRev','UUID','getMemberID','values','event$','_redoStacks','SYNCED','/resources','1227534rRpBfj','unit','_getCurrentRevision','url','UNIVER_SHEET','pauseCollaboration','&assign=','_updateLocalCache','_clearUndo','/-/object/-/batch_allowed','fetchMiss','_updateStatus','COMMENT_UPDATE','_entityInit$','_awaitingChangeset','_commandService','_schedule','add','_submitChangeset','onTransformSelections','synced','onMissedChangesetFetched','[SyncedState]:\x20received\x20acknowledgement.','JOIN_ROOM_FULL','Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20','delete','init','CLOSE_ROOM','online$','c1Prime','_transformService','FETCH_MISS','roomInfos','sendChangesetTimeout','hostname','registerHTTPInterceptor','session.room-full','_transformStack','members$','csShouldRetryEvent','version','fetchThroughInterceptors','SOCKET_FAILED','defineProperty','disableLocalCache','onStarting','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','_isEchoedAwaitingChangeset','getConfig','_onConnectionOpen','JOIN_ROOM_PERMISSION_DENIED','setCurrentUser','_config','ERROR_IMAGE','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','loadOfflineData','_resendWithTimeout','removeMember','_queuedRemoteChangesets','_initMergeInterceptor','responseType','pipe','_resendTimer','saveSheetBlock','complete','commentUpdate$','PERMISSION_REJ','string','UNIVER_DOC','symbol','objectActions','_initUnitPermissionChange','onMissingChangesets','loadUnitOfRevision','_checkMissing','ONLINE','_waitCount','_roomCreated$','getRoom','avatar','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','then','_startTelemetryCollaborationNewChangeset','charCodeAt','/universer-api/oidc/authpage','onTransformRemoteChangesetByIMECache','[CollaborationEntity]:\x20cannot\x20lock\x20transition\x20twice!\x20This\x20is\x20an\x20implementation\x20error,\x20meaning\x20you\x20transit\x20the\x20collaboration\x20state\x20again\x20in\x20the\x20process\x20of\x20a\x20previous\x20transition.\x20This\x20should\x20never\x20happen.','_isPermissionRej','onStateChange','cfgEnableObjInherit','_createHandler','_removeRoom','_initRequestHeader','focused$','_onCombEvent','_joinRoom','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!','transformUndoRedo','HEARTBEAT_INTERVAL','RECV','getImage','_onRemoteRetry','collaboratorID','/universer-api/user/session-ticket','editing\x20status\x20changed\x20to','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','_unlockTransition','getUnitId','0.22.1','LEAVE','JOIN_ROOM_FAILED','infoRsp','getImageSourceCache','actions','_instanceService','includes','toggleOffline','LIVESHARE_OPERATION','name','dispose','asObservable','_clearRedo','getSnapshotAPIPath','_acknowledgeAwaitingIfReady','href','socketService','waitForRoom$','userID','fetching\x20missing\x20changesets\x20from\x20','COMPRESS_MUTATION_APPLY','setCfgEnableObjInherit','_toggleOffline','members','readyForCollab','SUBMIT_CHANGESET','saveImage','updateOfflineData','snapshot','packageName','unitId','_memberService','SUBMIT_CHANGESET_TIMEOUT','_createInitialState','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.','_maxTotalRetryTimeout','fetch_missing','decorate','prototype','_entities','HELLO','PERMISSION_DENIED','status$','_getRedoStack','_fetchMissChangesets','_transformSelections','/universer-api/file/{fileID}/sign-url','_replaceFileID','getTime','_rescheduleHeartbeat','offline','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','_onRemoteACK','unitID','_sendHeartbeatTimer','change$','changesets','loadDoc','Error\x20on\x20receiving\x20event','session','sessionStatus$','HEARTBEAT','originalMeta','[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.','/collaborator','[CollaborationEntity]','slice','find','315964cKUYZe','length','onMutationExecutedForCollab','FETCH_MISSING','confirm','getFocusedUnit','replace','_onConflict','_members','result','min','next','selections','constructor','joinEvent','list','getCurrentRevOfUnit','getActiveSheet','_getUndoStack','_getSignURL','univer-pro.collaboration-client-socket-service','error$','getSheetBlock','localCacheService','_retryConnectingTimer','stopTime','failed\x20to\x20apply\x20missed\x20changesets!','OTHER_CLIENTS_EDITING','SUCCUSS','_tryReconnect','[OfflineState]:\x20received\x20rejection.','_transformRemoteChangesetByStateCache','_executeRemoteChangeset','INGEST','_socket','connection\x20error','_stopTelemetryCollaborationNewChangeset','refreshPermission','pending','setConfig','error','getDeserializedSheetBlock','updateMember','objectID','getCfgEnableObjInherit','_getAPIPrefixPath','CHANGESET_ACK','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','interceptor','fetchMissingChangesets','reconnect','unitInfo$','POST','startsWith','_showConflictNotification','MUTATION','/fetchmissing?from=','closeSession','origin','subject','HEARTBEAT_TIMEOUT','_singleActiveUnitService','getCurrentUser','_collaborationUIEventService','_clearLocalCache','uploadFileServerUrl','_onJoinRoomEvent','_substituteRedoStack','[OfflineState]:\x20received\x20acknowledgement.','UnitEmbedded','permissionRejEvent','_configService','toPrimitive','_sessionStatus$','mutations','PENDING','map','reject','eventID','_updateState','toString','\x0aAfter:\x20','SOCKET_FAILED_RETRY','getCurrentSelections','_onRemoteRejected','_snapshotService','_initCloseConn','[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!','/universer-api/snapshot','_onLocalMutation','UNIVER_COLLABORATION_CLIENT_PLUGIN','unknown','liveShareNewHost','encodeURIComponent','awaiting','fetching\x20the\x20latest\x20document\x20from\x20the\x20server.','_transformAndApplyRemoteChangeset','_getUploadFileURL','isArray','getWorkbookSelections','_collaborationSessionService','LIVESHARE_TERMINATE','collaborators','/role','_handlerCallback','NEW_CHANGESETS','_sendingTimer','awaiting_with_pending','socket\x20close','_pendingMutations','get','LIVESHARE_NEW_HOST','_cfgEnableObjInherit','_socket$','onRemoteAck','GLOBAL_ROOMS_CNT_EXCEEDS','_transformStateCache','createInstance','transformChangesets','_tryEnsureSocket','liveShareOperation','_collaborationTimeoutTimer','object','apply','reqId','resourceIDs','deleteCollaborator','9GLthFy','toggleOnline','requireSession','/block/','findIndex','_univerInstanceService','_acknowledgeAwaiting','_acknowledgedAwaitingRevision','splice','override','JOIN','socket\x20open.','transformMutationsWithChangeset','getTypeOfUnitAdded$','_httpService','ERROR_EXCEED_SIZE','onCommentUpdate','size','_onConnectionFailed','[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.','createCollaborator','target','sort','isPermissionRej','Failed\x20to\x20update\x20permission\x20point','_getSendChangesetTimeout','_createInitialStateImpl','_emitMembers','commentUpdateEvent','_exhaustRemoteChangesetQueue','/universer-api/uniscript','getInterceptPoints','_startCollaboration','MSG_FOR_ERROR','executeCommand','_throwTelemetryCollaborationNewChangeset','_clearHeartbeatTimer','requestParams','stringify','_remoteChangesetQueue','PERSON','default','/universer-api/comb','_type','message$','_clearScheduledTask','getOwnPropertyDescriptor','[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20','FileId','_commentUpdate$','_toggleOnline','_roomMembers','_incrementRevisionNumber','CHANGESET_SHOULD_RETRY','[CollaborationController]:\x20invalid\x20univer\x20type:\x20','_imageSourceCache','code','unitId\x20is\x20not\x20found','forEach','[SyncedState]:\x20received\x20rejection.','[PendingState]:\x20unhandled\x20univer\x20type:\x20','getUnit','floor','_compressMutationService','getTypeOfUnitDisposed$','onSendChangeset','getCollabEntity$','loadUnit','3045066wfpYPO','collaboration-client.local-cache-service','_getDownloadEndpointURL','append','baseRev','getMember','socket$','enableSingleActiveInstanceLock','_logService','[DataLoaderService]','_disableEditing','joinRsp','[CollaborationUndoRedoService]','not_collab','Univer','collabSubmitChangesetUrl','compose','__Key__','LIVESHARE_FETCH_OPERATIONS','debug','updatePermissionObjEvent','387494oIvcgt','NO_OTHER_CLIENTS_EDITING','_transformIMECache','onTransformRemoteChangesetByStateCache','enableAuthServer','UPDATE_PERMISSION_OBJ','_userManagerService','PSEUDO_FETCH_MISSING_RESULT','filter','c2Prime','_onFetchMissResult','RETRY_CONNECTING_MAX_COUNT','_waitForHeartbeatResponse','People','_listenToNetworkCondition','sheets','entityInit$','_sessions','unit-cache-','JOIN_ROOM_NOT_EXISTS','getLatestCsReqIdBySid','_event$','/object/','emitEvent','_shouldReportTelemetry','_commentService','_handler','onRemoteRej','_injector','_getAPIPrefix','capture','OFFLINE','every','BASE64','_registerDependencies','session.room-not-exists','_localCacheService','ERROR_IMAGE_TYPE','collaboration_new_changeset','5VGefxg','_unitInfo$','_handleRemoteChangesets','updatePermissionPoint','[CollaborationSessionService]','_socketMessageSubscription','_onUserJoin','CONFLICT','title','createSocket','subscribe','m2Prime','now','[FetchMissState]','awaitingChangeset','USERS_ENTER','textRanges','_telemetryService','_clearCollaborationTimeoutTimer','ws://127.0.0.1:8000/universer-api/comb/connect','call','type','telemetry\x20info\x20is\x20not\x20initialized','[FetchingMissState]:\x20received\x20stale\x20ack\x20revision:\x20','_localeService','[CollaborationSession]','fromCollab','post','_revisionService','_transitionLocked','_onUserLeave','_members$','set','patch','_changesetReqId','_lockTransition','_clearRetryConnectingTimer','_timeoutTimer','signUrlServerUrl','status','csAckEvent','getSheetId','fromCharCode','onLocalMutation','updateCollaborator','_onRemoteChangeset','_transformRemoteChangesetByIMECache','SHOULD_CLOSE_CONN','_retryCount','resend','_eventService','_state$','dispose$','_replayCachedMutations','_sender','755016XAlRPf','\x0aCurrent:\x20','_telemetryInfo','roles','_sheetTransformSelectionsService','incrementRevOfUnit','_scheduleCompleteTimestamp','enableOfflineEditing','709752qroVRA','OPTIONAL','close','shouldCloseConn','copyFileMeta','workbook','_candidateSocket','snapshotServerUrl','params','setWaitCount','conflict','missingChangesets','_scheduleCollaborationTimeoutTimer','from','_createSocket','onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.','body','disposeWithMe','file','encode','sessionStatus','localeService','_initDependencies','/universer-api/snapshot/','[PendingState]:\x20received\x20acknowledgement.','_state','_collaborationPaused','clear','authzUrl','location','cmd','src'];_0x1522=function(){return _0xc241ea;};return _0x1522();}let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x12515c,_0x570566,_0x2fe8db,_0x1e38cc,_0xf201d0,_0x49d774,_0x1da107,_0x15bb8b,_0x22e01a,_0x3323cd,_0x164178){const _0x5cddfb=_0x37a288;super(_0x12515c,_0x570566,_0x2fe8db,[],_0x1e38cc,_0x1da107,_0x3323cd,_0x49d774,_0x164178),this[_0x5cddfb(0x299)]=_0xf201d0,this[_0x5cddfb(0x270)]=_0x15bb8b,this[_0x5cddfb(0x37c)]=_0x22e01a,_defineProperty(this,'status',_0x5cddfb(0x203)),_defineProperty(this,_0x5cddfb(0x352),0x0),_defineProperty(this,_0x5cddfb(0x184),0x0),_defineProperty(this,_0x5cddfb(0x39c),void 0x0),_defineProperty(this,'_sender',void 0x0);}[_0x37a288(0x326)](_0x3b3c15){const _0x351ff5=_0x37a288;this[_0x351ff5(0x251)]();const _0x73643b=this[_0x351ff5(0x299)][_0x351ff5(0x21a)](AwaitingWithPendingState,this['unitID'],this[_0x351ff5(0x2b9)],this[_0x351ff5(0x36c)],[_0x3b3c15],this[_0x351ff5(0x297)],this[_0x351ff5(0x39c)]);return _0x73643b[_0x351ff5(0x365)](),_0x73643b;}[_0x37a288(0x342)](_0x33fdcb){const _0x20fe10=_0x37a288;if(this['_checkMissing'](_0x33fdcb))return this[_0x20fe10(0x251)](),this[_0x20fe10(0x299)][_0x20fe10(0x21a)](FetchingMissState,this[_0x20fe10(0x196)],this[_0x20fe10(0x2b9)],this[_0x20fe10(0x36c)],[],null,[_0x33fdcb],this[_0x20fe10(0x297)]);try{const _0x46130b=this['_transformService'][_0x20fe10(0x21b)]([_0x33fdcb],[this['_awaitingChangeset']],![]);if(isTransformChangesetsSuccess(_0x46130b)){const {c1Prime:_0xc93052,c2Prime:_0x312f7a}=_0x46130b;this['_executeRemoteChangeset'](_0xc93052[0x0]),_0x312f7a[0x0][_0x20fe10(0x26c)]=this[_0x20fe10(0x360)](),this[_0x20fe10(0x251)]();const _0x46359d=this[_0x20fe10(0x299)][_0x20fe10(0x21a)](_AwaitingState,this['unitID'],this[_0x20fe10(0x2b9)],_0x312f7a[0x0],this['_handler']);return _0x46359d[_0x20fe10(0x365)](),_0x46359d;}throw _0x46130b[_0x20fe10(0x1cd)];}catch(_0x319d3b){return this[_0x20fe10(0x270)][_0x20fe10(0x1cd)](_0x319d3b),this[_0x20fe10(0x1ac)](![]);}}[_0x37a288(0x217)](_0xe1a3b1){const _0x3de603=_0x37a288;this[_0x3de603(0x251)]();const _0x174993=this[_0x3de603(0x2c0)][_0x3de603(0x1b5)](this[_0x3de603(0x196)]);if(_0xe1a3b1['revision']<=_0x174993)return this;if(this[_0x3de603(0x3a8)](_0xe1a3b1))return this[_0x3de603(0x299)]['createInstance'](FetchingMissState,this[_0x3de603(0x196)],this[_0x3de603(0x2b9)],this[_0x3de603(0x36c)],[],_0xe1a3b1[_0x3de603(0x319)],[],this[_0x3de603(0x297)]);this['_incrementRevisionNumber']();const _0x1a1cc2=this['_injector'][_0x3de603(0x21a)](SyncedState,this['unitID'],this['type'],this[_0x3de603(0x297)]);return _0x1a1cc2['_updateLocalCache'](),_0x1a1cc2;}['onRemoteRej'](_0x4ecf54){const _0x138980=_0x37a288;return this[_0x138980(0x1ac)](!!(_0x4ecf54===null||_0x4ecf54===void 0x0?void 0x0:_0x4ecf54[_0x138980(0x23b)]));}[_0x37a288(0x30b)](_0xe72495){const _0x66a1bd=_0x37a288;if(this[_0x66a1bd(0x184)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x66a1bd(0x167)]();return this[_0x66a1bd(0x39c)]=createTimerObservable$(this[_0x66a1bd(0x352)],{'timeout':this[_0x66a1bd(0x352)],'reqId':_0xe72495[_0x66a1bd(0x221)]}),this[_0x66a1bd(0x2da)]=this[_0x66a1bd(0x39c)][_0x66a1bd(0x2ae)](({reqId:_0x495815,timeout:_0x53b657})=>{const _0x23fad9=_0x66a1bd;this[_0x23fad9(0x396)](_0x495815,_0x53b657);}),this;}[_0x37a288(0x167)](){const _0x5bfebc=_0x37a288;return this['_clearScheduledTask'](),this[_0x5bfebc(0x299)][_0x5bfebc(0x21a)](OfflineState,this[_0x5bfebc(0x196)],this['type'],this['_awaitingChangeset'],[],this[_0x5bfebc(0x297)]);}[_0x37a288(0x225)](){return this;}[_0x37a288(0x2d5)](){const _0x30ae1d=_0x37a288;this[_0x30ae1d(0x297)][_0x30ae1d(0x265)](this[_0x30ae1d(0x36c)]);}[_0x37a288(0x1ac)](_0x2f10fc){const _0x44c0ef=_0x37a288;return this[_0x44c0ef(0x251)](),this['_injector']['createInstance'](ConflictState,this[_0x44c0ef(0x196)],this[_0x44c0ef(0x2b9)],this[_0x44c0ef(0x36c)],[],this['_handler'],_0x2f10fc);}[_0x37a288(0x396)](_0x552ebd,_0x567e9e){const _0x4bd3d9=_0x37a288;var _0x29bfbb;_0x552ebd===((_0x29bfbb=this[_0x4bd3d9(0x36c)])===null||_0x29bfbb===void 0x0?void 0x0:_0x29bfbb[_0x4bd3d9(0x221)])&&(this[_0x4bd3d9(0x2d5)](),this[_0x4bd3d9(0x352)]=_0x567e9e===0x0?0x3e8:Math['min'](_0x567e9e*0x2,MAX_RETRY_TIMEOUT),this['_maxTotalRetryTimeout']+=this[_0x4bd3d9(0x352)]);}[_0x37a288(0x251)](){const _0x2a8590=_0x37a288;var _0x180043;(_0x180043=this['_sender'])===null||_0x180043===void 0x0||_0x180043[_0x2a8590(0x32c)](),this[_0x2a8590(0x352)]=0x0,this['_maxTotalRetryTimeout']=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,IUndoRedoService),__decorateParam(0xa,Optional(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x42fb94,_0x4151dc,_0x23e00e,_0x4b810e,_0x541723,_0x5953c0,_0x16095f,_0x3ea065,_0x821dc5,_0x32aaf5,_0x59cb9e,_0x40b610,_0x1cdf82){const _0x17fad3=_0x37a288;super(_0x42fb94,_0x4151dc,_0x23e00e,_0x4b810e,_0x541723,_0x821dc5,_0x40b610,_0x3ea065,_0x1cdf82),this[_0x17fad3(0x299)]=_0x16095f,this[_0x17fad3(0x270)]=_0x32aaf5,this[_0x17fad3(0x37c)]=_0x59cb9e,this[_0x17fad3(0x1bc)]=_0x1cdf82,_defineProperty(this,_0x17fad3(0x2cb),_0x17fad3(0x210)),_defineProperty(this,_0x17fad3(0x352),0x0),_defineProperty(this,'_maxTotalRetryTimeout',0x0),_defineProperty(this,_0x17fad3(0x39c),void 0x0),_defineProperty(this,'_sender',void 0x0),_0x5953c0&&(this[_0x17fad3(0x39c)]=_0x5953c0,this[_0x17fad3(0x2da)]=this[_0x17fad3(0x39c)]['subscribe'](({reqId:_0x15a72a,timeout:_0x1c8638})=>{this['_resendWithTimeout'](_0x15a72a,_0x1c8638);}));}[_0x37a288(0x326)](_0x2d59){const _0x540628=_0x37a288;return this['_pendingMutations'][_0x540628(0x344)](_0x2d59),this;}[_0x37a288(0x342)](_0x1fa046){const _0x29a10f=_0x37a288;if(this[_0x29a10f(0x3a8)](_0x1fa046))return this[_0x29a10f(0x251)](),this[_0x29a10f(0x299)][_0x29a10f(0x21a)](FetchingMissState,this[_0x29a10f(0x196)],this[_0x29a10f(0x2b9)],this[_0x29a10f(0x36c)],this[_0x29a10f(0x212)],null,[_0x1fa046],this[_0x29a10f(0x297)]);try{const _0x220592=this['_transformService']['transformChangesets']([_0x1fa046],[this[_0x29a10f(0x36c)]],![]);if(isTransformChangesetsSuccess(_0x220592)){const {c1Prime:_0x298ff7,c2Prime:_0x1886b1}=_0x220592,_0x31c0ff=this[_0x29a10f(0x37c)]['transformMutationsWithChangeset'](_0x298ff7[0x0],this[_0x29a10f(0x212)]);if(isTransformMutationsWithChangesetSuccess(_0x31c0ff)){const {c1Prime:_0x2edaf3,m2Prime:_0xee785f}=_0x31c0ff;return this[_0x29a10f(0x1c5)](_0x2edaf3),_0x1886b1[0x0]['baseRev']=this[_0x29a10f(0x360)](),this[_0x29a10f(0x251)](),this[_0x29a10f(0x299)][_0x29a10f(0x21a)](_AwaitingWithPendingState,this[_0x29a10f(0x196)],this[_0x29a10f(0x2b9)],_0x1886b1[0x0],_0xee785f,this['_handler'],void 0x0);}throw _0x31c0ff[_0x29a10f(0x1cd)];}throw _0x220592[_0x29a10f(0x1cd)];}catch(_0x4d05eb){return this['_logService'][_0x29a10f(0x1cd)](_0x4d05eb),this['_onConflict'](![]);}}[_0x37a288(0x217)](_0x49585d){const _0x464372=_0x37a288;this[_0x464372(0x251)]();const _0x1e7996=this[_0x464372(0x360)]();if(_0x49585d[_0x464372(0x319)]<=_0x1e7996)return this;if(this[_0x464372(0x3a8)](_0x49585d))return this[_0x464372(0x299)][_0x464372(0x21a)](FetchingMissState,this['unitID'],this[_0x464372(0x2b9)],this[_0x464372(0x36c)],this[_0x464372(0x212)],_0x49585d['revision'],[],this['_handler']);this[_0x464372(0x258)]();const _0xfcb9a1=this[_0x464372(0x299)][_0x464372(0x21a)](PendingState,this[_0x464372(0x196)],this[_0x464372(0x2b9)],this[_0x464372(0x212)],this['_handler']);return _0xfcb9a1['_schedule'](),_0xfcb9a1[_0x464372(0x365)](),_0xfcb9a1;}[_0x37a288(0x298)](_0x187217){const _0x2284a7=_0x37a288;return this[_0x2284a7(0x1ac)](!!(_0x187217===null||_0x187217===void 0x0?void 0x0:_0x187217[_0x2284a7(0x23b)]));}[_0x37a288(0x30b)](_0x36da85){const _0x53b14f=_0x37a288;if(this['_maxTotalRetryTimeout']>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x53b14f(0x167)]();return this[_0x53b14f(0x39c)]=createTimerObservable$(this['_resendTimeout'],{'timeout':this[_0x53b14f(0x352)],'reqId':_0x36da85[_0x53b14f(0x221)]}),this['_sender']=this['_resendTimer'][_0x53b14f(0x2ae)](({reqId:_0x57b5b2,timeout:_0x39cb39})=>{const _0x2cc875=_0x53b14f;this[_0x2cc875(0x396)](_0x57b5b2,_0x39cb39);}),this;}[_0x37a288(0x167)](){const _0x1d2184=_0x37a288;return this[_0x1d2184(0x251)](),this[_0x1d2184(0x299)]['createInstance'](OfflineState,this[_0x1d2184(0x196)],this['type'],this['_awaitingChangeset'],this[_0x1d2184(0x212)],this['_handler']);}[_0x37a288(0x225)](){return this;}[_0x37a288(0x2d5)](){const _0x40306a=_0x37a288;this[_0x40306a(0x297)][_0x40306a(0x265)](this[_0x40306a(0x36c)]);}[_0x37a288(0x1ac)](_0x1e4b91){const _0x3060f8=_0x37a288;return this[_0x3060f8(0x251)](),this['_injector'][_0x3060f8(0x21a)](ConflictState,this[_0x3060f8(0x196)],this[_0x3060f8(0x2b9)],null,this[_0x3060f8(0x212)],this['_handler'],_0x1e4b91);}[_0x37a288(0x396)](_0x39029e,_0x3be891){const _0x2a9dc2=_0x37a288;var _0x552832;_0x39029e===((_0x552832=this[_0x2a9dc2(0x36c)])===null||_0x552832===void 0x0?void 0x0:_0x552832['reqId'])&&(this[_0x2a9dc2(0x2d5)](),this['_resendTimeout']=_0x3be891===0x0?0x3e8:Math[_0x2a9dc2(0x1af)](_0x3be891*0x2,MAX_RETRY_TIMEOUT),this[_0x2a9dc2(0x184)]+=this[_0x2a9dc2(0x352)]);}[_0x37a288(0x251)](){const _0x52370e=_0x37a288;var _0x2df561;(_0x2df561=this['_sender'])===null||_0x2df561===void 0x0||_0x2df561[_0x52370e(0x32c)](),this[_0x52370e(0x352)]=0x0,this[_0x52370e(0x184)]=0x0;}};AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,Inject(Injector)),__decorateParam(0x7,Inject(RevisionService)),__decorateParam(0x8,ICommandService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,Optional(ILocalCacheService))],AwaitingWithPendingState);let ConflictState=class ConflictState extends CollaborationState{constructor(_0x3fc34d,_0x2fc991,_0x449b20,_0x2c088a,_0x3149d2,_0x263860=![],_0x9b9cdf,_0x3a7be2,_0x556e9f,_0x5c400b,_0x3ee4be,_0x2e51a9,_0x37cfbc){const _0x36a79a=_0x37a288;super(_0x3fc34d,_0x2fc991,_0x449b20,_0x2c088a,_0x3149d2,_0x3a7be2,_0x556e9f,_0x5c400b,_0x37cfbc),this[_0x36a79a(0x14a)]=_0x263860,this[_0x36a79a(0x348)]=_0x9b9cdf,this[_0x36a79a(0x2bc)]=_0x3ee4be,this[_0x36a79a(0x1e4)]=_0x2e51a9,this['localCacheService']=_0x37cfbc,_defineProperty(this,'status',_0x36a79a(0x2ed)),this[_0x36a79a(0x1db)](),this[_0x36a79a(0x1e5)](),this[_0x36a79a(0x272)]();}['appendMutation'](){return this;}[_0x37a288(0x342)](){return this;}[_0x37a288(0x217)](){return this;}['onRemoteRej'](){return this;}[_0x37a288(0x30b)](){return this;}[_0x37a288(0x167)](){return this;}[_0x37a288(0x225)](){return this;}[_0x37a288(0x2d5)](){throw new Error('[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.');}[_0x37a288(0x1e5)](){const _0x2aa67a=_0x37a288;var _0x15e2ff;(_0x15e2ff=this['_localCacheService'])===null||_0x15e2ff===void 0x0||_0x15e2ff['updateOfflineData'](this[_0x2aa67a(0x196)],this[_0x2aa67a(0x2b9)],null,[]);}[_0x37a288(0x1db)](){const _0x43114f=_0x37a288;if(this['_isPermissionRej'])this[_0x43114f(0x1e4)]['emitEvent']({'id':_0x43114f(0x18a)});else this[_0x43114f(0x1e4)]['emitEvent']({'id':_0x43114f(0x2ab)});}[_0x37a288(0x272)](){const _0x36ae74=_0x37a288;this['_permissionService']['updatePermissionPoint'](new WorkbookEditablePermission(this[_0x36ae74(0x196)])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,Inject(IPermissionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Inject(RevisionService)),__decorateParam(0xa,Inject(LocaleService)),__decorateParam(0xb,Inject(CollaborationUIEventService)),__decorateParam(0xc,Optional(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x2a7f6c,_0x1cf9a4,_0x48d8d7,_0x3d866a,_0x4c5a74,_0x196f3e,_0x3aa4b4,_0x4cc750,_0x5a82ce,_0x3a260f){const _0x5a4967=_0x37a288;super(_0x2a7f6c,_0x1cf9a4,_0x48d8d7,_0x3d866a,_0x4c5a74,_0x4cc750,_0x5a82ce,_0x3aa4b4,_0x3a260f),this[_0x5a4967(0x299)]=_0x196f3e,_defineProperty(this,_0x5a4967(0x2cb),_0x5a4967(0x193));}[_0x37a288(0x326)](_0x258518){const _0xdc6a3c=_0x37a288;return this['_pendingMutations'][_0xdc6a3c(0x344)](_0x258518),this[_0xdc6a3c(0x365)](),this;}[_0x37a288(0x342)](_0x24d8cd){throw new Error('[OfflineState]:\x20received\x20changeset.');}[_0x37a288(0x217)](){const _0x491184=_0x37a288;throw new Error(_0x491184(0x1e9));}[_0x37a288(0x298)](){const _0x260d39=_0x37a288;throw new Error(_0x260d39(0x1c3));}[_0x37a288(0x30b)](){return this;}[_0x37a288(0x167)](){return this;}[_0x37a288(0x225)](){const _0x1f0824=_0x37a288,{_injector:_0x26e88d,_pendingMutations:_0x483b6a,_awaitingChangeset:_0x5607d1,unitID:_0x7a8883,_handler:_0x1c33bb,type:_0x3a70c6}=this,_0x5a8602=createOnlineState(_0x26e88d,_0x7a8883,_0x3a70c6,_0x5607d1,_0x483b6a,_0x1c33bb);if(_0x5a8602 instanceof PendingState)_0x5a8602[_0x1f0824(0x36e)]();else{if(_0x5a8602 instanceof AwaitingWithPendingState||_0x5a8602 instanceof AwaitingState)_0x5a8602[_0x1f0824(0x2d5)]();}return _0x5a8602;}[_0x37a288(0x2d5)](){const _0x58e75c=_0x37a288;throw new Error(_0x58e75c(0x1a0));}};OfflineState=__decorate([__decorateParam(0x5,Inject(Injector)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Optional(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0x465a2b,_0x55f8f8,_0x513316,_0x5bfc41,_0x33cb17,_0x2f7a69,_0x1298f6,_0x4da9a8,_0x38ff76,_0x56c619,_0x468457,_0x49da95,_0x25c55b,_0x5dbd98){const _0xe60e8e=_0x37a288;super(_0x465a2b,_0x55f8f8,_0x513316,_0x5bfc41,_0x1298f6,_0x468457,_0x49da95,_0x38ff76,_0x5dbd98),this[_0xe60e8e(0x22b)]=_0x33cb17,this[_0xe60e8e(0x398)]=_0x2f7a69,this['_injector']=_0x4da9a8,this['_logService']=_0x56c619,this['_transformService']=_0x25c55b,this['localCacheService']=_0x5dbd98,_defineProperty(this,'status',_0xe60e8e(0x185));}['onMissedChangesetFetched'](_0x1fc92e){const _0x409525=_0x37a288;try{if(this['_handleRemoteChangesets'](_0x1fc92e)[_0x409525(0x2ee)])throw new Error('[FetchMissState]:\x20missing\x20changesets\x20response\x20still\x20has\x20revision\x20gaps.');if(this[_0x409525(0x2a6)]([...this[_0x409525(0x398)]][_0x409525(0x23a)]((_0x26dd02,_0x22a421)=>_0x26dd02[_0x409525(0x319)]-_0x22a421[_0x409525(0x319)]))[_0x409525(0x2ee)])return this[_0x409525(0x398)]=[],this[_0x409525(0x365)](),this[_0x409525(0x297)][_0x409525(0x3a6)]({'from':this['_getCurrentRevision'](),'to':0x0}),this;const _0x3c5384=this['_awaitingChangeset'],_0x5b6bca=this['_pendingMutations'];let _0x1dc21c;if(_0x3c5384&&_0x5b6bca[_0x409525(0x1a6)]!==0x0)_0x1dc21c=this[_0x409525(0x299)][_0x409525(0x21a)](AwaitingWithPendingState,this[_0x409525(0x196)],this[_0x409525(0x2b9)],_0x3c5384,_0x5b6bca,this[_0x409525(0x297)],void 0x0);else{if(_0x3c5384&&_0x5b6bca[_0x409525(0x1a6)]===0x0)_0x3c5384[_0x409525(0x26c)]=this[_0x409525(0x360)](),_0x1dc21c=this[_0x409525(0x299)]['createInstance'](AwaitingState,this['unitID'],this[_0x409525(0x2b9)],_0x3c5384,this[_0x409525(0x297)]);else{if(_0x5b6bca[_0x409525(0x1a6)]!==0x0){const _0x41c4ca=this[_0x409525(0x299)][_0x409525(0x21a)](PendingState,this['unitID'],this[_0x409525(0x2b9)],_0x5b6bca,this[_0x409525(0x297)]);_0x41c4ca[_0x409525(0x36e)](),_0x1dc21c=_0x41c4ca;}else _0x1dc21c=this[_0x409525(0x299)][_0x409525(0x21a)](SyncedState,this[_0x409525(0x196)],this['type'],this[_0x409525(0x297)]);}}return _0x1dc21c[_0x409525(0x365)](),_0x1dc21c;}catch(_0xadfd36){return this[_0x409525(0x270)][_0x409525(0x1cd)](_0x409525(0x2b1),_0x409525(0x1bf),_0xadfd36),this[_0x409525(0x299)]['createInstance'](ConflictState,this['unitID'],this[_0x409525(0x2b9)],this[_0x409525(0x36c)],this[_0x409525(0x212)],this['_handler'],![]);}}[_0x37a288(0x2a6)](_0x1af4bd){const _0x4d2ebc=_0x37a288;this[_0x4d2ebc(0x16e)]();for(let _0x2b4898=0x0;_0x2b4898<_0x1af4bd[_0x4d2ebc(0x1a6)];_0x2b4898++){const _0x32a5e9=_0x1af4bd[_0x2b4898],_0x2c8bb3=this[_0x4d2ebc(0x360)]();if(_0x32a5e9[_0x4d2ebc(0x319)]<=_0x2c8bb3)continue;if(_0x32a5e9[_0x4d2ebc(0x319)]>_0x2c8bb3+0x1)return{'missingChangesets':!![]};if(this['_isEchoedAwaitingChangeset'](_0x32a5e9)){this['_acknowledgeAwaiting']();continue;}this[_0x4d2ebc(0x205)](_0x32a5e9),this['_acknowledgeAwaitingIfReady']();}return{'missingChangesets':![]};}[_0x37a288(0x205)](_0xce9fcf){const _0x241619=_0x37a288;let _0x1bd0fc=_0xce9fcf,_0xcb1885=this[_0x241619(0x36c)];if(_0xcb1885){const _0x135105=this[_0x241619(0x37c)][_0x241619(0x21b)]([_0xce9fcf],[_0xcb1885],![]);if(!isTransformChangesetsSuccess(_0x135105))throw _0x135105[_0x241619(0x1cd)];_0x1bd0fc=_0x135105[_0x241619(0x37b)][0x0],_0xcb1885=_0x135105[_0x241619(0x286)][0x0];}let _0x46efbc=this['_pendingMutations'];if(_0x46efbc[_0x241619(0x1a6)]){const _0x1f4899=this[_0x241619(0x37c)]['transformMutationsWithChangeset'](_0x1bd0fc,_0x46efbc);if(!isTransformMutationsWithChangesetSuccess(_0x1f4899))throw _0x1f4899[_0x241619(0x1cd)];_0x1bd0fc=_0x1f4899['c1Prime'],_0x46efbc=_0x1f4899[_0x241619(0x2af)];}this[_0x241619(0x1c5)](_0x1bd0fc);if(_0xcb1885)_0xcb1885[_0x241619(0x26c)]=this[_0x241619(0x360)]();this['_awaitingChangeset']=_0xcb1885,this['_pendingMutations']=_0x46efbc;}[_0x37a288(0x16e)](){const _0x1e2b3b=_0x37a288;if(!this[_0x1e2b3b(0x36c)]||this[_0x1e2b3b(0x22b)]==null)return;const _0x20803f=this[_0x1e2b3b(0x360)]();if(this['_acknowledgedAwaitingRevision']<=_0x20803f)throw new Error(_0x1e2b3b(0x2bb)+this[_0x1e2b3b(0x22b)]+'.');if(this['_acknowledgedAwaitingRevision']===_0x20803f+0x1)this[_0x1e2b3b(0x22a)]();}['_acknowledgeAwaiting'](){const _0x3d05b0=_0x37a288;this[_0x3d05b0(0x258)](),this['_awaitingChangeset']=null,this[_0x3d05b0(0x22b)]=null;}[_0x37a288(0x38d)](_0x245f36){const _0xe7a101=_0x37a288,_0x2683e5=this[_0xe7a101(0x36c)];if(!_0x2683e5)return![];if(!_0x2683e5['sid']||_0x2683e5['reqId']===null||_0x2683e5[_0xe7a101(0x221)]===void 0x0)return![];return _0x245f36[_0xe7a101(0x196)]===_0x2683e5['unitID']&&_0x245f36['sid']===_0x2683e5[_0xe7a101(0x341)]&&_0x245f36[_0xe7a101(0x221)]===_0x2683e5[_0xe7a101(0x221)];}['resend'](){const _0x2881da=_0x37a288;throw new Error(_0x2881da(0x194));}['appendMutation'](_0x29da96){return this['_pendingMutations']['push'](_0x29da96),this;}['onRemoteChangeset'](_0x45830f){const _0x11f762=_0x37a288;return this['_queuedRemoteChangesets'][_0x11f762(0x344)](_0x45830f),this;}['onRemoteAck'](_0x3462b6){const _0x25c5df=_0x37a288;if(this[_0x25c5df(0x36c)]){const _0xf6629=this[_0x25c5df(0x360)]();if(_0x3462b6[_0x25c5df(0x319)]<=_0xf6629)return this;else{if(_0xf6629+0x1===_0x3462b6[_0x25c5df(0x319)])this['_incrementRevisionNumber'](),this[_0x25c5df(0x36c)]=null,this[_0x25c5df(0x22b)]=null;else this[_0x25c5df(0x22b)]=_0x3462b6[_0x25c5df(0x319)];}return this;}if(_0x3462b6[_0x25c5df(0x319)]<=this[_0x25c5df(0x360)]())return this;throw new Error(_0x25c5df(0x1d4));}[_0x37a288(0x298)](_0xc2fd63){const _0x2f40b1=_0x37a288;return this[_0x2f40b1(0x1ac)](!!(_0xc2fd63===null||_0xc2fd63===void 0x0?void 0x0:_0xc2fd63['isPermissionRej']));}[_0x37a288(0x30b)](){return this;}[_0x37a288(0x167)](){const _0x36ad6f=_0x37a288;return this[_0x36ad6f(0x299)][_0x36ad6f(0x21a)](OfflineState,this[_0x36ad6f(0x196)],this[_0x36ad6f(0x2b9)],this[_0x36ad6f(0x36c)],this[_0x36ad6f(0x212)],this[_0x36ad6f(0x297)]);}[_0x37a288(0x225)](){return this;}['_onConflict'](_0x548104){const _0x3ac0c6=_0x37a288;return this[_0x3ac0c6(0x299)][_0x3ac0c6(0x21a)](ConflictState,this[_0x3ac0c6(0x196)],this['type'],this['_awaitingChangeset'],this[_0x3ac0c6(0x212)],this[_0x3ac0c6(0x297)],_0x548104);}};FetchingMissState=__decorate([__decorateParam(0x7,Inject(Injector)),__decorateParam(0x8,Inject(RevisionService)),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,ITransformService),__decorateParam(0xd,Optional(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x584171,_0x3d5fde,_0xbe98d1,_0x425912,_0x1b2b34,_0x434d38){const _0x33ee92=_0x37a288;if(_0x425912&&_0x1b2b34[_0x33ee92(0x1a6)])return _0x584171[_0x33ee92(0x21a)](AwaitingWithPendingState,_0x3d5fde,_0xbe98d1,_0x425912,_0x1b2b34,_0x434d38,void 0x0);if(_0x425912)return _0x584171['createInstance'](AwaitingState,_0x3d5fde,_0xbe98d1,_0x425912,_0x434d38);if(_0x1b2b34['length'])return _0x584171[_0x33ee92(0x21a)](PendingState,_0x3d5fde,_0xbe98d1,_0x1b2b34,_0x434d38);return _0x584171[_0x33ee92(0x21a)](SyncedState,_0x3d5fde,_0xbe98d1,_0x434d38);}let CollaborationEntity=class CollaborationEntity extends RxDisposable{get[_0x37a288(0x309)](){const _0x1de919=_0x37a288;return this[_0x1de919(0x2fc)];}constructor(_0x37f2ed,_0x1cbbf9,_0x37224e,_0x15406c,_0x1fdfe3,_0x1d6dcc,_0x26e14f,_0x50c554,_0x3f5f48,_0x16d08f,_0x5e5a75,_0x53a1e5,_0x337e01,_0x1da79c){const _0x40873a=_0x37a288;super(),this[_0x40873a(0x196)]=_0x37f2ed,this[_0x40873a(0x19c)]=_0x1cbbf9,this[_0x40873a(0x24f)]=_0x37224e,this[_0x40873a(0x299)]=_0x15406c,this[_0x40873a(0x263)]=_0x1fdfe3,this[_0x40873a(0x2bc)]=_0x1d6dcc,this[_0x40873a(0x2c0)]=_0x26e14f,this[_0x40873a(0x2d6)]=_0x50c554,this[_0x40873a(0x229)]=_0x3f5f48,this[_0x40873a(0x270)]=_0x16d08f,this[_0x40873a(0x36d)]=_0x5e5a75,this[_0x40873a(0x348)]=_0x53a1e5,this[_0x40873a(0x1e2)]=_0x337e01,this[_0x40873a(0x2a1)]=_0x1da79c,_defineProperty(this,_0x40873a(0x2d7),new BehaviorSubject(null)),_defineProperty(this,_0x40873a(0x314),this[_0x40873a(0x2d7)][_0x40873a(0x16b)]()),_defineProperty(this,_0x40873a(0x2fc),void 0x0),_defineProperty(this,_0x40873a(0x2fd),![]),_defineProperty(this,_0x40873a(0x310),''),_defineProperty(this,'_changesetReqId',0x0),_defineProperty(this,_0x40873a(0x18b),this[_0x40873a(0x314)][_0x40873a(0x39b)](map(_0x2da50f=>{if(_0x2da50f)return _0x2da50f['status'];return'offline';}),shareReplay(0x1))),_defineProperty(this,_0x40873a(0x2c1),![]),_defineProperty(this,_0x40873a(0x24b),[]);}async[_0x37a288(0x378)](){const _0x25604e=_0x37a288;if(this[_0x25604e(0x309)])throw new Error('[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.');await this[_0x25604e(0x333)]();}[_0x37a288(0x363)](){const _0x16b1f5=_0x37a288;return this[_0x16b1f5(0x2fd)]=!![],toDisposable(()=>{const _0x47f67b=_0x16b1f5;this[_0x47f67b(0x2fd)]=![],this[_0x47f67b(0x241)]();});}[_0x37a288(0x2cf)](_0x532a7f){const _0x4291c1=_0x37a288;this[_0x4291c1(0x1fe)](_0x532a7f);}[_0x37a288(0x1f4)](_0x212cd3){const _0xb2ba03=_0x37a288;this[_0xb2ba03(0x2fc)]=_0x212cd3,this['_state$']['next'](_0x212cd3);}async['_init'](){const _0x48a257=_0x37a288;this[_0x48a257(0x1f4)](await this[_0x48a257(0x181)]());if(this[_0x48a257(0x1e2)]){var _0x5329a4;(_0x5329a4=this[_0x48a257(0x1e2)])===null||_0x5329a4===void 0x0||_0x5329a4['editingUnit'](this[_0x48a257(0x196)]),this[_0x48a257(0x2f4)](this[_0x48a257(0x1e2)]['getUnitStatus$'](this[_0x48a257(0x196)])[_0x48a257(0x2ae)](_0x404207=>{const _0x23085a=_0x48a257;this['_logService'][_0x23085a(0x27b)](_0x23085a(0x1a2),_0x23085a(0x15b),_0x404207),_0x404207===0x1?(this['_eventService']['emitEvent']({'id':_0x23085a(0x327)}),this[_0x23085a(0x348)][_0x23085a(0x2a7)](new WorkbookEditablePermission(this[_0x23085a(0x196)])['id'],![]),this[_0x23085a(0x348)]['setShowComponents'](![])):(this[_0x23085a(0x348)][_0x23085a(0x2a7)](new WorkbookEditablePermission(this[_0x23085a(0x196)])['id'],!![]),this[_0x23085a(0x348)]['setShowComponents'](!![]));}));}let _0x13a004=![];return this['disposeWithMe'](this[_0x48a257(0x19c)][_0x48a257(0x19d)][_0x48a257(0x2ae)](_0x1b97d7=>{const _0x18aa99=_0x48a257;if(_0x1b97d7===0x3)this[_0x18aa99(0x256)](_0x13a004);else _0x1b97d7===0x2&&(_0x13a004=!![],this[_0x18aa99(0x176)]());})),this[_0x48a257(0x2f4)](this['session'][_0x48a257(0x35a)][_0x48a257(0x2ae)](_0x349873=>{const _0x3bb082=_0x48a257;try{switch(_0x349873[_0x3bb082(0x1f3)]){case CollaborationEvent[_0x3bb082(0x20e)]:this[_0x3bb082(0x2d1)](parseProtocolChangeset(_0x349873[_0x3bb082(0x346)]));break;case CollaborationEvent[_0x3bb082(0x1d3)]:this['_onRemoteACK'](_0x349873['data']);break;case CollaborationEvent[_0x3bb082(0x320)]:this[_0x3bb082(0x1f9)]();break;case CollaborationEvent[_0x3bb082(0x259)]:this[_0x3bb082(0x158)](_0x349873[_0x3bb082(0x346)]);break;case CollaborationEvent[_0x3bb082(0x284)]:this['_onFetchMissResult'](_0x349873['data'][_0x3bb082(0x199)][_0x3bb082(0x1f1)](_0x1dc087=>parseProtocolChangeset(_0x1dc087)));break;case CollaborationEvent[_0x3bb082(0x3a0)]:this['_onRemoteRejected']({'isPermissionRej':!![]});break;case CollaborationEvent[_0x3bb082(0x33a)]:break;}}catch(_0x2fda5e){console['error'](_0x3bb082(0x19b),_0x2fda5e);throw _0x2fda5e;}})),this[_0x48a257(0x2fc)];}[_0x37a288(0x15d)](){const _0x5df1d8=_0x37a288;this[_0x5df1d8(0x2c1)]=![];}['_lockTransition'](){const _0x204739=_0x37a288;if(this['_transitionLocked'])throw new Error(_0x204739(0x149));this[_0x204739(0x2c1)]=!![];}[_0x37a288(0x1fe)](_0x1ba702){const _0x395e7c=_0x37a288;this[_0x395e7c(0x2c7)](),this['_updateState'](this['_state']['appendMutation'](_0x1ba702)),this[_0x395e7c(0x15d)]();}['_onRemoteChangeset'](_0x18f9d4){const _0x36c945=_0x37a288;if(_0x18f9d4[_0x36c945(0x319)]<=this[_0x36c945(0x2c0)][_0x36c945(0x1b5)](this[_0x36c945(0x196)]))return;if(this[_0x36c945(0x2fd)]){this[_0x36c945(0x24b)][_0x36c945(0x344)](_0x18f9d4);return;}this[_0x36c945(0x30d)](_0x18f9d4);}[_0x37a288(0x241)](){const _0x4af243=_0x37a288;this[_0x4af243(0x24b)][_0x4af243(0x25e)](_0xafba27=>this[_0x4af243(0x30d)](_0xafba27)),this[_0x4af243(0x24b)]=[];}['_applyRemoteChangeset'](_0x528b90){const _0xa69283=_0x37a288,_0x57d852=this[_0xa69283(0x263)][_0xa69283(0x1d5)][_0xa69283(0x387)](this[_0xa69283(0x263)][_0xa69283(0x1d5)][_0xa69283(0x243)]()['COMPRESS_MUTATION_APPLY'])(_0x528b90[_0xa69283(0x1ef)],null)||_0x528b90['mutations'],_0x548a54={..._0x528b90,'mutations':_0x57d852};this[_0xa69283(0x2c7)](),this['_updateState'](this[_0xa69283(0x2fc)][_0xa69283(0x342)](_0x548a54)),this[_0xa69283(0x15d)]();}[_0x37a288(0x195)](_0x275ff3){const _0x158930=_0x37a288;this[_0x158930(0x2c7)](),this['_updateState'](this[_0x158930(0x2fc)][_0x158930(0x217)](_0x275ff3)),this[_0x158930(0x15d)]();}[_0x37a288(0x1f9)](_0x13084f){const _0x3c332e=_0x37a288;this[_0x3c332e(0x2c7)](),this['_updateState'](this[_0x3c332e(0x2fc)][_0x3c332e(0x298)](_0x13084f)),this[_0x3c332e(0x15d)]();}['_onRemoteRetry'](_0x3cd2cf){const _0x615e64=_0x37a288;this[_0x615e64(0x2c7)](),this[_0x615e64(0x1f4)](this[_0x615e64(0x2fc)][_0x615e64(0x30b)](_0x3cd2cf)),this[_0x615e64(0x15d)]();}[_0x37a288(0x287)](_0x22df4a){const _0xa0c9c2=_0x37a288;if(!(this[_0xa0c9c2(0x2fc)]instanceof FetchingMissState))throw new TypeError('[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!');const _0x56938c=_0x22df4a[_0xa0c9c2(0x1f1)](_0x47a207=>{const _0x4cf41e=_0xa0c9c2,_0x2f77e7=this[_0x4cf41e(0x263)]['interceptor'][_0x4cf41e(0x387)](this[_0x4cf41e(0x263)]['interceptor'][_0x4cf41e(0x243)]()[_0x4cf41e(0x174)])(_0x47a207[_0x4cf41e(0x1ef)],null)||_0x47a207[_0x4cf41e(0x1ef)];return{..._0x47a207,'mutations':_0x2f77e7};});this['_lockTransition'](),this['_updateState'](this[_0xa0c9c2(0x2fc)][_0xa0c9c2(0x373)](_0x56938c)),this[_0xa0c9c2(0x15d)]();}[_0x37a288(0x176)](){const _0x5c1b72=_0x37a288;this[_0x5c1b72(0x2c7)](),this[_0x5c1b72(0x1f4)](this[_0x5c1b72(0x2fc)][_0x5c1b72(0x167)]()),this[_0x5c1b72(0x15d)]();}[_0x37a288(0x256)](_0x2d345e=![]){const _0x3c7126=_0x37a288;this[_0x3c7126(0x2c7)](),this[_0x3c7126(0x1f4)](this[_0x3c7126(0x2fc)][_0x3c7126(0x225)]()),this[_0x3c7126(0x15d)]();const _0x40b470=this[_0x3c7126(0x2fc)];_0x2d345e&&_0x40b470 instanceof SyncedState&&(this['_lockTransition'](),this[_0x3c7126(0x1f4)](_0x40b470[_0x3c7126(0x368)]()),this[_0x3c7126(0x15d)]());}async[_0x37a288(0x181)](){return new Promise(_0x268e74=>{const _0x60ab38=_0x378b;this['session'][_0x60ab38(0x19d)][_0x60ab38(0x39b)](take(0x1))[_0x60ab38(0x2ae)](async _0x5db674=>{const _0x5a7018=_0x60ab38;_0x268e74(await this[_0x5a7018(0x23e)](_0x5db674===0x3));});});}['_createHandler'](){const _0x408732=_0x37a288,_0x426b6d=this[_0x408732(0x196)];return{'onStateChange':(_0x252e80,_0x389f90)=>{const _0x4ed965=_0x408732;if(_0x252e80!==this[_0x4ed965(0x2fc)])throw new Error(_0x4ed965(0x253)+_0x252e80[_0x4ed965(0x2cb)]+_0x4ed965(0x1f6)+_0x389f90['status']+_0x4ed965(0x2dc)+this[_0x4ed965(0x2fc)]['status']);this[_0x4ed965(0x1f4)](_0x389f90);},'onSendChangeset':_0x59c953=>{const _0x8dea17=_0x408732;!_0x59c953[_0x8dea17(0x341)]&&(_0x59c953[_0x8dea17(0x341)]=this[_0x8dea17(0x310)],_0x59c953[_0x8dea17(0x221)]=++this[_0x8dea17(0x2c6)]);const _0x150228={'eventID':CollaborationEvent[_0x8dea17(0x179)],'data':{'unitID':_0x59c953[_0x8dea17(0x196)],'unitType':this[_0x8dea17(0x24f)],'changeset':_0x59c953,'memberID':this[_0x8dea17(0x19c)][_0x8dea17(0x358)]()}};this[_0x8dea17(0x19c)][_0x8dea17(0x316)](_0x150228,this[_0x8dea17(0x196)]);},'onMissingChangesets':({from:_0x1aa496,to:_0x374e39})=>{const _0x539459=_0x408732;this[_0x539459(0x270)][_0x539459(0x27b)](_0x539459(0x1a2),_0x539459(0x173)+_0x1aa496+'\x20to\x20'+_0x374e39);const _0x4d8239={'eventID':CollaborationEvent['FETCH_MISSING'],'data':{'unitID':_0x426b6d,'unitType':this[_0x539459(0x24f)],'from':_0x1aa496,'to':_0x374e39}};this['session'][_0x539459(0x316)](_0x4d8239,this[_0x539459(0x196)]);}};}async[_0x37a288(0x23e)](_0x577169){const _0x22ee07=_0x37a288;var _0x17837a,_0x24b429,_0x5538bf;const _0x341600=await((_0x17837a=this['_localCacheService'])===null||_0x17837a===void 0x0?void 0x0:_0x17837a[_0x22ee07(0x395)](this[_0x22ee07(0x196)])),_0x5e08a5=(_0x24b429=_0x341600===null||_0x341600===void 0x0?void 0x0:_0x341600[_0x22ee07(0x1ef)])!==null&&_0x24b429!==void 0x0?_0x24b429:[],_0x46fb66=(_0x5538bf=_0x341600===null||_0x341600===void 0x0?void 0x0:_0x341600[_0x22ee07(0x2b2)])!==null&&_0x5538bf!==void 0x0?_0x5538bf:null,_0x3eb1ea=!!(_0x46fb66===null||_0x46fb66===void 0x0?void 0x0:_0x46fb66['sid'])&&!!(_0x46fb66===null||_0x46fb66===void 0x0?void 0x0:_0x46fb66[_0x22ee07(0x221)]);this['_changesetSessionId']=_0x3eb1ea?_0x46fb66[_0x22ee07(0x341)]:uuidv4(),this[_0x22ee07(0x2c6)]=_0x3eb1ea?_0x46fb66[_0x22ee07(0x221)]:0x0;const _0x3ca235=this[_0x22ee07(0x196)];try{this[_0x22ee07(0x2d9)](_0x46fb66,_0x5e08a5);}catch(_0x5602f4){this[_0x22ee07(0x270)]['error'](_0x5602f4);}const _0x175ea4=this[_0x22ee07(0x14d)]();if(_0x577169){const _0x354f14=createOnlineState(this[_0x22ee07(0x299)],_0x3ca235,this[_0x22ee07(0x24f)],_0x46fb66,_0x5e08a5,_0x175ea4);if(_0x354f14 instanceof PendingState)_0x354f14[_0x22ee07(0x36e)]();else{if(_0x354f14 instanceof AwaitingWithPendingState||_0x354f14 instanceof AwaitingState)_0x354f14[_0x22ee07(0x2d5)]();}return _0x354f14;}return this[_0x22ee07(0x299)][_0x22ee07(0x21a)](OfflineState,_0x3ca235,this[_0x22ee07(0x24f)],_0x46fb66,_0x5e08a5,_0x175ea4);}['_replayCachedMutations'](_0x83d967,_0x59dcc0){const _0x3cf84f=_0x37a288;var _0x499c5d,_0x49e4d1;const _0x2a134c=this[_0x3cf84f(0x263)][_0x3cf84f(0x1d5)][_0x3cf84f(0x387)](this[_0x3cf84f(0x263)][_0x3cf84f(0x1d5)]['getInterceptPoints']()['COMPRESS_MUTATION_APPLY']);(_0x499c5d=_0x2a134c((_0x83d967===null||_0x83d967===void 0x0?void 0x0:_0x83d967[_0x3cf84f(0x1ef)])||[],null))===null||_0x499c5d===void 0x0||_0x499c5d['forEach'](_0x1df1de=>this['_commandService'][_0x3cf84f(0x246)](_0x1df1de['id'],_0x1df1de[_0x3cf84f(0x2eb)])),(_0x49e4d1=_0x2a134c(_0x59dcc0||[],null))===null||_0x49e4d1===void 0x0||_0x49e4d1[_0x3cf84f(0x25e)](_0x34b1f9=>this[_0x3cf84f(0x36d)][_0x3cf84f(0x246)](_0x34b1f9['id'],_0x34b1f9[_0x3cf84f(0x2eb)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x2d5fdb,_0x9210d,_0x42dab0,_0x2d5408,_0x2aab84,_0x1acb6d,_0x4ebfc6,_0x444429,_0x56bd61,_0x2df3fa,_0xe73b91,_0x4f5064,_0x3ea458,_0x21c9f7){const _0x3d4fac=_0x37a288;super(_0x2d5fdb,_0x42dab0,_0x9210d,_0x2d5408,_0x2aab84,_0x1acb6d,_0x4ebfc6,_0x444429,_0x56bd61,_0x2df3fa,_0xe73b91,_0x4f5064,_0x3ea458,_0x21c9f7),this['unitID']=_0x2d5fdb,this[_0x3d4fac(0x2b9)]=_0x9210d,_defineProperty(this,_0x3d4fac(0x20d),null);}['addHandlerCallback'](_0x4dc8ae){this['_handlerCallback']=_0x4dc8ae;}[_0x37a288(0x16a)](){const _0x2be447=_0x37a288;this[_0x2be447(0x20d)]=null,super[_0x2be447(0x16a)]();}['_createHandler'](){const _0x4c0be7=_0x37a288,_0x3a70fa=super['_createHandler']();return _0x3a70fa[_0x4c0be7(0x33e)]=_0xe641ce=>{const _0x34874a=_0x4c0be7;var _0x5cf5dc,_0x6f4108;return(_0x5cf5dc=this[_0x34874a(0x20d)])===null||_0x5cf5dc===void 0x0||(_0x6f4108=_0x5cf5dc[_0x34874a(0x33e)])===null||_0x6f4108===void 0x0?void 0x0:_0x6f4108[_0x34874a(0x2b8)](_0x5cf5dc,_0xe641ce);},_0x3a70fa['onTransformState']=_0xd8138d=>{const _0x447d07=_0x4c0be7;var _0x5abc25,_0x5f3bb8;return(_0x5abc25=this[_0x447d07(0x20d)])===null||_0x5abc25===void 0x0||(_0x5f3bb8=_0x5abc25['onTransformState'])===null||_0x5f3bb8===void 0x0?void 0x0:_0x5f3bb8[_0x447d07(0x2b8)](_0x5abc25,_0xd8138d);},_0x3a70fa['onTransformSelections']=_0x4a4597=>{const _0x2b5c1a=_0x4c0be7;var _0x349e1a,_0x11413c;return(_0x349e1a=this['_handlerCallback'])===null||_0x349e1a===void 0x0||(_0x11413c=_0x349e1a[_0x2b5c1a(0x371)])===null||_0x11413c===void 0x0?void 0x0:_0x11413c[_0x2b5c1a(0x2b8)](_0x349e1a,_0x4a4597);},_0x3a70fa['onSyncEditingCollabCursor']=_0x9b4b1e=>{const _0x50730d=_0x4c0be7;var _0x2b8b63,_0x553ae0;return(_0x2b8b63=this[_0x50730d(0x20d)])===null||_0x2b8b63===void 0x0||(_0x553ae0=_0x2b8b63['onSyncEditingCollabCursor'])===null||_0x553ae0===void 0x0?void 0x0:_0x553ae0['call'](_0x2b8b63,_0x9b4b1e);},_0x3a70fa['onTransformRemoteChangesetByIMECache']=_0x5f4718=>{const _0x153174=_0x4c0be7;var _0x16f374,_0x4d4a3c,_0x364cf0;if(!((_0x16f374=this['_handlerCallback'])===null||_0x16f374===void 0x0?void 0x0:_0x16f374[_0x153174(0x148)]))throw new Error(_0x153174(0x15c));return(_0x4d4a3c=this[_0x153174(0x20d)])===null||_0x4d4a3c===void 0x0||(_0x364cf0=_0x4d4a3c[_0x153174(0x148)])===null||_0x364cf0===void 0x0?void 0x0:_0x364cf0[_0x153174(0x2b8)](_0x4d4a3c,_0x5f4718);},_0x3a70fa[_0x4c0be7(0x280)]=_0x1e93bf=>{const _0x4dca96=_0x4c0be7;var _0x3bedcc,_0x51d0e2,_0x4d100c;if(!((_0x3bedcc=this['_handlerCallback'])===null||_0x3bedcc===void 0x0?void 0x0:_0x3bedcc[_0x4dca96(0x280)]))throw new Error(_0x4dca96(0x2f2));return(_0x51d0e2=this['_handlerCallback'])===null||_0x51d0e2===void 0x0||(_0x4d100c=_0x51d0e2[_0x4dca96(0x280)])===null||_0x4d100c===void 0x0?void 0x0:_0x4d100c[_0x4dca96(0x2b8)](_0x51d0e2,_0x1e93bf);},_0x3a70fa;}async['_init'](){const _0x855d0d=_0x37a288,_0xb20d17=await super['_init']();return this[_0x855d0d(0x2f4)](this[_0x855d0d(0x36d)][_0x855d0d(0x1a7)]((_0x4327ca,_0x2b9c67)=>{const _0x1fad8b=_0x855d0d;if(_0x4327ca[_0x1fad8b(0x2b9)]!==CommandType[_0x1fad8b(0x1dc)]||(_0x2b9c67===null||_0x2b9c67===void 0x0?void 0x0:_0x2b9c67[_0x1fad8b(0x2be)])||(_0x2b9c67===null||_0x2b9c67===void 0x0?void 0x0:_0x2b9c67['onlyLocal']))return;if(_0x4327ca['id']===RichTextEditingMutation['id'])return;const _0xd3ea0f=_0x4327ca[_0x1fad8b(0x2eb)];if((_0xd3ea0f===null||_0xd3ea0f===void 0x0?void 0x0:_0xd3ea0f[_0x1fad8b(0x17e)])!==this[_0x1fad8b(0x196)])return;const _0x4f8587=_0x4327ca,_0x56ca95=this[_0x1fad8b(0x263)][_0x1fad8b(0x1d5)][_0x1fad8b(0x387)](this[_0x1fad8b(0x263)][_0x1fad8b(0x1d5)]['getInterceptPoints']()[_0x1fad8b(0x355)])([_0x4f8587],this[_0x1fad8b(0x229)])||[_0x4f8587];this[_0x1fad8b(0x1fe)](_0x56ca95[0x0]);})),_0xb20d17;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],DocCollaborationEntity);let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x413562,_0x2f7604,_0x292bfd,_0x3cfac1,_0x25e287,_0x5aa605,_0x38533c,_0x307812,_0x26f3c1,_0x164205,_0x17fc38,_0x45b59b,_0x1e7e10,_0x35eaa7,_0x3409c7){const _0x11476f=_0x37a288;super(_0x413562,_0x292bfd,_0x2f7604,_0x3cfac1,_0x25e287,_0x5aa605,_0x38533c,_0x26f3c1,_0x164205,_0x17fc38,_0x45b59b,_0x1e7e10,_0x35eaa7,_0x3409c7),this[_0x11476f(0x196)]=_0x413562,this[_0x11476f(0x2b9)]=_0x2f7604,this[_0x11476f(0x2df)]=_0x307812;}[_0x37a288(0x14d)](){const _0x3f048b=_0x37a288,_0x4dfaab=super[_0x3f048b(0x14d)]();return _0x4dfaab[_0x3f048b(0x371)]=_0x155a7d=>this[_0x3f048b(0x2df)][_0x3f048b(0x325)](_0x155a7d),_0x4dfaab;}async[_0x37a288(0x333)](){const _0x3ec712=_0x37a288,_0x2c2039=await super[_0x3ec712(0x333)]();return this[_0x3ec712(0x2f4)](this[_0x3ec712(0x36d)]['onMutationExecutedForCollab']((_0xd6147,_0x326c2e)=>{const _0x5a4511=_0x3ec712;if(_0xd6147[_0x5a4511(0x2b9)]!==CommandType['MUTATION']||(_0x326c2e===null||_0x326c2e===void 0x0?void 0x0:_0x326c2e['fromCollab'])||(_0x326c2e===null||_0x326c2e===void 0x0?void 0x0:_0x326c2e['onlyLocal']))return;const _0x145fa7=_0xd6147[_0x5a4511(0x2eb)];if((_0x145fa7===null||_0x145fa7===void 0x0?void 0x0:_0x145fa7[_0x5a4511(0x17e)])!==this[_0x5a4511(0x196)])return;const _0xea1aa5=_0xd6147,_0x38725e=this[_0x5a4511(0x263)][_0x5a4511(0x1d5)][_0x5a4511(0x387)](this[_0x5a4511(0x263)][_0x5a4511(0x1d5)]['getInterceptPoints']()[_0x5a4511(0x355)])([_0xea1aa5],this[_0x5a4511(0x229)])||[_0xea1aa5];this['_onLocalMutation'](_0x38725e[0x0]);})),_0x2c2039;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(SheetTransformSelectionsService)),__decorateParam(0x8,Inject(CollaborationUIEventService)),__decorateParam(0x9,IUniverInstanceService),__decorateParam(0xa,ILogService),__decorateParam(0xb,ICommandService),__decorateParam(0xc,IPermissionService),__decorateParam(0xd,Optional(ISingleActiveUnitService)),__decorateParam(0xe,Optional(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=createIdentifier('univer-pro.collaboration-client.network-condition.service');function deserializeToCombResponse(_0xa67b2c){const _0x24eb80=_0x37a288,_0x48fe96=_0xa67b2c[_0x24eb80(0x346)],_0x307861=JSON['parse'](_0x48fe96);switch(_0x307861[_0x24eb80(0x301)]){case CombCmd[_0x24eb80(0x19e)]:case CombCmd[_0x24eb80(0x189)]:{const _0x2e059a=_0x307861[_0x24eb80(0x162)];return{..._0x307861,'data':_0x2e059a,'cmd':_0x307861[_0x24eb80(0x301)]};}case CombCmd[_0x24eb80(0x22e)]:{const _0x3da5a8=_0x307861[_0x24eb80(0x273)];return{..._0x307861,'data':_0x3da5a8,'cmd':_0x307861['cmd']};}case CombCmd[_0x24eb80(0x156)]:{const _0x572e04=_0x307861['collaMsg'];switch(_0x572e04[_0x24eb80(0x1f3)]){case CollaborationEvent[_0x24eb80(0x3a0)]:var _0x5a96eb;return{..._0x307861,'data':{..._0x572e04,'data':(_0x5a96eb=_0x572e04[_0x24eb80(0x1eb)])===null||_0x5a96eb===void 0x0?void 0x0:_0x5a96eb['cs']},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x1d3)]:var _0x1a3bfe;return{..._0x307861,'data':{..._0x572e04,'data':(_0x1a3bfe=_0x572e04[_0x24eb80(0x2cc)])===null||_0x1a3bfe===void 0x0?void 0x0:_0x1a3bfe['cs']},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x20e)]:var _0x595930;return{..._0x307861,'data':{..._0x572e04,'data':(_0x595930=_0x572e04['newCsEvent'])===null||_0x595930===void 0x0?void 0x0:_0x595930['cs']},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x320)]:var _0x3d5c6c;return{..._0x307861,'data':{..._0x572e04,'data':(_0x3d5c6c=_0x572e04['csRejEvent'])===null||_0x3d5c6c===void 0x0?void 0x0:_0x3d5c6c['cs']},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x259)]:var _0x1b63b6;return{..._0x307861,'data':{..._0x572e04,'data':(_0x1b63b6=_0x572e04[_0x24eb80(0x385)])===null||_0x1b63b6===void 0x0?void 0x0:_0x1b63b6['cs']},'cmd':_0x307861['cmd']};case CollaborationEvent[_0x24eb80(0x31a)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x33c)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x2b3)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x1b3)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x32f)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x334)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x214)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x201)]},'cmd':_0x307861['cmd']};case CollaborationEvent['LIVESHARE_FETCH_OPERATIONS']:case CollaborationEvent['LIVESHARE_OPERATION']:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x21d)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent['LIVESHARE_TERMINATE']:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x201)]},'cmd':_0x307861['cmd']};case CollaborationEvent[_0x24eb80(0x245)]:return{..._0x307861,'data':_0x572e04,'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x36a)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x240)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x282)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x27c)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x2d3)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04[_0x24eb80(0x2e6)]},'cmd':_0x307861[_0x24eb80(0x301)]};case CollaborationEvent[_0x24eb80(0x33a)]:return{..._0x307861,'data':{..._0x572e04,'data':_0x572e04['uniscriptRunEvent']},'cmd':_0x307861['cmd']};default:return _0x307861;}}default:return _0x307861;}}function serializeCombRequest(_0x31fb2c){const _0x38a0b0=_0x37a288;switch(_0x31fb2c['cmd']){case CombCmd[_0x38a0b0(0x19e)]:case CombCmd['HELLO']:return JSON[_0x38a0b0(0x24a)]({'cmd':_0x31fb2c['cmd'],'routeKey':_0x31fb2c[_0x38a0b0(0x304)]});case CombCmd[_0x38a0b0(0x1c6)]:{let _0x68b8ae;switch(_0x31fb2c[_0x38a0b0(0x346)][_0x38a0b0(0x1f3)]){case CollaborationEvent['UPDATE_CURSOR']:_0x68b8ae={'eventID':CollaborationEvent[_0x38a0b0(0x31a)],'updateCursorEvent':_0x31fb2c['data']['data']};break;case CollaborationEvent[_0x38a0b0(0x32f)]:_0x68b8ae={'eventID':CollaborationEvent['USERS_LEAVE'],'leaveEvent':_0x31fb2c[_0x38a0b0(0x346)]['data']};break;case CollaborationEvent[_0x38a0b0(0x2b3)]:_0x68b8ae={'eventID':CollaborationEvent[_0x38a0b0(0x2b3)],'joinEvent':_0x31fb2c[_0x38a0b0(0x346)][_0x38a0b0(0x346)]};break;case CollaborationEvent[_0x38a0b0(0x214)]:_0x68b8ae={'eventID':CollaborationEvent[_0x38a0b0(0x214)],'liveShareNewHost':_0x31fb2c[_0x38a0b0(0x346)]['data']};break;case CollaborationEvent[_0x38a0b0(0x168)]:_0x68b8ae={'eventID':CollaborationEvent[_0x38a0b0(0x168)],'liveShareOperation':_0x31fb2c[_0x38a0b0(0x346)][_0x38a0b0(0x346)]};break;case CollaborationEvent[_0x38a0b0(0x20a)]:_0x68b8ae={'eventID':CollaborationEvent['LIVESHARE_TERMINATE'],'liveShareTerminate':_0x31fb2c[_0x38a0b0(0x346)][_0x38a0b0(0x346)]};break;case CollaborationEvent['LIVESHARE_REQUEST_HOST']:_0x68b8ae={'eventID':CollaborationEvent['LIVESHARE_REQUEST_HOST'],'liveShareRequestHost':_0x31fb2c[_0x38a0b0(0x346)][_0x38a0b0(0x346)]};break;case CollaborationEvent[_0x38a0b0(0x27a)]:_0x68b8ae={'eventID':CollaborationEvent['LIVESHARE_FETCH_OPERATIONS']};break;default:_0x68b8ae={'eventID':_0x31fb2c[_0x38a0b0(0x346)][_0x38a0b0(0x1f3)]};}return JSON[_0x38a0b0(0x24a)]({'cmd':_0x31fb2c[_0x38a0b0(0x301)],'routeKey':_0x31fb2c[_0x38a0b0(0x304)],'collaMsg':_0x68b8ae});}case CombCmd['JOIN']:return JSON[_0x38a0b0(0x24a)]({'cmd':_0x31fb2c[_0x38a0b0(0x301)],'routeKey':_0x31fb2c['routeKey'],'joinReq':_0x31fb2c[_0x38a0b0(0x346)]});case CombCmd[_0x38a0b0(0x160)]:return JSON[_0x38a0b0(0x24a)]({'cmd':_0x31fb2c['cmd'],'routeKey':_0x31fb2c[_0x38a0b0(0x304)],'leaveReq':_0x31fb2c[_0x38a0b0(0x346)]});default:throw new Error(_0x38a0b0(0x394));}}const ICollaborationSocketService=createIdentifier(_0x37a288(0x1b9));function generateSubmitChangesPath(_0x3f92f4,_0x33b46f,_0x1652d3){const _0x508c15=_0x37a288;return _0x3f92f4+'/'+_0x33b46f+_0x508c15(0x34c)+_0x1652d3+'/new_changes';}let CollaborationSocketService=class CollaborationSocketService extends Disposable{constructor(_0x5f22b7,_0x9b7dc9,_0x1b61d,_0x56d45d,_0x17b32e){const _0x62bdf2=_0x37a288;super(),this[_0x62bdf2(0x299)]=_0x5f22b7,this[_0x62bdf2(0x232)]=_0x9b7dc9,this['_configService']=_0x1b61d,this[_0x62bdf2(0x270)]=_0x56d45d,this[_0x62bdf2(0x313)]=_0x17b32e;}['_doCreateSocket'](_0x45cf8d){const _0x3780f1=_0x37a288,_0x14aee1=this[_0x3780f1(0x299)]['get'](ISocketService);if(!_0x14aee1)throw new Error('[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!');const _0x65f84d=_0x14aee1['createSocket'](_0x45cf8d);if(!_0x65f84d)throw new Error(_0x3780f1(0x329));const _0x36a95d=new DisposableCollection(),_0x194be3=new Subject();_0x36a95d[_0x3780f1(0x36f)](_0x65f84d[_0x3780f1(0x323)]['subscribe'](_0x1eca95=>_0x194be3[_0x3780f1(0x1b0)](_0x1eca95))),_0x36a95d[_0x3780f1(0x36f)](toDisposable(()=>_0x194be3['complete']()));const _0x5d5ac4=new Subject();_0x36a95d[_0x3780f1(0x36f)](_0x65f84d[_0x3780f1(0x1ba)][_0x3780f1(0x2ae)](_0x559620=>_0x5d5ac4[_0x3780f1(0x1b0)](_0x559620))),_0x36a95d[_0x3780f1(0x36f)](toDisposable(()=>_0x5d5ac4[_0x3780f1(0x39e)]()));const _0x3b59bc=new Subject();_0x36a95d['add'](_0x65f84d[_0x3780f1(0x250)][_0x3780f1(0x2ae)](_0xa6afff=>{const _0x3f2885=deserializeToCombResponse(_0xa6afff);_0x3b59bc['next'](_0x3f2885);})),_0x36a95d[_0x3780f1(0x36f)](toDisposable(()=>_0x3b59bc[_0x3780f1(0x39e)]()));let _0xf66f70;const _0x4ed5e6=()=>{const _0x3c91ce=_0x3780f1;_0x5d5ac4['next'](new Event(_0x3c91ce(0x1c8))),_0x194be3[_0x3c91ce(0x1b0)](new Event(_0x3c91ce(0x1c8))),_0xf66f70['close']();};return _0xf66f70={'memberID':'','close$':_0x194be3[_0x3780f1(0x16b)](),'error$':_0x5d5ac4['asObservable'](),'open$':_0x65f84d[_0x3780f1(0x34a)],'message$':_0x3b59bc[_0x3780f1(0x16b)](),'send':_0x310594=>{const _0x176a23=_0x3780f1;if(_0x310594[_0x176a23(0x301)]===CombCmd[_0x176a23(0x1c6)]){if(_0x310594[_0x176a23(0x346)]['eventID']===CollaborationEvent['SUBMIT_CHANGESET']){this['_submitChangeset'](_0xf66f70,_0x310594[_0x176a23(0x346)])[_0x176a23(0x34e)](_0x4bc1db=>{const _0x51131c=_0x176a23;this[_0x51131c(0x270)]['error'](_0x4bc1db),_0x4ed5e6();});return;}if(_0x310594[_0x176a23(0x346)][_0x176a23(0x1f3)]===CollaborationEvent[_0x176a23(0x1a8)]){const _0x1d257d=_0x310594[_0x176a23(0x346)];this['_fetchMissChangesets'](_0x1d257d)[_0x176a23(0x3af)](_0x782e67=>{const _0xa6663=_0x176a23;_0x3b59bc['next']({'cmd':CombCmd[_0xa6663(0x156)],'code':CmdRspCode['OK'],'routeKey':_0x1d257d[_0xa6663(0x346)][_0xa6663(0x196)],'routeType':'','data':{'eventID':CollaborationEvent['PSEUDO_FETCH_MISSING_RESULT'],'data':{'changesets':_0x782e67}}});})[_0x176a23(0x34e)](_0x217170=>{const _0x35b7ab=_0x176a23;this[_0x35b7ab(0x270)]['error'](_0x217170),_0x4ed5e6();});return;}}_0x65f84d[_0x176a23(0x316)](serializeCombRequest(_0x310594));},'close':()=>{const _0xcd9e2=_0x3780f1;_0x65f84d[_0xcd9e2(0x2e5)](),_0x36a95d[_0xcd9e2(0x16a)]();}},_0xf66f70;}async[_0x37a288(0x370)](_0x2666c0,_0x313446){const _0x474140=_0x37a288;var _0x2f7184;const {unitType:_0xbb6522,unitID:_0x4429d7,changeset:_0x5e1fe7}=_0x313446['data'],_0x521d32={'unitID':_0x4429d7,'memberID':_0x2666c0[_0x474140(0x32d)],'type':_0xbb6522,'changeset':parseChangesetToProtocol(_0x5e1fe7)},_0xb75db=this[_0x474140(0x1ec)][_0x474140(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x1a759b=generateSubmitChangesPath((_0x2f7184=_0xb75db===null||_0xb75db===void 0x0?void 0x0:_0xb75db[_0x474140(0x277)])!==null&&_0x2f7184!==void 0x0?_0x2f7184:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0xbb6522,_0x4429d7);try{await this[_0x474140(0x232)][_0x474140(0x2bf)](_0x1a759b,{'body':_0x521d32});}catch(_0x397b9f){this[_0x474140(0x270)]['error'](_0x474140(0x2bd),_0x474140(0x338));throw _0x397b9f;}}async[_0x37a288(0x18d)](_0x59e16e){const _0x2b1cdc=_0x37a288,{unitID:_0x398ea6,from:_0x49c1a5,to:_0x2f4111,unitType:_0x1b9767}=_0x59e16e[_0x2b1cdc(0x346)];return(await this[_0x2b1cdc(0x313)][_0x2b1cdc(0x1d6)]({'metadata':void 0x0},{'unitID':_0x398ea6,'type':_0x1b9767,'from':_0x49c1a5,'to':_0x2f4111}))['changesets'][_0x2b1cdc(0x1f1)](_0x5a5c4d=>{const _0x58f9a4=_0x2b1cdc;if(_0x5a5c4d[_0x58f9a4(0x1ef)]===null||_0x5a5c4d['mutations']===void 0x0)_0x5a5c4d[_0x58f9a4(0x1ef)]=[];return _0x5a5c4d;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ILogService),__decorateParam(0x4,ISnapshotServerService)],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends Disposable{get['_socket'](){const _0x2556ba=_0x37a288;return this[_0x2556ba(0x216)][_0x2556ba(0x30f)]();}constructor(_0xf1e11a,_0x40c186,_0x690b45,_0x33f015,_0x5e8705,_0x175959){const _0xbb6287=_0x37a288;super(),this[_0xbb6287(0x299)]=_0xf1e11a,this[_0xbb6287(0x270)]=_0x40c186,this[_0xbb6287(0x1ec)]=_0x690b45,this['_socketService']=_0x33f015,this['_collaborationUIEventService']=_0x5e8705,this['_networkConditionService']=_0x175959,_defineProperty(this,'_socket$',new BehaviorSubject(void 0x0)),_defineProperty(this,_0xbb6287(0x26e),this[_0xbb6287(0x216)][_0xbb6287(0x16b)]()),_defineProperty(this,_0xbb6287(0x2e9),null),_defineProperty(this,_0xbb6287(0x28e),new Map()),_defineProperty(this,_0xbb6287(0x347),new BehaviorSubject(0x0)),_defineProperty(this,_0xbb6287(0x18b),this[_0xbb6287(0x347)][_0xbb6287(0x16b)]()),_defineProperty(this,'_socketReady',![]),_defineProperty(this,_0xbb6287(0x1bd),void 0x0),_defineProperty(this,'_retryCount',0x0),_defineProperty(this,'_sendHeartbeatTimer',void 0x0),_defineProperty(this,_0xbb6287(0x2c9),void 0x0),this[_0xbb6287(0x28b)]();}[_0x37a288(0x28b)](){const _0x5a63fd=_0x37a288;if(!this[_0x5a63fd(0x351)])return;this[_0x5a63fd(0x2f4)](this[_0x5a63fd(0x351)][_0x5a63fd(0x37a)]['subscribe'](_0x321a47=>{const _0x146e81=_0x5a63fd;if(_0x321a47&&!this[_0x146e81(0x1c7)])this['reconnect']();if(!_0x321a47)this['_onOffline']();}));}['dispose'](){const _0x27cf0d=_0x37a288;super[_0x27cf0d(0x16a)](),this[_0x27cf0d(0x2c8)](),this[_0x27cf0d(0x33b)](),this[_0x27cf0d(0x248)](),this['_sessions'][_0x27cf0d(0x25e)](_0x539b9f=>_0x539b9f['dispose']()),this['_sessions'][_0x27cf0d(0x2fe)](),this[_0x27cf0d(0x347)][_0x27cf0d(0x39e)]();}async[_0x37a288(0x226)](_0x1d2457){const _0x270640=_0x37a288;if(this[_0x270640(0x28e)][_0x270640(0x315)](_0x1d2457))return this[_0x270640(0x28e)]['get'](_0x1d2457);this[_0x270640(0x21c)]();const _0x427ce4=this[_0x270640(0x299)]['createInstance'](CollaborationSession,_0x1d2457,this[_0x270640(0x216)][_0x270640(0x16b)]());return this[_0x270640(0x28e)][_0x270640(0x2c4)](_0x1d2457,_0x427ce4),_0x427ce4;}[_0x37a288(0x1de)](_0x261c7){const _0x221eff=_0x37a288,_0x59de4f=this[_0x221eff(0x28e)][_0x221eff(0x213)](_0x261c7);_0x59de4f&&(this[_0x221eff(0x28e)][_0x221eff(0x377)](_0x261c7),_0x59de4f[_0x221eff(0x2e5)]());if(!this[_0x221eff(0x28e)][_0x221eff(0x235)]){var _0x239ca4;(_0x239ca4=this[_0x221eff(0x1c7)])===null||_0x239ca4===void 0x0||_0x239ca4['close']();}}[_0x37a288(0x1d7)](){const _0x1d8422=_0x37a288;this[_0x1d8422(0x2d4)]=0x0,this[_0x1d8422(0x2c8)](),this['_tryReconnect']();}[_0x37a288(0x2c8)](){const _0xfda6f9=_0x37a288;this[_0xfda6f9(0x1bd)]!=null&&(clearTimeout(this[_0xfda6f9(0x1bd)]),this[_0xfda6f9(0x1bd)]=null);}async[_0x37a288(0x2f1)](){const _0x5c21b3=_0x37a288;var _0x5d6176;const _0x3221c6=this[_0x5c21b3(0x1ec)][_0x5c21b3(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x60c84=(_0x5d6176=_0x3221c6===null||_0x3221c6===void 0x0?void 0x0:_0x3221c6['collabWebSocketUrl'])!==null&&_0x5d6176!==void 0x0?_0x5d6176:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x300c78=await this[_0x5c21b3(0x350)][_0x5c21b3(0x2ad)](_0x60c84);return this[_0x5c21b3(0x2e9)]=_0x300c78,_0x300c78;}async[_0x37a288(0x21c)](){const _0x381f88=_0x37a288;try{var _0x52f945,_0x14e876;const _0x2d41b0=(_0x52f945=(_0x14e876=this[_0x381f88(0x1c7)])!==null&&_0x14e876!==void 0x0?_0x14e876:this[_0x381f88(0x2e9)])!==null&&_0x52f945!==void 0x0?_0x52f945:await this[_0x381f88(0x2f1)]();if(_0x2d41b0){const _0x239187=_0x2d41b0['send'];_0x2d41b0['send']=_0x36724a=>{const _0x57f776=_0x381f88;if(_0x36724a[_0x57f776(0x301)]!==CombCmd[_0x57f776(0x160)])this[_0x57f776(0x192)]();return _0x239187[_0x57f776(0x220)](_0x2d41b0,[_0x36724a]);},_0x2d41b0[_0x381f88(0x250)][_0x381f88(0x2ae)](_0x170c23=>this[_0x381f88(0x335)](_0x2d41b0,_0x170c23)),_0x2d41b0['error$']['pipe'](_0x8aa908(0x1))[_0x381f88(0x2ae)](_0x1ab9aa=>this[_0x381f88(0x270)][_0x381f88(0x1cd)]('[CollaborationSessionService]:\x20socket\x20error',_0x1ab9aa)),_0x2d41b0[_0x381f88(0x34a)][_0x381f88(0x39b)](_0x8aa908(0x1))[_0x381f88(0x2ae)](()=>{const _0x6a68be=_0x381f88;this[_0x6a68be(0x38f)](_0x2d41b0);}),_0x2d41b0[_0x381f88(0x323)]['pipe'](_0x8aa908(0x1))[_0x381f88(0x2ae)](_0xbedb1c=>{const _0x33481a=_0x381f88;this[_0x33481a(0x270)][_0x33481a(0x27b)]('[CollaborationSessionService]',_0x33481a(0x211),_0xbedb1c),this[_0x33481a(0x236)]();});}}catch(_0x4fa2f9){this['_logService'][_0x381f88(0x1cd)](_0x4fa2f9),this[_0x381f88(0x236)]();}}['_onConnectionOpen'](_0x16cd94){const _0x417372=_0x37a288;this[_0x417372(0x270)][_0x417372(0x27b)](_0x417372(0x2a8),_0x417372(0x22f)),_0x16cd94['send']({'cmd':CombCmd[_0x417372(0x189)]}),this[_0x417372(0x192)]();}['_onOffline'](){const _0x38b179=_0x37a288;this[_0x38b179(0x305)]=![],this[_0x38b179(0x2e9)]=null,this[_0x38b179(0x347)][_0x38b179(0x1b0)](0x2),this[_0x38b179(0x216)][_0x38b179(0x1b0)](null),this['_clearTimeoutTimer'](),this['_clearHeartbeatTimer']();}[_0x37a288(0x236)](){const _0x1fa727=_0x37a288;var _0x50069f;this[_0x1fa727(0x303)]();if(this['_retryCount']<((_0x50069f=this[_0x1fa727(0x1ec)]['getConfig'](_0x1fa727(0x288)))!==null&&_0x50069f!==void 0x0?_0x50069f:0x3))this[_0x1fa727(0x1e4)][_0x1fa727(0x294)]({'id':_0x1fa727(0x1f7)}),this[_0x1fa727(0x1c2)]();else this[_0x1fa727(0x1e4)][_0x1fa727(0x294)]({'id':_0x1fa727(0x388)});}['_tryReconnect'](){const _0xcd1be8=_0x37a288;var _0x4cd6b5;const _0x72abca=this[_0xcd1be8(0x2d4)],_0x1dd7df=this[_0xcd1be8(0x1ec)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x2a6621=_0x72abca===0x0?0x0:((_0x4cd6b5=_0x1dd7df===null||_0x1dd7df===void 0x0?void 0x0:_0x1dd7df['retryConnectingInterval'])!==null&&_0x4cd6b5!==void 0x0?_0x4cd6b5:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x72abca;this[_0xcd1be8(0x1bd)]=setTimeout(()=>{const _0x54f995=_0xcd1be8;clearTimeout(this['_retryConnectingTimer']),this[_0x54f995(0x1bd)]=null,this[_0x54f995(0x21c)]();},_0x2a6621),this[_0xcd1be8(0x2d4)]+=0x1;}[_0x37a288(0x335)](_0x3c68ed,_0x3ee9fa){const _0x34f8c8=_0x37a288,{cmd:_0x134ea6}=_0x3ee9fa;_0x134ea6===CombCmd[_0x34f8c8(0x189)]&&!this[_0x34f8c8(0x305)]&&(_0x3c68ed[_0x34f8c8(0x32d)]=_0x3ee9fa[_0x34f8c8(0x346)][_0x34f8c8(0x32d)],this[_0x34f8c8(0x216)][_0x34f8c8(0x1b0)](_0x3c68ed),this[_0x34f8c8(0x347)][_0x34f8c8(0x1b0)](0x3),this[_0x34f8c8(0x305)]=!![],this[_0x34f8c8(0x2e9)]=null);if(_0x134ea6===CombCmd[_0x34f8c8(0x19e)])this[_0x34f8c8(0x33b)]();this['_rescheduleHeartbeat']();}['_rescheduleHeartbeat'](){const _0x7cbf18=_0x37a288;var _0x5034f9;this[_0x7cbf18(0x248)](),this[_0x7cbf18(0x197)]=setTimeout(()=>this[_0x7cbf18(0x306)](),(_0x5034f9=this[_0x7cbf18(0x1ec)][_0x7cbf18(0x38e)](_0x7cbf18(0x155)))!==null&&_0x5034f9!==void 0x0?_0x5034f9:DEFAULT_HEARTBEAT_INTERVAL);}[_0x37a288(0x306)](){const _0xdc1b77=_0x37a288;this[_0xdc1b77(0x1c7)][_0xdc1b77(0x316)]({'cmd':CombCmd['HEARTBEAT']}),this[_0xdc1b77(0x289)]();}[_0x37a288(0x289)](){const _0x4978e7=_0x37a288;var _0x507fdb;this[_0x4978e7(0x2c9)]=setTimeout(()=>this[_0x4978e7(0x236)](),(_0x507fdb=this[_0x4978e7(0x1ec)][_0x4978e7(0x38e)]('HEARTBEAT_TIMEOUT'))!==null&&_0x507fdb!==void 0x0?_0x507fdb:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x37a288(0x248)](){const _0x18984d=_0x37a288;this[_0x18984d(0x197)]!=null&&(clearTimeout(this[_0x18984d(0x197)]),this[_0x18984d(0x197)]=null);}['_clearTimeoutTimer'](){const _0x3301e3=_0x37a288;this[_0x3301e3(0x2c9)]!=null&&(clearTimeout(this['_timeoutTimer']),this[_0x3301e3(0x2c9)]=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ILogService),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,Inject(CollaborationUIEventService)),__decorateParam(0x5,Optional(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends RxDisposable{constructor(_0x33e94f,_0x68fda7,_0xe7256a,_0x11adf9){const _0x54385a=_0x37a288;var _0x290c2d;super(),this['_injector']=_0x33e94f,this['_collabSessionService']=_0x68fda7,this[_0x54385a(0x1ec)]=_0xe7256a,this[_0x54385a(0x229)]=_0x11adf9,_defineProperty(this,_0x54385a(0x188),new Map()),_defineProperty(this,_0x54385a(0x36b),new Subject()),_defineProperty(this,_0x54385a(0x28d),this[_0x54385a(0x36b)][_0x54385a(0x16b)]());if(((_0x290c2d=this[_0x54385a(0x1ec)]['getConfig']('collaboration-client.config'))===null||_0x290c2d===void 0x0?void 0x0:_0x290c2d['enableCollaboration'])!==![])this['_init']();}[_0x37a288(0x16a)](){const _0x295dbd=_0x37a288;super[_0x295dbd(0x16a)](),this[_0x295dbd(0x188)]['forEach'](_0x935c9=>_0x935c9['dispose']()),this[_0x295dbd(0x188)]['clear']();}['getCollabEntity'](_0xb74760){const _0x3b0317=_0x37a288;var _0x141942;return(_0x141942=this[_0x3b0317(0x188)]['get'](_0xb74760))!==null&&_0x141942!==void 0x0?_0x141942:null;}['getCollabEntity$'](_0x233842){const _0x354230=_0x37a288,_0x3507fd=this['getCollabEntity'](_0x233842);if(_0x3507fd)return of(_0x3507fd);return this[_0x354230(0x36b)][_0x354230(0x39b)](filter(_0x316a9f=>_0x316a9f['unitID']===_0x233842));}[_0x37a288(0x178)](_0x14b58e){const _0x10a63f=_0x37a288;return firstValueFrom(this[_0x10a63f(0x266)](_0x14b58e)[_0x10a63f(0x39b)](_0x23341b(()=>void 0x0)));}['_init'](){const _0x323167=_0x37a288,_0x294e68=0x10;this[_0x323167(0x229)][_0x323167(0x231)](UniverInstanceType[_0x323167(0x362)])[_0x323167(0x39b)](takeUntil(this['dispose$']),delay(_0x294e68))[_0x323167(0x2ae)](async _0x13a120=>{const _0x25ea93=_0x323167,_0x9e5316=_0x13a120[_0x25ea93(0x35f)][_0x25ea93(0x15e)](),_0x394818=await this['_startCollaboration'](_0x9e5316,UniverInstanceType[_0x25ea93(0x362)]);this[_0x25ea93(0x188)][_0x25ea93(0x2c4)](_0x9e5316,_0x394818);}),this[_0x323167(0x229)][_0x323167(0x231)](UniverInstanceType[_0x323167(0x3a2)])['pipe'](takeUntil(this['dispose$']),delay(_0x294e68))[_0x323167(0x39b)](filter(_0x433609=>{const _0x58a5a5=_0x323167;return!_0x433609[_0x58a5a5(0x35f)][_0x58a5a5(0x15e)]()[_0x58a5a5(0x1da)]('__');}))[_0x323167(0x2ae)](async _0x278da1=>{const _0x55ac64=_0x323167,_0x499eff=_0x278da1[_0x55ac64(0x35f)][_0x55ac64(0x15e)](),_0x3955b4=await this['_startCollaboration'](_0x499eff,UniverInstanceType[_0x55ac64(0x3a2)]);this[_0x55ac64(0x188)][_0x55ac64(0x2c4)](_0x499eff,_0x3955b4);}),_0x5de48a(this[_0x323167(0x229)][_0x323167(0x264)](UniverInstanceType[_0x323167(0x362)]),this[_0x323167(0x229)]['getTypeOfUnitDisposed$'](UniverInstanceType[_0x323167(0x3a2)]))[_0x323167(0x39b)](takeUntil(this[_0x323167(0x2d8)]))[_0x323167(0x2ae)](_0x49e78e=>{const _0x3e0ae8=_0x323167,_0x4f9e88=_0x49e78e[_0x3e0ae8(0x15e)](),_0x3c4684=this['_entities'][_0x3e0ae8(0x213)](_0x4f9e88);_0x3c4684&&(_0x3c4684['dispose'](),this[_0x3e0ae8(0x188)]['delete'](_0x4f9e88));});}async[_0x37a288(0x244)](_0x505ce3,_0x57464b){const _0x529a4d=_0x37a288,_0x327571=await this['_collabSessionService'][_0x529a4d(0x226)](_0x505ce3),_0x2821ba=this['_injector'][_0x529a4d(0x21a)](this['_getCtorByUniverInstanceType'](_0x57464b),_0x505ce3,_0x57464b,_0x327571);return await _0x2821ba['init'](),this['_entityInit$'][_0x529a4d(0x1b0)](_0x2821ba),_0x2821ba;}['_getCtorByUniverInstanceType'](_0x398b81){const _0x2a9c47=_0x37a288;switch(_0x398b81){case UniverInstanceType[_0x2a9c47(0x3a2)]:return DocCollaborationEntity;case UniverInstanceType[_0x2a9c47(0x362)]:return SheetCollaborationEntity;default:throw new Error(_0x2a9c47(0x25a)+_0x398b81);}}};CollaborationController=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(CollaborationSessionService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,IUniverInstanceService)],CollaborationController);var name='@univerjs-pro/collaboration-client',version=_0x37a288(0x15f);const DEFAULT_FILE_NAME_KEY=_0x37a288(0x312),UNIVER_DEFAULT_FILE_NAME=_0x37a288(0x276);let FileNameController=class FileNameController extends Disposable{constructor(_0x41da65,_0x5befd8){const _0x5573e3=_0x37a288;super(),this[_0x5573e3(0x229)]=_0x41da65,this['_configService']=_0x5befd8,this[_0x5573e3(0x333)]();}['_init'](){const _0x5a943f=_0x37a288;this['disposeWithMe'](this[_0x5a943f(0x229)][_0x5a943f(0x150)][_0x5a943f(0x2ae)](()=>{const _0x164eb8=_0x5a943f;var _0x33f8be;const _0x429611=this[_0x164eb8(0x229)][_0x164eb8(0x1aa)]();let _0x3d9b78=(_0x33f8be=this[_0x164eb8(0x1ec)][_0x164eb8(0x38e)]('DEFAULT_FILE_NAME'))!==null&&_0x33f8be!==void 0x0?_0x33f8be:UNIVER_DEFAULT_FILE_NAME;if(_0x429611 instanceof Workbook)_0x3d9b78=_0x429611[_0x164eb8(0x169)];document[_0x164eb8(0x2ac)]=_0x3d9b78;}));}};FileNameController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,IConfigService)],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x8d2baf,_0x404d33,_0x543d0f){const _0x46225f=_0x37a288;this[_0x46225f(0x1ec)]=_0x8d2baf,this[_0x46225f(0x232)]=_0x404d33,this[_0x46225f(0x2f8)]=_0x543d0f,this[_0x46225f(0x378)]();}[_0x37a288(0x378)](){const _0x6c6645=_0x37a288;this[_0x6c6645(0x232)]['registerHTTPInterceptor']({'priority':0x1,'interceptor':(_0x158602,_0x418ca5)=>{return _0x418ca5(_0x158602)['pipe'](concatMap(async _0x58fac9=>{const _0xe14f33=_0x378b,_0x32c53f=_0x58fac9;if(_0x32c53f['status']===0x191){if(typeof window===_0xe14f33(0x31b))throw new Error('[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.');if(window[_0xe14f33(0x1a9)](this['localeService']['t'](_0xe14f33(0x31c)))){const _0xf33711=window[_0xe14f33(0x202)](window[_0xe14f33(0x300)][_0xe14f33(0x16f)]);window[_0xe14f33(0x300)]['href']=this[_0xe14f33(0x34d)]()+_0xe14f33(0x322)+_0xf33711;}}return _0x32c53f;}));}});}[_0x37a288(0x34d)](){const _0x40bdf0=_0x37a288;var _0x3760a1;const _0x236ffa=this[_0x40bdf0(0x1ec)][_0x40bdf0(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x3760a1=_0x236ffa===null||_0x236ffa===void 0x0?void 0x0:_0x236ffa[_0x40bdf0(0x354)])!==null&&_0x3760a1!==void 0x0?_0x3760a1:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,Inject(LocaleService))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1='/universer-api/authz';let AuthzIoHttpService=class AuthzIoHttpService extends Disposable{constructor(_0x38b274,_0x55d2ae){const _0x439fd6=_0x37a288;super(),this['_HTTPService']=_0x38b274,this[_0x439fd6(0x1ec)]=_0x55d2ae,_defineProperty(this,_0x439fd6(0x215),![]),this[_0x439fd6(0x399)]();}[_0x37a288(0x399)](){const _0x3c429e=_0x37a288,_0x5cefbe=this;this[_0x3c429e(0x2f4)](this[_0x3c429e(0x32e)][_0x3c429e(0x381)]({'priority':0x3e7,'interceptor':MergeInterceptorFactory({'isMatch'(_0x1909e5){const _0x2ab6e7=_0x3c429e;var _0x39126f;if(_0x1909e5['method']===_0x2ab6e7(0x1d9)&&((_0x39126f=_0x1909e5[_0x2ab6e7(0x249)])===null||_0x39126f===void 0x0?void 0x0:_0x39126f['body'])){const {objectID:_0x1069cb,objectType:_0x2a5b46}=_0x1909e5['requestParams'][_0x2ab6e7(0x2f3)]||{};if(!_0x1069cb||_0x2a5b46===void 0x0)return![];const _0xdb29a6=_0x5cefbe['_getAPIPrefixPath']()+'/'+_0x2a5b46+_0x2ab6e7(0x293)+_0x1069cb+'/allowed';if(_0x1909e5[_0x2ab6e7(0x361)]===_0xdb29a6)return!![];}return![];},'getParamsFromRequest'(_0x44c8a7){const _0x3a7a5c=_0x3c429e;var _0x3eb7af;return(_0x3eb7af=_0x44c8a7['requestParams'])===null||_0x3eb7af===void 0x0?void 0x0:_0x3eb7af[_0x3a7a5c(0x2f3)];},'mergeParamsToRequest'(_0x832566,_0x365ed2){const _0x2e658d=_0x3c429e,_0x57297d=_0x5cefbe['_getAPIPrefixPath']()+_0x2e658d(0x367),_0x569ff8=_0x832566['reduce']((_0x2c6e42,_0x37db60)=>{const _0x4a4930=_0x2e658d,{unitID:_0x58a291,objectID:_0x59e668,objectType:_0x530823,actions:_0x5157a5}=_0x37db60;if(!_0x2c6e42[_0x58a291])_0x2c6e42[_0x58a291]={};if(!_0x2c6e42[_0x58a291][_0x59e668])_0x2c6e42[_0x58a291][_0x59e668]={'objectID':_0x59e668,'objectType':_0x530823,'actions':[]};return _0x2c6e42[_0x58a291][_0x59e668]['actions'][_0x4a4930(0x344)](..._0x5157a5),_0x2c6e42;},{}),_0x1b18a8=[];for(const _0x369298 in _0x569ff8)for(const _0x48ed7f in _0x569ff8[_0x369298]){const {actions:_0x272046,objectType:_0x47540c}=_0x569ff8[_0x369298][_0x48ed7f],_0x58be27=[...new Set(_0x272046)];_0x1b18a8[_0x2e658d(0x344)]({'unitID':_0x369298,'objectID':_0x48ed7f,'objectType':_0x47540c,'actions':_0x58be27});}return new HTTPRequest(_0x2e658d(0x1d9),_0x57297d,{'headers':_0x365ed2[_0x2e658d(0x345)],'withCredentials':_0x365ed2['withCredentials'],'responseType':_0x365ed2[_0x2e658d(0x39a)],'body':{'requests':_0x1b18a8}});}},{'distributeResult'(_0x418200,_0x123b80){const _0xd817ec=_0x3c429e,{objectActions:_0x1e903e}=_0x418200;return _0x123b80[_0xd817ec(0x1f1)](_0x4fcdef=>{const _0x44cf86=_0xd817ec,{unitID:_0x90a8ac,objectID:_0x13d269,actions:_0x40a3b5}=_0x4fcdef,_0x5ea31d=_0x1e903e[_0x44cf86(0x1a4)](_0x1a71dc=>_0x1a71dc[_0x44cf86(0x196)]===_0x90a8ac&&_0x1a71dc[_0x44cf86(0x1d0)]===_0x13d269);return{'config':_0x4fcdef,'result':{'actions':_0x40a3b5[_0x44cf86(0x1f1)](_0x23e1b4=>_0x5ea31d===null||_0x5ea31d===void 0x0?void 0x0:_0x5ea31d['actions']['find'](_0x5a05ca=>_0x5a05ca['action']===_0x23e1b4))[_0x44cf86(0x285)](_0x4d6834=>!!_0x4d6834),'error':_0x418200[_0x44cf86(0x1cd)]}};});}})}));}[_0x37a288(0x1d2)](){const _0x3d8f17=_0x37a288;var _0xe81edb;const _0x397c8b=this[_0x3d8f17(0x1ec)][_0x3d8f17(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0xe81edb=_0x397c8b===null||_0x397c8b===void 0x0?void 0x0:_0x397c8b['authzUrl'])!==null&&_0xe81edb!==void 0x0?_0xe81edb:DEFAULT_AUTHZ_URL_KEY$1;}async['create'](_0x3534b0){const _0x33d9fd=_0x37a288,_0x99a959=this['_getAPIPrefixPath']()+'/'+_0x3534b0['objectType']+'/object';return(await this[_0x33d9fd(0x32e)]['post'](_0x99a959,{'body':_0x3534b0}))[_0x33d9fd(0x2f3)][_0x33d9fd(0x1d0)]||'';}async[_0x37a288(0x1b4)](_0x20c853){const _0x5915e1=_0x37a288,_0x141390=this[_0x5915e1(0x1d2)]()+'/-/object/list';return(await this[_0x5915e1(0x32e)][_0x5915e1(0x2bf)](_0x141390,{'body':_0x20c853}))[_0x5915e1(0x2f3)]['objects'];}async[_0x37a288(0x34f)](_0x5906e6){const _0x2725f6=_0x37a288;var _0x5c637c;const _0x32cb37=this['_getAPIPrefixPath']()+'/'+_0x5906e6['objectType']+_0x2725f6(0x293)+_0x5906e6[_0x2725f6(0x1d0)],_0x40e34d=await this[_0x2725f6(0x32e)]['put'](_0x32cb37,{'body':_0x5906e6});if((_0x40e34d===null||_0x40e34d===void 0x0||(_0x5c637c=_0x40e34d[_0x2725f6(0x2f3)])===null||_0x5c637c===void 0x0||(_0x5c637c=_0x5c637c[_0x2725f6(0x1cd)])===null||_0x5c637c===void 0x0?void 0x0:_0x5c637c[_0x2725f6(0x25c)])!==0x1)throw new Error(_0x2725f6(0x23c));}async['allowed'](_0x37fb0b){const _0x41b58a=_0x37a288,_0x587fb0=this[_0x41b58a(0x1d2)]()+'/'+_0x37fb0b['objectType']+_0x41b58a(0x293)+_0x37fb0b[_0x41b58a(0x1d0)]+'/allowed';return(await this[_0x41b58a(0x32e)][_0x41b58a(0x2bf)](_0x587fb0,{'body':_0x37fb0b}))[_0x41b58a(0x2f3)][_0x41b58a(0x164)];}async['batchAllowed'](_0xf51214){const _0x203656=_0x37a288,_0x34678b=this[_0x203656(0x1d2)]()+_0x203656(0x367);return(await this['_HTTPService']['post'](_0x34678b,{'body':{'requests':_0xf51214}}))[_0x203656(0x2f3)][_0x203656(0x3a4)];}async['listRoles'](_0x3ea374){const _0x1df767=_0x37a288,_0x17b4b1=this[_0x1df767(0x1d2)]()+'/'+_0x3ea374[_0x1df767(0x33d)]+_0x1df767(0x20c),_0x55be48=await this[_0x1df767(0x32e)][_0x1df767(0x2bf)](_0x17b4b1,{'body':_0x3ea374});return{'roles':_0x55be48[_0x1df767(0x2f3)][_0x1df767(0x2de)],'actions':_0x55be48['body'][_0x1df767(0x164)]};}async[_0x37a288(0x223)](_0x14925c){const _0x59b3ba=_0x37a288,_0x41b8cc=this['_getAPIPrefixPath']()+_0x59b3ba(0x1a1);await this['_HTTPService'][_0x59b3ba(0x377)](_0x41b8cc,{'params':{'collaboratorID':_0x14925c[_0x59b3ba(0x159)],'objectID':_0x14925c[_0x59b3ba(0x1d0)],'unitID':_0x14925c[_0x59b3ba(0x196)]}});}async[_0x37a288(0x2d0)](_0x2c827f){const _0x508252=_0x37a288,_0x5b84f3=this[_0x508252(0x1d2)]()+_0x508252(0x1a1);await this[_0x508252(0x32e)][_0x508252(0x2c5)](_0x5b84f3,{'body':_0x2c827f});}async[_0x37a288(0x238)](_0xfb9414){const _0x202a76=_0x37a288,_0x1dd57f=this[_0x202a76(0x1d2)]()+'/collaborator';await this[_0x202a76(0x32e)][_0x202a76(0x2bf)](_0x1dd57f,{'body':_0xfb9414});}async['listCollaborators'](_0x5a4c32){const _0x229ffe=_0x37a288;var _0x100310;const _0x3d0a70=this[_0x229ffe(0x1d2)]()+'/collaborator',_0x1607b7=await this[_0x229ffe(0x32e)]['get'](_0x3d0a70,{'params':{'objectID':_0x5a4c32[_0x229ffe(0x1d0)],'unitID':_0x5a4c32[_0x229ffe(0x196)]}});return this[_0x229ffe(0x175)]((_0x100310=_0x1607b7[_0x229ffe(0x2f3)][_0x229ffe(0x14c)])!==null&&_0x100310!==void 0x0?_0x100310:![]),_0x1607b7[_0x229ffe(0x2f3)][_0x229ffe(0x20b)];}async['putCollaborators'](_0x3e6bb4){const _0x50a729=_0x37a288,_0x3b4117=this['_getAPIPrefixPath']()+_0x50a729(0x1a1);await this[_0x50a729(0x32e)][_0x50a729(0x31f)](_0x3b4117,{'body':_0x3e6bb4});}[_0x37a288(0x175)](_0x34479e){const _0x5011ab=_0x37a288;this[_0x5011ab(0x215)]=_0x34479e;}[_0x37a288(0x1d1)](){return this['_cfgEnableObjInherit'];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,Inject(IConfigService))],AuthzIoHttpService);function base64ToBytes(_0x2d04f2){const _0x166afe=_0x37a288,_0x409550=atob(_0x2d04f2),_0x124a00=new Uint8Array(_0x409550[_0x166afe(0x1a6)]);for(let _0xa45620=0x0;_0xa45620<_0x409550['length'];_0xa45620++)_0x124a00[_0xa45620]=_0x409550[_0x166afe(0x146)](_0xa45620);return _0x124a00;}function bytesToBase64(_0x1ef48d){const _0x43f470=_0x37a288;let _0x3518d7='';for(let _0x443576=0x0;_0x443576<_0x1ef48d[_0x43f470(0x1a6)];_0x443576++)_0x3518d7+=String[_0x43f470(0x2ce)](_0x1ef48d[_0x443576]);return btoa(_0x3518d7);}function encrypt(_0x27e441,_0x1d7a72){const _0x1be6a8=_0x37a288,_0x116a33=base64ToBytes(_0x1d7a72),_0x143ad1=randomBytes(0x10);return bytesToBase64(concatBytes(_0x143ad1,cbc(_0x116a33,_0x143ad1)[_0x1be6a8(0x311)](utf8ToBytes(_0x27e441))));}function getAttachHeader(){const _0x30eb57=_0x37a288,_0x5480ce=getGlobalObject()[_0x30eb57(0x279)];if(typeof window!==_0x30eb57(0x31b)&&typeof window[_0x30eb57(0x300)]!=='undefined'&&_0x5480ce){const _0x507845={'time':Math[_0x30eb57(0x262)](Date[_0x30eb57(0x2b0)]()/0x3e8),'domain':location[_0x30eb57(0x380)]};return encrypt(JSON[_0x30eb57(0x24a)](_0x507845),_0x5480ce);}}let DomainRequestService=class DomainRequestService{constructor(_0x104f19){const _0x465bad=_0x37a288;this[_0x465bad(0x232)]=_0x104f19,this['_initRequestHeader']();}[_0x37a288(0x14f)](){const _0x4369f8=_0x37a288;this[_0x4369f8(0x232)][_0x4369f8(0x381)]({'interceptor':(_0x2d2408,_0x3c1455)=>{const _0x15741b=_0x4369f8,_0x40344e=getAttachHeader();if(_0x40344e)_0x2d2408[_0x15741b(0x345)][_0x15741b(0x2c4)]('x-univer-host',_0x40344e);return _0x3c1455(_0x2d2408);}});}};DomainRequestService=__decorate([__decorateParam(0x0,Inject(HTTPService))],DomainRequestService);let DataLoaderService=class DataLoaderService extends RxDisposable{constructor(_0x2c98c0,_0x564b97,_0x5eabdc){const _0x348ab3=_0x37a288;super(),this[_0x348ab3(0x270)]=_0x2c98c0,this[_0x348ab3(0x1fa)]=_0x564b97,this[_0x348ab3(0x2a1)]=_0x5eabdc,_defineProperty(this,_0x348ab3(0x2a5),new BehaviorSubject(null)),_defineProperty(this,_0x348ab3(0x1d8),this[_0x348ab3(0x2a5)][_0x348ab3(0x16b)]());}async[_0x37a288(0x3a7)](_0x464061,_0x56b24a,_0x2a2319){const _0x182aaa=_0x37a288;this['_unitInfo$']['next']({'unitId':_0x464061,'type':_0x56b24a});let _0x1b605a=null;switch(_0x56b24a){case UniverInstanceType[_0x182aaa(0x362)]:_0x1b605a=await this[_0x182aaa(0x1fa)]['loadSheet'](_0x464061,_0x2a2319);break;case UniverInstanceType[_0x182aaa(0x3a2)]:_0x1b605a=await this[_0x182aaa(0x1fa)][_0x182aaa(0x19a)](_0x464061,_0x2a2319);break;default:this[_0x182aaa(0x270)]['error'](_0x182aaa(0x271),'Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.');break;}return _0x1b605a;}async[_0x37a288(0x267)](_0x37df39,_0x163f36,_0x3006dc){const _0x2f575a=_0x37a288;var _0x5363b5;this['_unitInfo$']['next']({'unitId':_0x37df39,'type':_0x163f36,'subUnitId':_0x3006dc});let _0x2d3265=0x0;const _0x554155=await((_0x5363b5=this['_localCacheService'])===null||_0x5363b5===void 0x0?void 0x0:_0x5363b5[_0x2f575a(0x395)](_0x37df39));if(_0x554155&&(_0x554155[_0x2f575a(0x2b2)]||_0x554155['mutations'][_0x2f575a(0x1a6)]!==0x0))_0x2d3265=_0x554155[_0x2f575a(0x34b)];if(_0x2d3265===0x0)this[_0x2f575a(0x270)]['debug'](_0x2f575a(0x271),_0x2f575a(0x204));return this[_0x2f575a(0x3a7)](_0x37df39,_0x163f36,_0x2d3265);}};DataLoaderService=__decorate([__decorateParam(0x0,ILogService),__decorateParam(0x1,Inject(SnapshotService)),__decorateParam(0x2,Optional(ILocalCacheService))],DataLoaderService);const DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY='/universer-api/stream/file/upload',DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY=_0x37a288(0x18f);let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x523eac,_0x2c5bfd,_0x6166c6){const _0x3a78fd=_0x37a288;this[_0x3a78fd(0x232)]=_0x523eac,this[_0x3a78fd(0x1ec)]=_0x2c5bfd,this[_0x3a78fd(0x229)]=_0x6166c6,_defineProperty(this,_0x3a78fd(0x3aa),0x0),_defineProperty(this,_0x3a78fd(0x30c),new Subject()),_defineProperty(this,_0x3a78fd(0x198),this[_0x3a78fd(0x30c)]),_defineProperty(this,_0x3a78fd(0x25b),new Map());}[_0x37a288(0x2ec)](_0x2e5f56){const _0x41cb71=_0x37a288;this[_0x41cb71(0x3aa)]=_0x2e5f56,this[_0x41cb71(0x30c)][_0x41cb71(0x1b0)](_0x2e5f56);}[_0x37a288(0x163)](_0x22aa7e,_0x5ce32b){const _0x178145=_0x37a288;if(_0x5ce32b===ImageSourceType[_0x178145(0x29e)]){const _0x1dbf28=new Image();return _0x1dbf28[_0x178145(0x302)]=_0x22aa7e,_0x1dbf28;}return this[_0x178145(0x25b)]['get'](_0x22aa7e);}['addImageSourceCache'](_0x39d121,_0x36c29a,_0x1e46a5){const _0x22ece7=_0x37a288;if(_0x36c29a===ImageSourceType[_0x22ece7(0x29e)]||_0x1e46a5==null)return;this[_0x22ece7(0x25b)][_0x22ece7(0x2c4)](_0x39d121,_0x1e46a5);}async[_0x37a288(0x157)](_0x49e213){const _0x36912b=_0x37a288;try{const _0x51174a=this[_0x36912b(0x190)](this[_0x36912b(0x1b8)](),''+_0x49e213),_0x10ee13=(await this['_httpService'][_0x36912b(0x213)](_0x51174a))[_0x36912b(0x2f3)];if(_0x10ee13[_0x36912b(0x1cd)]&&_0x10ee13['error'][_0x36912b(0x25c)]===ErrorCode['OK']){const _0x43f6bb=resolveWithBasePath(_0x10ee13[_0x36912b(0x361)],this[_0x36912b(0x26a)]());return Promise['resolve'](_0x43f6bb);}return Promise['reject'](_0x10ee13['error']);}catch(_0x395d23){return Promise[_0x36912b(0x1f2)](_0x395d23);}}async[_0x37a288(0x17a)](_0x55da7e){const _0x5bc478=_0x37a288;let _0x3f8d0f='';if(!DRAWING_IMAGE_ALLOW_IMAGE_LIST[_0x5bc478(0x166)](_0x55da7e['type']))return this['_decreaseWaiting'](),Promise[_0x5bc478(0x1f2)](new Error(ImageUploadStatusType[_0x5bc478(0x2a2)]));if(_0x55da7e[_0x5bc478(0x235)]>getDrawingImageAllowSize())return this[_0x5bc478(0x331)](),Promise[_0x5bc478(0x1f2)](new Error(ImageUploadStatusType[_0x5bc478(0x233)]));try{const _0x3aea85=new FormData();_0x3aea85[_0x5bc478(0x26b)](_0x5bc478(0x2f5),_0x55da7e);const _0x127aa0=this['_univerInstanceService'][_0x5bc478(0x1aa)](),_0x5ba2c8=_0x127aa0===null||_0x127aa0===void 0x0?void 0x0:_0x127aa0[_0x5bc478(0x15e)]();if(!_0x5ba2c8)throw new Error(_0x5bc478(0x25d));const _0x5affca=this[_0x5bc478(0x206)]()+'?size='+_0x55da7e[_0x5bc478(0x235)][_0x5bc478(0x1f5)]()+'&source='+FileSource[_0x5bc478(0x1ea)]+_0x5bc478(0x364)+encodeURIComponent(_0x5ba2c8),_0x1fbf8f={'body':_0x3aea85},_0x59a427=(await this[_0x5bc478(0x232)][_0x5bc478(0x2bf)](_0x5affca,_0x1fbf8f))[_0x5bc478(0x2f3)];if(typeof _0x59a427[_0x5bc478(0x254)]!==_0x5bc478(0x3a1))return this[_0x5bc478(0x331)](),Promise[_0x5bc478(0x1f2)](new Error(ImageUploadStatusType[_0x5bc478(0x393)]));_0x3f8d0f=_0x59a427['FileId'];}catch(_0x3c77cb){return this['_decreaseWaiting'](),Promise[_0x5bc478(0x1f2)](new Error(ImageUploadStatusType[_0x5bc478(0x393)]));}return new Promise((_0x6836cf,_0x13a1f8)=>{const _0x14f234=_0x5bc478,_0x243eee=new FileReader();_0x243eee['readAsDataURL'](_0x55da7e),_0x243eee[_0x14f234(0x318)]=_0x2a5d35=>{const _0x5a727f=_0x14f234;var _0x479210;const _0x5afe93=(_0x479210=_0x2a5d35[_0x5a727f(0x239)])===null||_0x479210===void 0x0?void 0x0:_0x479210['result'];if(_0x5afe93==null){this[_0x5a727f(0x331)](),_0x13a1f8(new Error(ImageUploadStatusType[_0x5a727f(0x393)]));return;}_0x6836cf({'imageId':generateRandomId(0x6),'imageSourceType':ImageSourceType[_0x5a727f(0x357)],'source':_0x3f8d0f,'base64Cache':_0x5afe93,'status':ImageUploadStatusType[_0x5a727f(0x1c1)]}),this['_decreaseWaiting']();};});}['_getUploadFileURL'](){const _0x24a02d=_0x37a288;var _0x49553b;const _0x12c97a=this[_0x24a02d(0x1ec)][_0x24a02d(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x49553b=_0x12c97a===null||_0x12c97a===void 0x0?void 0x0:_0x12c97a[_0x24a02d(0x1e6)])!==null&&_0x49553b!==void 0x0?_0x49553b:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x37a288(0x1b8)](){const _0x39e131=_0x37a288;var _0x11df8c;const _0x1730a=this[_0x39e131(0x1ec)][_0x39e131(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x11df8c=_0x1730a===null||_0x1730a===void 0x0?void 0x0:_0x1730a[_0x39e131(0x2ca)])!==null&&_0x11df8c!==void 0x0?_0x11df8c:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}[_0x37a288(0x26a)](){const _0x223d74=_0x37a288;var _0x28f2de;const _0x1c7ff9=this[_0x223d74(0x1ec)][_0x223d74(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x28f2de=_0x1c7ff9===null||_0x1c7ff9===void 0x0?void 0x0:_0x1c7ff9['downloadEndpointUrl'])!==null&&_0x28f2de!==void 0x0?_0x28f2de:location[_0x223d74(0x1df)];}[_0x37a288(0x190)](_0x364187,_0x521634){const _0x30e5e0=_0x37a288;return _0x364187[_0x30e5e0(0x1ab)]('{fileID}',_0x521634);}[_0x37a288(0x331)](){const _0x3347f0=_0x37a288;this[_0x3347f0(0x3aa)]-=0x1,this[_0x3347f0(0x30c)]['next'](this[_0x3347f0(0x3aa)]);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,IConfigService),__decorateParam(0x2,Inject(IUniverInstanceService))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY='/universer-api/authz';let MentionIoHttpService=class MentionIoHttpService{constructor(_0x53a815,_0x5c4af4){const _0x8147bc=_0x37a288;this['_configService']=_0x53a815,this[_0x8147bc(0x32e)]=_0x5c4af4;}[_0x37a288(0x1d2)](){const _0x30bdb4=_0x37a288;var _0x5776dc;const _0x3d5672=this[_0x30bdb4(0x1ec)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x5776dc=_0x3d5672===null||_0x3d5672===void 0x0?void 0x0:_0x3d5672[_0x30bdb4(0x2ff)])!==null&&_0x5776dc!==void 0x0?_0x5776dc:DEFAULT_AUTHZ_URL_KEY;}async[_0x37a288(0x1b4)](_0x198f64){const _0x5c3f9e=_0x37a288,_0x452457=this[_0x5c3f9e(0x1d2)]()+_0x5c3f9e(0x1a1);return{'list':[{'title':_0x5c3f9e(0x28a),'mentions':(await this[_0x5c3f9e(0x32e)][_0x5c3f9e(0x213)](_0x452457,{'params':{'objectID':_0x198f64['unitId'],'unitID':_0x198f64['unitId']}}))[_0x5c3f9e(0x2f3)][_0x5c3f9e(0x20b)][_0x5c3f9e(0x1f1)](_0x66f65f=>({'objectId':_0x66f65f['id'],'name':_0x66f65f[_0x5c3f9e(0x1e0)][_0x5c3f9e(0x169)],'metadata':{'icon':_0x66f65f[_0x5c3f9e(0x1e0)][_0x5c3f9e(0x3ad)]},'label':_0x66f65f[_0x5c3f9e(0x1e0)][_0x5c3f9e(0x169)],'objectType':MentionType['PERSON']})),'metadata':{},'type':MentionType[_0x5c3f9e(0x24c)]}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,Inject(IConfigService)),__decorateParam(0x1,Inject(HTTPService))],MentionIoHttpService);let PermissionService=class PermissionService extends RxDisposable{constructor(_0x4a18dc,_0x117a11,_0x4843af,_0x4ea79b,_0x2ebc17){const _0x2664c5=_0x37a288;super(),this[_0x2664c5(0x299)]=_0x4a18dc,this[_0x2664c5(0x229)]=_0x117a11,this[_0x2664c5(0x348)]=_0x4843af,this[_0x2664c5(0x209)]=_0x4ea79b,this[_0x2664c5(0x1e4)]=_0x2ebc17,this[_0x2664c5(0x3a5)](),this[_0x2664c5(0x1fb)]();}['_initCloseConn'](){const _0x291fd1=_0x37a288,_0x31cb7b=async _0x2c1a08=>{const _0xd7d241=_0x378b;(await this[_0xd7d241(0x209)][_0xd7d241(0x226)](_0x2c1a08))[_0xd7d241(0x35a)]['pipe'](filter(_0x4882ba=>_0x4882ba['eventID']===CollaborationEvent['SHOULD_CLOSE_CONN']),_0x2ed60a(this['dispose$']))[_0xd7d241(0x2ae)](_0x5bf01b=>{const _0x435ea=_0xd7d241,{reason:_0x290ba6}=_0x5bf01b['data'];this[_0x435ea(0x1e4)][_0x435ea(0x294)]({'id':'CLOSE_ROOM','data':_0x290ba6}),this[_0x435ea(0x348)][_0x435ea(0x2a7)](new WorkbookEditablePermission(_0x2c1a08)['id'],![]),this[_0x435ea(0x209)]['closeSession'](_0x2c1a08);});};_0x5de48a(this[_0x291fd1(0x229)][_0x291fd1(0x231)](UniverInstanceType[_0x291fd1(0x362)]),this[_0x291fd1(0x229)][_0x291fd1(0x231)](UniverInstanceType[_0x291fd1(0x3a2)]))['pipe'](_0x23341b(_0x449804=>_0x449804[_0x291fd1(0x35f)][_0x291fd1(0x15e)]()),filter(_0x3059ea=>!isInternalEditorID(_0x3059ea)),_0x2ed60a(this[_0x291fd1(0x2d8)]))[_0x291fd1(0x2ae)](_0x780f4a=>{_0x31cb7b(_0x780f4a);});}[_0x37a288(0x3a5)](){const _0x37bb13=_0x37a288,_0x3169a0=async _0x2594d4=>{const _0x550fd9=_0x378b,_0x3688f9=await this[_0x550fd9(0x209)][_0x550fd9(0x226)](_0x2594d4),_0x3c20aa=this[_0x550fd9(0x299)]['get'](SheetPermissionInitController);_0x3688f9['event$'][_0x550fd9(0x39b)](filter(_0x2cfd0c=>_0x2cfd0c[_0x550fd9(0x1f3)]===CollaborationEvent['UPDATE_PERMISSION_OBJ']),_0x2ed60a(this['dispose$']))[_0x550fd9(0x2ae)](_0x4d8ce1=>{const _0x3ba353=_0x550fd9,{objectId:_0x39c533}=_0x4d8ce1[_0x3ba353(0x346)];if(_0x39c533===_0x2594d4)_0x3c20aa['initWorkbookPermissionChange'](_0x2594d4);else _0x3c20aa[_0x3ba353(0x1ca)](_0x2594d4,_0x39c533);});};_0x5de48a(this[_0x37bb13(0x229)][_0x37bb13(0x231)](UniverInstanceType[_0x37bb13(0x362)]))[_0x37bb13(0x39b)](_0x23341b(_0x37c7e0=>_0x37c7e0[_0x37bb13(0x35f)][_0x37bb13(0x15e)]()),filter(_0x170832=>!isInternalEditorID(_0x170832)),_0x2ed60a(this[_0x37bb13(0x2d8)]))[_0x37bb13(0x2ae)](_0x4f83a5=>{_0x3169a0(_0x4f83a5);});}};PermissionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,IUniverInstanceService),__decorateParam(0x2,IPermissionService),__decorateParam(0x3,Inject(CollaborationSessionService)),__decorateParam(0x4,Inject(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x536a8e,_0x3c5f31){const _0x4046cd=_0x37a288;this[_0x4046cd(0x1ec)]=_0x536a8e,this[_0x4046cd(0x232)]=_0x3c5f31;}async[_0x37a288(0x356)](_0x23660b,_0x32665b){const _0x5b0154=_0x37a288;var _0x4eaab7;const {unitID:_0x38c6e2,type:_0x47a0de,revision:revision=0x0}=_0x32665b,_0x176f6c=this['getSnapshotAPIPath']()+'/'+_0x47a0de+_0x5b0154(0x34c)+_0x38c6e2+'/rev/'+revision,_0x2909df=(await this[_0x5b0154(0x232)][_0x5b0154(0x213)](_0x176f6c))[_0x5b0154(0x2f3)],_0x8341e3=(_0x4eaab7=_0x2909df[_0x5b0154(0x17c)])===null||_0x4eaab7===void 0x0?void 0x0:_0x4eaab7[_0x5b0154(0x2e8)];if(_0x8341e3){const _0x3ff100=_0x8341e3===null||_0x8341e3===void 0x0?void 0x0:_0x8341e3['originalMeta'];_0x8341e3[_0x5b0154(0x19f)]=textEncoder[_0x5b0154(0x2f6)](b64DecodeUnicode(_0x3ff100)),Object['entries'](_0x8341e3[_0x5b0154(0x28c)])[_0x5b0154(0x25e)](([,_0x20f92f])=>{const _0x4bebd8=_0x5b0154,_0x31cb1f=_0x20f92f[_0x4bebd8(0x19f)];_0x20f92f[_0x4bebd8(0x19f)]=textEncoder[_0x4bebd8(0x2f6)](b64DecodeUnicode(_0x31cb1f));});}return _0x2909df;}async[_0x37a288(0x1bb)](_0x39f3ed,_0x427383){const _0x45b6a9=_0x37a288,{unitID:_0x32236c,type:_0x45d47d,blockID:_0x2c12bb}=_0x427383,_0x5e7238=this[_0x45b6a9(0x29a)]()+'/'+_0x45d47d+_0x45b6a9(0x34c)+_0x32236c+'/block/'+_0x2c12bb;return(await this[_0x45b6a9(0x232)][_0x45b6a9(0x213)](_0x5e7238))[_0x45b6a9(0x2f3)];}async[_0x37a288(0x1ce)](_0x58dd5a,_0x23f312){const _0x45fe57=_0x37a288,{unitID:_0x18bad6,type:_0x400c7f,blockID:_0x2d8eef}=_0x23f312,_0x29cf4e=this[_0x45fe57(0x29a)]()+'/block/'+_0x400c7f+_0x45fe57(0x34c)+_0x18bad6+_0x45fe57(0x227)+_0x2d8eef;return(await this[_0x45fe57(0x232)][_0x45fe57(0x213)](_0x29cf4e))[_0x45fe57(0x2f3)];}async['fetchMissingChangesets'](_0x355909,_0xcfde13){const _0xa92d8b=_0x37a288,{unitID:_0x32ab30,type:_0x6177e4,from:_0x3da6c5,to:_0x2b50d0}=_0xcfde13,_0x9bd94a=this['_getAPIPrefix']()+'/'+_0x6177e4+'/unit/'+_0x32ab30+_0xa92d8b(0x1dd)+_0x3da6c5+'&to='+_0x2b50d0;return(await this[_0xa92d8b(0x232)][_0xa92d8b(0x213)](_0x9bd94a))['body'];}[_0x37a288(0x16d)](){const _0x35a977=_0x37a288;var _0x1ba5a9;return(_0x1ba5a9=this[_0x35a977(0x1ec)][_0x35a977(0x38e)]('SNAPSHOT_URL_KEY'))!==null&&_0x1ba5a9!==void 0x0?_0x1ba5a9:this[_0x35a977(0x29a)]();}[_0x37a288(0x29a)](){const _0x16d776=_0x37a288;var _0x25baeb;const _0x41c35b=this['_configService'][_0x16d776(0x38e)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x25baeb=_0x41c35b===null||_0x41c35b===void 0x0?void 0x0:_0x41c35b[_0x16d776(0x2ea)])!==null&&_0x25baeb!==void 0x0?_0x25baeb:DEFAULT_SNAPSHOT_SERVER_URL;}async[_0x37a288(0x332)](_0x33a699,_0x410001){const _0x505bd4=_0x37a288,_0x3cd553=_0x505bd4(0x2fa)+_0x410001[_0x505bd4(0x2b9)]+_0x505bd4(0x34c)+_0x410001[_0x505bd4(0x196)]+_0x505bd4(0x35d);return(await this[_0x505bd4(0x232)]['get'](_0x3cd553,{'params':{'resourceId':JSON['stringify'](_0x410001[_0x505bd4(0x222)])}}))[_0x505bd4(0x2f3)];}[_0x37a288(0x31e)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}['updateSnapshot'](){const _0x24594d=_0x37a288;throw new Error(_0x24594d(0x339));}[_0x37a288(0x39d)](){const _0x2457b3=_0x37a288;throw new Error(_0x2457b3(0x339));}['saveChangeset'](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x37a288(0x2e7)](){const _0x5152ca=_0x37a288;throw new Error(_0x5152ca(0x339));}[_0x37a288(0x291)](){const _0x586125=_0x37a288;throw new Error(_0x586125(0x339));}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends LocalUndoRedoService{constructor(_0x5b1863,_0x56f97f,_0x1ec502,_0x4773fa,_0x1a5862){const _0x108ece=_0x37a288;super(_0x5b1863,_0x56f97f,_0x1ec502),this[_0x108ece(0x37c)]=_0x4773fa,this[_0x108ece(0x270)]=_0x1a5862;}[_0x37a288(0x154)](_0x683413,_0x34ad31){const _0x5cf589=_0x37a288,_0x5842b2=this[_0x5cf589(0x1b7)](_0x683413);if(_0x5842b2)try{const _0x4ebbdb=this[_0x5cf589(0x383)](_0x5842b2,_0x34ad31);this['_substituteUndoStack'](_0x683413,_0x4ebbdb);}catch(_0x29bb49){this[_0x5cf589(0x270)]['error'](_0x5cf589(0x274),_0x29bb49),this[_0x5cf589(0x366)](_0x683413);}const _0x53c7ce=this[_0x5cf589(0x18c)](_0x683413);if(_0x53c7ce)try{const _0x563d87=this[_0x5cf589(0x383)](_0x53c7ce,_0x34ad31);this['_substituteRedoStack'](_0x683413,_0x563d87);}catch(_0x2c664d){this[_0x5cf589(0x270)][_0x5cf589(0x1cd)](_0x2c664d),this['_clearRedo'](_0x683413);}}['_clearUndo'](_0x5cb564){const _0x39863a=_0x37a288,_0x4b770d=this[_0x39863a(0x1b7)](_0x5cb564);_0x4b770d&&(_0x4b770d[_0x39863a(0x1a6)]=0x0,this[_0x39863a(0x369)]());}[_0x37a288(0x16c)](_0x53631d){const _0x154941=_0x37a288,_0x5860c6=this['_getRedoStack'](_0x53631d);_0x5860c6&&(_0x5860c6['length']=0x0,this[_0x154941(0x369)]());}['_substituteUndoStack'](_0x25e97f,_0x194d7d){const _0x474a08=_0x37a288;this['_undoStacks'][_0x474a08(0x2c4)](_0x25e97f,_0x194d7d),this['_updateStatus']();}[_0x37a288(0x1e8)](_0x3b6f72,_0x999684){const _0x7012d9=_0x37a288;this[_0x7012d9(0x35b)]['set'](_0x3b6f72,_0x999684),this['_updateStatus']();}[_0x37a288(0x383)](_0x5af5e6,_0x4d72ee){const _0x23fce2=_0x37a288,_0x4b3ee2=[];let _0x4438c9=_0x4d72ee,_0xe27ce0=_0x4d72ee;for(let _0x147868=_0x5af5e6[_0x23fce2(0x1a6)]-0x1;_0x147868>=0x0;_0x147868--){const {unitID:_0x390455,undoMutations:_0x584c7c,redoMutations:_0x29ce24}=_0x5af5e6[_0x147868],_0x433e5d=this[_0x23fce2(0x37c)][_0x23fce2(0x230)](_0x4438c9,_0x584c7c),_0x3c89b6=this[_0x23fce2(0x37c)][_0x23fce2(0x230)](_0xe27ce0,_0x29ce24);if(isTransformMutationsWithChangesetFailure(_0x433e5d)||isTransformMutationsWithChangesetFailure(_0x3c89b6)){this[_0x23fce2(0x270)][_0x23fce2(0x1cd)]('[CollaborationUndoRedoService]','transformStack\x20failed!',_0x433e5d,_0x3c89b6);break;}_0x4438c9=_0x433e5d[_0x23fce2(0x37b)],_0xe27ce0=_0x3c89b6[_0x23fce2(0x37b)],_0x4b3ee2[_0x23fce2(0x344)]({'unitID':_0x390455,'undoMutations':_0x433e5d[_0x23fce2(0x2af)],'redoMutations':_0x3c89b6[_0x23fce2(0x2af)]});}return _0x4b3ee2['reverse']();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,ICommandService),__decorateParam(0x2,IContextService),__decorateParam(0x3,ITransformService),__decorateParam(0x4,ILogService)],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends Plugin{constructor(_0x34407c={},_0x27c0f1,_0xe29ce,_0xf60fd0){const _0x60c132=_0x37a288;super(),this[_0x60c132(0x392)]=_0x34407c,this['_logService']=_0x27c0f1,this[_0x60c132(0x299)]=_0xe29ce,this[_0x60c132(0x1ec)]=_0xf60fd0;const {..._0x216248}=merge({},defaultPluginConfig,_0x34407c);if(!_0x216248[_0x60c132(0x170)])throw new Error(_0x60c132(0x1fc));this[_0x60c132(0x392)]=_0x216248,this[_0x60c132(0x1ec)][_0x60c132(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0x216248);}[_0x37a288(0x38b)](){const _0x1dcc5d=_0x37a288;this['_registerDependencies'](),this[_0x1dcc5d(0x2f9)]();}[_0x37a288(0x29f)](){const _0x2a8872=_0x37a288;var _0x47baf8,_0x41b536;if(this[_0x2a8872(0x299)][_0x2a8872(0x315)](IUndoRedoService))this['_logService'][_0x2a8872(0x1cd)](_0x2a8872(0x328),_0x2a8872(0x153));const _0xc38e1=mergeOverrideWithDependencies([[IUndoRedoService,{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this[_0x2a8872(0x392)][_0x2a8872(0x170)]}],[ISnapshotServerService,{'useClass':SnapshotServerOverHTTPService}],[IAuthzIoService,{'useClass':AuthzIoHttpService}],[IImageIoService,{'useClass':CollaborationImageIoService}],[IMentionIOService,{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x47baf8=this['_config'])===null||_0x47baf8===void 0x0?void 0x0:_0x47baf8[_0x2a8872(0x22d)]);if(!((_0x41b536=this[_0x2a8872(0x392)])===null||_0x41b536===void 0x0?void 0x0:_0x41b536[_0x2a8872(0x26f)])){const _0x54cf01=_0xc38e1[_0x2a8872(0x228)](([_0x2a38f3])=>_0x2a38f3===ISingleActiveUnitService);if(_0x54cf01!==-0x1)_0xc38e1[_0x2a8872(0x22c)](_0x54cf01,0x1);}registerDependencies(this[_0x2a8872(0x299)],_0xc38e1);}[_0x37a288(0x2f9)](){const _0x147389=_0x37a288;var _0x3dd7ff,_0x2e480e;this['_injector']['get'](HTTPService)[_0x147389(0x381)]({'priority':0x14,'interceptor':ThresholdInterceptorFactory({'maxParallel':0x6})});if(!((_0x3dd7ff=this[_0x147389(0x392)])===null||_0x3dd7ff===void 0x0?void 0x0:_0x3dd7ff[_0x147389(0x2e2)])){var _0x3ec556;(_0x3ec556=this[_0x147389(0x299)][_0x147389(0x213)](ILocalCacheService,Quantity[_0x147389(0x2e4)]))===null||_0x3ec556===void 0x0||_0x3ec556[_0x147389(0x38a)]();}if((_0x2e480e=this[_0x147389(0x392)])===null||_0x2e480e===void 0x0?void 0x0:_0x2e480e[_0x147389(0x281)])touchDependencies(this[_0x147389(0x299)],[[AuthServerService]]);touchDependencies(this['_injector'],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,'pluginName',_0x37a288(0x1ff)),_defineProperty(UniverCollaborationClientPlugin,_0x37a288(0x17d),name),_defineProperty(UniverCollaborationClientPlugin,_0x37a288(0x386),version),UniverCollaborationClientPlugin=__decorate([DependentOn(UniverLicensePlugin,UniverCollaborationPlugin,UniverNetworkPlugin),__decorateParam(0x1,ILogService),__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,IConfigService)],UniverCollaborationClientPlugin);export{AuthzIoHttpService,AwaitingState,AwaitingWithPendingState,COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,CollaborationController,CollaborationEntity,CollaborationImageIoService,CollaborationSession,CollaborationSessionService,CollaborationSocketService,CollaborationStatus,CollaborationUIEventId,CollaborationUIEventService,CollaborativeUndoRedoService,CommentService,ConflictState,DEFAULT_COLLAB_WEB_SOCKET_URL,DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,DEFAULT_WS_SESSION_TICKET_URL,DataLoaderService,DocCollaborationEntity,FetchingMissState,HEARTBEAT_INTERVAL_KEY,HEARTBEAT_TIMEOUT_KEY,ICollaborationSocketService,ILocalCacheService,INetworkConditionService,ISingleActiveUnitService,LOCAL_CACHE_INTERVAL,LOCAL_CACHE_INTERVAL_KEY,MemberService,MentionIoHttpService,OfflineState,PendingState,REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,RETRY_CONNECTING_MAX_COUNT_KEY,SessionStatus,SheetCollaborationEntity,SheetTransformSelectionsService,SnapshotServerOverHTTPService,SyncedState,UnitStatus,UniverCollaborationClientPlugin,deserializeToCombResponse,getLocalCacheKey,serializeCombRequest};
|