@univerjs-pro/collaboration-client 1.0.4 → 1.1.0

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.
Files changed (91) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/ar-SA.js +1 -1
  4. package/lib/cjs/locale/ca-ES.js +1 -1
  5. package/lib/cjs/locale/de-DE.js +1 -1
  6. package/lib/cjs/locale/en-US.js +1 -1
  7. package/lib/cjs/locale/es-ES.js +1 -1
  8. package/lib/cjs/locale/fa-IR.js +1 -1
  9. package/lib/cjs/locale/fr-FR.js +1 -1
  10. package/lib/cjs/locale/id-ID.js +1 -1
  11. package/lib/cjs/locale/it-IT.js +1 -1
  12. package/lib/cjs/locale/ja-JP.js +1 -1
  13. package/lib/cjs/locale/ko-KR.js +1 -1
  14. package/lib/cjs/locale/pl-PL.js +1 -1
  15. package/lib/cjs/locale/pt-BR.js +1 -1
  16. package/lib/cjs/locale/ru-RU.js +1 -1
  17. package/lib/cjs/locale/sk-SK.js +1 -1
  18. package/lib/cjs/locale/vi-VN.js +1 -1
  19. package/lib/cjs/locale/zh-CN.js +1 -1
  20. package/lib/cjs/locale/zh-HK.js +1 -1
  21. package/lib/cjs/locale/zh-TW.js +1 -1
  22. package/lib/es/facade.js +1 -1
  23. package/lib/es/index.js +1 -1
  24. package/lib/es/locale/ar-SA.js +1 -1
  25. package/lib/es/locale/ca-ES.js +1 -1
  26. package/lib/es/locale/de-DE.js +1 -1
  27. package/lib/es/locale/en-US.js +1 -1
  28. package/lib/es/locale/es-ES.js +1 -1
  29. package/lib/es/locale/fa-IR.js +1 -1
  30. package/lib/es/locale/fr-FR.js +1 -1
  31. package/lib/es/locale/id-ID.js +1 -1
  32. package/lib/es/locale/it-IT.js +1 -1
  33. package/lib/es/locale/ja-JP.js +1 -1
  34. package/lib/es/locale/ko-KR.js +1 -1
  35. package/lib/es/locale/pl-PL.js +1 -1
  36. package/lib/es/locale/pt-BR.js +1 -1
  37. package/lib/es/locale/ru-RU.js +1 -1
  38. package/lib/es/locale/sk-SK.js +1 -1
  39. package/lib/es/locale/vi-VN.js +1 -1
  40. package/lib/es/locale/zh-CN.js +1 -1
  41. package/lib/es/locale/zh-HK.js +1 -1
  42. package/lib/es/locale/zh-TW.js +1 -1
  43. package/lib/facade.js +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/locale/ar-SA.js +1 -1
  46. package/lib/locale/ca-ES.js +1 -1
  47. package/lib/locale/de-DE.js +1 -1
  48. package/lib/locale/en-US.js +1 -1
  49. package/lib/locale/es-ES.js +1 -1
  50. package/lib/locale/fa-IR.js +1 -1
  51. package/lib/locale/fr-FR.js +1 -1
  52. package/lib/locale/id-ID.js +1 -1
  53. package/lib/locale/it-IT.js +1 -1
  54. package/lib/locale/ja-JP.js +1 -1
  55. package/lib/locale/ko-KR.js +1 -1
  56. package/lib/locale/pl-PL.js +1 -1
  57. package/lib/locale/pt-BR.js +1 -1
  58. package/lib/locale/ru-RU.js +1 -1
  59. package/lib/locale/sk-SK.js +1 -1
  60. package/lib/locale/vi-VN.js +1 -1
  61. package/lib/locale/zh-CN.js +1 -1
  62. package/lib/locale/zh-HK.js +1 -1
  63. package/lib/locale/zh-TW.js +1 -1
  64. package/lib/types/controllers/collaboration/collaboration-state.d.ts +51 -11
  65. package/lib/types/facade/f-collaboration.d.ts +3 -4
  66. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +3 -3
  67. package/lib/types/services/collaboration-ui-event/collaboration-ui-event.d.ts +1 -0
  68. package/lib/types/services/data-loader/data-loader.service.d.ts +9 -2
  69. package/lib/types/services/local-cache/local-cache.service.d.ts +11 -6
  70. package/lib/umd/facade.js +1 -1
  71. package/lib/umd/index.js +1 -1
  72. package/lib/umd/locale/ar-SA.js +1 -1
  73. package/lib/umd/locale/ca-ES.js +1 -1
  74. package/lib/umd/locale/de-DE.js +1 -1
  75. package/lib/umd/locale/en-US.js +1 -1
  76. package/lib/umd/locale/es-ES.js +1 -1
  77. package/lib/umd/locale/fa-IR.js +1 -1
  78. package/lib/umd/locale/fr-FR.js +1 -1
  79. package/lib/umd/locale/id-ID.js +1 -1
  80. package/lib/umd/locale/it-IT.js +1 -1
  81. package/lib/umd/locale/ja-JP.js +1 -1
  82. package/lib/umd/locale/ko-KR.js +1 -1
  83. package/lib/umd/locale/pl-PL.js +1 -1
  84. package/lib/umd/locale/pt-BR.js +1 -1
  85. package/lib/umd/locale/ru-RU.js +1 -1
  86. package/lib/umd/locale/sk-SK.js +1 -1
  87. package/lib/umd/locale/vi-VN.js +1 -1
  88. package/lib/umd/locale/zh-CN.js +1 -1
  89. package/lib/umd/locale/zh-HK.js +1 -1
  90. package/lib/umd/locale/zh-TW.js +1 -1
  91. package/package.json +16 -16
