@univerjs-pro/collaboration-client 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (97) 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 +8 -2
  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/data-loader/data-loader.service.d.ts +1 -1
  75. package/lib/types/services/image-remote/image-io.service.d.ts +2 -4
  76. package/lib/umd/facade.js +1 -1
  77. package/lib/umd/index.js +1 -1
  78. package/lib/umd/locale/ar-SA.js +1 -1
  79. package/lib/umd/locale/ca-ES.js +1 -1
  80. package/lib/umd/locale/de-DE.js +1 -1
  81. package/lib/umd/locale/en-US.js +1 -1
  82. package/lib/umd/locale/es-ES.js +1 -1
  83. package/lib/umd/locale/fa-IR.js +1 -1
  84. package/lib/umd/locale/fr-FR.js +1 -1
  85. package/lib/umd/locale/id-ID.js +1 -1
  86. package/lib/umd/locale/it-IT.js +1 -1
  87. package/lib/umd/locale/ja-JP.js +1 -1
  88. package/lib/umd/locale/ko-KR.js +1 -1
  89. package/lib/umd/locale/pl-PL.js +1 -1
  90. package/lib/umd/locale/pt-BR.js +1 -1
  91. package/lib/umd/locale/ru-RU.js +1 -1
  92. package/lib/umd/locale/sk-SK.js +1 -1
  93. package/lib/umd/locale/vi-VN.js +1 -1
  94. package/lib/umd/locale/zh-CN.js +1 -1
  95. package/lib/umd/locale/zh-HK.js +1 -1
  96. package/lib/umd/locale/zh-TW.js +1 -1
  97. package/package.json +15 -16
