@dao42/d42paas-front 0.6.4 → 0.6.5

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.
@@ -14713,20 +14713,29 @@ const daopaasDB = openDB("daopaas", 1, {
14713
14713
  });
14714
14714
  async function setReplaySource(val) {
14715
14715
  const {
14716
- CRDTInfo,
14716
+ CRDTInfo: CRDTInfo2,
14717
14717
  appStatus,
14718
14718
  globalData
14719
14719
  } = oTStore.getState();
14720
14720
  if (appStatus === "replay")
14721
14721
  return;
14722
+ if (val.event === "editor") {
14723
+ val.editor.revision++;
14724
+ }
14722
14725
  return (await daopaasDB).put("crdts", __spreadProps(__spreadValues({}, val), {
14723
14726
  userInfo: lodash$2.exports.pick(val.userInfo, ["uuid", "role"]),
14724
14727
  file: lodash$2.exports.omit(val.file, "value")
14725
14728
  }), val.timestamp + "." + v4$1().split("-")[0]);
14726
14729
  }
14730
+ async function getLocalFile(key) {
14731
+ return (await daopaasDB).get("files", key);
14732
+ }
14727
14733
  async function getLocalReplayFile(key) {
14728
14734
  return (await daopaasDB).get("replayFiles", key);
14729
14735
  }
14736
+ async function getAllLocalReplayFile() {
14737
+ return (await daopaasDB).getAll("replayFiles");
14738
+ }
14730
14739
  async function setLocalFile(key, val) {
14731
14740
  return (await daopaasDB).put("files", val, key);
14732
14741
  }
@@ -28355,7 +28364,7 @@ const PlaygroundInit = (arg) => {
28355
28364
  playgroundId,
28356
28365
  io
28357
28366
  } = arg;
