@univerjs-pro/collaboration-client 1.0.0-alpha.1 → 1.0.0-alpha.3

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 (96) hide show
  1. package/README.md +8 -2
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ar-SA.js +1 -1
  5. package/lib/cjs/locale/ca-ES.js +1 -1
  6. package/lib/cjs/locale/de-DE.js +1 -1
  7. package/lib/cjs/locale/en-US.js +1 -1
  8. package/lib/cjs/locale/es-ES.js +1 -1
  9. package/lib/cjs/locale/fa-IR.js +1 -1
  10. package/lib/cjs/locale/fr-FR.js +1 -1
  11. package/lib/cjs/locale/id-ID.js +1 -1
  12. package/lib/cjs/locale/it-IT.js +1 -1
  13. package/lib/cjs/locale/ja-JP.js +1 -1
  14. package/lib/cjs/locale/ko-KR.js +1 -1
  15. package/lib/cjs/locale/pl-PL.js +1 -1
  16. package/lib/cjs/locale/pt-BR.js +1 -1
  17. package/lib/cjs/locale/ru-RU.js +1 -1
  18. package/lib/cjs/locale/sk-SK.js +1 -1
  19. package/lib/cjs/locale/vi-VN.js +1 -1
  20. package/lib/cjs/locale/zh-CN.js +1 -1
  21. package/lib/cjs/locale/zh-HK.js +1 -1
  22. package/lib/cjs/locale/zh-TW.js +1 -1
  23. package/lib/es/facade.js +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/facade.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/locale/ar-SA.js +1 -1
  47. package/lib/locale/ca-ES.js +1 -1
  48. package/lib/locale/de-DE.js +1 -1
  49. package/lib/locale/en-US.js +1 -1
  50. package/lib/locale/es-ES.js +1 -1
  51. package/lib/locale/fa-IR.js +1 -1
  52. package/lib/locale/fr-FR.js +1 -1
  53. package/lib/locale/id-ID.js +1 -1
  54. package/lib/locale/it-IT.js +1 -1
  55. package/lib/locale/ja-JP.js +1 -1
  56. package/lib/locale/ko-KR.js +1 -1
  57. package/lib/locale/pl-PL.js +1 -1
  58. package/lib/locale/pt-BR.js +1 -1
  59. package/lib/locale/ru-RU.js +1 -1
  60. package/lib/locale/sk-SK.js +1 -1
  61. package/lib/locale/vi-VN.js +1 -1
  62. package/lib/locale/zh-CN.js +1 -1
  63. package/lib/locale/zh-HK.js +1 -1
  64. package/lib/locale/zh-TW.js +1 -1
  65. package/lib/types/controllers/collaboration/collaboration-entity.d.ts +6 -0
  66. package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +0 -2
  67. package/lib/types/facade/f-collaboration.d.ts +40 -0
  68. package/lib/types/index.d.ts +6 -3
  69. package/lib/types/services/attachment-remote/attachment-io.service.d.ts +1 -4
  70. package/lib/types/services/collaboration-session/collaboration-changeset-translator.d.ts +4 -0
  71. package/lib/types/services/collaboration-session/collaboration-client-adapter.d.ts +39 -0
  72. package/lib/types/services/collaboration-session/collaboration-session.d.ts +5 -4
  73. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +14 -14
  74. package/lib/types/services/image-remote/image-io.service.d.ts +2 -4
  75. package/lib/umd/facade.js +1 -1
  76. package/lib/umd/index.js +1 -1
  77. package/lib/umd/locale/ar-SA.js +1 -1
  78. package/lib/umd/locale/ca-ES.js +1 -1
  79. package/lib/umd/locale/de-DE.js +1 -1
  80. package/lib/umd/locale/en-US.js +1 -1
  81. package/lib/umd/locale/es-ES.js +1 -1
  82. package/lib/umd/locale/fa-IR.js +1 -1
  83. package/lib/umd/locale/fr-FR.js +1 -1
  84. package/lib/umd/locale/id-ID.js +1 -1
  85. package/lib/umd/locale/it-IT.js +1 -1
  86. package/lib/umd/locale/ja-JP.js +1 -1
  87. package/lib/umd/locale/ko-KR.js +1 -1
  88. package/lib/umd/locale/pl-PL.js +1 -1
  89. package/lib/umd/locale/pt-BR.js +1 -1
  90. package/lib/umd/locale/ru-RU.js +1 -1
  91. package/lib/umd/locale/sk-SK.js +1 -1
  92. package/lib/umd/locale/vi-VN.js +1 -1
  93. package/lib/umd/locale/zh-CN.js +1 -1
  94. package/lib/umd/locale/zh-HK.js +1 -1
  95. package/lib/umd/locale/zh-TW.js +1 -1
  96. package/package.json +15 -16