@@ -1 +1 @@
1
- const _0x37fcc9=_0x4610;(function(_0x44af7a,_0x8572ab){const _0x3e5a60=_0x4610,_0x222e55=_0x44af7a();while(!![]){try{const _0x22a1a6=-parseInt(_0x3e5a60(0x129))/0x1+-parseInt(_0x3e5a60(0x13c))/0x2*(parseInt(_0x3e5a60(0x126))/0x3)+-parseInt(_0x3e5a60(0x132))/0x4+-parseInt(_0x3e5a60(0x134))/0x5+parseInt(_0x3e5a60(0x12f))/0x6+parseInt(_0x3e5a60(0x139))/0x7+parseInt(_0x3e5a60(0x12d))/0x8;if(_0x22a1a6===_0x8572ab)break;else _0x222e55['push'](_0x222e55['shift']());}catch(_0x4909f0){_0x222e55['push'](_0x222e55['shift']());}}}(_0x14cc,0x4b904));function _0x4610(_0x2a33e1,_0x6cad9d){_0x2a33e1=_0x2a33e1-0x123;const _0x14cc7d=_0x14cc();let _0x46101e=_0x14cc7d[_0x2a33e1];return _0x46101e;}const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':_0x37fcc9(0x131)}},'collabStatus':{'fetchMiss':_0x37fcc9(0x125),'conflict':'編輯衝突','notCollab':_0x37fcc9(0x124),'synced':_0x37fcc9(0x12c),'syncing':'同步中...','offline':_0x37fcc9(0x138)},'session':{'connection-failed':_0x37fcc9(0x127),'will-retry':_0x37fcc9(0x13a),'room-full':_0x37fcc9(0x133),'join-failed':_0x37fcc9(0x13b),'room-not-exists':_0x37fcc9(0x136),'room-permission-denied':_0x37fcc9(0x13e),'room-cnt-exceeds':_0x37fcc9(0x137),'collaboration-timeout':_0x37fcc9(0x12a)},'conflict':{'title':_0x37fcc9(0x135),'content':_0x37fcc9(0x130)},'permission':{'title':_0x37fcc9(0x123),'content':_0x37fcc9(0x12e)},'collaboration':{'single-unit':{'warning':_0x37fcc9(0x128)},'closeRoom':_0x37fcc9(0x12b)},'auth':{'needGotoLoginAlert':_0x37fcc9(0x13d)}}};function _0x14cc(){const _0x202c67=['伺服器未回應協作請求,您的編輯將儲存在本機。','由於協作房間已關閉,編輯權限已被收回。','已同步','8715752OamleO','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','1909326QWPBlk','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','點擊重新連線','172604ttIJgD','此文件協作人數已達上限,您的編輯將暫存於本機。','1549065CQAUEW','協作衝突','加入協作失敗,您的編輯將暫存於本機。','協作文件數量超過限制,您的編輯將暫存於本機。','已離線,編輯將儲存在本機','172984mLcwlO','連線失敗,將在稍後重試連線。','加入協作失敗,請稍後重試,您的編輯將暫存於本機。','324776liMHtv','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','沒有協作權限,您的編輯將暫存於本機。','認證錯誤','本機檔案','正在擷取伺服器資料...','6YFwjHv','連線失敗,請檢查您的網路。','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','445154qlIgGp'];_0x14cc=function(){return _0x202c67;};return _0x14cc();}export{e as default};
1
+ const _0x3b8851=_0x5e7a;(function(_0x458da0,_0x2d6656){const _0x4880f6=_0x5e7a,_0x226fc1=_0x458da0();while(!![]){try{const _0x19d86d=parseInt(_0x4880f6(0x1f3))/0x1*(parseInt(_0x4880f6(0x1db))/0x2)+parseInt(_0x4880f6(0x1de))/0x3+-parseInt(_0x4880f6(0x1e0))/0x4*(-parseInt(_0x4880f6(0x1f1))/0x5)+parseInt(_0x4880f6(0x1ec))/0x6*(-parseInt(_0x4880f6(0x1ea))/0x7)+-parseInt(_0x4880f6(0x1f4))/0x8*(parseInt(_0x4880f6(0x1eb))/0x9)+parseInt(_0x4880f6(0x1ed))/0xa*(parseInt(_0x4880f6(0x1dd))/0xb)+-parseInt(_0x4880f6(0x1ee))/0xc;if(_0x19d86d===_0x2d6656)break;else _0x226fc1['push'](_0x226fc1['shift']());}catch(_0x37d32c){_0x226fc1['push'](_0x226fc1['shift']());}}}(_0x47fc,0x6e244));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':'點擊重新連線'}},'collabStatus':{'fetchMiss':_0x3b8851(0x1e2),'conflict':_0x3b8851(0x1e5),'notCollab':_0x3b8851(0x1e1),'synced':_0x3b8851(0x1e3),'syncing':_0x3b8851(0x1e9),'offline':'已離線,編輯將儲存在本機'},'session':{'connection-failed':_0x3b8851(0x1f2),'will-retry':_0x3b8851(0x1ef),'room-full':_0x3b8851(0x1d9),'join-failed':_0x3b8851(0x1e6),'room-not-exists':'加入協作失敗,您的編輯將暫存於本機。','room-permission-denied':_0x3b8851(0x1e7),'room-cnt-exceeds':'協作文件數量超過限制,您的編輯將暫存於本機。','collaboration-timeout':'伺服器未回應協作請求,您的編輯將儲存在本機。'},'conflict':{'title':_0x3b8851(0x1dc),'content':_0x3b8851(0x1e4)},'permission':{'title':_0x3b8851(0x1df),'content':_0x3b8851(0x1e8)},'collaboration':{'single-unit':{'warning':_0x3b8851(0x1da)},'closeRoom':'由於協作房間已關閉,編輯權限已被收回。'},'auth':{'needGotoLoginAlert':_0x3b8851(0x1f0)}}};function _0x5e7a(_0x3f4940,_0x1cfd05){_0x3f4940=_0x3f4940-0x1d9;const _0x47fc5e=_0x47fc();let _0x5e7a99=_0x47fc5e[_0x3f4940];return _0x5e7a99;}function _0x47fc(){const _0x3bae62=['沒有協作權限,您的編輯將暫存於本機。','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','同步中...','259nbSoVZ','99vKJwxg','47418WhBGHN','70eVkUSc','7097544RBEGxw','連線失敗,將在稍後重試連線。','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','5tMjDit','連線失敗,請檢查您的網路。','503545sraJxd','68984GdEPIv','此文件協作人數已達上限,您的編輯將暫存於本機。','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','2VVXenT','協作衝突','1355739bhtQrz','105480mSqOzv','認證錯誤','113672DbtIwV','本機檔案','正在擷取伺服器資料...','已同步','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','編輯衝突','加入協作失敗,請稍後重試,您的編輯將暫存於本機。'];_0x47fc=function(){return _0x3bae62;};return _0x47fc();}export{e as default};
@@ -47,6 +47,20 @@ export declare enum CollaborationStatus {
47
47
  CONFLICT = "conflict",
48
48
  OFFLINE = "offline"
49
49
  }
50
+ /**
51
+ * The retry of an awaiting changeset. It is handed from one state to the next while the awaiting changeset is
52
+ * kept, so the pending timer, the backoff and the total retry time survive state transitions.
53
+ */
54
+ export interface IResendSchedule {
55
+ /** The pending retry. `undefined` once it has fired and the awaiting changeset was resent. */
56
+ timer: Observable<{
57
+ reqId: number;
58
+ }> | undefined;
59
+ /** The backoff before the next retry. */
60
+ timeout: number;
61
+ /** The total backoff spent on this awaiting changeset, bounded by `MAX_RETRY_TOTAL_TIMEOUT`. */
62
+ total: number;
63
+ }
50
64
  /**
51
65
  * Use state machine to manage syncing states.
52
66
  * An explanation to how these states are transformed to each other.
@@ -115,6 +129,22 @@ export declare abstract class CollaborationState {
115
129
  protected _transformRemoteChangesetByStateCache(changeset: IChangeset): IChangeset;
116
130
  protected _syncEditingCollabCursor(changeset: IChangeset): void;
117
131
  protected _getCurrentRevision(): number;
132
+ /**
133
+ * Servers may deliver a changeset more than once or out of order, e.g. when several server nodes relay
134
+ * changesets, or after the snapshot used to join already contains it. Revisions already applied are ignored.
135
+ */
136
+ protected _isAppliedRevision(changeset: IChangeset): boolean;
137
+ /**
138
+ * The awaiting changeset may come back as a broadcast instead of an acknowledgement, e.g. when the request
139
+ * was committed after the client reconnected with another member id.
140
+ */
141
+ protected _isEchoedAwaitingChangeset(remoteChangeset: IChangeset): boolean;
142
+ /**
143
+ * The acknowledgement echoes the committed changeset, so it can be matched to the awaiting changeset by sid/reqId
144
+ * even when its revision is already contained in the loaded snapshot, e.g. the ack was lost and the awaiting
145
+ * changeset was resent after a reload.
146
+ */
147
+ protected _isAckOfAwaitingChangeset(ack: IAcknowledgedChangeset): boolean;
118
148
  protected _incrementRevisionNumber(): void;
119
149
  protected _executeRemoteChangeset(changeset: IChangeset): void;
120
150
  }
@@ -179,7 +209,7 @@ export declare class AwaitingState extends CollaborationState {
179
209
  private _maxTotalRetryTimeout;
180
210
  private _resendTimer;
181
211
  private _sender;
182
- constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, handler: ICollaborationStateHandler, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService);
212
+ constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, handler: ICollaborationStateHandler, schedule: IResendSchedule | undefined, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService);
183
213
  appendMutation(mutation: IMutationInfo): CollaborationState;
184
214
  onRemoteChangeset(changeset: IChangeset): CollaborationState;
185
215
  onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
@@ -191,7 +221,10 @@ export declare class AwaitingState extends CollaborationState {
191
221
  toggleOnline(): CollaborationState;
192
222
  resend(): void;
193
223
  private _onConflict;
194
- private _resendWithTimeout;
224
+ private _subscribeResendTimer;
225
+ private _runScheduledResend;
226
+ /** The retry of the awaiting changeset, to hand to the next state that keeps the changeset. */
227
+ private _resendSchedule;
195
228
  private _clearScheduledTask;
196
229
  }