@@ -1 +1 @@
1
- const _0x3d2533=_0x25c8;function _0x27b1(){const _0x37c3db=['216BuLsuT','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','編輯衝突','343532JhilrH','此文件協作人數已達上限,您的編輯將暫存於本機。','69915bbtlCz','伺服器未回應協作請求,您的編輯將儲存在本機。','492oBGPYn','連線失敗,請檢查您的網路。','加入協作失敗,您的編輯將暫存於本機。','已離線,編輯將儲存在本機','同步中...','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','正在擷取伺服器資料...','點擊重新連線','87965inQleH','連線失敗,將在稍後重試連線。','5612406FheadX','5444248OMNDEm','協作文件數量超過限制,您的編輯將暫存於本機。','協作衝突','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','61602NWGCcS','46049157sIYXFm'];_0x27b1=function(){return _0x37c3db;};return _0x27b1();}(function(_0x251d85,_0x3ea4d9){const _0x149bdd=_0x25c8,_0x1f1665=_0x251d85();while(!![]){try{const _0x2463e1=parseInt(_0x149bdd(0x8b))/0x1+parseInt(_0x149bdd(0x84))/0x2+parseInt(_0x149bdd(0x7f))/0x3+parseInt(_0x149bdd(0x80))/0x4+-parseInt(_0x149bdd(0x7d))/0x5*(-parseInt(_0x149bdd(0x8d))/0x6)+parseInt(_0x149bdd(0x89))/0x7*(parseInt(_0x149bdd(0x86))/0x8)+-parseInt(_0x149bdd(0x85))/0x9;if(_0x2463e1===_0x3ea4d9)break;else _0x1f1665['push'](_0x1f1665['shift']());}catch(_0x19ddbc){_0x1f1665['push'](_0x1f1665['shift']());}}}(_0x27b1,0xf0285));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':_0x3d2533(0x7c)}},'collabStatus':{'fetchMiss':_0x3d2533(0x7b),'conflict':_0x3d2533(0x88),'notCollab':'本機檔案','synced':'已同步','syncing':_0x3d2533(0x91),'offline':_0x3d2533(0x90)},'session':{'connection-failed':_0x3d2533(0x8e),'will-retry':_0x3d2533(0x7e),'room-full':_0x3d2533(0x8a),'join-failed':'加入協作失敗,請稍後重試,您的編輯將暫存於本機。','room-not-exists':_0x3d2533(0x8f),'room-permission-denied':'沒有協作權限,您的編輯將暫存於本機。','room-cnt-exceeds':_0x3d2533(0x81),'collaboration-timeout':_0x3d2533(0x8c)},'conflict':{'title':_0x3d2533(0x82),'content':_0x3d2533(0x92)},'permission':{'title':'認證錯誤','content':_0x3d2533(0x87)},'collaboration':{'single-unit':{'warning':'您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。'},'closeRoom':'由於協作房間已關閉,編輯權限已被收回。'},'auth':{'needGotoLoginAlert':_0x3d2533(0x83)}}};function _0x25c8(_0x1141fa,_0x282a30){_0x1141fa=_0x1141fa-0x7b;const _0x27b152=_0x27b1();let _0x25c80c=_0x27b152[_0x1141fa];return _0x25c80c;}export{e as default};
1
+ const _0xa4d642=_0x2c27;(function(_0x3376e7,_0x23df22){const _0x2a2695=_0x2c27,_0x3c1e01=_0x3376e7();while(!![]){try{const _0x305d14=parseInt(_0x2a2695(0x168))/0x1*(-parseInt(_0x2a2695(0x162))/0x2)+-parseInt(_0x2a2695(0x15d))/0x3+parseInt(_0x2a2695(0x14f))/0x4*(parseInt(_0x2a2695(0x15c))/0x5)+parseInt(_0x2a2695(0x151))/0x6+parseInt(_0x2a2695(0x163))/0x7*(parseInt(_0x2a2695(0x155))/0x8)+parseInt(_0x2a2695(0x14e))/0x9*(parseInt(_0x2a2695(0x15b))/0xa)+-parseInt(_0x2a2695(0x161))/0xb*(parseInt(_0x2a2695(0x159))/0xc);if(_0x305d14===_0x23df22)break;else _0x3c1e01['push'](_0x3c1e01['shift']());}catch(_0x1be8e6){_0x3c1e01['push'](_0x3c1e01['shift']());}}}(_0x1edd,0xca142));function _0x2c27(_0x326025,_0x9495ac){_0x326025=_0x326025-0x14e;const _0x1edd6e=_0x1edd();let _0x2c277c=_0x1edd6e[_0x326025];return _0x2c277c;}const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':_0xa4d642(0x167)}},'collabStatus':{'fetchMiss':'正在擷取伺服器資料...','conflict':_0xa4d642(0x156),'notCollab':_0xa4d642(0x166),'synced':_0xa4d642(0x15e),'syncing':_0xa4d642(0x154),'offline':_0xa4d642(0x16c)},'session':{'connection-failed':_0xa4d642(0x16a),'will-retry':_0xa4d642(0x16b),'room-full':_0xa4d642(0x152),'join-failed':_0xa4d642(0x153),'room-not-exists':_0xa4d642(0x158),'room-permission-denied':_0xa4d642(0x169),'room-cnt-exceeds':_0xa4d642(0x164),'collaboration-timeout':_0xa4d642(0x160)},'conflict':{'title':_0xa4d642(0x165),'content':_0xa4d642(0x15a)},'permission':{'title':_0xa4d642(0x150),'content':_0xa4d642(0x15f)},'collaboration':{'single-unit':{'warning':_0xa4d642(0x157)},'closeRoom':_0xa4d642(0x16d)},'auth':{'needGotoLoginAlert':'您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。'}}};export{e as default};function _0x1edd(){const _0x48f5a7=['3464400ISoOXW','此文件協作人數已達上限,您的編輯將暫存於本機。','加入協作失敗,請稍後重試,您的編輯將暫存於本機。','同步中...','16IIWsPG','編輯衝突','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','加入協作失敗,您的編輯將暫存於本機。','48DvvRmo','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','750JEBhYE','2495930DEVARE','83685hDTnvn','已同步','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','伺服器未回應協作請求,您的編輯將儲存在本機。','2429768lCXJwG','4qrHlZl','751583ZvgdVP','協作文件數量超過限制,您的編輯將暫存於本機。','協作衝突','本機檔案','點擊重新連線','659387HESHiY','沒有協作權限,您的編輯將暫存於本機。','連線失敗,請檢查您的網路。','連線失敗,將在稍後重試連線。','已離線,編輯將儲存在本機','由於協作房間已關閉,編輯權限已被收回。','152091ASVfTD','8nJOtmK','認證錯誤'];_0x1edd=function(){return _0x48f5a7;};return _0x1edd();}
@@ -80,9 +80,9 @@ export interface IDocCollaborationEntityCallback {
80
80
  export declare class DocCollaborationEntity extends CollaborationEntity {
81
81
  readonly unitID: string;
82
82
  readonly type: UniverInstanceType;
83
- private readonly _docStateChangeManagerService?;
83
+ private readonly _docStateChangeManagerService;
84
84
  private _handlerCallback;
85
- 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, _docStateChangeManagerService?: DocStateChangeManagerService | undefined, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
85
+ 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, _docStateChangeManagerService: DocStateChangeManagerService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
86
86
  addHandlerCallback(cb: IDocCollaborationEntityCallback): void;
87
87
  dispose(): void;
88
88
  protected _createHandler(): ICollaborationStateHandler;
@@ -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;
@@ -20,6 +20,6 @@ export declare class DataLoaderService extends RxDisposable {
20
20
  readonly unitLoaded$: import("rxjs").Observable<UnitModel<object, UniverInstanceType>>;
21
21
  constructor(_logService: ILogService, _snapshotService: SnapshotService, _localCacheService?: ILocalCacheService | undefined);
22
22
  dispose(): void;
23
- loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number): Promise<UnitModel | null>;
23
+ loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number, subUnitId?: string): Promise<UnitModel | null>;
24
24
  loadUnit(unitId: string, type: UniverInstanceType, subUnitId?: string): Promise<UnitModel | null>;
25
25
  }