28358
- reactDom.exports.unstable_batchedUpdates(() => {
28367
+ reactDom.exports.unstable_batchedUpdates(async () => {
28359
28368
  const setUserInfo = userStore.getState().setUserInfo;
28360
28369
  const setUserList = userListStore.getState().setUserList;
28361
28370
  const {
@@ -28379,6 +28388,12 @@ const PlaygroundInit = (arg) => {
28379
28388
  setGlobalData
28380
28389
  } = oTStore.getState();
28381
28390
  shadowUserStore.getState();
28391
+ const allFiles = await getAllLocalReplayFile();
28392
+ allFiles.forEach((f2) => {
28393
+ setLocalReplayFile(f2.path, __spreadProps(__spreadValues({}, f2), {
28394
+ revision: 0
28395
+ }));
28396
+ });
28382
28397
  window.clearCache = () => {
28383
28398
  localStorage.clear();
28384
28399
  indexedDB.deleteDatabase("daopaas").onsuccess = () => {
@@ -28436,13 +28451,15 @@ const PlaygroundInit = (arg) => {
28436
28451
  setCRDTInfo2(crdt);
28437
28452
  const otPlaygroundInfo = oTStore.getState().playgroundInfo;
28438
28453
  setPlaygroundInfo(__spreadProps(__spreadValues(__spreadValues({}, playgroundInfo), otPlaygroundInfo), {
28439
- activeDockerId: dockerInfo2.dockerId
28454
+ activeDockerId: dockerInfo2 == null ? void 0 : dockerInfo2.dockerId
28440
28455
  }));
28441
- (_a2 = otPlaygroundInfo == null ? void 0 : otPlaygroundInfo.dockerInfos) == null ? void 0 : _a2.set(dockerInfo2.dockerId, dockerInfo2);
28442
- setDockerInfo(__spreadValues(__spreadValues({}, oTStore.getState().dockerInfo), dockerInfo2));
28443
- dockerInfo2.fileTree && switchFileTree({
28444
- data: dockerInfo2.fileTree
28445
- });
28456
+ if (dockerInfo2) {
28457
+ (_a2 = otPlaygroundInfo == null ? void 0 : otPlaygroundInfo.dockerInfos) == null ? void 0 : _a2.set(dockerInfo2.dockerId, dockerInfo2);
28458
+ setDockerInfo(__spreadValues(__spreadValues({}, oTStore.getState().dockerInfo), dockerInfo2));
28459
+ dockerInfo2.fileTree && switchFileTree({
28460
+ data: dockerInfo2.fileTree
28461
+ });
28462
+ }
28446
28463
  });
28447
28464
  io.on("playgroundStatus", (data) => {
28448
28465
  setPlaygroundStatus(data);
@@ -28451,7 +28468,7 @@ const PlaygroundInit = (arg) => {
28451
28468
  setDockerStatus(data || "STOP");
28452
28469
  });
28453
28470
  io.on("fileContent", async (d2) => {
28454
- var _a2, _b2, _c2, _d3;
28471
+ var _a2, _b2, _c2;
28455
28472
  const _d2 = JSON.parse(d2);
28456
28473
  setCRDTInfo2(_d2);
28457
28474
  setAsyncType("file");
@@ -28462,7 +28479,11 @@ const PlaygroundInit = (arg) => {
28462
28479
  switchDoc2(_d2.file);
28463
28480
  (await daopaasDB).put("files", (_a2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _a2.value, (_b2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _b2.path);
28464
28481
  if (!await getLocalReplayFile(_d2.file.path)) {
28465
- setLocalReplayFile((_c2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _c2.path, (_d3 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _d3.value);
28482
+ setLocalReplayFile((_c2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _c2.path, {
28483
+ value: _d2.file.value,
28484
+ revision: 0,
28485
+ path: _d2.file.path
28486
+ });
28466
28487
  }
28467
28488
  }
28468
28489
  });
@@ -28484,7 +28505,7 @@ const PlaygroundInit = (arg) => {
28484
28505
  io.on("saveFile", (d2) => {
28485
28506
  JSON.parse(d2);
28486
28507
  });
28487
- io.on("customAck", (d2) => {
28508
+ io.on("customAck", async (d2) => {
28488
28509
  const _d2 = JSON.parse(d2);
28489
28510
  setCRDTInfo2(_d2);
28490
28511
  setAsyncType("editor");
@@ -28507,14 +28528,20 @@ const PlaygroundInit = (arg) => {
28507
28528
  return;
28508
28529
  }
28509
28530
  });
28510
- io.on("serverAck", (d2) => {
28511
- var _a2;
28531
+ io.on("serverAck", async (d2) => {
28532
+ var _a2, _b2;
28512
28533
  const _d2 = JSON.parse(d2);
28513
28534
  setAsyncType("editor");
28535
+ const file = await getLocalReplayFile(_d2.file.path);
28536
+ setLocalReplayFile((_a2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _a2.path, {
28537
+ value: file.value,
28538
+ revision: file.revision + 1,
28539
+ path: _d2.file.path
28540
+ });
28514
28541
  setReplaySource(__spreadProps(__spreadValues({}, _d2), {
28515
28542
  event: "editor",
28516
28543
  editor: __spreadProps(__spreadValues({}, _d2.editor), {
28517
- revision: (_a2 = _d2.editor) == null ? void 0 : _a2.revision
28544
+ revision: (_b2 = _d2.editor) == null ? void 0 : _b2.revision
28518
28545
  })
28519
28546
  }));
28520
28547
  setServerAck();
@@ -32704,42 +32731,65 @@ const {
32704
32731
  switchDoc,
32705
32732
  setCRDTInfo,
32706
32733
  dockerInfo,
32707
- doc
32734
+ doc,
32735
+ CRDTInfo
32708
32736
  } = oTStore.getState();
32709
32737
  const replay = async (passInData) => {
32738
+ var _a2, _b2, _c2;
32710
32739
  setAppStatus("replay");
32740
+ let operation;
32711
32741
  const replayList = await getLocalCRDTs();
32712
32742
  const filterReplayList = replayList.filter((replayItem) => replayItem.userInfo.uuid === passInData.userId);
32713
- let filterReplaySource = null;
32714
- filterReplayList.some((nowTimeData, index2, array3) => {
32715
- if (dayjs$1(passInData.timestamp).isSame(nowTimeData.timestamp) || dayjs$1(passInData.timestamp).isBefore(nowTimeData.timestamp)) {
32716
- filterReplaySource = nowTimeData;
32717
- return true;
32718
- }
32719
- });
32743
+ const currentFilter = filterReplayList.filter((f2) => dayjs$1(passInData.timestamp).isSame(f2.timestamp) || dayjs$1(passInData.timestamp).isBefore(f2.timestamp));
32744
+ const filterReplaySource = currentFilter[0];
32745
+ const replayFile = await getLocalReplayFile(filterReplaySource.file.path);
32746
+ const localFile = await getLocalFile(filterReplaySource.file.path);
32720
32747
  if (filterReplaySource.event === "editor") {
32721
- const tempFilter = filterReplayList.filter((x2) => x2.event === "editor");
32722
- let composeOperation = new TextOperation();
32723
- let i2 = 0;
32724
- while (filterReplaySource.editor.revision > tempFilter[i2].editor.revision) {
32725
- composeOperation = composeOperation.compose(TextOperation.fromJSON(tempFilter[i2].editor.operation));
32726
- filterReplaySource.editor.operation = composeOperation.toJSON();
32727
- i2++;
32748
+ const tempFilter = filterReplayList.filter((x2) => x2.event === "editor").filter((x2) => {
32749
+ var _a3;
32750
+ return ((_a3 = x2.file) == null ? void 0 : _a3.path) === replayFile.path;
32751
+ });
32752
+ const operationFilter = filterReplaySource.editor.revision > replayFile.revision ? tempFilter.filter((x2) => x2.editor.revision <= filterReplaySource.editor.revision).filter((x2) => x2.editor.revision > replayFile.revision) : tempFilter.filter((x2) => x2.editor.revision > filterReplaySource.editor.revision).filter((x2) => x2.editor.revision <= replayFile.revision);
32753
+ if (filterReplaySource.editor.revision > replayFile.revision) {
32754
+ operation = operationFilter.reduce((currentOp, nextOp, _index) => {
32755
+ const NextOP = TextOperation.fromJSON(nextOp.editor.operation);
32756
+ if (currentOp.targetLength === NextOP.baseLength) {
32757
+ return currentOp.compose(NextOP);
32758
+ } else {
32759
+ return NextOP.compose(currentOp);
32760
+ }
32761
+ }, new TextOperation().retain(replayFile.revision === 0 ? replayFile.value.length : localFile.value.length));
32762
+ } else {
32763
+ operation = operationFilter.length === 1 ? TextOperation.fromJSON(operationFilter[0].editor.operation).invert(localFile.value) : operationFilter.reduce((currentOp, nextOp, _index) => {
32764
+ const NextOP = TextOperation.fromJSON(nextOp.editor.operation);
32765
+ if (currentOp.editor) {
32766
+ return TextOperation.fromJSON(currentOp.editor.operation).compose(NextOP);
32767
+ } else {
32768
+ return currentOp.compose(NextOP);
32769
+ }
32770
+ }).invert(localFile.value);
32728
32771
  }
32772
+ filterReplaySource.editor.operation = operation.toJSON();
32729
32773
  }
32730
32774
  if (filterReplaySource.file) {
32731
32775
  if (!filterReplaySource.file)
32732
32776
  return;
32733
- const doc2 = await getLocalReplayFile(filterReplaySource.file.path);
32777
+ setLocalFile(filterReplaySource.file.path, __spreadProps(__spreadValues({}, localFile), {
32778
+ value: replayFile.revision === 0 ? operation == null ? void 0 : operation.apply(replayFile.value) : operation == null ? void 0 : operation.apply(localFile.value)
32779
+ }));
32734
32780
  switchDoc == null ? void 0 : switchDoc({
32735
- value: doc2,
32781
+ value: replayFile.value,
32736
32782
  path: filterReplaySource.file.path
32737
32783
  });
32738
32784
  }
32785
+ console.log(oTStore.getState().appStatus);
32786
+ setLocalReplayFile((_a2 = filterReplaySource == null ? void 0 : filterReplaySource.file) == null ? void 0 : _a2.path, __spreadProps(__spreadValues({}, replayFile), {
32787
+ revision: (_b2 = filterReplaySource == null ? void 0 : filterReplaySource.editor) == null ? void 0 : _b2.revision,
32788
+ path: (_c2 = filterReplaySource == null ? void 0 : filterReplaySource.file) == null ? void 0 : _c2.path
32789
+ }));
32739
32790
  setTimeout(() => {
32740
32791
  setCRDTInfo(__spreadValues({}, filterReplaySource));
32741
32792
  }, 0);
32742
- setAppStatus("code");
32743
32793
  };
32744
32794
  var index$6 = "";
32745
32795
  const ignoreReplayerStore = create$3((set2) => ({
@@ -46753,7 +46803,7 @@ const FileTree = ({
46753
46803
  const [remoteUserList, setRemoteUserList] = react.exports.useState({});
46754
46804
  const treeRef = react.exports.useRef(null);
46755
46805
  const {
46756
- CRDTInfo,
46806
+ CRDTInfo: CRDTInfo2,
46757
46807
  dockerInfo: dockerInfo2
46758
46808
  } = oTStore((state) => state);
46759
46809
  const {
@@ -46856,8 +46906,11 @@ const FileTree = ({
46856
46906
  const items = event.dataTransfer.items;
46857
46907
  if (items.length === 0)
46858
46908
  return;
46859
- for (let i2 = 0; i2 < items.length; i2++) {
46860
- const item = items[i2].webkitGetAsEntry();
46909
+ const itemsIterate = [];
46910
+ for (const i2 of items) {
46911
+ itemsIterate.push(i2.webkitGetAsEntry());
46912
+ }
46913
+ for (const item of itemsIterate) {
46861
46914
  if (item) {
46862
46915
  addedFolder.files = addedFolder.files.concat(await traverseFileTree(item));
46863
46916
  }
@@ -46906,14 +46959,14 @@ const FileTree = ({
46906
46959
  }
46907
46960
  }, [treeRef]);
46908
46961
  const onUploadFile = (payload) => {
46909
- io.emit("upload", payload);
46962
+ io == null ? void 0 : io.emit("upload", payload);
46910
46963
  };
46911
46964
  react.exports.useEffect(() => {
46912
46965
  var _a2, _b2;
46913
- const user = userListStore.getState().userList.find((item) => item.uuid === CRDTInfo.userInfo.uuid);
46914
- if (((_a2 = CRDTInfo == null ? void 0 : CRDTInfo.editor) == null ? void 0 : _a2.evtType) === "File" && user) {
46915
- const path = (_b2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _b2.path;
46916
- if (!IsMe(CRDTInfo.userInfo)) {
46966
+ const user = userListStore.getState().userList.find((item) => item.uuid === CRDTInfo2.userInfo.uuid);
46967
+ if (((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.editor) == null ? void 0 : _a2.evtType) === "File" && user) {
46968
+ const path = (_b2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _b2.path;
46969
+ if (!IsMe(CRDTInfo2.userInfo)) {
46917
46970
  setRemoteUserList((oldUserListItem) => {
46918
46971
  const userListItem = __spreadValues({}, oldUserListItem);
46919
46972
  const remoteUserListObj = Object.entries(userListItem);
@@ -46963,7 +47016,7 @@ const FileTree = ({
46963
47016
  }
46964
47017
  }
46965
47018
  }
46966
- }, [CRDTInfo]);
47019
+ }, [CRDTInfo2]);
46967
47020
  return /* @__PURE__ */ jsx(FollowLayout, {
46968
47021
  name: "file",
46969
47022
  children: /* @__PURE__ */ jsx("div", {
@@ -187895,7 +187948,7 @@ const Editor = ({
187895
187948
  value,
187896
187949
  path,
187897
187950
  language: language2,
187898
- CRDTInfo,
187951
+ CRDTInfo: CRDTInfo2,
187899
187952
  doc: doc22
187900
187953
  }) => {
187901
187954
  var _a2;
@@ -187908,7 +187961,7 @@ const Editor = ({
187908
187961
  model: gotModel
187909
187962
  }]);
187910
187963
  }
187911
- client2.revision = ((_a2 = CRDTInfo.editor) == null ? void 0 : _a2.revision) ? CRDTInfo.editor.revision : 0;
187964
+ client2.revision = ((_a2 = CRDTInfo2.editor) == null ? void 0 : _a2.revision) ? CRDTInfo2.editor.revision : 0;
187912
187965
  editor.setModel(gotModel);
187913
187966
  if (file) {
187914
187967
  docServer.set(file.path, {
@@ -187928,6 +187981,11 @@ const Editor = ({
187928
187981
  extensions: [".rb"],
187929
187982
  aliases: ["ruby", "RUBY"]
187930
187983
  });
187984
+ languages.register({
187985
+ id: "go",
187986
+ extensions: [".go"],
187987
+ aliases: ["go", "GO"]
187988
+ });
187931
187989
  languages.register({
187932
187990
  id: "python",
187933
187991
  extensions: [".py"],
@@ -187966,7 +188024,7 @@ const Editor = ({
187966
188024
  const languageClient = new lib.MonacoLanguageClient({
187967
188025
  name: "Language Client",
187968
188026
  clientOptions: {
187969
- documentSelector: ["java", "ruby", "python"],
188027
+ documentSelector: ["java", "ruby", "python", "go"],
187970
188028
  errorHandler: {
187971
188029
  error: () => lib.ErrorAction.Continue,
187972
188030
  closed: () => lib.CloseAction.DoNotRestart
@@ -187985,10 +188043,10 @@ const Editor = ({
187985
188043
  };
187986
188044
  const switchModel = (model) => {
187987
188045
  const {
187988
- CRDTInfo,
188046
+ CRDTInfo: CRDTInfo2,
187989
188047
  setCRDTInfo: setCRDTInfo2
187990
188048
  } = oTStore.getState();
187991
- setCRDTInfo2(__spreadProps(__spreadValues({}, CRDTInfo), {
188049
+ setCRDTInfo2(__spreadProps(__spreadValues({}, CRDTInfo2), {
187992
188050
  file: {
187993
188051
  action: "Get",
187994
188052
  value: model.getValue(),
@@ -188098,20 +188156,20 @@ const Editor = ({
188098
188156
  react.exports.useEffect(() => {
188099
188157
  var _a2, _b2, _c2;
188100
188158
  const {
188101
- CRDTInfo,
188159
+ CRDTInfo: CRDTInfo2,
188102
188160
  doc: doc22,
188103
188161
  serverAck,
188104
188162
  appStatus
188105
188163
  } = oTStore.getState();
188106
188164
  useValue.getState();
188107
- if (!CRDTInfo.editor || CRDTInfo.editor.evtType !== "Editor")
188165
+ if (!CRDTInfo2.editor || CRDTInfo2.editor.evtType !== "Editor")
188108
188166
  return;
188109
188167
  if (oTStore.getState().appStatus === "replay" && ignoreReplayerStore.getState().ignoreReplayers.some((d2) => d2 === "editor")) {
188110
188168
  return;
188111
188169
  }
188112
- if (editor && ((doc22 == null ? void 0 : doc22.path) === ((_a2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _a2.path) || ((_b2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _b2.path) === "singleFile")) {
188113
- const server_operation = CRDTInfo.editor.operation;
188114
- const CLIENT_OPERATION = receiveOperation(CRDTInfo.editor.revision, TextOperation.fromJSON(server_operation), (_c2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _c2.path);
188170
+ if (editor && ((doc22 == null ? void 0 : doc22.path) === ((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _a2.path) || ((_b2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _b2.path) === "singleFile")) {
188171
+ const server_operation = CRDTInfo2.editor.operation;
188172
+ const CLIENT_OPERATION = receiveOperation(CRDTInfo2.editor.revision, TextOperation.fromJSON(server_operation), (_c2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _c2.path);
188115
188173
  client2.applyServer(CLIENT_OPERATION.operation);
188116
188174
  const {
188117
188175
  ops
@@ -188151,14 +188209,14 @@ const Editor = ({
188151
188209
  react.exports.useEffect(() => {
188152
188210
  var _a2;
188153
188211
  const {
188154
- CRDTInfo
188212
+ CRDTInfo: CRDTInfo2
188155
188213
  } = oTStore.getState();
188156
188214
  const {
188157
188215
  shadowUser
188158
188216
  } = shadowUserStore.getState();
188159
- if (((_a2 = CRDTInfo == null ? void 0 : CRDTInfo.extend) == null ? void 0 : _a2.type) === "editor-scroll" && editor && shadowUser.uuid) {
188160
- editor.setScrollTop(editor.getScrollHeight() * Number(CRDTInfo.extend.topPercent));
188161
- editor.setScrollLeft(-(editor.getScrollWidth() * Number(CRDTInfo.extend.leftPercent)));
188217
+ if (((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.extend) == null ? void 0 : _a2.type) === "editor-scroll" && editor && shadowUser.uuid) {
188218
+ editor.setScrollTop(editor.getScrollHeight() * Number(CRDTInfo2.extend.topPercent));
188219
+ editor.setScrollLeft(-(editor.getScrollWidth() * Number(CRDTInfo2.extend.leftPercent)));
188162
188220
  }
188163
188221
  }, [OTSTATE.CRDTInfo.extend]);
188164
188222
  react.exports.useEffect(() => {
@@ -188166,7 +188224,7 @@ const Editor = ({
188166
188224
  if (!editor)
188167
188225
  return;
188168
188226
  const {
188169
- CRDTInfo,
188227
+ CRDTInfo: CRDTInfo2,
188170
188228
  doc: doc22,
188171
188229
  serverAck,
188172
188230
  appStatus
@@ -188176,8 +188234,8 @@ const Editor = ({
188176
188234
  setUsersDelta
188177
188235
  } = useValue.getState();
188178
188236
  editor.getModel();
188179
- if ((doc22 == null ? void 0 : doc22.path) === ((_a2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _a2.path)) {
188180
- if (CRDTInfo.selection) {
188237
+ if ((doc22 == null ? void 0 : doc22.path) === ((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _a2.path)) {
188238
+ if (CRDTInfo2.selection) {
188181
188239
  usersDelta.forEach((u2) => {
188182
188240
  let timer;
188183
188241
  const _label = document.querySelector(`.${u2.role}-label`);
@@ -188192,8 +188250,8 @@ const Editor = ({
188192
188250
  getPosition: function() {
188193
188251
  return {
188194
188252
  position: {
188195
- lineNumber: CRDTInfo.selection[0][7],
188196
- column: CRDTInfo.selection[0][6]
188253
+ lineNumber: CRDTInfo2.selection[0][7],
188254
+ column: CRDTInfo2.selection[0][6]
188197
188255
  },
188198
188256
  preference: [editor$1.ContentWidgetPositionPreference.ABOVE, editor$1.ContentWidgetPositionPreference.BELOW]
188199
188257
  };
@@ -188201,9 +188259,9 @@ const Editor = ({
188201
188259
  }));
188202
188260
  });
188203
188261
  setUsersDelta(usersDelta.map((deltaInfo) => {
188204
- if (deltaInfo.uuid === CRDTInfo.userInfo.uuid) {
188262
+ if (deltaInfo.uuid === CRDTInfo2.userInfo.uuid) {
188205
188263
  return __spreadProps(__spreadValues({}, deltaInfo), {
188206
- delta: editor.deltaDecorations(deltaInfo.delta ? deltaInfo.delta : "", (CRDTInfo == null ? void 0 : CRDTInfo.selection).map((s2) => ({
188264
+ delta: editor.deltaDecorations(deltaInfo.delta ? deltaInfo.delta : "", (CRDTInfo2 == null ? void 0 : CRDTInfo2.selection).map((s2) => ({
188207
188265
  range: new Range$4(s2[0], s2[1], s2[2], s2[3]),
188208
188266
  options: {
188209
188267
  isWholeLine: false,
@@ -188217,7 +188275,7 @@ const Editor = ({
188217
188275
  }
188218
188276
  }));
188219
188277
  }
188220
- if (((_b2 = CRDTInfo == null ? void 0 : CRDTInfo.editor) == null ? void 0 : _b2.evtType) === "Editor")
188278
+ if (((_b2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.editor) == null ? void 0 : _b2.evtType) === "Editor")
188221
188279
  ;
188222
188280
  }
188223
188281
  }, [OTSTATE.CRDTInfo.selection]);
@@ -188248,28 +188306,30 @@ const Editor = ({
188248
188306
  let egt = /\.(\w+$)/gim.exec(file.path);
188249
188307
  egt = egt ? egt : ["", file.path.substring(1)];
188250
188308
  const {
188251
- CRDTInfo,
188252
- doc: doc22
188309
+ CRDTInfo: CRDTInfo2,
188310
+ doc: doc22,
188311
+ appStatus,
188312
+ setAppStatus: setAppStatus2
188253
188313
  } = oTStore.getState();
188254
188314
  const {
188255
188315
  shadowUser
188256
188316
  } = shadowUserStore.getState();
188257
- if (file.path && egt && oTStore.getState().appStatus === "replay" && !ignoreReplayerStore.getState().ignoreReplayers.some((d2) => d2 === "editor")) {
188317
+ if (file.path && egt && appStatus === "replay" && !ignoreReplayerStore.getState().ignoreReplayers.some((d2) => d2 === "editor")) {
188258
188318
  updateLspOps({
188259
188319
  value: file.value,
188260
188320
  path: file.path,
188261
188321
  language: FExtension[egt[1]],
188262
- CRDTInfo,
188322
+ CRDTInfo: CRDTInfo2,
188263
188323
  doc: doc22
188264
188324
  });
188265
188325
  return;
188266
188326
  }
188267
- if (oTStore.getState().appStatus !== "replay" && (shadowUser.uuid || file.path && egt && IsMe(CRDTInfo.userInfo))) {
188327
+ if (appStatus !== "replay" && (shadowUser.uuid || file.path && egt && IsMe(CRDTInfo2.userInfo))) {
188268
188328
  updateLspOps({
188269
188329
  value: file.value,
188270
188330
  path: file.path,
188271
188331
  language: FExtension[egt[1]],
188272
- CRDTInfo,
188332
+ CRDTInfo: CRDTInfo2,
188273
188333
  doc: doc22
188274
188334
  });
188275
188335
  }
@@ -195489,9 +195549,7 @@ const Console = (_e2) => {
195489
195549
  }
195490
195550
  }, options);
195491
195551
  const [terminal, setTerminal] = react.exports.useState(null);
195492
- const {
195493
- CRDTInfo
195494
- } = oTStore((state) => state);
195552
+ const OTSTATE = oTStore((state) => state);
195495
195553
  const {
195496
195554
  dockerStatus
195497
195555
  } = oTStore((state) => state);
@@ -195522,11 +195580,11 @@ const Console = (_e2) => {
195522
195580
  var _a2;
195523
195581
  if (!terminal)
195524
195582
  return;
195525
- const crdt = CRDTInfo.console;
195583
+ const crdt = OTSTATE.CRDTInfo.console;
195526
195584
  if (crdt) {
195527
195585
  writeText(terminal, ((_a2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _a2.value) || "");
195528
195586
  }
195529
- }, [CRDTInfo.console]);
195587
+ }, [OTSTATE.CRDTInfo]);
195530
195588
  react.exports.useEffect(() => {
195531
195589
  if (!terminal)
195532
195590
  return;
@@ -195709,7 +195767,7 @@ const TerminalComponent = (_i) => {
195709
195767
  userLabel.classList.add("xterm-helper-user-label");
195710
195768
  const [terminal, setTerminal] = react.exports.useState(null);
195711
195769
  const {
195712
- CRDTInfo
195770
+ CRDTInfo: CRDTInfo2
195713
195771
  } = oTStore((state) => state);
195714
195772
  const initTerminalText = (terminal2, text2) => {
195715
195773
  terminal2.write("\r\n");
@@ -195746,25 +195804,25 @@ const TerminalComponent = (_i) => {
195746
195804
  var _a2, _b2, _c2, _d2;
195747
195805
  if (!terminal)
195748
195806
  return;
195749
- if (CRDTInfo.terminal) {
195807
+ if (CRDTInfo2.terminal) {
195750
195808
  initTerminalText(terminal, ((_d2 = (_c2 = (_b2 = (_a2 = oTStore.getState()) == null ? void 0 : _a2.CRDTInfo) == null ? void 0 : _b2.terminal) == null ? void 0 : _c2.doc) == null ? void 0 : _d2.value) || "");
195751
195809
  }
195752
195810
  }, [terminal]);
195753
195811
  react.exports.useEffect(() => {
195754
195812
  var _a2, _b2, _c2;
195755
- const crdt = CRDTInfo.terminal;
195813
+ const crdt = CRDTInfo2.terminal;
195756
195814
  if (terminal && crdt) {
195757
195815
  if (((_a2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _a2.action) === "Get") {
195758
195816
  initTerminalText(terminal, crdt.doc.value);
195759
195817
  return;
195760
195818
  }
195761
195819
  writeText(terminal, ((_b2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _b2.value) || "");
195762
- if (!CRDTInfo.userInfo.uuid)
195820
+ if (!CRDTInfo2.userInfo.uuid)
195763
195821
  return;
195764
195822
  const postUser = userListStore.getState().userList.find(({
195765
195823
  uuid: uuid2
195766
- }) => uuid2 === CRDTInfo.userInfo.uuid);
195767
- if (postUser && !IsMe(CRDTInfo.userInfo)) {
195824
+ }) => uuid2 === CRDTInfo2.userInfo.uuid);
195825
+ if (postUser && !IsMe(CRDTInfo2.userInfo)) {
195768
195826
  const helperContainer = (_c2 = terminal == null ? void 0 : terminal._core) == null ? void 0 : _c2._helperContainer;
195769
195827
  const childNode = helperContainer == null ? void 0 : helperContainer.firstChild;
195770
195828
  userLabel.innerText = postUser.username;
@@ -195793,7 +195851,7 @@ const TerminalComponent = (_i) => {
195793
195851
  };
195794
195852
  }
195795
195853
  }
195796
- }, [CRDTInfo.terminal]);
195854
+ }, [CRDTInfo2.terminal]);
195797
195855
  return /* @__PURE__ */ jsx(FollowLayout, {
195798
195856
  name: "terminal",
195799
195857
  children: /* @__PURE__ */ jsx("div", {
@@ -196377,7 +196435,7 @@ const MultiPlayerCursorLayout = newStyled.svg`
196377
196435
  `;
196378
196436
  const MultiPlayerCursor = () => {
196379
196437
  const [users, setUsers] = react.exports.useState(null);
196380
- const CRDTInfo = oTStore((state) => state.CRDTInfo);
196438
+ const CRDTInfo2 = oTStore((state) => state.CRDTInfo);
196381
196439
  const throttled = lodash$2.exports.throttle((a) => {
196382
196440
  var _a2, _b2;
196383
196441
  (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("extraSync", JSON.stringify(a));
@@ -196387,12 +196445,12 @@ const MultiPlayerCursor = () => {
196387
196445
  userList
196388
196446
  } = userListStore.getState();
196389
196447
  setUsers(userList.map((_user) => {
196390
- if (_user.uuid === CRDTInfo.userInfo.uuid) {
196391
- _user.cursor = CRDTInfo.extend;
196448
+ if (_user.uuid === CRDTInfo2.userInfo.uuid) {
196449
+ _user.cursor = CRDTInfo2.extend;
196392
196450
  }
196393
196451
  return _user;
196394
196452
  }));
196395
- }, [CRDTInfo]);
196453
+ }, [CRDTInfo2]);
196396
196454
  react.exports.useEffect(() => {
196397
196455
  const {
196398
196456
  userInfo