@@ -1 +1 @@
1
- const _0xc89ca8=_0x4b0d;function _0x4b0d(_0x7ab5a2,_0x21255e){_0x7ab5a2=_0x7ab5a2-0xc4;const _0x442d76=_0x442d();let _0x4b0d47=_0x442d76[_0x7ab5a2];return _0x4b0d47;}(function(_0x4a97e1,_0x7fd119){const _0x1a1017=_0x4b0d,_0x2c0660=_0x4a97e1();while(!![]){try{const _0x4f8a02=-parseInt(_0x1a1017(0xcd))/0x1*(parseInt(_0x1a1017(0xd3))/0x2)+-parseInt(_0x1a1017(0xd7))/0x3+-parseInt(_0x1a1017(0xd4))/0x4+parseInt(_0x1a1017(0xc6))/0x5*(-parseInt(_0x1a1017(0xc4))/0x6)+parseInt(_0x1a1017(0xcc))/0x7*(parseInt(_0x1a1017(0xdb))/0x8)+parseInt(_0x1a1017(0xd1))/0x9+parseInt(_0x1a1017(0xce))/0xa*(parseInt(_0x1a1017(0xc5))/0xb);if(_0x4f8a02===_0x7fd119)break;else _0x2c0660['push'](_0x2c0660['shift']());}catch(_0x29eada){_0x2c0660['push'](_0x2c0660['shift']());}}}(_0x442d,0x55fb6));function _0x442d(){const _0x29ad82=['您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','5173398SIUNFD','點擊重新連線','14URqbSA','1894840kyCMrR','加入協作失敗,您的編輯將暫存於本機。','加入協作失敗,請稍後重試,您的編輯將暫存於本機。','11622yBnXLL','認證錯誤','連線失敗,請檢查您的網路。','沒有協作權限,您的編輯將暫存於本機。','8wqHTjj','協作文件數量超過限制,您的編輯將暫存於本機。','744ekZDej','22pekTQK','21355hfuaZZ','伺服器未回應協作請求,您的編輯將儲存在本機。','編輯衝突','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','此文件協作人數已達上限,您的編輯將暫存於本機。','已同步','3441277pIHIBg','947uBJMdf','1497830ZkHAoj','協作衝突'];_0x442d=function(){return _0x29ad82;};return _0x442d();}const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':_0xc89ca8(0xd2)}},'collabStatus':{'fetchMiss':'正在擷取伺服器資料...','conflict':_0xc89ca8(0xc8),'notCollab':'本機檔案','synced':_0xc89ca8(0xcb),'syncing':'同步中...','offline':'已離線,編輯將儲存在本機'},'session':{'connection-failed':_0xc89ca8(0xd9),'will-retry':'連線失敗,將在稍後重試連線。','room-full':_0xc89ca8(0xca),'join-failed':_0xc89ca8(0xd6),'room-not-exists':_0xc89ca8(0xd5),'room-permission-denied':_0xc89ca8(0xda),'room-cnt-exceeds':_0xc89ca8(0xdc),'collaboration-timeout':_0xc89ca8(0xc7)},'conflict':{'title':_0xc89ca8(0xcf),'content':'您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。'},'permission':{'title':_0xc89ca8(0xd8),'content':'您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。'},'collaboration':{'single-unit':{'warning':_0xc89ca8(0xc9)},'closeRoom':'由於協作房間已關閉,編輯權限已被收回。'},'auth':{'needGotoLoginAlert':_0xc89ca8(0xd0)}}};export{e as default};
1
+ function _0x3aaa(_0x4a700a,_0x2500b5){_0x4a700a=_0x4a700a-0x86;const _0x30af31=_0x30af();let _0x3aaa09=_0x30af31[_0x4a700a];return _0x3aaa09;}function _0x30af(){const _0x4fda45=['124yrulDw','連線失敗,將在稍後重試連線。','由於協作房間已關閉,編輯權限已被收回。','此文件協作人數已達上限,您的編輯將暫存於本機。','9AiplCq','1222944DoFFDs','編輯衝突','2468505duTJLi','390EUzXfc','已同步','協作衝突','正在擷取伺服器資料...','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','認證錯誤','伺服器未回應協作請求,您的編輯將儲存在本機。','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','209bVsziQ','4603WFmGBB','28070NLwlBR','3511412YfiksO','本機檔案','協作文件數量超過限制,您的編輯將暫存於本機。','加入協作失敗,您的編輯將暫存於本機。','32UEniai','2463909ThuZuN','已離線,編輯將儲存在本機','同步中...','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','5275740rjwQcz'];_0x30af=function(){return _0x4fda45;};return _0x30af();}const _0x38b178=_0x3aaa;(function(_0x5fe9fa,_0x47265e){const _0x5cc2e9=_0x3aaa,_0x291924=_0x5fe9fa();while(!![]){try{const _0x22e615=-parseInt(_0x5cc2e9(0x88))/0x1*(-parseInt(_0x5cc2e9(0x94))/0x2)+-parseInt(_0x5cc2e9(0x9b))/0x3+parseInt(_0x5cc2e9(0x8a))/0x4+-parseInt(_0x5cc2e9(0x89))/0x5*(-parseInt(_0x5cc2e9(0x9c))/0x6)+-parseInt(_0x5cc2e9(0x8f))/0x7*(parseInt(_0x5cc2e9(0x8e))/0x8)+parseInt(_0x5cc2e9(0x98))/0x9*(-parseInt(_0x5cc2e9(0x93))/0xa)+parseInt(_0x5cc2e9(0x87))/0xb*(parseInt(_0x5cc2e9(0x99))/0xc);if(_0x22e615===_0x47265e)break;else _0x291924['push'](_0x291924['shift']());}catch(_0x5bb7df){_0x291924['push'](_0x291924['shift']());}}}(_0x30af,0xac648));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':'點擊重新連線'}},'collabStatus':{'fetchMiss':_0x38b178(0x9f),'conflict':_0x38b178(0x9a),'notCollab':_0x38b178(0x8b),'synced':_0x38b178(0x9d),'syncing':_0x38b178(0x91),'offline':_0x38b178(0x90)},'session':{'connection-failed':'連線失敗,請檢查您的網路。','will-retry':_0x38b178(0x95),'room-full':_0x38b178(0x97),'join-failed':'加入協作失敗,請稍後重試,您的編輯將暫存於本機。','room-not-exists':_0x38b178(0x8d),'room-permission-denied':'沒有協作權限,您的編輯將暫存於本機。','room-cnt-exceeds':_0x38b178(0x8c),'collaboration-timeout':_0x38b178(0xa2)},'conflict':{'title':_0x38b178(0x9e),'content':_0x38b178(0x86)},'permission':{'title':_0x38b178(0xa1),'content':'您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。'},'collaboration':{'single-unit':{'warning':_0x38b178(0x92)},'closeRoom':_0x38b178(0x96)},'auth':{'needGotoLoginAlert':_0x38b178(0xa0)}}};export{e as default};
@@ -108,3 +108,9 @@ export declare class SlideCollaborationEntity extends CollaborationEntity {
108
108
  constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
109
109
  protected _init(): Promise<CollaborationState>;
110
110
  }
111
+ export declare class BoardCollaborationEntity extends CollaborationEntity {
112
+ readonly unitID: string;
113
+ readonly type: UniverInstanceType;
114
+ constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
115
+ protected _init(): Promise<CollaborationState>;
116
+ }
@@ -18,8 +18,6 @@ export declare const SINGLE_CHANGESET_MUTATIONS: Set<string>;
18
18
  export declare const SLIDE_SINGLE_CHANGESET_MUTATIONS: Set<string>;
19
19
  export declare function takeMutationsForChangeset(pendingMutations: IMutationInfo[], singleChangesetMutations?: Set<string>): IMutationInfo[];
20
20
  export declare function assembleMutationChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
21
- export declare const assembleSheetChangeset: typeof assembleMutationChangeset;
22
- export declare function assembleBaseChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
23
21
  export declare function assembleSlideChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
24
22
  export declare function assembleDocChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
25
23
  export declare function createTimerObservable$<T>(ms: number, options: T): Observable<T>;
@@ -1,4 +1,5 @@
1
1
  import type { FBase as FBaseFacade } from '@univerjs-pro/bases/facade';
2
+ import type { FBoard } from '@univerjs-pro/boards/facade';
2
3
  import type { ILogContext } from '@univerjs-pro/collaboration';
3
4
  import type { FPresentation } from '@univerjs-pro/slides/facade';
4
5
  import type { IDisposable } from '@univerjs/core';
@@ -9,6 +10,13 @@ import { SnapshotService } from '@univerjs-pro/collaboration';
9
10
  import { CollaborationController, CollaborationStatus } from '@univerjs-pro/collaboration-client';
10
11
  import { Injector, IUniverInstanceService } from '@univerjs/core';
11
12
  import { FBase } from '@univerjs/core/facade';
13
+ export interface ICollaborationFlushOptions {
14
+ /**
15
+ * Maximum time to wait for local collaboration changes to reach SYNCED.
16
+ * Defaults to 30 seconds.
17
+ */
18
+ timeout?: number;
19
+ }
12
20
  /**
13
21
  * The Facade API object for the Collaboration module. It provides methods to interact with the
14
22
  * Univer Collaboration backend server, such as loading Univer Sheets and subscribing to collaborators.
@@ -25,6 +33,7 @@ export declare class FCollaboration extends FBase {
25
33
  getDocument: (id: string) => FDocument | null;
26
34
  getPresentation: (id: string) => FPresentation | null;
27
35
  getBase: (id: string) => FBaseFacade | null;
36
+ getBoard: (id: string) => FBoard | null;
28
37
  }, _injector: Injector, _univerInstanceService: IUniverInstanceService, _snapshotService: SnapshotService, _collaborationController: CollaborationController);
29
38
  /**
30
39
  * Load a Univer Sheet from the server with a unit ID.
@@ -74,6 +83,18 @@ export declare class FCollaboration extends FBase {
74
83
  * ```
75
84
  */