197
230
  /**
@@ -208,10 +241,7 @@ export declare class AwaitingWithPendingState extends CollaborationState {
208
241
  private _maxTotalRetryTimeout;
209
242
  private _resendTimer;
210
243
  private _sender;
211
- constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, timer: Observable<{
212
- timeout: number;
213
- reqId: number;
214
- }> | undefined, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService | undefined);
244
+ constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, schedule: IResendSchedule | undefined, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService | undefined);
215
245
  appendMutation(mutation: IMutationInfo): CollaborationState;
216
246
  onRemoteChangeset(changeset: IChangeset): CollaborationState;
217
247
  onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
@@ -223,7 +253,10 @@ export declare class AwaitingWithPendingState extends CollaborationState {
223
253
  toggleOnline(): CollaborationState;
224
254
  resend(): void;
225
255
  private _onConflict;
226
- private _resendWithTimeout;
256
+ private _subscribeResendTimer;
257
+ private _runScheduledResend;
258
+ /** The retry of the awaiting changeset, to hand to the next state that keeps the changeset. */
259
+ private _resendSchedule;
227
260
  private _clearScheduledTask;
228
261
  }
229
262
  /**
@@ -236,10 +269,12 @@ export declare class ConflictState extends CollaborationState {
236
269
  private _isPermissionRej;
237
270
  private readonly _permissionService;
238
271
  private readonly _localeService;
272
+ private readonly _userManagerService;
273
+ private readonly _logService;
239
274
  private readonly _collaborationUIEventService;
240
275
  private readonly localCacheService?;
241
276
  readonly status = CollaborationStatus.CONFLICT;
242
- constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, _isPermissionRej: boolean | undefined, _permissionService: IPermissionService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, revisionService: RevisionService, _localeService: LocaleService, _collaborationUIEventService: CollaborationUIEventService, localCacheService?: ILocalCacheService | undefined);
277
+ constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, _isPermissionRej: boolean | undefined, _permissionService: IPermissionService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, revisionService: RevisionService, _localeService: LocaleService, _userManagerService: UserManagerService, _logService: ILogService, _collaborationUIEventService: CollaborationUIEventService, localCacheService?: ILocalCacheService | undefined);
243
278
  appendMutation(): CollaborationState;
244
279
  onRemoteChangeset(): CollaborationState;
245
280
  onRemoteAck(): CollaborationState;
@@ -280,6 +315,8 @@ export declare class FetchingMissState extends CollaborationState {
280
315
  */
281
316
  private _acknowledgedAwaitingRevision;
282
317
  private _queuedRemoteChangesets;
318
+ /** The retry of the awaiting changeset. The next awaiting state runs it after the fetch. */
319
+ private _resendSchedule;
283
320
  private readonly _injector;
284
321
  private readonly _logService;
285
322
  private readonly _transformService;
@@ -291,13 +328,16 @@ export declare class FetchingMissState extends CollaborationState {
291
328
  * Keep the changeset in `_awaitingChangeset` for transform and sid/reqId de-duplication, and store only
292
329
  * the acknowledged server revision here.
293
330
  */
294
- _acknowledgedAwaitingRevision: Nullable<number>, _queuedRemoteChangesets: IChangeset[], handler: ICollaborationStateHandler, _injector: Injector, revisionService: RevisionService, _logService: ILogService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, _transformService: ITransformService, localCacheService?: ILocalCacheService | undefined);
331
+ _acknowledgedAwaitingRevision: Nullable<number>, _queuedRemoteChangesets: IChangeset[], handler: ICollaborationStateHandler,
332
+ /** The retry of the awaiting changeset. The next awaiting state runs it after the fetch. */
333
+ _resendSchedule: IResendSchedule | undefined, _injector: Injector, revisionService: RevisionService, _logService: ILogService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, _transformService: ITransformService, localCacheService?: ILocalCacheService | undefined);
295
334
  onMissedChangesetFetched(changesets: IChangeset[]): CollaborationState;
296
335
  private _handleRemoteChangesets;
297
336
  private _transformAndApplyRemoteChangeset;
298
337
  private _acknowledgeAwaitingIfReady;
299
338
  private _acknowledgeAwaiting;
300
- private _isEchoedAwaitingChangeset;
339
+ /** The awaiting changeset was committed before the loaded snapshot, so there is no new revision to count. */
340
+ private _dropAcknowledgedAwaiting;
301
341
  resend(): void;
302
342
  appendMutation(mutation: IMutationInfo<object>): CollaborationState;
303
343
  onRemoteChangeset(changeset: IChangeset): CollaborationState;
@@ -305,7 +345,7 @@ export declare class FetchingMissState extends CollaborationState {
305
345
  onRemoteRej(config?: {
306
346
  isPermissionRej: boolean;
307
347
  }): CollaborationState;
308
- onRemoteRetry(): CollaborationState;
348
+ onRemoteRetry(changeset: IChangeset): CollaborationState;
309
349
  toggleOffline(): CollaborationState;
310
350
  toggleOnline(): CollaborationState;
311
351
  private _onConflict;
@@ -7,8 +7,7 @@ import type { IDisposable } from '@univerjs/core';
7
7
  import type { FDocument } from '@univerjs/docs/facade';
8
8
  import type { IMember } from '@univerjs/protocol';
9
9
  import type { FWorkbook } from '@univerjs/sheets/facade';
10
- import { SnapshotService } from '@univerjs-pro/collaboration';
11
- import { CollaborationController, CollaborationStatus } from '@univerjs-pro/collaboration-client';
10
+ import { CollaborationController, CollaborationStatus, DataLoaderService } from '@univerjs-pro/collaboration-client';
12
11
  import { Injector, IUniverInstanceService } from '@univerjs/core';
13
12
  import { FBase } from '@univerjs/core/facade';
14
13
  export interface ICollaborationFlushOptions {
@@ -27,7 +26,7 @@ export declare class FCollaboration extends FBase {
27
26
  private readonly _handler;
28
27
  protected readonly _injector: Injector;
29
28
  protected readonly _univerInstanceService: IUniverInstanceService;
30
- protected readonly _snapshotService: SnapshotService;
29
+ protected readonly _dataLoaderService: DataLoaderService;
31
30
  protected readonly _collaborationController: CollaborationController;
32
31
  constructor(_handler: {
33
32
  getWorkbook: (id: string) => FWorkbook | null;
@@ -36,7 +35,7 @@ export declare class FCollaboration extends FBase {
36
35
  getBase: (id: string) => FBaseFacade | null;
37
36
  getBoard: (id: string) => FBoard | null;
38
37
  getPdf: (id: string) => FPdf | null;
39
- }, _injector: Injector, _univerInstanceService: IUniverInstanceService, _snapshotService: SnapshotService, _collaborationController: CollaborationController);
38
+ }, _injector: Injector, _univerInstanceService: IUniverInstanceService, _dataLoaderService: DataLoaderService, _collaborationController: CollaborationController);
40
39
  /**
41
40
  * Load a Univer Sheet from the server with a unit ID.
42
41
  * @param {string} unitId ID of the Univer Sheet that you would like to load.
@@ -3,7 +3,6 @@ import type { ICollaborationSocket } from '../socket/collaboration-socket.servic
3
3
  import type { ICollaborationClientAdapter } from './collaboration-client-adapter';
4
4
  import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
5
5
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
6
- import { INetworkConditionService } from '../network-condition/network-condition.service';
7
6
  import { ICollaborationSocketService } from '../socket/collaboration-socket.service';
8
7
  import { CollaborationSession, SessionStatus } from './collaboration-session';
9
8
  /**
@@ -17,18 +16,18 @@ export declare class CollaborationSessionService extends Disposable {
17
16
  private readonly _socketService;
18
17
  private readonly _collaborationUIEventService;
19
18
  private readonly _adapter;
20
- private readonly _networkConditionService?;
21
19
  private _sessions;
22
20
  private _pendingSessions;
23
21
  private _sessionChannels;
24
22
  private _socketChannels;
23
+ private _networkConditionService?;
25
24
  /**
26
25
  * Socket for collaboration sessions on the default endpoint.
27
26
  */
28
27
  readonly socket$: import("rxjs").Observable<Nullable<ICollaborationSocket>>;
29
28
  private _status$;
30
29
  status$: import("rxjs").Observable<SessionStatus>;
31
- constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _adapter: ICollaborationClientAdapter, _networkConditionService?: INetworkConditionService | undefined);
30
+ constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _adapter: ICollaborationClientAdapter);
32
31
  private _listenToNetworkCondition;
