@univer-cli/univer-collaboration-runtime 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # @univer-cli/univer-collaboration-runtime
2
+
3
+ English | [简体中文](./README.zh-CN.md)
4
+
5
+ Create a headless collaboration runtime that binds one Univer Unit in a Node.js process and explicitly controls reading, editing, pulling, and committing.
6
+
7
+ The runtime handles UnitData/Snapshot loading, mutation capture, OT, revisions, pending/awaiting state, and changeset identity. Through the backend port, the application determines whether content comes from local files, databases, or Collaboration Server.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pnpm add @univer-cli/univer-collaboration-runtime
13
+ ```
14
+
15
+ Requires Node.js 22.12 or higher and meets the Univer and Collaboration SDK version requirements in the package manifest.
16
+
17
+ ## Quick Start
18
+
19
+ Create a backend, then inject it and a Univer factory into the runtime factory:
20
+
21
+ ```ts
22
+ import { createStandardHeadlessUniverFactory } from "@univer-cli/headless-univer";
23
+ import {
24
+ createUniverCollaborationRuntimeFactory,
25
+ type CollaborationRuntimeBackend,
26
+ } from "@univer-cli/univer-collaboration-runtime";
27
+
28
+ const backend: CollaborationRuntimeBackend = {
29
+ async open({ unitId, unitType }) {
30
+ return {
31
+ format: "unit-data",
32
+ getConnectionState: () => "online",
33
+ getUnitData: async () => loadCheckpoint(unitId, unitType),
34
+ fetchChangesets: (from, to) => loadChangesets(unitId, from, to),
35
+ submitChangeset: (draft) => storeChangeset(unitId, unitType, draft),
36
+ close: async () => undefined,
37
+ };
38
+ },
39
+ };
40
+
41
+ const factory = createUniverCollaborationRuntimeFactory({
42
+ backend,
43
+ createUniver: createStandardHeadlessUniverFactory({ license: "" }),
44
+ });
45
+ ```
46
+
47
+ The factory creates a runtime for a target. A runtime remains bound to that one Unit throughout its lifecycle.
48
+
49
+ ## Recommended single-round workflow
50
+
51
+ ```ts
52
+ const runtime = await factory.load(unitId, unitType);
53
+
54
+ try {
55
+ const initialPull = await runtime.pull();
56
+ if (initialPull.status === "conflict") throw new Error(initialPull.conflict.message);
57
+
58
+ const result = await runtime.execute({
59
+ mode: "write",
60
+ code: 'workbook.getActiveSheet().getRange("A1").setValue("ready");',
61
+ });
62
+
63
+ let commit = await runtime.commit();
64
+ if (commit.status === "pull-required") {
65
+ const pulled = await runtime.pull();
66
+ if (pulled.status === "conflict") throw new Error(pulled.conflict.message);
67
+ commit = await runtime.commit();
68
+ }
69
+ console.log(result.value, commit);
70
+ } finally {
71
+ await runtime.close();
72
+ }
73
+ ```
74
+
75
+ - `execute({ mode: "read" })` does not allow mutations.
76
+ - `execute({ mode: "write" })` captures mutations and adds them to the local pending state.
77
+ - `fetch()` only retrieves and validates remote changesets; it does not modify Unit content. Most workflows do not need to call it separately.
78
+ - `pull()` fetches first, then reconciles local state through OT and applies remote changesets.
79
+ - `commit()` commits local changeset and handles awaiting/pending identity.
80
+ - `close()` releases the backend handle and Univer instance.
81
+
82
+ The caller must inspect the final commit status. `confirmed` and `nothing-to-commit` are complete. `retry` and `unknown` can be retried on the same runtime. `pull-required` requires another pull/commit cycle. `conflict` requires writes to stop while the application chooses a recovery strategy.
83
+
84
+ ## Backend port
85
+
86
+ `CollaborationRuntimeBackend.open()` returns a handle bound to the target. The handle can use a `unit-data` checkpoint or Snapshot and is responsible for continuous changeset reads, idempotent commits, connection state, and closing. The runtime does not interpret Workspace, Worktree, ResourceRef, credentials, or URLs; those belong to the application adapter.
87
+
88
+ When connecting to the official Collaboration Server, build the backend with the services, endpoints, and transports provided by the Collaboration SDK. Snapshots and changesets should not pass through the daemon.
89
+
90
+ ## Status and errors
91
+
92
+ The runtime exposes the current revision, connection state, local dirty state, and conflict results. Backend interruptions are not disguised as success; fetch/pull/commit results let adapters distinguish no changes, successful pushes, conflicts, and failures. If a runtime can no longer be reused safely, its owner should destroy it instead of continuing execution.
93
+
94
+ ## Relationship with other packages
95
+
96
+ The standard Univer composition comes from `@univer-cli/headless-univer`. To reuse runtimes by key in worker processes, use
97
+ [`@univer-cli/univer-collaboration-runtime-pool`](../univer-collaboration-runtime-pool/README.md).
98
+ This package does not provide Commander commands, a pool, workers, a daemon, a target-to-key algorithm, or an authentication strategy.
@@ -0,0 +1,106 @@
1
+ # @univer-cli/univer-collaboration-runtime
2
+
3
+ [English](./README.md) | 简体中文
4
+
5
+ 在一个 Node.js 进程中创建绑定单个 Univer Unit 的 headless collaboration runtime,并显式控制读取、编辑、
6
+ 拉取和提交。
7
+
8
+ Runtime 负责 UnitData/Snapshot 加载、mutation capture、OT、revision、pending/awaiting 状态与 changeset
9
+ identity。Application 通过 backend port 决定内容来自本地文件、数据库还是 Collaboration Server。
10
+
11
+ ## 安装
12
+
13
+ ```bash
14
+ pnpm add @univer-cli/univer-collaboration-runtime
15
+ ```
16
+
17
+ 要求 Node.js 22.12 或更高版本,并满足 package manifest 中 Univer 与 Collaboration SDK 的版本要求。
18
+
19
+ ## 快速开始
20
+
21
+ 先创建 backend,再把 Univer factory 注入 runtime factory:
22
+
23
+ ```ts
24
+ import { createStandardHeadlessUniverFactory } from "@univer-cli/headless-univer";
25
+ import {
26
+ createUniverCollaborationRuntimeFactory,
27
+ type CollaborationRuntimeBackend,
28
+ } from "@univer-cli/univer-collaboration-runtime";
29
+
30
+ const backend: CollaborationRuntimeBackend = {
31
+ async open({ unitId, unitType }) {
32
+ return {
33
+ format: "unit-data",
34
+ getConnectionState: () => "online",
35
+ getUnitData: async () => loadCheckpoint(unitId, unitType),
36
+ fetchChangesets: (from, to) => loadChangesets(unitId, from, to),
37
+ submitChangeset: (draft) => storeChangeset(unitId, unitType, draft),
38
+ close: async () => undefined,
39
+ };
40
+ },
41
+ };
42
+
43
+ const factory = createUniverCollaborationRuntimeFactory({
44
+ backend,
45
+ createUniver: createStandardHeadlessUniverFactory({ license: "" }),
46
+ });
47
+ ```
48
+
49
+ Factory 按 target 创建 runtime;一个 runtime 的整个生命周期只绑定一个 Unit。
50
+
51
+ ## 推荐的单回合流程
52
+
53
+ ```ts
54
+ const runtime = await factory.load(unitId, unitType);
55
+
56
+ try {
57
+ const initialPull = await runtime.pull();
58
+ if (initialPull.status === "conflict") throw new Error(initialPull.conflict.message);
59
+
60
+ const result = await runtime.execute({
61
+ mode: "write",
62
+ code: 'workbook.getActiveSheet().getRange("A1").setValue("ready");',
63
+ });
64
+
65
+ let commit = await runtime.commit();
66
+ if (commit.status === "pull-required") {
67
+ const pulled = await runtime.pull();
68
+ if (pulled.status === "conflict") throw new Error(pulled.conflict.message);
69
+ commit = await runtime.commit();
70
+ }
71
+ console.log(result.value, commit);
72
+ } finally {
73
+ await runtime.close();
74
+ }
75
+ ```
76
+
77
+ - `execute({ mode: "read" })` 不允许产生 mutation。
78
+ - `execute({ mode: "write" })` 捕获 mutation 并加入本地 pending state。
79
+ - `fetch()` 只获取并校验远端 changesets,不修改 Unit 内容;普通流程通常不必单独调用。
80
+ - `pull()` 会先 fetch,再通过 OT 协调本地状态并应用远端 changesets。
81
+ - `commit()` 提交本地 changeset,并处理 awaiting/pending identity。
82
+ - `close()` 释放 backend handle 与 Univer。
83
+
84
+ 调用方必须检查最终 commit status:`confirmed` 与 `nothing-to-commit` 已完成;`retry` 或 `unknown` 可在同一
85
+ runtime 重试;`pull-required` 需要再次 pull/commit;`conflict` 需要停止写入并由 application 决定恢复方式。
86
+
87
+ ## Backend port
88
+
89
+ `CollaborationRuntimeBackend.open()` 返回绑定 target 的 handle。Handle 可以使用 `unit-data` checkpoint 或
90
+ Snapshot,并负责连续 changeset 读取、幂等提交、连接状态与关闭。Runtime 不解释 Workspace、Worktree、
91
+ ResourceRef、认证或 URL;这些属于 application adapter。
92
+
93
+ 连接官方 Collaboration Server 时,可使用 Collaboration SDK 提供的 service、endpoint 与 transport 实现
94
+ backend,而不是让 Snapshot 和 changeset 经过 daemon 中转。
95
+
96
+ ## 状态与错误
97
+
98
+ Runtime 暴露当前 revision、connection state、本地 dirty state 与冲突结果。Backend 中断不会伪装成成功;
99
+ fetch/pull/commit 的结果允许 adapter 区分无变化、已推进、冲突或失败。无法继续安全复用的 runtime 应由 owner
100
+ 销毁,而不是继续执行。
101
+
102
+ ## 与其他 package 的关系
103
+
104
+ 标准 Univer composition 由 `@univer-cli/headless-univer` 提供。需要在 worker 中按 key 复用 runtime 时,使用
105
+ [`@univer-cli/univer-collaboration-runtime-pool`](../univer-collaboration-runtime-pool/README.zh-CN.md)。
106
+ 本 package 不提供 Commander、pool、worker、daemon、target-to-key 算法或认证策略。
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ 'use strict';module['exports']=require('./index.mjs');
@@ -0,0 +1,230 @@
1
+ import { IBoardData } from "@univerjs-pro/boards";
2
+ import { ISlideData } from "@univerjs-pro/slides";
3
+ import { IBaseSnapshot, IDocumentData, IWorkbookData, Univer, UniverInstanceType } from "@univerjs/core";
4
+ import { IChangeset, IFetchMissingChangesetsResponse, IGetSheetBlockResponse, IGetUnitOnRevResponse, IMutation } from "@univerjs/protocol";
5
+ import { ISnapshotServerService, SnapshotService } from "@univerjs-pro/collaboration";
6
+ //#region src/backend.d.ts
7
+ type CollaborationConnectionState = "online" | "reconnecting" | "offline" | "closed";
8
+ interface CollaborationRuntimeTarget {
9
+ readonly unitId: string;
10
+ readonly unitType: UniverInstanceType;
11
+ }
12
+ interface CollaborationChangesetDraft {
13
+ readonly baseRev: number;
14
+ readonly mutations: readonly IMutation[];
15
+ readonly sid: string;
16
+ readonly reqId: number;
17
+ readonly additionalFields?: string;
18
+ }
19
+ type CollaborationBackendSubmitResult = {
20
+ readonly status: "confirmed";
21
+ readonly precedingChangesets: readonly IChangeset[];
22
+ readonly acceptedChangeset: IChangeset;
23
+ } | {
24
+ readonly status: "retry";
25
+ } | {
26
+ readonly status: "unknown";
27
+ } | {
28
+ readonly status: "rejected";
29
+ readonly reason: "invalid-revision" | "permission-denied" | "invalid-changeset";
30
+ readonly message: string;
31
+ };
32
+ interface CollaborationBackendHandleBase {
33
+ getConnectionState(): CollaborationConnectionState;
34
+ fetchChangesets(fromRevision: number, toRevision?: number): Promise<IFetchMissingChangesetsResponse>;
35
+ submitChangeset(draft: CollaborationChangesetDraft): Promise<CollaborationBackendSubmitResult>;
36
+ close(): Promise<void>;
37
+ }
38
+ type CollaborationUnitDataCheckpoint = {
39
+ readonly unitType: UniverInstanceType.UNIVER_SHEET;
40
+ readonly unitData: IWorkbookData;
41
+ readonly changesets: readonly IChangeset[];
42
+ } | {
43
+ readonly unitType: UniverInstanceType.UNIVER_DOC;
44
+ readonly unitData: IDocumentData;
45
+ readonly changesets: readonly IChangeset[];
46
+ } | {
47
+ readonly unitType: UniverInstanceType.UNIVER_SLIDE;
48
+ readonly unitData: ISlideData;
49
+ readonly changesets: readonly IChangeset[];
50
+ } | {
51
+ readonly unitType: UniverInstanceType.UNIVER_BASE;
52
+ readonly unitData: IBaseSnapshot;
53
+ readonly changesets: readonly IChangeset[];
54
+ } | {
55
+ readonly unitType: UniverInstanceType.UNIVER_BOARD;
56
+ readonly unitData: IBoardData;
57
+ readonly changesets: readonly IChangeset[];
58
+ };
59
+ interface CollaborationUnitDataBackendHandle extends CollaborationBackendHandleBase {
60
+ readonly format: "unit-data";
61
+ getUnitData(): Promise<CollaborationUnitDataCheckpoint>;
62
+ }
63
+ interface CollaborationSnapshotBackendHandle extends CollaborationBackendHandleBase {
64
+ readonly format: "snapshot";
65
+ getUnitOnRev(revision?: number): Promise<IGetUnitOnRevResponse>;
66
+ getSheetBlock(blockID: string): Promise<IGetSheetBlockResponse>;
67
+ }
68
+ type CollaborationRuntimeBackendHandle = CollaborationUnitDataBackendHandle | CollaborationSnapshotBackendHandle;
69
+ interface CollaborationRuntimeBackend {
70
+ open(target: CollaborationRuntimeTarget): Promise<CollaborationRuntimeBackendHandle>;
71
+ }
72
+ //#endregion
73
+ //#region src/errors.d.ts
74
+ type CollaborationRuntimeErrorCode = "COLLABORATION_INVALID_INPUT" | "COLLABORATION_LOAD_FAILED" | "COLLABORATION_UNAVAILABLE" | "COLLABORATION_PROTOCOL_ERROR" | "COLLABORATION_CLOSED";
75
+ interface CollaborationRuntimeErrorOptions extends ErrorOptions {
76
+ readonly retryable?: boolean;
77
+ }
78
+ declare class CollaborationRuntimeError extends Error {
79
+ readonly code: CollaborationRuntimeErrorCode;
80
+ readonly retryable: boolean;
81
+ constructor(code: CollaborationRuntimeErrorCode, message: string, options?: CollaborationRuntimeErrorOptions);
82
+ }
83
+ //#endregion
84
+ //#region src/types.d.ts
85
+ type CollaborationRuntimeValue = null | boolean | number | string | CollaborationRuntimeValue[] | {
86
+ readonly [key: string]: CollaborationRuntimeValue;
87
+ };
88
+ interface CollaborationRuntimeReadExecution {
89
+ readonly code: string;
90
+ readonly mode: "read";
91
+ }
92
+ interface CollaborationRuntimeWriteExecution {
93
+ readonly code: string;
94
+ readonly mode: "write";
95
+ }
96
+ interface CollaborationRuntimeReadResult {
97
+ readonly value: CollaborationRuntimeValue;
98
+ readonly state: CollaborationRuntimeState;
99
+ }
100
+ interface CollaborationRuntimeWriteResult {
101
+ readonly value: CollaborationRuntimeValue;
102
+ readonly mutations: readonly IMutation[];
103
+ readonly state: CollaborationRuntimeState;
104
+ }
105
+ interface CollaborationReplaceMutationsResult {
106
+ readonly previousMutationCount: number;
107
+ readonly pendingMutationCount: number;
108
+ readonly state: CollaborationRuntimeState;
109
+ }
110
+ type CollaborationFetchResult = {
111
+ readonly status: "unchanged";
112
+ readonly knownHeadRevision: number;
113
+ readonly state: CollaborationRuntimeState;
114
+ } | {
115
+ readonly status: "fetched";
116
+ readonly fromRevision: number;
117
+ readonly toRevision: number;
118
+ readonly changesets: readonly CollaborationChangesetSummary[];
119
+ readonly state: CollaborationRuntimeState;
120
+ };
121
+ type CollaborationPullResult = {
122
+ readonly status: "up-to-date";
123
+ readonly state: CollaborationRuntimeState;
124
+ } | {
125
+ readonly status: "pulled";
126
+ readonly fromRevision: number;
127
+ readonly toRevision: number;
128
+ readonly appliedChangesets: readonly CollaborationChangesetSummary[];
129
+ readonly transformedPendingMutationCount: number;
130
+ readonly state: CollaborationRuntimeState;
131
+ } | {
132
+ readonly status: "conflict";
133
+ readonly conflict: CollaborationConflict;
134
+ readonly state: CollaborationRuntimeState;
135
+ };
136
+ type CollaborationCommitResult = {
137
+ readonly status: "nothing-to-commit";
138
+ readonly state: CollaborationRuntimeState;
139
+ } | {
140
+ readonly status: "pull-required";
141
+ readonly baseRevision: number;
142
+ readonly knownHeadRevision: number;
143
+ readonly confirmedChangesets: readonly CollaborationChangesetSummary[];
144
+ readonly state: CollaborationRuntimeState;
145
+ } | {
146
+ readonly status: "confirmed";
147
+ readonly confirmedChangesets: readonly CollaborationChangesetSummary[];
148
+ readonly reconciledChangesets: readonly CollaborationChangesetSummary[];
149
+ readonly state: CollaborationRuntimeState;
150
+ } | {
151
+ readonly status: "retry" | "unknown";
152
+ readonly changeset: CollaborationChangesetSummary;
153
+ readonly confirmedChangesets: readonly CollaborationChangesetSummary[];
154
+ readonly state: CollaborationRuntimeState;
155
+ } | {
156
+ readonly status: "conflict";
157
+ readonly conflict: CollaborationConflict;
158
+ readonly confirmedChangesets: readonly CollaborationChangesetSummary[];
159
+ readonly state: CollaborationRuntimeState;
160
+ };
161
+ interface CollaborationChangesetSummary {
162
+ readonly baseRevision: number;
163
+ readonly revision: number;
164
+ readonly mutationCount: number;
165
+ readonly sid?: string;
166
+ readonly reqId?: number;
167
+ }
168
+ type CollaborationConflictReason = "transform-failed" | "changeset-rejected" | "permission-rejected";
169
+ interface CollaborationConflict {
170
+ readonly operation: "pull" | "commit";
171
+ readonly reason: CollaborationConflictReason;
172
+ readonly message: string;
173
+ }
174
+ interface CollaborationRuntimeState {
175
+ readonly connection: CollaborationConnectionState;
176
+ readonly baseRevision: number;
177
+ readonly knownHeadRevision: number;
178
+ readonly pendingMutationCount: number;
179
+ readonly bufferedChangesetCount: number;
180
+ readonly awaitingChangeset: CollaborationChangesetSummary | null;
181
+ readonly conflict: CollaborationConflict | null;
182
+ }
183
+ type CollaborationUnitData = IWorkbookData | IDocumentData | ISlideData | IBaseSnapshot | IBoardData;
184
+ interface UniverCollaborationRuntime {
185
+ readonly unitId: string;
186
+ readonly unitType: UniverInstanceType;
187
+ getState(): CollaborationRuntimeState;
188
+ getPendingMutations(): readonly IMutation[];
189
+ execute(input: CollaborationRuntimeReadExecution): Promise<CollaborationRuntimeReadResult>;
190
+ execute(input: CollaborationRuntimeWriteExecution): Promise<CollaborationRuntimeWriteResult>;
191
+ replacePendingMutations(mutations: readonly IMutation[]): Promise<CollaborationReplaceMutationsResult>;
192
+ fetch(): Promise<CollaborationFetchResult>;
193
+ pull(): Promise<CollaborationPullResult>;
194
+ commit(): Promise<CollaborationCommitResult>;
195
+ exportUnitData(): Promise<CollaborationUnitData>;
196
+ close(): Promise<void>;
197
+ }
198
+ //#endregion
199
+ //#region src/factory.d.ts
200
+ interface UniverFactoryContext {
201
+ /** Resolves the per-Univer SnapshotService after the factory has returned. */
202
+ readonly resolveSnapshotService?: () => SnapshotService;
203
+ readonly unitId: string;
204
+ readonly unitType: UniverInstanceType;
205
+ }
206
+ type UniverFactory = (context: UniverFactoryContext) => Univer | Promise<Univer>;
207
+ interface UniverCollaborationRuntimeFactoryOptions {
208
+ readonly backend: CollaborationRuntimeBackend;
209
+ readonly createUniver: UniverFactory;
210
+ readonly maxCodeLength?: number;
211
+ readonly snapshotServerService?: ISnapshotServerService;
212
+ }
213
+ interface UniverCollaborationRuntimeFactory {
214
+ load(unitId: string, unitType: UniverInstanceType): Promise<UniverCollaborationRuntime>;
215
+ }
216
+ declare function createUniverCollaborationRuntimeFactory(options: UniverCollaborationRuntimeFactoryOptions): UniverCollaborationRuntimeFactory;
217
+ //#endregion
218
+ //#region src/server/index.d.ts
219
+ type CollaborationHttpRequest = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
220
+ interface CollaborationServerConfig {
221
+ readonly snapshotServerUrl: string;
222
+ readonly collabSubmitChangesetUrl: string;
223
+ readonly collabWebSocketUrl: string;
224
+ readonly wsSessionTicketUrl: string;
225
+ readonly httpRequest?: CollaborationHttpRequest;
226
+ readonly commitTimeoutMs?: number;
227
+ }
228
+ declare function createCollaborationServerAdapter(serverConfig: CollaborationServerConfig): CollaborationRuntimeBackend;
229
+ //#endregion
230
+ export { type CollaborationBackendHandleBase, type CollaborationBackendSubmitResult, type CollaborationChangesetDraft, type CollaborationChangesetSummary, type CollaborationCommitResult, type CollaborationConflict, type CollaborationConflictReason, type CollaborationConnectionState, type CollaborationFetchResult, type CollaborationHttpRequest, type CollaborationPullResult, type CollaborationReplaceMutationsResult, type CollaborationRuntimeBackend, type CollaborationRuntimeBackendHandle, CollaborationRuntimeError, type CollaborationRuntimeErrorCode, type CollaborationRuntimeErrorOptions, type CollaborationRuntimeReadExecution, type CollaborationRuntimeReadResult, type CollaborationRuntimeState, type CollaborationRuntimeTarget, type CollaborationRuntimeValue, type CollaborationRuntimeWriteExecution, type CollaborationRuntimeWriteResult, type CollaborationServerConfig, type CollaborationSnapshotBackendHandle, type CollaborationUnitData, type CollaborationUnitDataBackendHandle, type CollaborationUnitDataCheckpoint, type UniverCollaborationRuntime, type UniverCollaborationRuntimeFactory, type UniverCollaborationRuntimeFactoryOptions, type UniverFactory, type UniverFactoryContext, createCollaborationServerAdapter, createUniverCollaborationRuntimeFactory };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ function _0x1727(_0xeea3ae,_0x221350){_0xeea3ae=_0xeea3ae-0x92;const _0x287be8=_0x287b();let _0x1727b7=_0x287be8[_0xeea3ae];return _0x1727b7;}const _0x1482ee=_0x1727;(function(_0x149574,_0x65540e){const _0x33e347=_0x1727,_0x198056=_0x149574();while(!![]){try{const _0xd65d2f=parseInt(_0x33e347(0x16a))/0x1+parseInt(_0x33e347(0xa8))/0x2+-parseInt(_0x33e347(0x97))/0x3+parseInt(_0x33e347(0xaa))/0x4*(parseInt(_0x33e347(0x1cc))/0x5)+parseInt(_0x33e347(0xce))/0x6*(parseInt(_0x33e347(0xf2))/0x7)+parseInt(_0x33e347(0xbd))/0x8*(parseInt(_0x33e347(0x178))/0x9)+-parseInt(_0x33e347(0x108))/0xa;if(_0xd65d2f===_0x65540e)break;else _0x198056['push'](_0x198056['shift']());}catch(_0x5b0540){_0x198056['push'](_0x198056['shift']());}}}(_0x287b,0xe726d));import{CommandType as _0x222396,DependentOn as _0x5484e2,ICommandService as _0x38e832,IUniverInstanceService as _0x43b472,Inject as _0x3d53db,Injector as _0x2d7cf3,Plugin as _0x5a4b2b,UniverInstanceType as _0x2706d9,registerDependencies as _0x4fdc5e,sequenceExecute as _0x4d1c43,toDisposable as _0x4471f1}from'@univerjs/core';import{CompressMutationService as _0x883255,ISnapshotServerService as _0x56efa7,ITransformService as _0x140dc4,RevertRevisionMutation as _0x5442a0,RevisionService as _0x18e322,SnapshotService as _0x50e6cf,UniverCollaborationPlugin as _0x21f34a,isTransformMutationsSuccess as _0x318500,parseChangesetToProtocol as _0x49c5bb,parseMutationToProtocol as _0x2ffc6e,parseProtocolChangeset as _0x574ea1,transformSnapshotToBaseData as _0x3e51e0,transformSnapshotToBoardData as _0x170d99,transformSnapshotToDocumentData as _0xbc816c,transformSnapshotToSlideData as _0xa6a84a,transformSnapshotToWorkbookData as _0x5f373c}from'@univerjs-pro/collaboration';import{FormulaCalculationSessionService as _0x6823bc}from'@univerjs/engine-formula';import{CmdRspCode as _0x39ab32,CombCmd as _0x66851,isError as _0x279d4e}from'@univerjs/protocol';import{PersistFormulaLastValuesCommand as _0x54581c}from'@univerjs-pro/engine-formula';import{DocStateChangeManagerService as _0x5b9d55,RichTextEditingMutation as _0x35966f}from'@univerjs/docs';import{IRenderManagerService as _0x1a7a50}from'@univerjs/engine-render';import{FUniver as _0x5a39f3}from'@univerjs/core/facade';import'@univerjs-pro/bases/facade';import'@univerjs-pro/boards/facade';import'@univerjs-pro/slides/facade';import'@univerjs/docs/facade';import'@univerjs/sheets/facade';import _0x274a5e from'@oxc-project/runtime/helpers/decorateParam';import _0x4679aa from'@oxc-project/runtime/helpers/decorate';var j=class extends Error{[_0x1482ee(0x1a4)];[_0x1482ee(0x15a)];constructor(_0x210fcb,_0x2adf56,_0x2280a9={}){const _0x304a9c=_0x1482ee;super(_0x2adf56,_0x2280a9),this[_0x304a9c(0x1d4)]=_0x304a9c(0x177),this[_0x304a9c(0x1a4)]=_0x210fcb,this[_0x304a9c(0x15a)]=_0x2280a9[_0x304a9c(0x15a)]??!0x1;}},se=class{[_0x1482ee(0x1b9)];[_0x1482ee(0x1a0)];['_pending']=[];[_0x1482ee(0x1f9)]=[];[_0x1482ee(0x1e1)]=0x0;constructor(_0x1ca94c,_0x38767c,_0x4b8c58){const _0x57a6fa=_0x1482ee;this[_0x57a6fa(0x1b9)]=_0x1ca94c,this['_unitId']=_0x38767c,this[_0x57a6fa(0x1f9)][_0x57a6fa(0xdc)](_0x1ca94c[_0x57a6fa(0x9c)]['onMutationExecutedForCollab']((_0x54a681,_0x1b5373)=>{const _0x4abeb3=_0x57a6fa;this[_0x4abeb3(0x18a)](_0x54a681,_0x1b5373,_0x4b8c58);})),_0x4b8c58===_0x2706d9[_0x57a6fa(0x18d)]&&(_0x1ca94c['injector'][_0x57a6fa(0x169)](_0x1a7a50),this[_0x57a6fa(0x1c9)]());}get[_0x1482ee(0x10a)](){const _0x4a6153=_0x1482ee;return this[_0x4a6153(0x164)];}[_0x1482ee(0xfe)](_0x4facac){const _0x15655b=_0x1482ee;return this[_0x15655b(0x164)][_0x15655b(0x109)](_0x4facac);}[_0x1482ee(0x190)](_0x2cc7f9){const _0x5bc0d3=_0x1482ee;this[_0x5bc0d3(0x164)][_0x5bc0d3(0xd4)](0x0,this[_0x5bc0d3(0x164)][_0x5bc0d3(0x1a3)],..._0x2cc7f9);}[_0x1482ee(0xe2)](){const _0x5993ef=_0x1482ee;return this['_pending'][_0x5993ef(0xd4)](0x0);}['prependPending'](_0x4983eb){const _0x2cf4a9=_0x1482ee;this[_0x2cf4a9(0x164)]['unshift'](..._0x4983eb);}async[_0x1482ee(0x111)](_0x30fe9c){const _0x22f812=_0x1482ee;this['_suppressionDepth']+=0x1;try{return await _0x30fe9c();}finally{--this[_0x22f812(0x1e1)];}}[_0x1482ee(0xed)](){const _0x219d07=_0x1482ee;for(let _0x4083c5 of this['_disposables'][_0x219d07(0xd4)](0x0))_0x4083c5[_0x219d07(0xed)]();}[_0x1482ee(0x18a)](_0x180e85,_0x58938a,_0x2eff92){const _0xc20312=_0x1482ee;if(this[_0xc20312(0x1e1)]>0x0||_0x180e85[_0xc20312(0xac)]!==_0x222396[_0xc20312(0xb3)]||_0x58938a?.[_0xc20312(0xf1)]||_0x58938a?.[_0xc20312(0x116)]||_0x58938a?.['onlyLocal'])return;let _0x4dfa0d=_0x180e85['params'];if(_0x4dfa0d?.[_0xc20312(0x15d)]!==void 0x0&&_0x4dfa0d[_0xc20312(0x15d)]!==this[_0xc20312(0x1a0)]){if(_0x4dfa0d[_0xc20312(0xbe)]===_0x54581c['id'])return;throw new j(_0xc20312(0x202),_0xc20312(0xf3)+this[_0xc20312(0x1a0)]+_0xc20312(0x1e7)+_0x180e85['id']+_0xc20312(0x11f)+String(_0x4dfa0d[_0xc20312(0x15d)]));}if(_0x4dfa0d?.[_0xc20312(0x15d)]===void 0x0||_0x2eff92===_0x2706d9['UNIVER_DOC']&&_0x180e85['id']===_0x35966f['id'])return;if(_0x180e85['id']===_0x5442a0['id'])throw new j(_0xc20312(0x202),_0xc20312(0xd1));let _0x33058e=_0x180e85,_0x389c58=this[_0xc20312(0x1b9)][_0xc20312(0x11e)][_0xc20312(0x1f3)][_0xc20312(0x126)]()[_0xc20312(0xde)],_0x4f845a=(this['_kernel'][_0xc20312(0x11e)]['interceptor'][_0xc20312(0x130)](_0x389c58)([_0x33058e],this[_0xc20312(0x1b9)][_0xc20312(0xa3)])??[_0x33058e])[0x0];_0x4f845a&&this[_0xc20312(0x164)][_0xc20312(0xdc)](_0x2ffc6e(_0x4f845a));}['_subscribeToDocumentState'](){const _0x5e3cb6=_0x1482ee;let _0x4d0895=this[_0x5e3cb6(0x1b9)][_0x5e3cb6(0x16e)][_0x5e3cb6(0x169)](_0x5b9d55)[_0x5e3cb6(0x113)][_0x5e3cb6(0xcf)](_0x138cf0=>{const _0x14ca56=_0x5e3cb6;if(this['_suppressionDepth']>0x0||_0x138cf0?.[_0x14ca56(0x15d)]!==this[_0x14ca56(0x1a0)])return;let _0x3a1df1={'id':_0x138cf0[_0x14ca56(0x1dd)],'params':{'actions':_0x138cf0[_0x14ca56(0x1a2)][_0x14ca56(0x207)],'textRanges':null,'unitId':_0x138cf0[_0x14ca56(0x15d)]},'type':_0x222396[_0x14ca56(0xb3)]};this[_0x14ca56(0x164)]['push'](_0x2ffc6e(_0x3a1df1));});this[_0x5e3cb6(0x1f9)][_0x5e3cb6(0xdc)](_0x4471f1(()=>_0x4d0895[_0x5e3cb6(0x1d5)]()));}},ce=new Set(['formula.mutation.set-trigger-formula-calculation-start','formula.mutation.set-trigger-formula-calculation-stop',_0x1482ee(0x1d1),_0x1482ee(0x1b3),'formula.mutation.set-array-formula-data',_0x1482ee(0x206),_0x1482ee(0x154)]),le=new Set(['createBase',_0x1482ee(0x9f),_0x1482ee(0x204),'createDocument','createPresentation','createUniverSheet',_0x1482ee(0xf7)]);function ue(_0x7486c9,_0x58aa59,_0x3b8010){let _0x2287bc=_0x5a39f3['newAPI'](_0x7486c9);return{async 'execute'(_0x593844,_0x1ed74a){const _0x35a736=_0x1727;if(_0x593844['length']>_0x3b8010)throw new j(_0x35a736(0x202),_0x35a736(0xd5)+_0x3b8010+_0x35a736(0x10c));let _0x461c12=_0x1ed74a===_0x35a736(0x17e)?M(_0x2287bc):void 0x0,_0xd77f08=de(_0x2287bc,_0x58aa59);try{return await Function(_0x35a736(0x19f),_0x35a736(0xf8)+_0x593844+_0x35a736(0xe8))(_0xd77f08);}finally{_0x461c12?.[_0x35a736(0xed)]();}}};}function de(_0x5c5bd1,_0xeb888d){return new Proxy(_0x5c5bd1,{'get'(_0x412fca,_0x15b1d1,_0x4ac5db){return le['has'](_0x15b1d1)?()=>{const _0x441472=_0x1727;throw new j(_0x441472(0x202),_0x441472(0x173)+_0xeb888d+_0x441472(0x94)+String(_0x15b1d1));}:Reflect['get'](_0x412fca,_0x15b1d1,_0x4ac5db);}});}function M(_0x163121){const _0x511839=_0x1482ee;return _0x163121[_0x511839(0x1fb)](_0x163121[_0x511839(0xff)][_0x511839(0x1af)],_0x240ef3=>{const _0x5db7d9=_0x511839;let _0x781501=_0x240ef3;if(N(_0x781501))throw _0x781501[_0x5db7d9(0x1d9)]=!0x0,new j(_0x5db7d9(0x202),_0x5db7d9(0x149)+_0x781501['id']);});}function N(_0x30bd77){const _0x118ec5=_0x1482ee;return _0x30bd77['type']===_0x222396[_0x118ec5(0xb0)]||_0x30bd77['type']===_0x222396[_0x118ec5(0xb3)]&&!ce['has'](_0x30bd77['id']);}function P(_0x2a426e){const _0xe51fa4=_0x1482ee;if(_0x2a426e===void 0x0)return null;if(_0x2a426e===null||typeof _0x2a426e==_0xe51fa4(0x1bb)||typeof _0x2a426e==_0xe51fa4(0x132))return _0x2a426e;if(typeof _0x2a426e==_0xe51fa4(0x18c)){if(Number[_0xe51fa4(0x200)](_0x2a426e))return _0x2a426e;throw I();}if(Array[_0xe51fa4(0x187)](_0x2a426e))return _0x2a426e[_0xe51fa4(0x168)](P);if(F(_0x2a426e))return Object['fromEntries'](Object[_0xe51fa4(0x144)](_0x2a426e)[_0xe51fa4(0x168)](([_0x5aeee4,_0x383236])=>[_0x5aeee4,P(_0x383236)]));throw I();}function F(_0x29f1bf){const _0x2c847e=_0x1482ee;if(typeof _0x29f1bf!=_0x2c847e(0xb7)||!_0x29f1bf)return!0x1;let _0xe1e381=Object[_0x2c847e(0x1fc)](_0x29f1bf);return _0xe1e381===Object['prototype']||_0xe1e381===null;}function I(){const _0x4bfbfc=_0x1482ee;return new j(_0x4bfbfc(0x202),_0x4bfbfc(0xec));}var L=class{[_0x1482ee(0x1f6)]=Promise[_0x1482ee(0x1d0)]();[_0x1482ee(0x17b)](_0x370b51){const _0x1ae2f3=_0x1482ee;let _0x41c99c=this[_0x1ae2f3(0x1f6)]['then'](_0x370b51,_0x370b51);return this[_0x1ae2f3(0x1f6)]=_0x41c99c[_0x1ae2f3(0xd3)](()=>void 0x0,()=>void 0x0),_0x41c99c;}};function R(_0x13a636,_0x3e7fc5,_0x451f93,_0xc8f18a){const _0x287a9f=_0x1482ee;if(!Array['isArray'](_0x13a636))throw new j(_0x287a9f(0xd6),_0x287a9f(0x1d7));let _0x13874a=[..._0x13a636][_0x287a9f(0x1e8)]((_0x1a0425,_0x363559)=>_0x1a0425[_0x287a9f(0xea)]-_0x363559[_0x287a9f(0xea)]),_0x58b2f8=_0xc8f18a;for(let _0x423ab8 of _0x13874a){if(!_0x423ab8||typeof _0x423ab8!=_0x287a9f(0xb7)||!Array[_0x287a9f(0x187)](_0x423ab8[_0x287a9f(0xb6)])||_0x423ab8[_0x287a9f(0xb6)]['some'](_0x371582=>!_0x371582||typeof _0x371582!=_0x287a9f(0xb7)||!('id'in _0x371582)||typeof _0x371582['id']!=_0x287a9f(0x132)||!(_0x287a9f(0x205)in _0x371582)||typeof _0x371582[_0x287a9f(0x205)]!=_0x287a9f(0x132))||!Number[_0x287a9f(0x1f2)](_0x423ab8['baseRev'])||!Number[_0x287a9f(0x1f2)](_0x423ab8[_0x287a9f(0xea)])||_0x423ab8[_0x287a9f(0xc2)]!==_0x3e7fc5||_0x423ab8[_0x287a9f(0xac)]!==_0x451f93||_0x423ab8['baseRev']!==_0x58b2f8||_0x423ab8[_0x287a9f(0xea)]!==_0x58b2f8+0x1)throw new j(_0x287a9f(0xd6),_0x287a9f(0xd7));_0x58b2f8=_0x423ab8[_0x287a9f(0xea)];}return _0x13874a;}function z(_0x50c2d9){const _0x7c954a=_0x1482ee;return{'baseRevision':_0x50c2d9[_0x7c954a(0x1f4)],'mutationCount':_0x50c2d9['mutations'][_0x7c954a(0x1a3)],'revision':_0x50c2d9[_0x7c954a(0xea)],..._0x50c2d9[_0x7c954a(0x162)]===void 0x0?{}:{'sid':_0x50c2d9[_0x7c954a(0x162)]},..._0x50c2d9[_0x7c954a(0x179)]===void 0x0?{}:{'reqId':_0x50c2d9[_0x7c954a(0x179)]}};}function B(_0x49dca6,_0x131908,_0x39be18,_0x24cc64,_0x1e5246,_0x117861='initial'){const _0x490ca7=_0x1482ee;if(_0x1e5246[_0x490ca7(0x12e)](_0x5f0b3f=>_0x5f0b3f[_0x490ca7(0xb6)][_0x490ca7(0x12e)](_0x4ee66f=>_0x4ee66f['id']===_0x5442a0['id'])))throw new j(_0x490ca7(0xd6),'Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20replayed\x20in\x20place');let _0x4eaab0=_0x24cc64;for(let _0x20bf5f of _0x1e5246){let _0x416a83=_0x4eaab0+0x1;if(_0x20bf5f[_0x490ca7(0xc2)]!==_0x131908||_0x20bf5f[_0x490ca7(0xac)]!==_0x39be18||_0x20bf5f[_0x490ca7(0x1f4)]!==_0x4eaab0||_0x20bf5f[_0x490ca7(0xea)]!==_0x416a83)throw new j(_0x490ca7(0xd6),_0x490ca7(0x10e));let _0x389a11=_0x574ea1(_0x20bf5f),_0x281929=_0x49dca6[_0x490ca7(0x11e)][_0x490ca7(0x1f3)]['getInterceptPoints']()[_0x490ca7(0x1d3)],_0x51ec12=_0x49dca6[_0x490ca7(0x11e)][_0x490ca7(0x1f3)]['fetchThroughInterceptors'](_0x281929)(_0x389a11[_0x490ca7(0xb6)],null)??_0x389a11[_0x490ca7(0xb6)],_0x38dbdc=_0x4d1c43(_0x51ec12,_0x49dca6['commandService'],_0x117861===_0x490ca7(0x16b)?{'fromChangeset':!0x0}:{'fromCollab':!0x0});if(!_0x38dbdc[_0x490ca7(0x12a)])throw new j(_0x490ca7(0xd0),'Confirmed\x20mutation\x20replay\x20failed\x20at\x20index\x20'+_0x38dbdc[_0x490ca7(0x1b4)]+':\x20'+String(_0x38dbdc[_0x490ca7(0x186)]));let _0x2500e1=_0x49dca6['revisionService'][_0x490ca7(0x146)](_0x131908);if(_0x2500e1!==_0x416a83)throw new j(_0x490ca7(0xd6),_0x490ca7(0x1fd));_0x4eaab0=_0x2500e1;}return _0x4eaab0;}function V(_0x49d73e,_0x14fd62,_0x460185){const _0x7a663d=_0x1482ee;let _0x4b1b83=_0x5a39f3['newAPI'](_0x49d73e);switch(_0x460185){case _0x2706d9[_0x7a663d(0x13c)]:return H(_0x4b1b83['getWorkbook'](_0x14fd62)?.['save'](),_0x14fd62);case _0x2706d9[_0x7a663d(0x18d)]:return H(_0x4b1b83[_0x7a663d(0x11a)](_0x14fd62)?.[_0x7a663d(0x161)](),_0x14fd62);case _0x2706d9[_0x7a663d(0x197)]:return H(_0x4b1b83['getPresentation'](_0x14fd62)?.[_0x7a663d(0x161)](),_0x14fd62);case _0x2706d9[_0x7a663d(0x1b0)]:return H(_0x4b1b83[_0x7a663d(0xc3)](_0x14fd62)?.[_0x7a663d(0x161)](),_0x14fd62);case _0x2706d9[_0x7a663d(0x9e)]:return H(_0x4b1b83[_0x7a663d(0xd8)](_0x14fd62)?.[_0x7a663d(0x161)](),_0x14fd62);default:throw new j(_0x7a663d(0x202),_0x7a663d(0x93)+_0x460185);}}function H(_0x8d78e,_0xc47a94){const _0x358aa2=_0x1482ee;if(_0x8d78e===void 0x0)throw new j(_0x358aa2(0xd0),'Unit\x20'+_0xc47a94+_0x358aa2(0x1e4));return structuredClone(_0x8d78e);}var fe=class{[_0x1482ee(0x15d)];[_0x1482ee(0xee)];[_0x1482ee(0x131)];[_0x1482ee(0x151)];['_univer'];[_0x1482ee(0x1b9)];[_0x1482ee(0xb1)];['_acceptingOperations']=!0x0;['_closed']=!0x1;[_0x1482ee(0xc9)];[_0x1482ee(0x1db)];[_0x1482ee(0xbb)]=new L();[_0x1482ee(0x192)]=[];[_0x1482ee(0x14d)];[_0x1482ee(0x12b)]=null;[_0x1482ee(0x115)]=null;[_0x1482ee(0x10d)]=crypto['randomUUID']();['_nextReqId']=0x1;constructor(_0x5a4805,_0x31c275,_0x6eb256,_0x2145f4,_0x56374e,_0x164c1f,_0x176eab){const _0x2d2840=_0x1482ee;this['unitId']=_0x5a4805,this[_0x2d2840(0xee)]=_0x31c275,this['_baseRevision']=_0x6eb256,this[_0x2d2840(0x151)]=_0x2145f4,this[_0x2d2840(0x120)]=_0x56374e,this['_kernel']=_0x164c1f,this[_0x2d2840(0x14d)]=_0x6eb256,this[_0x2d2840(0xc9)]=new se(_0x164c1f,_0x5a4805,_0x31c275),this[_0x2d2840(0x1db)]=ue(_0x56374e,_0x5a4805,_0x176eab);}['getState'](){const _0x379b0f=_0x1482ee;return{'awaitingChangeset':this[_0x379b0f(0x115)]===null?null:U(this[_0x379b0f(0x115)]),'baseRevision':this[_0x379b0f(0x131)],'bufferedChangesetCount':this['_bufferedChangesets'][_0x379b0f(0x1a3)],'conflict':this[_0x379b0f(0x12b)],'connection':this['_closed']?_0x379b0f(0xdd):this[_0x379b0f(0x151)]['getConnectionState'](),'knownHeadRevision':this[_0x379b0f(0x14d)],'pendingMutationCount':this[_0x379b0f(0xc9)][_0x379b0f(0x10a)]['length']};}[_0x1482ee(0x1a9)](){const _0x2b8278=_0x1482ee;return structuredClone(this[_0x2b8278(0xc9)]['pending']);}['fetch'](){const _0x14b3e5=_0x1482ee;return this[_0x14b3e5(0x137)]()||this[_0x14b3e5(0xbb)][_0x14b3e5(0x17b)](async()=>(this[_0x14b3e5(0xdf)](_0x14b3e5(0x1df)),await this[_0x14b3e5(0x1aa)]()));}['pull'](){const _0x18c3b2=_0x1482ee;return this['_rejectIfNotAccepting']()||this[_0x18c3b2(0xbb)][_0x18c3b2(0x17b)](async()=>{const _0xdecfba=_0x18c3b2;if(this[_0xdecfba(0xdf)]('pull'),await this['_fetchChangesets'](),this[_0xdecfba(0x192)][_0xdecfba(0x1a3)]===0x0)return{'state':this[_0xdecfba(0x1f5)](),'status':_0xdecfba(0x119)};let _0x4d6a53=[...this[_0xdecfba(0x192)]];if(_0x4d6a53[_0xdecfba(0x12e)](_0x143bc4=>_0x143bc4['mutations']['some'](_0x7ce9c6=>_0x7ce9c6['id']===_0x5442a0['id'])))throw new j(_0xdecfba(0xd6),_0xdecfba(0xeb));let _0x12623b=this['_baseRevision'],_0x378317=this[_0xdecfba(0x115)]?W(this[_0xdecfba(0x115)][_0xdecfba(0xb6)],this[_0xdecfba(0x15d)],this['unitType'],this[_0xdecfba(0x131)]):null,_0x1d1232=_0x574ea1({'baseRev':this[_0xdecfba(0x131)],'memberID':'','mutations':[...this['_capture'][_0xdecfba(0x10a)]],'revision':0x0,'type':this[_0xdecfba(0xee)],'unitID':this['unitId'],'userID':''})['mutations'],_0x5274f2=[];for(let _0x138de8 of _0x4d6a53){let _0x304e57=_0x574ea1(_0x138de8);if(this[_0xdecfba(0x115)]!==null&&_0x138de8['sid']===this[_0xdecfba(0x115)][_0xdecfba(0x162)]&&_0x138de8['reqId']===this[_0xdecfba(0x115)][_0xdecfba(0x179)]){let _0x20c30c=(_0x378317??[])['map'](_0x2ffc6e);G(_0x138de8[_0xdecfba(0xb6)],_0x20c30c)||await this['_closeAfterFatalError'](new j('COLLABORATION_PROTOCOL_ERROR',_0xdecfba(0x148))),_0x5274f2['push']({'changeset':_0x138de8,'kind':_0xdecfba(0x1a8)}),_0x378317=null;continue;}let _0x404fcd=_0x304e57['mutations'];if(_0x378317!==null){let _0x17bd97=this['_kernel'][_0xdecfba(0x17f)][_0xdecfba(0x133)](_0x404fcd,_0x378317,!0x1);if(!_0x318500(_0x17bd97))return this['_conflict']={'message':_0x17bd97[_0xdecfba(0x186)][_0xdecfba(0xb9)],'operation':_0xdecfba(0x17c),'reason':_0xdecfba(0x176)},{'conflict':this[_0xdecfba(0x12b)],'state':this[_0xdecfba(0x1f5)](),'status':'conflict'};_0x404fcd=_0x17bd97[_0xdecfba(0x1c4)],_0x378317=_0x17bd97['m2Prime'];}let _0x1593a1=this['_kernel'][_0xdecfba(0x17f)][_0xdecfba(0x133)](_0x404fcd,_0x1d1232,!0x1);if(!_0x318500(_0x1593a1))return this['_conflict']={'message':_0x1593a1[_0xdecfba(0x186)][_0xdecfba(0xb9)],'operation':_0xdecfba(0x17c),'reason':_0xdecfba(0x176)},{'conflict':this[_0xdecfba(0x12b)],'state':this['getState'](),'status':_0xdecfba(0x1c6)};_0x5274f2['push']({'changeset':_0x49c5bb({..._0x304e57,'mutations':_0x1593a1[_0xdecfba(0x1c4)]}),'kind':_0xdecfba(0x1d8)}),_0x1d1232=_0x1593a1[_0xdecfba(0xfa)];}let _0x5c1984=_0x12623b;for(let _0x4102aa of _0x5274f2){if(_0x4102aa[_0xdecfba(0x156)]==='awaiting-ack'){let _0x24b2b8=this[_0xdecfba(0x1b9)][_0xdecfba(0x166)][_0xdecfba(0x146)](this[_0xdecfba(0x15d)]);_0x24b2b8!==_0x4102aa[_0xdecfba(0xc0)][_0xdecfba(0xea)]&&await this[_0xdecfba(0x184)](new j(_0xdecfba(0xd6),'Awaiting\x20changeset\x20echo\x20does\x20not\x20follow\x20the\x20current\x20revision')),_0x5c1984=_0x24b2b8;continue;}_0x5c1984=await this[_0xdecfba(0x18e)](_0x5c1984,[_0x4102aa[_0xdecfba(0xc0)]]);}return this[_0xdecfba(0xc9)][_0xdecfba(0x190)](_0x1d1232[_0xdecfba(0x168)](_0x2ffc6e)),this[_0xdecfba(0x115)]!==null&&(this[_0xdecfba(0x115)]=_0x378317===null?null:{...this['_awaiting'],'baseRev':_0x5c1984,'mutations':_0x378317[_0xdecfba(0x168)](_0x2ffc6e)}),this[_0xdecfba(0x131)]=_0x5c1984,this['_bufferedChangesets']['splice'](0x0),{'appliedChangesets':_0x4d6a53['map'](z),'fromRevision':_0x12623b,'state':this[_0xdecfba(0x1f5)](),'status':'pulled','toRevision':_0x5c1984,'transformedPendingMutationCount':_0x1d1232[_0xdecfba(0x1a3)]};});}[_0x1482ee(0x122)](){const _0x374af3=_0x1482ee;return this['_rejectIfNotAccepting']()||this[_0x374af3(0xbb)][_0x374af3(0x17b)](async()=>{const _0x1fe0cd=_0x374af3;this['_assertMutableState'](_0x1fe0cd(0x122));let _0x5beee4=[],_0x5a1c55=[];if(this[_0x1fe0cd(0x115)]===null){if(this[_0x1fe0cd(0xc9)][_0x1fe0cd(0x10a)][_0x1fe0cd(0x1a3)]===0x0)return{'state':this[_0x1fe0cd(0x1f5)](),'status':'nothing-to-commit'};if(await this[_0x1fe0cd(0x1aa)](),this['_bufferedChangesets'][_0x1fe0cd(0x1a3)]>0x0)return{'baseRevision':this[_0x1fe0cd(0x131)],'confirmedChangesets':_0x5beee4,'knownHeadRevision':this['_knownHeadRevision'],'state':this['getState'](),'status':_0x1fe0cd(0x117)};this[_0x1fe0cd(0xe3)]();}for(;this[_0x1fe0cd(0x115)]!==null;){let _0x2fd873=this[_0x1fe0cd(0x115)],_0x436490;try{_0x436490=await this[_0x1fe0cd(0x151)][_0x1fe0cd(0x1e3)](_0x2fd873);}catch{return{'changeset':U(_0x2fd873),'confirmedChangesets':_0x5beee4,'state':this[_0x1fe0cd(0x1f5)](),'status':'unknown'};}if(_0x436490[_0x1fe0cd(0x1e6)]==='retry'||_0x436490[_0x1fe0cd(0x1e6)]===_0x1fe0cd(0x182))return{'changeset':U(_0x2fd873),'confirmedChangesets':_0x5beee4,'state':this[_0x1fe0cd(0x1f5)](),'status':_0x436490[_0x1fe0cd(0x1e6)]};if(_0x436490['status']===_0x1fe0cd(0x99))return _0x436490['reason']==='invalid-revision'?(this['_capture'][_0x1fe0cd(0xf4)](_0x2fd873[_0x1fe0cd(0xb6)]),this[_0x1fe0cd(0x115)]=null,await this[_0x1fe0cd(0x1aa)](),{'baseRevision':this[_0x1fe0cd(0x131)],'confirmedChangesets':_0x5beee4,'knownHeadRevision':this['_knownHeadRevision'],'state':this[_0x1fe0cd(0x1f5)](),'status':_0x1fe0cd(0x117)}):(this[_0x1fe0cd(0x12b)]={'message':_0x436490['message'],'operation':_0x1fe0cd(0x122),'reason':_0x436490[_0x1fe0cd(0xba)]===_0x1fe0cd(0xe7)?_0x1fe0cd(0x19c):_0x1fe0cd(0x1c7)},{'conflict':this[_0x1fe0cd(0x12b)],'confirmedChangesets':_0x5beee4,'state':this[_0x1fe0cd(0x1f5)](),'status':_0x1fe0cd(0x1c6)});let _0x216079=_0x436490[_0x1fe0cd(0xb2)];try{this[_0x1fe0cd(0x14f)](_0x2fd873,_0x436490[_0x1fe0cd(0x1e5)],_0x216079);}catch(_0x43178e){await this[_0x1fe0cd(0x184)](_0x43178e);}let _0x5a6b24=_0x2fd873[_0x1fe0cd(0xb6)];if(_0x436490[_0x1fe0cd(0x1e5)][_0x1fe0cd(0x1a3)]>0x0){let _0x4f1c5f=await this[_0x1fe0cd(0xa6)](_0x2fd873,_0x436490['precedingChangesets']);if(_0x4f1c5f===null)return{'conflict':this[_0x1fe0cd(0x12b)],'confirmedChangesets':_0x5beee4,'state':this[_0x1fe0cd(0x1f5)](),'status':_0x1fe0cd(0x1c6)};_0x5a6b24=_0x4f1c5f['awaitingMutations'];try{this[_0x1fe0cd(0x19b)](_0x436490[_0x1fe0cd(0x1e5)]);}catch(_0x4b937c){await this[_0x1fe0cd(0x184)](_0x4b937c);}_0x5a1c55[_0x1fe0cd(0xdc)](..._0x436490['precedingChangesets'][_0x1fe0cd(0x168)](z));}G(_0x216079[_0x1fe0cd(0xb6)],_0x5a6b24)||await this[_0x1fe0cd(0x184)](new j(_0x1fe0cd(0xd6),_0x1fe0cd(0xfc)));let _0x3c9e65=this[_0x1fe0cd(0x1b9)][_0x1fe0cd(0x166)][_0x1fe0cd(0x146)](this[_0x1fe0cd(0x15d)]);if(_0x3c9e65!==_0x216079[_0x1fe0cd(0xea)]&&await this[_0x1fe0cd(0x184)](new j('COLLABORATION_PROTOCOL_ERROR',_0x1fe0cd(0xa1))),this[_0x1fe0cd(0x131)]=_0x3c9e65,this[_0x1fe0cd(0x14d)]=Math[_0x1fe0cd(0x1ec)](this[_0x1fe0cd(0x14d)],_0x3c9e65),this[_0x1fe0cd(0x115)]=null,_0x5beee4['push'](z(_0x216079)),this[_0x1fe0cd(0xc9)]['pending'][_0x1fe0cd(0x1a3)]===0x0)break;this[_0x1fe0cd(0xe3)]();}return{'confirmedChangesets':_0x5beee4,'reconciledChangesets':_0x5a1c55,'state':this[_0x1fe0cd(0x1f5)](),'status':_0x1fe0cd(0x189)};});}async['_fetchChangesets'](){const _0xba33d5=_0x1482ee;let _0x5db5db=this['_knownHeadRevision'],_0xcb869=await this[_0xba33d5(0x151)]['fetchChangesets'](_0x5db5db,void 0x0);if(_0x279d4e(_0xcb869[_0xba33d5(0x186)])){let _0x424b5b=_0xcb869[_0xba33d5(0x186)];throw new j(_0xba33d5(0x106),_0x424b5b?.[_0xba33d5(0xb9)]||_0xba33d5(0x1eb),{'retryable':!0x0});}let _0x5872f2=R(_0xcb869[_0xba33d5(0xda)],this[_0xba33d5(0x15d)],this[_0xba33d5(0xee)],_0x5db5db),_0x1f33c9=_0x5872f2['at'](-0x1)?.[_0xba33d5(0xea)]??_0x5db5db;if(_0xcb869[_0xba33d5(0x127)]!==void 0x0&&_0xcb869[_0xba33d5(0x127)]!==_0x1f33c9)throw new j(_0xba33d5(0xd6),_0xba33d5(0xaf));return _0x5872f2['length']===0x0?{'knownHeadRevision':this[_0xba33d5(0x14d)],'state':this['getState'](),'status':_0xba33d5(0x170)}:(this[_0xba33d5(0x192)][_0xba33d5(0xdc)](..._0x5872f2),this['_knownHeadRevision']=_0x1f33c9,{'changesets':_0x5872f2[_0xba33d5(0x168)](z),'fromRevision':_0x5db5db,'state':this[_0xba33d5(0x1f5)](),'status':_0xba33d5(0x18f),'toRevision':_0x1f33c9});}[_0x1482ee(0xe3)](){const _0xf83ad8=_0x1482ee;let _0x72539a=this[_0xf83ad8(0xc9)][_0xf83ad8(0xe2)]();this[_0xf83ad8(0x115)]={'baseRev':this['_baseRevision'],'mutations':_0x72539a,'reqId':this['_nextReqId'],'sid':this[_0xf83ad8(0x10d)]},this['_nextReqId']+=0x1;}[_0x1482ee(0x14f)](_0x3be48b,_0x895a2a,_0x27ba86){const _0x5587d0=_0x1482ee;let _0x2b3588=R(_0x895a2a,this[_0x5587d0(0x15d)],this[_0x5587d0(0xee)],this[_0x5587d0(0x131)])['at'](-0x1)?.[_0x5587d0(0xea)]??this[_0x5587d0(0x131)];if(_0x27ba86[_0x5587d0(0xc2)]!==this[_0x5587d0(0x15d)]||_0x27ba86[_0x5587d0(0xac)]!==this[_0x5587d0(0xee)]||_0x27ba86[_0x5587d0(0x162)]!==_0x3be48b[_0x5587d0(0x162)]||_0x27ba86[_0x5587d0(0x179)]!==_0x3be48b[_0x5587d0(0x179)]||_0x27ba86[_0x5587d0(0x1f4)]!==_0x2b3588||_0x27ba86[_0x5587d0(0xea)]!==_0x2b3588+0x1)throw new j('COLLABORATION_PROTOCOL_ERROR',_0x5587d0(0x12c));}async[_0x1482ee(0xa6)](_0x17a016,_0xf37255){const _0x2bf9f1=_0x1482ee;let _0x9a863e=W(_0x17a016[_0x2bf9f1(0xb6)],this[_0x2bf9f1(0x15d)],this[_0x2bf9f1(0xee)],this[_0x2bf9f1(0x131)]),_0x146096=W(this[_0x2bf9f1(0xc9)]['pending'],this[_0x2bf9f1(0x15d)],this[_0x2bf9f1(0xee)],this[_0x2bf9f1(0x131)]),_0x319f92=[];for(let _0x5df5e8 of _0xf37255){let _0x160232=_0x574ea1(_0x5df5e8),_0x5bf742=this['_kernel'][_0x2bf9f1(0x17f)][_0x2bf9f1(0x133)](_0x160232['mutations'],_0x9a863e,!0x1);if(!_0x318500(_0x5bf742))return this[_0x2bf9f1(0x9d)](_0x2bf9f1(0x122),_0x5bf742['error']),null;_0x9a863e=_0x5bf742[_0x2bf9f1(0xfa)];let _0x24e229=this[_0x2bf9f1(0x1b9)]['transformService'][_0x2bf9f1(0x133)](_0x5bf742[_0x2bf9f1(0x1c4)],_0x146096,!0x1);if(!_0x318500(_0x24e229))return this['_setTransformConflict'](_0x2bf9f1(0x122),_0x24e229[_0x2bf9f1(0x186)]),null;_0x146096=_0x24e229[_0x2bf9f1(0xfa)],_0x319f92[_0x2bf9f1(0xdc)](_0x49c5bb({..._0x160232,'mutations':_0x24e229[_0x2bf9f1(0x1c4)]}));}let _0x2c8f51=await this[_0x2bf9f1(0x18e)](this[_0x2bf9f1(0x131)],_0x319f92);return this[_0x2bf9f1(0xc9)][_0x2bf9f1(0x190)](_0x146096['map'](_0x2ffc6e)),this[_0x2bf9f1(0x131)]=_0x2c8f51,{'awaitingMutations':_0x9a863e[_0x2bf9f1(0x168)](_0x2ffc6e),'revision':_0x2c8f51};}['_setTransformConflict'](_0x557d33,_0x29cdf5){const _0x23ef01=_0x1482ee;this[_0x23ef01(0x12b)]={'message':_0x29cdf5[_0x23ef01(0xb9)],'operation':_0x557d33,'reason':_0x23ef01(0x176)};}async[_0x1482ee(0x18e)](_0x4c2035,_0x3d263b){const _0x42c8e9=_0x1482ee;try{return await this['_capture'][_0x42c8e9(0x111)](async()=>B(this['_kernel'],this[_0x42c8e9(0x15d)],this[_0x42c8e9(0xee)],_0x4c2035,_0x3d263b,_0x42c8e9(0x1d8)));}catch(_0x1b81c0){return await this[_0x42c8e9(0x184)](_0x1b81c0);}}async[_0x1482ee(0x184)](_0x918fdd){const _0x2afcc5=_0x1482ee;this[_0x2afcc5(0x1f8)]=!0x1,this['_closePromise']??=this['_closeOwnedResources']();try{await this[_0x2afcc5(0xb1)];}catch{}throw _0x918fdd;}[_0x1482ee(0x19b)](_0x28221d){const _0xa05013=_0x1482ee;let _0x4335c6=_0x28221d['at'](-0x1)?.[_0xa05013(0xea)];if(_0x4335c6===void 0x0||this[_0xa05013(0x192)][_0xa05013(0x1a3)]===0x0)return;let _0x5023ce=this[_0xa05013(0x192)][_0xa05013(0x1d6)](({revision:_0x543a08})=>_0x543a08>_0x4335c6),_0x3e6231=this['_bufferedChangesets'][_0xa05013(0x109)](0x0,_0x5023ce===-0x1?this['_bufferedChangesets']['length']:_0x5023ce);for(let _0x5071d1 of _0x3e6231){let _0x204a3c=_0x28221d['find'](({revision:_0x240156})=>_0x240156===_0x5071d1[_0xa05013(0xea)]);if(!_0x204a3c||!pe(_0x5071d1,_0x204a3c))throw new j(_0xa05013(0xd6),_0xa05013(0xe6));}this['_bufferedChangesets'][_0xa05013(0xd4)](0x0,_0x3e6231[_0xa05013(0x1a3)]);}[_0x1482ee(0x1c2)](_0x450825){const _0x52a2dc=_0x1482ee;return this[_0x52a2dc(0x137)]()||this[_0x52a2dc(0xbb)][_0x52a2dc(0x17b)](async()=>{const _0x5823f8=_0x52a2dc;_0x450825[_0x5823f8(0x1a7)]===_0x5823f8(0x9b)&&this['_assertMutableState'](_0x5823f8(0x9b));let _0x48d331=this[_0x5823f8(0xc9)][_0x5823f8(0x10a)]['length'],_0x5584ec=P(await this[_0x5823f8(0x1db)][_0x5823f8(0x1c2)](_0x450825[_0x5823f8(0x1a4)],_0x450825[_0x5823f8(0x1a7)]));return _0x450825['mode']===_0x5823f8(0x17e)?{'state':this[_0x5823f8(0x1f5)](),'value':_0x5584ec}:{'mutations':this['_capture'][_0x5823f8(0xfe)](_0x48d331),'state':this[_0x5823f8(0x1f5)](),'value':_0x5584ec};});}[_0x1482ee(0x114)](_0x38fd40){const _0x4452cf=_0x1482ee;return this['_rejectIfNotAccepting']()||this[_0x4452cf(0xbb)]['run'](async()=>{const _0x128ad8=_0x4452cf;if(this[_0x128ad8(0xdf)](_0x128ad8(0x102)),this['_awaiting']!==null)throw new j('COLLABORATION_INVALID_INPUT',_0x128ad8(0x199));let _0x3f251f=me(_0x38fd40),_0x159cc3=[...this[_0x128ad8(0xc9)]['pending']];this[_0x128ad8(0xc9)][_0x128ad8(0x190)](_0x3f251f);let _0x458e76=this['getState']();return{'pendingMutationCount':_0x3f251f[_0x128ad8(0x1a3)],'previousMutationCount':_0x159cc3[_0x128ad8(0x1a3)],'state':_0x458e76};});}['exportUnitData'](){const _0x357c20=_0x1482ee;return this[_0x357c20(0x137)]()||this[_0x357c20(0xbb)][_0x357c20(0x17b)](async()=>V(this[_0x357c20(0x120)],this[_0x357c20(0x15d)],this[_0x357c20(0xee)]));}[_0x1482ee(0x10f)](){const _0x240936=_0x1482ee;return this[_0x240936(0xb1)]?this[_0x240936(0xb1)]:(this[_0x240936(0x1f8)]=!0x1,this[_0x240936(0xb1)]=this[_0x240936(0xbb)][_0x240936(0x17b)](async()=>await this['_closeOwnedResources']()),this[_0x240936(0xb1)]);}async['_closeOwnedResources'](){const _0x9959f2=_0x1482ee;try{this['_capture']['dispose'](),await this['_handle'][_0x9959f2(0x10f)]();}finally{try{this['_univer'][_0x9959f2(0xed)]();}finally{this[_0x9959f2(0x1ba)]=!0x0;}}}[_0x1482ee(0x137)](){const _0x18c9ee=_0x1482ee;return this[_0x18c9ee(0x1f8)]?null:Promise[_0x18c9ee(0x1a1)](new j('COLLABORATION_CLOSED',_0x18c9ee(0x1e2)));}[_0x1482ee(0xdf)](_0x37cf92){const _0x5d5c90=_0x1482ee;if(this[_0x5d5c90(0x12b)]!==null)throw new j(_0x5d5c90(0x202),_0x5d5c90(0x1ea)+_0x37cf92+_0x5d5c90(0xb4));}};function _0x287b(){const _0x33e252=['createWorkbook','data','formula.mutation.set-formula-data','actions','waitForSubmission','_connection','size','Unsupported\x20collaboration\x20Unit\x20type:\x20','\x20cannot\x20call\x20','Checkpoint\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','backend','2277399YiccOc','maxCodeLength\x20must\x20be\x20a\x20positive\x20safe\x20integer','rejected','flatMap','write','commandService','_setTransformConflict','UNIVER_BOARD','createBoard','_ensureConnected','ACK\x20revision\x20does\x20not\x20follow\x20the\x20applied\x20confirmed\x20revision','Checkpoint\x20Unit\x20type\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20type','instanceService','catch','timeout','_reconcilePrecedingChangesets','addEventListener','2706066AYaOLv','LEAVE','71476RyWPYT','Snapshot\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','type','_joined','snapshotServerService','Backend\x20latest\x20revision\x20does\x20not\x20match\x20its\x20continuous\x20changeset\x20range','COMMAND','_closePromise','acceptedChangeset','MUTATION','\x20after\x20the\x20collaboration\x20runtime\x20entered\x20conflict','_handleMessage','mutations','object','JOIN','message','reason','_operations','_stopHeartbeat','24FNBMJW','trigger','rev','changeset','onStarting','unitID','getBase','_lease','application/json','http:','changeset_ack','HELLO','_capture','accepted','delete','ticket','GET','376386zVPIPR','subscribe','COLLABORATION_LOAD_FAILED','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20is\x20not\x20supported\x20by\x20this\x20runtime','sheets','then','splice','Code\x20is\x20longer\x20than\x20the\x20','COLLABORATION_PROTOCOL_ERROR','Backend\x20returned\x20a\x20non-contiguous\x20changeset\x20range','getBoard','Snapshot\x20block\x20','changesets','_socket','push','closed','COMPRESS_MUTATION_SEND','_assertMutableState','all','permission_rej','takePending','_createAwaitingFromPending','acquire','bind','Buffered\x20changeset\x20does\x20not\x20match\x20the\x20canonical\x20preceding\x20changeset','permission-denied','\x20})();','searchParams','revision','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20pulled\x20in\x20place','Collaboration\x20runtime\x20result\x20must\x20be\x20JSON-compatible','dispose','unitType','finally','_release','fromCollab','7kxfDgN','Runtime\x20for\x20','prependPending','set','\x20must\x20be\x20an\x20absolute\x20URL','disposeUnit','return\x20(async\x20()\x20=>\x20{\x20','maxCodeLength','m2Prime','ack','Backend\x20returned\x20an\x20ACK\x20whose\x20mutations\x20do\x20not\x20match\x20the\x20submitted\x20changeset','base64','snapshotFrom','Event','snapshotServerUrl','unit','replace\x20mutations','eventID','Snapshot\x20Unit\x20identity\x20does\x20not\x20match\x20the\x20requested\x20Unit','collabSubmitChangesetUrl','COLLABORATION_UNAVAILABLE','https:','23595120fFygWt','slice','pending','leases','\x20character\x20limit','_sid','Confirmed\x20changeset\x20history\x20is\x20not\x20contiguous','close','Collaboration\x20HTTP\x20response\x20is\x20not\x20valid\x20JSON','suppress','Snapshot\x20contains\x20duplicate\x20block\x20ids','docStateChange$','replacePendingMutations','_awaiting','fromChangeset','pull-required','_config','up-to-date','getDocument','json','pathname','_failCommandWaiters','compressMutationService','\x20for\x20Unit\x20','_univer','_memberId','commit','new_changes','Manual\x20collaboration\x20plugin\x20did\x20not\x20reach\x20the\x20Starting\x20lifecycle','race','getInterceptPoints','latestRevision','commitTimeoutMs','No\x20active\x20Unit\x20leases','result','_conflict','Backend\x20returned\x20an\x20ACK\x20that\x20does\x20not\x20match\x20the\x20submitted\x20changeset','_requestCommand','some','Changeset\x20submission\x20was\x20rejected','fetchThroughInterceptors','_baseRevision','string','transformMutations','fetchmissing','Backend\x20failed\x20to\x20close\x20the\x20initial\x20revision\x20gap','_injector','_rejectIfNotAccepting','SnapshotService\x20is\x20not\x20ready\x20until\x20the\x20Univer\x20factory\x20has\x20returned','_target','wss:','getSheetBlock','UNIVER_SHEET','new_changesets','waitForLatestApplied','readyState','has','Session\x20ticket\x20request\x20failed\x20with\x20HTTP\x20','Collaboration\x20WebSocket\x20is\x20not\x20online','OPEN','entries','Failed\x20to\x20establish\x20Collaboration\x20WebSocket','incrementRevOfUnit','send','Awaiting\x20changeset\x20echo\x20does\x20not\x20match\x20the\x20transformed\x20local\x20mutations','Read\x20execution\x20cannot\x20run\x20persistable\x20action\x20','originalMeta','Failed\x20to\x20open\x20the\x20collaboration\x20backend','Connection\x20timed\x20out','_knownHeadRevision','routeKey','_validateAcceptedChangeset','Collaboration\x20WebSocket\x20closed','_handle','_submissionWaiters','pluginName','sheet.mutation.send-init-pivot-text-local','replace','kind','Changeset\x20submission\x20was\x20denied','httpRequest','open','retryable','clear','block','unitId','takeInboundChangesets','protocol','permissionRejEvent','save','sid','join','_pending','UNIVER_CLI_SDK_MANUAL_COLLABORATION_PLUGIN','revisionService','\x20request\x20is\x20already\x20active\x20for\x20','map','get','1149992LDRIaf','initial','commitTimeoutMs\x20must\x20be\x20a\x20positive\x20safe\x20integer','timer','injector','permission','unchanged','min','promise','Single-Unit\x20runtime\x20for\x20','HEARTBEAT','_heartbeat','transform-failed','CollaborationRuntimeError','1711494fZOTZM','reqId','infoRsp','run','pull','invalid','read','transformService','memberID','createUnit','unknown','Sheet-shaped\x20snapshot\x20is\x20missing\x20workbook\x20metadata','_closeAfterFatalError','wsSessionTicketUrl','error','isArray','\x20returned\x20a\x20different\x20block\x20identity','confirmed','_captureCommandMutation','_waitForSubmission','number','UNIVER_DOC','_replayRemoteChangesets','fetched','replacePending','_join','_bufferedChangesets','memberId','from','Collaboration\x20HELLO\x20response\x20is\x20invalid','RECV','UNIVER_SLIDE','Failed\x20to\x20create\x20the\x20collaboration\x20runtime','Cannot\x20replace\x20mutations\x20after\x20a\x20changeset\x20is\x20awaiting\x20confirmation','cmd','_consumeBufferedPrecedingChangesets','permission-rejected','_scheduleReconnect','every','univerAPI','_unitId','reject','redoState','length','code','getUnitData','trim','mode','awaiting-ack','getPendingMutations','_fetchChangesets','stringify','getConnectionState','changeset_should_retry','_state','BeforeCommandExecute','UNIVER_BASE','csAckEvent','Heartbeat\x20failed','formula.mutation.set-calculation-result','index','unitData','invalid-changeset','_startHeartbeat','collabWebSocketUrl','_kernel','_closed','boolean','_connect','fetchChangesets','_commandWaiters','invalid-revision','removeEventListener','unit-data','execute','Collaboration\x20HTTP\x20request\x20failed\x20with\x20status\x20','m1Prime','\x20uses\x20an\x20unsupported\x20protocol','conflict','changeset-rejected','Timed\x20out\x20establishing\x20Collaboration\x20WebSocket','_subscribeToDocumentState','Failed\x20to\x20transform\x20the\x20Unit\x20snapshot','_reconnectTimer','260EaBuQA','Backend\x20returned\x20no\x20Unit\x20snapshot','registerPlugin','_inbound','resolve','formula.mutation.set-trigger-formula-calculation','csRejEvent','COMPRESS_MUTATION_APPLY','name','unsubscribe','findIndex','Backend\x20changesets\x20must\x20be\x20an\x20array','remote','cancel','_handleCollaborationEvent','_executor','collaMsg','commandId','_connectPromise','fetch','values','_suppressionDepth','Collaboration\x20runtime\x20is\x20closing\x20or\x20closed','submitChangeset','\x20is\x20unavailable','precedingChangesets','status','\x20cannot\x20capture\x20mutation\x20','sort','ws:','Cannot\x20','Backend\x20failed\x20to\x20fetch\x20changesets','max','getUnitOnRev','POST','snapshot','add','doc','isSafeInteger','interceptor','baseRev','getState','_tail','offline','_acceptingOperations','_disposables','workbook','addEvent','getPrototypeOf','Univer\x20revision\x20did\x20not\x20advance\x20to\x20the\x20confirmed\x20changeset\x20revision','_reconnectAttempts','Session\x20ticket\x20response\x20is\x20missing\x20a\x20ticket','isFinite','retry','COLLABORATION_INVALID_INPUT','online'];_0x287b=function(){return _0x33e252;};return _0x287b();}function U(_0xabffa6){const _0x21a36e=_0x1482ee;return{'baseRevision':_0xabffa6[_0x21a36e(0x1f4)],'mutationCount':_0xabffa6['mutations'][_0x21a36e(0x1a3)],'reqId':_0xabffa6[_0x21a36e(0x179)],'revision':0x0,'sid':_0xabffa6[_0x21a36e(0x162)]};}function W(_0x3f00af,_0x1e9019,_0x2ca3d5,_0x50c9ac){return _0x574ea1({'baseRev':_0x50c9ac,'memberID':'','mutations':[..._0x3f00af],'revision':0x0,'type':_0x2ca3d5,'unitID':_0x1e9019,'userID':''})['mutations'];}function pe(_0x35f266,_0x208613){const _0xb5c5fb=_0x1482ee;return _0x35f266[_0xb5c5fb(0xc2)]===_0x208613[_0xb5c5fb(0xc2)]&&_0x35f266[_0xb5c5fb(0xac)]===_0x208613[_0xb5c5fb(0xac)]&&_0x35f266[_0xb5c5fb(0x1f4)]===_0x208613[_0xb5c5fb(0x1f4)]&&_0x35f266[_0xb5c5fb(0xea)]===_0x208613[_0xb5c5fb(0xea)]&&_0x35f266[_0xb5c5fb(0x162)]===_0x208613[_0xb5c5fb(0x162)]&&_0x35f266['reqId']===_0x208613['reqId']&&JSON['stringify'](_0x35f266[_0xb5c5fb(0xb6)])===JSON['stringify'](_0x208613[_0xb5c5fb(0xb6)]);}function G(_0x1e3001,_0x10ed56){const _0x39e09a=_0x1482ee;return _0x1e3001['length']===_0x10ed56[_0x39e09a(0x1a3)]&&_0x1e3001[_0x39e09a(0x19e)]((_0x56a1b3,_0x165b52)=>_0x56a1b3['id']===_0x10ed56[_0x165b52]?.['id']&&_0x56a1b3[_0x39e09a(0x205)]===_0x10ed56[_0x165b52]?.[_0x39e09a(0x205)]);}function me(_0x17a39a){const _0x1baf79=_0x1482ee;if(!Array[_0x1baf79(0x187)](_0x17a39a))throw new j(_0x1baf79(0x202),'Replacement\x20mutations\x20must\x20be\x20an\x20array');return _0x17a39a['map'](_0x196632=>{const _0x4c3c78=_0x1baf79;if(!_0x196632||typeof _0x196632!=_0x4c3c78(0xb7)||typeof _0x196632['id']!=_0x4c3c78(0x132)||_0x196632['id'][_0x4c3c78(0x1a3)]===0x0||typeof _0x196632[_0x4c3c78(0x205)]!=_0x4c3c78(0x132))throw new j(_0x4c3c78(0x202),'Replacement\x20mutations\x20must\x20contain\x20non-empty\x20id\x20and\x20string\x20data\x20fields');return{'data':_0x196632[_0x4c3c78(0x205)],'id':_0x196632['id']};});}var K=class extends _0x5a4b2b{[_0x1482ee(0x118)];[_0x1482ee(0x136)];static [_0x1482ee(0x153)]=_0x1482ee(0x165);constructor(_0x393817,_0x30ec4b){const _0x469409=_0x1482ee;super(),this[_0x469409(0x118)]=_0x393817,this[_0x469409(0x136)]=_0x30ec4b;}[_0x1482ee(0xc1)](){const _0xab6ae6=_0x1482ee;this[_0xab6ae6(0x118)]['snapshotServerService']!==void 0x0&&_0x4fdc5e(this[_0xab6ae6(0x136)],[[_0x56efa7,{'useValue':this[_0xab6ae6(0x118)][_0xab6ae6(0xae)]}]]),this[_0xab6ae6(0x118)][_0xab6ae6(0xc1)]({'commandService':this[_0xab6ae6(0x136)][_0xab6ae6(0x169)](_0x38e832),'compressMutationService':this[_0xab6ae6(0x136)][_0xab6ae6(0x169)](_0x883255),'instanceService':this[_0xab6ae6(0x136)][_0xab6ae6(0x169)](_0x43b472),'injector':this[_0xab6ae6(0x136)],'revisionService':this[_0xab6ae6(0x136)][_0xab6ae6(0x169)](_0x18e322),'transformService':this[_0xab6ae6(0x136)][_0xab6ae6(0x169)](_0x140dc4)});}};K=_0x4679aa([_0x5484e2(_0x21f34a),_0x274a5e(0x1,_0x3d53db(_0x2d7cf3))],K);function he(_0x39e9a0,_0x23c96e){const _0x57746b=_0x1482ee;let _0x1481d7;if(_0x39e9a0[_0x57746b(0x1ce)](K,{'onStarting'(_0x5e0d18){_0x1481d7=_0x5e0d18;},..._0x23c96e===void 0x0?{}:{'snapshotServerService':_0x23c96e}}),!_0x1481d7)throw Error(_0x57746b(0x124));return _0x1481d7;}async function ge(_0x316ca3,_0x2d17ff,_0x1abb48){const _0x3f1f13=_0x1482ee;let _0x3ef574=await _0x316ca3['getUnitOnRev'](0x0);if(_0x279d4e(_0x3ef574[_0x3f1f13(0x186)])){let _0x12f66f=_0x3ef574[_0x3f1f13(0x186)];throw new j(_0x3f1f13(0xd0),_0x12f66f?.[_0x3f1f13(0xb9)]||'Backend\x20failed\x20to\x20load\x20the\x20Unit\x20snapshot');}let _0x4f79b7=_0x3ef574[_0x3f1f13(0x1ef)];if(!_0x4f79b7)throw new j(_0x3f1f13(0xd0),_0x3f1f13(0x1cd));_e(_0x4f79b7,_0x2d17ff,_0x1abb48);try{switch(_0x1abb48){case _0x2706d9['UNIVER_SHEET']:return{'changesets':_0x3ef574['changesets'],'unitData':await _0x5f373c(_0x4f79b7,await q(_0x316ca3,_0x4f79b7)),'unitType':_0x1abb48};case _0x2706d9[_0x3f1f13(0x18d)]:return{'changesets':_0x3ef574['changesets'],'unitData':_0xbc816c(_0x4f79b7),'unitType':_0x1abb48};case _0x2706d9[_0x3f1f13(0x197)]:return{'changesets':_0x3ef574['changesets'],'unitData':_0xa6a84a(_0x4f79b7),'unitType':_0x1abb48};case _0x2706d9[_0x3f1f13(0x1b0)]:return{'changesets':_0x3ef574['changesets'],'unitData':await _0x3e51e0(_0x4f79b7,await q(_0x316ca3,_0x4f79b7)),'unitType':_0x1abb48};case _0x2706d9[_0x3f1f13(0x9e)]:return{'changesets':_0x3ef574['changesets'],'unitData':_0x170d99(_0x4f79b7),'unitType':_0x1abb48};default:throw new j(_0x3f1f13(0x202),_0x3f1f13(0x93)+_0x1abb48);}}catch(_0x3e9481){throw _0x3e9481 instanceof j?_0x3e9481:new j(_0x3f1f13(0xd0),_0x3f1f13(0x1ca),{'cause':_0x3e9481});}}function _e(_0x76edec,_0x162026,_0x141a20){const _0x549aa6=_0x1482ee;if(_0x76edec[_0x549aa6(0xc2)]!==_0x162026||_0x76edec['type']!==_0x141a20)throw new j(_0x549aa6(0xd0),_0x549aa6(0x104));if(!Number[_0x549aa6(0x1f2)](_0x76edec[_0x549aa6(0xbf)])||_0x76edec[_0x549aa6(0xbf)]<0x1)throw new j('COLLABORATION_LOAD_FAILED',_0x549aa6(0xab));}async function q(_0x172036,_0xff5c52){const _0x328264=_0x1482ee;let _0x40d8f2=_0xff5c52['workbook'];if(!_0x40d8f2)throw new j(_0x328264(0xd0),_0x328264(0x183));let _0x4d4a23=Object[_0x328264(0x1e0)](_0x40d8f2['blockMeta'])[_0x328264(0x9a)](({blocks:_0x4d3f38})=>_0x4d3f38);if(new Set(_0x4d4a23)[_0x328264(0x92)]!==_0x4d4a23[_0x328264(0x1a3)])throw new j('COLLABORATION_LOAD_FAILED',_0x328264(0x112));return await Promise[_0x328264(0xe0)](_0x4d4a23[_0x328264(0x168)](async _0x48f55c=>{const _0x4e7425=_0x328264;let _0x9e78ba=await _0x172036[_0x4e7425(0x13b)](_0x48f55c);if(_0x279d4e(_0x9e78ba[_0x4e7425(0x186)])||!_0x9e78ba[_0x4e7425(0x15c)])throw new j('COLLABORATION_LOAD_FAILED',_0x9e78ba[_0x4e7425(0x186)]?.[_0x4e7425(0xb9)]||'Snapshot\x20block\x20'+_0x48f55c+_0x4e7425(0x1e4));if(_0x9e78ba[_0x4e7425(0x15c)]['id']!==_0x48f55c)throw new j('COLLABORATION_LOAD_FAILED',_0x4e7425(0xd9)+_0x48f55c+_0x4e7425(0x188));return _0x9e78ba[_0x4e7425(0x15c)];}));}function ve(_0x787321){const _0x8b7ee9=_0x1482ee;let _0x1cd529=_0x787321[_0x8b7ee9(0xf9)]??0xa00000;if(!Number[_0x8b7ee9(0x1f2)](_0x1cd529)||_0x1cd529<=0x0)throw new j(_0x8b7ee9(0x202),_0x8b7ee9(0x98));return{async 'load'(_0x3ea66a,_0x2786cd){const _0x1fd9c4=_0x8b7ee9;be(_0x3ea66a,_0x2786cd);let _0x13297c,_0x51fb11={'unitId':_0x3ea66a,'unitType':_0x2786cd},_0x4892bf={'unitId':_0x3ea66a,'unitType':_0x2786cd,..._0x787321[_0x1fd9c4(0xae)]===void 0x0?{}:{'resolveSnapshotService':()=>{const _0x551877=_0x1fd9c4;if(_0x13297c===void 0x0)throw new j(_0x551877(0xd0),_0x551877(0x138));return _0x13297c;}}},_0x35ef52;try{_0x35ef52=await _0x787321[_0x1fd9c4(0x96)]['open'](_0x51fb11);}catch(_0x848559){throw new j(_0x1fd9c4(0x106),_0x1fd9c4(0x14b),{'cause':_0x848559,'retryable':!0x0});}let _0xc10a94;try{_0xc10a94=await _0x787321['createUniver'](_0x4892bf);let _0x32b462=he(_0xc10a94,_0x787321['snapshotServerService']);_0x787321['snapshotServerService']!==void 0x0&&(_0x13297c=_0x32b462[_0x1fd9c4(0x16e)][_0x1fd9c4(0x169)](_0x50e6cf));let _0x19dd2c=await xe(_0x35ef52,_0x3ea66a,_0x2786cd);Se(_0x19dd2c,_0x51fb11),Ce(_0xc10a94,_0x19dd2c);let _0x52a5aa=B(_0x32b462,_0x3ea66a,_0x2786cd,J(_0x19dd2c[_0x1fd9c4(0x1b5)]),_0x19dd2c[_0x1fd9c4(0xda)]),_0x3d0bf1=await _0x35ef52[_0x1fd9c4(0x1bd)](_0x52a5aa,void 0x0);if(_0x279d4e(_0x3d0bf1[_0x1fd9c4(0x186)])){let _0x20ea9d=_0x3d0bf1[_0x1fd9c4(0x186)];throw new j(_0x1fd9c4(0x106),_0x20ea9d?.[_0x1fd9c4(0xb9)]||_0x1fd9c4(0x135),{'retryable':!0x0});}let _0x38beff=R(_0x3d0bf1[_0x1fd9c4(0xda)],_0x3ea66a,_0x2786cd,_0x52a5aa),_0xf0b75d=_0x38beff['at'](-0x1)?.[_0x1fd9c4(0xea)]??_0x52a5aa;if(_0x3d0bf1[_0x1fd9c4(0x127)]!==void 0x0&&_0x3d0bf1['latestRevision']!==_0xf0b75d)throw new j(_0x1fd9c4(0xd6),'Backend\x20latest\x20revision\x20does\x20not\x20match\x20the\x20initial\x20continuous\x20changeset\x20range');return _0x52a5aa=B(_0x32b462,_0x3ea66a,_0x2786cd,_0x52a5aa,_0x38beff),await ye(_0x32b462),new fe(_0x3ea66a,_0x2786cd,_0x52a5aa,_0x35ef52,_0xc10a94,_0x32b462,_0x1cd529);}catch(_0x5177ae){try{await _0x35ef52[_0x1fd9c4(0x10f)]();}catch{}try{_0xc10a94?.[_0x1fd9c4(0xed)]();}catch{}throw _0x5177ae instanceof j?_0x5177ae:new j(_0x1fd9c4(0xd0),_0x1fd9c4(0x198),{'cause':_0x5177ae});}}};}async function ye(_0x89d6c8){const _0x251079=_0x1482ee;_0x89d6c8[_0x251079(0x16e)][_0x251079(0x140)](_0x6823bc)&&await _0x89d6c8[_0x251079(0x16e)][_0x251079(0x169)](_0x6823bc)[_0x251079(0x13e)]();}function be(_0x2ba8a1,_0x599a8b){const _0x39d826=_0x1482ee;if(_0x2ba8a1[_0x39d826(0x1a6)]()[_0x39d826(0x1a3)]===0x0)throw new j(_0x39d826(0x202),'unitId\x20must\x20not\x20be\x20empty');if(_0x599a8b!==_0x2706d9[_0x39d826(0x13c)]&&_0x599a8b!==_0x2706d9[_0x39d826(0x18d)]&&_0x599a8b!==_0x2706d9[_0x39d826(0x197)]&&_0x599a8b!==_0x2706d9[_0x39d826(0x1b0)]&&_0x599a8b!==_0x2706d9[_0x39d826(0x9e)])throw new j(_0x39d826(0x202),'Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0x599a8b);}async function xe(_0x1a7534,_0xbb9f67,_0x3ecf0c){const _0x156959=_0x1482ee;return _0x1a7534['format']===_0x156959(0x1c1)?await _0x1a7534[_0x156959(0x1a5)]():await ge(_0x1a7534,_0xbb9f67,_0x3ecf0c);}function Se(_0x1a3a9e,_0x2de03c){const _0x3a3610=_0x1482ee;if(_0x1a3a9e[_0x3a3610(0xee)]!==_0x2de03c[_0x3a3610(0xee)])throw new j(_0x3a3610(0xd0),_0x3a3610(0xa2));if(_0x1a3a9e[_0x3a3610(0x1b5)]['id']!==_0x2de03c[_0x3a3610(0x15d)])throw new j(_0x3a3610(0xd0),'Checkpoint\x20Unit\x20id\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20id');J(_0x1a3a9e[_0x3a3610(0x1b5)]);}function J(_0x31ce04){const _0x237bfe=_0x1482ee;let _0x405f07=_0x31ce04['rev'];if(!Number[_0x237bfe(0x1f2)](_0x405f07)||_0x405f07===void 0x0||_0x405f07<0x1)throw new j('COLLABORATION_LOAD_FAILED',_0x237bfe(0x95));return _0x405f07;}function Ce(_0x38f4d3,_0x50392c){const _0x2fac98=_0x1482ee;switch(_0x50392c[_0x2fac98(0xee)]){case _0x2706d9[_0x2fac98(0x13c)]:_0x38f4d3[_0x2fac98(0x181)](_0x50392c[_0x2fac98(0xee)],structuredClone(_0x50392c['unitData']));return;case _0x2706d9[_0x2fac98(0x18d)]:_0x38f4d3['createUnit'](_0x50392c[_0x2fac98(0xee)],structuredClone(_0x50392c[_0x2fac98(0x1b5)]));return;case _0x2706d9['UNIVER_SLIDE']:_0x38f4d3[_0x2fac98(0x181)](_0x50392c[_0x2fac98(0xee)],structuredClone(_0x50392c[_0x2fac98(0x1b5)]));return;case _0x2706d9[_0x2fac98(0x1b0)]:_0x38f4d3[_0x2fac98(0x181)](_0x50392c[_0x2fac98(0xee)],structuredClone(_0x50392c[_0x2fac98(0x1b5)]));return;case _0x2706d9[_0x2fac98(0x9e)]:_0x38f4d3[_0x2fac98(0x181)](_0x50392c[_0x2fac98(0xee)],structuredClone(_0x50392c['unitData']));return;}}var we=class{[_0x1482ee(0x118)];['_target'];[_0x1482ee(0xc4)];['format']=_0x1482ee(0x1ef);constructor(_0x1fdba4,_0x3af239,_0x35cb1d){const _0x54dff0=_0x1482ee;this[_0x54dff0(0x118)]=_0x1fdba4,this[_0x54dff0(0x139)]=_0x3af239,this[_0x54dff0(0xc4)]=_0x35cb1d;}[_0x1482ee(0x1ac)](){const _0x1096eb=_0x1482ee;return this[_0x1096eb(0xc4)]['getConnectionState']();}async[_0x1482ee(0x1ed)](_0xe5ceee=0x0){const _0x1eb1e3=_0x1482ee;let _0x80b296=X(this[_0x1eb1e3(0x118)][_0x1eb1e3(0x100)],this[_0x1eb1e3(0x139)][_0x1eb1e3(0xee)],_0x1eb1e3(0x101),this[_0x1eb1e3(0x139)][_0x1eb1e3(0x15d)],_0x1eb1e3(0xbf),_0xe5ceee),_0x20f5b5=await Y(this[_0x1eb1e3(0x118)],_0x80b296);return Te(_0x20f5b5[_0x1eb1e3(0x1ef)]),_0x20f5b5;}async[_0x1482ee(0x13b)](_0xb89b89){const _0x1bdf3d=_0x1482ee;let _0x28c97b=X(this['_config'][_0x1bdf3d(0x100)],this['_target'][_0x1bdf3d(0xee)],_0x1bdf3d(0x101),this[_0x1bdf3d(0x139)][_0x1bdf3d(0x15d)],_0x1bdf3d(0x15c),_0xb89b89),_0xdb7471=await Y(this[_0x1bdf3d(0x118)],_0x28c97b);return _0xdb7471['block']&&typeof _0xdb7471[_0x1bdf3d(0x15c)]['data']=='string'&&(_0xdb7471[_0x1bdf3d(0x15c)][_0x1bdf3d(0x205)]=Z(_0xdb7471[_0x1bdf3d(0x15c)][_0x1bdf3d(0x205)])),_0xdb7471;}async[_0x1482ee(0x1bd)](_0x28e390,_0x1654fe=0x0){const _0x572d56=_0x1482ee;let _0x366c85=X(this['_config'][_0x572d56(0x100)],this[_0x572d56(0x139)]['unitType'],_0x572d56(0x101),this[_0x572d56(0x139)]['unitId'],_0x572d56(0x134));_0x366c85[_0x572d56(0xe9)][_0x572d56(0xf5)](_0x572d56(0x194),String(_0x28e390)),_0x366c85[_0x572d56(0xe9)][_0x572d56(0xf5)]('to',String(_0x1654fe));let _0x357813=await Y(this[_0x572d56(0x118)],_0x366c85);return this[_0x572d56(0xc4)][_0x572d56(0x15e)](),_0x357813;}async[_0x1482ee(0x1e3)](_0x30f3ab){const _0x1618bd=_0x1482ee;await this['_lease']['ensureOnline']();let _0x1a93fa=this[_0x1618bd(0xc4)][_0x1618bd(0x208)](_0x30f3ab['sid'],_0x30f3ab['reqId']),_0x198828={..._0x30f3ab,'memberID':this[_0x1618bd(0xc4)][_0x1618bd(0x193)],'revision':0x0,'type':this[_0x1618bd(0x139)]['unitType'],'unitID':this[_0x1618bd(0x139)][_0x1618bd(0x15d)],'userID':''},_0x3d7758=X(this[_0x1618bd(0x118)][_0x1618bd(0x105)],this['_target'][_0x1618bd(0xee)],'unit',this[_0x1618bd(0x139)][_0x1618bd(0x15d)],_0x1618bd(0x123)),_0x532527=this[_0x1618bd(0x118)][_0x1618bd(0x158)](_0x3d7758,{'body':JSON[_0x1618bd(0x1ab)]({'changeset':_0x198828,'memberID':this[_0x1618bd(0xc4)][_0x1618bd(0x193)],'type':this['_target']['unitType'],'unitID':this['_target']['unitId']}),'headers':{'content-type':_0x1618bd(0xc5)},'method':_0x1618bd(0x1ee)})[_0x1618bd(0xd3)](async _0x5e29cb=>_0x5e29cb[_0x1618bd(0x1e6)]===0x191||_0x5e29cb[_0x1618bd(0x1e6)]===0x193?_0x1618bd(0x16f):_0x5e29cb[_0x1618bd(0x1e6)]===0x190||_0x5e29cb[_0x1618bd(0x1e6)]===0x199?_0x1618bd(0x17d):_0x5e29cb['ok']?_0x1618bd(0xca):_0x1618bd(0x182))[_0x1618bd(0xa4)](()=>_0x1618bd(0x182)),_0x27985d=Ee(this['_config'][_0x1618bd(0x128)]),_0x152198=_0x532527[_0x1618bd(0xd3)](_0x28c3f5=>_0x28c3f5===_0x1618bd(0x16f)?{'status':'permission-rejected'}:_0x28c3f5===_0x1618bd(0x17d)?{'status':'changeset-rejected'}:new Promise(()=>void 0x0)),_0x3d5c48=await Promise[_0x1618bd(0x125)]([_0x1a93fa[_0x1618bd(0x172)],_0x152198,_0x27985d[_0x1618bd(0x172)]['then'](()=>({'status':_0x1618bd(0xa5)}))])[_0x1618bd(0xef)](()=>{const _0x596da3=_0x1618bd;_0x1a93fa[_0x596da3(0x1d9)](),_0x27985d['cancel']();});if(_0x3d5c48[_0x1618bd(0x1e6)]===_0x1618bd(0xa5)){let _0x3cbdb2=await _0x532527;return _0x3cbdb2==='permission'?{'message':_0x1618bd(0x157),'reason':_0x1618bd(0xe7),'status':_0x1618bd(0x99)}:_0x3cbdb2==='invalid'?{'message':_0x1618bd(0x12f),'reason':_0x1618bd(0x1b6),'status':'rejected'}:{'status':_0x1618bd(0x182)};}if(_0x3d5c48[_0x1618bd(0x1e6)]===_0x1618bd(0xdd))return{'status':'unknown'};if(_0x3d5c48[_0x1618bd(0x1e6)]==='retry')return{'status':_0x1618bd(0x201)};if(_0x3d5c48[_0x1618bd(0x1e6)]==='permission-rejected')return{'message':'Changeset\x20submission\x20was\x20denied','reason':_0x1618bd(0xe7),'status':_0x1618bd(0x99)};if(_0x3d5c48[_0x1618bd(0x1e6)]===_0x1618bd(0x1c7)){let _0x364bca=await this['fetchChangesets'](_0x30f3ab['baseRev'],_0x30f3ab['baseRev']);return{'message':_0x1618bd(0x12f),'reason':_0x364bca['latestRevision']!==void 0x0&&_0x364bca[_0x1618bd(0x127)]<_0x30f3ab[_0x1618bd(0x1f4)]?_0x1618bd(0x1bf):_0x1618bd(0x1b6),'status':'rejected'};}let _0x952b77=_0x3d5c48[_0x1618bd(0xc0)],_0x5b01eb=await this['fetchChangesets'](_0x30f3ab[_0x1618bd(0x1f4)],_0x952b77['revision']-0x1);if(_0x279d4e(_0x5b01eb['error'])){let _0x766fb6=_0x5b01eb['error'];throw new j(_0x1618bd(0x106),_0x766fb6?.[_0x1618bd(0xb9)]||'Failed\x20to\x20fetch\x20preceding\x20changesets',{'retryable':!0x0});}return{'acceptedChangeset':_0x952b77,'precedingChangesets':_0x5b01eb['changesets'],'status':_0x1618bd(0x189)};}async[_0x1482ee(0x10f)](){const _0x15764b=_0x1482ee;await this['_lease'][_0x15764b(0x10f)]();}};async function Y(_0x43c8da,_0xde85bf){const _0x1ee21e=_0x1482ee;let _0x166b79;try{_0x166b79=await _0x43c8da[_0x1ee21e(0x158)](_0xde85bf,{'method':_0x1ee21e(0xcd)});}catch(_0x5cc91a){throw new j(_0x1ee21e(0x106),'Collaboration\x20HTTP\x20request\x20failed',{'cause':_0x5cc91a,'retryable':!0x0});}if(!_0x166b79['ok'])throw new j(_0x1ee21e(0x106),_0x1ee21e(0x1c3)+_0x166b79[_0x1ee21e(0x1e6)],{'retryable':_0x166b79['status']>=0x1f4});try{return await _0x166b79[_0x1ee21e(0x11b)]();}catch(_0x2add52){throw new j(_0x1ee21e(0xd6),_0x1ee21e(0x110),{'cause':_0x2add52});}}function X(_0x218892,..._0x431f14){const _0x150eec=_0x1482ee;let _0x46c07b=new URL(_0x218892);return _0x46c07b[_0x150eec(0x11c)]=_0x46c07b[_0x150eec(0x11c)][_0x150eec(0x155)](/\/$/,'')+'/'+_0x431f14[_0x150eec(0x168)](_0x396719=>encodeURIComponent(String(_0x396719)))[_0x150eec(0x163)]('/'),_0x46c07b;}function Te(_0x5a708e){const _0x2746ed=_0x1482ee;if(!_0x5a708e)return;let _0x599a9c=[_0x5a708e[_0x2746ed(0x1fa)],_0x5a708e[_0x2746ed(0x1f1)],_0x5a708e['slide'],_0x5a708e['board']];for(let _0x1a786a of _0x599a9c)_0x1a786a&&typeof _0x1a786a[_0x2746ed(0x14a)]=='string'&&(_0x1a786a[_0x2746ed(0x14a)]=Z(_0x1a786a[_0x2746ed(0x14a)]));if(_0x5a708e['workbook']){for(let _0x2ca003 of Object[_0x2746ed(0x1e0)](_0x5a708e[_0x2746ed(0x1fa)][_0x2746ed(0xd2)]))typeof _0x2ca003[_0x2746ed(0x14a)]==_0x2746ed(0x132)&&(_0x2ca003[_0x2746ed(0x14a)]=Z(_0x2ca003[_0x2746ed(0x14a)]));}}function Z(_0x3037da){const _0x2416bc=_0x1482ee;return Uint8Array[_0x2416bc(0x194)](Buffer[_0x2416bc(0x194)](_0x3037da,_0x2416bc(0xfd)));}function Ee(_0x39516f){let _0x25fc3b;return{'cancel':()=>{_0x25fc3b!==void 0x0&&clearTimeout(_0x25fc3b);},'promise':new Promise(_0x4000b7=>{_0x25fc3b=setTimeout(_0x4000b7,_0x39516f);})};}var De=class{['_config'];[_0x1482ee(0x1ae)]=_0x1482ee(0x1f7);['_socket'];[_0x1482ee(0x1de)];[_0x1482ee(0x121)]='';['_joined']=new Map();[_0x1482ee(0x1be)]=new Map();['_submissionWaiters']=new Map();[_0x1482ee(0x1cf)]=new Map();[_0x1482ee(0x175)];[_0x1482ee(0x1cb)];[_0x1482ee(0x1fe)]=0x0;constructor(_0x63b627){const _0x2193a8=_0x1482ee;this[_0x2193a8(0x118)]=_0x63b627;}async[_0x1482ee(0xe4)](_0xb2dfdf){const _0x2938c8=_0x1482ee;let _0x4c8b99=this[_0x2938c8(0xad)][_0x2938c8(0x169)](_0xb2dfdf['unitId']);if(_0x4c8b99&&_0x4c8b99['target'][_0x2938c8(0xee)]!==_0xb2dfdf[_0x2938c8(0xee)])throw new j(_0x2938c8(0x202),'The\x20same\x20Unit\x20id\x20cannot\x20be\x20joined\x20with\x20two\x20Unit\x20types');if(await this[_0x2938c8(0xa0)](),_0x4c8b99)_0x4c8b99[_0x2938c8(0x10b)]+=0x1;else{try{await this[_0x2938c8(0x191)](_0xb2dfdf);}catch(_0x1cbf87){throw this[_0x2938c8(0xad)][_0x2938c8(0x92)]===0x0&&(this[_0x2938c8(0x1ae)]=_0x2938c8(0xdd),this[_0x2938c8(0xbc)](),this[_0x2938c8(0xdb)]?.['close'](0x3e8,'Initial\x20Unit\x20JOIN\x20failed'),this[_0x2938c8(0xdb)]=void 0x0,this[_0x2938c8(0x121)]=''),_0x1cbf87;}this[_0x2938c8(0xad)]['set'](_0xb2dfdf['unitId'],{'leases':0x1,'target':_0xb2dfdf});}let _0x29c62c=!0x1,_0x4b50c2=()=>this[_0x2938c8(0x121)],_0x5e1ba1=new Set();return{'close':async()=>{const _0x19e01e=_0x2938c8;if(!_0x29c62c){_0x29c62c=!0x0;for(let _0x5eaa6c of _0x5e1ba1)_0x5eaa6c[_0x19e01e(0x1d9)]();_0x5e1ba1[_0x19e01e(0x15b)](),await this[_0x19e01e(0xf0)](_0xb2dfdf['unitId']);}},'ensureOnline':async()=>await this[_0x2938c8(0xa0)](),'getConnectionState':()=>_0x29c62c?_0x2938c8(0xdd):this[_0x2938c8(0x1ae)],get 'memberId'(){return _0x4b50c2();},'takeInboundChangesets':()=>{const _0x1b34d5=_0x2938c8;let _0x2522bd=this[_0x1b34d5(0x1cf)]['get'](_0xb2dfdf[_0x1b34d5(0x15d)])??[];return this[_0x1b34d5(0x1cf)]['delete'](_0xb2dfdf['unitId']),_0x2522bd;},'waitForSubmission':(_0x43e075,_0x5e2fb8)=>{const _0x2e623f=_0x2938c8;let _0x3a251f=this[_0x2e623f(0x18b)](_0x43e075,_0x5e2fb8);return _0x5e1ba1[_0x2e623f(0x1f0)](_0x3a251f),_0x3a251f[_0x2e623f(0x172)][_0x2e623f(0xd3)](()=>_0x5e1ba1['delete'](_0x3a251f),()=>_0x5e1ba1[_0x2e623f(0xcb)](_0x3a251f)),{'cancel':()=>{const _0x2fb0f3=_0x2e623f;_0x5e1ba1[_0x2fb0f3(0xcb)](_0x3a251f),_0x3a251f[_0x2fb0f3(0x1d9)]();},'promise':_0x3a251f[_0x2e623f(0x172)]};}};}async[_0x1482ee(0xa0)](){const _0x293cfb=_0x1482ee;if(this[_0x293cfb(0x1ae)]!==_0x293cfb(0x203)||this[_0x293cfb(0xdb)]?.[_0x293cfb(0x13f)]!==WebSocket[_0x293cfb(0x143)]){this[_0x293cfb(0x1cb)]!==void 0x0&&clearTimeout(this[_0x293cfb(0x1cb)]),this['_reconnectTimer']=void 0x0,this[_0x293cfb(0x1de)]??=this['_connect']();try{await this[_0x293cfb(0x1de)];}finally{this[_0x293cfb(0x1de)]=void 0x0;}}}async[_0x1482ee(0x1bc)](){const _0xb1283e=_0x1482ee;this[_0xb1283e(0x1ae)]='reconnecting';let _0x492d93=await this[_0xb1283e(0x118)][_0xb1283e(0x158)](this[_0xb1283e(0x118)][_0xb1283e(0x185)],{'headers':{'content-type':'application/json'},'method':'GET'});if(!_0x492d93['ok'])throw this['_state']=_0xb1283e(0x1f7),new j('COLLABORATION_UNAVAILABLE',_0xb1283e(0x141)+_0x492d93[_0xb1283e(0x1e6)],{'retryable':_0x492d93[_0xb1283e(0x1e6)]>=0x1f4});let _0x573e71=await _0x492d93[_0xb1283e(0x11b)]();if(typeof _0x573e71[_0xb1283e(0xcc)]!=_0xb1283e(0x132)||_0x573e71['ticket']['length']===0x0)throw this['_state']=_0xb1283e(0x1f7),new j(_0xb1283e(0xd6),_0xb1283e(0x1ff));let _0x4ff792=new URL(this[_0xb1283e(0x118)]['collabWebSocketUrl']);_0x4ff792[_0xb1283e(0xe9)][_0xb1283e(0xf5)]('sessionTicket',_0x573e71['ticket']);let _0x2ab2d2=new WebSocket(_0x4ff792);this[_0xb1283e(0xdb)]=_0x2ab2d2,_0x2ab2d2['addEventListener'](_0xb1283e(0xb9),_0x43566c=>this[_0xb1283e(0xb5)](_0x43566c)),_0x2ab2d2[_0xb1283e(0xa7)](_0xb1283e(0x10f),()=>{const _0x50141d=_0xb1283e;this['_socket']===_0x2ab2d2&&(this[_0x50141d(0xbc)](),this[_0x50141d(0x11d)](new j(_0x50141d(0x106),_0x50141d(0x150),{'retryable':!0x0})),this[_0x50141d(0x1ae)]=this[_0x50141d(0xad)][_0x50141d(0x92)]===0x0?_0x50141d(0xdd):'reconnecting',this[_0x50141d(0xad)][_0x50141d(0x92)]>0x0&&this[_0x50141d(0x19d)]());}),await Oe(_0x2ab2d2);let _0x251b42=await this[_0xb1283e(0x12d)](_0x66851[_0xb1283e(0xc8)],'',{'cmd':_0x66851[_0xb1283e(0xc8)],'routeKey':''});if(_0x251b42[_0xb1283e(0x1a4)]!==_0x39ab32['OK']||typeof _0x251b42['infoRsp']?.[_0xb1283e(0x180)]!=_0xb1283e(0x132))throw _0x2ab2d2[_0xb1283e(0x10f)](),new j(_0xb1283e(0xd6),_0xb1283e(0x195));this['_memberId']=_0x251b42[_0xb1283e(0x17a)][_0xb1283e(0x180)],this['_state']=_0xb1283e(0x203);for(let {target:_0x8174dd}of this['_joined'][_0xb1283e(0x1e0)]())try{await this[_0xb1283e(0x191)](_0x8174dd);}catch(_0x35e1a9){throw _0x2ab2d2[_0xb1283e(0x10f)](0x3f3,'Failed\x20to\x20rejoin\x20Unit\x20room'),_0x35e1a9;}this[_0xb1283e(0x1fe)]=0x0,this[_0xb1283e(0x1b7)]();}async[_0x1482ee(0x191)](_0x44e235){const _0x27b6ed=_0x1482ee;let _0x43af65=await this['_requestCommand'](_0x66851['JOIN'],_0x44e235['unitId'],{'cmd':_0x66851['JOIN'],'joinReq':{'rooms':[{'args':'','roomID':_0x44e235[_0x27b6ed(0x15d)]}]},'routeKey':_0x44e235[_0x27b6ed(0x15d)]});if(_0x43af65[_0x27b6ed(0x1a4)]!==_0x39ab32['OK'])throw new j(_0x27b6ed(0x106),typeof _0x43af65[_0x27b6ed(0xba)]==_0x27b6ed(0x132)?_0x43af65[_0x27b6ed(0xba)]:'Failed\x20to\x20join\x20Unit\x20room');}[_0x1482ee(0x12d)](_0x60f88f,_0x39ba6e,_0x10de7a){const _0x504a04=_0x1482ee;let _0x5838d5=this[_0x504a04(0xdb)];if(!_0x5838d5||_0x5838d5[_0x504a04(0x13f)]!==WebSocket[_0x504a04(0x143)])return Promise[_0x504a04(0x1a1)](new j('COLLABORATION_UNAVAILABLE',_0x504a04(0x142),{'retryable':!0x0}));let _0x27f353=_0x60f88f+':'+_0x39ba6e;return new Promise((_0x5dee31,_0x59dc84)=>{const _0x2ebfdf=_0x504a04;if(this['_commandWaiters'][_0x2ebfdf(0x140)](_0x27f353)){_0x59dc84(new j(_0x2ebfdf(0xd6),'A\x20'+_0x60f88f+_0x2ebfdf(0x167)+_0x39ba6e));return;}let _0x2a9adc=setTimeout(()=>{const _0x19f6ac=_0x2ebfdf;this[_0x19f6ac(0x1be)][_0x19f6ac(0xcb)](_0x27f353),_0x59dc84(new j(_0x19f6ac(0x106),'Timed\x20out\x20waiting\x20for\x20Collaboration\x20command\x20'+_0x60f88f,{'retryable':!0x0}));},0x7530);this[_0x2ebfdf(0x1be)][_0x2ebfdf(0xf5)](_0x27f353,{'reject':_0x59dc84,'resolve':_0x5dee31,'timer':_0x2a9adc});try{_0x5838d5['send'](JSON['stringify'](_0x10de7a));}catch(_0x205454){this[_0x2ebfdf(0x1be)][_0x2ebfdf(0xcb)](_0x27f353),clearTimeout(_0x2a9adc),_0x59dc84(new j(_0x2ebfdf(0x106),'Failed\x20to\x20send\x20Collaboration\x20WebSocket\x20command',{'cause':_0x205454,'retryable':!0x0}));}});}['_handleMessage'](_0x15e673){const _0xefcc88=_0x1482ee;if(typeof _0x15e673[_0xefcc88(0x205)]!=_0xefcc88(0x132))return;let _0x129bc0;try{_0x129bc0=JSON['parse'](_0x15e673[_0xefcc88(0x205)]);}catch{this[_0xefcc88(0xdb)]?.[_0xefcc88(0x10f)](0x3eb,'Invalid\x20JSON\x20response');return;}let _0x75ed75=typeof _0x129bc0[_0xefcc88(0x14e)]==_0xefcc88(0x132)?_0x129bc0[_0xefcc88(0x14e)]:'';if(_0x129bc0[_0xefcc88(0x19a)]===_0x66851[_0xefcc88(0xc8)]||_0x129bc0[_0xefcc88(0x19a)]===_0x66851[_0xefcc88(0xb8)]||_0x129bc0['cmd']===_0x66851[_0xefcc88(0x174)]){let _0x413371=_0x129bc0['cmd']+':'+_0x75ed75,_0x3c64c5=this[_0xefcc88(0x1be)][_0xefcc88(0x169)](_0x413371);_0x3c64c5&&(this[_0xefcc88(0x1be)][_0xefcc88(0xcb)](_0x413371),clearTimeout(_0x3c64c5[_0xefcc88(0x16d)]),_0x3c64c5['resolve'](_0x129bc0));return;}_0x129bc0[_0xefcc88(0x19a)]!==_0x66851[_0xefcc88(0x196)]||!_0x129bc0['collaMsg']||this[_0xefcc88(0x1da)](_0x75ed75,_0x129bc0[_0xefcc88(0x1dc)]);}[_0x1482ee(0x1da)](_0x179f68,_0x31dfd6){const _0x32af12=_0x1482ee;let _0x5a1ef7=_0x31dfd6[_0x32af12(0x103)],_0x40e6f6=_0x5a1ef7===_0x32af12(0xc7)?_0x32af12(0x1b1):_0x5a1ef7==='changeset_rej'?_0x32af12(0x1d2):_0x5a1ef7===_0x32af12(0x1ad)?'csShouldRetryEvent':_0x5a1ef7===_0x32af12(0xe1)?_0x32af12(0x160):_0x5a1ef7===_0x32af12(0x13d)?'newCsEvent':void 0x0;if(!_0x40e6f6)return;let _0x5883bc=ke(_0x31dfd6[_0x40e6f6]);if(!_0x5883bc||_0x5883bc[_0x32af12(0xc2)]!==_0x179f68)return;if(_0x5a1ef7===_0x32af12(0x13d)){let _0x367a90=this[_0x32af12(0x1cf)][_0x32af12(0x169)](_0x179f68)??[];_0x367a90[_0x32af12(0xdc)](_0x5883bc),this['_inbound'][_0x32af12(0xf5)](_0x179f68,_0x367a90);return;}let _0x56c96c=Q(_0x5883bc['sid'],_0x5883bc['reqId']),_0x30418e=this[_0x32af12(0x152)][_0x32af12(0x169)](_0x56c96c);_0x30418e&&_0x30418e(_0x5a1ef7===_0x32af12(0xc7)?{'changeset':_0x5883bc,'status':_0x32af12(0xfb)}:_0x5a1ef7===_0x32af12(0x1ad)?{'status':_0x32af12(0x201)}:_0x5a1ef7===_0x32af12(0xe1)?{'status':'permission-rejected'}:{'status':'changeset-rejected'});}[_0x1482ee(0x18b)](_0x2f9b02,_0x22eea8){const _0x4d9fb2=_0x1482ee;let _0x1695f4=Q(_0x2f9b02,_0x22eea8);if(this[_0x4d9fb2(0x152)]['has'](_0x1695f4))return{'cancel':()=>void 0x0,'promise':Promise[_0x4d9fb2(0x1a1)](new j(_0x4d9fb2(0x202),'The\x20same\x20changeset\x20submission\x20is\x20already\x20in\x20flight'))};let _0x5aaf22=()=>void 0x0;return{'cancel':()=>_0x5aaf22({'status':_0x4d9fb2(0xdd)}),'promise':new Promise(_0x34f156=>{const _0x54fb55=_0x4d9fb2;_0x5aaf22=_0xf0f825=>{this['_submissionWaiters']['delete'](_0x1695f4)&&_0x34f156(_0xf0f825);},this[_0x54fb55(0x152)]['set'](_0x1695f4,_0x5aaf22);})};}async[_0x1482ee(0xf0)](_0xa0b60b){const _0x3f3c42=_0x1482ee;let _0x525430=this[_0x3f3c42(0xad)][_0x3f3c42(0x169)](_0xa0b60b);_0x525430&&(--_0x525430[_0x3f3c42(0x10b)],!(_0x525430[_0x3f3c42(0x10b)]>0x0)&&(this['_joined'][_0x3f3c42(0xcb)](_0xa0b60b),this['_inbound'][_0x3f3c42(0xcb)](_0xa0b60b),this[_0x3f3c42(0xdb)]?.[_0x3f3c42(0x13f)]===WebSocket[_0x3f3c42(0x143)]&&this[_0x3f3c42(0xdb)][_0x3f3c42(0x147)](JSON['stringify']({'cmd':_0x66851[_0x3f3c42(0xa9)],'leaveReq':{'args':'','roomID':_0xa0b60b},'routeKey':_0xa0b60b})),this[_0x3f3c42(0xad)][_0x3f3c42(0x92)]===0x0&&(this[_0x3f3c42(0x1ae)]=_0x3f3c42(0xdd),this[_0x3f3c42(0x1cb)]!==void 0x0&&clearTimeout(this[_0x3f3c42(0x1cb)]),this[_0x3f3c42(0x1cb)]=void 0x0,this[_0x3f3c42(0xbc)](),this['_socket']?.['close'](0x3e8,_0x3f3c42(0x129)),this[_0x3f3c42(0xdb)]=void 0x0,this[_0x3f3c42(0x121)]='')));}[_0x1482ee(0x19d)](){const _0x31c656=_0x1482ee;if(this[_0x31c656(0x1cb)]!==void 0x0||this[_0x31c656(0x1fe)]>=0x3){this[_0x31c656(0x1fe)]>=0x3&&(this[_0x31c656(0x1ae)]='offline');return;}let _0x3a550e=Math[_0x31c656(0x171)](0x3e8*0x2**this['_reconnectAttempts'],0x4e20);this[_0x31c656(0x1fe)]+=0x1,this['_reconnectTimer']=setTimeout(()=>{const _0x22505a=_0x31c656;this[_0x22505a(0x1cb)]=void 0x0,this[_0x22505a(0x1de)]??=this[_0x22505a(0x1bc)](),this['_connectPromise']['catch'](()=>this[_0x22505a(0x19d)]())[_0x22505a(0xef)](()=>{const _0x4fb4d2=_0x22505a;this[_0x4fb4d2(0x1de)]=void 0x0;});},_0x3a550e);}[_0x1482ee(0x1b7)](){const _0x380082=_0x1482ee;this[_0x380082(0xbc)](),this[_0x380082(0x175)]=setInterval(()=>{const _0x4ca058=_0x380082;this[_0x4ca058(0x1ae)]===_0x4ca058(0x203)&&this[_0x4ca058(0x12d)](_0x66851[_0x4ca058(0x174)],'',{'cmd':_0x66851['HEARTBEAT'],'routeKey':''})[_0x4ca058(0xa4)](()=>this['_socket']?.[_0x4ca058(0x10f)](0x3f3,_0x4ca058(0x1b2)));},0x7530);}[_0x1482ee(0xbc)](){const _0x846731=_0x1482ee;this[_0x846731(0x175)]!==void 0x0&&clearInterval(this['_heartbeat']),this[_0x846731(0x175)]=void 0x0;}['_failCommandWaiters'](_0x2c7116){const _0x1d364b=_0x1482ee;for(let _0x2bb49c of this[_0x1d364b(0x1be)][_0x1d364b(0x1e0)]())clearTimeout(_0x2bb49c[_0x1d364b(0x16d)]),_0x2bb49c[_0x1d364b(0x1a1)](_0x2c7116);this['_commandWaiters'][_0x1d364b(0x15b)]();}};function Oe(_0x859e6b){return new Promise((_0x151ad2,_0x2bd6ab)=>{const _0x11c74b=_0x1727;let _0x101ba6=()=>{const _0x63e6d2=_0x1727;clearTimeout(_0x3ee492),_0x859e6b['removeEventListener'](_0x63e6d2(0x10f),_0x161c46),_0x859e6b[_0x63e6d2(0x1c0)](_0x63e6d2(0x186),_0x2921e3),_0x859e6b['removeEventListener'](_0x63e6d2(0x159),_0x472aa2);},_0x11e69e=_0x42a318=>{const _0x9af8fc=_0x1727;_0x101ba6(),_0x2bd6ab(new j(_0x9af8fc(0x106),_0x42a318,{'retryable':!0x0}));},_0x161c46=()=>_0x11e69e('Collaboration\x20WebSocket\x20closed\x20before\x20opening'),_0x2921e3=()=>_0x11e69e(_0x11c74b(0x145)),_0x472aa2=()=>{_0x101ba6(),_0x151ad2();},_0x3ee492=setTimeout(()=>{const _0x145820=_0x11c74b;_0x11e69e(_0x145820(0x1c8)),_0x859e6b['close'](0x3e8,_0x145820(0x14c));},0x7530);_0x859e6b[_0x11c74b(0xa7)](_0x11c74b(0x10f),_0x161c46,{'once':!0x0}),_0x859e6b[_0x11c74b(0xa7)]('error',_0x2921e3,{'once':!0x0}),_0x859e6b[_0x11c74b(0xa7)]('open',_0x472aa2,{'once':!0x0});});}function ke(_0x3a931c){const _0x5a55c5=_0x1482ee;if(!_0x3a931c||typeof _0x3a931c!='object')return null;let _0x2dd220=_0x3a931c['cs'];return _0x2dd220&&typeof _0x2dd220==_0x5a55c5(0xb7)?_0x2dd220:null;}function Q(_0x58ec9d,_0x2bbc69){return(_0x58ec9d??'')+':'+(_0x2bbc69??0x0);}var Ae=class{[_0x1482ee(0x118)];[_0x1482ee(0x209)];constructor(_0xed206e){const _0x465153=_0x1482ee;this[_0x465153(0x118)]=je(_0xed206e),this[_0x465153(0x209)]=new De(this[_0x465153(0x118)]);}async[_0x1482ee(0x159)](_0x39a929){const _0x30e189=_0x1482ee;let _0x2c5f97=await this['_connection']['acquire'](_0x39a929);return new we(this[_0x30e189(0x118)],_0x39a929,_0x2c5f97);}};function je(_0x4bbccc){const _0x4f7923=_0x1482ee;let _0x244dab=$(_0x4bbccc[_0x4f7923(0x100)],_0x4f7923(0x100),[_0x4f7923(0xc6),'https:']),_0x43578d=$(_0x4bbccc[_0x4f7923(0x105)],_0x4f7923(0x105),[_0x4f7923(0xc6),_0x4f7923(0x107)]),_0x350cb1=$(_0x4bbccc['collabWebSocketUrl'],_0x4f7923(0x1b8),[_0x4f7923(0x1e9),_0x4f7923(0x13a),_0x4f7923(0xc6),'https:']);_0x350cb1[_0x4f7923(0x15f)]===_0x4f7923(0xc6)&&(_0x350cb1['protocol']=_0x4f7923(0x1e9)),_0x350cb1[_0x4f7923(0x15f)]===_0x4f7923(0x107)&&(_0x350cb1['protocol']=_0x4f7923(0x13a));let _0x24ad3c=$(_0x4bbccc['wsSessionTicketUrl'],_0x4f7923(0x185),[_0x4f7923(0xc6),'https:']),_0x2a2dd3=_0x4bbccc[_0x4f7923(0x128)]??0x7530;if(!Number['isSafeInteger'](_0x2a2dd3)||_0x2a2dd3<=0x0)throw new j(_0x4f7923(0x202),_0x4f7923(0x16c));return{'collabSubmitChangesetUrl':_0x43578d,'collabWebSocketUrl':_0x350cb1,'commitTimeoutMs':_0x2a2dd3,'httpRequest':_0x4bbccc['httpRequest']??globalThis[_0x4f7923(0x1df)][_0x4f7923(0xe5)](globalThis),'snapshotServerUrl':_0x244dab,'wsSessionTicketUrl':_0x24ad3c};}function $(_0x4c4b08,_0x593d72,_0x172170){const _0x357fd9=_0x1482ee;let _0x1308fd;try{_0x1308fd=new URL(_0x4c4b08);}catch{throw new j(_0x357fd9(0x202),_0x593d72+_0x357fd9(0xf6));}if(!_0x172170['includes'](_0x1308fd[_0x357fd9(0x15f)]))throw new j(_0x357fd9(0x202),_0x593d72+_0x357fd9(0x1c5));return _0x1308fd;}function Me(_0x47a772){return new Ae(_0x47a772);}export{j as CollaborationRuntimeError,Me as createCollaborationServerAdapter,ve as createUniverCollaborationRuntimeFactory};
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@univer-cli/univer-collaboration-runtime",
3
+ "type": "module",
4
+ "version": "1.0.0-beta.2",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "README.zh-CN.md"
19
+ ],
20
+ "dependencies": {
21
+ "@oxc-project/runtime": "0.142.0",
22
+ "@univerjs-pro/bases": "1.0.0-beta.2",
23
+ "@univerjs-pro/boards": "1.0.0-beta.2",
24
+ "@univerjs-pro/collaboration": "1.0.0-beta.2",
25
+ "@univerjs-pro/engine-formula": "1.0.0-beta.2",
26
+ "@univerjs-pro/slides": "1.0.0-beta.2",
27
+ "@univerjs/core": "1.0.0-beta.2",
28
+ "@univerjs/docs": "1.0.0-beta.2",
29
+ "@univerjs/engine-formula": "1.0.0-beta.2",
30
+ "@univerjs/engine-render": "1.0.0-beta.2",
31
+ "@univerjs/protocol": "1.0.0-beta.2",
32
+ "@univerjs/sheets": "1.0.0-beta.2"
33
+ }
34
+ }