@univerjs-pro/collaboration-client 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) 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/changeset-submitter.d.ts +2 -2
  65. package/lib/types/controllers/collaboration/collaboration-entity.d.ts +4 -4
  66. package/lib/types/controllers/collaboration/collaboration-state.d.ts +24 -22
  67. package/lib/types/facade/f-event.d.ts +3 -1
  68. package/lib/types/index.d.ts +1 -1
  69. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +1 -0
  70. package/lib/types/services/collaboration-ui-event/collaboration-ui-event.d.ts +2 -0
  71. package/lib/umd/facade.js +1 -1
  72. package/lib/umd/index.js +1 -1
  73. package/lib/umd/locale/ar-SA.js +1 -1
  74. package/lib/umd/locale/ca-ES.js +1 -1
  75. package/lib/umd/locale/de-DE.js +1 -1
  76. package/lib/umd/locale/en-US.js +1 -1
  77. package/lib/umd/locale/es-ES.js +1 -1
  78. package/lib/umd/locale/fa-IR.js +1 -1
  79. package/lib/umd/locale/fr-FR.js +1 -1
  80. package/lib/umd/locale/id-ID.js +1 -1
  81. package/lib/umd/locale/it-IT.js +1 -1
  82. package/lib/umd/locale/ja-JP.js +1 -1
  83. package/lib/umd/locale/ko-KR.js +1 -1
  84. package/lib/umd/locale/pl-PL.js +1 -1
  85. package/lib/umd/locale/pt-BR.js +1 -1
  86. package/lib/umd/locale/ru-RU.js +1 -1
  87. package/lib/umd/locale/sk-SK.js +1 -1
  88. package/lib/umd/locale/vi-VN.js +1 -1
  89. package/lib/umd/locale/zh-CN.js +1 -1
  90. package/lib/umd/locale/zh-HK.js +1 -1
  91. package/lib/umd/locale/zh-TW.js +1 -1
  92. package/package.json +15 -15
@@ -1 +1 @@
1
- function _0x4f67(_0x37b400,_0xa878c9){_0x37b400=_0x37b400-0x113;const _0x368765=_0x3687();let _0x4f67b5=_0x368765[_0x37b400];return _0x4f67b5;}const _0x2914f5=_0x4f67;(function(_0x11c453,_0x3134de){const _0xa3b454=_0x4f67,_0x34354d=_0x11c453();while(!![]){try{const _0x18c234=-parseInt(_0xa3b454(0x116))/0x1+parseInt(_0xa3b454(0x113))/0x2*(-parseInt(_0xa3b454(0x11e))/0x3)+-parseInt(_0xa3b454(0x128))/0x4*(parseInt(_0xa3b454(0x12e))/0x5)+-parseInt(_0xa3b454(0x118))/0x6*(-parseInt(_0xa3b454(0x127))/0x7)+-parseInt(_0xa3b454(0x12d))/0x8*(parseInt(_0xa3b454(0x129))/0x9)+-parseInt(_0xa3b454(0x122))/0xa+parseInt(_0xa3b454(0x114))/0xb*(parseInt(_0xa3b454(0x126))/0xc);if(_0x18c234===_0x3134de)break;else _0x34354d['push'](_0x34354d['shift']());}catch(_0x28af09){_0x34354d['push'](_0x34354d['shift']());}}}(_0x3687,0x839c9));function _0x3687(){const _0x26e3b6=['您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','已同步','6348VlHQSA','736127VGSwPM','4iZRvyT','1368243XWoAUP','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','認證錯誤','連線失敗,請檢查您的網路。','40rvCMSL','5317320XKYKLl','11854MJBSmg','64823YnscKq','伺服器未回應協作請求,您的編輯將儲存在本機。','501223miiTlD','加入協作失敗,請稍後重試,您的編輯將暫存於本機。','30MFGwsb','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','此文件協作人數已達上限,您的編輯將暫存於本機。','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','本機檔案','協作文件數量超過限制,您的編輯將暫存於本機。','393PuwtWd','編輯衝突','協作衝突','加入協作失敗,您的編輯將暫存於本機。','28620IDcTPh','同步中...'];_0x3687=function(){return _0x26e3b6;};return _0x3687();}const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':'點擊重新連線'}},'collabStatus':{'fetchMiss':'正在擷取伺服器資料...','conflict':_0x2914f5(0x11f),'notCollab':_0x2914f5(0x11c),'synced':_0x2914f5(0x125),'syncing':_0x2914f5(0x123),'offline':'已離線,編輯將儲存在本機'},'session':{'connection-failed':_0x2914f5(0x12c),'will-retry':'連線失敗,將在稍後重試連線。','room-full':_0x2914f5(0x11a),'join-failed':_0x2914f5(0x117),'room-not-exists':_0x2914f5(0x121),'room-permission-denied':'沒有協作權限,您的編輯將暫存於本機。','room-cnt-exceeds':_0x2914f5(0x11d),'collaboration-timeout':_0x2914f5(0x115)},'conflict':{'title':_0x2914f5(0x120),'content':_0x2914f5(0x119)},'permission':{'title':_0x2914f5(0x12b),'content':_0x2914f5(0x124)},'collaboration':{'single-unit':{'warning':_0x2914f5(0x12a)},'closeRoom':'由於協作房間已關閉,編輯權限已被收回。'},'auth':{'needGotoLoginAlert':_0x2914f5(0x11b)}}};export{e as default};
1
+ const _0x47cf02=_0x4882;function _0x2711(){const _0xf6a9ef=['同步中...','編輯衝突','加入協作失敗,您的編輯將暫存於本機。','13393630VWDkij','8150085cndmho','協作文件數量超過限制,您的編輯將暫存於本機。','1260936wObPyg','協作衝突','已離線,編輯將儲存在本機','連線失敗,將在稍後重試連線。','4qxTvQj','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','連線失敗,請檢查您的網路。','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','8447455sVDbyU','42vRsuYc','4hilIFe','沒有協作權限,您的編輯將暫存於本機。','653879Qpoeze','認證錯誤','正在擷取伺服器資料...','5998856qVEaSl','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','4683261igwXCg','由於協作房間已關閉,編輯權限已被收回。','加入協作失敗,請稍後重試,您的編輯將暫存於本機。'];_0x2711=function(){return _0xf6a9ef;};return _0x2711();}function _0x4882(_0x4eea93,_0x2a7876){_0x4eea93=_0x4eea93-0xb2;const _0x27114e=_0x2711();let _0x488297=_0x27114e[_0x4eea93];return _0x488297;}(function(_0x52f273,_0x2754a0){const _0xbb5d1f=_0x4882,_0x2eacd7=_0x52f273();while(!![]){try{const _0x285f2d=-parseInt(_0xbb5d1f(0xbc))/0x1*(parseInt(_0xbb5d1f(0xb3))/0x2)+parseInt(_0xbb5d1f(0xc1))/0x3*(parseInt(_0xbb5d1f(0xba))/0x4)+parseInt(_0xbb5d1f(0xb8))/0x5+parseInt(_0xbb5d1f(0xca))/0x6*(-parseInt(_0xbb5d1f(0xb9))/0x7)+parseInt(_0xbb5d1f(0xbf))/0x8+parseInt(_0xbb5d1f(0xc8))/0x9+-parseInt(_0xbb5d1f(0xc7))/0xa;if(_0x285f2d===_0x2754a0)break;else _0x2eacd7['push'](_0x2eacd7['shift']());}catch(_0x9acf2f){_0x2eacd7['push'](_0x2eacd7['shift']());}}}(_0x2711,0xf3a37));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':'點擊重新連線'}},'collabStatus':{'fetchMiss':_0x47cf02(0xbe),'conflict':_0x47cf02(0xc5),'notCollab':'本機檔案','synced':'已同步','syncing':_0x47cf02(0xc4),'offline':_0x47cf02(0xcc)},'session':{'connection-failed':_0x47cf02(0xb5),'will-retry':_0x47cf02(0xb2),'room-full':'此文件協作人數已達上限,您的編輯將暫存於本機。','join-failed':_0x47cf02(0xc3),'room-not-exists':_0x47cf02(0xc6),'room-permission-denied':_0x47cf02(0xbb),'room-cnt-exceeds':_0x47cf02(0xc9),'collaboration-timeout':'伺服器未回應協作請求,您的編輯將儲存在本機。'},'conflict':{'title':_0x47cf02(0xcb),'content':_0x47cf02(0xb4)},'permission':{'title':_0x47cf02(0xbd),'content':_0x47cf02(0xb7)},'collaboration':{'single-unit':{'warning':_0x47cf02(0xb6)},'closeRoom':_0x47cf02(0xc2)},'auth':{'needGotoLoginAlert':_0x47cf02(0xc0)}}};export{e as default};
@@ -1,7 +1,7 @@
1
1
  import type { IChangeset } from '@univerjs-pro/collaboration';