33
32
  dispose(): void;
34
33
  /**
@@ -66,6 +65,7 @@ export declare class CollaborationSessionService extends Disposable {
66
65
  private _onMessage;
67
66
  private _hasSessionsForEndpoint;
68
67
  private _getSocketChannel;
68
+ private _clearHandshakeTimer;
69
69
  private _rescheduleHeartbeat;
70
70
  private _sendHeartbeat;
71
71
  private _waitForHeartbeatResponse;
@@ -2,6 +2,7 @@ export interface ICollaborationUIEvent {
2
2
  id: CollaborationUIEventId;
3
3
  data?: string;
4
4
  unitID?: string;
5
+ userId?: string;
5
6
  }
6
7
  export declare enum CollaborationUIEventId {
7
8
  OTHER_CLIENT_EDITING = "OTHER_CLIENT_EDITING",
@@ -1,3 +1,4 @@
1
+ import type { ILogContext } from '@univerjs-pro/collaboration';
1
2
  import type { UnitModel } from '@univerjs/core';
2
3
  import { SnapshotService } from '@univerjs-pro/collaboration';
3
4
  import { ILogService, RxDisposable, UniverInstanceType } from '@univerjs/core';
@@ -20,6 +21,12 @@ export declare class DataLoaderService extends RxDisposable {
20
21
  readonly unitLoaded$: import("rxjs").Observable<UnitModel<object, UniverInstanceType>>;
21
22
  constructor(_logService: ILogService, _snapshotService: SnapshotService, _localCacheService?: ILocalCacheService | undefined);
22
23
  dispose(): void;
23
- loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number, subUnitId?: string): Promise<UnitModel | null>;
24
- loadUnit(unitId: string, type: UniverInstanceType, subUnitId?: string): Promise<UnitModel | null>;
24
+ loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number, subUnitId?: string, context?: ILogContext): Promise<UnitModel | null>;
25
+ /**
26
+ * Load a unit from the server. Edits cached locally are replayed on the revision they were cached on, so the
27
+ * snapshot of that revision is loaded when there are any.
28
+ */
29
+ loadUnit(unitId: string, type: UniverInstanceType, subUnitId?: string, context?: ILogContext): Promise<UnitModel | null>;
30
+ private _loadUnit;
31
+ private _loadSnapshot;
25
32
  }
@@ -2,21 +2,26 @@ import type { IChangeset } from '@univerjs-pro/collaboration';
2
2
  import type { IMutationInfo, Nullable, UniverInstanceType } from '@univerjs/core';
3
3
  export interface IUnitCacheData {
4
4
  unitID: string;
5
+ userId?: string | null;
5
6
  type: UniverInstanceType;
6
7
  rev: number;
7
8
  awaitingChangeset: Nullable<IChangeset>;
8
9
  mutations: IMutationInfo[];
9
10
  }
11
+ /**
12
+ * Omit userId to use the current UserManagerService user. An explicit empty string
13
+ * or null targets document-only data, including retries after an account change.
14
+ */
10
15
  export interface ILocalCacheService {
11
- loadOfflineData(unitID: string): Promise<Nullable<IUnitCacheData>>;
12
- saveOfflineData(unitID: string, data: IUnitCacheData): Promise<boolean>;
13
- backupOfflineData?(unitID: string, reason: string): Promise<void>;
14
- clearOfflineData(unitID: string): Promise<void>;
15
- updateOfflineData(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[]): void;
16
+ loadOfflineData(unitID: string, userId?: string | null): Promise<Nullable<IUnitCacheData>>;
17
+ saveOfflineData(unitID: string, data: IUnitCacheData, userId?: string | null): Promise<boolean>;
18
+ backupOfflineData?(unitID: string, reason: string, userId?: string | null): Promise<void>;
19
+ clearOfflineData(unitID: string, userId?: string | null): Promise<void>;
20
+ updateOfflineData(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[], userId?: string | null): void;
16
21
  disableLocalCache(): void;
17
22
  enableLocalCache(): void;
18
23
  exhaustSavingTask(): Promise<void>;
19
24
  saveTaskMap: Map<string, number>;
20
25
  }
21
26
  export declare const ILocalCacheService: import("@wendellhu/redi").IdentifierDecorator<ILocalCacheService>;