76
85
  loadSlideAsync(unitId: string, context?: ILogContext): Promise<FPresentation | null>;
86
+ /**
87
+ * Load a Univer Board from the server with a unit ID.
88
+ * @param {string} unitId ID of the Univer Board that you would like to load.
89
+ * @param {ILogContext} [context] Optional context.
90
+ * @returns {Promise<FBoard | null>} The {@link FBoard} or null if ID cannot be associated with a Univer Board.
91
+ * @example
92
+ * ```typescript
93
+ * const collaboration = univerAPI.getCollaboration();
94
+ * const board = await collaboration.loadBoardAsync('your-unit-id');
95
+ * ```
96
+ */
97
+ loadBoardAsync(unitId: string, context?: ILogContext): Promise<FBoard | null>;
77
98
  /**
78
99
  * Subscribe collaborators of a Univer file.
79
100
  *
@@ -126,4 +147,23 @@ export declare class FCollaboration extends FBase {
126
147
  * ```
127
148
  */
128
149
  getCollaborationStatus(unitId?: string): CollaborationStatus;
150
+ /**
151
+ * Wait until all currently queued collaboration changes for a unit are synchronized.
152
+ *
153
+ * This is intended as an explicit barrier for scripts, agents, and tests after a batch of
154
+ * facade mutations. It does not make individual facade APIs asynchronous.
155
+ *
156
+ * @param {string} [unitId] Optional unit ID. If omitted, uses the focused unit.
157
+ * @param {ICollaborationFlushOptions} [options] Optional timeout configuration.
158
+ * @returns {Promise<void>} Resolves when the unit reaches CollaborationStatus.SYNCED.
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const collaboration = univerAPI.getCollaboration();
163
+ * document.insertText(0, 'Saved through collaboration');
164
+ * await collaboration.flush(document.getId());
165
+ * ```
166
+ */
167
+ flush(unitId?: string, options?: ICollaborationFlushOptions): Promise<void>;
168
+ private _resolveUnitId;
129
169
  }
@@ -2,14 +2,17 @@ export { DEFAULT_WS_SESSION_TICKET_URL, HEARTBEAT_INTERVAL_KEY, HEARTBEAT_TIMEOU
2
2
  export { DEFAULT_COLLAB_WEB_SOCKET_URL, DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT, REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY, } from './config/config';
3
3
  export type { IUniverCollaborationClientConfig } from './config/config';
4
4
  export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY } from './config/config';