2
2
  import type { ICollaborationSendOptions } from '../../services/socket/collaboration-socket.service';
3
3
  /** Why the awaiting changeset was sent again. */
4
- export type ChangesetResendReason = 'ack_timeout' | 'should_retry' | 'reconnect' | 'request_failed';
4
+ export type ChangesetResendReason = 'ack_timeout' | 'should_retry' | 'reconnect' | 'request_failed' | 'license_editing_connections_exceeded';
5
5
  /** Emitted every time an awaiting changeset is sent again. The first send is not an event. */
6
6
  export interface IChangesetResendEvent {
7
7
  unitID: string;
@@ -107,7 +107,7 @@ export declare class ChangesetSubmitter {
107
107
  */
108
108
  armAckTimeout(): void;
109
109
  /** The server asked for the changeset to be resent: replace the current timer with the short backoff. */
110
- requestRetry(): void;
110
+ requestRetry(reason?: ChangesetResendReason): void;
111
111
  /** The changeset was acknowledged, rejected or dropped. */
112
112
  dispose(): void;
113
113
  private _deliver;
@@ -1,13 +1,13 @@
1
1
  import type { IDisposable, IMutationInfo, Nullable, UniverInstanceType } from '@univerjs/core';
2
2
  import type { Observable } from 'rxjs';
3
- import type { CollaborationSession } from '../../services/collaboration-session/collaboration-session';
4
- import type { IUnitCacheData } from '../../services/local-cache/local-cache.service';
5
- import type { IChangesetResendEvent } from './changeset-submitter';
6
- import type { CollaborationState, ICollaborationStateHandler, IConflictInfo, PrepareTransformSelectionsHandler, SyncEditingCollabCursorHandler, TransformIMEHandler, TransformRemoteChangesetByIMECache, TransformRemoteChangesetByStateCache, TransformSelectionsHandler, TransformStateHandler } from './collaboration-state';
7
3
  import { CompressMutationService, RevisionService } from '@univerjs-pro/collaboration';
8
4
  import { ICommandService, ILogService, Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
9
5
  import { DocStateChangeManagerService } from '@univerjs/docs';
10
6
  import { BehaviorSubject } from 'rxjs';
7
+ import type { CollaborationSession } from '../../services/collaboration-session/collaboration-session';
8
+ import type { IUnitCacheData } from '../../services/local-cache/local-cache.service';
9
+ import type { IChangesetResendEvent } from './changeset-submitter';
10
+ import type { CollaborationState, ICollaborationStateHandler, IConflictInfo, PrepareTransformSelectionsHandler, SyncEditingCollabCursorHandler, TransformIMEHandler, TransformRemoteChangesetByIMECache, TransformRemoteChangesetByStateCache, TransformSelectionsHandler, TransformStateHandler } from './collaboration-state';
11
11
  import { CollaborationUIEventService } from '../../services/collaboration-ui-event/collaboration-ui-event';
12
12
  import { ILocalCacheService } from '../../services/local-cache/local-cache.service';
13
13
  import { SheetTransformSelectionsService } from '../../services/range-selection/sheet-transform-selections.service';
@@ -1,11 +1,11 @@
1
1
  import type { IAcknowledgedChangeset, IChangeset } from '@univerjs-pro/collaboration';
2
2
  import type { IMutationInfo, Nullable } from '@univerjs/core';
3
+ import { ITransformService, RevisionService } from '@univerjs-pro/collaboration';
4
+ import { ICommandService, IConfigService, ILogService, Injector, IPermissionService, IUniverInstanceService, UniverInstanceType, UserManagerService } from '@univerjs/core';
3
5
  import type { IUnitCacheData } from '../../services/local-cache/local-cache.service';
6
+ import type { ICollaborationSendOptions } from '../../services/socket/collaboration-socket.service';
4
7
  import type { ICollaborativeUndoRedoService } from '../../services/undoredo/collaborative-undoredo.service';
5
8
  import type { ChangesetResendInfo, ChangesetResendReason } from './changeset-submitter';
6
- import type { ICollaborationSendOptions } from '../../services/socket/collaboration-socket.service';
7
- import { ITransformService, RevisionService } from '@univerjs-pro/collaboration';
8
- import { ICommandService, IConfigService, ILogService, Injector, IPermissionService, IUniverInstanceService, UniverInstanceType, UserManagerService } from '@univerjs/core';
9
9
  import { CollaborationUIEventService } from '../../services/collaboration-ui-event/collaboration-ui-event';
10
10
  import { ILocalCacheService } from '../../services/local-cache/local-cache.service';
11
11
  import { ChangesetSubmitter } from './changeset-submitter';
@@ -52,6 +52,14 @@ export interface ICollaborationStateHandler {
52
52
  maxAckTimeout?: number;
53
53
  };
54
54
  }
55
+ /** What the server sent with a `changeset_rej` or `permission_rej` event. */
56
+ export interface IRemoteRejection {
57
+ isPermissionRej: boolean;
58
+ /** The reason in words, when the server gave one. */
59
+ reason?: string;
60
+ /** The protocol error code, when the server gave one. */
61
+ code?: number;
62
+ }
55
63
  /** Why a unit entered `ConflictState`. */
56
64
  export type ConflictReason =
57
65
  /** A remote changeset could not be transformed against the local edits. */
@@ -62,6 +70,8 @@ export type ConflictReason =
62
70
  | 'changeset_rejected'
63
71
  /** The server rejected the local changeset for lack of permission. */
64
72
  | 'permission_rejected'
73
+ /** The server's License does not cover collaboration on this document type. */
74
+ | 'license_unit_type_rejected'
65
75
  /** Another collaborator reverted the unit to a historical revision. */
66
76
  | 'remote_revert';
67
77
  /** The remote revert that caused a `remote_revert` conflict. */
@@ -151,13 +161,11 @@ export declare abstract class CollaborationState {
151
161
  /**
152
162
  * Received a rejection from the server, meaning that conflict could be resolved by the algorithm.
153
163
  */
154
- abstract onRemoteRej(config?: {
155
- isPermissionRej: boolean;
156
- }): CollaborationState;
164
+ abstract onRemoteRej(config?: IRemoteRejection): CollaborationState;
157
165
  /**
158
166
  * Received a retry message from the server, meaning that some unexpected error occurred in server.
159
167
  */
160
- abstract onRemoteRetry(changeset: IChangeset): CollaborationState;
168
+ abstract onRemoteRetry(changeset: IChangeset, code?: number): CollaborationState;
161
169
  abstract toggleOffline(): CollaborationState;
162
170
  abstract toggleOnline(): CollaborationState;
163
171
  /**
@@ -198,9 +206,9 @@ export declare abstract class CollaborationState {
198
206
  /** The conflict info of an error thrown while transforming or applying a remote changeset. */
199
207
  protected _conflictInfoFromError(error: unknown): IConflictInfo;
200
208
  /** The conflict info of a rejection from the server. */
201
- protected _rejectionInfo(config?: {
202
- isPermissionRej: boolean;
203
- }): IConflictInfo;
209
+ protected _rejectionInfo(config?: IRemoteRejection): IConflictInfo;
210
+ /** The resend reason for a `changeset_should_retry`, by the code the server attached to it. */
211
+ protected _retryReason(code?: number): ChangesetResendReason;
204
212
  /** Request the changesets after the current revision up to `revision`: left open, right closed. */
205
213
  protected _requestMissingChangesets(revision: number): void;
206
214
  /** Transform undo redo mutations in the undo redo stack. */
@@ -293,10 +301,8 @@ export declare class AwaitingState extends CollaborationState {
293
301
  private _transformAndApply;
294
302
  onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
295
303
  private _toSynced;
296
- onRemoteRej(config?: {
297
- isPermissionRej: boolean;
298
- }): CollaborationState;
299
- onRemoteRetry(changeset: IChangeset): CollaborationState;
304
+ onRemoteRej(config?: IRemoteRejection): CollaborationState;
305
+ onRemoteRetry(changeset: IChangeset, code?: number): CollaborationState;
300
306
  toggleOffline(): CollaborationState;
301
307
  toggleOnline(): CollaborationState;
302
308
  resend(reason?: ChangesetResendReason): void;
@@ -324,10 +330,8 @@ export declare class AwaitingWithPendingState extends CollaborationState {
324
330
  onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
325
331
  /** Transit to `PendingState` to schedule another sending task. */
326
332
  private _toPending;
327
- onRemoteRej(config?: {
328
- isPermissionRej: boolean;
329
- }): CollaborationState;
330
- onRemoteRetry(changeset: IChangeset): CollaborationState;
333
+ onRemoteRej(config?: IRemoteRejection): CollaborationState;
334
+ onRemoteRetry(changeset: IChangeset, code?: number): CollaborationState;
331
335
  toggleOffline(): CollaborationState;
332
336
  toggleOnline(): CollaborationState;
333
337
  resend(reason?: ChangesetResendReason): void;
@@ -434,10 +438,8 @@ export declare class FetchingMissState extends CollaborationState {
434
438
  appendMutation(mutation: IMutationInfo<object>): CollaborationState;
435
439
  onRemoteChangeset(changeset: IChangeset): CollaborationState;
436
440
  onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
437
- onRemoteRej(config?: {
438
- isPermissionRej: boolean;
439
- }): CollaborationState;
440
- onRemoteRetry(changeset: IChangeset): CollaborationState;
441
+ onRemoteRej(config?: IRemoteRejection): CollaborationState;
442
+ onRemoteRetry(changeset: IChangeset, code?: number): CollaborationState;
441
443
  toggleOffline(): CollaborationState;
442
444
  toggleOnline(): CollaborationState;
443
445
  private _onConflict;
@@ -15,7 +15,7 @@ export interface ICollaborationConflictEventParams extends IEventBase {
15
15
  * - `remote_revert`: another collaborator reverted the unit to a historical revision
16
16
  */
17
17
  reason: ConflictReason;
18
- /** The error message, when the conflict was caused by an error */
18
+ /** The error message, or the reason the server gave when it rejected the changeset */
19
19
  message?: string;
20
20
  /** The revert that caused the conflict, when `reason` is `remote_revert` */
21
21
  revert?: IRemoteRevertInfo;
@@ -56,6 +56,7 @@ export interface ICollaborationChangesetResendEventParams extends IEventBase {
56
56
  * - `ack_timeout`: no acknowledgement arrived in time
57
57
  * - `should_retry`: the server asked for the changeset to be resent
58
58
  * - `reconnect`: the connection was restored or the changeset was restored from the local cache
59
+ * - `license_editing_connections_exceeded`: the server asked for a resend; its License editing connections were all in use
59
60
  */
60
61
  reason: ChangesetResendReason;
61
62
  /** How many times the changeset has been resent, counting this one */
@@ -98,6 +99,7 @@ export interface IFCollaborationEventNameMixin {
98
99
  * const { unitId, reason, localChanges, cacheCleared } = event;
99
100
  * if (localChanges) saveSomewhere(unitId, localChanges);
100
101
  * if (reason === 'permission_rejected') return showNoPermission(unitId);
102
+ * if (reason === 'license_unit_type_rejected') return showLicenseLimit(unitId, event.message);
101
103
  * if (cacheCleared) window.location.reload();
102
104
  * });
103
105
  * ```
@@ -7,7 +7,7 @@ export type { ChangesetResendReason, IChangesetResendEvent, IChangesetSubmitterO
7
7
  export { BaseCollaborationEntity, BoardCollaborationEntity, CollaborationEntity, DocCollaborationEntity, PdfCollaborationEntity, SheetCollaborationEntity, SlideCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
8
8
  export type { ICollaborationConflictEvent, IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
9
9
  export { AwaitingState, AwaitingWithPendingState, CollaborationStatus, ConflictState, FetchingMissState, OfflineState, PendingState, SyncedState, } from './controllers/collaboration/collaboration-state';
10
- export type { ConflictReason, IConflictInfo, IRemoteRevertInfo, ISelectionTransformTransaction, } from './controllers/collaboration/collaboration-state';
10
+ export type { ConflictReason, IConflictInfo, IRemoteRejection, IRemoteRevertInfo, ISelectionTransformTransaction, } from './controllers/collaboration/collaboration-state';
11
11
  export { CollaborationController } from './controllers/collaboration/collaboration.controller';
12
12
  export { UniverCollaborationClientPlugin } from './plugin';
13
13
  export { CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
@@ -59,6 +59,7 @@ export declare class CollaborationSessionService extends Disposable {
59
59
  private _tryEnsureSocket;
60
60
  private _onConnectionOpen;
61
61
  private _onOffline;
62
+ private _onLicenseRejected;
62
63
  private _onConnectionFailed;
63
64
  private _tryReconnect;
64
65
  private _resolveSessionIdentity;
@@ -18,6 +18,8 @@ export declare enum CollaborationUIEventId {
18
18
  JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
19
19
  SOCKET_FAILED_RETRY = "SOCKET_FAILED_RETRY",
20
20
  SOCKET_FAILED = "SOCKET_FAILED",
21
+ /** The server refused this page's domain under its License; no reconnect is scheduled until a manual one. */
22
+ LICENSE_DOMAIN_REJECTED = "LICENSE_DOMAIN_REJECTED",
21
23
  /**
22
24
  * @deprecated No longer emitted. Unacknowledged changesets are resent automatically; subscribe to
23
25
  * `CollaborationEntity.changesetResend$` (or the `CollaborationChangesetResend` facade event) instead.
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x1cd3(_0x16583b,_0x2b71db){_0x16583b=_0x16583b-0x65;const _0x1bc693=_0x1bc6();let _0x1cd3c4=_0x1bc693[_0x16583b];return _0x1cd3c4;}(function(_0x4e89f7,_0x16e981){const _0x20bd6f=_0x1cd3,_0x2e6630=_0x4e89f7();while(!![]){try{const _0x477958=parseInt(_0x20bd6f(0x73))/0x1*(parseInt(_0x20bd6f(0xd0))/0x2)+-parseInt(_0x20bd6f(0x8b))/0x3*(parseInt(_0x20bd6f(0x78))/0x4)+-parseInt(_0x20bd6f(0x6f))/0x5+parseInt(_0x20bd6f(0x99))/0x6*(parseInt(_0x20bd6f(0xdf))/0x7)+parseInt(_0x20bd6f(0xba))/0x8*(parseInt(_0x20bd6f(0x79))/0x9)+-parseInt(_0x20bd6f(0xab))/0xa*(-parseInt(_0x20bd6f(0x8d))/0xb)+-parseInt(_0x20bd6f(0xc6))/0xc;if(_0x477958===_0x16e981)break;else _0x2e6630['push'](_0x2e6630['shift']());}catch(_0x498982){_0x2e6630['push'](_0x2e6630['shift']());}}}(_0x1bc6,0x982c0),function(_0x22f909,_0x389c51){const _0x5d88df=_0x1cd3;typeof exports==_0x5d88df(0x67)&&typeof module<'u'?_0x389c51(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define==_0x5d88df(0xa5)&&define[_0x5d88df(0x9a)]?define([_0x5d88df(0x93),_0x5d88df(0xd4),_0x5d88df(0x83),'@univerjs/core',_0x5d88df(0xcf)],_0x389c51):(_0x22f909=typeof globalThis<'u'?globalThis:_0x22f909||self,_0x389c51(_0x22f909['UniverProCollaborationClientFacade']={},_0x22f909[_0x5d88df(0xb8)],_0x22f909[_0x5d88df(0xa6)],_0x22f909['UniverCore'],_0x22f909['rxjs']));}(this,function(_0x5f2bc9,_0x42eff0,_0x2db56a,_0x18b349,_0x4a3183){const _0xbf0c54=_0x1cd3;Object[_0xbf0c54(0x69)](_0x5f2bc9,Symbol[_0xbf0c54(0xda)],{'value':_0xbf0c54(0x6b)});var _0x4c8507=class extends _0x2db56a[_0xbf0c54(0xa3)]{get[_0xbf0c54(0x88)](){const _0x1fbc73=_0xbf0c54;return _0x42eff0[_0x1fbc73(0x88)];}};_0x2db56a[_0xbf0c54(0xa3)]['extend'](_0x4c8507);var _0x47cade=class extends _0x2db56a[_0xbf0c54(0xe0)]{get[_0xbf0c54(0xbe)](){return'CollaborationStatusChanged';}get[_0xbf0c54(0x7a)](){const _0x489fb5=_0xbf0c54;return _0x489fb5(0x7a);}get[_0xbf0c54(0xdb)](){const _0x49a8b8=_0xbf0c54;return _0x49a8b8(0xdb);}};_0x2db56a['FEventName'][_0xbf0c54(0xb2)](_0x47cade);function _0x2c160c(_0x12f4a0,_0x2062df){return function(_0x4a01ce,_0x25bbec){_0x2062df(_0x4a01ce,_0x25bbec,_0x12f4a0);};}function _0x3cb5b7(_0x599f43,_0x37696e,_0x290715,_0xaa97a5){const _0x461421=_0xbf0c54;var _0x2f5340=arguments[_0x461421(0xad)],_0x497a9d=_0x2f5340<0x3?_0x37696e:_0xaa97a5===null?_0xaa97a5=Object[_0x461421(0x77)](_0x37696e,_0x290715):_0xaa97a5,_0x38203a;if(typeof Reflect==_0x461421(0x67)&&typeof Reflect[_0x461421(0xc3)]=='function')_0x497a9d=Reflect['decorate'](_0x599f43,_0x37696e,_0x290715,_0xaa97a5);else{for(var _0x44e7d5=_0x599f43[_0x461421(0xad)]-0x1;_0x44e7d5>=0x0;_0x44e7d5--)(_0x38203a=_0x599f43[_0x44e7d5])&&(_0x497a9d=(_0x2f5340<0x3?_0x38203a(_0x497a9d):_0x2f5340>0x3?_0x38203a(_0x37696e,_0x290715,_0x497a9d):_0x38203a(_0x37696e,_0x290715))||_0x497a9d);}return _0x2f5340>0x3&&_0x497a9d&&Object[_0x461421(0x69)](_0x37696e,_0x290715,_0x497a9d),_0x497a9d;}let _0x50f853=class extends _0x2db56a[_0xbf0c54(0x91)]{constructor(_0x1be74d,_0x446077,_0x5be445,_0x54678f,_0x3a19ea){const _0x389786=_0xbf0c54;super(),this[_0x389786(0xb0)]=_0x1be74d,this[_0x389786(0x7f)]=_0x446077,this[_0x389786(0xac)]=_0x5be445,this[_0x389786(0xdd)]=_0x54678f,this[_0x389786(0xae)]=_0x3a19ea;}async[_0xbf0c54(0x87)](_0x4548be,_0x5a71b5){const _0x1e7d9a=_0xbf0c54;return await this[_0x1e7d9a(0xdd)]['loadUnit'](_0x4548be,_0x18b349[_0x1e7d9a(0xa7)][_0x1e7d9a(0xbb)],void 0x0,_0x5a71b5)?(await this[_0x1e7d9a(0xae)][_0x1e7d9a(0xd5)](_0x4548be),this[_0x1e7d9a(0xb0)][_0x1e7d9a(0x65)](_0x4548be)):null;}async[_0xbf0c54(0x6d)](_0x418fbe,_0x3c4e94){const _0x11a14b=_0xbf0c54;return await this[_0x11a14b(0xdd)][_0x11a14b(0x75)](_0x418fbe,_0x18b349[_0x11a14b(0xa7)][_0x11a14b(0x74)],void 0x0,_0x3c4e94)?(await this[_0x11a14b(0xae)][_0x11a14b(0xd5)](_0x418fbe),this[_0x11a14b(0xb0)]['getDocument'](_0x418fbe)):null;}async['loadBaseAsync'](_0x2fa50f,_0x432baf){const _0x5989ae=_0xbf0c54;return await this[_0x5989ae(0xdd)][_0x5989ae(0x75)](_0x2fa50f,_0x18b349[_0x5989ae(0xa7)][_0x5989ae(0xdc)],void 0x0,_0x432baf)?(await this['_collaborationController'][_0x5989ae(0xd5)](_0x2fa50f),this['_handler']['getBase'](_0x2fa50f)):null;}async['loadSlideAsync'](_0x13ccc2,_0x2215ad){const _0x525567=_0xbf0c54;return await this['_dataLoaderService'][_0x525567(0x75)](_0x13ccc2,_0x18b349[_0x525567(0xa7)][_0x525567(0xc5)],void 0x0,_0x2215ad)?(await this['_collaborationController'][_0x525567(0xd5)](_0x13ccc2),this['_handler'][_0x525567(0xc1)](_0x13ccc2)):null;}async[_0xbf0c54(0xc4)](_0x367ab3,_0x20d1a9){const _0x308b89=_0xbf0c54;return await this['_dataLoaderService'][_0x308b89(0x75)](_0x367ab3,_0x18b349[_0x308b89(0xa7)][_0x308b89(0x96)],void 0x0,_0x20d1a9)?(await this[_0x308b89(0xae)][_0x308b89(0xd5)](_0x367ab3),this[_0x308b89(0xb0)][_0x308b89(0xd8)](_0x367ab3)):null;}async[_0xbf0c54(0x94)](_0x100cb0,_0x3a57cd){const _0x13d134=_0xbf0c54;return await this[_0x13d134(0xdd)][_0x13d134(0x75)](_0x100cb0,_0x18b349[_0x13d134(0xa7)][_0x13d134(0xa0)],void 0x0,_0x3a57cd)?(await this[_0x13d134(0xae)]['readyForCollab'](_0x100cb0),this[_0x13d134(0xb0)]['getPdf'](_0x100cb0)):null;}[_0xbf0c54(0xce)](_0x21851d,_0x256b85){const _0x7b915b=_0xbf0c54;let _0x2e88e2=this[_0x7b915b(0x7f)][_0x7b915b(0xbc)](_0x42eff0[_0x7b915b(0x76)])[_0x7b915b(0xb9)](_0x21851d)['pipe']((0x0,_0x4a3183[_0x7b915b(0x6c)])(_0x50a3bd=>_0x50a3bd[_0x7b915b(0x82)]))['subscribe'](_0x309c00=>_0x256b85(Array[_0x7b915b(0x81)](_0x309c00[_0x7b915b(0xc7)]())));return(0x0,_0x18b349['toDisposable'])(_0x2e88e2);}[_0xbf0c54(0x98)](_0x1276c5){const _0x2363d8=_0xbf0c54;let _0x52ef64=this['_resolveUnitId'](_0x1276c5);if(!_0x52ef64)return _0x42eff0[_0x2363d8(0x88)][_0x2363d8(0x7d)];let _0x672b1d=this[_0x2363d8(0xae)][_0x2363d8(0x68)](_0x52ef64);return(_0x672b1d==null?void 0x0:_0x672b1d[_0x2363d8(0xb3)][_0x2363d8(0xa8)])??_0x42eff0[_0x2363d8(0x88)][_0x2363d8(0x7d)];}[_0xbf0c54(0x90)](_0x1d1219){const _0x1c3044=_0xbf0c54;let _0x52896b=this[_0x1c3044(0x6e)](_0x1d1219);return _0x52896b?this[_0x1c3044(0xae)][_0x1c3044(0x90)](_0x52896b):!0x1;}[_0xbf0c54(0xb4)](_0x148086,_0x53edc8={}){const _0x283abf=_0xbf0c54;let _0x341759=this[_0x283abf(0x6e)](_0x148086);if(!_0x341759)return Promise['reject'](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0xa2ff1c=this[_0x283abf(0xae)][_0x283abf(0x68)](_0x341759);if(!_0xa2ff1c)return Promise[_0x283abf(0x66)](Error(_0x283abf(0xbf)+_0x341759+_0x283abf(0x85)));let _0x43bf95=_0xa2ff1c[_0x283abf(0xb3)][_0x283abf(0xa8)];if(_0x43bf95===_0x42eff0['CollaborationStatus'][_0x283abf(0xaa)])return Promise[_0x283abf(0x6a)]();let _0x1cef8e=_0x5acb6a(_0x341759,_0x43bf95);if(_0x1cef8e)return Promise[_0x283abf(0x66)](_0x1cef8e);let _0x2571a7=_0x53edc8[_0x283abf(0x9b)]??0x7530;return new Promise((_0x5caa5c,_0x5ac876)=>{const _0x52aac8=_0x283abf;let _0x2d6aeb=!0x1,_0x9d6ad3=null,_0x35136a=setTimeout(()=>{const _0x2a8065=_0x1cd3;_0x2d6aeb=!0x0,_0x9d6ad3==null||_0x9d6ad3[_0x2a8065(0x70)](),_0x5ac876(Error(_0x2a8065(0xd7)+_0x341759+_0x2a8065(0xa4)+_0x2571a7+_0x2a8065(0xd9)));},_0x2571a7),_0x4825a7=()=>{const _0x53baac=_0x1cd3;_0x2d6aeb=!0x0,clearTimeout(_0x35136a),_0x9d6ad3==null||_0x9d6ad3[_0x53baac(0x70)]();};_0x9d6ad3=_0xa2ff1c[_0x52aac8(0xc2)][_0x52aac8(0x9c)](_0x51c83f=>{const _0x240191=_0x52aac8;if(_0x2d6aeb)return;if(_0x51c83f===_0x42eff0[_0x240191(0x88)][_0x240191(0xaa)]){_0x4825a7(),_0x5caa5c();return;}let _0x488a4a=_0x5acb6a(_0x341759,_0x51c83f);_0x488a4a&&(_0x4825a7(),_0x5ac876(_0x488a4a));});});}['_resolveUnitId'](_0x294c0b){const _0x58d32f=_0xbf0c54;var _0x29bb68;return _0x294c0b||((_0x29bb68=this['_univerInstanceService']['getFocusedUnit']())==null?void 0x0:_0x29bb68[_0x58d32f(0x95)]());}};_0x50f853=_0x3cb5b7([_0x2c160c(0x1,(0x0,_0x18b349[_0xbf0c54(0x8e)])(_0x18b349[_0xbf0c54(0x7b)])),_0x2c160c(0x2,_0x18b349[_0xbf0c54(0xd6)]),_0x2c160c(0x3,(0x0,_0x18b349[_0xbf0c54(0x8e)])(_0x42eff0[_0xbf0c54(0x84)])),_0x2c160c(0x4,(0x0,_0x18b349[_0xbf0c54(0x8e)])(_0x42eff0[_0xbf0c54(0xb5)]))],_0x50f853);function _0x5acb6a(_0x40a592,_0x2b60ba){const _0x3395c4=_0xbf0c54;return _0x2b60ba===_0x42eff0[_0x3395c4(0x88)][_0x3395c4(0x80)]||_0x2b60ba===_0x42eff0['CollaborationStatus']['NOT_COLLAB']?Error(_0x3395c4(0xcd)+_0x40a592+_0x3395c4(0xcc)+_0x2b60ba+'.'):null;}var _0x2951a7=class extends _0x2db56a[_0xbf0c54(0x9f)]{[_0xbf0c54(0xa2)](_0x172df4){const _0x8ba8e4=_0xbf0c54;let _0x29e1fc=_0x172df4[_0x8ba8e4(0xbc)](_0x42eff0[_0x8ba8e4(0xb5)]);this[_0x8ba8e4(0xd1)](this[_0x8ba8e4(0xd2)](this[_0x8ba8e4(0x92)][_0x8ba8e4(0xbe)],()=>{const _0x5f07ed=_0x8ba8e4;let _0x2a82b1=new _0x18b349[(_0x5f07ed(0x8a))](),_0x446831=_0xfe9e90=>{const _0x210b1e=_0x5f07ed;let _0x389563=_0xfe9e90['status$'][_0x210b1e(0xb6)]((0x0,_0x4a3183[_0x210b1e(0x72)])())[_0x210b1e(0x9c)](_0x400e3d=>{const _0x319a7e=_0x210b1e;let _0x407517={'unitId':_0xfe9e90[_0x319a7e(0x86)],'status':_0x400e3d};this[_0x319a7e(0xb7)](this['Event']['CollaborationStatusChanged'],_0x407517);});_0x2a82b1[_0x210b1e(0x8f)]((0x0,_0x18b349[_0x210b1e(0x9e)])(_0x389563));};return _0x29e1fc[_0x5f07ed(0xa9)]()[_0x5f07ed(0xc8)](_0x446831),_0x2a82b1[_0x5f07ed(0x8f)]((0x0,_0x18b349[_0x5f07ed(0x9e)])(_0x29e1fc[_0x5f07ed(0x71)][_0x5f07ed(0x9c)](_0x446831))),_0x2a82b1;})),this[_0x8ba8e4(0xd1)](this[_0x8ba8e4(0xd2)](this[_0x8ba8e4(0x92)]['CollaborationConflict'],()=>{const _0x309c20=_0x8ba8e4;let _0x5d2ab2=new _0x18b349[(_0x309c20(0x8a))](),_0x11451b=_0x1232d0=>{const _0x22a571=_0x309c20;let _0x3c2e74=_0x1232d0[_0x22a571(0xde)]['subscribe'](_0x1ece67=>{const _0x3b9987=_0x22a571;let _0xcf0d31={'unitId':_0x1ece67[_0x3b9987(0x86)],'reason':_0x1ece67[_0x3b9987(0xb1)],'message':_0x1ece67[_0x3b9987(0x89)],'revert':_0x1ece67[_0x3b9987(0x7e)],'localChanges':_0x1ece67[_0x3b9987(0x7c)],'cacheCleared':_0x1ece67[_0x3b9987(0x8c)]};this[_0x3b9987(0xb7)](this['Event'][_0x3b9987(0x7a)],_0xcf0d31);});_0x5d2ab2[_0x22a571(0x8f)]((0x0,_0x18b349[_0x22a571(0x9e)])(_0x3c2e74));};return _0x29e1fc['getCollabEntities']()[_0x309c20(0xc8)](_0x11451b),_0x5d2ab2[_0x309c20(0x8f)]((0x0,_0x18b349[_0x309c20(0x9e)])(_0x29e1fc['entityInit$'][_0x309c20(0x9c)](_0x11451b))),_0x5d2ab2;})),this[_0x8ba8e4(0xd1)](this['registerEventHandler'](this[_0x8ba8e4(0x92)][_0x8ba8e4(0xdb)],()=>{const _0x1c81e0=_0x8ba8e4;let _0x526a33=new _0x18b349[(_0x1c81e0(0x8a))](),_0x41dded=_0x5d4ec4=>{const _0x327270=_0x1c81e0;let _0x143aaa=_0x5d4ec4['changesetResend$'][_0x327270(0x9c)](_0x221acc=>{const _0x4f1018=_0x327270;let _0x196f86={'unitId':_0x221acc['unitID'],'reqId':_0x221acc[_0x4f1018(0xc9)],'reason':_0x221acc[_0x4f1018(0xb1)],'attempt':_0x221acc[_0x4f1018(0xa1)],'elapsedMs':_0x221acc['elapsedMs'],'unsyncedMutationCount':_0x221acc[_0x4f1018(0xca)],'nextDelayMs':_0x221acc['nextDelayMs']};this['fireEvent'](this[_0x4f1018(0x92)][_0x4f1018(0xdb)],_0x196f86);});_0x526a33[_0x327270(0x8f)]((0x0,_0x18b349[_0x327270(0x9e)])(_0x143aaa));};return _0x29e1fc[_0x1c81e0(0xa9)]()[_0x1c81e0(0xc8)](_0x41dded),_0x526a33['add']((0x0,_0x18b349[_0x1c81e0(0x9e)])(_0x29e1fc['entityInit$'][_0x1c81e0(0x9c)](_0x41dded))),_0x526a33;}));}[_0xbf0c54(0xaf)](){const _0x1a6519=_0xbf0c54;return this[_0x1a6519(0x7f)][_0x1a6519(0xcb)](_0x50f853,{'getWorkbook':_0x12db00=>this[_0x1a6519(0x65)](_0x12db00),'getDocument':_0x215e1f=>this[_0x1a6519(0xbd)](_0x215e1f),'getPresentation':_0x2f2c58=>this[_0x1a6519(0xc1)](_0x2f2c58),'getBase':_0x1105ce=>this[_0x1a6519(0xd3)](_0x1105ce),'getBoard':_0x7b3951=>this[_0x1a6519(0xd8)](_0x7b3951),'getPdf':_0x1f63e5=>this[_0x1a6519(0x97)](_0x1f63e5)});}['loadServerUnit'](_0x14964f,_0x36643a,_0x4afa86){const _0x20e976=_0xbf0c54;return this['_injector'][_0x20e976(0xbc)](_0x42eff0[_0x20e976(0x84)])['loadUnit'](_0x14964f,_0x36643a,_0x4afa86);}[_0xbf0c54(0xc0)](_0x1c0013,_0x360a1b,_0x264fdb){const _0x4d337e=_0xbf0c54;return this[_0x4d337e(0x7f)][_0x4d337e(0xbc)](_0x42eff0[_0x4d337e(0x84)])['loadUnitOfRevision'](_0x1c0013,_0x360a1b,_0x264fdb);}};_0x2db56a['FUniver'][_0xbf0c54(0xb2)](_0x2951a7),Object['defineProperty'](_0x5f2bc9,_0xbf0c54(0x9d),{'enumerable':!0x0,'get':function(){return _0x50f853;}});}));function _0x1bc6(){const _0x3b85df=['121122CDbaGd','CollaborationConflict','Injector','localChanges','NOT_COLLAB','revert','_injector','CONFLICT','from','members$','@univerjs/core/facade','DataLoaderService','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','unitID','loadSheetAsync','CollaborationStatus','message','DisposableCollection','1795485BrBjjo','cacheCleared','6280087AOdVlM','Inject','add','hasWritePending','FBase','Event','exports','loadPdfAsync','getUnitId','UNIVER_BOARD','getPdf','getCollaborationStatus','6VEwyOb','amd','timeout','subscribe','FCollaboration','toDisposable','FUniver','UNIVER_PDF','attempt','_initialize','FEnum','\x22\x20after\x20','function','UniverCoreFacade','UniverInstanceType','status','getCollabEntities','SYNCED','20bDKAda','_univerInstanceService','length','_collaborationController','getCollaboration','_handler','reason','extend','state','flush','CollaborationController','pipe','fireEvent','UniverProCollaborationClient','waitForRoom$','688eUwJXi','UNIVER_SHEET','get','getDocument','CollaborationStatusChanged','[FCollaboration]:\x20Unit\x20\x22','loadServerUnitOfRevision','getPresentation','status$','decorate','loadBoardAsync','UNIVER_SLIDE','13422876MRdLhK','values','forEach','reqId','unsyncedMutationCount','createInstance','\x22\x20while\x20collaboration\x20status\x20is\x20','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','subscribeCollaborators','rxjs','1024pziyCm','disposeWithMe','registerEventHandler','getBase','@univerjs-pro/collaboration-client','readyForCollab','IUniverInstanceService','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','getBoard','ms.','toStringTag','CollaborationChangesetResend','UNIVER_BASE','_dataLoaderService','conflict$','5726147tLtEWs','FEventName','getWorkbook','reject','object','getCollabEntity','defineProperty','resolve','Module','switchMap','loadDocAsync','_resolveUnitId','3904875bPnnOL','unsubscribe','entityInit$','distinctUntilChanged','8JOvtgF','UNIVER_DOC','loadUnit','MemberService','getOwnPropertyDescriptor','4sKbVIP'];_0x1bc6=function(){return _0x3b85df;};return _0x1bc6();}
1
+ function _0xc5ff(_0x423174,_0x3d56e1){_0x423174=_0x423174-0x81;const _0x3593c1=_0x3593();let _0xc5ff9a=_0x3593c1[_0x423174];return _0xc5ff9a;}function _0x3593(){const _0x568ca0=['reqId','15430zbYHwa','_injector','NOT_COLLAB','forEach','getDocument','UniverCoreFacade','conflict$','amd','subscribe','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','extend','UniverCore','waitForRoom$','18kaxEhs','registerEventHandler','hasWritePending','getUnitId','FCollaboration','state','UniverProCollaborationClient','CONFLICT','unitID','reject','368xKYxkA','subscribeCollaborators','DisposableCollection','unsubscribe','getCollaborationStatus','cacheCleared','loadPdfAsync','4231098QdIRAo','pipe','switchMap','21802dQmKRO','toDisposable','flush','timeout','_handler','getFocusedUnit','DataLoaderService','\x22\x20after\x20','@univerjs-pro/collaboration-client','6252688HwdNEa','resolve','_dataLoaderService','CollaborationController','decorate','fireEvent','loadBaseAsync','MemberService','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','UNIVER_BASE','createInstance','Injector','getPdf','_univerInstanceService','disposeWithMe','FEventName','readyForCollab','status','getCollaboration','loadSheetAsync','getOwnPropertyDescriptor','length','getCollabEntities','_collaborationController','loadBoardAsync','UNIVER_SHEET','16FJritn','distinctUntilChanged','2432151GYlZir','1711360CCUOSb','@univerjs/core','Event','4355lcdlfB','CollaborationStatus','CollaborationChangesetResend','values','SYNCED','CollaborationStatusChanged','_initialize','defineProperty','loadSlideAsync','Inject','getPresentation','getBoard','UNIVER_SLIDE','getWorkbook','FEnum','from','changesetResend$','add','Module','loadUnit','getBase','entityInit$','loadServerUnitOfRevision','CollaborationConflict','IUniverInstanceService','UniverInstanceType','_resolveUnitId','rxjs','[FCollaboration]:\x20Unit\x20\x22','reason','UNIVER_BOARD','8793820NQXvOU','getCollabEntity','get','FUniver','function','object','status$','loadUnitOfRevision'];_0x3593=function(){return _0x568ca0;};return _0x3593();}(function(_0x308660,_0x144786){const _0x698089=_0xc5ff,_0x479bb6=_0x308660();while(!![]){try{const _0xacbd2=parseInt(_0x698089(0xb2))/0x1*(parseInt(_0x698089(0xf1))/0x2)+parseInt(_0x698089(0x86))/0x3+-parseInt(_0x698089(0x92))/0x4+parseInt(_0x698089(0xaf))/0x5*(-parseInt(_0x698089(0xe7))/0x6)+-parseInt(_0x698089(0xd1))/0x7+parseInt(_0x698089(0xac))/0x8*(-parseInt(_0x698089(0xae))/0x9)+parseInt(_0x698089(0xda))/0xa*(parseInt(_0x698089(0x89))/0xb);if(_0xacbd2===_0x144786)break;else _0x479bb6['push'](_0x479bb6['shift']());}catch(_0x25d723){_0x479bb6['push'](_0x479bb6['shift']());}}}(_0x3593,0xd79f2),function(_0xeff011,_0x54116c){const _0x363af9=_0xc5ff;typeof exports==_0x363af9(0xd6)&&typeof module<'u'?_0x54116c(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define==_0x363af9(0xd5)&&define[_0x363af9(0xe1)]?define(['exports',_0x363af9(0x91),'@univerjs/core/facade',_0x363af9(0xb0),_0x363af9(0xcd)],_0x54116c):(_0xeff011=typeof globalThis<'u'?globalThis:_0xeff011||self,_0x54116c(_0xeff011['UniverProCollaborationClientFacade']={},_0xeff011[_0x363af9(0xed)],_0xeff011[_0x363af9(0xdf)],_0xeff011[_0x363af9(0xe5)],_0xeff011[_0x363af9(0xcd)]));}(this,function(_0x102256,_0x5f35f2,_0x44fb20,_0x42f323,_0x3e105b){const _0x3ef1bf=_0xc5ff;Object[_0x3ef1bf(0xb9)](_0x102256,Symbol['toStringTag'],{'value':_0x3ef1bf(0xc4)});var _0x499f19=class extends _0x44fb20[_0x3ef1bf(0xc0)]{get['CollaborationStatus'](){const _0x55539b=_0x3ef1bf;return _0x5f35f2[_0x55539b(0xb3)];}};_0x44fb20[_0x3ef1bf(0xc0)]['extend'](_0x499f19);var _0x4aaf93=class extends _0x44fb20[_0x3ef1bf(0xa1)]{get['CollaborationStatusChanged'](){const _0x437825=_0x3ef1bf;return _0x437825(0xb7);}get[_0x3ef1bf(0xc9)](){const _0x571e53=_0x3ef1bf;return _0x571e53(0xc9);}get[_0x3ef1bf(0xb4)](){const _0x470799=_0x3ef1bf;return _0x470799(0xb4);}};_0x44fb20[_0x3ef1bf(0xa1)][_0x3ef1bf(0xe4)](_0x4aaf93);function _0x26cbd2(_0x4c4c60,_0x2ec554){return function(_0x133d4d,_0x50a2f7){_0x2ec554(_0x133d4d,_0x50a2f7,_0x4c4c60);};}function _0x48c2d3(_0xd4a2b3,_0x530521,_0xf4794f,_0x394197){const _0x6d3329=_0x3ef1bf;var _0x946218=arguments[_0x6d3329(0xa7)],_0x4009f6=_0x946218<0x3?_0x530521:_0x394197===null?_0x394197=Object[_0x6d3329(0xa6)](_0x530521,_0xf4794f):_0x394197,_0x538db2;if(typeof Reflect==_0x6d3329(0xd6)&&typeof Reflect[_0x6d3329(0x96)]=='function')_0x4009f6=Reflect[_0x6d3329(0x96)](_0xd4a2b3,_0x530521,_0xf4794f,_0x394197);else{for(var _0x5345bd=_0xd4a2b3[_0x6d3329(0xa7)]-0x1;_0x5345bd>=0x0;_0x5345bd--)(_0x538db2=_0xd4a2b3[_0x5345bd])&&(_0x4009f6=(_0x946218<0x3?_0x538db2(_0x4009f6):_0x946218>0x3?_0x538db2(_0x530521,_0xf4794f,_0x4009f6):_0x538db2(_0x530521,_0xf4794f))||_0x4009f6);}return _0x946218>0x3&&_0x4009f6&&Object['defineProperty'](_0x530521,_0xf4794f,_0x4009f6),_0x4009f6;}let _0xdf49f3=class extends _0x44fb20['FBase']{constructor(_0x134e88,_0x26665b,_0x2ace45,_0x25d049,_0x197ac9){const _0x2c130d=_0x3ef1bf;super(),this[_0x2c130d(0x8d)]=_0x134e88,this['_injector']=_0x26665b,this[_0x2c130d(0x9f)]=_0x2ace45,this[_0x2c130d(0x94)]=_0x25d049,this[_0x2c130d(0xa9)]=_0x197ac9;}async[_0x3ef1bf(0xa5)](_0x4f8d49,_0xe26abb){const _0x481edd=_0x3ef1bf;return await this[_0x481edd(0x94)]['loadUnit'](_0x4f8d49,_0x42f323['UniverInstanceType'][_0x481edd(0xab)],void 0x0,_0xe26abb)?(await this[_0x481edd(0xa9)]['readyForCollab'](_0x4f8d49),this['_handler'][_0x481edd(0xbf)](_0x4f8d49)):null;}async['loadDocAsync'](_0x415997,_0x2dded0){const _0x3b3298=_0x3ef1bf;return await this[_0x3b3298(0x94)][_0x3b3298(0xc5)](_0x415997,_0x42f323[_0x3b3298(0xcb)]['UNIVER_DOC'],void 0x0,_0x2dded0)?(await this[_0x3b3298(0xa9)]['readyForCollab'](_0x415997),this[_0x3b3298(0x8d)][_0x3b3298(0xde)](_0x415997)):null;}async[_0x3ef1bf(0x98)](_0x5139ee,_0x40a39b){const _0x3bfd32=_0x3ef1bf;return await this[_0x3bfd32(0x94)]['loadUnit'](_0x5139ee,_0x42f323[_0x3bfd32(0xcb)][_0x3bfd32(0x9b)],void 0x0,_0x40a39b)?(await this[_0x3bfd32(0xa9)][_0x3bfd32(0xa2)](_0x5139ee),this[_0x3bfd32(0x8d)][_0x3bfd32(0xc6)](_0x5139ee)):null;}async[_0x3ef1bf(0xba)](_0x5e90e5,_0x41ae3d){const _0x26a07d=_0x3ef1bf;return await this[_0x26a07d(0x94)]['loadUnit'](_0x5e90e5,_0x42f323[_0x26a07d(0xcb)][_0x26a07d(0xbe)],void 0x0,_0x41ae3d)?(await this['_collaborationController'][_0x26a07d(0xa2)](_0x5e90e5),this['_handler']['getPresentation'](_0x5e90e5)):null;}async[_0x3ef1bf(0xaa)](_0x4b68af,_0x1e5838){const _0x1c764a=_0x3ef1bf;return await this[_0x1c764a(0x94)]['loadUnit'](_0x4b68af,_0x42f323[_0x1c764a(0xcb)][_0x1c764a(0xd0)],void 0x0,_0x1e5838)?(await this['_collaborationController'][_0x1c764a(0xa2)](_0x4b68af),this[_0x1c764a(0x8d)]['getBoard'](_0x4b68af)):null;}async[_0x3ef1bf(0x85)](_0x43f94a,_0x7624f0){const _0x41b729=_0x3ef1bf;return await this[_0x41b729(0x94)]['loadUnit'](_0x43f94a,_0x42f323[_0x41b729(0xcb)]['UNIVER_PDF'],void 0x0,_0x7624f0)?(await this[_0x41b729(0xa9)]['readyForCollab'](_0x43f94a),this[_0x41b729(0x8d)][_0x41b729(0x9e)](_0x43f94a)):null;}[_0x3ef1bf(0xf2)](_0x5c6ccd,_0x75887a){const _0x2d5af3=_0x3ef1bf;let _0x141776=this[_0x2d5af3(0xdb)][_0x2d5af3(0xd3)](_0x5f35f2[_0x2d5af3(0x99)])[_0x2d5af3(0xe6)](_0x5c6ccd)[_0x2d5af3(0x87)]((0x0,_0x3e105b[_0x2d5af3(0x88)])(_0x4181cc=>_0x4181cc['members$']))[_0x2d5af3(0xe2)](_0x1d7922=>_0x75887a(Array[_0x2d5af3(0xc1)](_0x1d7922[_0x2d5af3(0xb5)]())));return(0x0,_0x42f323[_0x2d5af3(0x8a)])(_0x141776);}[_0x3ef1bf(0x83)](_0x5a437b){const _0x39ce00=_0x3ef1bf;let _0x1d82d1=this[_0x39ce00(0xcc)](_0x5a437b);if(!_0x1d82d1)return _0x5f35f2[_0x39ce00(0xb3)]['NOT_COLLAB'];let _0x47b01c=this[_0x39ce00(0xa9)][_0x39ce00(0xd2)](_0x1d82d1);return(_0x47b01c==null?void 0x0:_0x47b01c[_0x39ce00(0xec)]['status'])??_0x5f35f2['CollaborationStatus'][_0x39ce00(0xdc)];}[_0x3ef1bf(0xe9)](_0x4bb8be){const _0xe02553=_0x3ef1bf;let _0x3336ea=this['_resolveUnitId'](_0x4bb8be);return _0x3336ea?this['_collaborationController'][_0xe02553(0xe9)](_0x3336ea):!0x1;}[_0x3ef1bf(0x8b)](_0x4bdaea,_0x38841a={}){const _0x2e4ba8=_0x3ef1bf;let _0x52f94e=this['_resolveUnitId'](_0x4bdaea);if(!_0x52f94e)return Promise[_0x2e4ba8(0xf0)](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0x487ca0=this['_collaborationController'][_0x2e4ba8(0xd2)](_0x52f94e);if(!_0x487ca0)return Promise[_0x2e4ba8(0xf0)](Error(_0x2e4ba8(0xce)+_0x52f94e+_0x2e4ba8(0xe3)));let _0x11239a=_0x487ca0[_0x2e4ba8(0xec)][_0x2e4ba8(0xa3)];if(_0x11239a===_0x5f35f2[_0x2e4ba8(0xb3)][_0x2e4ba8(0xb6)])return Promise[_0x2e4ba8(0x93)]();let _0x5d94cb=_0x3b56d6(_0x52f94e,_0x11239a);if(_0x5d94cb)return Promise[_0x2e4ba8(0xf0)](_0x5d94cb);let _0x1e5151=_0x38841a[_0x2e4ba8(0x8c)]??0x7530;return new Promise((_0x26067f,_0x1dffac)=>{const _0x15b7e2=_0x2e4ba8;let _0x107c50=!0x1,_0x505235=null,_0x54fae8=setTimeout(()=>{const _0x5cfc7e=_0xc5ff;_0x107c50=!0x0,_0x505235==null||_0x505235['unsubscribe'](),_0x1dffac(Error(_0x5cfc7e(0x9a)+_0x52f94e+_0x5cfc7e(0x90)+_0x1e5151+'ms.'));},_0x1e5151),_0x18bafd=()=>{const _0x5ee9d2=_0xc5ff;_0x107c50=!0x0,clearTimeout(_0x54fae8),_0x505235==null||_0x505235[_0x5ee9d2(0x82)]();};_0x505235=_0x487ca0[_0x15b7e2(0xd7)][_0x15b7e2(0xe2)](_0x320941=>{if(_0x107c50)return;if(_0x320941===_0x5f35f2['CollaborationStatus']['SYNCED']){_0x18bafd(),_0x26067f();return;}let _0x1800b8=_0x3b56d6(_0x52f94e,_0x320941);_0x1800b8&&(_0x18bafd(),_0x1dffac(_0x1800b8));});});}[_0x3ef1bf(0xcc)](_0x1b8296){const _0x13fe6c=_0x3ef1bf;var _0xa9444b;return _0x1b8296||((_0xa9444b=this[_0x13fe6c(0x9f)][_0x13fe6c(0x8e)]())==null?void 0x0:_0xa9444b[_0x13fe6c(0xea)]());}};_0xdf49f3=_0x48c2d3([_0x26cbd2(0x1,(0x0,_0x42f323[_0x3ef1bf(0xbb)])(_0x42f323[_0x3ef1bf(0x9d)])),_0x26cbd2(0x2,_0x42f323[_0x3ef1bf(0xca)]),_0x26cbd2(0x3,(0x0,_0x42f323[_0x3ef1bf(0xbb)])(_0x5f35f2[_0x3ef1bf(0x8f)])),_0x26cbd2(0x4,(0x0,_0x42f323[_0x3ef1bf(0xbb)])(_0x5f35f2[_0x3ef1bf(0x95)]))],_0xdf49f3);function _0x3b56d6(_0x6ca59d,_0x35efc6){const _0x148864=_0x3ef1bf;return _0x35efc6===_0x5f35f2[_0x148864(0xb3)][_0x148864(0xee)]||_0x35efc6===_0x5f35f2[_0x148864(0xb3)][_0x148864(0xdc)]?Error('[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22'+_0x6ca59d+'\x22\x20while\x20collaboration\x20status\x20is\x20'+_0x35efc6+'.'):null;}var _0x5050c8=class extends _0x44fb20[_0x3ef1bf(0xd4)]{[_0x3ef1bf(0xb8)](_0x3edc92){const _0x297450=_0x3ef1bf;let _0x756d99=_0x3edc92[_0x297450(0xd3)](_0x5f35f2[_0x297450(0x95)]);this[_0x297450(0xa0)](this[_0x297450(0xe8)](this['Event'][_0x297450(0xb7)],()=>{const _0xcfe159=_0x297450;let _0x3f2c02=new _0x42f323[(_0xcfe159(0x81))](),_0x30c716=_0x111727=>{const _0x50e2e5=_0xcfe159;let _0x24cd40=_0x111727[_0x50e2e5(0xd7)][_0x50e2e5(0x87)]((0x0,_0x3e105b[_0x50e2e5(0xad)])())[_0x50e2e5(0xe2)](_0x144ccb=>{const _0x35cfa6=_0x50e2e5;let _0x2af0dc={'unitId':_0x111727[_0x35cfa6(0xef)],'status':_0x144ccb};this[_0x35cfa6(0x97)](this[_0x35cfa6(0xb1)]['CollaborationStatusChanged'],_0x2af0dc);});_0x3f2c02['add']((0x0,_0x42f323[_0x50e2e5(0x8a)])(_0x24cd40));};return _0x756d99[_0xcfe159(0xa8)]()[_0xcfe159(0xdd)](_0x30c716),_0x3f2c02['add']((0x0,_0x42f323[_0xcfe159(0x8a)])(_0x756d99['entityInit$'][_0xcfe159(0xe2)](_0x30c716))),_0x3f2c02;})),this[_0x297450(0xa0)](this[_0x297450(0xe8)](this['Event'][_0x297450(0xc9)],()=>{const _0x210a8e=_0x297450;let _0x229f6f=new _0x42f323[(_0x210a8e(0x81))](),_0x1e53a2=_0xd579dc=>{const _0x3ed228=_0x210a8e;let _0x2304ac=_0xd579dc[_0x3ed228(0xe0)][_0x3ed228(0xe2)](_0x2bc1da=>{const _0x10eaa5=_0x3ed228;let _0x406bf3={'unitId':_0x2bc1da[_0x10eaa5(0xef)],'reason':_0x2bc1da[_0x10eaa5(0xcf)],'message':_0x2bc1da['message'],'revert':_0x2bc1da['revert'],'localChanges':_0x2bc1da['localChanges'],'cacheCleared':_0x2bc1da[_0x10eaa5(0x84)]};this[_0x10eaa5(0x97)](this[_0x10eaa5(0xb1)]['CollaborationConflict'],_0x406bf3);});_0x229f6f['add']((0x0,_0x42f323['toDisposable'])(_0x2304ac));};return _0x756d99[_0x210a8e(0xa8)]()['forEach'](_0x1e53a2),_0x229f6f['add']((0x0,_0x42f323[_0x210a8e(0x8a)])(_0x756d99[_0x210a8e(0xc7)][_0x210a8e(0xe2)](_0x1e53a2))),_0x229f6f;})),this[_0x297450(0xa0)](this[_0x297450(0xe8)](this['Event'][_0x297450(0xb4)],()=>{const _0x496162=_0x297450;let _0x2c1ba1=new _0x42f323[(_0x496162(0x81))](),_0x1fba6f=_0x395889=>{const _0x32fc78=_0x496162;let _0x2981f3=_0x395889[_0x32fc78(0xc2)]['subscribe'](_0x25b72e=>{const _0x3cd958=_0x32fc78;let _0x13148d={'unitId':_0x25b72e['unitID'],'reqId':_0x25b72e[_0x3cd958(0xd9)],'reason':_0x25b72e['reason'],'attempt':_0x25b72e['attempt'],'elapsedMs':_0x25b72e['elapsedMs'],'unsyncedMutationCount':_0x25b72e['unsyncedMutationCount'],'nextDelayMs':_0x25b72e['nextDelayMs']};this[_0x3cd958(0x97)](this['Event'][_0x3cd958(0xb4)],_0x13148d);});_0x2c1ba1[_0x32fc78(0xc3)]((0x0,_0x42f323[_0x32fc78(0x8a)])(_0x2981f3));};return _0x756d99[_0x496162(0xa8)]()['forEach'](_0x1fba6f),_0x2c1ba1[_0x496162(0xc3)]((0x0,_0x42f323['toDisposable'])(_0x756d99[_0x496162(0xc7)][_0x496162(0xe2)](_0x1fba6f))),_0x2c1ba1;}));}[_0x3ef1bf(0xa4)](){const _0x5150d4=_0x3ef1bf;return this[_0x5150d4(0xdb)][_0x5150d4(0x9c)](_0xdf49f3,{'getWorkbook':_0x14516a=>this[_0x5150d4(0xbf)](_0x14516a),'getDocument':_0x499405=>this['getDocument'](_0x499405),'getPresentation':_0x3f569a=>this[_0x5150d4(0xbc)](_0x3f569a),'getBase':_0x12fd73=>this[_0x5150d4(0xc6)](_0x12fd73),'getBoard':_0x536e3d=>this[_0x5150d4(0xbd)](_0x536e3d),'getPdf':_0x2e0afe=>this[_0x5150d4(0x9e)](_0x2e0afe)});}['loadServerUnit'](_0x2f819b,_0x40bd5c,_0x2b5f48){const _0x27e5fc=_0x3ef1bf;return this[_0x27e5fc(0xdb)][_0x27e5fc(0xd3)](_0x5f35f2[_0x27e5fc(0x8f)])['loadUnit'](_0x2f819b,_0x40bd5c,_0x2b5f48);}[_0x3ef1bf(0xc8)](_0x2429d9,_0x3d934a,_0x4f464c){const _0x195d20=_0x3ef1bf;return this[_0x195d20(0xdb)]['get'](_0x5f35f2[_0x195d20(0x8f)])[_0x195d20(0xd8)](_0x2429d9,_0x3d934a,_0x4f464c);}};_0x44fb20[_0x3ef1bf(0xd4)][_0x3ef1bf(0xe4)](_0x5050c8),Object[_0x3ef1bf(0xb9)](_0x102256,_0x3ef1bf(0xeb),{'enumerable':!0x0,'get':function(){return _0xdf49f3;}});}));