@textbus/collaborate 2.0.0-beta.9 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/collaborate-cursor.d.ts +11 -11
- package/bundles/collaborate-cursor.js +120 -117
- package/bundles/collaborate.d.ts +11 -6
- package/bundles/collaborate.js +242 -216
- package/package.json +7 -7
- package/src/collaborate-cursor.ts +100 -56
- package/src/collaborate.ts +235 -66
- package/tsconfig-build.json +1 -1
package/bundles/collaborate.js
CHANGED
@@ -7,172 +7,81 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
import {
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
12
|
+
};
|
13
|
+
import { Inject, Injectable } from '@tanbo/di';
|
14
|
+
import { delay, filter, map, Subject } from '@tanbo/stream';
|
15
|
+
import { ChangeOrigin, ContentType, Controller, HISTORY_STACK_SIZE, makeError, Registry, RootComponentRef, Scheduler, Selection, Slot, Starter, Translator } from '@textbus/core';
|
16
|
+
import { Array as YArray, Doc as YDoc, Map as YMap, Text as YText, UndoManager, createAbsolutePositionFromRelativePosition, createRelativePositionFromTypeIndex } from 'yjs';
|
14
17
|
import { CollaborateCursor } from './collaborate-cursor';
|
15
18
|
import { createUnknownComponent } from './unknown.component';
|
16
19
|
const collaborateErrorFn = makeError('Collaborate');
|
20
|
+
class ContentMap {
|
21
|
+
constructor() {
|
22
|
+
this.slotAndYTextMap = new WeakMap();
|
23
|
+
this.yTextAndSLotMap = new WeakMap();
|
24
|
+
}
|
25
|
+
set(key, value) {
|
26
|
+
if (key instanceof Slot) {
|
27
|
+
this.slotAndYTextMap.set(key, value);
|
28
|
+
this.yTextAndSLotMap.set(value, key);
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
this.slotAndYTextMap.set(value, key);
|
32
|
+
this.yTextAndSLotMap.set(key, value);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
get(key) {
|
36
|
+
if (key instanceof Slot) {
|
37
|
+
return this.slotAndYTextMap.get(key) || null;
|
38
|
+
}
|
39
|
+
return this.yTextAndSLotMap.get(key) || null;
|
40
|
+
}
|
41
|
+
delete(key) {
|
42
|
+
if (key instanceof Slot) {
|
43
|
+
const v = this.slotAndYTextMap.get(key);
|
44
|
+
this.slotAndYTextMap.delete(key);
|
45
|
+
if (v) {
|
46
|
+
this.yTextAndSLotMap.delete(v);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
const v = this.yTextAndSLotMap.get(key);
|
51
|
+
this.yTextAndSLotMap.delete(key);
|
52
|
+
if (v) {
|
53
|
+
this.slotAndYTextMap.delete(v);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
17
58
|
let Collaborate = class Collaborate {
|
18
|
-
constructor(rootComponentRef, collaborateCursor, scheduler, translator, registry, selection, starter) {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
enumerable: true,
|
45
|
-
configurable: true,
|
46
|
-
writable: true,
|
47
|
-
value: registry
|
48
|
-
});
|
49
|
-
Object.defineProperty(this, "selection", {
|
50
|
-
enumerable: true,
|
51
|
-
configurable: true,
|
52
|
-
writable: true,
|
53
|
-
value: selection
|
54
|
-
});
|
55
|
-
Object.defineProperty(this, "starter", {
|
56
|
-
enumerable: true,
|
57
|
-
configurable: true,
|
58
|
-
writable: true,
|
59
|
-
value: starter
|
60
|
-
});
|
61
|
-
Object.defineProperty(this, "onSelectionChange", {
|
62
|
-
enumerable: true,
|
63
|
-
configurable: true,
|
64
|
-
writable: true,
|
65
|
-
value: void 0
|
66
|
-
});
|
67
|
-
Object.defineProperty(this, "yDoc", {
|
68
|
-
enumerable: true,
|
69
|
-
configurable: true,
|
70
|
-
writable: true,
|
71
|
-
value: new YDoc()
|
72
|
-
});
|
73
|
-
Object.defineProperty(this, "onBack", {
|
74
|
-
enumerable: true,
|
75
|
-
configurable: true,
|
76
|
-
writable: true,
|
77
|
-
value: void 0
|
78
|
-
});
|
79
|
-
Object.defineProperty(this, "onForward", {
|
80
|
-
enumerable: true,
|
81
|
-
configurable: true,
|
82
|
-
writable: true,
|
83
|
-
value: void 0
|
84
|
-
});
|
85
|
-
Object.defineProperty(this, "onChange", {
|
86
|
-
enumerable: true,
|
87
|
-
configurable: true,
|
88
|
-
writable: true,
|
89
|
-
value: void 0
|
90
|
-
});
|
91
|
-
Object.defineProperty(this, "onPush", {
|
92
|
-
enumerable: true,
|
93
|
-
configurable: true,
|
94
|
-
writable: true,
|
95
|
-
value: void 0
|
96
|
-
});
|
97
|
-
Object.defineProperty(this, "backEvent", {
|
98
|
-
enumerable: true,
|
99
|
-
configurable: true,
|
100
|
-
writable: true,
|
101
|
-
value: new Subject()
|
102
|
-
});
|
103
|
-
Object.defineProperty(this, "forwardEvent", {
|
104
|
-
enumerable: true,
|
105
|
-
configurable: true,
|
106
|
-
writable: true,
|
107
|
-
value: new Subject()
|
108
|
-
});
|
109
|
-
Object.defineProperty(this, "changeEvent", {
|
110
|
-
enumerable: true,
|
111
|
-
configurable: true,
|
112
|
-
writable: true,
|
113
|
-
value: new Subject()
|
114
|
-
});
|
115
|
-
Object.defineProperty(this, "pushEvent", {
|
116
|
-
enumerable: true,
|
117
|
-
configurable: true,
|
118
|
-
writable: true,
|
119
|
-
value: new Subject()
|
120
|
-
});
|
121
|
-
Object.defineProperty(this, "manager", {
|
122
|
-
enumerable: true,
|
123
|
-
configurable: true,
|
124
|
-
writable: true,
|
125
|
-
value: void 0
|
126
|
-
});
|
127
|
-
Object.defineProperty(this, "subscriptions", {
|
128
|
-
enumerable: true,
|
129
|
-
configurable: true,
|
130
|
-
writable: true,
|
131
|
-
value: []
|
132
|
-
});
|
133
|
-
Object.defineProperty(this, "updateFromRemote", {
|
134
|
-
enumerable: true,
|
135
|
-
configurable: true,
|
136
|
-
writable: true,
|
137
|
-
value: false
|
138
|
-
});
|
139
|
-
Object.defineProperty(this, "contentSyncCaches", {
|
140
|
-
enumerable: true,
|
141
|
-
configurable: true,
|
142
|
-
writable: true,
|
143
|
-
value: new WeakMap()
|
144
|
-
});
|
145
|
-
Object.defineProperty(this, "slotStateSyncCaches", {
|
146
|
-
enumerable: true,
|
147
|
-
configurable: true,
|
148
|
-
writable: true,
|
149
|
-
value: new WeakMap()
|
150
|
-
});
|
151
|
-
Object.defineProperty(this, "slotsSyncCaches", {
|
152
|
-
enumerable: true,
|
153
|
-
configurable: true,
|
154
|
-
writable: true,
|
155
|
-
value: new WeakMap()
|
156
|
-
});
|
157
|
-
Object.defineProperty(this, "componentStateSyncCaches", {
|
158
|
-
enumerable: true,
|
159
|
-
configurable: true,
|
160
|
-
writable: true,
|
161
|
-
value: new WeakMap()
|
162
|
-
});
|
163
|
-
Object.defineProperty(this, "selectionChangeEvent", {
|
164
|
-
enumerable: true,
|
165
|
-
configurable: true,
|
166
|
-
writable: true,
|
167
|
-
value: new Subject()
|
168
|
-
});
|
169
|
-
Object.defineProperty(this, "updateRemoteActions", {
|
170
|
-
enumerable: true,
|
171
|
-
configurable: true,
|
172
|
-
writable: true,
|
173
|
-
value: []
|
174
|
-
});
|
175
|
-
this.onSelectionChange = this.selectionChangeEvent.asObservable();
|
59
|
+
constructor(stackSize, rootComponentRef, collaborateCursor, controller, scheduler, translator, registry, selection, starter) {
|
60
|
+
this.stackSize = stackSize;
|
61
|
+
this.rootComponentRef = rootComponentRef;
|
62
|
+
this.collaborateCursor = collaborateCursor;
|
63
|
+
this.controller = controller;
|
64
|
+
this.scheduler = scheduler;
|
65
|
+
this.translator = translator;
|
66
|
+
this.registry = registry;
|
67
|
+
this.selection = selection;
|
68
|
+
this.starter = starter;
|
69
|
+
this.yDoc = new YDoc();
|
70
|
+
this.backEvent = new Subject();
|
71
|
+
this.forwardEvent = new Subject();
|
72
|
+
this.changeEvent = new Subject();
|
73
|
+
this.pushEvent = new Subject();
|
74
|
+
this.manager = null;
|
75
|
+
this.subscriptions = [];
|
76
|
+
this.updateFromRemote = false;
|
77
|
+
this.contentSyncCaches = new WeakMap();
|
78
|
+
this.slotStateSyncCaches = new WeakMap();
|
79
|
+
this.slotsSyncCaches = new WeakMap();
|
80
|
+
this.componentStateSyncCaches = new WeakMap();
|
81
|
+
this.selectionChangeEvent = new Subject();
|
82
|
+
this.contentMap = new ContentMap();
|
83
|
+
this.updateRemoteActions = [];
|
84
|
+
this.onSelectionChange = this.selectionChangeEvent.asObservable().pipe(delay());
|
176
85
|
this.onBack = this.backEvent.asObservable();
|
177
86
|
this.onForward = this.forwardEvent.asObservable();
|
178
87
|
this.onChange = this.changeEvent.asObservable();
|
@@ -180,60 +89,156 @@ let Collaborate = class Collaborate {
|
|
180
89
|
}
|
181
90
|
get canBack() {
|
182
91
|
var _a;
|
183
|
-
return (_a = this.manager) === null || _a === void 0 ? void 0 : _a.canUndo();
|
92
|
+
return ((_a = this.manager) === null || _a === void 0 ? void 0 : _a.canUndo()) || false;
|
184
93
|
}
|
185
94
|
get canForward() {
|
186
95
|
var _a;
|
187
|
-
return (_a = this.manager) === null || _a === void 0 ? void 0 : _a.canRedo();
|
96
|
+
return ((_a = this.manager) === null || _a === void 0 ? void 0 : _a.canRedo()) || false;
|
188
97
|
}
|
189
|
-
|
190
|
-
this.
|
191
|
-
|
192
|
-
|
98
|
+
listen() {
|
99
|
+
const root = this.yDoc.getMap('RootComponent');
|
100
|
+
const rootComponent = this.rootComponentRef.component;
|
101
|
+
this.manager = new UndoManager(root, {
|
102
|
+
trackedOrigins: new Set([this.yDoc])
|
103
|
+
});
|
104
|
+
const cursorKey = 'cursor-position';
|
105
|
+
this.manager.on('stack-item-added', event => {
|
106
|
+
event.stackItem.meta.set(cursorKey, this.getRelativeCursorLocation());
|
107
|
+
if (this.manager.undoStack.length > this.stackSize) {
|
108
|
+
this.manager.undoStack.shift();
|
109
|
+
}
|
110
|
+
if (event.origin === this.yDoc) {
|
111
|
+
this.pushEvent.next();
|
112
|
+
}
|
113
|
+
this.changeEvent.next();
|
114
|
+
});
|
115
|
+
this.manager.on('stack-item-popped', event => {
|
116
|
+
const position = event.stackItem.meta.get(cursorKey);
|
117
|
+
if (position) {
|
118
|
+
this.restoreCursorLocation(position);
|
119
|
+
}
|
120
|
+
});
|
121
|
+
this.subscriptions.push(this.selection.onChange.subscribe(() => {
|
193
122
|
const paths = this.selection.getPaths();
|
194
123
|
this.selectionChangeEvent.next(paths);
|
124
|
+
}), this.scheduler.onDocChanged.pipe(map(item => {
|
125
|
+
return item.filter(i => {
|
126
|
+
return i.from !== ChangeOrigin.Remote;
|
127
|
+
});
|
128
|
+
}), filter(item => {
|
129
|
+
return item.length;
|
130
|
+
})).subscribe(() => {
|
131
|
+
this.yDoc.transact(() => {
|
132
|
+
this.updateRemoteActions.forEach(fn => {
|
133
|
+
fn();
|
134
|
+
});
|
135
|
+
this.updateRemoteActions = [];
|
136
|
+
}, this.yDoc);
|
195
137
|
}));
|
138
|
+
this.syncRootComponent(root, rootComponent);
|
196
139
|
}
|
197
140
|
updateRemoteSelection(paths) {
|
198
141
|
this.collaborateCursor.draw(paths);
|
199
142
|
}
|
200
|
-
listen() {
|
201
|
-
//
|
202
|
-
}
|
203
143
|
back() {
|
144
|
+
var _a;
|
204
145
|
if (this.canBack) {
|
205
|
-
this.
|
206
|
-
this.
|
207
|
-
this.scheduler.ignoreChanges = false;
|
146
|
+
(_a = this.manager) === null || _a === void 0 ? void 0 : _a.undo();
|
147
|
+
this.backEvent.next();
|
208
148
|
}
|
209
149
|
}
|
210
150
|
forward() {
|
151
|
+
var _a;
|
211
152
|
if (this.canForward) {
|
212
|
-
this.
|
213
|
-
this.
|
214
|
-
this.scheduler.ignoreChanges = false;
|
153
|
+
(_a = this.manager) === null || _a === void 0 ? void 0 : _a.redo();
|
154
|
+
this.forwardEvent.next();
|
215
155
|
}
|
216
156
|
}
|
157
|
+
clear() {
|
158
|
+
var _a;
|
159
|
+
(_a = this.manager) === null || _a === void 0 ? void 0 : _a.clear();
|
160
|
+
this.changeEvent.next();
|
161
|
+
}
|
217
162
|
destroy() {
|
163
|
+
var _a;
|
218
164
|
this.subscriptions.forEach(i => i.unsubscribe());
|
165
|
+
this.collaborateCursor.destroy();
|
166
|
+
(_a = this.manager) === null || _a === void 0 ? void 0 : _a.destroy();
|
219
167
|
}
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
168
|
+
syncRootComponent(root, rootComponent) {
|
169
|
+
let slots = root.get('slots');
|
170
|
+
if (!slots) {
|
171
|
+
slots = new YArray();
|
172
|
+
rootComponent.slots.toArray().forEach(i => {
|
173
|
+
const sharedSlot = this.createSharedSlotBySlot(i);
|
174
|
+
slots.push([sharedSlot]);
|
175
|
+
});
|
228
176
|
this.yDoc.transact(() => {
|
229
|
-
|
230
|
-
|
177
|
+
root.set('state', rootComponent.state);
|
178
|
+
root.set('slots', slots);
|
179
|
+
});
|
180
|
+
}
|
181
|
+
else if (slots.length === 0) {
|
182
|
+
rootComponent.updateState(() => {
|
183
|
+
return root.get('state');
|
184
|
+
});
|
185
|
+
this.yDoc.transact(() => {
|
186
|
+
rootComponent.slots.toArray().forEach(i => {
|
187
|
+
const sharedSlot = this.createSharedSlotBySlot(i);
|
188
|
+
slots.push([sharedSlot]);
|
231
189
|
});
|
232
|
-
|
233
|
-
|
234
|
-
|
190
|
+
});
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
rootComponent.updateState(() => {
|
194
|
+
return root.get('state');
|
195
|
+
});
|
196
|
+
rootComponent.slots.clean();
|
197
|
+
slots.forEach(sharedSlot => {
|
198
|
+
const slot = this.createSlotBySharedSlot(sharedSlot);
|
199
|
+
this.syncContent(sharedSlot.get('content'), slot);
|
200
|
+
this.syncSlot(sharedSlot, slot);
|
201
|
+
rootComponent.slots.insert(slot);
|
202
|
+
});
|
203
|
+
}
|
204
|
+
this.syncComponent(root, rootComponent);
|
205
|
+
this.syncSlots(slots, rootComponent);
|
206
|
+
}
|
207
|
+
restoreCursorLocation(position) {
|
208
|
+
const anchorPosition = createAbsolutePositionFromRelativePosition(position.anchor, this.yDoc);
|
209
|
+
const focusPosition = createAbsolutePositionFromRelativePosition(position.focus, this.yDoc);
|
210
|
+
if (anchorPosition && focusPosition) {
|
211
|
+
const focusSlot = this.contentMap.get(focusPosition.type);
|
212
|
+
const anchorSlot = this.contentMap.get(anchorPosition.type);
|
213
|
+
if (focusSlot && anchorSlot) {
|
214
|
+
this.selection.setBaseAndExtent(anchorSlot, anchorPosition.index, focusSlot, focusPosition.index);
|
215
|
+
return;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
this.selection.unSelect();
|
219
|
+
}
|
220
|
+
getRelativeCursorLocation() {
|
221
|
+
const { anchorSlot, anchorOffset, focusSlot, focusOffset } = this.selection;
|
222
|
+
if (anchorSlot) {
|
223
|
+
const anchorYText = this.contentMap.get(anchorSlot);
|
224
|
+
if (anchorYText) {
|
225
|
+
const anchorPosition = createRelativePositionFromTypeIndex(anchorYText, anchorOffset);
|
226
|
+
if (focusSlot) {
|
227
|
+
const focusYText = this.contentMap.get(focusSlot);
|
228
|
+
if (focusYText) {
|
229
|
+
const focusPosition = createRelativePositionFromTypeIndex(focusYText, focusOffset);
|
230
|
+
return {
|
231
|
+
focus: focusPosition,
|
232
|
+
anchor: anchorPosition
|
233
|
+
};
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
return null;
|
235
239
|
}
|
236
240
|
syncContent(content, slot) {
|
241
|
+
this.contentMap.set(slot, content);
|
237
242
|
const syncRemote = (ev, tr) => {
|
238
243
|
this.runRemoteUpdate(tr, () => {
|
239
244
|
slot.retain(0);
|
@@ -244,6 +249,7 @@ let Collaborate = class Collaborate {
|
|
244
249
|
if (formats.length) {
|
245
250
|
slot.retain(action.retain, formats);
|
246
251
|
}
|
252
|
+
slot.retain(slot.index + action.retain);
|
247
253
|
}
|
248
254
|
else {
|
249
255
|
slot.retain(action.retain);
|
@@ -265,11 +271,11 @@ let Collaborate = class Collaborate {
|
|
265
271
|
slot.insert(component);
|
266
272
|
}
|
267
273
|
if (this.selection.isSelected) {
|
268
|
-
if (slot === this.selection.
|
269
|
-
this.selection.
|
274
|
+
if (slot === this.selection.anchorSlot && this.selection.anchorOffset > index) {
|
275
|
+
this.selection.setAnchor(slot, this.selection.anchorOffset + length);
|
270
276
|
}
|
271
|
-
if (slot === this.selection.
|
272
|
-
this.selection.
|
277
|
+
if (slot === this.selection.focusSlot && this.selection.focusOffset > index) {
|
278
|
+
this.selection.setFocus(slot, this.selection.focusOffset + length);
|
273
279
|
}
|
274
280
|
}
|
275
281
|
}
|
@@ -278,17 +284,22 @@ let Collaborate = class Collaborate {
|
|
278
284
|
slot.retain(slot.index);
|
279
285
|
slot.delete(action.delete);
|
280
286
|
if (this.selection.isSelected) {
|
281
|
-
if (slot === this.selection.
|
282
|
-
this.selection.
|
287
|
+
if (slot === this.selection.anchorSlot && this.selection.anchorOffset >= index) {
|
288
|
+
this.selection.setAnchor(slot, this.selection.startOffset - action.delete);
|
283
289
|
}
|
284
|
-
if (slot === this.selection.
|
285
|
-
this.selection.
|
290
|
+
if (slot === this.selection.focusSlot && this.selection.focusOffset >= index) {
|
291
|
+
this.selection.setFocus(slot, this.selection.focusOffset - action.delete);
|
286
292
|
}
|
287
293
|
}
|
288
294
|
}
|
289
295
|
else if (action.attributes) {
|
290
296
|
slot.updateState(draft => {
|
291
|
-
|
297
|
+
if (typeof draft === 'object' && draft !== null) {
|
298
|
+
Object.assign(draft, action.attributes);
|
299
|
+
}
|
300
|
+
else {
|
301
|
+
return action.attributes;
|
302
|
+
}
|
292
303
|
});
|
293
304
|
}
|
294
305
|
});
|
@@ -325,17 +336,13 @@ let Collaborate = class Collaborate {
|
|
325
336
|
const isEmpty = delta.length === 1 && delta[0].insert === Slot.emptyPlaceholder;
|
326
337
|
if (typeof action.content === 'string') {
|
327
338
|
length = action.content.length;
|
328
|
-
content.insert(offset, action.content);
|
339
|
+
content.insert(offset, action.content, action.formats || {});
|
329
340
|
}
|
330
341
|
else {
|
331
342
|
length = 1;
|
332
|
-
const
|
333
|
-
const sharedComponent = this.createSharedComponentByComponent(component);
|
343
|
+
const sharedComponent = this.createSharedComponentByComponent(action.ref);
|
334
344
|
content.insertEmbed(offset, sharedComponent);
|
335
345
|
}
|
336
|
-
if (action.formats) {
|
337
|
-
content.format(offset, length, action.formats);
|
338
|
-
}
|
339
346
|
if (isEmpty && offset === 0) {
|
340
347
|
content.delete(content.length - 1, 1);
|
341
348
|
}
|
@@ -343,7 +350,9 @@ let Collaborate = class Collaborate {
|
|
343
350
|
}
|
344
351
|
else if (action.type === 'delete') {
|
345
352
|
const delta = content.toDelta();
|
346
|
-
content.
|
353
|
+
if (content.length) {
|
354
|
+
content.delete(offset, action.count);
|
355
|
+
}
|
347
356
|
if (content.length === 0) {
|
348
357
|
content.insert(0, '\n', (_a = delta[0]) === null || _a === void 0 ? void 0 : _a.attributes);
|
349
358
|
}
|
@@ -368,7 +377,12 @@ let Collaborate = class Collaborate {
|
|
368
377
|
if (key === 'state') {
|
369
378
|
const state = ev.target.get('state');
|
370
379
|
slot.updateState(draft => {
|
371
|
-
|
380
|
+
if (typeof draft === 'object' && draft !== null) {
|
381
|
+
Object.assign(draft, state);
|
382
|
+
}
|
383
|
+
else {
|
384
|
+
return state;
|
385
|
+
}
|
372
386
|
});
|
373
387
|
}
|
374
388
|
});
|
@@ -394,8 +408,8 @@ let Collaborate = class Collaborate {
|
|
394
408
|
let index = 0;
|
395
409
|
ev.delta.forEach(action => {
|
396
410
|
if (Reflect.has(action, 'retain')) {
|
397
|
-
slots.retain(action.retain);
|
398
411
|
index += action.retain;
|
412
|
+
slots.retain(index);
|
399
413
|
}
|
400
414
|
else if (action.insert) {
|
401
415
|
action.insert.forEach(item => {
|
@@ -423,8 +437,7 @@ let Collaborate = class Collaborate {
|
|
423
437
|
index = action.offset;
|
424
438
|
}
|
425
439
|
else if (action.type === 'insertSlot') {
|
426
|
-
const
|
427
|
-
const sharedSlot = this.createSharedSlotBySlot(slot);
|
440
|
+
const sharedSlot = this.createSharedSlotBySlot(action.ref);
|
428
441
|
remoteSlots.insert(index, [sharedSlot]);
|
429
442
|
index++;
|
430
443
|
}
|
@@ -451,7 +464,12 @@ let Collaborate = class Collaborate {
|
|
451
464
|
if (key === 'state') {
|
452
465
|
const state = ev.target.get('state');
|
453
466
|
component.updateState(draft => {
|
454
|
-
|
467
|
+
if (typeof draft === 'object' && draft !== null) {
|
468
|
+
Object.assign(draft, state);
|
469
|
+
}
|
470
|
+
else {
|
471
|
+
return state;
|
472
|
+
}
|
455
473
|
});
|
456
474
|
}
|
457
475
|
});
|
@@ -469,7 +487,7 @@ let Collaborate = class Collaborate {
|
|
469
487
|
});
|
470
488
|
}
|
471
489
|
runLocalUpdate(fn) {
|
472
|
-
if (this.updateFromRemote) {
|
490
|
+
if (this.updateFromRemote || this.controller.readonly) {
|
473
491
|
return;
|
474
492
|
}
|
475
493
|
this.updateRemoteActions.push(fn);
|
@@ -479,7 +497,12 @@ let Collaborate = class Collaborate {
|
|
479
497
|
return;
|
480
498
|
}
|
481
499
|
this.updateFromRemote = true;
|
482
|
-
|
500
|
+
if (tr.origin === this.manager) {
|
501
|
+
this.scheduler.historyApplyTransact(fn);
|
502
|
+
}
|
503
|
+
else {
|
504
|
+
this.scheduler.remoteUpdateTransact(fn);
|
505
|
+
}
|
483
506
|
this.updateFromRemote = false;
|
484
507
|
}
|
485
508
|
createSharedComponentByComponent(component) {
|
@@ -582,6 +605,7 @@ let Collaborate = class Collaborate {
|
|
582
605
|
return slot;
|
583
606
|
}
|
584
607
|
cleanSubscriptionsBySlot(slot) {
|
608
|
+
this.contentMap.delete(slot);
|
585
609
|
[this.contentSyncCaches.get(slot), this.slotStateSyncCaches.get(slot)].forEach(fn => {
|
586
610
|
if (fn) {
|
587
611
|
fn();
|
@@ -606,8 +630,10 @@ let Collaborate = class Collaborate {
|
|
606
630
|
};
|
607
631
|
Collaborate = __decorate([
|
608
632
|
Injectable(),
|
609
|
-
|
633
|
+
__param(0, Inject(HISTORY_STACK_SIZE)),
|
634
|
+
__metadata("design:paramtypes", [Number, RootComponentRef,
|
610
635
|
CollaborateCursor,
|
636
|
+
Controller,
|
611
637
|
Scheduler,
|
612
638
|
Translator,
|
613
639
|
Registry,
|
@@ -618,7 +644,7 @@ export { Collaborate };
|
|
618
644
|
function makeFormats(registry, attrs) {
|
619
645
|
const formats = [];
|
620
646
|
if (attrs) {
|
621
|
-
Object.keys(attrs).
|
647
|
+
Object.keys(attrs).forEach(key => {
|
622
648
|
const formatter = registry.getFormatter(key);
|
623
649
|
if (formatter) {
|
624
650
|
formats.push([formatter, attrs[key]]);
|
@@ -627,4 +653,4 @@ function makeFormats(registry, attrs) {
|
|
627
653
|
}
|
628
654
|
return formats;
|
629
655
|
}
|
630
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3JhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLFdBQVcsQ0FBQTtBQUN0QyxPQUFPLEVBQWMsT0FBTyxFQUFnQixNQUFNLGVBQWUsQ0FBQTtBQUNqRSxPQUFPLEVBRUwsV0FBVyxFQUdYLFNBQVMsRUFDVCxRQUFRLEVB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Nhbkluc2VydElubGluZUNvbXBvbmVudCA9IHNsb3Quc2NoZW1hLmluY2x1ZGVzKENvbnRlbnRUeXBlLklubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNhbkluc2VydElubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgdGhpcy5zeW5jU2xvdHMoc2hhcmVkQ29tcG9uZW50LmdldCgnc2xvdHMnKSwgY29tcG9uZW50KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNDb21wb25lbnQoc2hhcmVkQ29tcG9uZW50LCBjb21wb25lbnQpXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGNvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLnNlbGVjdGlvbi5pc1NlbGVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmIChzbG90ID09PSB0aGlzLnNlbGVjdGlvbi5zdGFydFNsb3QgJiYgdGhpcy5zZWxlY3Rpb24uc3RhcnRPZmZzZXQhID49IGluZGV4KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3Rpb24uc2V0U3RhcnQoc2xvdCwgdGhpcy5zZWxlY3Rpb24uc3RhcnRPZmZzZXQhICsgbGVuZ3RoKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChzbG90ID09PSB0aGlzLnNlbGVjdGlvbi5lbmRTbG90ICYmIHRoaXMuc2VsZWN0aW9uLmVuZE9mZnNldCEgPj0gaW5kZXgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGlvbi5zZXRFbmQoc2xvdCwgdGhpcy5zZWxlY3Rpb24uZW5kT2Zmc2V0ISArIGxlbmd0aClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0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3Qub25Db250ZW50Q2hhbmdlLnN1YnNjcmliZShhY3Rpb25zID0+IHtcbiAgICAgIHRoaXMucnVuTG9jYWxVcGRhdGUoKCkgPT4ge1xuICAgICAgICBsZXQgb2Zmc2V0ID0gMFxuICAgICAgICBsZXQgbGVuZ3RoID0gMFxuICAgICAgICBmb3IgKGNvbnN0IGFjdGlvbiBvZiBhY3Rpb25zKSB7XG4gICAgICAgICAgaWYgKGFjdGlvbi50eXBlID09PSAncmV0YWluJykge1xuICAgICAgICAgICAgY29uc3QgZm9ybWF0cyA9IGFjdGlvbi5mb3JtYXRzXG4gICAgICAgICAgICBpZiAoZm9ybWF0cykge1xuICAgICAgICAgICAgICBjb25zdCBrZXlzID0gT2JqZWN0LmtleXMoZm9ybWF0cylcbiAgICAgICAgICAgICAgbGV0IGxlbmd0aCA9IGtleXMubGVuZ3RoXG4gICAgICAgICAgICAgIGtleXMuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5yZWdpc3RyeS5nZXRGb3JtYXR0ZXIoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgbGVuZ3RoLS1cbiAgICAgICAgICAgICAgICAgIFJlZmxlY3QuZGVsZXRlUHJvcGVydHkoZm9ybWF0cywga2V5KVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgaWYgKGxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGNvbnRlbnQuZm9ybWF0KG9mZnNldCwgYWN0aW9uLm9mZnNldCwgZm9ybWF0cylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgb2Zmc2V0ID0gYWN0aW9uLm9mZnNldFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdpbnNlcnQnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbnRlbnQudG9EZWx0YSgpXG4gICAgICAgICAgICBjb25zdCBpc0VtcHR5ID0gZGVsdGEubGVuZ3RoID09PSAxICYmIGRlbHRhWzBdLmluc2VydCA9PT0gU2xvdC5lbXB0eVBsYWNlaG9sZGVyXG4gICAgICAgICAgICBpZiAodHlwZW9mIGFjdGlvbi5jb250ZW50ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICBsZW5ndGggPSBhY3Rpb24uY29udGVudC5sZW5ndGhcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnQob2Zmc2V0LCBhY3Rpb24uY29udGVudClcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IDFcbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gc2xvdC5nZXRDb250ZW50QXRJbmRleChvZmZzZXQpIGFzIENvbXBvbmVudEluc3RhbmNlXG4gICAgICAgICAgICAgIGNvbnN0IHNoYXJlZENvbXBvbmVudCA9IHRoaXMuY3JlYXRlU2hhcmVkQ29tcG9uZW50QnlDb21wb25lbnQoY29tcG9uZW50KVxuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydEVtYmVkKG9mZnNldCwgc2hhcmVkQ29tcG9uZW50KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjdGlvbi5mb3JtYXRzKSB7XG4gICAgICAgICAgICAgIGNvbnRlbnQuZm9ybWF0KG9mZnNldCwgbGVuZ3RoLCBhY3Rpb24uZm9ybWF0cylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc0VtcHR5ICYmIG9mZnNldCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50LmRlbGV0ZShjb250ZW50Lmxlbmd0aCAtIDEsIDEpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvZmZzZXQgKz0gbGVuZ3RoXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2RlbGV0ZScpIHtcbiAgICAgICAgICA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VxuICAgICAgICAgICAgaW5kZXggKz0gYWN0aW9uLnJldGFpblxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmluc2VydCkge1xuICAgICAgICAgICAgKGFjdGlvbi5pbnNlcnQgYXMgQXJyYXk8WU1hcDxhbnk+PikuZm9yRWFjaChpdGVtID0+IHtcbiAgICAgICAgICAgICAgY29uc3Qgc2xvdCA9IHRoaXMuY3JlYXRlU2xvdEJ5U2hhcmVkU2xvdChpdGVtKVxuICAgICAgICAgICAgICBzbG90cy5pbnNlcnQoc2xvdClcbiAgICAgICAgICAgICAgdGhpcy5zeW5jQ29udGVudChpdGVtLmdldCgnY29udGVudCcpLCBzbG90KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNTbG90KGl0ZW0sIHNsb3QpXG4gICAgICAgICAgICAgIGluZGV4KytcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZGVsZXRlKSB7XG4gICAgICAgICAgICBzbG90cy5yZXRhaW4oaW5kZXgpXG4gICAgICAgICAgICBzbG90cy5kZWxldGUoYWN0aW9uLmRlbGV0ZSlcbiAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICB9KVxuICAgIH1cbiAgICByZW1vdGVTbG90cy5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90cy5vbkNoYW5nZS5zdWJzY3JpYmUob3BlcmF0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgY29uc3QgYXBwbHlBY3Rpb25zID0gb3BlcmF0aW9ucy5hcHBseVxuICAgICAgICBsZXQgaW5kZXg6IG51bWJlclxuICAgICAgICBhcHBseUFjdGlvbnMuZm9yRWFjaChhY3Rpb24gPT4ge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGluZGV4ID0gYWN0aW9uLm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gICAgICBhbmNob3I6IGFuY2hvclBvc2l0aW9uXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBudWxsXG4gIH1cblxuICBwcml2YXRlIHN5bmNDb250ZW50KGNvbnRlbnQ6IFlUZXh0LCBzbG90OiBTbG90KSB7XG4gICAgdGhpcy5jb250ZW50TWFwLnNldChzbG90LCBjb250ZW50KVxuICAgIGNvbnN0IHN5bmNSZW1vdGUgPSAoZXYsIHRyKSA9PiB7XG4gICAgICB0aGlzLnJ1blJlbW90ZVVwZGF0ZSh0ciwgKCkgPT4ge1xuICAgICAgICBzbG90LnJldGFpbigwKVxuICAgICAgICBldi5kZWx0YS5mb3JFYWNoKGFjdGlvbiA9PiB7XG4gICAgICAgICAgaWYgKFJlZmxlY3QuaGFzKGFjdGlvbiwgJ3JldGFpbicpKSB7XG4gICAgICAgICAgICBpZiAoYWN0aW9uLmF0dHJpYnV0ZXMpIHtcbiAgICAgICAgICAgICAgY29uc3QgZm9ybWF0cyA9IG1ha2VGb3JtYXRzKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKVxuICAgICAgICAgICAgICBpZiAoZm9ybWF0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzbG90LnJldGFpbihhY3Rpb24ucmV0YWluISwgZm9ybWF0cylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzbG90LnJldGFpbihzbG90LmluZGV4ICsgYWN0aW9uLnJldGFpbilcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHNsb3QucmV0YWluKGFjdGlvbi5yZXRhaW4pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uaW5zZXJ0KSB7XG4gICAgICAgICAgICBjb25zdCBpbmRleCA9IHNsb3QuaW5kZXhcbiAgICAgICAgICAgIGxldCBsZW5ndGggPSAxXG4gICAgICAgICAgICBpZiAodHlwZW9mIGFjdGlvbi5pbnNlcnQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IGFjdGlvbi5pbnNlcnQubGVuZ3RoXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGFjdGlvbi5pbnNlcnQsIG1ha2VGb3JtYXRzKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbnN0IHNoYXJlZENvbXBvbmVudCA9IGFjdGlvbi5pbnNlcnQgYXMgWU1hcDxhbnk+XG4gICAgICAgICAgICAgIGNvbnN0IGNhbkluc2VydElubGluZUNvbXBvbmVudCA9IHNsb3Quc2NoZW1hLmluY2x1ZGVzKENvbnRlbnRUeXBlLklubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNhbkluc2VydElubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgdGhpcy5zeW5jU2xvdHMoc2hhcmVkQ29tcG9uZW50LmdldCgnc2xvdHMnKSwgY29tcG9uZW50KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNDb21wb25lbnQoc2hhcmVkQ29tcG9uZW50LCBjb21wb25lbnQpXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGNvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLnNlbGVjdGlvbi5pc1NlbGVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmIChzbG90ID09PSB0aGlzLnNlbGVjdGlvbi5hbmNob3JTbG90ICYmIHRoaXMuc2VsZWN0aW9uLmFuY2hvck9mZnNldCEgPiBpbmRleCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLnNldEFuY2h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LnNlbGVjdGlvbi5mb2N1c09mZnNldCEgLSBhY3Rpb24uZGVsZXRlKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uYXR0cmlidXRlcykge1xuICAgICAgICAgICAgc2xvdC51cGRhdGVTdGF0ZShkcmFmdCA9PiB7XG4gICAgICAgICAgICAgIGlmICh0eXBlb2YgZHJhZnQgPT09ICdvYmplY3QnICYmIGRyYWZ0ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihkcmFmdCwgYWN0aW9uLmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFjdGlvbi5hdHRyaWJ1dGVzXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfSlcbiAgICB9XG4gICAgY29udGVudC5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90Lm9uQ29udGVudENoYW5nZS5zdWJzY3JpYmUoYWN0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgbGV0IG9mZnNldCA9IDBcbiAgICAgICAgbGV0IGxlbmd0aCA9IDBcbiAgICAgICAgZm9yIChjb25zdCBhY3Rpb24gb2YgYWN0aW9ucykge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHMgPSBhY3Rpb24uZm9ybWF0c1xuICAgICAgICAgICAgaWYgKGZvcm1hdHMpIHtcbiAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKGZvcm1hdHMpXG4gICAgICAgICAgICAgIGxldCBsZW5ndGggPSBrZXlzLmxlbmd0aFxuICAgICAgICAgICAgICBrZXlzLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMucmVnaXN0cnkuZ2V0Rm9ybWF0dGVyKGtleSkpIHtcbiAgICAgICAgICAgICAgICAgIGxlbmd0aC0tXG4gICAgICAgICAgICAgICAgICBSZWZsZWN0LmRlbGV0ZVByb3BlcnR5KGZvcm1hdHMsIGtleSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGFjdGlvbi5vZmZzZXQsIGZvcm1hdHMpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIG9mZnNldCA9IGFjdGlvbi5vZmZzZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnaW5zZXJ0Jykge1xuICAgICAgICAgICAgY29uc3QgZGVsdGEgPSBjb250ZW50LnRvRGVsdGEoKVxuICAgICAgICAgICAgY29uc3QgaXNFbXB0eSA9IGRlbHRhLmxlbmd0aCA9PT0gMSAmJiBkZWx0YVswXS5pbnNlcnQgPT09IFNsb3QuZW1wdHlQbGFjZWhvbGRlclxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhY3Rpb24uY29udGVudCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gYWN0aW9uLmNvbnRlbnQubGVuZ3RoXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0KG9mZnNldCwgYWN0aW9uLmNvbnRlbnQsIGFjdGlvbi5mb3JtYXRzIHx8IHt9KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gMVxuICAgICAgICAgICAgICBjb25zdCBzaGFyZWRDb21wb25lbnQgPSB0aGlzLmNyZWF0ZVNoYXJlZENvbXBvbmVudEJ5Q29tcG9uZW50KGFjdGlvbi5yZWYgYXMgQ29tcG9uZW50SW5zdGFuY2UpXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0RW1iZWQob2Zmc2V0LCBzaGFyZWRDb21wb25lbnQpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChpc0VtcHR5ICYmIG9mZnNldCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50LmRlbGV0ZShjb250ZW50Lmxlbmd0aCAtIDEsIDEpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvZmZzZXQgKz0gbGVuZ3RoXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2RlbGV0ZScpIHtcbiAgICAgICAgICAgIGNvbnN0IGRlbHRhID0gY29udGVudC50b0RlbHRhKClcbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCkge1xuICAgICAgICAgICAgICBjb250ZW50LmRlbGV0ZShvZmZzZXQsIGFjdGlvbi5jb3VudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydCgwLCAnXFxuJywgZGVsdGFbMF0/LmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG5cbiAgICBzdWIuYWRkKHNsb3Qub25DaGlsZENvbXBvbmVudFJlbW92ZS5zdWJzY3JpYmUoY29tcG9uZW50cyA9PiB7XG4gICAgICBjb21wb25lbnRzLmZvckVhY2goYyA9PiB7XG4gICAgICAgIHRoaXMuY2xlYW5TdWJzY3JpcHRpb25zQnlDb21wb25lbnQoYylcbiAgICAgIH0pXG4gICAgfSkpXG4gICAgdGhpcy5jb250ZW50U3luY0NhY2hlcy5zZXQoc2xvdCwgKCkgPT4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AgICAgICAgICAgICAgaW5kZXgrK1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5kZWxldGUpIHtcbiAgICAgICAgICAgIHNsb3RzLnJldGFpbihpbmRleClcbiAgICAgICAgICAgIHNsb3RzLmRlbGV0ZShhY3Rpb24uZGVsZXRlKVxuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgIH0pXG4gICAgfVxuICAgIHJlbW90ZVNsb3RzLm9ic2VydmUoc3luY1JlbW90ZSlcblxuICAgIGNvbnN0IHN1YiA9IHNsb3RzLm9uQ2hhbmdlLnN1YnNjcmliZShvcGVyYXRpb25zID0+IHtcbiAgICAgIHRoaXMucnVuTG9jYWxVcGRhdGUoKCkgPT4ge1xuICAgICAgICBjb25zdCBhcHBseUFjdGlvbnMgPSBvcGVyYXRpb25zLmFwcGx5XG4gICAgICAgIGxldCBpbmRleDogbnVtYmVyXG4gICAgICAgIGFwcGx5QWN0aW9ucy5mb3JFYWNoKGFjdGlvbiA9PiB7XG4gICAgICAgICAgaWYgKGFjdGlvbi50eXBlID09PSAncmV0YWluJykge1xuICAgICAgICAgICAgaW5kZXggPSBhY3Rpb24ub2Zmc2V0XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2luc2VydFNsb3QnKSB7XG4gICAgICAgICAgICBjb25zdCBzaGFyZWRTbG90ID0gdGhpcy5jcmVhdGVTaGFyZWRTbG90QnlTbG90KGFjdGlvbi5yZWYpXG4gICAgICAgICAgICByZW1vdGVTbG90cy5pbnNlcnQoaW5kZXgsIFtzaGFyZWRTbG90XSlcbiAgICAgICAgICAgIGluZGV4KytcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnZGVsZXRlJykge1xuICAgICAgICAgICAgcmVtb3RlU2xvdHMuZGVsZXRlKGluZGV4LCBhY3Rpb24uY291bnQpXG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgf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pbmVDb21wb25lbnQgPSBzbG90LnNjaGVtYS5pbmNsdWRlcyhDb250ZW50VHlwZS5JbmxpbmVDb21wb25lbnQpXG4gICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNhbkluc2VydElubGluZUNvbXBvbmVudClcbiAgICAgICAgICBzbG90Lmluc2VydChjb21wb25lbnQpXG4gICAgICAgICAgdGhpcy5zeW5jU2xvdHMoc2hhcmVkQ29tcG9uZW50LmdldCgnc2xvdHMnKSwgY29tcG9uZW50KVxuICAgICAgICAgIHRoaXMuc3luY0NvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNvbXBvbmVudClcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3cgY29sbGFib3JhdGVFcnJvckZuKCd1bmV4cGVjdGVkIGRlbHRhIGFjdGlvbi4nKVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc2xvdFxuICB9XG5cbiAgcHJpdmF0ZSBjbGVhblN1YnNjcmlwdGlvbnNCeVNsb3Qoc2xvdDogU2xvdCkge1xuICAgIHRoaXMuY29udGVudE1hcC5kZWxldGUoc2xvdCk7XG4gICAgW3RoaXMuY29udGVudFN5bmNDYWNoZXMuZ2V0KHNsb3QpLCB0aGlzLnNsb3RTdGF0ZVN5bmNDYWNoZXMuZ2V0KHNsb3QpXS5mb3JFYWNoKGZuID0+IHtcbiAgICAgIGlmIChmbikge1xuICAgICAgICBmbigpXG4gICAgICB9XG4gICAgfSlcbiAgICBzbG90LnNsaWNlQ29udGVudCgpLmZvckVhY2goaSA9PiB7XG4gICAgICBpZiAodHlwZW9mIGkgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgIHRoaXMuY2xlYW5TdWJzY3JpcHRpb25zQnlDb21wb25lbnQoaSlcbiAgICAgIH1cbiAgICB9KVxuICB9XG5cbiAgcHJpdmF0ZS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