5
- export { CollaborationEntity, DocCollaborationEntity, SheetCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
5
+ export { BaseCollaborationEntity, BoardCollaborationEntity, CollaborationEntity, DocCollaborationEntity, SheetCollaborationEntity, SlideCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
6
6
  export type { IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
7
7
  export { AwaitingState, AwaitingWithPendingState, CollaborationStatus, ConflictState, FetchingMissState, OfflineState, PendingState, SyncedState, } from './controllers/collaboration/collaboration-state';
8
8
  export { CollaborationController } from './controllers/collaboration/collaboration.controller';
9
9
  export { UniverCollaborationClientPlugin } from './plugin';
10
- export { AttachmentSourceType, CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
11
- export type { AttachmentValue, IAttachmentIoService as IAttachmentIoServiceType, IAttachmentUploadOptions, IAttachmentValue, } from './services/attachment-remote/attachment-io.service';
10
+ export { CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
11
+ export { AttachmentSourceType } from './services/attachment-remote/types';
12
+ export type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue, } from './services/attachment-remote/types';
12
13
  export { AuthzIoHttpService } from './services/auth-server/authz-io-http.service';
14
+ export { createUniverCollaborationAdapter, ICollaborationClientAdapterService, } from './services/collaboration-session/collaboration-client-adapter';
15
+ export type { ICollaborationAdapterResolveContext, ICollaborationAdapterTransformContext, ICollaborationChangesetAdapter, ICollaborationClientAdapter, ICollaborationSessionIdentity, ICollaborationTarget, ICollaborationUnitResolution, ICreateUniverCollaborationAdapterOptions, } from './services/collaboration-session/collaboration-client-adapter';
13
16
  export { CollaborationSession, SessionStatus } from './services/collaboration-session/collaboration-session';
14
17
  export { CollaborationSessionService } from './services/collaboration-session/collaboration-session.service';
15
18
  export { CollaborationUIEventId, CollaborationUIEventService, } from './services/collaboration-ui-event/collaboration-ui-event';
@@ -1,9 +1,6 @@
1
- import type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue } from './types';
1
+ import type { IAttachmentUploadOptions, IAttachmentValue } from './types';
2
2
  import { IConfigService, IUniverInstanceService } from '@univerjs/core';
3
3
  import { HTTPService } from '@univerjs/network';
4
- import { AttachmentSourceType } from './types';
5
- export { AttachmentSourceType };
6
- export type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue };
7
4
  export interface IAttachmentIoService {
8
5
  getUploadOptions(): IAttachmentUploadOptions;
9
6
  saveAttachment(file: File): Promise<IAttachmentValue>;
@@ -0,0 +1,4 @@
1
+ import type { ICollaborationEvent } from '@univerjs-pro/collaboration';
2
+ import type { ICollaborationSessionIdentity } from './collaboration-client-adapter';
3
+ export declare function toRemoteCollaborationEvent(identity: ICollaborationSessionIdentity, event: ICollaborationEvent): ICollaborationEvent;
4
+ export declare function toLocalCollaborationEvents(identity: ICollaborationSessionIdentity, event: ICollaborationEvent): ICollaborationEvent[];
@@ -0,0 +1,39 @@
1
+ import type { IChangeset } from '@univerjs-pro/collaboration';
2
+ import type { UniverInstanceType } from '@univerjs/core';
3
+ export interface ICollaborationTarget {
4
+ endpoint?: string;
5
+ unitId: string;
6
+ unitType?: UniverInstanceType;
7
+ }
8
+ export interface ICollaborationAdapterResolveContext {
9
+ unitId: string;
10
+ unitType?: UniverInstanceType;
11
+ }
12
+ export interface ICollaborationAdapterTransformContext {
13
+ localUnitId: string;
14
+ unitType?: UniverInstanceType;
15
+ target: ICollaborationTarget;
16
+ }
17
+ export interface ICollaborationChangesetAdapter {
18
+ toRemote(changeset: IChangeset, context: ICollaborationAdapterTransformContext): IChangeset;
19
+ toLocal(changeset: IChangeset, context: ICollaborationAdapterTransformContext): IChangeset;
20
+ }
21
+ export interface ICollaborationUnitResolution {
22
+ target: ICollaborationTarget;
23
+ changeset?: ICollaborationChangesetAdapter;
24
+ }
25
+ export interface ICollaborationClientAdapter {
26
+ resolveUnit(context: ICollaborationAdapterResolveContext): ICollaborationUnitResolution | Promise<ICollaborationUnitResolution>;
27
+ }
28
+ export interface ICreateUniverCollaborationAdapterOptions {
29
+ resolveUnit?: ICollaborationClientAdapter['resolveUnit'];
30
+ }
31
+ export interface ICollaborationSessionIdentity {
32
+ localUnitId: string;
33
+ unitType?: UniverInstanceType;
34
+ target: ICollaborationTarget;
35
+ changeset?: ICollaborationChangesetAdapter;
36
+ }
37
+ export declare const ICollaborationClientAdapterService: import("@wendellhu/redi").IdentifierDecorator<ICollaborationClientAdapter>;
38
+ export declare function createUniverCollaborationAdapter(options?: ICreateUniverCollaborationAdapterOptions): ICollaborationClientAdapter;
39
+ export declare function normalizeCollaborationSessionIdentity(localUnitId: string, unitType: UniverInstanceType | undefined, resolution: ICollaborationUnitResolution): ICollaborationSessionIdentity;
@@ -2,6 +2,7 @@ import type { ICollaborationEvent } from '@univerjs-pro/collaboration';
2
2
  import type { IDisposable, Nullable } from '@univerjs/core';
3
3
  import type { Observable } from 'rxjs';
4
4
  import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
5
+ import type { ICollaborationSessionIdentity } from './collaboration-client-adapter';
5
6
  import { IConfigService, ILogService, RxDisposable } from '@univerjs/core';
6
7
  import { ITelemetryService } from '@univerjs/telemetry';
7
8
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
@@ -23,10 +24,10 @@ export declare const FailedReason: {
23
24
  /**
24
25
  * The data structure to represent a collaboration session. It also manages the collaborator's identity.
25
26
  *
26
- * An collaboration session maps to a unit.
27
+ * A collaboration session maps one local unit to one collaboration target.
27
28
  */
28
29
  export declare class CollaborationSession extends RxDisposable implements IDisposable {
29
- private readonly _unitID;
30
+ private readonly _identity;
30
31
  private readonly _logService;
31
32
  private readonly _configService;
32
33
  private readonly _memberService;
@@ -40,7 +41,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
40
41
  readonly event$: Observable<ICollaborationEvent>;
41
42
  private _socket;
42
43
  private _socketMessageSubscription;
43
- constructor(_unitID: string, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _configService: IConfigService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
44
+ constructor(_identity: ICollaborationSessionIdentity, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _configService: IConfigService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
44
45
  getMemberID(): string | null;
45
46
  dispose(): void;
46
47
  close(): void;
@@ -53,7 +54,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
53
54
  /**
54
55
  * Send event to the collaboration server.
55
56
  */
56
- send(event: ICollaborationEvent, unitID: string): Promise<void>;
57
+ send(event: ICollaborationEvent, _unitID: string): Promise<void>;
57
58
  private _collaborationTimeoutTimer;
58
59
  private _scheduleCollaborationTimeoutTimer;
59
60
  private _clearCollaborationTimeoutTimer;
@@ -1,5 +1,6 @@
1
- import type { Nullable } from '@univerjs/core';
1
+ import type { Nullable, UniverInstanceType } from '@univerjs/core';
2
2
  import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
3
+ import type { ICollaborationClientAdapter } from './collaboration-client-adapter';
3
4
  import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
4
5
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
5
6
  import { INetworkConditionService } from '../network-condition/network-condition.service';
@@ -15,22 +16,19 @@ export declare class CollaborationSessionService extends Disposable {
15
16
  private readonly _configService;
16
17
  private readonly _socketService;
17
18
  private readonly _collaborationUIEventService;
19
+ private readonly _adapter;
18
20
  private readonly _networkConditionService?;
21
+ private _sessions;
22
+ private _pendingSessions;
23
+ private _sessionChannels;
24
+ private _socketChannels;
19
25
  /**
20
- * Socket for collaboration sessions. Session are by unitID but the socket is share by collaboration sessions.
26
+ * Socket for collaboration sessions on the default endpoint.
21
27
  */
22
- private _socket$;
23
28
  readonly socket$: import("rxjs").Observable<Nullable<ICollaborationSocket>>;
24
- private get _socket();
25
- private _candidateSocket;
26
- private _sessions;
27
29
  private _status$;
28
30
  status$: import("rxjs").Observable<SessionStatus>;
29
- private _socketReady;
30
- private _retryConnectingTimer;
31
- private _retryCount;
32
- private _socketMessageSubscription;
33
- constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _networkConditionService?: INetworkConditionService | undefined);
31
+ constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _adapter: ICollaborationClientAdapter, _networkConditionService?: INetworkConditionService | undefined);
34
32
  private _listenToNetworkCondition;
35
33
  dispose(): void;
36
34
  /**
@@ -38,7 +36,8 @@ export declare class CollaborationSessionService extends Disposable {
38
36
  * @param unitID
39
37
  * @returns a collaboration session.
40
38
  */
41
- requireSession(unitID: string): Promise<CollaborationSession>;
39
+ requireSession(unitID: string, unitType?: UniverInstanceType): Promise<CollaborationSession>;
40
+ private _createSession;
42
41
  closeSession(unitID: string): void;
43
42
  reconnect(): void;
44
43
  private _clearRetryConnectingTimer;
@@ -63,9 +62,10 @@ export declare class CollaborationSessionService extends Disposable {
63
62
  private _onOffline;
64
63
  private _onConnectionFailed;
65
64
  private _tryReconnect;
65
+ private _resolveSessionIdentity;
66
66
  private _onMessage;
67
- private _sendHeartbeatTimer;
68
- private _timeoutTimer;
67
+ private _hasSessionsForEndpoint;
68
+ private _getSocketChannel;
69
69
  private _rescheduleHeartbeat;
70
70
  private _sendHeartbeat;
71
71
  private _waitForHeartbeatResponse;
@@ -1,9 +1,7 @@
1
- import type { Nullable } from '@univerjs/core';
2
- import type { IImageIoService, IImageIoServiceParam } from '@univerjs/drawing';
1
+ import type { IImageIoService, IImageIoServiceParam, Nullable } from '@univerjs/core';
3
2
  import type { IError } from '@univerjs/protocol';
4
3
  import type { Observable } from 'rxjs';
5
- import { IConfigService, IUniverInstanceService } from '@univerjs/core';
6
- import { ImageSourceType } from '@univerjs/drawing';
4
+ import { IConfigService, ImageSourceType, IUniverInstanceService } from '@univerjs/core';
7
5
  import { HTTPService } from '@univerjs/network';
8
6
  export interface ISignUrlResponse {
9
7
  error: IError | undefined;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x4322(_0x1d64c9,_0xa85045){_0x1d64c9=_0x1d64c9-0x1bb;const _0x3879e1=_0x3879();let _0x432296=_0x3879e1[_0x1d64c9];return _0x432296;}function _0x3879(){const _0x334e76=['CollaborationStatusChanged','FUniver','7gfrpiM','disposeWithMe','3971902CoQkJP','length','_handler','loadSlide','@univerjs/core/facade','decorate','add','_collaborationController','getCollaboration','defineProperty','FEventName','DataLoaderService','readyForCollab','877693tHCBnH','values','@univerjs/core','loadServerUnitOfRevision','Injector','toStringTag','registerEventHandler','entityInit$','_snapshotService','loadBaseAsync','FEnum','exports','loadUnitOfRevision','UniverProCollaborationClient','36IGCIcv','CollaborationController','UniverProCollaboration','973168TxITEy','toDisposable','getDocument','_injector','IUniverInstanceService','FCollaboration','pipe','1173096NKrbST','10YDSxUF','FBase','getFocusedUnit','CollaborationStatus','MemberService','object','loadSheet','getCollabEntity','2697955uaBdgN','subscribe','getWorkbook','state','loadBase','loadDocAsync','getPresentation','@univerjs-pro/collaboration','status$','function','18WXIyuR','switchMap','@univerjs-pro/collaboration-client','amd','948928IpHQyh','unitID','getUnitId','6939366asFhbS','Inject','createInstance','get','Event','DisposableCollection','loadDoc','_initialize','NOT_COLLAB','getOwnPropertyDescriptor','rxjs','extend','getBase'];_0x3879=function(){return _0x334e76;};return _0x3879();}(function(_0xd33a76,_0x59fe51){const _0x5f39f4=_0x4322,_0x482e71=_0xd33a76();while(!![]){try{const _0xafcf71=parseInt(_0x5f39f4(0x1c0))/0x1+-parseInt(_0x5f39f4(0x1d8))/0x2+parseInt(_0x5f39f4(0x1eb))/0x3*(parseInt(_0x5f39f4(0x1d1))/0x4)+-parseInt(_0x5f39f4(0x1e1))/0x5+-parseInt(_0x5f39f4(0x1f2))/0x6*(parseInt(_0x5f39f4(0x201))/0x7)+-parseInt(_0x5f39f4(0x1ef))/0x8*(-parseInt(_0x5f39f4(0x1ce))/0x9)+-parseInt(_0x5f39f4(0x1d9))/0xa*(-parseInt(_0x5f39f4(0x203))/0xb);if(_0xafcf71===_0x59fe51)break;else _0x482e71['push'](_0x482e71['shift']());}catch(_0x45c4e6){_0x482e71['push'](_0x482e71['shift']());}}}(_0x3879,0xd95b3),function(_0x3a1e6e,_0x1d5742){const _0x557fb1=_0x4322;typeof exports==_0x557fb1(0x1de)&&typeof module<'u'?_0x1d5742(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define==_0x557fb1(0x1ea)&&define[_0x557fb1(0x1ee)]?define([_0x557fb1(0x1cb),_0x557fb1(0x1ed),_0x557fb1(0x207),_0x557fb1(0x1c2),_0x557fb1(0x1e8),'rxjs'],_0x1d5742):(_0x3a1e6e=typeof globalThis<'u'?globalThis:_0x3a1e6e||self,_0x1d5742(_0x3a1e6e['UniverProCollaborationClientFacade']={},_0x3a1e6e[_0x557fb1(0x1cd)],_0x3a1e6e['UniverCoreFacade'],_0x3a1e6e['UniverCore'],_0x3a1e6e[_0x557fb1(0x1d0)],_0x3a1e6e[_0x557fb1(0x1fc)]));}(this,function(_0x35a544,_0x1ad98c,_0x131f9c,_0x80d3a0,_0x1a6ca0,_0x4d9d27){const _0x4c1a34=_0x4322;Object[_0x4c1a34(0x1bc)](_0x35a544,Symbol[_0x4c1a34(0x1c5)],{'value':'Module'});var _0x771dcd=class extends _0x131f9c[_0x4c1a34(0x1ca)]{get[_0x4c1a34(0x1dc)](){const _0x5e5025=_0x4c1a34;return _0x1ad98c[_0x5e5025(0x1dc)];}};_0x131f9c[_0x4c1a34(0x1ca)]['extend'](_0x771dcd);var _0x5213d3=class extends _0x131f9c[_0x4c1a34(0x1bd)]{get['CollaborationStatusChanged'](){const _0x5b53da=_0x4c1a34;return _0x5b53da(0x1ff);}};_0x131f9c[_0x4c1a34(0x1bd)][_0x4c1a34(0x1fd)](_0x5213d3);function _0x494468(_0x1d276a,_0x1f2d10){return function(_0x5a99b9,_0x3fee8a){_0x1f2d10(_0x5a99b9,_0x3fee8a,_0x1d276a);};}function _0x3abfd8(_0x10d3ad,_0x10065,_0x2b7495,_0x536fa6){const _0x35bc15=_0x4c1a34;var _0x17f015=arguments[_0x35bc15(0x204)],_0x297848=_0x17f015<0x3?_0x10065:_0x536fa6===null?_0x536fa6=Object[_0x35bc15(0x1fb)](_0x10065,_0x2b7495):_0x536fa6,_0x4de904;if(typeof Reflect=='object'&&typeof Reflect[_0x35bc15(0x208)]==_0x35bc15(0x1ea))_0x297848=Reflect[_0x35bc15(0x208)](_0x10d3ad,_0x10065,_0x2b7495,_0x536fa6);else{for(var _0x4d43fd=_0x10d3ad['length']-0x1;_0x4d43fd>=0x0;_0x4d43fd--)(_0x4de904=_0x10d3ad[_0x4d43fd])&&(_0x297848=(_0x17f015<0x3?_0x4de904(_0x297848):_0x17f015>0x3?_0x4de904(_0x10065,_0x2b7495,_0x297848):_0x4de904(_0x10065,_0x2b7495))||_0x297848);}return _0x17f015>0x3&&_0x297848&&Object[_0x35bc15(0x1bc)](_0x10065,_0x2b7495,_0x297848),_0x297848;}let _0x4eb2b5=class extends _0x131f9c[_0x4c1a34(0x1da)]{constructor(_0x542b71,_0x4772ac,_0x343266,_0x4fdbfd,_0x38e1bd){const _0x2a820b=_0x4c1a34;super(),this[_0x2a820b(0x205)]=_0x542b71,this[_0x2a820b(0x1d4)]=_0x4772ac,this['_univerInstanceService']=_0x343266,this[_0x2a820b(0x1c8)]=_0x4fdbfd,this[_0x2a820b(0x20a)]=_0x38e1bd;}async['loadSheetAsync'](_0x125406,_0x11eae5){const _0x14591f=_0x4c1a34;return await this[_0x14591f(0x1c8)][_0x14591f(0x1df)](_0x125406,0x0,_0x11eae5)?(await this['_collaborationController'][_0x14591f(0x1bf)](_0x125406),this[_0x14591f(0x205)][_0x14591f(0x1e3)](_0x125406)):null;}async[_0x4c1a34(0x1e6)](_0x2c5cb3,_0x401f68){const _0x1f4807=_0x4c1a34;return await this['_snapshotService'][_0x1f4807(0x1f8)](_0x2c5cb3,0x0,_0x401f68)?(await this[_0x1f4807(0x20a)][_0x1f4807(0x1bf)](_0x2c5cb3),this[_0x1f4807(0x205)]['getDocument'](_0x2c5cb3)):null;}async[_0x4c1a34(0x1c9)](_0x55c7f8,_0x5d71b1){const _0x220ef7=_0x4c1a34;return await this[_0x220ef7(0x1c8)][_0x220ef7(0x1e5)](_0x55c7f8,0x0,_0x5d71b1)?(await this[_0x220ef7(0x20a)]['readyForCollab'](_0x55c7f8),this[_0x220ef7(0x205)]['getBase'](_0x55c7f8)):null;}async['loadSlideAsync'](_0x48c220,_0x2e3cdd){const _0x253c6d=_0x4c1a34;return await this['_snapshotService'][_0x253c6d(0x206)](_0x48c220,0x0,_0x2e3cdd)?(await this[_0x253c6d(0x20a)]['readyForCollab'](_0x48c220),this[_0x253c6d(0x205)][_0x253c6d(0x1e7)](_0x48c220)):null;}['subscribeCollaborators'](_0x179493,_0x5c1d53){const _0x2490e4=_0x4c1a34;return(0x0,_0x80d3a0[_0x2490e4(0x1d2)])(this[_0x2490e4(0x1d4)][_0x2490e4(0x1f5)](_0x1ad98c[_0x2490e4(0x1dd)])['waitForRoom$'](_0x179493)[_0x2490e4(0x1d7)]((0x0,_0x4d9d27[_0x2490e4(0x1ec)])(_0x36d168=>_0x36d168['members$']))[_0x2490e4(0x1e2)](_0x2731ef=>_0x5c1d53(Array['from'](_0x2731ef[_0x2490e4(0x1c1)]()))));}['getCollaborationStatus'](_0x44ad64){const _0x24ef74=_0x4c1a34;var _0xb1ec65;let _0x427fa0;if(_0x44ad64)_0x427fa0=_0x44ad64;else{let _0x4fce71=this['_univerInstanceService'][_0x24ef74(0x1db)]();_0x427fa0=_0x4fce71==null?void 0x0:_0x4fce71[_0x24ef74(0x1f1)]();}if(!_0x427fa0)return _0x1ad98c[_0x24ef74(0x1dc)]['NOT_COLLAB'];let _0x421dfe=this[_0x24ef74(0x20a)][_0x24ef74(0x1e0)](_0x427fa0);return(_0xb1ec65=_0x421dfe==null?void 0x0:_0x421dfe[_0x24ef74(0x1e4)]['status'])==null?_0x1ad98c[_0x24ef74(0x1dc)][_0x24ef74(0x1fa)]:_0xb1ec65;}};_0x4eb2b5=_0x3abfd8([_0x494468(0x1,(0x0,_0x80d3a0[_0x4c1a34(0x1f3)])(_0x80d3a0[_0x4c1a34(0x1c4)])),_0x494468(0x2,_0x80d3a0[_0x4c1a34(0x1d5)]),_0x494468(0x3,(0x0,_0x80d3a0['Inject'])(_0x1a6ca0['SnapshotService'])),_0x494468(0x4,(0x0,_0x80d3a0[_0x4c1a34(0x1f3)])(_0x1ad98c[_0x4c1a34(0x1cf)]))],_0x4eb2b5);var _0x193672=class extends _0x131f9c[_0x4c1a34(0x200)]{[_0x4c1a34(0x1f9)](_0x55789a){const _0x24de41=_0x4c1a34;let _0x510a2f=_0x55789a[_0x24de41(0x1f5)](_0x1ad98c[_0x24de41(0x1cf)]);this[_0x24de41(0x202)](this[_0x24de41(0x1c6)](this[_0x24de41(0x1f6)]['CollaborationStatusChanged'],()=>{const _0x490391=_0x24de41;let _0xfb34d6=new _0x80d3a0[(_0x490391(0x1f7))](),_0x2f228c=_0x510a2f[_0x490391(0x1c7)]['subscribe'](_0x50737f=>{const _0x2c07cc=_0x490391;let _0x28a30b=_0x50737f[_0x2c07cc(0x1e9)][_0x2c07cc(0x1e2)](_0x1336cb=>{const _0x1e0542=_0x2c07cc;let _0x166f14={'unitId':_0x50737f[_0x1e0542(0x1f0)],'status':_0x1336cb};this['fireEvent'](this[_0x1e0542(0x1f6)][_0x1e0542(0x1ff)],_0x166f14);});_0xfb34d6[_0x2c07cc(0x209)]((0x0,_0x80d3a0[_0x2c07cc(0x1d2)])(_0x28a30b));});return _0xfb34d6[_0x490391(0x209)]((0x0,_0x80d3a0[_0x490391(0x1d2)])(_0x2f228c)),_0xfb34d6;}));}[_0x4c1a34(0x1bb)](){const _0x119bf1=_0x4c1a34;return this[_0x119bf1(0x1d4)][_0x119bf1(0x1f4)](_0x4eb2b5,{'getWorkbook':_0x4c8241=>this['getWorkbook'](_0x4c8241),'getDocument':_0x497a3a=>this[_0x119bf1(0x1d3)](_0x497a3a),'getPresentation':_0x5af403=>this['getPresentation'](_0x5af403),'getBase':_0x1f962c=>this[_0x119bf1(0x1fe)](_0x1f962c)});}['loadServerUnit'](_0x14f5d3,_0xb52ab,_0x268edf){const _0x901334=_0x4c1a34;return this[_0x901334(0x1d4)][_0x901334(0x1f5)](_0x1ad98c[_0x901334(0x1be)])['loadUnit'](_0x14f5d3,_0xb52ab,_0x268edf);}[_0x4c1a34(0x1c3)](_0x3825b9,_0x354efa,_0x3a42fd){const _0x4777bd=_0x4c1a34;return this['_injector'][_0x4777bd(0x1f5)](_0x1ad98c[_0x4777bd(0x1be)])[_0x4777bd(0x1cc)](_0x3825b9,_0x354efa,_0x3a42fd);}};_0x131f9c[_0x4c1a34(0x200)][_0x4c1a34(0x1fd)](_0x193672),Object[_0x4c1a34(0x1bc)](_0x35a544,_0x4c1a34(0x1d6),{'enumerable':!0x0,'get':function(){return _0x4eb2b5;}});}));
1
+ (function(_0x29fe18,_0x47abbc){const _0x1dae1c=_0x3e43,_0x4bb106=_0x29fe18();while(!![]){try{const _0x1bb982=-parseInt(_0x1dae1c(0x233))/0x1+parseInt(_0x1dae1c(0x248))/0x2*(parseInt(_0x1dae1c(0x249))/0x3)+parseInt(_0x1dae1c(0x215))/0x4+-parseInt(_0x1dae1c(0x1fb))/0x5+-parseInt(_0x1dae1c(0x22e))/0x6+-parseInt(_0x1dae1c(0x20a))/0x7+-parseInt(_0x1dae1c(0x200))/0x8*(-parseInt(_0x1dae1c(0x24a))/0x9);if(_0x1bb982===_0x47abbc)break;else _0x4bb106['push'](_0x4bb106['shift']());}catch(_0x574d56){_0x4bb106['push'](_0x4bb106['shift']());}}}(_0x1b54,0x6a738),function(_0x57e7c5,_0x213d25){const _0x4539af=_0x3e43;typeof exports=='object'&&typeof module<'u'?_0x213d25(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define=='function'&&define[_0x4539af(0x22b)]?define([_0x4539af(0x228),_0x4539af(0x235),_0x4539af(0x20f),_0x4539af(0x211),_0x4539af(0x234),_0x4539af(0x1fd)],_0x213d25):(_0x57e7c5=typeof globalThis<'u'?globalThis:_0x57e7c5||self,_0x213d25(_0x57e7c5[_0x4539af(0x23c)]={},_0x57e7c5[_0x4539af(0x202)],_0x57e7c5[_0x4539af(0x223)],_0x57e7c5[_0x4539af(0x206)],_0x57e7c5[_0x4539af(0x246)],_0x57e7c5[_0x4539af(0x1fd)]));}(this,function(_0x38c5b1,_0x2e361e,_0x280377,_0x1ca07a,_0x307cc5,_0x2dbb1a){const _0x2323f8=_0x3e43;Object[_0x2323f8(0x204)](_0x38c5b1,Symbol[_0x2323f8(0x20c)],{'value':_0x2323f8(0x230)});var _0x159d97=class extends _0x280377[_0x2323f8(0x245)]{get['CollaborationStatus'](){const _0x2b35bd=_0x2323f8;return _0x2e361e[_0x2b35bd(0x222)];}};_0x280377['FEnum'][_0x2323f8(0x22a)](_0x159d97);var _0x328501=class extends _0x280377[_0x2323f8(0x236)]{get[_0x2323f8(0x213)](){return'CollaborationStatusChanged';}};_0x280377[_0x2323f8(0x236)][_0x2323f8(0x22a)](_0x328501);function _0x6a3b9f(_0xd06144,_0x2c3635){return function(_0x57dcae,_0x51230e){_0x2c3635(_0x57dcae,_0x51230e,_0xd06144);};}function _0x59a918(_0x3a0667,_0x2fc364,_0x12bb61,_0x43349c){const _0x46c525=_0x2323f8;var _0xbba3ee=arguments[_0x46c525(0x209)],_0x37d3a9=_0xbba3ee<0x3?_0x2fc364:_0x43349c===null?_0x43349c=Object[_0x46c525(0x1ef)](_0x2fc364,_0x12bb61):_0x43349c,_0xf5576a;if(typeof Reflect=='object'&&typeof Reflect[_0x46c525(0x247)]==_0x46c525(0x214))_0x37d3a9=Reflect[_0x46c525(0x247)](_0x3a0667,_0x2fc364,_0x12bb61,_0x43349c);else{for(var _0x5d9b1c=_0x3a0667[_0x46c525(0x209)]-0x1;_0x5d9b1c>=0x0;_0x5d9b1c--)(_0xf5576a=_0x3a0667[_0x5d9b1c])&&(_0x37d3a9=(_0xbba3ee<0x3?_0xf5576a(_0x37d3a9):_0xbba3ee>0x3?_0xf5576a(_0x2fc364,_0x12bb61,_0x37d3a9):_0xf5576a(_0x2fc364,_0x12bb61))||_0x37d3a9);}return _0xbba3ee>0x3&&_0x37d3a9&&Object[_0x46c525(0x204)](_0x2fc364,_0x12bb61,_0x37d3a9),_0x37d3a9;}let _0x4a5feb=class extends _0x280377[_0x2323f8(0x23e)]{constructor(_0x5010af,_0xd7dc74,_0x2c83af,_0x2cfd16,_0x1c27e0){const _0xcae31d=_0x2323f8;super(),this['_handler']=_0x5010af,this[_0xcae31d(0x22f)]=_0xd7dc74,this[_0xcae31d(0x1ee)]=_0x2c83af,this[_0xcae31d(0x227)]=_0x2cfd16,this[_0xcae31d(0x216)]=_0x1c27e0;}async['loadSheetAsync'](_0x421c22,_0x34b98c){const _0x3944c4=_0x2323f8;return await this['_snapshotService'][_0x3944c4(0x221)](_0x421c22,0x0,_0x34b98c)?(await this[_0x3944c4(0x216)][_0x3944c4(0x21c)](_0x421c22),this[_0x3944c4(0x205)]['getWorkbook'](_0x421c22)):null;}async[_0x2323f8(0x243)](_0x63e2eb,_0x102c99){const _0x471129=_0x2323f8;return await this[_0x471129(0x227)][_0x471129(0x232)](_0x63e2eb,0x0,_0x102c99)?(await this[_0x471129(0x216)][_0x471129(0x21c)](_0x63e2eb),this[_0x471129(0x205)][_0x471129(0x212)](_0x63e2eb)):null;}async['loadBaseAsync'](_0xd0294,_0x2b1b8c){const _0x174b62=_0x2323f8;return await this[_0x174b62(0x227)][_0x174b62(0x244)](_0xd0294,0x0,_0x2b1b8c)?(await this[_0x174b62(0x216)][_0x174b62(0x21c)](_0xd0294),this['_handler'][_0x174b62(0x20d)](_0xd0294)):null;}async[_0x2323f8(0x201)](_0x55b0c4,_0x4e7552){const _0x3b374d=_0x2323f8;return await this[_0x3b374d(0x227)]['loadSlide'](_0x55b0c4,0x0,_0x4e7552)?(await this[_0x3b374d(0x216)][_0x3b374d(0x21c)](_0x55b0c4),this[_0x3b374d(0x205)][_0x3b374d(0x1f6)](_0x55b0c4)):null;}async[_0x2323f8(0x21d)](_0x29e98b,_0x14646d){const _0x27d48f=_0x2323f8;return await this['_snapshotService'][_0x27d48f(0x1ff)](_0x29e98b,0x0,_0x14646d)?(await this['_collaborationController'][_0x27d48f(0x21c)](_0x29e98b),this[_0x27d48f(0x205)][_0x27d48f(0x1fe)](_0x29e98b)):null;}[_0x2323f8(0x1f1)](_0x3efd08,_0x4a3bb0){const _0x130b06=_0x2323f8;return(0x0,_0x1ca07a['toDisposable'])(this['_injector'][_0x130b06(0x1ed)](_0x2e361e[_0x130b06(0x208)])[_0x130b06(0x237)](_0x3efd08)[_0x130b06(0x207)]((0x0,_0x2dbb1a[_0x130b06(0x24d)])(_0x28b5bc=>_0x28b5bc[_0x130b06(0x23d)]))[_0x130b06(0x239)](_0x2b0c17=>_0x4a3bb0(Array[_0x130b06(0x21f)](_0x2b0c17[_0x130b06(0x1f4)]()))));}[_0x2323f8(0x231)](_0xb3db25){const _0x51decf=_0x2323f8;var _0x158721;let _0x431fe5=this['_resolveUnitId'](_0xb3db25);if(!_0x431fe5)return _0x2e361e['CollaborationStatus'][_0x51decf(0x1f9)];let _0x1a9012=this[_0x51decf(0x216)]['getCollabEntity'](_0x431fe5);return(_0x158721=_0x1a9012==null?void 0x0:_0x1a9012[_0x51decf(0x1fa)][_0x51decf(0x22c)])==null?_0x2e361e[_0x51decf(0x222)][_0x51decf(0x1f9)]:_0x158721;}[_0x2323f8(0x1fc)](_0x2b80b1,_0x49078f={}){const _0x4dd211=_0x2323f8;var _0x32340e;let _0x48126b=this[_0x4dd211(0x24c)](_0x2b80b1);if(!_0x48126b)return Promise[_0x4dd211(0x21a)](Error(_0x4dd211(0x23f)));let _0x2c0a4b=this[_0x4dd211(0x216)][_0x4dd211(0x218)](_0x48126b);if(!_0x2c0a4b)return Promise['reject'](Error('[FCollaboration]:\x20Unit\x20\x22'+_0x48126b+_0x4dd211(0x240)));let _0x3082ba=_0x2c0a4b[_0x4dd211(0x1fa)]['status'];if(_0x3082ba===_0x2e361e[_0x4dd211(0x222)]['SYNCED'])return Promise['resolve']();let _0x163b49=_0x51b5a8(_0x48126b,_0x3082ba);if(_0x163b49)return Promise[_0x4dd211(0x21a)](_0x163b49);let _0x1a84a4=(_0x32340e=_0x49078f['timeout'])==null?0x7530:_0x32340e;return new Promise((_0x19da00,_0x2bebd8)=>{const _0x40457a=_0x4dd211;let _0x42f17b=!0x1,_0x39ab63=null,_0xedbaad=setTimeout(()=>{const _0x43dedc=_0x3e43;_0x42f17b=!0x0,_0x39ab63==null||_0x39ab63['unsubscribe'](),_0x2bebd8(Error(_0x43dedc(0x238)+_0x48126b+_0x43dedc(0x219)+_0x1a84a4+_0x43dedc(0x225)));},_0x1a84a4),_0x9d4e53=()=>{const _0x11e746=_0x3e43;_0x42f17b=!0x0,clearTimeout(_0xedbaad),_0x39ab63==null||_0x39ab63[_0x11e746(0x242)]();};_0x39ab63=_0x2c0a4b[_0x40457a(0x21b)]['subscribe'](_0xe39911=>{const _0x238ef2=_0x40457a;if(_0x42f17b)return;if(_0xe39911===_0x2e361e['CollaborationStatus'][_0x238ef2(0x226)]){_0x9d4e53(),_0x19da00();return;}let _0x22e950=_0x51b5a8(_0x48126b,_0xe39911);_0x22e950&&(_0x9d4e53(),_0x2bebd8(_0x22e950));});});}[_0x2323f8(0x24c)](_0x261106){const _0x4f906e=_0x2323f8;var _0x28dc69;return _0x261106||((_0x28dc69=this[_0x4f906e(0x1ee)][_0x4f906e(0x210)]())==null?void 0x0:_0x28dc69[_0x4f906e(0x1f2)]());}};_0x4a5feb=_0x59a918([_0x6a3b9f(0x1,(0x0,_0x1ca07a[_0x2323f8(0x1f0)])(_0x1ca07a[_0x2323f8(0x241)])),_0x6a3b9f(0x2,_0x1ca07a[_0x2323f8(0x224)]),_0x6a3b9f(0x3,(0x0,_0x1ca07a[_0x2323f8(0x1f0)])(_0x307cc5[_0x2323f8(0x21e)])),_0x6a3b9f(0x4,(0x0,_0x1ca07a[_0x2323f8(0x1f0)])(_0x2e361e[_0x2323f8(0x203)]))],_0x4a5feb);function _0x51b5a8(_0x5b3892,_0x50b6cd){const _0x2cf28d=_0x2323f8;return _0x50b6cd===_0x2e361e[_0x2cf28d(0x222)]['CONFLICT']||_0x50b6cd===_0x2e361e[_0x2cf28d(0x222)]['NOT_COLLAB']?Error(_0x2cf28d(0x217)+_0x5b3892+_0x2cf28d(0x1ec)+_0x50b6cd+'.'):null;}var _0x327b1c=class extends _0x280377[_0x2323f8(0x1f7)]{[_0x2323f8(0x23b)](_0x63949e){const _0x53714e=_0x2323f8;let _0x23b5bb=_0x63949e[_0x53714e(0x1ed)](_0x2e361e[_0x53714e(0x203)]);this['disposeWithMe'](this[_0x53714e(0x23a)](this['Event'][_0x53714e(0x213)],()=>{const _0x3ea29d=_0x53714e;let _0x3bd43b=new _0x1ca07a[(_0x3ea29d(0x1f8))](),_0x509e52=_0x23b5bb[_0x3ea29d(0x20e)][_0x3ea29d(0x239)](_0x510518=>{const _0x5916dc=_0x3ea29d;let _0x5a9cc6=_0x510518[_0x5916dc(0x21b)][_0x5916dc(0x239)](_0x3ed7fd=>{let _0x200ce4={'unitId':_0x510518['unitID'],'status':_0x3ed7fd};this['fireEvent'](this['Event']['CollaborationStatusChanged'],_0x200ce4);});_0x3bd43b[_0x5916dc(0x24b)]((0x0,_0x1ca07a[_0x5916dc(0x22d)])(_0x5a9cc6));});return _0x3bd43b[_0x3ea29d(0x24b)]((0x0,_0x1ca07a[_0x3ea29d(0x22d)])(_0x509e52)),_0x3bd43b;}));}[_0x2323f8(0x1f5)](){const _0x3581b8=_0x2323f8;return this['_injector'][_0x3581b8(0x1f3)](_0x4a5feb,{'getWorkbook':_0x530542=>this[_0x3581b8(0x20b)](_0x530542),'getDocument':_0x1718ee=>this[_0x3581b8(0x212)](_0x1718ee),'getPresentation':_0x6c4c49=>this[_0x3581b8(0x1f6)](_0x6c4c49),'getBase':_0x11c29e=>this[_0x3581b8(0x20d)](_0x11c29e),'getBoard':_0xa0f90=>this[_0x3581b8(0x1fe)](_0xa0f90)});}['loadServerUnit'](_0x172f7c,_0x8787b6,_0x1823d8){const _0x36c2d8=_0x2323f8;return this[_0x36c2d8(0x22f)][_0x36c2d8(0x1ed)](_0x2e361e['DataLoaderService'])['loadUnit'](_0x172f7c,_0x8787b6,_0x1823d8);}['loadServerUnitOfRevision'](_0x23c50c,_0xe3e29b,_0x5c04e0){const _0x45c974=_0x2323f8;return this['_injector'][_0x45c974(0x1ed)](_0x2e361e['DataLoaderService'])[_0x45c974(0x220)](_0x23c50c,_0xe3e29b,_0x5c04e0);}};_0x280377[_0x2323f8(0x1f7)][_0x2323f8(0x22a)](_0x327b1c),Object[_0x2323f8(0x204)](_0x38c5b1,_0x2323f8(0x229),{'enumerable':!0x0,'get':function(){return _0x4a5feb;}});}));function _0x3e43(_0x5c931d,_0x261820){_0x5c931d=_0x5c931d-0x1ec;const _0x1b5492=_0x1b54();let _0x3e43e4=_0x1b5492[_0x5c931d];return _0x3e43e4;}function _0x1b54(){const _0xb42b99=['loadSlideAsync','UniverProCollaborationClient','CollaborationController','defineProperty','_handler','UniverCore','pipe','MemberService','length','4222225PSwJqe','getWorkbook','toStringTag','getBase','entityInit$','@univerjs/core/facade','getFocusedUnit','@univerjs/core','getDocument','CollaborationStatusChanged','function','2755200UYBVSA','_collaborationController','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','getCollabEntity','\x22\x20after\x20','reject','status$','readyForCollab','loadBoardAsync','SnapshotService','from','loadUnitOfRevision','loadSheet','CollaborationStatus','UniverCoreFacade','IUniverInstanceService','ms.','SYNCED','_snapshotService','exports','FCollaboration','extend','amd','status','toDisposable','4790922scXXAd','_injector','Module','getCollaborationStatus','loadDoc','733830McVuHq','@univerjs-pro/collaboration','@univerjs-pro/collaboration-client','FEventName','waitForRoom$','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','subscribe','registerEventHandler','_initialize','UniverProCollaborationClientFacade','members$','FBase','[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','Injector','unsubscribe','loadDocAsync','loadBase','FEnum','UniverProCollaboration','decorate','333930BwjNnO','6TzMHjS','15039126cAAdmM','add','_resolveUnitId','switchMap','\x22\x20while\x20collaboration\x20status\x20is\x20','get','_univerInstanceService','getOwnPropertyDescriptor','Inject','subscribeCollaborators','getUnitId','createInstance','values','getCollaboration','getPresentation','FUniver','DisposableCollection','NOT_COLLAB','state','611140XOlWpS','flush','rxjs','getBoard','loadBoard','8DcqpWn'];_0x1b54=function(){return _0xb42b99;};return _0x1b54();}