@netless/appliance-plugin 1.1.43-beta.0 → 1.1.43-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.
Files changed (35) hide show
  1. package/READMA.zh-CN.md +1 -1
  2. package/README.md +5 -1
  3. package/dist/appliance-plugin.js +1 -1
  4. package/dist/appliance-plugin.mjs +1 -1
  5. package/dist/{bridge-DcVN05tP.mjs → bridge-DzcPAEgn.mjs} +1 -1
  6. package/dist/{bridge-D68E09T9.js → bridge-iTPNL78o.js} +1 -1
  7. package/dist/bridge.js +1 -1
  8. package/dist/bridge.mjs +1 -1
  9. package/dist/core/enum.d.ts +3 -1
  10. package/dist/core/mainEngine.d.ts +8 -2
  11. package/dist/core/mainThread/subLocalThread.d.ts +6 -1
  12. package/dist/core/tools/pencilEraserBitMap.d.ts +6 -2
  13. package/dist/core/types.d.ts +2 -0
  14. package/dist/core/worker/fullWorkerLocal.d.ts +4 -1
  15. package/dist/fullWorker.js +89 -89
  16. package/dist/{index-BNHPCii1.mjs → index-14J65ewZ.mjs} +271 -241
  17. package/dist/index-B6nsfvHS.js +570 -0
  18. package/dist/index-B9E9m3wQ.js +1 -0
  19. package/dist/{index-B_vZ9d3x.mjs → index-BARnlEAY.mjs} +7772 -7621
  20. package/dist/{index-CWDWQZBs.mjs → index-BGKGGHj6.mjs} +271 -241
  21. package/dist/index-Bgw8Yl5s.js +570 -0
  22. package/dist/{index-DiLPVPwQ.js → index-Bp0tojzJ.js} +1 -1
  23. package/dist/{index-GZUDLXJC.js → index-C-LIZHUj.js} +1 -1
  24. package/dist/{index-K_0NX6pD.mjs → index-D2r_A0b8.mjs} +1 -1
  25. package/dist/index-DVTWLAHF.js +1 -0
  26. package/dist/{index-CV8YaU3F.mjs → index-DWS4kyH2.mjs} +1 -1
  27. package/dist/{index-NG5kKK1W.mjs → index-DkMJ7xR-.mjs} +9004 -8853
  28. package/dist/plugin/bitmapEraserOptions.d.ts +0 -2
  29. package/dist/plugin/types.d.ts +0 -4
  30. package/dist/subWorker.js +85 -85
  31. package/package.json +1 -1
  32. package/dist/index-C2AHqjj8.js +0 -570
  33. package/dist/index-DChI1--R.js +0 -1
  34. package/dist/index-DFo0Gmfx.js +0 -570
  35. package/dist/index-GBYM7kT5.js +0 -1
@@ -1,7 +1,7 @@
1
1
  var ye = Object.defineProperty;
2
2
  var we = (M, e, t) => e in M ? ye(M, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : M[e] = t;
3
3
  var u = (M, e, t) => we(M, typeof e != "symbol" ? e + "" : e, t);
4
- import { D as K, e as b, c as m, r as $, b as R, g as Z, t as V, a as h, f as de, M as ve, h as D, i as j, j as ke, C as H, k as z, l as Se, m as te, n as Ie, o as se, p as ge, q as Te, s as re, u as ie, v as Y, w as _, E as N, x as ee, y as Q, z as We, A as Re, B as Ee, F as be, G as Le, H as pe, I as ue, T as oe, J as ae, K as Ce, L as Ne, N as fe, P as me, Q as ne, R as Oe, S as ce, U as q, W as Be, V as he, X as De } from "./index-NG5kKK1W.mjs";
4
+ import { D as K, e as b, c as m, r as $, b as R, g as Z, t as V, a as h, f as de, M as ve, h as D, i as j, j as ke, C as H, k as z, l as Se, m as te, n as Ie, o as se, p as ge, q as Te, s as re, u as ie, v as Y, w as _, E as N, x as ee, y as Q, z as We, A as Re, B as Ee, F as be, G as Le, H as pe, I as ue, T as oe, J as ae, K as Ce, L as Ne, N as fe, P as me, Q as ne, R as Be, S as ce, U as q, W as Oe, V as he, X as De } from "./index-DkMJ7xR-.mjs";
5
5
  import { cloneDeep as J, xor as Me, isNumber as G, isEqual as le } from "lodash";
6
6
  import "clipper-lib";
7
7
  import "lineclip";
@@ -297,9 +297,9 @@ class Ae {
297
297
  })), c = /* @__PURE__ */ new Map();
298
298
  let d;