@@ -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 _0x39a8(){const _0x52c00c=['pipe','Inject','unitID','1792710nVQWDS','loadSheet','FCollaboration','switchMap','_snapshotService','readyForCollab','getOwnPropertyDescriptor','loadServerUnitOfRevision','UniverProCollaborationClient','943236bcepRm','registerEventHandler','loadSlideAsync','DataLoaderService','length','UniverCoreFacade','loadDocAsync','loadServerUnit','add','1015689QzrrYU','702824dSlfXs','@univerjs/core','@univerjs/core/facade','status$','loadUnitOfRevision','extend','values','_initialize','state','getWorkbook','getCollabEntity','4xKmiNm','toDisposable','toStringTag','getFocusedUnit','1625294pFXSEb','MemberService','exports','from','UniverProCollaboration','_handler','18NNkVJV','Event','CollaborationStatus','FUniver','members$','18NQzqLg','Injector','subscribe','_injector','loadBaseAsync','getCollaborationStatus','createInstance','waitForRoom$','subscribeCollaborators','function','getDocument','get','NOT_COLLAB','decorate','object','514270jpHVuZ','loadSlide','1YKBHJp','495714mwxAkm','CollaborationController','fireEvent','getPresentation','loadBase','rxjs','loadSheetAsync','UniverProCollaborationClientFacade','loadUnit','FEventName','getBase','FEnum','UniverCore','Module','status','_collaborationController','SnapshotService','defineProperty','CollaborationStatusChanged'];_0x39a8=function(){return _0x52c00c;};return _0x39a8();}function _0x4427(_0x166e43,_0x32c7c5){_0x166e43=_0x166e43-0x171;const _0x39a819=_0x39a8();let _0x4427d8=_0x39a819[_0x166e43];return _0x4427d8;}(function(_0x16e95c,_0x6ad17e){const _0x6242e8=_0x4427,_0x4e1e6c=_0x16e95c();while(!![]){try{const _0x7a5d9d=-parseInt(_0x6242e8(0x185))/0x1*(-parseInt(_0x6242e8(0x186))/0x2)+-parseInt(_0x6242e8(0x1ae))/0x3*(parseInt(_0x6242e8(0x1ba))/0x4)+parseInt(_0x6242e8(0x183))/0x5*(parseInt(_0x6242e8(0x174))/0x6)+parseInt(_0x6242e8(0x1a5))/0x7+-parseInt(_0x6242e8(0x1af))/0x8*(-parseInt(_0x6242e8(0x1c4))/0x9)+-parseInt(_0x6242e8(0x19c))/0xa+-parseInt(_0x6242e8(0x1be))/0xb;if(_0x7a5d9d===_0x6ad17e)break;else _0x4e1e6c['push'](_0x4e1e6c['shift']());}catch(_0x5719e6){_0x4e1e6c['push'](_0x4e1e6c['shift']());}}}(_0x39a8,0x31245),function(_0x4e2c60,_0x7df73d){const _0xb78b3e=_0x4427;typeof exports==_0xb78b3e(0x182)&&typeof module<'u'?_0x7df73d(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define=='function'&&define['amd']?define([_0xb78b3e(0x1c0),'@univerjs-pro/collaboration-client',_0xb78b3e(0x1b1),_0xb78b3e(0x1b0),'@univerjs-pro/collaboration',_0xb78b3e(0x18b)],_0x7df73d):(_0x4e2c60=typeof globalThis<'u'?globalThis:_0x4e2c60||self,_0x7df73d(_0x4e2c60[_0xb78b3e(0x18d)]={},_0x4e2c60[_0xb78b3e(0x1a4)],_0x4e2c60[_0xb78b3e(0x1aa)],_0x4e2c60[_0xb78b3e(0x192)],_0x4e2c60[_0xb78b3e(0x1c2)],_0x4e2c60[_0xb78b3e(0x18b)]));}(this,function(_0x1a6e23,_0xb89e0b,_0x2d30eb,_0x51cdf5,_0xd5626b,_0x20fd6a){const _0x3a0109=_0x4427;Object[_0x3a0109(0x197)](_0x1a6e23,Symbol[_0x3a0109(0x1bc)],{'value':_0x3a0109(0x193)});var _0x40fcf4=class extends _0x2d30eb[_0x3a0109(0x191)]{get[_0x3a0109(0x171)](){const _0x4e3e89=_0x3a0109;return _0xb89e0b[_0x4e3e89(0x171)];}};_0x2d30eb[_0x3a0109(0x191)][_0x3a0109(0x1b4)](_0x40fcf4);var _0x1cfdff=class extends _0x2d30eb[_0x3a0109(0x18f)]{get[_0x3a0109(0x198)](){const _0x14fef9=_0x3a0109;return _0x14fef9(0x198);}};_0x2d30eb[_0x3a0109(0x18f)][_0x3a0109(0x1b4)](_0x1cfdff);function _0x59df80(_0x45ef82,_0x2a9b63){return function(_0x572f9d,_0x3bb5ca){_0x2a9b63(_0x572f9d,_0x3bb5ca,_0x45ef82);};}function _0x4534ac(_0x1f6df0,_0xaa2071,_0x35ce14,_0x171ac5){const _0xe3b83a=_0x3a0109;var _0x51ed83=arguments[_0xe3b83a(0x1a9)],_0x20cc5a=_0x51ed83<0x3?_0xaa2071:_0x171ac5===null?_0x171ac5=Object[_0xe3b83a(0x1a2)](_0xaa2071,_0x35ce14):_0x171ac5,_0x4524d1;if(typeof Reflect==_0xe3b83a(0x182)&&typeof Reflect[_0xe3b83a(0x181)]==_0xe3b83a(0x17d))_0x20cc5a=Reflect[_0xe3b83a(0x181)](_0x1f6df0,_0xaa2071,_0x35ce14,_0x171ac5);else{for(var _0x249fb9=_0x1f6df0['length']-0x1;_0x249fb9>=0x0;_0x249fb9--)(_0x4524d1=_0x1f6df0[_0x249fb9])&&(_0x20cc5a=(_0x51ed83<0x3?_0x4524d1(_0x20cc5a):_0x51ed83>0x3?_0x4524d1(_0xaa2071,_0x35ce14,_0x20cc5a):_0x4524d1(_0xaa2071,_0x35ce14))||_0x20cc5a);}return _0x51ed83>0x3&&_0x20cc5a&&Object[_0xe3b83a(0x197)](_0xaa2071,_0x35ce14,_0x20cc5a),_0x20cc5a;}let _0x2f85da=class extends _0x2d30eb['FBase']{constructor(_0x534f93,_0x35c81c,_0x328b98,_0x73bea5,_0x258601){const _0x521483=_0x3a0109;super(),this[_0x521483(0x1c3)]=_0x534f93,this[_0x521483(0x177)]=_0x35c81c,this['_univerInstanceService']=_0x328b98,this[_0x521483(0x1a0)]=_0x73bea5,this[_0x521483(0x195)]=_0x258601;}async[_0x3a0109(0x18c)](_0x4c4c78,_0x45d671){const _0x4355b2=_0x3a0109;return await this[_0x4355b2(0x1a0)][_0x4355b2(0x19d)](_0x4c4c78,0x0,_0x45d671)?(await this['_collaborationController'][_0x4355b2(0x1a1)](_0x4c4c78),this['_handler'][_0x4355b2(0x1b8)](_0x4c4c78)):null;}async[_0x3a0109(0x1ab)](_0x399053,_0x2fc7a7){const _0x5ae2b5=_0x3a0109;return await this[_0x5ae2b5(0x1a0)]['loadDoc'](_0x399053,0x0,_0x2fc7a7)?(await this[_0x5ae2b5(0x195)][_0x5ae2b5(0x1a1)](_0x399053),this[_0x5ae2b5(0x1c3)][_0x5ae2b5(0x17e)](_0x399053)):null;}async[_0x3a0109(0x178)](_0x549daf,_0x362340){const _0x852f9e=_0x3a0109;return await this[_0x852f9e(0x1a0)][_0x852f9e(0x18a)](_0x549daf,0x0,_0x362340)?(await this['_collaborationController'][_0x852f9e(0x1a1)](_0x549daf),this[_0x852f9e(0x1c3)][_0x852f9e(0x190)](_0x549daf)):null;}async[_0x3a0109(0x1a7)](_0x3b081e,_0x5d2b6a){const _0x55292b=_0x3a0109;return await this[_0x55292b(0x1a0)][_0x55292b(0x184)](_0x3b081e,0x0,_0x5d2b6a)?(await this[_0x55292b(0x195)]['readyForCollab'](_0x3b081e),this[_0x55292b(0x1c3)]['getPresentation'](_0x3b081e)):null;}[_0x3a0109(0x17c)](_0x4e3104,_0x26820f){const _0x253cb5=_0x3a0109;return(0x0,_0x51cdf5[_0x253cb5(0x1bb)])(this[_0x253cb5(0x177)][_0x253cb5(0x17f)](_0xb89e0b[_0x253cb5(0x1bf)])[_0x253cb5(0x17b)](_0x4e3104)[_0x253cb5(0x199)]((0x0,_0x20fd6a[_0x253cb5(0x19f)])(_0x5cfff2=>_0x5cfff2[_0x253cb5(0x173)]))[_0x253cb5(0x176)](_0x103180=>_0x26820f(Array[_0x253cb5(0x1c1)](_0x103180[_0x253cb5(0x1b5)]()))));}[_0x3a0109(0x179)](_0x3ed15f){const _0x1dc348=_0x3a0109;var _0x2bbc89;let _0x746c8;if(_0x3ed15f)_0x746c8=_0x3ed15f;else{let _0x43ad3c=this['_univerInstanceService'][_0x1dc348(0x1bd)]();_0x746c8=_0x43ad3c==null?void 0x0:_0x43ad3c['getUnitId']();}if(!_0x746c8)return _0xb89e0b[_0x1dc348(0x171)][_0x1dc348(0x180)];let _0x40fb8c=this[_0x1dc348(0x195)][_0x1dc348(0x1b9)](_0x746c8);return(_0x2bbc89=_0x40fb8c==null?void 0x0:_0x40fb8c[_0x1dc348(0x1b7)][_0x1dc348(0x194)])==null?_0xb89e0b['CollaborationStatus'][_0x1dc348(0x180)]:_0x2bbc89;}};_0x2f85da=_0x4534ac([_0x59df80(0x1,(0x0,_0x51cdf5[_0x3a0109(0x19a)])(_0x51cdf5[_0x3a0109(0x175)])),_0x59df80(0x2,_0x51cdf5['IUniverInstanceService']),_0x59df80(0x3,(0x0,_0x51cdf5[_0x3a0109(0x19a)])(_0xd5626b[_0x3a0109(0x196)])),_0x59df80(0x4,(0x0,_0x51cdf5[_0x3a0109(0x19a)])(_0xb89e0b['CollaborationController']))],_0x2f85da);var _0x53ece8=class extends _0x2d30eb[_0x3a0109(0x172)]{[_0x3a0109(0x1b6)](_0x368de0){const _0x758abf=_0x3a0109;let _0x296fa9=_0x368de0['get'](_0xb89e0b[_0x758abf(0x187)]);this['disposeWithMe'](this[_0x758abf(0x1a6)](this['Event'][_0x758abf(0x198)],()=>{const _0xce78d2=_0x758abf;let _0x343165=new _0x51cdf5['DisposableCollection'](),_0x10750d=_0x296fa9['entityInit$'][_0xce78d2(0x176)](_0x2bc429=>{const _0x173f78=_0xce78d2;let _0x58a833=_0x2bc429[_0x173f78(0x1b2)]['subscribe'](_0x13067b=>{const _0x7769c7=_0x173f78;let _0x2b7125={'unitId':_0x2bc429[_0x7769c7(0x19b)],'status':_0x13067b};this[_0x7769c7(0x188)](this[_0x7769c7(0x1c5)][_0x7769c7(0x198)],_0x2b7125);});_0x343165[_0x173f78(0x1ad)]((0x0,_0x51cdf5[_0x173f78(0x1bb)])(_0x58a833));});return _0x343165[_0xce78d2(0x1ad)]((0x0,_0x51cdf5[_0xce78d2(0x1bb)])(_0x10750d)),_0x343165;}));}['getCollaboration'](){const _0x8df78c=_0x3a0109;return this['_injector'][_0x8df78c(0x17a)](_0x2f85da,{'getWorkbook':_0x37af1c=>this[_0x8df78c(0x1b8)](_0x37af1c),'getDocument':_0x3c850b=>this[_0x8df78c(0x17e)](_0x3c850b),'getPresentation':_0x269830=>this[_0x8df78c(0x189)](_0x269830),'getBase':_0x17b8f4=>this[_0x8df78c(0x190)](_0x17b8f4)});}[_0x3a0109(0x1ac)](_0x2a666e,_0x569cf6,_0x28f7d5){const _0x5859d2=_0x3a0109;return this[_0x5859d2(0x177)][_0x5859d2(0x17f)](_0xb89e0b[_0x5859d2(0x1a8)])[_0x5859d2(0x18e)](_0x2a666e,_0x569cf6,_0x28f7d5);}[_0x3a0109(0x1a3)](_0x49f8f2,_0x1f578b,_0x5c16a3){const _0x540acb=_0x3a0109;return this[_0x540acb(0x177)][_0x540acb(0x17f)](_0xb89e0b[_0x540acb(0x1a8)])[_0x540acb(0x1b3)](_0x49f8f2,_0x1f578b,_0x5c16a3);}};_0x2d30eb[_0x3a0109(0x172)][_0x3a0109(0x1b4)](_0x53ece8),Object[_0x3a0109(0x197)](_0x1a6e23,_0x3a0109(0x19e),{'enumerable':!0x0,'get':function(){return _0x2f85da;}});}));
1
+ function _0x4eff(){const _0xebc6ef=['loadSheetAsync','_collaborationController','FBase','status$','ms.','_initialize','getPresentation','rxjs','1079299iGGoRT','_resolveUnitId','loadBase','state','extend','SYNCED','FCollaboration','FEnum','[FCollaboration]:\x20Unit\x20\x22','toStringTag','NOT_COLLAB','CollaborationController','Module','loadUnit','values','43945ASdzbh','object','registerEventHandler','loadDoc','@univerjs-pro/collaboration-client','loadBoard','unitID','length','defineProperty','exports','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','toDisposable','15mfSXen','unsubscribe','function','resolve','_injector','loadSheet','getCollabEntity','loadDocAsync','loadServerUnit','_handler','582gRdBoo','191943faFbow','@univerjs/core','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','getDocument','getOwnPropertyDescriptor','SnapshotService','amd','status','get','add','[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.','\x22\x20after\x20','719512gGESDx','loadBoardAsync','readyForCollab','getFocusedUnit','from','getBoard','subscribe','Event','entityInit$','createInstance','IUniverInstanceService','CollaborationStatusChanged','@univerjs/core/facade','getWorkbook','DisposableCollection','_snapshotService','12538830myrTXf','DataLoaderService','loadUnitOfRevision','_univerInstanceService','reject','UniverProCollaborationClientFacade','CollaborationStatus','MemberService','CONFLICT','@univerjs-pro/collaboration','FEventName','fireEvent','UniverCore','decorate','flush','loadBaseAsync','2410289wDTmeD','getCollaboration','8FdeXVk','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','getBase','FUniver','Inject','loadServerUnitOfRevision','2398804YjGFeO','UniverProCollaborationClient'];_0x4eff=function(){return _0xebc6ef;};return _0x4eff();}function _0x299f(_0x19dac4,_0x41173c){_0x19dac4=_0x19dac4-0x75;const _0x4effc9=_0x4eff();let _0x299f49=_0x4effc9[_0x19dac4];return _0x299f49;}(function(_0x4ce818,_0x4b9724){const _0x270c0f=_0x299f,_0xab29d7=_0x4ce818();while(!![]){try{const _0xaed5b1=parseInt(_0x270c0f(0x9a))/0x1+parseInt(_0x270c0f(0x90))/0x2+parseInt(_0x270c0f(0xb5))/0x3*(-parseInt(_0x270c0f(0xcc))/0x4)+-parseInt(_0x270c0f(0xa9))/0x5*(-parseInt(_0x270c0f(0xbf))/0x6)+-parseInt(_0x270c0f(0x88))/0x7*(parseInt(_0x270c0f(0x8a))/0x8)+parseInt(_0x270c0f(0xc0))/0x9+-parseInt(_0x270c0f(0x78))/0xa;if(_0xaed5b1===_0x4b9724)break;else _0xab29d7['push'](_0xab29d7['shift']());}catch(_0x1cc992){_0xab29d7['push'](_0xab29d7['shift']());}}}(_0x4eff,0x9fe71),function(_0x1e08f6,_0x3548bc){const _0x4e24c0=_0x299f;typeof exports==_0x4e24c0(0xaa)&&typeof module<'u'?_0x3548bc(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define==_0x4e24c0(0xb7)&&define[_0x4e24c0(0xc6)]?define([_0x4e24c0(0xb2),_0x4e24c0(0xad),_0x4e24c0(0xd8),_0x4e24c0(0xc1),_0x4e24c0(0x81),_0x4e24c0(0x99)],_0x3548bc):(_0x1e08f6=typeof globalThis<'u'?globalThis:_0x1e08f6||self,_0x3548bc(_0x1e08f6[_0x4e24c0(0x7d)]={},_0x1e08f6[_0x4e24c0(0x91)],_0x1e08f6['UniverCoreFacade'],_0x1e08f6[_0x4e24c0(0x84)],_0x1e08f6['UniverProCollaboration'],_0x1e08f6['rxjs']));}(this,function(_0x4ca478,_0x15892a,_0x26c841,_0x16f7fc,_0x4bf555,_0x3a4b4f){const _0xb49d29=_0x299f;Object[_0xb49d29(0xb1)](_0x4ca478,Symbol[_0xb49d29(0xa3)],{'value':_0xb49d29(0xa6)});var _0x2e42bf=class extends _0x26c841['FEnum']{get[_0xb49d29(0x7e)](){const _0x4040f4=_0xb49d29;return _0x15892a[_0x4040f4(0x7e)];}};_0x26c841[_0xb49d29(0xa1)]['extend'](_0x2e42bf);var _0x9bc4cd=class extends _0x26c841[_0xb49d29(0x82)]{get[_0xb49d29(0xd7)](){const _0x5ac31f=_0xb49d29;return _0x5ac31f(0xd7);}};_0x26c841[_0xb49d29(0x82)][_0xb49d29(0x9e)](_0x9bc4cd);function _0x50d807(_0x2cf027,_0x303320){return function(_0x44768f,_0x41b71f){_0x303320(_0x44768f,_0x41b71f,_0x2cf027);};}function _0x431474(_0x2d8b95,_0x298c87,_0x3491da,_0x5afd55){const _0xb968ea=_0xb49d29;var _0x3fd37c=arguments[_0xb968ea(0xb0)],_0x563069=_0x3fd37c<0x3?_0x298c87:_0x5afd55===null?_0x5afd55=Object[_0xb968ea(0xc4)](_0x298c87,_0x3491da):_0x5afd55,_0x5dfa78;if(typeof Reflect=='object'&&typeof Reflect[_0xb968ea(0x85)]==_0xb968ea(0xb7))_0x563069=Reflect['decorate'](_0x2d8b95,_0x298c87,_0x3491da,_0x5afd55);else{for(var _0x26045d=_0x2d8b95[_0xb968ea(0xb0)]-0x1;_0x26045d>=0x0;_0x26045d--)(_0x5dfa78=_0x2d8b95[_0x26045d])&&(_0x563069=(_0x3fd37c<0x3?_0x5dfa78(_0x563069):_0x3fd37c>0x3?_0x5dfa78(_0x298c87,_0x3491da,_0x563069):_0x5dfa78(_0x298c87,_0x3491da))||_0x563069);}return _0x3fd37c>0x3&&_0x563069&&Object[_0xb968ea(0xb1)](_0x298c87,_0x3491da,_0x563069),_0x563069;}let _0x15f830=class extends _0x26c841[_0xb49d29(0x94)]{constructor(_0x2e6823,_0x1033d4,_0x261f06,_0x5bfe3c,_0x4c3393){const _0x41f6b9=_0xb49d29;super(),this['_handler']=_0x2e6823,this[_0x41f6b9(0xb9)]=_0x1033d4,this[_0x41f6b9(0x7b)]=_0x261f06,this[_0x41f6b9(0x77)]=_0x5bfe3c,this[_0x41f6b9(0x93)]=_0x4c3393;}async[_0xb49d29(0x92)](_0x5c5c70,_0x25dae7){const _0x486e63=_0xb49d29;return await this['_snapshotService'][_0x486e63(0xba)](_0x5c5c70,0x0,_0x25dae7)?(await this[_0x486e63(0x93)][_0x486e63(0xce)](_0x5c5c70),this[_0x486e63(0xbe)]['getWorkbook'](_0x5c5c70)):null;}async[_0xb49d29(0xbc)](_0x3bf73e,_0x21946d){const _0x118bf3=_0xb49d29;return await this[_0x118bf3(0x77)][_0x118bf3(0xac)](_0x3bf73e,0x0,_0x21946d)?(await this[_0x118bf3(0x93)][_0x118bf3(0xce)](_0x3bf73e),this[_0x118bf3(0xbe)][_0x118bf3(0xc3)](_0x3bf73e)):null;}async[_0xb49d29(0x87)](_0x5331f8,_0x40242a){const _0xdfc7b3=_0xb49d29;return await this[_0xdfc7b3(0x77)][_0xdfc7b3(0x9c)](_0x5331f8,0x0,_0x40242a)?(await this[_0xdfc7b3(0x93)][_0xdfc7b3(0xce)](_0x5331f8),this[_0xdfc7b3(0xbe)][_0xdfc7b3(0x8c)](_0x5331f8)):null;}async['loadSlideAsync'](_0x11644d,_0x46bdf4){const _0xe374a2=_0xb49d29;return await this[_0xe374a2(0x77)]['loadSlide'](_0x11644d,0x0,_0x46bdf4)?(await this[_0xe374a2(0x93)][_0xe374a2(0xce)](_0x11644d),this['_handler'][_0xe374a2(0x98)](_0x11644d)):null;}async[_0xb49d29(0xcd)](_0x33d66b,_0x2f1834){const _0x1d6ad2=_0xb49d29;return await this[_0x1d6ad2(0x77)][_0x1d6ad2(0xae)](_0x33d66b,0x0,_0x2f1834)?(await this[_0x1d6ad2(0x93)][_0x1d6ad2(0xce)](_0x33d66b),this[_0x1d6ad2(0xbe)][_0x1d6ad2(0xd1)](_0x33d66b)):null;}['subscribeCollaborators'](_0x3eadd4,_0x4783d9){const _0x3485e9=_0xb49d29;return(0x0,_0x16f7fc['toDisposable'])(this[_0x3485e9(0xb9)][_0x3485e9(0xc8)](_0x15892a[_0x3485e9(0x7f)])['waitForRoom$'](_0x3eadd4)['pipe']((0x0,_0x3a4b4f['switchMap'])(_0xc9fa6=>_0xc9fa6['members$']))['subscribe'](_0x5d76f1=>_0x4783d9(Array[_0x3485e9(0xd0)](_0x5d76f1[_0x3485e9(0xa8)]()))));}['getCollaborationStatus'](_0x1014a0){const _0x2c059f=_0xb49d29;var _0x1c1e18;let _0x1ae4aa=this['_resolveUnitId'](_0x1014a0);if(!_0x1ae4aa)return _0x15892a['CollaborationStatus']['NOT_COLLAB'];let _0x476e5c=this['_collaborationController'][_0x2c059f(0xbb)](_0x1ae4aa);return(_0x1c1e18=_0x476e5c==null?void 0x0:_0x476e5c['state'][_0x2c059f(0xc7)])==null?_0x15892a[_0x2c059f(0x7e)]['NOT_COLLAB']:_0x1c1e18;}[_0xb49d29(0x86)](_0x33506b,_0x51259a={}){const _0x1e6668=_0xb49d29;var _0x503ec2;let _0x3c3acf=this[_0x1e6668(0x9b)](_0x33506b);if(!_0x3c3acf)return Promise[_0x1e6668(0x7c)](Error(_0x1e6668(0xca)));let _0x13e7a7=this[_0x1e6668(0x93)]['getCollabEntity'](_0x3c3acf);if(!_0x13e7a7)return Promise[_0x1e6668(0x7c)](Error(_0x1e6668(0xa2)+_0x3c3acf+_0x1e6668(0xb3)));let _0x38c5d9=_0x13e7a7[_0x1e6668(0x9d)]['status'];if(_0x38c5d9===_0x15892a[_0x1e6668(0x7e)][_0x1e6668(0x9f)])return Promise[_0x1e6668(0xb8)]();let _0x182800=_0x5e889e(_0x3c3acf,_0x38c5d9);if(_0x182800)return Promise[_0x1e6668(0x7c)](_0x182800);let _0xc1d9d4=(_0x503ec2=_0x51259a['timeout'])==null?0x7530:_0x503ec2;return new Promise((_0x15866b,_0x2ed0e0)=>{const _0x1e4a20=_0x1e6668;let _0x83b2af=!0x1,_0xb91cb9=null,_0x578267=setTimeout(()=>{const _0x4a47bb=_0x299f;_0x83b2af=!0x0,_0xb91cb9==null||_0xb91cb9[_0x4a47bb(0xb6)](),_0x2ed0e0(Error(_0x4a47bb(0x8b)+_0x3c3acf+_0x4a47bb(0xcb)+_0xc1d9d4+_0x4a47bb(0x96)));},_0xc1d9d4),_0x7653ff=()=>{const _0x115e45=_0x299f;_0x83b2af=!0x0,clearTimeout(_0x578267),_0xb91cb9==null||_0xb91cb9[_0x115e45(0xb6)]();};_0xb91cb9=_0x13e7a7['status$'][_0x1e4a20(0xd2)](_0x1a9ce7=>{const _0x35363b=_0x1e4a20;if(_0x83b2af)return;if(_0x1a9ce7===_0x15892a[_0x35363b(0x7e)][_0x35363b(0x9f)]){_0x7653ff(),_0x15866b();return;}let _0x5bf0e3=_0x5e889e(_0x3c3acf,_0x1a9ce7);_0x5bf0e3&&(_0x7653ff(),_0x2ed0e0(_0x5bf0e3));});});}[_0xb49d29(0x9b)](_0x364d63){const _0xaf0fb6=_0xb49d29;var _0x44a688;return _0x364d63||((_0x44a688=this[_0xaf0fb6(0x7b)][_0xaf0fb6(0xcf)]())==null?void 0x0:_0x44a688['getUnitId']());}};_0x15f830=_0x431474([_0x50d807(0x1,(0x0,_0x16f7fc[_0xb49d29(0x8e)])(_0x16f7fc['Injector'])),_0x50d807(0x2,_0x16f7fc[_0xb49d29(0xd6)]),_0x50d807(0x3,(0x0,_0x16f7fc[_0xb49d29(0x8e)])(_0x4bf555[_0xb49d29(0xc5)])),_0x50d807(0x4,(0x0,_0x16f7fc[_0xb49d29(0x8e)])(_0x15892a[_0xb49d29(0xa5)]))],_0x15f830);function _0x5e889e(_0x274e69,_0xaed991){const _0x262823=_0xb49d29;return _0xaed991===_0x15892a['CollaborationStatus'][_0x262823(0x80)]||_0xaed991===_0x15892a[_0x262823(0x7e)][_0x262823(0xa4)]?Error(_0x262823(0xc2)+_0x274e69+'\x22\x20while\x20collaboration\x20status\x20is\x20'+_0xaed991+'.'):null;}var _0x514769=class extends _0x26c841[_0xb49d29(0x8d)]{[_0xb49d29(0x97)](_0x53adda){const _0x12ed27=_0xb49d29;let _0x1d512a=_0x53adda['get'](_0x15892a[_0x12ed27(0xa5)]);this['disposeWithMe'](this[_0x12ed27(0xab)](this['Event']['CollaborationStatusChanged'],()=>{const _0x445de5=_0x12ed27;let _0x92e2ce=new _0x16f7fc[(_0x445de5(0x76))](),_0x37da96=_0x1d512a[_0x445de5(0xd4)]['subscribe'](_0x3a935a=>{const _0x4bb353=_0x445de5;let _0x5a1456=_0x3a935a[_0x4bb353(0x95)][_0x4bb353(0xd2)](_0xa89233=>{const _0x1c8ea8=_0x4bb353;let _0x5d80ac={'unitId':_0x3a935a[_0x1c8ea8(0xaf)],'status':_0xa89233};this[_0x1c8ea8(0x83)](this[_0x1c8ea8(0xd3)]['CollaborationStatusChanged'],_0x5d80ac);});_0x92e2ce[_0x4bb353(0xc9)]((0x0,_0x16f7fc[_0x4bb353(0xb4)])(_0x5a1456));});return _0x92e2ce['add']((0x0,_0x16f7fc[_0x445de5(0xb4)])(_0x37da96)),_0x92e2ce;}));}[_0xb49d29(0x89)](){const _0x1027a5=_0xb49d29;return this['_injector'][_0x1027a5(0xd5)](_0x15f830,{'getWorkbook':_0x4cd6ab=>this[_0x1027a5(0x75)](_0x4cd6ab),'getDocument':_0x5ddeb8=>this[_0x1027a5(0xc3)](_0x5ddeb8),'getPresentation':_0xe47905=>this[_0x1027a5(0x98)](_0xe47905),'getBase':_0x5e1b04=>this[_0x1027a5(0x8c)](_0x5e1b04),'getBoard':_0x497cd5=>this[_0x1027a5(0xd1)](_0x497cd5)});}[_0xb49d29(0xbd)](_0x4ac871,_0x477dc0,_0x4b329f){const _0x577ed6=_0xb49d29;return this[_0x577ed6(0xb9)]['get'](_0x15892a['DataLoaderService'])[_0x577ed6(0xa7)](_0x4ac871,_0x477dc0,_0x4b329f);}[_0xb49d29(0x8f)](_0x18e378,_0xe0178c,_0x2bff0e){const _0x28c641=_0xb49d29;return this['_injector'][_0x28c641(0xc8)](_0x15892a[_0x28c641(0x79)])[_0x28c641(0x7a)](_0x18e378,_0xe0178c,_0x2bff0e);}};_0x26c841[_0xb49d29(0x8d)]['extend'](_0x514769),Object[_0xb49d29(0xb1)](_0x4ca478,_0xb49d29(0xa0),{'enumerable':!0x0,'get':function(){return _0x15f830;}});}));