22
- export declare function getLocalCacheKey(unitID: string): string;
27
+ export declare function getLocalCacheKey(unitID: string, userId?: string | null): string;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (function(_0x4e80fc,_0x1b7b1f){const _0x43c43f=_0x1419,_0x450b27=_0x4e80fc();while(!![]){try{const _0x465c4e=-parseInt(_0x43c43f(0x1b7))/0x1*(-parseInt(_0x43c43f(0x1a0))/0x2)+parseInt(_0x43c43f(0x19b))/0x3*(-parseInt(_0x43c43f(0x1cc))/0x4)+parseInt(_0x43c43f(0x19c))/0x5*(-parseInt(_0x43c43f(0x1ba))/0x6)+parseInt(_0x43c43f(0x1aa))/0x7*(-parseInt(_0x43c43f(0x1a4))/0x8)+-parseInt(_0x43c43f(0x1f7))/0x9*(-parseInt(_0x43c43f(0x19d))/0xa)+-parseInt(_0x43c43f(0x1fa))/0xb*(parseInt(_0x43c43f(0x1f0))/0xc)+parseInt(_0x43c43f(0x1e8))/0xd;if(_0x465c4e===_0x1b7b1f)break;else _0x450b27['push'](_0x450b27['shift']());}catch(_0x27517c){_0x450b27['push'](_0x450b27['shift']());}}}(_0x4eec,0x29f44),function(_0x1a7dd0,_0x1c1280){const _0x1c0fca=_0x1419;typeof exports=='object'&&typeof module<'u'?_0x1c1280(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define==_0x1c0fca(0x1ed)&&define['amd']?define([_0x1c0fca(0x1cb),_0x1c0fca(0x1a2),'@univerjs/core/facade','@univerjs/core',_0x1c0fca(0x1f4),_0x1c0fca(0x1c3)],_0x1c1280):(_0x1a7dd0=typeof globalThis<'u'?globalThis:_0x1a7dd0||self,_0x1c1280(_0x1a7dd0[_0x1c0fca(0x1af)]={},_0x1a7dd0[_0x1c0fca(0x1b8)],_0x1a7dd0[_0x1c0fca(0x1d4)],_0x1a7dd0['UniverCore'],_0x1a7dd0['UniverProCollaboration'],_0x1a7dd0[_0x1c0fca(0x1c3)]));}(this,function(_0x3d29b0,_0x116e2b,_0x575807,_0x3584e7,_0x272123,_0x149dce){const _0x3e3892=_0x1419;Object[_0x3e3892(0x1bb)](_0x3d29b0,Symbol[_0x3e3892(0x1f8)],{'value':_0x3e3892(0x1f1)});var _0x9c26f0=class extends _0x575807[_0x3e3892(0x1dc)]{get[_0x3e3892(0x1bc)](){const _0x195271=_0x3e3892;return _0x116e2b[_0x195271(0x1bc)];}};_0x575807['FEnum'][_0x3e3892(0x1c5)](_0x9c26f0);var _0x588efa=class extends _0x575807['FEventName']{get['CollaborationStatusChanged'](){const _0x4e6e3d=_0x3e3892;return _0x4e6e3d(0x1e5);}};_0x575807[_0x3e3892(0x19e)]['extend'](_0x588efa);function _0x4e33b1(_0x4da079,_0x3f390e){return function(_0x5a056f,_0x24b931){_0x3f390e(_0x5a056f,_0x24b931,_0x4da079);};}function _0x4246bc(_0x3f1e0b,_0x53ca09,_0x198e8f,_0x1a92f3){const _0x267330=_0x3e3892;var _0x184eba=arguments[_0x267330(0x1ec)],_0x5405d4=_0x184eba<0x3?_0x53ca09:_0x1a92f3===null?_0x1a92f3=Object[_0x267330(0x1c4)](_0x53ca09,_0x198e8f):_0x1a92f3,_0x25539d;if(typeof Reflect=='object'&&typeof Reflect[_0x267330(0x1ae)]==_0x267330(0x1ed))_0x5405d4=Reflect[_0x267330(0x1ae)](_0x3f1e0b,_0x53ca09,_0x198e8f,_0x1a92f3);else{for(var _0x13f7c1=_0x3f1e0b['length']-0x1;_0x13f7c1>=0x0;_0x13f7c1--)(_0x25539d=_0x3f1e0b[_0x13f7c1])&&(_0x5405d4=(_0x184eba<0x3?_0x25539d(_0x5405d4):_0x184eba>0x3?_0x25539d(_0x53ca09,_0x198e8f,_0x5405d4):_0x25539d(_0x53ca09,_0x198e8f))||_0x5405d4);}return _0x184eba>0x3&&_0x5405d4&&Object[_0x267330(0x1bb)](_0x53ca09,_0x198e8f,_0x5405d4),_0x5405d4;}let _0x27b724=class extends _0x575807['FBase']{constructor(_0x3f18fd,_0x53ad63,_0x1be216,_0xf87e78,_0x2e43fa){const _0xe36972=_0x3e3892;super(),this[_0xe36972(0x1da)]=_0x3f18fd,this['_injector']=_0x53ad63,this[_0xe36972(0x1a8)]=_0x1be216,this[_0xe36972(0x1b6)]=_0xf87e78,this[_0xe36972(0x1d1)]=_0x2e43fa;}async[_0x3e3892(0x1c2)](_0x6651ba,_0xb5fc2b){const _0x2ebbfb=_0x3e3892;return await this[_0x2ebbfb(0x1b6)][_0x2ebbfb(0x1d2)](_0x6651ba,0x0,_0xb5fc2b)?(await this[_0x2ebbfb(0x1d1)][_0x2ebbfb(0x1b2)](_0x6651ba),this[_0x2ebbfb(0x1da)][_0x2ebbfb(0x1a5)](_0x6651ba)):null;}async['loadDocAsync'](_0x56f975,_0x2b4eaa){const _0x22afa1=_0x3e3892;return await this['_snapshotService']['loadDoc'](_0x56f975,0x0,_0x2b4eaa)?(await this[_0x22afa1(0x1d1)][_0x22afa1(0x1b2)](_0x56f975),this[_0x22afa1(0x1da)]['getDocument'](_0x56f975)):null;}async['loadBaseAsync'](_0x9fa446,_0x24980d){const _0x279011=_0x3e3892;return await this[_0x279011(0x1b6)][_0x279011(0x1c6)](_0x9fa446,0x0,_0x24980d)?(await this[_0x279011(0x1d1)]['readyForCollab'](_0x9fa446),this['_handler']['getBase'](_0x9fa446)):null;}async[_0x3e3892(0x1e4)](_0x216a23,_0x28b6a8){const _0x1db230=_0x3e3892;return await this[_0x1db230(0x1b6)][_0x1db230(0x1b3)](_0x216a23,0x0,_0x28b6a8)?(await this[_0x1db230(0x1d1)][_0x1db230(0x1b2)](_0x216a23),this[_0x1db230(0x1da)][_0x1db230(0x1e7)](_0x216a23)):null;}async['loadBoardAsync'](_0x517cb6,_0x258034){const _0x1c7fee=_0x3e3892;return await this[_0x1c7fee(0x1b6)]['loadBoard'](_0x517cb6,0x0,_0x258034)?(await this[_0x1c7fee(0x1d1)]['readyForCollab'](_0x517cb6),this[_0x1c7fee(0x1da)]['getBoard'](_0x517cb6)):null;}async[_0x3e3892(0x1d8)](_0x501482,_0x149f2d){const _0x44376b=_0x3e3892;return await this[_0x44376b(0x1b6)][_0x44376b(0x1bd)](_0x501482,0x0,_0x149f2d)?(await this['_collaborationController'][_0x44376b(0x1b2)](_0x501482),this[_0x44376b(0x1da)][_0x44376b(0x1a9)](_0x501482)):null;}[_0x3e3892(0x1b1)](_0x2d84c8,_0x32936c){const _0x363935=_0x3e3892;let _0x57537f=this['_injector']['get'](_0x116e2b['MemberService'])[_0x363935(0x1b4)](_0x2d84c8)[_0x363935(0x1df)]((0x0,_0x149dce[_0x363935(0x1c1)])(_0x5ee84f=>_0x5ee84f[_0x363935(0x1a1)]))[_0x363935(0x1bf)](_0x2f58ad=>_0x32936c(Array['from'](_0x2f58ad[_0x363935(0x1fc)]())));return(0x0,_0x3584e7[_0x363935(0x1ca)])(_0x57537f);}[_0x3e3892(0x1e0)](_0x314b95){const _0x599885=_0x3e3892;let _0x141848=this[_0x599885(0x1ef)](_0x314b95);if(!_0x141848)return _0x116e2b[_0x599885(0x1bc)]['NOT_COLLAB'];let _0x1691e2=this[_0x599885(0x1d1)][_0x599885(0x1e3)](_0x141848);return(_0x1691e2==null?void 0x0:_0x1691e2[_0x599885(0x1d9)][_0x599885(0x19f)])??_0x116e2b['CollaborationStatus'][_0x599885(0x1b0)];}['flush'](_0x148a81,_0x140621={}){const _0x19e428=_0x3e3892;let _0x194981=this['_resolveUnitId'](_0x148a81);if(!_0x194981)return Promise[_0x19e428(0x1ce)](Error(_0x19e428(0x1fb)));let _0x539173=this[_0x19e428(0x1d1)]['getCollabEntity'](_0x194981);if(!_0x539173)return Promise[_0x19e428(0x1ce)](Error(_0x19e428(0x1f6)+_0x194981+_0x19e428(0x1dd)));let _0x73fff4=_0x539173[_0x19e428(0x1d9)]['status'];if(_0x73fff4===_0x116e2b[_0x19e428(0x1bc)]['SYNCED'])return Promise[_0x19e428(0x1ea)]();let _0x521360=_0x3eb8ed(_0x194981,_0x73fff4);if(_0x521360)return Promise[_0x19e428(0x1ce)](_0x521360);let _0x3eff41=_0x140621['timeout']??0x7530;return new Promise((_0x345ba3,_0x117ef4)=>{const _0x50e6fb=_0x19e428;let _0x43b999=!0x1,_0x17c2c9=null,_0x5bd5a8=setTimeout(()=>{const _0x603c3d=_0x1419;_0x43b999=!0x0,_0x17c2c9==null||_0x17c2c9[_0x603c3d(0x1e9)](),_0x117ef4(Error(_0x603c3d(0x1c7)+_0x194981+_0x603c3d(0x1e1)+_0x3eff41+_0x603c3d(0x1a6)));},_0x3eff41),_0x565b9b=()=>{const _0x114e6f=_0x1419;_0x43b999=!0x0,clearTimeout(_0x5bd5a8),_0x17c2c9==null||_0x17c2c9[_0x114e6f(0x1e9)]();};_0x17c2c9=_0x539173['status$'][_0x50e6fb(0x1bf)](_0x3d8a32=>{const _0x4e6b2d=_0x50e6fb;if(_0x43b999)return;if(_0x3d8a32===_0x116e2b['CollaborationStatus'][_0x4e6b2d(0x1e2)]){_0x565b9b(),_0x345ba3();return;}let _0x5e9aae=_0x3eb8ed(_0x194981,_0x3d8a32);_0x5e9aae&&(_0x565b9b(),_0x117ef4(_0x5e9aae));});});}[_0x3e3892(0x1ef)](_0x96fc0c){const _0x584653=_0x3e3892;var _0x205a60;return _0x96fc0c||((_0x205a60=this['_univerInstanceService'][_0x584653(0x1c0)]())==null?void 0x0:_0x205a60['getUnitId']());}};_0x27b724=_0x4246bc([_0x4e33b1(0x1,(0x0,_0x3584e7[_0x3e3892(0x1e6)])(_0x3584e7[_0x3e3892(0x1ee)])),_0x4e33b1(0x2,_0x3584e7[_0x3e3892(0x1c9)]),_0x4e33b1(0x3,(0x0,_0x3584e7[_0x3e3892(0x1e6)])(_0x272123['SnapshotService'])),_0x4e33b1(0x4,(0x0,_0x3584e7[_0x3e3892(0x1e6)])(_0x116e2b[_0x3e3892(0x1d5)]))],_0x27b724);function _0x3eb8ed(_0x1ed197,_0x1e3014){const _0x1f1409=_0x3e3892;return _0x1e3014===_0x116e2b['CollaborationStatus'][_0x1f1409(0x1ad)]||_0x1e3014===_0x116e2b['CollaborationStatus'][_0x1f1409(0x1b0)]?Error(_0x1f1409(0x1b5)+_0x1ed197+'\x22\x20while\x20collaboration\x20status\x20is\x20'+_0x1e3014+'.'):null;}var _0x234dd3=class extends _0x575807[_0x3e3892(0x1d0)]{[_0x3e3892(0x1d3)](_0x23cb11){const _0x3939b9=_0x3e3892;let _0x5cca81=_0x23cb11[_0x3939b9(0x1cd)](_0x116e2b[_0x3939b9(0x1d5)]);this[_0x3939b9(0x1d6)](this[_0x3939b9(0x1c8)](this[_0x3939b9(0x1a3)][_0x3939b9(0x1e5)],()=>{const _0x4f084d=_0x3939b9;let _0x36c070=new _0x3584e7['DisposableCollection'](),_0x144aa6=_0x5cca81[_0x4f084d(0x1b9)][_0x4f084d(0x1bf)](_0x451ff5=>{const _0x35a6b5=_0x4f084d;let _0x4427b9=_0x451ff5[_0x35a6b5(0x1de)]['subscribe'](_0x579df4=>{const _0x169f7a=_0x35a6b5;let _0x278fb1={'unitId':_0x451ff5[_0x169f7a(0x1cf)],'status':_0x579df4};this['fireEvent'](this[_0x169f7a(0x1a3)][_0x169f7a(0x1e5)],_0x278fb1);});_0x36c070[_0x35a6b5(0x1eb)]((0x0,_0x3584e7['toDisposable'])(_0x4427b9));});return _0x36c070[_0x4f084d(0x1eb)]((0x0,_0x3584e7[_0x4f084d(0x1ca)])(_0x144aa6)),_0x36c070;}));}[_0x3e3892(0x1f5)](){const _0x3154bd=_0x3e3892;return this[_0x3154bd(0x1a7)][_0x3154bd(0x1f3)](_0x27b724,{'getWorkbook':_0xc8181e=>this['getWorkbook'](_0xc8181e),'getDocument':_0x57d9f7=>this[_0x3154bd(0x1ac)](_0x57d9f7),'getPresentation':_0x472739=>this[_0x3154bd(0x1e7)](_0x472739),'getBase':_0x18668d=>this[_0x3154bd(0x1f2)](_0x18668d),'getBoard':_0x46537=>this[_0x3154bd(0x1db)](_0x46537),'getPdf':_0x2f1be6=>this[_0x3154bd(0x1a9)](_0x2f1be6)});}[_0x3e3892(0x1f9)](_0x31f6d4,_0x457ad9,_0x2a3a3a){const _0x4f5c67=_0x3e3892;return this['_injector']['get'](_0x116e2b[_0x4f5c67(0x1ab)])[_0x4f5c67(0x1fd)](_0x31f6d4,_0x457ad9,_0x2a3a3a);}[_0x3e3892(0x1be)](_0x26653d,_0x4d2050,_0x3b6c7c){const _0x4d3559=_0x3e3892;return this[_0x4d3559(0x1a7)][_0x4d3559(0x1cd)](_0x116e2b[_0x4d3559(0x1ab)])['loadUnitOfRevision'](_0x26653d,_0x4d2050,_0x3b6c7c);}};_0x575807[_0x3e3892(0x1d0)][_0x3e3892(0x1c5)](_0x234dd3),Object['defineProperty'](_0x3d29b0,_0x3e3892(0x1d7),{'enumerable':!0x0,'get':function(){return _0x27b724;}});}));function _0x1419(_0x48810a,_0x4192bc){_0x48810a=_0x48810a-0x19b;const _0x4eec19=_0x4eec();let _0x1419cd=_0x4eec19[_0x48810a];return _0x1419cd;}function _0x4eec(){const _0x478ae7=['1636665jVHpfW','10HPRniX','FEventName','status','250WCikJb','members$','@univerjs-pro/collaboration-client','Event','874312GnpSeG','getWorkbook','ms.','_injector','_univerInstanceService','getPdf','21BpGIvc','DataLoaderService','getDocument','CONFLICT','decorate','UniverProCollaborationClientFacade','NOT_COLLAB','subscribeCollaborators','readyForCollab','loadSlide','waitForRoom$','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','_snapshotService','560bomgPw','UniverProCollaborationClient','entityInit$','6CmgSTq','defineProperty','CollaborationStatus','loadPdf','loadServerUnitOfRevision','subscribe','getFocusedUnit','switchMap','loadSheetAsync','rxjs','getOwnPropertyDescriptor','extend','loadBase','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','registerEventHandler','IUniverInstanceService','toDisposable','exports','18476SqUkQi','get','reject','unitID','FUniver','_collaborationController','loadSheet','_initialize','UniverCoreFacade','CollaborationController','disposeWithMe','FCollaboration','loadPdfAsync','state','_handler','getBoard','FEnum','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','status$','pipe','getCollaborationStatus','\x22\x20after\x20','SYNCED','getCollabEntity','loadSlideAsync','CollaborationStatusChanged','Inject','getPresentation','12132367PrhwvN','unsubscribe','resolve','add','length','function','Injector','_resolveUnitId','76044BNLFKZ','Module','getBase','createInstance','@univerjs-pro/collaboration','getCollaboration','[FCollaboration]:\x20Unit\x20\x22','1263951zmmMTy','toStringTag','loadServerUnit','253CZHpgZ','[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.','values','loadUnit','111tsAAZn'];_0x4eec=function(){return _0x478ae7;};return _0x4eec();}
1
+ function _0x128c(){const _0x360678=['7732182JtusmM','NOT_COLLAB','object','CollaborationController','CONFLICT','IUniverInstanceService','readyForCollab','getFocusedUnit','disposeWithMe','loadDocAsync','entityInit$','CollaborationStatus','MemberService','UNIVER_SHEET','loadUnit','_collaborationController','waitForRoom$','getWorkbook','6190940lTMfgH','UniverProCollaborationClientFacade','add','flush','6408832DdYOPn','1vNdgxw','switchMap','_univerInstanceService','Event','@univerjs-pro/collaboration-client','2452154eLHuiL','Injector','status','@univerjs/core/facade','getOwnPropertyDescriptor','_resolveUnitId','getPdf','FEventName','reject','loadBoardAsync','UniverProCollaborationClient','DataLoaderService','UNIVER_DOC','createInstance','loadServerUnit','26071398mbDfQe','toDisposable','length','getCollabEntity','unsubscribe','92925dOoRpP','rxjs','getBoard','10787637GkqnAH','FBase','UniverCoreFacade','pipe','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','state','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','loadPdfAsync','\x22\x20after\x20','DisposableCollection','CollaborationStatusChanged','UNIVER_PDF','_dataLoaderService','defineProperty','loadBaseAsync','status$','FCollaboration','_handler','loadUnitOfRevision','\x22\x20while\x20collaboration\x20status\x20is\x20','UNIVER_BOARD','toStringTag','Module','subscribe','function','resolve','get','UniverInstanceType','FEnum','Inject','SYNCED','24MXrhDG','from','[FCollaboration]:\x20Unit\x20\x22','getBase','UNIVER_BASE','@univerjs/core','decorate','loadSheetAsync','extend','subscribeCollaborators','amd','loadServerUnitOfRevision','members$','unitID','getPresentation','_injector','registerEventHandler'];_0x128c=function(){return _0x360678;};return _0x128c();}function _0x3b1b(_0x514561,_0x53dfd4){_0x514561=_0x514561-0x136;const _0x128c2a=_0x128c();let _0x3b1ba4=_0x128c2a[_0x514561];return _0x3b1ba4;}(function(_0x33c55c,_0x1b55a9){const _0x55dee1=_0x3b1b,_0x3aade2=_0x33c55c();while(!![]){try{const _0x4c0a9e=-parseInt(_0x55dee1(0x154))/0x1*(parseInt(_0x55dee1(0x159))/0x2)+-parseInt(_0x55dee1(0x16d))/0x3*(-parseInt(_0x55dee1(0x18f))/0x4)+parseInt(_0x55dee1(0x14f))/0x5+parseInt(_0x55dee1(0x13d))/0x6+parseInt(_0x55dee1(0x170))/0x7+parseInt(_0x55dee1(0x153))/0x8+-parseInt(_0x55dee1(0x168))/0x9;if(_0x4c0a9e===_0x1b55a9)break;else _0x3aade2['push'](_0x3aade2['shift']());}catch(_0x3e5dc7){_0x3aade2['push'](_0x3aade2['shift']());}}}(_0x128c,0xe38bf),function(_0x4325e1,_0x4cca04){const _0x129dd9=_0x3b1b;typeof exports==_0x129dd9(0x13f)&&typeof module<'u'?_0x4cca04(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define==_0x129dd9(0x188)&&define[_0x129dd9(0x136)]?define(['exports',_0x129dd9(0x158),_0x129dd9(0x15c),_0x129dd9(0x194),'rxjs'],_0x4cca04):(_0x4325e1=typeof globalThis<'u'?globalThis:_0x4325e1||self,_0x4cca04(_0x4325e1[_0x129dd9(0x150)]={},_0x4325e1[_0x129dd9(0x163)],_0x4325e1[_0x129dd9(0x172)],_0x4325e1['UniverCore'],_0x4325e1[_0x129dd9(0x16e)]));}(this,function(_0x1d5524,_0x23fd0b,_0x35a254,_0x43e644,_0x2aa361){const _0x2dd743=_0x3b1b;Object[_0x2dd743(0x17d)](_0x1d5524,Symbol[_0x2dd743(0x185)],{'value':_0x2dd743(0x186)});var _0x560aec=class extends _0x35a254[_0x2dd743(0x18c)]{get[_0x2dd743(0x148)](){const _0x6919ab=_0x2dd743;return _0x23fd0b[_0x6919ab(0x148)];}};_0x35a254[_0x2dd743(0x18c)][_0x2dd743(0x197)](_0x560aec);var _0x562c24=class extends _0x35a254[_0x2dd743(0x160)]{get['CollaborationStatusChanged'](){const _0x1f3463=_0x2dd743;return _0x1f3463(0x17a);}};_0x35a254[_0x2dd743(0x160)]['extend'](_0x562c24);function _0x1d1bb8(_0x2ca686,_0x116160){return function(_0x396941,_0x3065fd){_0x116160(_0x396941,_0x3065fd,_0x2ca686);};}function _0x598a38(_0x16fd5d,_0x384e64,_0x4ddaea,_0x1c54d9){const _0x52d387=_0x2dd743;var _0x3efc6d=arguments[_0x52d387(0x16a)],_0x53e171=_0x3efc6d<0x3?_0x384e64:_0x1c54d9===null?_0x1c54d9=Object[_0x52d387(0x15d)](_0x384e64,_0x4ddaea):_0x1c54d9,_0x48dd96;if(typeof Reflect=='object'&&typeof Reflect['decorate']==_0x52d387(0x188))_0x53e171=Reflect[_0x52d387(0x195)](_0x16fd5d,_0x384e64,_0x4ddaea,_0x1c54d9);else{for(var _0x53f12e=_0x16fd5d['length']-0x1;_0x53f12e>=0x0;_0x53f12e--)(_0x48dd96=_0x16fd5d[_0x53f12e])&&(_0x53e171=(_0x3efc6d<0x3?_0x48dd96(_0x53e171):_0x3efc6d>0x3?_0x48dd96(_0x384e64,_0x4ddaea,_0x53e171):_0x48dd96(_0x384e64,_0x4ddaea))||_0x53e171);}return _0x3efc6d>0x3&&_0x53e171&&Object['defineProperty'](_0x384e64,_0x4ddaea,_0x53e171),_0x53e171;}let _0x36cb72=class extends _0x35a254[_0x2dd743(0x171)]{constructor(_0x2cda6d,_0x56e978,_0x3a99f8,_0xeadb36,_0x3bae3b){const _0x317ae8=_0x2dd743;super(),this['_handler']=_0x2cda6d,this[_0x317ae8(0x13b)]=_0x56e978,this['_univerInstanceService']=_0x3a99f8,this[_0x317ae8(0x17c)]=_0xeadb36,this[_0x317ae8(0x14c)]=_0x3bae3b;}async[_0x2dd743(0x196)](_0x4cd708,_0xed34f3){const _0x488f14=_0x2dd743;return await this[_0x488f14(0x17c)]['loadUnit'](_0x4cd708,_0x43e644[_0x488f14(0x18b)][_0x488f14(0x14a)],void 0x0,_0xed34f3)?(await this[_0x488f14(0x14c)][_0x488f14(0x143)](_0x4cd708),this[_0x488f14(0x181)][_0x488f14(0x14e)](_0x4cd708)):null;}async[_0x2dd743(0x146)](_0x486264,_0x49b879){const _0x11518d=_0x2dd743;return await this[_0x11518d(0x17c)][_0x11518d(0x14b)](_0x486264,_0x43e644['UniverInstanceType'][_0x11518d(0x165)],void 0x0,_0x49b879)?(await this['_collaborationController'][_0x11518d(0x143)](_0x486264),this[_0x11518d(0x181)]['getDocument'](_0x486264)):null;}async[_0x2dd743(0x17e)](_0x2d4afe,_0x1a57ee){const _0x2baec6=_0x2dd743;return await this[_0x2baec6(0x17c)][_0x2baec6(0x14b)](_0x2d4afe,_0x43e644['UniverInstanceType'][_0x2baec6(0x193)],void 0x0,_0x1a57ee)?(await this[_0x2baec6(0x14c)]['readyForCollab'](_0x2d4afe),this[_0x2baec6(0x181)][_0x2baec6(0x192)](_0x2d4afe)):null;}async['loadSlideAsync'](_0x311b63,_0x5372e1){const _0x8de62c=_0x2dd743;return await this[_0x8de62c(0x17c)][_0x8de62c(0x14b)](_0x311b63,_0x43e644[_0x8de62c(0x18b)]['UNIVER_SLIDE'],void 0x0,_0x5372e1)?(await this[_0x8de62c(0x14c)][_0x8de62c(0x143)](_0x311b63),this[_0x8de62c(0x181)][_0x8de62c(0x13a)](_0x311b63)):null;}async[_0x2dd743(0x162)](_0x36af75,_0x2675b9){const _0x1cec0b=_0x2dd743;return await this['_dataLoaderService'][_0x1cec0b(0x14b)](_0x36af75,_0x43e644[_0x1cec0b(0x18b)][_0x1cec0b(0x184)],void 0x0,_0x2675b9)?(await this[_0x1cec0b(0x14c)][_0x1cec0b(0x143)](_0x36af75),this['_handler'][_0x1cec0b(0x16f)](_0x36af75)):null;}async[_0x2dd743(0x177)](_0x19dcde,_0x40a754){const _0x2b4089=_0x2dd743;return await this[_0x2b4089(0x17c)][_0x2b4089(0x14b)](_0x19dcde,_0x43e644[_0x2b4089(0x18b)][_0x2b4089(0x17b)],void 0x0,_0x40a754)?(await this[_0x2b4089(0x14c)]['readyForCollab'](_0x19dcde),this[_0x2b4089(0x181)][_0x2b4089(0x15f)](_0x19dcde)):null;}[_0x2dd743(0x198)](_0x39ad9a,_0x4b278d){const _0x16a217=_0x2dd743;let _0x294ad6=this['_injector'][_0x16a217(0x18a)](_0x23fd0b[_0x16a217(0x149)])[_0x16a217(0x14d)](_0x39ad9a)[_0x16a217(0x173)]((0x0,_0x2aa361[_0x16a217(0x155)])(_0x506b3a=>_0x506b3a[_0x16a217(0x138)]))['subscribe'](_0x4a2c77=>_0x4b278d(Array[_0x16a217(0x190)](_0x4a2c77['values']())));return(0x0,_0x43e644['toDisposable'])(_0x294ad6);}['getCollaborationStatus'](_0x39c8e3){const _0x3e99fe=_0x2dd743;let _0x106b7a=this[_0x3e99fe(0x15e)](_0x39c8e3);if(!_0x106b7a)return _0x23fd0b['CollaborationStatus'][_0x3e99fe(0x13e)];let _0x109d08=this[_0x3e99fe(0x14c)][_0x3e99fe(0x16b)](_0x106b7a);return(_0x109d08==null?void 0x0:_0x109d08[_0x3e99fe(0x175)][_0x3e99fe(0x15b)])??_0x23fd0b[_0x3e99fe(0x148)][_0x3e99fe(0x13e)];}[_0x2dd743(0x152)](_0x50dfdb,_0x4a0220={}){const _0x4ebc1b=_0x2dd743;let _0xf50fe7=this[_0x4ebc1b(0x15e)](_0x50dfdb);if(!_0xf50fe7)return Promise[_0x4ebc1b(0x161)](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0x7a4a45=this[_0x4ebc1b(0x14c)][_0x4ebc1b(0x16b)](_0xf50fe7);if(!_0x7a4a45)return Promise[_0x4ebc1b(0x161)](Error(_0x4ebc1b(0x191)+_0xf50fe7+_0x4ebc1b(0x176)));let _0x2a0678=_0x7a4a45[_0x4ebc1b(0x175)][_0x4ebc1b(0x15b)];if(_0x2a0678===_0x23fd0b[_0x4ebc1b(0x148)][_0x4ebc1b(0x18e)])return Promise[_0x4ebc1b(0x189)]();let _0x37d58d=_0x5ec889(_0xf50fe7,_0x2a0678);if(_0x37d58d)return Promise['reject'](_0x37d58d);let _0x25e9ff=_0x4a0220['timeout']??0x7530;return new Promise((_0x18664e,_0x34400d)=>{const _0x518b86=_0x4ebc1b;let _0x117992=!0x1,_0x1a873e=null,_0x152f7b=setTimeout(()=>{const _0x1676f2=_0x3b1b;_0x117992=!0x0,_0x1a873e==null||_0x1a873e[_0x1676f2(0x16c)](),_0x34400d(Error('[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22'+_0xf50fe7+_0x1676f2(0x178)+_0x25e9ff+'ms.'));},_0x25e9ff),_0x1834f3=()=>{const _0x27fef5=_0x3b1b;_0x117992=!0x0,clearTimeout(_0x152f7b),_0x1a873e==null||_0x1a873e[_0x27fef5(0x16c)]();};_0x1a873e=_0x7a4a45[_0x518b86(0x17f)][_0x518b86(0x187)](_0x2e5b6f=>{const _0x5a2066=_0x518b86;if(_0x117992)return;if(_0x2e5b6f===_0x23fd0b[_0x5a2066(0x148)]['SYNCED']){_0x1834f3(),_0x18664e();return;}let _0x12ad62=_0x5ec889(_0xf50fe7,_0x2e5b6f);_0x12ad62&&(_0x1834f3(),_0x34400d(_0x12ad62));});});}[_0x2dd743(0x15e)](_0x15b8f7){const _0x55015c=_0x2dd743;var _0x20bca3;return _0x15b8f7||((_0x20bca3=this[_0x55015c(0x156)][_0x55015c(0x144)]())==null?void 0x0:_0x20bca3['getUnitId']());}};_0x36cb72=_0x598a38([_0x1d1bb8(0x1,(0x0,_0x43e644[_0x2dd743(0x18d)])(_0x43e644[_0x2dd743(0x15a)])),_0x1d1bb8(0x2,_0x43e644[_0x2dd743(0x142)]),_0x1d1bb8(0x3,(0x0,_0x43e644[_0x2dd743(0x18d)])(_0x23fd0b[_0x2dd743(0x164)])),_0x1d1bb8(0x4,(0x0,_0x43e644['Inject'])(_0x23fd0b[_0x2dd743(0x140)]))],_0x36cb72);function _0x5ec889(_0x45b850,_0x12d8de){const _0x4cf263=_0x2dd743;return _0x12d8de===_0x23fd0b['CollaborationStatus'][_0x4cf263(0x141)]||_0x12d8de===_0x23fd0b[_0x4cf263(0x148)]['NOT_COLLAB']?Error(_0x4cf263(0x174)+_0x45b850+_0x4cf263(0x183)+_0x12d8de+'.'):null;}var _0x24a4b5=class extends _0x35a254['FUniver']{['_initialize'](_0x520664){const _0x405076=_0x2dd743;let _0x7fba16=_0x520664['get'](_0x23fd0b[_0x405076(0x140)]);this[_0x405076(0x145)](this[_0x405076(0x13c)](this[_0x405076(0x157)]['CollaborationStatusChanged'],()=>{const _0x4a16a1=_0x405076;let _0x450461=new _0x43e644[(_0x4a16a1(0x179))](),_0x195f42=_0x7fba16[_0x4a16a1(0x147)][_0x4a16a1(0x187)](_0xec8592=>{const _0x3367ed=_0x4a16a1;let _0x59b9e7=_0xec8592['status$'][_0x3367ed(0x187)](_0xe2805b=>{const _0x498c7f=_0x3367ed;let _0x4adf7b={'unitId':_0xec8592[_0x498c7f(0x139)],'status':_0xe2805b};this['fireEvent'](this['Event']['CollaborationStatusChanged'],_0x4adf7b);});_0x450461['add']((0x0,_0x43e644['toDisposable'])(_0x59b9e7));});return _0x450461[_0x4a16a1(0x151)]((0x0,_0x43e644[_0x4a16a1(0x169)])(_0x195f42)),_0x450461;}));}['getCollaboration'](){const _0x2e23f0=_0x2dd743;return this[_0x2e23f0(0x13b)][_0x2e23f0(0x166)](_0x36cb72,{'getWorkbook':_0xad1d66=>this[_0x2e23f0(0x14e)](_0xad1d66),'getDocument':_0x5948a1=>this['getDocument'](_0x5948a1),'getPresentation':_0x315c9a=>this[_0x2e23f0(0x13a)](_0x315c9a),'getBase':_0xa177ff=>this[_0x2e23f0(0x192)](_0xa177ff),'getBoard':_0xc448c2=>this[_0x2e23f0(0x16f)](_0xc448c2),'getPdf':_0x3fbbc2=>this[_0x2e23f0(0x15f)](_0x3fbbc2)});}[_0x2dd743(0x167)](_0x33f262,_0x3ef435,_0x523005){const _0xce3e7a=_0x2dd743;return this[_0xce3e7a(0x13b)][_0xce3e7a(0x18a)](_0x23fd0b['DataLoaderService'])[_0xce3e7a(0x14b)](_0x33f262,_0x3ef435,_0x523005);}[_0x2dd743(0x137)](_0x4a7e0e,_0x5db160,_0x179f21){const _0xbb9c82=_0x2dd743;return this[_0xbb9c82(0x13b)]['get'](_0x23fd0b['DataLoaderService'])[_0xbb9c82(0x182)](_0x4a7e0e,_0x5db160,_0x179f21);}};_0x35a254['FUniver'][_0x2dd743(0x197)](_0x24a4b5),Object[_0x2dd743(0x17d)](_0x1d5524,_0x2dd743(0x180),{'enumerable':!0x0,'get':function(){return _0x36cb72;}});}));