299
299
  n != null && n.selectIds && (d = Me(t.selectIds, n.selectIds), n.selectIds.forEach((w) => {
300
- const k = this.vNodes.get(w);
301
- if (k) {
302
- const { toolsType: I, op: W, opt: g } = k;
300
+ const S = this.vNodes.get(w);
301
+ if (S) {
302
+ const { toolsType: I, op: W, opt: g } = S;
303
303
  c.set(w, {
304
304
  opt: g,
305
305
  toolsType: I,
@@ -695,57 +695,82 @@ class Ae {
695
695
  var t;
696
696
  (t = this.getWorkShape(e)) == null || t.clearTmpPoints(), this.workShapes.delete(e);
697
697
  }
698
+ /** Stop queued Bitmap Eraser work and restore Doing-time hidden nodes. */
699
+ abortBitmapEraser(e) {
700
+ const t = this.workShapes.get(e);
701
+ (t == null ? void 0 : t.toolsType) === m.BitMapEraser && (t.clearTmpPoints(), this.workShapes.delete(e), this.combineDrawActiveId === e && (this.combineDrawActiveId = void 0), this.drawWorkActiveId === e && (this.drawWorkActiveId = void 0), this.bitmapEraserRenderQueue = Promise.resolve());
702
+ }
703
+ publishBitmapEraserBeforeImages(e, t) {
704
+ t.size && this.thread.post({
705
+ sp: [
706
+ {
707
+ type: h.None,
708
+ viewId: this.thread.viewId,
709
+ eraseTxnId: e,
710
+ eraseTxnBeforeImages: new Map(t)
711
+ }
712
+ ]
713
+ });
714
+ }
698
715
  async drawBitMapEraserFull(e, t, s, r) {
699
- const { willUpdateNodes: i, willDeleteNodes: o, eraseTxnRecoveryRequired: a } = t, n = e.getWorkId(), c = [
700
- ...i ? Array.from(i.keys()).map((l) => String(l)) : [],
716
+ const {
717
+ willUpdateNodes: i,
718
+ willDeleteNodes: o,
719
+ eraseTxnRecoveryRequired: a,
720
+ eraseTxnBeforeImages: n
721
+ } = t, c = e.getWorkId(), d = [
722
+ ...i ? Array.from(i.keys()).map((p) => String(p)) : [],
701
723
  ...o ? Array.from(o) : []
702
- ], d = [];
703
- if (r && d.push({
724
+ ], l = [];
725
+ if (r && l.push({
704
726
  type: h.None,
705
727
  needUndoTicker: r,
706
- undoScopeIds: c,
728
+ undoScopeIds: d,
707
729
  undoScopePhase: "finalize",
708
- eraseTxnId: n,
709
- eraseTxnRecoveryRequired: a
710
- }), d.push({
730
+ eraseTxnId: c,
731
+ eraseTxnRecoveryRequired: a,
732
+ eraseTxnBeforeImages: n
733
+ }), l.push({
711
734
  type: h.RemoveNode,
712
- removeIds: [n],
713
- eraseTxnId: n,
735
+ removeIds: [c],
736
+ eraseTxnId: c,
714
737
  viewId: this.thread.viewId,
715
738
  needUndoTicker: r,
716
- eraseTxnRecoveryRequired: a
717
- }), s && d.push({
739
+ eraseTxnRecoveryRequired: a,
740
+ eraseTxnBeforeImages: n
741
+ }), s && l.push({
718
742
  type: h.None,
719
743
  isLockSentEventCursor: s
720
744
  }), i != null && i.size || o != null && o.size) {
721
745
  if (i != null && i.size)
722
- for (const [l, p] of i)
723
- d.push({
746
+ for (const [p, f] of i)
747
+ l.push({
724
748
  type: h.UpdateNode,
725
749
  dataType: R.Local,
726
- opt: p.opt,
727
- workId: l,
750
+ opt: f.opt,
751
+ workId: p,
728
752
  updateNodeOpt: {
729
753
  useAnimation: !1
730
754
  },
731
- eraseTxnId: n,
755
+ eraseTxnId: c,
732
756
  needUndoTicker: r
733
757
  });
734
- o != null && o.size && d.push({
758
+ o != null && o.size && l.push({
735
759
  type: h.RemoveNode,
736
760
  removeIds: [...o],
737
- eraseTxnId: n,
761
+ eraseTxnId: c,
738
762
  viewId: this.thread.viewId,
739
763
  needUndoTicker: r
740
764
  });
741
765
  }
742
- d.push({
766
+ l.push({
743
767
  type: h.None,
744
768
  viewId: this.thread.viewId,
745
- eraseTxnId: n,
769
+ eraseTxnId: c,
746
770
  eraseTxnPhase: t.eraseTxnCommitStatus === "failed" || a ? "failed" : "applied",
747
- eraseTxnRecoveryRequired: a
748
- }), d.length && this.thread.post({ sp: d });
771
+ eraseTxnRecoveryRequired: a,
772
+ eraseTxnBeforeImages: n
773
+ }), l.length && this.thread.post({ sp: l });
749
774
  }
750
775
  drawPencilEraserFull(e, t, s, r) {
751
776
  const { willNewNodes: i, willDeleteNodes: o } = t, a = e.getWorkId(), n = [
@@ -951,14 +976,14 @@ class Ae {
951
976
  if (i || r) {
952
977
  const p = i == null ? void 0 : i.willDeleteNodes, f = i == null ? void 0 : i.willNewNodes, w = [
953
978
  ...p ? Array.from(p) : []
954
- ], k = {
979
+ ], S = {
955
980
  render: [],
956
981
  sp: [],
957
982
  ...r
958
983
  };
959
984
  if (i != null && i.rect) {
960
985
  const I = Te(i.rect);
961
- (a = k.render) == null || a.push(
986
+ (a = S.render) == null || a.push(
962
987
  {
963
988
  rect: I,
964
989
  isClear: !0,
@@ -974,12 +999,12 @@ class Ae {
974
999
  }
975
1000
  );
976
1001
  }
977
- if (s && w.length && ((n = this.getWorkShape(e)) == null ? void 0 : n.toolsType) === m.BitMapEraser && ((c = k.sp) == null || c.push({
1002
+ if (s && w.length && ((n = this.getWorkShape(e)) == null ? void 0 : n.toolsType) === m.BitMapEraser && ((c = S.sp) == null || c.push({
978
1003
  type: h.None,
979
1004
  collectUndoTicker: s,
980
1005
  undoScopeIds: w,
981
1006
  undoScopePhase: "collect"
982
- })), p != null && p.size && ((d = k.sp) == null || d.push({
1007
+ })), p != null && p.size && ((d = S.sp) == null || d.push({
983
1008
  type: h.RemoveNode,
984
1009
  removeIds: [...p],
985
1010
  viewId: this.thread.viewId,
@@ -987,7 +1012,7 @@ class Ae {
987
1012
  collectUndoTicker: s
988
1013
  })), f != null && f.size)
989
1014
  for (const [I, W] of f)
990
- (l = k.sp) == null || l.push({
1015
+ (l = S.sp) == null || l.push({
991
1016
  type: h.FullWork,
992
1017
  dataType: R.Local,
993
1018
  toolsType: W.toolsType,
@@ -1000,7 +1025,7 @@ class Ae {
1000
1025
  needUndoTicker: t,
1001
1026
  collectUndoTicker: s
1002
1027
  });
1003
- i != null && i.rect && await this.thread.fullLayer.parent.prepareRender, this.thread.post(k);
1028
+ i != null && i.rect && await this.thread.fullLayer.parent.prepareRender, this.thread.post(S);
1004
1029
  }
1005
1030
  }
1006
1031
  async consumeDrawAll(e, t) {
@@ -1018,23 +1043,23 @@ class Ae {
1018
1043
  if (p === m.LaserPen)
1019
1044
  return;
1020
1045
  p === m.BitMapEraser && await this.bitmapEraserRenderQueue;
1021
- const f = this.workShapes.get(H), w = (a = f == null ? void 0 : f.selectIds) == null ? void 0 : a[0], k = await l.consumeAll({ data: e, workerEngine: this });
1046
+ const f = this.workShapes.get(H), w = (a = f == null ? void 0 : f.selectIds) == null ? void 0 : a[0], S = await l.consumeAll({ data: e, workerEngine: this });
1022
1047
  switch (p) {
1023
1048
  case m.Selector:
1024
1049
  {
1025
- k.selectIds && w && ((n = k.selectIds) != null && n.includes(w)) && f.cursorBlur();
1050
+ S.selectIds && w && ((n = S.selectIds) != null && n.includes(w)) && f.cursorBlur();
1026
1051
  const I = [];
1027
1052
  i && I.push({
1028
1053
  type: h.None,
1029
1054
  isLockSentEventCursor: i,
1030
1055
  scenePath: r
1031
- }), k.type === h.Select && (k.selectIds && t.runReverseSelectWork(k.selectIds), I.push({ ...k, scenePath: r })), I.length && this.thread.post({ sp: I }), (c = l.selectIds) != null && c.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(d);
1056
+ }), S.type === h.Select && (S.selectIds && t.runReverseSelectWork(S.selectIds), I.push({ ...S, scenePath: r })), I.length && this.thread.post({ sp: I }), (c = l.selectIds) != null && c.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(d);
1032
1057
  }
1033
1058
  break;
1034
1059
  case m.PencilEraser:
1035
1060
  await this.drawPencilEraserFull(
1036
1061
  l,
1037
- k,
1062
+ S,
1038
1063
  i,
1039
1064
  o
1040
1065
  ), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(d);
@@ -1042,14 +1067,14 @@ class Ae {
1042
1067
  case m.BitMapEraser:
1043
1068
  await this.drawBitMapEraserFull(
1044
1069
  l,
1045
- k,
1070
+ S,
1046
1071
  i,
1047
1072
  o
1048
1073
  ), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(d);
1049
1074
  break;
1050
1075
  case m.Eraser:
1051
1076
  await this.drawEraser(
1052
- { ...k, scenePath: r },
1077
+ { ...S, scenePath: r },
1053
1078
  i,
1054
1079
  o,
1055
1080
  e.collectUndoTicker
@@ -1068,17 +1093,17 @@ class Ae {
1068
1093
  type: h.None,
1069
1094
  isLockSentEventCursor: i,
1070
1095
  scenePath: r
1071
- }), k) {
1072
- const g = p === m.Pencil && k.type === h.RemoveNode;
1096
+ }), S) {
1097
+ const g = p === m.Pencil && S.type === h.RemoveNode;
1073
1098
  g ? $(
1074
1099
  this.thread.localLayer,
1075
1100
  this.thread.localLayer.parent
1076
1101
  ) : I.push({
1077
- ...k,
1102
+ ...S,
1078
1103
  scenePath: r,
1079
1104
  needUndoTicker: e.needUndoTicker,
1080
- undoScopeIds: k.undoScopeIds || (k.workId !== void 0 ? [k.workId.toString()] : void 0),
1081
- undoScopePhase: k.undoScopePhase || "finalize"
1105
+ undoScopeIds: S.undoScopeIds || (S.workId !== void 0 ? [S.workId.toString()] : void 0),
1106
+ undoScopePhase: S.undoScopePhase || "finalize"
1082
1107
  }), this.fullWorkerDrawCount = 0, e.needUndoTicker && I.push({
1083
1108
  type: h.None,
1084
1109
  needUndoTicker: e.needUndoTicker,
@@ -1250,45 +1275,45 @@ class Fe {
1250
1275
  );
1251
1276
  }
1252
1277
  async animationDraw() {
1253
- var r, i, o, a, n, c, d, l, p, f, w, k, I, W, g, y, S, T, C, L, A;
1278
+ var r, i, o, a, n, c, d, l, p, f, w, S, I, W, g, y, v, T, C, L, A;
1254
1279
  let e = !1;
1255
1280
  const t = /* @__PURE__ */ new Map(), s = [];
1256
- for (const [E, v] of this.workShapes.entries())
1257
- switch (v.toolsType) {
1281
+ for (const [E, k] of this.workShapes.entries())
1282
+ switch (k.toolsType) {
1258
1283
  case m.BackgroundSVG: {
1259
- (r = v.node) == null || r.consumeService({
1284
+ (r = k.node) == null || r.consumeService({
1260
1285
  isFullWork: !0,
1261
1286
  replaceId: E
1262
- }), this.selectorWorkShapes.forEach((O, B) => {
1287
+ }), this.selectorWorkShapes.forEach((B, O) => {
1263
1288
  var P;
1264
- (P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
1289
+ (P = B.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(O), this.runEffect());
1265
1290
  }), this.workShapes.delete(E);
1266
1291
  break;
1267
1292
  }
1268
1293
  case m.Image: {
1269
- await ((i = v.node) == null ? void 0 : i.consumeServiceAsync({
1294
+ await ((i = k.node) == null ? void 0 : i.consumeServiceAsync({
1270
1295
  isFullWork: !0,
1271
1296
  worker: this
1272
- })), this.selectorWorkShapes.forEach((O, B) => {
1297
+ })), this.selectorWorkShapes.forEach((B, O) => {
1273
1298
  var P;
1274
- (P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
1299
+ (P = B.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(O), this.runEffect());
1275
1300
  }), this.workShapes.delete(E);
1276
1301
  break;
1277
1302
  }
1278
1303
  case m.Text: {
1279
- v.node && (await ((o = v.node) == null ? void 0 : o.consumeServiceAsync({
1304
+ k.node && (await ((o = k.node) == null ? void 0 : o.consumeServiceAsync({
1280
1305
  isFullWork: !0,
1281
1306
  replaceId: E,
1282
1307
  boxRect: this.thread.getSceneRect()
1283
- })), this.selectorWorkShapes.forEach((O, B) => {
1308
+ })), this.selectorWorkShapes.forEach((B, O) => {
1284
1309
  var P;
1285
- (P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
1286
- }), v.refreshTextRender && v.requestId && s.push({
1310
+ (P = B.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(O), this.runEffect());
1311
+ }), k.refreshTextRender && k.requestId && s.push({
1287
1312
  type: h.RefreshTextRender,
1288
- requestId: v.requestId,
1313
+ requestId: k.requestId,
1289
1314
  workId: E,
1290
1315
  viewId: this.thread.viewId
1291
- }), (a = v.node) == null || a.clearTmpPoints(), this.workShapes.delete(E));
1316
+ }), (a = k.node) == null || a.clearTmpPoints(), this.workShapes.delete(E));
1292
1317
  break;
1293
1318
  }
1294
1319
  case m.Arrow:
@@ -1298,60 +1323,60 @@ class Fe {
1298
1323
  case m.Star:
1299
1324
  case m.Polygon:
1300
1325
  case m.SpeechBalloon: {
1301
- const O = !!v.ops;
1302
- if ((n = v.animationWorkData) != null && n.length) {
1303
- const B = v.oldRect;
1304
- (c = v.node) == null || c.consumeService({
1305
- op: v.animationWorkData,
1306
- isFullWork: O
1307
- }), O && (this.selectorWorkShapes.forEach((P, F) => {
1326
+ const B = !!k.ops;
1327
+ if ((n = k.animationWorkData) != null && n.length) {
1328
+ const O = k.oldRect;
1329
+ (c = k.node) == null || c.consumeService({
1330
+ op: k.animationWorkData,
1331
+ isFullWork: B
1332
+ }), B && (this.selectorWorkShapes.forEach((P, F) => {
1308
1333
  var U;
1309
1334
  (U = P.selectIds) != null && U.includes(E) && (this.willRunEffectSelectorIds.add(F), this.runEffect());
1310
- }), (d = v.node) == null || d.clearTmpPoints(), this.workShapes.delete(E)), v.isEnableCursor ? t.set(E, {
1311
- cursorTool: _(v.toolsType),
1312
- workState: B ? v.ops ? b.Done : b.Doing : b.Start,
1313
- op: v.animationWorkData.slice(-3, -1)
1314
- }) : O && !v.useAnimation && ((l = v.updateNodeOpt) != null && l.useAnimation) && t.set(E, {
1315
- cursorTool: _(v.toolsType),
1335
+ }), (d = k.node) == null || d.clearTmpPoints(), this.workShapes.delete(E)), k.isEnableCursor ? t.set(E, {
1336
+ cursorTool: _(k.toolsType),
1337
+ workState: O ? k.ops ? b.Done : b.Doing : b.Start,
1338
+ op: k.animationWorkData.slice(-3, -1)
1339
+ }) : B && !k.useAnimation && ((l = k.updateNodeOpt) != null && l.useAnimation) && t.set(E, {
1340
+ cursorTool: _(k.toolsType),
1316
1341
  workState: b.Done,
1317
- op: v.animationWorkData.slice(-3, -1),
1318
- uid: (p = v.updateNodeOpt) == null ? void 0 : p.uid
1319
- }), v.animationWorkData.length = 0;
1342
+ op: k.animationWorkData.slice(-3, -1),
1343
+ uid: (p = k.updateNodeOpt) == null ? void 0 : p.uid
1344
+ }), k.animationWorkData.length = 0;
1320
1345
  }
1321
1346
  break;
1322
1347
  }
1323
1348
  case m.Pencil: {
1324
- if (v.useAnimation) {
1325
- if (v.useAnimation) {
1326
- if (v.isDel) {
1327
- (y = v.node) == null || y.clearTmpPoints(), this.workShapes.delete(E);
1349
+ if (k.useAnimation) {
1350
+ if (k.useAnimation) {
1351
+ if (k.isDel) {
1352
+ (y = k.node) == null || y.clearTmpPoints(), this.workShapes.delete(E);
1328
1353
  break;
1329
1354
  }
1330
- const O = 3, B = this.computNextAnimationIndex(
1331
- v,
1332
- O
1333
- ), P = v.isDiff ? 0 : Math.max(0, (v.animationIndex || 0) - O), F = (v.animationWorkData || []).slice(
1334
- P,
1355
+ const B = 3, O = this.computNextAnimationIndex(
1356
+ k,
1335
1357
  B
1336
- ), U = (T = (S = v.node) == null ? void 0 : S.getWorkId()) == null ? void 0 : T.toString();
1337
- if ((v.animationIndex || 0) < B || v.isDiff) {
1338
- if ((C = v.node) == null || C.consumeService({
1358
+ ), P = k.isDiff ? 0 : Math.max(0, (k.animationIndex || 0) - B), F = (k.animationWorkData || []).slice(
1359
+ P,
1360
+ O
1361
+ ), U = (T = (v = k.node) == null ? void 0 : v.getWorkId()) == null ? void 0 : T.toString();
1362
+ if ((k.animationIndex || 0) < O || k.isDiff) {
1363
+ if ((C = k.node) == null || C.consumeService({
1339
1364
  op: F,
1340
1365
  isFullWork: !1
1341
- }), v.animationIndex = B, v.isDiff && (v.isDiff = !1), F.length && v.isEnableCursor) {
1366
+ }), k.animationIndex = O, k.isDiff && (k.isDiff = !1), F.length && k.isEnableCursor) {
1342
1367
  const X = F.slice(-3, -1);
1343
1368
  t.set(E, {
1344
- cursorTool: _(v.toolsType),
1345
- workState: P === 0 ? b.Start : B === ((L = v.animationWorkData) == null ? void 0 : L.length) ? b.Done : b.Doing,
1369
+ cursorTool: _(k.toolsType),
1370
+ workState: P === 0 ? b.Start : O === ((L = k.animationWorkData) == null ? void 0 : L.length) ? b.Done : b.Doing,
1346
1371
  op: X
1347
1372
  });
1348
1373
  }
1349
- } else v.ops && ((A = v.node) == null || A.consumeService({
1350
- op: v.animationWorkData || [],
1374
+ } else k.ops && ((A = k.node) == null || A.consumeService({
1375
+ op: k.animationWorkData || [],
1351
1376
  isFullWork: !0,
1352
1377
  replaceId: U
1353
- }), v.isDel = !0, v.isEnableCursor && t.set(E, {
1354
- cursorTool: _(v.toolsType),
1378
+ }), k.isDel = !0, k.isEnableCursor && t.set(E, {
1379
+ cursorTool: _(k.toolsType),
1355
1380
  workState: b.Done,
1356
1381
  op: F.slice(-3, -1)
1357
1382
  }));
@@ -1359,34 +1384,34 @@ class Fe {
1359
1384
  break;
1360
1385
  }
1361
1386
  } else {
1362
- const O = !!v.ops;
1363
- if ((f = v.node) == null || f.consumeService({
1364
- op: v.animationWorkData || [],
1365
- isFullWork: O,
1387
+ const B = !!k.ops;
1388
+ if ((f = k.node) == null || f.consumeService({
1389
+ op: k.animationWorkData || [],
1390
+ isFullWork: B,
1366
1391
  replaceId: E
1367
- }), (w = v.node) == null || w.updataOptService(v.updateNodeOpt), O) {
1368
- if (!v.isEnableCursor && ((k = v.updateNodeOpt) != null && k.useAnimation) && ((I = v.animationWorkData) != null && I.length)) {
1369
- const B = v.animationWorkData.slice(-3, -1);
1392
+ }), (w = k.node) == null || w.updataOptService(k.updateNodeOpt), B) {
1393
+ if (!k.isEnableCursor && ((S = k.updateNodeOpt) != null && S.useAnimation) && ((I = k.animationWorkData) != null && I.length)) {
1394
+ const O = k.animationWorkData.slice(-3, -1);
1370
1395
  t.set(E, {
1371
- cursorTool: _(v.toolsType),
1396
+ cursorTool: _(k.toolsType),
1372
1397
  workState: b.Done,
1373
- op: B,
1374
- uid: (W = v.updateNodeOpt) == null ? void 0 : W.uid
1398
+ op: O,
1399
+ uid: (W = k.updateNodeOpt) == null ? void 0 : W.uid
1375
1400
  });
1376
1401
  }
1377
- this.selectorWorkShapes.forEach((B, P) => {
1402
+ this.selectorWorkShapes.forEach((O, P) => {
1378
1403
  var F;
1379
- (F = B.selectIds) != null && F.includes(E) && (this.willRunEffectSelectorIds.add(P), this.runEffect());
1380
- }), (g = v.node) == null || g.clearTmpPoints(), this.workShapes.delete(E);
1404
+ (F = O.selectIds) != null && F.includes(E) && (this.willRunEffectSelectorIds.add(P), this.runEffect());
1405
+ }), (g = k.node) == null || g.clearTmpPoints(), this.workShapes.delete(E);
1381
1406
  }
1382
1407
  }
1383
1408
  break;
1384
1409
  }
1385
1410
  }
1386
- e && this.runAnimation(), t.size && t.forEach((E, v) => {
1411
+ e && this.runAnimation(), t.size && t.forEach((E, k) => {
1387
1412
  s.push({
1388
1413
  type: h.Cursor,
1389
- uid: E.uid || v.split(de)[0],
1414
+ uid: E.uid || k.split(de)[0],
1390
1415
  op: E.op,
1391
1416
  workState: E.workState,
1392
1417
  cursorTool: E.cursorTool,
@@ -1421,7 +1446,7 @@ class Fe {
1421
1446
  return !1;
1422
1447
  }
1423
1448
  activeWorkShape(e) {
1424
- var W, g, y, S;
1449
+ var W, g, y, v;
1425
1450
  const {
1426
1451
  workId: t,
1427
1452
  opt: s,
@@ -1438,7 +1463,7 @@ class Fe {
1438
1463
  } = e;
1439
1464
  if (!t)
1440
1465
  return;
1441
- const w = t.toString(), k = (W = this.vNodes.get(w)) == null ? void 0 : W.rect;
1466
+ const w = t.toString(), S = (W = this.vNodes.get(w)) == null ? void 0 : W.rect;
1442
1467
  if (!((g = this.workShapes) != null && g.has(w))) {
1443
1468
  let T = {
1444
1469
  toolsType: r,
@@ -1448,19 +1473,19 @@ class Fe {
1448
1473
  updateNodeOpt: o,
1449
1474
  ops: a,
1450
1475
  useAnimation: typeof c < "u" ? c : typeof (o == null ? void 0 : o.useAnimation) < "u" ? o == null ? void 0 : o.useAnimation : !0,
1451
- oldRect: k,
1476
+ oldRect: S,
1452
1477
  isDiff: !1,
1453
1478
  imageBitmap: d,
1454
1479
  isEnableCursor: l
1455
1480
  };
1456
1481
  r && s && (T = this.setNodeKey(w, T, r, s)), (y = this.workShapes) == null || y.set(w, T);
1457
1482
  }
1458
- const I = (S = this.workShapes) == null ? void 0 : S.get(w);
1483
+ const I = (v = this.workShapes) == null ? void 0 : v.get(w);
1459
1484
  I.isEnableCursor = l, I.requestId = p, I.refreshTextRender = !!f, i && (I.type = i), a && (I.animationWorkData = V(a), I.ops = a), o && (I.updateNodeOpt = o), n && (I.isDiff = this.hasDiffData(
1460
1485
  I.animationWorkData || [],
1461
1486
  n,
1462
1487
  I.toolsType
1463
- ), I.toolsType, m.Pencil, I.animationWorkData = n), I.node && I.node.getWorkId() !== w && I.node.setWorkId(w), k && (I.oldRect = k), r && s && (s.syncUnitTime && (this.syncUnitTime = s.syncUnitTime), I.toolsType !== r && r && s && this.setNodeKey(w, I, r, s), I.node && I.node.setWorkOptions(s)), d && (I.imageBitmap = d);
1488
+ ), I.toolsType, m.Pencil, I.animationWorkData = n), I.node && I.node.getWorkId() !== w && I.node.setWorkId(w), S && (I.oldRect = S), r && s && (s.syncUnitTime && (this.syncUnitTime = s.syncUnitTime), I.toolsType !== r && r && s && this.setNodeKey(w, I, r, s), I.node && I.node.setWorkOptions(s)), d && (I.imageBitmap = d);
1464
1489
  }
1465
1490
  removeNode(e, t) {
1466
1491
  e.indexOf(D) > -1 && this.removeSelectWork(t), this.thread.fullLayer.getElementsByName(e).forEach((r) => {
@@ -1702,7 +1727,7 @@ class qe extends x {
1702
1727
  updateSelectorOpt: l,
1703
1728
  textUpdateForWoker: p,
1704
1729
  needUndoTicker: f
1705
- } = s, w = l.workState, k = r.sp || [];
1730
+ } = s, w = l.workState, S = r.sp || [];
1706
1731
  if (w === b.Start)
1707
1732
  return {
1708
1733
  sp: [
@@ -1717,7 +1742,7 @@ class qe extends x {
1717
1742
  const I = a == null ? void 0 : a.selectRect;
1718
1743
  if (c) {
1719
1744
  const g = w === b.Done ? f : void 0;
1720
- k.push({
1745
+ S.push({
1721
1746
  type: h.Select,
1722
1747
  selectIds: o.selectIds,
1723
1748
  selectRect: I,
@@ -1733,34 +1758,34 @@ class qe extends x {
1733
1758
  useAnimation: l.useAnimation || !1
1734
1759
  };
1735
1760
  l.uid && (y.uid = l.uid);
1736
- for (const [S, T] of i.entries())
1737
- T.toolsType === m.BackgroundSVG && k.push({
1761
+ for (const [v, T] of i.entries())
1762
+ T.toolsType === m.BackgroundSVG && S.push({
1738
1763
  ...T,
1739
- workId: S,
1764
+ workId: v,
1740
1765
  type: h.BackgroundSVGUpdate,
1741
1766
  dataType: R.Local,
1742
1767
  willSyncService: w === b.Done ? !0 : n,
1743
1768
  updateNodeOpt: y,
1744
1769
  needUndoTicker: g,
1745
1770
  emitEventType: this.emitEventType
1746
- }), p && T.toolsType === m.Text ? k.push({
1771
+ }), p && T.toolsType === m.Text ? S.push({
1747
1772
  ...T,
1748
- workId: S,
1773
+ workId: v,
1749
1774
  type: h.TextUpdate,
1750
1775
  dataType: R.Local,
1751
1776
  willSyncService: w === b.Done ? !0 : n,
1752
1777
  updateNodeOpt: y,
1753
1778
  needUndoTicker: g,
1754
1779
  emitEventType: this.emitEventType
1755
- }) : (n || w === b.Done) && k.push({
1780
+ }) : (n || w === b.Done) && S.push({
1756
1781
  ...T,
1757
- workId: S,
1782
+ workId: v,
1758
1783
  type: h.UpdateNode,
1759
1784
  updateNodeOpt: {
1760
1785
  ...y,
1761
1786
  eraserGeometryDelta: ee(
1762
1787
  (W = this.localWork) == null ? void 0 : W.vNodes,
1763
- S
1788
+ v
1764
1789
  )
1765
1790
  },
1766
1791
  isSync: d,
@@ -1768,15 +1793,15 @@ class qe extends x {
1768
1793
  emitEventType: this.emitEventType
1769
1794
  });
1770
1795
  }
1771
- return f && k.push({
1796
+ return f && S.push({
1772
1797
  type: h.None,
1773
1798
  needUndoTicker: f
1774
- }), k.push({
1799
+ }), S.push({
1775
1800
  type: h.SelectorTransform,
1776
1801
  emitEventType: this.emitEventType,
1777
1802
  workState: w
1778
1803
  }), {
1779
- sp: k
1804
+ sp: S
1780
1805
  };
1781
1806
  });
1782
1807
  }
@@ -1818,7 +1843,7 @@ class ze extends x {
1818
1843
  u(this, "emitEventType", N.ScaleNode);
1819
1844
  u(this, "updateSelectorCallback", (t) => {
1820
1845
  var I;
1821
- const { param: s, postData: r, workShapeNode: i, res: o, newServiceStore: a, smoothSync: n } = t, { updateSelectorOpt: c, willSyncService: d, needUndoTicker: l } = s, p = c.workState, f = r.sp || [], w = o == null ? void 0 : o.selectRect, k = p === b.Done ? l : void 0;
1846
+ const { param: s, postData: r, workShapeNode: i, res: o, newServiceStore: a, smoothSync: n } = t, { updateSelectorOpt: c, willSyncService: d, needUndoTicker: l } = s, p = c.workState, f = r.sp || [], w = o == null ? void 0 : o.selectRect, S = p === b.Done ? l : void 0;
1822
1847
  if (p === b.Start)
1823
1848
  return {
1824
1849
  sp: [
@@ -1852,7 +1877,7 @@ class ze extends x {
1852
1877
  dataType: R.Local,
1853
1878
  willSyncService: p === b.Done ? !0 : n,
1854
1879
  updateNodeOpt: W,
1855
- needUndoTicker: k,
1880
+ needUndoTicker: S,
1856
1881
  emitEventType: this.emitEventType
1857
1882
  }), y.toolsType === m.Text ? f.push({
1858
1883
  ...y,
@@ -1861,7 +1886,7 @@ class ze extends x {
1861
1886
  dataType: R.Local,
1862
1887
  willSyncService: p === b.Done ? !0 : n,
1863
1888
  updateNodeOpt: W,
1864
- needUndoTicker: k,
1889
+ needUndoTicker: S,
1865
1890
  emitEventType: this.emitEventType
1866
1891
  }) : (n || p === b.Done) && f.push({
1867
1892
  ...y,
@@ -1875,7 +1900,7 @@ class ze extends x {
1875
1900
  )
1876
1901
  },
1877
1902
  isSync: !0,
1878
- needUndoTicker: k,
1903
+ needUndoTicker: S,
1879
1904
  emitEventType: this.emitEventType
1880
1905
  });
1881
1906
  }
@@ -1929,9 +1954,9 @@ class Ve extends x {
1929
1954
  willSerializeData: l,
1930
1955
  isSync: p,
1931
1956
  needUndoTicker: f
1932
- } = s, w = c.workState, k = r.sp || [], I = o == null ? void 0 : o.selectRect, W = w === b.Done ? f : void 0;
1957
+ } = s, w = c.workState, S = r.sp || [], I = o == null ? void 0 : o.selectRect, W = w === b.Done ? f : void 0;
1933
1958
  if (d) {
1934
- l && w === b.Done && k.push({
1959
+ l && w === b.Done && S.push({
1935
1960
  type: h.Select,
1936
1961
  selectIds: i.selectIds,
1937
1962
  selectRect: I,
@@ -1943,16 +1968,16 @@ class Ve extends x {
1943
1968
  useAnimation: c.useAnimation || !1
1944
1969
  };
1945
1970
  if (c.uid && (y.uid = c.uid), n || w === b.Done)
1946
- for (const [S, T] of a.entries())
1947
- k.push({
1971
+ for (const [v, T] of a.entries())
1972
+ S.push({
1948
1973
  ...T,
1949
- workId: S,
1974
+ workId: v,
1950
1975
  type: h.UpdateNode,
1951
1976
  updateNodeOpt: {
1952
1977
  ...y,
1953
1978
  eraserGeometryDelta: ee(
1954
1979
  (g = this.localWork) == null ? void 0 : g.vNodes,
1955
- S
1980
+ v
1956
1981
  )
1957
1982
  },
1958
1983
  isSync: p,
@@ -1960,15 +1985,15 @@ class Ve extends x {
1960
1985
  emitEventType: this.emitEventType
1961
1986
  });
1962
1987
  }
1963
- return f && k.push({
1988
+ return f && S.push({
1964
1989
  type: h.None,
1965
1990
  needUndoTicker: f
1966
- }), k.push({
1991
+ }), S.push({
1967
1992
  type: h.SelectorTransform,
1968
1993
  emitEventType: this.emitEventType,
1969
1994
  workState: w
1970
1995
  }), {
1971
- sp: k
1996
+ sp: S
1972
1997
  };
1973
1998
  });
1974
1999
  }
@@ -2042,12 +2067,12 @@ class $e extends x {
2042
2067
  textUpdateForWoker: l,
2043
2068
  requestId: p,
2044
2069
  emitEventType: f
2045
- } = s, w = r.sp || [], k = a == null ? void 0 : a.selectRect;
2070
+ } = s, w = r.sp || [], S = a == null ? void 0 : a.selectRect;
2046
2071
  if (n && w) {
2047
2072
  d.fontSize && w.push({
2048
2073
  type: h.Select,
2049
2074
  selectIds: o.selectIds,
2050
- selectRect: k,
2075
+ selectRect: S,
2051
2076
  willSyncService: n,
2052
2077
  isSync: c,
2053
2078
  points: o.getChildrenPoints()
@@ -2187,7 +2212,7 @@ class He extends x {
2187
2212
  needUndoTicker: l,
2188
2213
  requestId: p,
2189
2214
  emitEventType: f
2190
- } = s, w = r.sp || [], k = a == null ? void 0 : a.selectRect;
2215
+ } = s, w = r.sp || [], S = a == null ? void 0 : a.selectRect;
2191
2216
  if (n && w) {
2192
2217
  for (const [I, W] of i.entries())
2193
2218
  w.push({
@@ -2208,7 +2233,7 @@ class He extends x {
2208
2233
  canRotate: o.canRotate,
2209
2234
  type: h.Select,
2210
2235
  selectIds: o.selectIds,
2211
- selectRect: k,
2236
+ selectRect: S,
2212
2237
  willSyncService: n,
2213
2238
  isSync: c
2214
2239
  });
@@ -2550,7 +2575,7 @@ class je {
2550
2575
  workState: p,
2551
2576
  imageSrc: f,
2552
2577
  imageBitmap: w,
2553
- imageElement: k,
2578
+ imageElement: S,
2554
2579
  workIds: I,
2555
2580
  isLockSentEventCursor: W,
2556
2581
  requestId: g
@@ -2560,19 +2585,24 @@ class je {
2560
2585
  G(e.dpr) && this.updateDpr(e.dpr);
2561
2586
  break;
2562
2587
  case h.AuthClear: {
2563
- const { clearUids: S, localUid: T } = e;
2564
- this.vNodes.setCanClearUids(S), this.vNodes.setLocalUid(T);
2588
+ const { clearUids: v, localUid: T } = e;
2589
+ this.vNodes.setCanClearUids(v), this.vNodes.setLocalUid(T);
2565
2590
  break;
2566
2591
  }
2567
2592
  case h.Destroy:
2568
2593
  this.destroy();
2569
2594
  break;
2595
+ case h.CancelBitmapEraser: {
2596
+ const v = y;
2597
+ v && this.localWork.abortBitmapEraser(v);
2598
+ break;
2599
+ }
2570
2600
  case h.Clear:
2571
2601
  this.clearAll();
2572
2602
  break;
2573
2603
  case h.ServiceSyncCommit: {
2574
2604
  if (this.destroyed) break;
2575
- const S = [
2605
+ const v = [
2576
2606
  (s = this.fullLayer) == null ? void 0 : s.parent,
2577
2607
  (r = this.topLayer) == null ? void 0 : r.parent,
2578
2608
  (i = this.localLayer) == null ? void 0 : i.parent,
@@ -2583,7 +2613,7 @@ class je {
2583
2613
  (async () => {
2584
2614
  await Le(
2585
2615
  this.serviceWork,
2586
- S
2616
+ v
2587
2617
  );
2588
2618
  })(),
2589
2619
  {
@@ -2617,26 +2647,26 @@ class je {
2617
2647
  try {
2618
2648
  await Ee(
2619
2649
  e.cameraTaskId,
2620
- async (S) => {
2621
- this.activeCameraTaskContext = S;
2650
+ async (v) => {
2651
+ this.activeCameraTaskContext = v;
2622
2652
  try {
2623
- await this.updateCamera(e, S);
2653
+ await this.updateCamera(e, v);
2624
2654
  } finally {
2625
- this.activeCameraTaskContext === S && (this.activeCameraTaskContext = void 0);
2655
+ this.activeCameraTaskContext === v && (this.activeCameraTaskContext = void 0);
2626
2656
  }
2627
2657
  }
2628
2658
  );
2629
- } catch (S) {
2630
- throw this.cameraOpt = void 0, this.cancelCameraSettledRender(), S;
2659
+ } catch (v) {
2660
+ throw this.cameraOpt = void 0, this.cancelCameraSettledRender(), v;
2631
2661
  }
2632
2662
  break;
2633
2663
  case h.UpdateTools:
2634
2664
  if (n && c) {
2635
- const S = {
2665
+ const v = {
2636
2666
  toolsType: n,
2637
2667
  toolsOpt: c
2638
2668
  };
2639
- this.topWork.canUseTopLayer(n) ? this.topWork.setToolsOpt(S) : this.localWork.setToolsOpt(S);
2669
+ this.topWork.canUseTopLayer(n) ? this.topWork.setToolsOpt(v) : this.localWork.setToolsOpt(v);
2640
2670
  }
2641
2671
  break;
2642
2672
  case h.CreateWork:
@@ -2688,31 +2718,31 @@ class je {
2688
2718
  d === R.Local && this.localWork.checkTextActive(e);
2689
2719
  break;
2690
2720
  case h.GetImageBitMap:
2691
- if (f && (w || k) && l) {
2692
- const S = this.imageResolveMap.get(f);
2693
- if (!S || S.requestId !== g) {
2694
- this.closeImageSource(w || k);
2721
+ if (f && (w || S) && l) {
2722
+ const v = this.imageResolveMap.get(f);
2723
+ if (!v || v.requestId !== g) {
2724
+ this.closeImageSource(w || S);
2695
2725
  break;
2696
2726
  }
2697
2727
  const T = l.toString();
2698
2728
  this.deleteCachedImagesByWorkId(T), this.cacheImages.set(f, {
2699
- imageSource: w || k,
2729
+ imageSource: w || S,
2700
2730
  workId: T
2701
2731
  });
2702
- const { resolve: C, timer: L } = S;
2732
+ const { resolve: C, timer: L } = v;
2703
2733
  L && clearTimeout(L), C && C(f);
2704
2734
  }
2705
2735
  break;
2706
2736
  case h.GetVNodeInfo:
2707
2737
  if (l && I) {
2708
- const S = I.map((T) => this.vNodes.get(T));
2738
+ const v = I.map((T) => this.vNodes.get(T));
2709
2739
  this.post({
2710
2740
  sp: [
2711
2741
  {
2712
2742
  type: h.GetVNodeInfo,
2713
2743
  dataType: R.Local,
2714
2744
  workId: l,
2715
- vInfo: S
2745
+ vInfo: v
2716
2746
  }
2717
2747
  ]
2718
2748
  });
@@ -2733,8 +2763,8 @@ class je {
2733
2763
  return;
2734
2764
  let p = a;
2735
2765
  if (n === pe.Iconify) {
2736
- const [y, S] = this.getIconSize(c, d, this.opt.displayer.dpr);
2737
- p = ue(a, y, S, l);
2766
+ const [y, v] = this.getIconSize(c, d, this.opt.displayer.dpr);
2767
+ p = ue(a, y, v, l);
2738
2768
  }
2739
2769
  if (this.cacheImages.has(p)) {
2740
2770
  const y = this.getCachedImages(p);
@@ -2744,18 +2774,18 @@ class je {
2744
2774
  const w = this.imageResolveMap.get(p);
2745
2775
  if (w)
2746
2776
  return await w.promise, this.getCachedImages(p);
2747
- let k, I;
2748
- const W = new Promise((y, S) => {
2749
- k = y, I = S;
2777
+ let S, I;
2778
+ const W = new Promise((y, v) => {
2779
+ S = y, I = v;
2750
2780
  }), g = {
2751
- resolve: k,
2781
+ resolve: S,
2752
2782
  reject: I,
2753
2783
  timer: void 0,
2754
2784
  requestId: i,
2755
2785
  promise: W
2756
2786
  };
2757
2787
  return g.timer = setTimeout(() => {
2758
- this.imageResolveMap.get(p) === g && k(p);
2788
+ this.imageResolveMap.get(p) === g && S(p);
2759
2789
  }, 5e3), this.imageResolveMap.set(p, g), this.opt.post({
2760
2790
  sp: [
2761
2791
  {
@@ -2930,29 +2960,29 @@ class je {
2930
2960
  }
2931
2961
  if (t != null && t.aborted) return;
2932
2962
  const f = /* @__PURE__ */ new Map();
2933
- for (const [y, S] of this.vNodes.getNodesByType(m.Text).entries()) {
2934
- const T = S.rect;
2963
+ for (const [y, v] of this.vNodes.getNodesByType(m.Text).entries()) {
2964
+ const T = v.rect;
2935
2965
  f.set(y, J(T));
2936
2966
  }
2937
- for (const [y, S] of this.vNodes.gethasEraserNodes().entries())
2938
- f.set(y, J(S.rect));
2967
+ for (const [y, v] of this.vNodes.gethasEraserNodes().entries())
2968
+ f.set(y, J(v.rect));
2939
2969
  const w = new Set(f.keys());
2940
- let k = !1;
2970
+ let S = !1;
2941
2971
  if (this.localWork.hasSelector()) {
2942
2972
  const y = (l = this.localWork.getSelector()) == null ? void 0 : l.selectIds;
2943
2973
  if (y) {
2944
- k = !0;
2945
- for (const S of y)
2946
- w.add(S);
2974
+ S = !0;
2975
+ for (const v of y)
2976
+ w.add(v);
2947
2977
  }
2948
2978
  }
2949
2979
  let I = !1;
2950
2980
  if (this.serviceWork.selectorWorkShapes.size)
2951
2981
  for (const y of this.serviceWork.selectorWorkShapes.values()) {
2952
- const S = y.selectIds;
2953
- if (S) {
2982
+ const v = y.selectIds;
2983
+ if (v) {
2954
2984
  I = !0;
2955
- for (const T of S)
2985
+ for (const T of v)
2956
2986
  w.add(T);
2957
2987
  }
2958
2988
  }
@@ -2961,14 +2991,14 @@ class je {
2961
2991
  for (const [T, C] of f.entries()) {
2962
2992
  const L = this.vNodes.get(T);
2963
2993
  if (L) {
2964
- const A = C, E = L.rect, v = this.getSceneRect(), O = ae(A, v), B = ae(E, v);
2994
+ const A = C, E = L.rect, k = this.getSceneRect(), B = ae(A, k), O = ae(E, k);
2965
2995
  let P = c;
2966
- (O !== B || A.w !== E.w || A.h !== E.h || B === Ce.intersect) && (P = !0);
2996
+ (B !== O || A.w !== E.w || A.h !== E.h || O === Ce.intersect) && (P = !0);
2967
2997
  const { toolsType: F, opt: U } = L, X = U.eraserlines && U.eraserlines.length > 0 || !!U.eraserFaces;
2968
2998
  (P || p && X) && (F === m.Text || X) && this.debounceUpdateCache.add(T);
2969
2999
  }
2970
3000
  }
2971
- if (k && this.localWork.reRenderSelector(), I)
3001
+ if (S && this.localWork.reRenderSelector(), I)
2972
3002
  for (const [
2973
3003
  T,
2974
3004
  C
@@ -2983,36 +3013,36 @@ class je {
2983
3013
  o = !0;
2984
3014
  const y = { cancelled: !1, cameraTaskId: i, context: t };
2985
3015
  this.activeCameraSettledRender = y;
2986
- const S = () => !this.destroyed && !y.cancelled && this.activeCameraSettledRender === y && !(t != null && t.aborted);
3016
+ const v = () => !this.destroyed && !y.cancelled && this.activeCameraSettledRender === y && !(t != null && t.aborted);
2987
3017
  this.debounceUpdateCameraId = setTimeout(async () => {
2988
3018
  var T;
2989
3019
  this.debounceUpdateCameraId = void 0;
2990
3020
  try {
2991
- if (!S()) return;
3021
+ if (!v()) return;
2992
3022
  const C = [];
2993
3023
  for (const E of this.debounceUpdateCache.values()) {
2994
- const v = (T = this.fullLayer) == null ? void 0 : T.getElementsByName(E)[0], O = this.vNodes.get(E);
2995
- if (O) {
2996
- const { toolsType: B, opt: P } = O;
2997
- if (v || B !== m.Text) {
3024
+ const k = (T = this.fullLayer) == null ? void 0 : T.getElementsByName(E)[0], B = this.vNodes.get(E);
3025
+ if (B) {
3026
+ const { toolsType: O, opt: P } = B;
3027
+ if (k || O !== m.Text) {
2998
3028
  const F = this.localWork.setFullWork({
2999
- toolsType: B,
3029
+ toolsType: O,
3000
3030
  opt: P,
3001
3031
  workId: E
3002
3032
  });
3003
3033
  if (F) {
3004
- if (B === m.Text)
3034
+ if (O === m.Text)
3005
3035
  C.push(
3006
3036
  F.consumeServiceAsync({
3007
3037
  isFullWork: !0,
3008
3038
  replaceId: E,
3009
3039
  boxRect: this.getSceneRect(),
3010
- isActive: S
3040
+ isActive: v
3011
3041
  })
3012
3042
  );
3013
3043
  else if (P.eraserlines && P.eraserlines.length > 0 || P.eraserFaces) {
3014
3044
  const U = F.consumeService({
3015
- op: O.op,
3045
+ op: B.op,
3016
3046
  isFullWork: !0,
3017
3047
  replaceId: E,
3018
3048
  workState: b.Done
@@ -3024,7 +3054,7 @@ class je {
3024
3054
  }
3025
3055
  this.debounceUpdateCache.delete(E);
3026
3056
  }
3027
- if (await Promise.all(C), !S()) return;
3057
+ if (await Promise.all(C), !v()) return;
3028
3058
  this.vNodes.updateLowLevelNodesRect(), this.vNodes.clearHighLevelIds();
3029
3059
  const L = [
3030
3060
  this.fullLayer.parent.prepareRender,
@@ -3037,7 +3067,7 @@ class je {
3037
3067
  this.topLayer.parent,
3038
3068
  this.localLayer.parent,
3039
3069
  this.serviceLayer.parent
3040
- ], await Promise.all(L), y.renderLayers = void 0, !S()) return;
3070
+ ], await Promise.all(L), y.renderLayers = void 0, !v()) return;
3041
3071
  const A = y.cameraTaskId;
3042
3072
  G(A) && this.opt.post({
3043
3073
  viewId: this.viewId,
@@ -3045,7 +3075,7 @@ class je {
3045
3075
  cameraSettledTaskId: A
3046
3076
  });
3047
3077
  } catch (C) {
3048
- if (!S()) return;
3078
+ if (!v()) return;
3049
3079
  const L = {
3050
3080
  code: "RENDERER_BUSINESS_ERROR",
3051
3081
  business: "updateCamera",
@@ -3087,8 +3117,8 @@ class je {
3087
3117
  "prepare-render"
3088
3118
  )) {
3089
3119
  W.filter(
3090
- (S) => S.cancelPendingRender()
3091
- ).forEach((S) => S.render()), g.catch(() => {
3120
+ (v) => v.cancelPendingRender()
3121
+ ).forEach((v) => v.render()), g.catch(() => {
3092
3122
  });
3093
3123
  return;
3094
3124
  }
@@ -3382,17 +3412,17 @@ class Je {
3382
3412
  const w = this.imageResolveMap.get(p);
3383
3413
  if (w)
3384
3414
  return await w.promise, this.getCachedImages(p);
3385
- let k;
3415
+ let S;
3386
3416
  const I = new Promise((g) => {
3387
- k = g;
3417
+ S = g;
3388
3418
  }), W = {
3389
- resolve: k,
3419
+ resolve: S,
3390
3420
  timer: void 0,
3391
3421
  requestId: i,
3392
3422
  promise: I
3393
3423
  };
3394
3424
  return W.timer = setTimeout(() => {
3395
- this.imageResolveMap.get(p) === W && k(p);
3425
+ this.imageResolveMap.get(p) === W && S(p);
3396
3426
  }, 5e3), this.imageResolveMap.set(p, W), this.opt.post({
3397
3427
  viewId: this.viewId,
3398
3428
  viewGeneration: this.viewGeneration,
@@ -3586,7 +3616,7 @@ class Je {
3586
3616
  for (const r of s.sp) {
3587
3617
  let i = !1;
3588
3618
  for (const o of e)
3589
- if (Oe(r, o)) {
3619
+ if (Be(r, o)) {
3590
3620
  i = !0;
3591
3621
  break;
3592
3622
  }
@@ -3739,7 +3769,7 @@ class lt {
3739
3769
  consumeWorkId: p
3740
3770
  } = e;
3741
3771
  if (c && q(i)) {
3742
- const f = Be(
3772
+ const f = Oe(
3743
3773
  o,
3744
3774
  a,
3745
3775
  "mainThread"
@@ -3894,17 +3924,17 @@ class lt {
3894
3924
  if (o === h.Init) {
3895
3925
  const g = i.viewGeneration ?? (this.viewGenerationById.get(a) || 0) + 1;
3896
3926
  await this.enqueueViewTask(a, async () => {
3897
- var E, v, O;
3927
+ var E, k, B;
3898
3928
  const y = this.viewGenerationById.get(a);
3899
3929
  if (y !== void 0 && g < y)
3900
3930
  return;
3901
3931
  this.viewGenerationById.set(a, g);
3902
- const S = i.viewOwner || `${a}:${g}:${++this.ownerSequence}`, T = (E = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : E.displayer, C = T == null ? void 0 : T.canvasContainerRef.current;
3932
+ const v = i.viewOwner || `${a}:${g}:${++this.ownerSequence}`, T = (E = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : E.displayer, C = T == null ? void 0 : T.canvasContainerRef.current;
3903
3933
  if (!T || !C || !l || !p) {
3904
3934
  this.viewOwnerById.delete(a);
3905
3935
  return;
3906
3936
  }
3907
- this.viewOwnerById.set(a, S);
3937
+ this.viewOwnerById.set(a, v);
3908
3938
  const L = this.mainThreadMap.get(a);
3909
3939
  L == null || L.destroy();
3910
3940
  const A = this.createMainThread(a, {
@@ -3913,14 +3943,14 @@ class lt {
3913
3943
  layerOpt: l,
3914
3944
  master: this.master,
3915
3945
  canvasOpt: p,
3916
- viewOwner: S,
3946
+ viewOwner: v,
3917
3947
  viewGeneration: g,
3918
- mainThreadRenderMode: ((O = (v = this.master.control) == null ? void 0 : v.renderingCompatibilityDecision) == null ? void 0 : O.mainThreadRenderMode) ?? "normal",
3919
- post: (B) => this.post({
3920
- ...B,
3921
- viewId: B.viewId || a,
3922
- viewGeneration: B.viewGeneration ?? g,
3923
- viewOwner: S
3948
+ mainThreadRenderMode: ((B = (k = this.master.control) == null ? void 0 : k.renderingCompatibilityDecision) == null ? void 0 : B.mainThreadRenderMode) ?? "normal",
3949
+ post: (O) => this.post({
3950
+ ...O,
3951
+ viewId: O.viewId || a,
3952
+ viewGeneration: O.viewGeneration ?? g,
3953
+ viewOwner: v
3924
3954
  })
3925
3955
  });
3926
3956
  this.mainThreadMap.set(a, A), A && f && A.setCameraOpt(f), this.post({
@@ -3936,12 +3966,12 @@ class lt {
3936
3966
  continue;
3937
3967
  }
3938
3968
  if (o === h.Snapshot || o === h.BoundingBox) {
3939
- const g = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, y = (s = this.master.control.viewContainerManager.mainView) == null ? void 0 : s.displayer, S = (r = y == null ? void 0 : y.snapshotContainerRef) == null ? void 0 : r.current;
3940
- if (g && S && f) {
3969
+ const g = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, y = (s = this.master.control.viewContainerManager.mainView) == null ? void 0 : s.displayer, v = (r = y == null ? void 0 : y.snapshotContainerRef) == null ? void 0 : r.current;
3970
+ if (g && v && f) {
3941
3971
  const T = this.getSnapshotRequestKey(i), C = this.snapshotThreadsByRequest.get(T);
3942
3972
  C && this.disposeSnapshotThread(T, C.thread, "replaced");
3943
3973
  const L = document.createElement("div");
3944
- L.style.width = `${f.width}px`, L.style.height = `${f.height}px`, S.append(L);
3974
+ L.style.width = `${f.width}px`, L.style.height = `${f.height}px`, v.append(L);
3945
3975
  const A = {
3946
3976
  ...he.defaultLayerOpt,
3947
3977
  offscreen: !1,
@@ -3951,7 +3981,7 @@ class lt {
3951
3981
  ...he.defaultScreenCanvasOpt,
3952
3982
  width: f.width,
3953
3983
  height: f.height
3954
- }, v = this.createSnapshotThread(a, {
3984
+ }, k = this.createSnapshotThread(a, {
3955
3985
  displayer: g,
3956
3986
  container: L,
3957
3987
  layerOpt: A,
@@ -3962,14 +3992,14 @@ class lt {
3962
3992
  viewGeneration: this.viewGenerationById.get(a)
3963
3993
  });
3964
3994
  this.snapshotThreadsByRequest.set(T, {
3965
- thread: v,
3995
+ thread: k,
3966
3996
  surface: L
3967
- }), v.on(i).then(() => {
3968
- this.disposeSnapshotThread(T, v);
3969
- }).catch((O) => {
3997
+ }), k.on(i).then(() => {
3998
+ this.disposeSnapshotThread(T, k);
3999
+ }).catch((B) => {
3970
4000
  this.master.Logger.error(
3971
- `[Appliance]: snapshot render failed; viewId=${a}; error=${O instanceof Error ? O.message : String(O)}`
3972
- ), this.disposeSnapshotThread(T, v);
4001
+ `[Appliance]: snapshot render failed; viewId=${a}; error=${B instanceof Error ? B.message : String(B)}`
4002
+ ), this.disposeSnapshotThread(T, k);
3973
4003
  });
3974
4004
  continue;
3975
4005
  }
@@ -4000,8 +4030,8 @@ class lt {
4000
4030
  continue;
4001
4031
  }
4002
4032
  if (o === h.GetImageBitMap) {
4003
- const g = this.mainThreadMap.get(a), y = this.viewGenerationById.get(a), S = this.viewOwnerById.get(a);
4004
- if (!g || i.viewGeneration !== void 0 && i.viewGeneration !== y || i.viewOwner !== void 0 && i.viewOwner !== S || this.mainThreadMap.get(a) !== g) {
4033
+ const g = this.mainThreadMap.get(a), y = this.viewGenerationById.get(a), v = this.viewOwnerById.get(a);
4034
+ if (!g || i.viewGeneration !== void 0 && i.viewGeneration !== y || i.viewOwner !== void 0 && i.viewOwner !== v || this.mainThreadMap.get(a) !== g) {
4005
4035
  this.releaseMessageBitmap(i);
4006
4036
  continue;
4007
4037
  }
@@ -4009,12 +4039,12 @@ class lt {
4009
4039
  continue;
4010
4040
  }
4011
4041
  if (o === h.TasksQueue && (n != null && n.size)) {
4012
- const g = n.get(a), y = this.mainThreadMap.get(a), S = this.viewGenerationById.get(a), T = this.viewOwnerById.get(a);
4042
+ const g = n.get(a), y = this.mainThreadMap.get(a), v = this.viewGenerationById.get(a), T = this.viewOwnerById.get(a);
4013
4043
  let C;
4014
4044
  if (g && y)
4015
4045
  try {
4016
4046
  await this.enqueueViewTask(a, async () => {
4017
- this.viewGenerationById.get(a) !== S || this.viewOwnerById.get(a) !== T || this.mainThreadMap.get(a) !== y || await y.on(g);
4047
+ this.viewGenerationById.get(a) !== v || this.viewOwnerById.get(a) !== T || this.mainThreadMap.get(a) !== y || await y.on(g);
4018
4048
  });
4019
4049
  } catch (L) {
4020
4050
  if (g.msgType !== h.UpdateCamera) throw L;
@@ -4032,7 +4062,7 @@ class lt {
4032
4062
  if (C && q(d)) {
4033
4063
  this.post({
4034
4064
  viewId: a,
4035
- viewGeneration: S,
4065
+ viewGeneration: v,
4036
4066
  viewOwner: T,
4037
4067
  cameraTaskId: d,
4038
4068
  cameraTaskStatus: C.code === "RENDERER_BUSINESS_TIMEOUT" ? "timeout" : "failed",
@@ -4044,26 +4074,26 @@ class lt {
4044
4074
  workerTasksqueueCount: c,
4045
4075
  cameraTaskId: d,
4046
4076
  viewId: a,
4047
- viewGeneration: S,
4077
+ viewGeneration: v,
4048
4078
  viewOwner: T
4049
4079
  });
4050
4080
  continue;
4051
4081
  }
4052
4082
  if (a === ce) {
4053
4083
  const g = [...this.mainThreadMap.entries()];
4054
- for (const [y, S] of g) {
4084
+ for (const [y, v] of g) {
4055
4085
  const T = this.enqueueViewTask(y, async () => {
4056
- this.mainThreadMap.get(y) === S && (o === h.Destroy ? (S.destroy(), this.mainThreadMap.delete(y), this.viewOwnerById.delete(y), this.viewGenerationById.set(
4086
+ this.mainThreadMap.get(y) === v && (o === h.Destroy ? (v.destroy(), this.mainThreadMap.delete(y), this.viewOwnerById.delete(y), this.viewGenerationById.set(
4057
4087
  y,
4058
4088
  (this.viewGenerationById.get(y) || 0) + 1
4059
- )) : await S.on(i));
4089
+ )) : await v.on(i));
4060
4090
  });
4061
4091
  await T, this.cameraRenderQueueByView.get(y) === T && this.cameraRenderQueueByView.delete(y);
4062
4092
  }
4063
4093
  continue;
4064
4094
  }
4065
- const k = this.mainThreadMap.get(a);
4066
- if (o === h.Destroy && !k) {
4095
+ const S = this.mainThreadMap.get(a);
4096
+ if (o === h.Destroy && !S) {
4067
4097
  await this.enqueueViewTask(a, async () => {
4068
4098
  this.viewGenerationById.set(
4069
4099
  a,
@@ -4072,12 +4102,12 @@ class lt {
4072
4102
  });
4073
4103
  continue;
4074
4104
  }
4075
- if (!k)
4105
+ if (!S)
4076
4106
  continue;
4077
4107
  const I = this.viewGenerationById.get(a), W = this.enqueueViewTask(a, async () => {
4078
- this.viewGenerationById.get(a) !== I || this.mainThreadMap.get(a) !== k || await k.on(i);
4108
+ this.viewGenerationById.get(a) !== I || this.mainThreadMap.get(a) !== S || await S.on(i);
4079
4109
  });
4080
- o === h.Destroy && (await W, this.mainThreadMap.get(a) === k && this.mainThreadMap.delete(a), this.viewOwnerById.delete(a), this.cameraRenderQueueByView.get(a) === W && this.cameraRenderQueueByView.delete(a), this.viewGenerationById.set(
4110
+ o === h.Destroy && (await W, this.mainThreadMap.get(a) === S && this.mainThreadMap.delete(a), this.viewOwnerById.delete(a), this.cameraRenderQueueByView.get(a) === W && this.cameraRenderQueueByView.delete(a), this.viewGenerationById.set(
4081
4111
  a,
4082
4112
  i.viewGeneration ?? (I || 0) + 1
4083
4113
  ));