@netless/appliance-plugin 1.1.27-beta.4 → 1.1.27-beta.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.
@@ -14,7 +14,7 @@ import bi, { createPortal as Yo } from "react-dom";
14
14
  import Ct from "react-draggable";
15
15
  import { Resizable as Ro } from "re-resizable";
16
16
  const pI = "/fullWorker.js", yI = "/subWorker.js";
17
- var ie = /* @__PURE__ */ ((o) => (o.selector = "selector", o.clicker = "clicker", o.laserPointer = "laserPointer", o.pencil = "pencil", o.rectangle = "rectangle", o.ellipse = "ellipse", o.shape = "shape", o.eraser = "eraser", o.pencilEraser = "pencilEraser", o.text = "text", o.straight = "straight", o.arrow = "arrow", o.hand = "hand", o.laserPen = "laserPen", o))(ie || {}), me = /* @__PURE__ */ ((o) => (o.Normal = "Normal", o.Stroke = "Stroke", o.Dotted = "Dotted", o.LongDotted = "LongDotted", o))(me || {}), _e = /* @__PURE__ */ ((o) => (o.Triangle = "triangle", o.Rhombus = "rhombus", o.Pentagram = "pentagram", o.SpeechBalloon = "speechBalloon", o.Star = "star", o.Polygon = "polygon", o))(_e || {}), U = /* @__PURE__ */ ((o) => (o.None = "None", o.ShowFloatBar = "ShowFloatBar", o.ZIndexFloatBar = "ZIndexFloatBar", o.DeleteNode = "DeleteNode", o.CopyNode = "CopyNode", o.ZIndexActive = "ZIndexActive", o.ZIndexNode = "ZIndexNode", o.RotateNode = "RotateNode", o.SetColorNode = "SetColorNode", o.TranslateNode = "TranslateNode", o.ScaleNode = "ScaleNode", o.OriginalEvent = "OriginalEvent", o.CreateScene = "CreateScene", o.ActiveCursor = "ActiveCursor", o.MoveCursor = "MoveCursor", o.CommandEditor = "CommandEditor", o.SetEditorData = "SetEditorData", o.SetFontStyle = "SetFontStyle", o.SetPoint = "SetPoint", o.SetLock = "SetLock", o.SetShapeOpt = "SetShapeOpt", o.CameraChange = "CameraChange", o.ActiveMethod = "ActiveMethod", o.HidFloatBarBtn = "HidFloatBarBtn", o))(U || {}), ee = /* @__PURE__ */ ((o) => (o.DisplayState = "DisplayState", o.MainEngine = "MainEngine", o.Cursor = "Cursor", o.BindMainView = "BindMainView", o))(ee || {}), Uo = /* @__PURE__ */ ((o) => (o[o.MainView = 0] = "MainView", o[o.Plugin = 1] = "Plugin", o[o.Both = 2] = "Both", o))(Uo || {}), Hn = /* @__PURE__ */ ((o) => (o.longPencil = "longPencil", o))(Hn || {}), v = /* @__PURE__ */ ((o) => (o[o.Pencil = 1] = "Pencil", o[o.Eraser = 2] = "Eraser", o[o.PencilEraser = 3] = "PencilEraser", o[o.BitMapEraser = 4] = "BitMapEraser", o[o.Selector = 5] = "Selector", o[o.Clicker = 6] = "Clicker", o[o.Arrow = 7] = "Arrow", o[o.Hand = 8] = "Hand", o[o.LaserPen = 9] = "LaserPen", o[o.Text = 10] = "Text", o[o.Straight = 11] = "Straight", o[o.Rectangle = 12] = "Rectangle", o[o.Ellipse = 13] = "Ellipse", o[o.Star = 14] = "Star", o[o.Triangle = 15] = "Triangle", o[o.Rhombus = 16] = "Rhombus", o[o.Polygon = 17] = "Polygon", o[o.SpeechBalloon = 18] = "SpeechBalloon", o[o.Image = 19] = "Image", o))(v || {}), q = /* @__PURE__ */ ((o) => (o[o.Local = 1] = "Local", o[o.Service = 2] = "Service", o[o.Worker = 3] = "Worker", o))(q || {}), j = /* @__PURE__ */ ((o) => (o[o.Pending = 0] = "Pending", o[o.Start = 1] = "Start", o[o.Doing = 2] = "Doing", o[o.Done = 3] = "Done", o[o.Unwritable = 4] = "Unwritable", o))(j || {}), R = /* @__PURE__ */ ((o) => (o[o.None = 0] = "None", o[o.Init = 1] = "Init", o[o.UpdateCamera = 2] = "UpdateCamera", o[o.UpdateTools = 3] = "UpdateTools", o[o.CreateWork = 4] = "CreateWork", o[o.DrawWork = 5] = "DrawWork", o[o.FullWork = 6] = "FullWork", o[o.UpdateNode = 7] = "UpdateNode", o[o.RemoveNode = 8] = "RemoveNode", o[o.Clear = 9] = "Clear", o[o.Select = 10] = "Select", o[o.Destroy = 11] = "Destroy", o[o.Snapshot = 12] = "Snapshot", o[o.BoundingBox = 13] = "BoundingBox", o[o.Cursor = 14] = "Cursor", o[o.TextUpdate = 15] = "TextUpdate", o[o.GetTextActive = 16] = "GetTextActive", o[o.TasksQueue = 17] = "TasksQueue", o[o.CursorHover = 18] = "CursorHover", o[o.CursorBlur = 19] = "CursorBlur", o[o.Console = 20] = "Console", o[o.GetImageBitMap = 23] = "GetImageBitMap", o[o.AuthWriter = 24] = "AuthWriter", o[o.AuthReader = 25] = "AuthReader", o[o.AuthClear = 26] = "AuthClear", o[o.AuthPage = 27] = "AuthPage", o[o.GetVNodeInfo = 28] = "GetVNodeInfo", o[o.UpdateDpr = 29] = "UpdateDpr", o[o.SetFontFace = 30] = "SetFontFace", o[o.ReportError = 31] = "ReportError", o[o.ReportLog = 32] = "ReportLog", o))(R || {}), nt = /* @__PURE__ */ ((o) => (o[o.None = 0] = "None", o[o.Bg = 1] = "Bg", o[o.ServiceFloat = 2] = "ServiceFloat", o[o.Float = 3] = "Float", o[o.TopFloat = 4] = "TopFloat", o))(nt || {}), Qt = /* @__PURE__ */ ((o) => (o[o.Cursor = 1] = "Cursor", o[o.TextCreate = 2] = "TextCreate", o))(Qt || {}), Gt = /* @__PURE__ */ ((o) => (o[o.Top = 1] = "Top", o[o.Bottom = 2] = "Bottom", o))(Gt || {}), Fe = /* @__PURE__ */ ((o) => (o[o.none = 1] = "none", o[o.all = 2] = "all", o[o.both = 3] = "both", o[o.proportional = 4] = "proportional", o))(Fe || {}), Wo = /* @__PURE__ */ ((o) => (o[o.Pending = 0] = "Pending", o[o.Start = 1] = "Start", o[o.Doing = 2] = "Doing", o[o.Done = 3] = "Done", o[o.Unwritable = 4] = "Unwritable", o))(Wo || {}), Vt = /* @__PURE__ */ ((o) => (o[o.inside = 0] = "inside", o[o.outside = 1] = "outside", o[o.intersect = 2] = "intersect", o))(Vt || {}), ke = /* @__PURE__ */ ((o) => (o.renderPage = "renderPage", o.addPage = "addPage", o.deletePage = "deletePage", o.addElement = "addElement", o.deleteElement = "deleteElement", o.clearPage = "clearPage", o.clearViewScenePath = "clearViewScenePath", o.clearView = "clearView", o.syncUndoStack = "syncUndoStack", o.syncRedoStack = "syncRedoStack", o))(ke || {}), tt = /* @__PURE__ */ ((o) => (o.setAuth = "setAuth", o.setShow = "addShow", o.setHide = "setHide", o.setClear = "setClear", o))(tt || {}), Zt = /* @__PURE__ */ ((o) => (o.Image = "image", o.Iconify = "iconify", o))(Zt || {});
17
+ var ie = /* @__PURE__ */ ((o) => (o.selector = "selector", o.clicker = "clicker", o.laserPointer = "laserPointer", o.pencil = "pencil", o.rectangle = "rectangle", o.ellipse = "ellipse", o.shape = "shape", o.eraser = "eraser", o.pencilEraser = "pencilEraser", o.text = "text", o.straight = "straight", o.arrow = "arrow", o.hand = "hand", o.laserPen = "laserPen", o))(ie || {}), me = /* @__PURE__ */ ((o) => (o.Normal = "Normal", o.Stroke = "Stroke", o.Dotted = "Dotted", o.LongDotted = "LongDotted", o))(me || {}), _e = /* @__PURE__ */ ((o) => (o.Triangle = "triangle", o.Rhombus = "rhombus", o.Pentagram = "pentagram", o.SpeechBalloon = "speechBalloon", o.Star = "star", o.Polygon = "polygon", o))(_e || {}), U = /* @__PURE__ */ ((o) => (o.None = "None", o.ShowFloatBar = "ShowFloatBar", o.ZIndexFloatBar = "ZIndexFloatBar", o.DeleteNode = "DeleteNode", o.CopyNode = "CopyNode", o.ZIndexActive = "ZIndexActive", o.ZIndexNode = "ZIndexNode", o.RotateNode = "RotateNode", o.SetColorNode = "SetColorNode", o.TranslateNode = "TranslateNode", o.ScaleNode = "ScaleNode", o.OriginalEvent = "OriginalEvent", o.CreateScene = "CreateScene", o.ActiveCursor = "ActiveCursor", o.MoveCursor = "MoveCursor", o.CommandEditor = "CommandEditor", o.SetEditorData = "SetEditorData", o.SetFontStyle = "SetFontStyle", o.SetPoint = "SetPoint", o.SetLock = "SetLock", o.SetShapeOpt = "SetShapeOpt", o.CameraChange = "CameraChange", o.ActiveMethod = "ActiveMethod", o.HidFloatBarBtn = "HidFloatBarBtn", o))(U || {}), ee = /* @__PURE__ */ ((o) => (o.DisplayState = "DisplayState", o.MainEngine = "MainEngine", o.Cursor = "Cursor", o.BindMainView = "BindMainView", o))(ee || {}), Uo = /* @__PURE__ */ ((o) => (o[o.MainView = 0] = "MainView", o[o.Plugin = 1] = "Plugin", o[o.Both = 2] = "Both", o))(Uo || {}), Hn = /* @__PURE__ */ ((o) => (o.longPencil = "longPencil", o))(Hn || {}), T = /* @__PURE__ */ ((o) => (o[o.Pencil = 1] = "Pencil", o[o.Eraser = 2] = "Eraser", o[o.PencilEraser = 3] = "PencilEraser", o[o.BitMapEraser = 4] = "BitMapEraser", o[o.Selector = 5] = "Selector", o[o.Clicker = 6] = "Clicker", o[o.Arrow = 7] = "Arrow", o[o.Hand = 8] = "Hand", o[o.LaserPen = 9] = "LaserPen", o[o.Text = 10] = "Text", o[o.Straight = 11] = "Straight", o[o.Rectangle = 12] = "Rectangle", o[o.Ellipse = 13] = "Ellipse", o[o.Star = 14] = "Star", o[o.Triangle = 15] = "Triangle", o[o.Rhombus = 16] = "Rhombus", o[o.Polygon = 17] = "Polygon", o[o.SpeechBalloon = 18] = "SpeechBalloon", o[o.Image = 19] = "Image", o))(T || {}), q = /* @__PURE__ */ ((o) => (o[o.Local = 1] = "Local", o[o.Service = 2] = "Service", o[o.Worker = 3] = "Worker", o))(q || {}), x = /* @__PURE__ */ ((o) => (o[o.Pending = 0] = "Pending", o[o.Start = 1] = "Start", o[o.Doing = 2] = "Doing", o[o.Done = 3] = "Done", o[o.Unwritable = 4] = "Unwritable", o))(x || {}), R = /* @__PURE__ */ ((o) => (o[o.None = 0] = "None", o[o.Init = 1] = "Init", o[o.UpdateCamera = 2] = "UpdateCamera", o[o.UpdateTools = 3] = "UpdateTools", o[o.CreateWork = 4] = "CreateWork", o[o.DrawWork = 5] = "DrawWork", o[o.FullWork = 6] = "FullWork", o[o.UpdateNode = 7] = "UpdateNode", o[o.RemoveNode = 8] = "RemoveNode", o[o.Clear = 9] = "Clear", o[o.Select = 10] = "Select", o[o.Destroy = 11] = "Destroy", o[o.Snapshot = 12] = "Snapshot", o[o.BoundingBox = 13] = "BoundingBox", o[o.Cursor = 14] = "Cursor", o[o.TextUpdate = 15] = "TextUpdate", o[o.GetTextActive = 16] = "GetTextActive", o[o.TasksQueue = 17] = "TasksQueue", o[o.CursorHover = 18] = "CursorHover", o[o.CursorBlur = 19] = "CursorBlur", o[o.Console = 20] = "Console", o[o.GetImageBitMap = 23] = "GetImageBitMap", o[o.AuthWriter = 24] = "AuthWriter", o[o.AuthReader = 25] = "AuthReader", o[o.AuthClear = 26] = "AuthClear", o[o.AuthPage = 27] = "AuthPage", o[o.GetVNodeInfo = 28] = "GetVNodeInfo", o[o.UpdateDpr = 29] = "UpdateDpr", o[o.SetFontFace = 30] = "SetFontFace", o[o.ReportError = 31] = "ReportError", o[o.ReportLog = 32] = "ReportLog", o))(R || {}), nt = /* @__PURE__ */ ((o) => (o[o.None = 0] = "None", o[o.Bg = 1] = "Bg", o[o.ServiceFloat = 2] = "ServiceFloat", o[o.Float = 3] = "Float", o[o.TopFloat = 4] = "TopFloat", o))(nt || {}), Qt = /* @__PURE__ */ ((o) => (o[o.Cursor = 1] = "Cursor", o[o.TextCreate = 2] = "TextCreate", o))(Qt || {}), Gt = /* @__PURE__ */ ((o) => (o[o.Top = 1] = "Top", o[o.Bottom = 2] = "Bottom", o))(Gt || {}), Fe = /* @__PURE__ */ ((o) => (o[o.none = 1] = "none", o[o.all = 2] = "all", o[o.both = 3] = "both", o[o.proportional = 4] = "proportional", o))(Fe || {}), Wo = /* @__PURE__ */ ((o) => (o[o.Pending = 0] = "Pending", o[o.Start = 1] = "Start", o[o.Doing = 2] = "Doing", o[o.Done = 3] = "Done", o[o.Unwritable = 4] = "Unwritable", o))(Wo || {}), Vt = /* @__PURE__ */ ((o) => (o[o.inside = 0] = "inside", o[o.outside = 1] = "outside", o[o.intersect = 2] = "intersect", o))(Vt || {}), ke = /* @__PURE__ */ ((o) => (o.renderPage = "renderPage", o.addPage = "addPage", o.deletePage = "deletePage", o.addElement = "addElement", o.deleteElement = "deleteElement", o.clearPage = "clearPage", o.clearViewScenePath = "clearViewScenePath", o.clearView = "clearView", o.syncUndoStack = "syncUndoStack", o.syncRedoStack = "syncRedoStack", o))(ke || {}), tt = /* @__PURE__ */ ((o) => (o.setAuth = "setAuth", o.setShow = "addShow", o.setHide = "setHide", o.setClear = "setClear", o))(tt || {}), Zt = /* @__PURE__ */ ((o) => (o.Image = "image", o.Iconify = "iconify", o))(Zt || {});
18
18
  const II = "cursorhover", Gn = 20, pe = "mainView", Bo = {
19
19
  linear: (o) => o,
20
20
  easeInQuad: (o) => o * o,
@@ -1142,7 +1142,7 @@ function ug(o) {
1142
1142
  return ag(o, cg | lg);
1143
1143
  }
1144
1144
  var hg = ug;
1145
- const ci = /* @__PURE__ */ Ei(hg), To = "1.1.27-beta.4", dg = "@netless/appliance-plugin", jn = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1145
+ const ci = /* @__PURE__ */ Ei(hg), To = "1.1.27-beta.5", dg = "@netless/appliance-plugin", jn = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1146
1146
  if (typeof window < "u") {
1147
1147
  let o = window.__netlessUA || "";
1148
1148
  o += ` ${dg}@${To}`, window.__netlessUA = o;
@@ -1392,7 +1392,7 @@ class _g {
1392
1392
  y(this, "checkLocalTextBlur", Lt(() => {
1393
1393
  if (this.collector)
1394
1394
  for (const [i, e] of this.editors.entries())
1395
- e.opt.workState !== j.Done && this.collector.isLocalId(i) && this.activeId !== i && (e.opt.text && e.opt.text.replace(/\s*,/g, "") ? this.unActive(i) : this.delete(i, !0, !0));
1395
+ e.opt.workState !== x.Done && this.collector.isLocalId(i) && this.activeId !== i && (e.opt.text && e.opt.text.replace(/\s*,/g, "") ? this.unActive(i) : this.delete(i, !0, !0));
1396
1396
  }, 100));
1397
1397
  const { control: e, internalMsgEmitter: t, publicMsgEmitter: n } = i;
1398
1398
  this.control = e, this.internalMsgEmitter = t, this.publicMsgEmitter = n;
@@ -1422,7 +1422,7 @@ class _g {
1422
1422
  get interceptors() {
1423
1423
  return {
1424
1424
  set: (i, e) => {
1425
- var d, I, m, M, f, T, S, N, C;
1425
+ var d, I, m, M, f, N, S, v, j;
1426
1426
  if (!this.collector)
1427
1427
  return !0;
1428
1428
  const {
@@ -1438,40 +1438,40 @@ class _g {
1438
1438
  if (!s && !r)
1439
1439
  return !0;
1440
1440
  const g = ((d = this.collector) == null ? void 0 : d.isLocalId(i)) ? (I = this.collector) == null ? void 0 : I.transformKey(i) : i, p = ((m = this.collector) == null ? void 0 : m.storage[t]) && this.collector.storage[t][n] && this.collector.storage[t][n][g] || void 0;
1441
- p ? p.toolsType === v.Text && (s && (this.control.worker.queryTaskBatchData({
1441
+ p ? p.toolsType === T.Text && (s && (this.control.worker.queryTaskBatchData({
1442
1442
  workId: i,
1443
1443
  msgType: R.UpdateNode
1444
- }).forEach((x) => {
1444
+ }).forEach((C) => {
1445
1445
  var k;
1446
- (k = this.control.worker) == null || k.taskBatchData.delete(x);
1446
+ (k = this.control.worker) == null || k.taskBatchData.delete(C);
1447
1447
  }), (S = this.control.worker) == null || S.taskBatchData.add({
1448
1448
  workId: i,
1449
1449
  msgType: R.UpdateNode,
1450
1450
  dataType: l || q.Local,
1451
- toolsType: v.Text,
1451
+ toolsType: T.Text,
1452
1452
  opt: c,
1453
1453
  viewId: t,
1454
1454
  scenePath: n,
1455
1455
  willRefresh: !0
1456
1456
  // willSyncService: canSync
1457
- }), (N = this.control.worker) == null || N.runAnimation()), r && ((C = this.collector) == null || C.dispatch({
1457
+ }), (v = this.control.worker) == null || v.runAnimation()), r && ((j = this.collector) == null || j.dispatch({
1458
1458
  type: R.UpdateNode,
1459
1459
  workId: i,
1460
- toolsType: v.Text,
1460
+ toolsType: T.Text,
1461
1461
  opt: c,
1462
1462
  viewId: t,
1463
1463
  scenePath: n,
1464
1464
  updateNodeOpt: h
1465
- }), c.workState === j.Done && this.undoTickerId && this.control.viewContainerManager.getUndoTickerId(t) === this.undoTickerId && (this.internalMsgEmitter.emit(
1465
+ }), c.workState === x.Done && this.undoTickerId && this.control.viewContainerManager.getUndoTickerId(t) === this.undoTickerId && (this.internalMsgEmitter.emit(
1466
1466
  "forceUndoTickerEnd",
1467
1467
  this.undoTickerId,
1468
1468
  t
1469
- ), this.undoTickerId = void 0), c.workState === j.Done && this.control.runEffectWork(() => {
1469
+ ), this.undoTickerId = void 0), c.workState === x.Done && this.control.runEffectWork(() => {
1470
1470
  this.control.worker.setShapeSelectorByWorkId(i, t);
1471
1471
  }))) : a === He.Text && (r && ((M = this.collector) == null || M.dispatch({
1472
1472
  type: c.text && R.FullWork || R.CreateWork,
1473
1473
  workId: i,
1474
- toolsType: v.Text,
1474
+ toolsType: T.Text,
1475
1475
  opt: c,
1476
1476
  isSync: !0,
1477
1477
  viewId: t,
@@ -1481,12 +1481,12 @@ class _g {
1481
1481
  workId: i,
1482
1482
  msgType: c.text && R.FullWork || R.CreateWork,
1483
1483
  dataType: l || q.Local,
1484
- toolsType: v.Text,
1484
+ toolsType: T.Text,
1485
1485
  opt: c,
1486
1486
  viewId: t,
1487
1487
  scenePath: n,
1488
1488
  willRefresh: !0
1489
- }), (T = this.control.worker) == null || T.runAnimation()));
1489
+ }), (N = this.control.worker) == null || N.runAnimation()));
1490
1490
  },
1491
1491
  delete: (i) => {
1492
1492
  var a, c, l;
@@ -1500,7 +1500,7 @@ class _g {
1500
1500
  return !0;
1501
1501
  s && ((a = this.control.worker) == null || a.taskBatchData.add({
1502
1502
  workId: i,
1503
- toolsType: v.Text,
1503
+ toolsType: T.Text,
1504
1504
  msgType: R.RemoveNode,
1505
1505
  dataType: q.Local,
1506
1506
  viewId: t,
@@ -1509,7 +1509,7 @@ class _g {
1509
1509
  }), (c = this.control.worker) == null || c.runAnimation()), r && ((l = this.collector) == null || l.dispatch({
1510
1510
  type: R.RemoveNode,
1511
1511
  removeIds: [i],
1512
- toolsType: v.Text,
1512
+ toolsType: T.Text,
1513
1513
  viewId: t,
1514
1514
  scenePath: n
1515
1515
  }), this.undoTickerId && this.control.viewContainerManager.getUndoTickerId(t) === this.undoTickerId && (this.internalMsgEmitter.emit(
@@ -1607,24 +1607,24 @@ class _g {
1607
1607
  viewId: r,
1608
1608
  scenePath: s
1609
1609
  };
1610
- if (t && t.workState === j.Done && !this.control.cursor.isEnableCursor && h && u) {
1611
- let T = c == null ? void 0 : c.uid;
1612
- if (!T) {
1610
+ if (t && t.workState === x.Done && !this.control.cursor.isEnableCursor && h && u) {
1611
+ let N = c == null ? void 0 : c.uid;
1612
+ if (!N) {
1613
1613
  const S = this.editors.get(l);
1614
- T = S && ((M = S.opt) == null ? void 0 : M.uid);
1614
+ N = S && ((M = S.opt) == null ? void 0 : M.uid);
1615
1615
  }
1616
- T && this.control.cursor.collectServiceCursor({
1616
+ N && this.control.cursor.collectServiceCursor({
1617
1617
  op: h && [
1618
1618
  h[0] + u[0],
1619
1619
  h[1] + u[1]
1620
1620
  ],
1621
- uid: T,
1622
- workState: j.Done,
1621
+ uid: N,
1622
+ workState: x.Done,
1623
1623
  viewId: r,
1624
1624
  type: R.Cursor
1625
1625
  });
1626
1626
  }
1627
- this.editors.set(l, d), a === q.Service && t.workState === j.Done && this.activeId === l && (this.activeId = void 0), this.control.viewContainerManager.updateTextEditorInfo(
1627
+ this.editors.set(l, d), a === q.Service && t.workState === x.Done && this.activeId === l && (this.activeId = void 0), this.control.viewContainerManager.updateTextEditorInfo(
1628
1628
  r,
1629
1629
  this.activeId
1630
1630
  );
@@ -1638,7 +1638,7 @@ class _g {
1638
1638
  active(i, e) {
1639
1639
  var n;
1640
1640
  const t = this.editors.get(i);
1641
- t && t.viewId && (t.opt.workState = j.Start, t.opt.uid = (n = this.collector) == null ? void 0 : n.uid, this.activeId = i, t.canWorker = !0, t.canSync = !0, e && t.viewId && this.addUndoTicker(e, t.viewId), this.editors.set(i, t), this.control.viewContainerManager.updateTextEditorInfo(
1641
+ t && t.viewId && (t.opt.workState = x.Start, t.opt.uid = (n = this.collector) == null ? void 0 : n.uid, this.activeId = i, t.canWorker = !0, t.canSync = !0, e && t.viewId && this.addUndoTicker(e, t.viewId), this.editors.set(i, t), this.control.viewContainerManager.updateTextEditorInfo(
1642
1642
  t.viewId,
1643
1643
  this.activeId
1644
1644
  ));
@@ -1647,7 +1647,7 @@ class _g {
1647
1647
  var t;
1648
1648
  const e = this.editors.get(i);
1649
1649
  if (e && e.viewId) {
1650
- e.opt.workState = j.Done, e.opt.uid = void 0, e.canWorker = !0, e.canSync = !0, this.editors.set(i, e), this.activeId = void 0;
1650
+ e.opt.workState = x.Done, e.opt.uid = void 0, e.canWorker = !0, e.canSync = !0, this.editors.set(i, e), this.activeId = void 0;
1651
1651
  const n = (t = this.control.viewContainerManager.getView(
1652
1652
  e.viewId
1653
1653
  )) == null ? void 0 : t.container;
@@ -1763,7 +1763,7 @@ class _g {
1763
1763
  const s = this.control.viewContainerManager.getView(i);
1764
1764
  if (!(s != null && s.focusScenePath))
1765
1765
  return;
1766
- const a = s == null ? void 0 : s.cameraOpt, c = this.control.getToolsOpt(v.Text, r);
1766
+ const a = s == null ? void 0 : s.cameraOpt, c = this.control.getToolsOpt(T.Text, r);
1767
1767
  if (!c)
1768
1768
  return;
1769
1769
  const l = (I = this.control.viewContainerManager) == null ? void 0 : I.transformToOriginPoint(
@@ -1777,7 +1777,7 @@ class _g {
1777
1777
  stripIgnoreTagBody: ["script"]
1778
1778
  // script标签较特殊,需要过滤标签中间的内容
1779
1779
  }).split(/\n/), g = c.toolsOpt;
1780
- g.text = qt(u), g.workState = j.Doing, g.boxPoint = [Math.round(e), Math.round(t)], g.boxSize = [g.fontSize, g.fontSize];
1780
+ g.text = qt(u), g.workState = x.Doing, g.boxPoint = [Math.round(e), Math.round(t)], g.boxSize = [g.fontSize, g.fontSize];
1781
1781
  const p = this.control.worker.now;
1782
1782
  return this.control.textEditorManager.checkEmptyTextBlur(), this.control.textEditorManager.createTextForMasterController(
1783
1783
  {
@@ -2220,10 +2220,10 @@ const Ye = class Ye extends OM {
2220
2220
  this.control.room.logger.error(
2221
2221
  `exceeds the limit of ${r} components, current: ${n}`
2222
2222
  ), (p = this.control.room) == null || p.disconnect().then(() => {
2223
- var M, f, T, S, N;
2224
- (T = (f = (M = this.control.room) == null ? void 0 : M.callbacks) == null ? void 0 : f.listeners) != null && T.map.onKickedWithReason && ((N = (S = this.control.room) == null ? void 0 : S.callbacks) == null || N.dispatch(
2223
+ var M, f, N, S, v;
2224
+ (N = (f = (M = this.control.room) == null ? void 0 : M.callbacks) == null ? void 0 : f.listeners) != null && N.map.onKickedWithReason && ((v = (S = this.control.room) == null ? void 0 : S.callbacks) == null || v.dispatch(
2225
2225
  "onKickedWithReason",
2226
- (C) => C("kickByAdmin")
2226
+ (j) => j("kickByAdmin")
2227
2227
  ));
2228
2228
  });
2229
2229
  return;
@@ -2437,6 +2437,7 @@ const Ye = class Ye extends OM {
2437
2437
  return e.split(at)[0] === this.uid;
2438
2438
  }
2439
2439
  dispatch(e) {
2440
+ var m;
2440
2441
  const {
2441
2442
  type: t,
2442
2443
  workId: n,
@@ -2455,15 +2456,15 @@ const Ye = class Ye extends OM {
2455
2456
  if (I)
2456
2457
  switch (t) {
2457
2458
  case R.Clear:
2458
- const m = {};
2459
- d && this.storage[I] && this.storage[I][d] ? (delete this.storage[I][d], this.setState(m, { isSync: p, viewId: I, scenePath: d })) : this.storage[I] && (delete this.storage[I], this.setState(m, { isSync: p, viewId: I, scenePath: "" })), st(
2459
+ const M = {};
2460
+ d && this.storage[I] && this.storage[I][d] ? (delete this.storage[I][d], this.setState(M, { isSync: p, viewId: I, scenePath: d })) : this.storage[I] && (delete this.storage[I], this.setState(M, { isSync: p, viewId: I, scenePath: "" })), st(
2460
2461
  () => {
2461
- var N, C;
2462
- this.control.isUseSimple || ((N = this.control.pluginManager) == null || N.dispatchPluginEvent(
2462
+ var j, C;
2463
+ (j = this.control.pluginManager) == null || j.dispatchPluginEvent(
2463
2464
  "syncStorage",
2464
2465
  I,
2465
2466
  d
2466
- ), (C = this.control.miniMapManager) == null || C.updateMiniMapCamera(I)), this.clearLimitComponents(I, d);
2467
+ ), this.control.isUseSimple || (C = this.control.miniMapManager) == null || C.updateMiniMapCamera(I), this.clearLimitComponents(I, d);
2467
2468
  },
2468
2469
  this.syncInterval,
2469
2470
  this.control.hasPolyfillMethod("requestIdleCallback")
@@ -2471,13 +2472,13 @@ const Ye = class Ye extends OM {
2471
2472
  break;
2472
2473
  case R.CreateWork:
2473
2474
  if (d && n && c && a) {
2474
- const N = this.isLocalId(n.toString()) ? this.transformKey(n) : n;
2475
+ const j = this.isLocalId(n.toString()) ? this.transformKey(n) : n;
2475
2476
  this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.addRenderPageElementId({
2476
2477
  viewId: I,
2477
2478
  scenePath: d,
2478
- elementId: N.toString()
2479
+ elementId: j.toString()
2479
2480
  }), this.updateValue(
2480
- N.toString(),
2481
+ j.toString(),
2481
2482
  {
2482
2483
  type: R.CreateWork,
2483
2484
  workId: n,
@@ -2490,24 +2491,24 @@ const Ye = class Ye extends OM {
2490
2491
  break;
2491
2492
  case R.DrawWork:
2492
2493
  if (d && n && typeof s == "number" && (u != null && u.length)) {
2493
- const N = this.isLocalId(n.toString()) ? this.transformKey(n) : n, C = this.storage[I] && this.storage[I][d] && this.storage[I][d][N] || void 0;
2494
+ const j = this.isLocalId(n.toString()) ? this.transformKey(n) : n, C = this.storage[I] && this.storage[I][d] && this.storage[I][d][j] || void 0;
2494
2495
  if (C != null && C.ops || (C == null ? void 0 : C.type) === R.FullWork)
2495
2496
  return;
2496
- const x = s ? ((C == null ? void 0 : C.op) || []).slice(0, s).concat(u) : u || (C == null ? void 0 : C.op), k = c || (C == null ? void 0 : C.toolsType), E = a || (C == null ? void 0 : C.opt), L = h || (C == null ? void 0 : C.updateNodeOpt);
2497
- n && k && E && x && (this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.addRenderPageElementId({
2497
+ const k = s ? ((C == null ? void 0 : C.op) || []).slice(0, s).concat(u) : u || (C == null ? void 0 : C.op), L = c || (C == null ? void 0 : C.toolsType), E = a || (C == null ? void 0 : C.opt), P = h || (C == null ? void 0 : C.updateNodeOpt);
2498
+ n && L && E && k && (this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.addRenderPageElementId({
2498
2499
  viewId: I,
2499
2500
  scenePath: d,
2500
- elementId: N.toString()
2501
+ elementId: j.toString()
2501
2502
  }), this.updateValue(
2502
- N.toString(),
2503
+ j.toString(),
2503
2504
  {
2504
2505
  ...C,
2505
2506
  type: R.DrawWork,
2506
2507
  workId: n,
2507
- updateNodeOpt: L,
2508
- toolsType: k,
2508
+ updateNodeOpt: P,
2509
+ toolsType: L,
2509
2510
  opt: E,
2510
- op: x,
2511
+ op: k,
2511
2512
  index: s
2512
2513
  },
2513
2514
  { isSync: p, viewId: I, scenePath: d }
@@ -2516,30 +2517,30 @@ const Ye = class Ye extends OM {
2516
2517
  break;
2517
2518
  case R.FullWork:
2518
2519
  if (d && n) {
2519
- const N = this.isLocalId(n.toString()) ? this.transformKey(n) : n, C = this.storage[I] && this.storage[I][d] && this.storage[I][d][N] || void 0, x = h || (C == null ? void 0 : C.updateNodeOpt), k = c || (C == null ? void 0 : C.toolsType), E = a || (C == null ? void 0 : C.opt), L = r || (C == null ? void 0 : C.ops);
2520
- k && E && (this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.addRenderPageElementId({
2520
+ const j = this.isLocalId(n.toString()) ? this.transformKey(n) : n, C = this.storage[I] && this.storage[I][d] && this.storage[I][d][j] || void 0, k = h || (C == null ? void 0 : C.updateNodeOpt), L = c || (C == null ? void 0 : C.toolsType), E = a || (C == null ? void 0 : C.opt), P = r || (C == null ? void 0 : C.ops);
2521
+ L && E && (this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.addRenderPageElementId({
2521
2522
  viewId: I,
2522
2523
  scenePath: d,
2523
- elementId: N.toString()
2524
+ elementId: j.toString()
2524
2525
  }), this.updateValue(
2525
- N.toString(),
2526
+ j.toString(),
2526
2527
  {
2527
2528
  type: R.FullWork,
2528
- updateNodeOpt: x,
2529
- workId: N,
2530
- toolsType: k,
2529
+ updateNodeOpt: k,
2530
+ workId: j,
2531
+ toolsType: L,
2531
2532
  opt: E,
2532
- ops: L
2533
+ ops: P
2533
2534
  },
2534
2535
  { isSync: p, viewId: I, scenePath: d }
2535
2536
  ), st(
2536
2537
  () => {
2537
- var P, z;
2538
- this.control.isUseSimple || ((P = this.control.pluginManager) == null || P.dispatchPluginEvent(
2538
+ var z, O;
2539
+ (z = this.control.pluginManager) == null || z.dispatchPluginEvent(
2539
2540
  "syncStorage",
2540
2541
  I,
2541
2542
  d
2542
- ), (z = this.control.miniMapManager) == null || z.updateMiniMapCamera(I)), this.limitComponents(I, d);
2543
+ ), this.control.isUseSimple || (O = this.control.miniMapManager) == null || O.updateMiniMapCamera(I), this.limitComponents(I, d);
2543
2544
  },
2544
2545
  this.syncInterval,
2545
2546
  this.control.hasPolyfillMethod("requestIdleCallback")
@@ -2548,21 +2549,21 @@ const Ye = class Ye extends OM {
2548
2549
  break;
2549
2550
  case R.RemoveNode:
2550
2551
  if (d && (l != null && l.length)) {
2551
- const N = l.map((C) => this.isLocalId(C + "") ? this.transformKey(C) : C);
2552
+ const j = l.map((C) => this.isLocalId(C + "") ? this.transformKey(C) : C);
2552
2553
  this.storage[I] && this.storage[I][d] && (Object.keys(this.storage[I][d]).map((C) => {
2553
- N != null && N.includes(C) && (this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.delRenderPageElementId({
2554
+ j != null && j.includes(C) && (this.control.renderControl.isUsePageAuth(I) && this.control.renderControl.delRenderPageElementId({
2554
2555
  viewId: I,
2555
2556
  scenePath: d,
2556
2557
  elementId: C
2557
2558
  }), this.updateValue(C, void 0, { isSync: p, viewId: I, scenePath: d }));
2558
- }), this.control.isUseSimple || st(
2559
+ }), (m = this.control.pluginManager) == null || m.dispatchPluginEvent(
2560
+ "syncStorage",
2561
+ I,
2562
+ d
2563
+ ), this.control.isUseSimple || st(
2559
2564
  () => {
2560
- var C, x;
2561
- (C = this.control.pluginManager) == null || C.dispatchPluginEvent(
2562
- "syncStorage",
2563
- I,
2564
- d
2565
- ), (x = this.control.miniMapManager) == null || x.updateMiniMapCamera(I);
2565
+ var C;
2566
+ (C = this.control.miniMapManager) == null || C.updateMiniMapCamera(I);
2566
2567
  },
2567
2568
  this.syncInterval,
2568
2569
  this.control.hasPolyfillMethod("requestIdleCallback")
@@ -2571,15 +2572,15 @@ const Ye = class Ye extends OM {
2571
2572
  break;
2572
2573
  case R.UpdateNode:
2573
2574
  if (d && n && (h || r || a)) {
2574
- const N = this.isLocalId(n.toString()) ? this.transformKey(n) : n, C = this.storage[I] && this.storage[I][d] && this.storage[I][d][N] || void 0;
2575
- C && (C.updateNodeOpt = h, (r || u) && (C.ops = r, C.op = u), a && (C.opt = a), C.type = R.FullWork, this.updateValue(N.toString(), C, {
2575
+ const j = this.isLocalId(n.toString()) ? this.transformKey(n) : n, C = this.storage[I] && this.storage[I][d] && this.storage[I][d][j] || void 0;
2576
+ C && (C.updateNodeOpt = h, (r || u) && (C.ops = r, C.op = u), a && (C.opt = a), C.type = R.FullWork, this.updateValue(j.toString(), C, {
2576
2577
  isSync: p,
2577
2578
  viewId: I,
2578
2579
  scenePath: d
2579
2580
  }), this.control.isUseSimple || st(
2580
2581
  () => {
2581
- var x;
2582
- (x = this.control.miniMapManager) == null || x.updateMiniMapCamera(I);
2582
+ var k;
2583
+ (k = this.control.miniMapManager) == null || k.updateMiniMapCamera(I);
2583
2584
  },
2584
2585
  this.syncInterval,
2585
2586
  this.control.hasPolyfillMethod("requestIdleCallback")
@@ -2589,20 +2590,20 @@ const Ye = class Ye extends OM {
2589
2590
  case R.Select:
2590
2591
  if (!d)
2591
2592
  return;
2592
- let M;
2593
- g != null && g.length && (M = g.map((N) => this.isLocalId(N + "") ? this.transformKey(N) : N));
2594
- const f = this.transformKey(Z), T = this.storage[I] && this.storage[I][d] && this.storage[I][d][f] || void 0, S = a || (T == null ? void 0 : T.opt);
2595
- M && this.checkOtherSelector(f, M, {
2593
+ let f;
2594
+ g != null && g.length && (f = g.map((j) => this.isLocalId(j + "") ? this.transformKey(j) : j));
2595
+ const N = this.transformKey(Z), S = this.storage[I] && this.storage[I][d] && this.storage[I][d][N] || void 0, v = a || (S == null ? void 0 : S.opt);
2596
+ f && this.checkOtherSelector(N, f, {
2596
2597
  isSync: p,
2597
2598
  viewId: I,
2598
2599
  scenePath: d
2599
2600
  }), this.updateValue(
2600
- f,
2601
- M && {
2601
+ N,
2602
+ f && {
2602
2603
  type: R.Select,
2603
- toolsType: v.Selector,
2604
- opt: S,
2605
- selectIds: M
2604
+ toolsType: T.Selector,
2605
+ opt: v,
2606
+ selectIds: f
2606
2607
  },
2607
2608
  { isSync: p, viewId: I, scenePath: d }
2608
2609
  );
@@ -2836,7 +2837,7 @@ const Ye = class Ye extends OM {
2836
2837
  return s;
2837
2838
  }
2838
2839
  dispatchPageAuth(e, t = !0) {
2839
- var l, h, u, g, p, d, I, m, M, f, T, S, N, C, x, k, E, L, P, z, O, D, F, _, W, J, ne, le, oe, X, $, Me, Je, Xe, dt, it, Ke, qe;
2840
+ var l, h, u, g, p, d, I, m, M, f, N, S, v, j, C, k, L, E, P, z, O, D, F, _, W, J, ne, le, oe, X, $, Me, Je, Xe, dt, it, Ke, qe;
2840
2841
  const { operation: n, viewId: r, scenePath: s, pageId: a, pageData: c } = e;
2841
2842
  switch (n) {
2842
2843
  case ke.addPage: {
@@ -2877,7 +2878,7 @@ const Ye = class Ye extends OM {
2877
2878
  case ke.deletePage: {
2878
2879
  if (!r || !s || !a)
2879
2880
  return;
2880
- (T = (f = (M = (m = (I = this.authStorage) == null ? void 0 : I.pageAuth) == null ? void 0 : m[r]) == null ? void 0 : M[s]) == null ? void 0 : f.pages) != null && T[a] && (delete this.authStorage.pageAuth[r][s].pages[a], t && ((S = this.plugin) == null || S.updateAttributes(
2881
+ (N = (f = (M = (m = (I = this.authStorage) == null ? void 0 : I.pageAuth) == null ? void 0 : m[r]) == null ? void 0 : M[s]) == null ? void 0 : f.pages) != null && N[a] && (delete this.authStorage.pageAuth[r][s].pages[a], t && ((S = this.plugin) == null || S.updateAttributes(
2881
2882
  [this.authSpace, "pageAuth", r, s, "pages", a],
2882
2883
  void 0
2883
2884
  )));
@@ -2886,7 +2887,7 @@ const Ye = class Ye extends OM {
2886
2887
  case ke.clearPage: {
2887
2888
  if (!r || !s || !a)
2888
2889
  return;
2889
- (E = (k = (x = (C = (N = this.authStorage) == null ? void 0 : N.pageAuth) == null ? void 0 : C[r]) == null ? void 0 : x[s]) == null ? void 0 : k.pages) != null && E[a] && (delete this.authStorage.pageAuth[r][s].pages[a], t && ((L = this.plugin) == null || L.updateAttributes(
2890
+ (L = (k = (C = (j = (v = this.authStorage) == null ? void 0 : v.pageAuth) == null ? void 0 : j[r]) == null ? void 0 : C[s]) == null ? void 0 : k.pages) != null && L[a] && (delete this.authStorage.pageAuth[r][s].pages[a], t && ((E = this.plugin) == null || E.updateAttributes(
2890
2891
  [this.authSpace, "pageAuth", r, s, "pages", a],
2891
2892
  {}
2892
2893
  )));
@@ -2947,7 +2948,7 @@ const Ye = class Ye extends OM {
2947
2948
  }
2948
2949
  }
2949
2950
  dispatchRenderAuth(e, t = !0) {
2950
- var l, h, u, g, p, d, I, m, M, f, T, S, N, C, x, k, E, L, P, z;
2951
+ var l, h, u, g, p, d, I, m, M, f, N, S, v, j, C, k, L, E, P, z;
2951
2952
  const { operation: n, viewId: r, uid: s, renderData: a, isClear: c } = e;
2952
2953
  if (r)
2953
2954
  switch (n) {
@@ -3018,13 +3019,13 @@ const Ye = class Ye extends OM {
3018
3019
  const O = [this.authSpace];
3019
3020
  Object.keys(this.authStorage).length && O.push("renderAuth");
3020
3021
  const D = this.authStorage.renderAuth || {};
3021
- Object.keys(D).length && O.push(r), D[r] = D[r] || {}, this.authStorage.renderAuth = D, Object.keys(D[r]).length && O.push("hide"), D[r].hide = D[r].hide || {}, D[r].hide !== !0 && (Object.keys(D[r].hide).length && O.push(s), D[r].hide[s] = !0), D[r].render !== !0 && ((T = D[r].render) != null && T[s]) && (delete D[r].render[s], t && ((S = this.plugin) == null || S.updateAttributes(
3022
+ Object.keys(D).length && O.push(r), D[r] = D[r] || {}, this.authStorage.renderAuth = D, Object.keys(D[r]).length && O.push("hide"), D[r].hide = D[r].hide || {}, D[r].hide !== !0 && (Object.keys(D[r].hide).length && O.push(s), D[r].hide[s] = !0), D[r].render !== !0 && ((N = D[r].render) != null && N[s]) && (delete D[r].render[s], t && ((S = this.plugin) == null || S.updateAttributes(
3022
3023
  [this.authSpace, "renderAuth", r, "render", s],
3023
3024
  void 0
3024
- ))), t && (O.length === 1 ? (N = this.plugin) == null || N.updateAttributes(
3025
+ ))), t && (O.length === 1 ? (v = this.plugin) == null || v.updateAttributes(
3025
3026
  O,
3026
3027
  ae(this.authStorage)
3027
- ) : O.length === 2 ? (C = this.plugin) == null || C.updateAttributes(O, ae(D)) : O.length === 3 ? (x = this.plugin) == null || x.updateAttributes(
3028
+ ) : O.length === 2 ? (j = this.plugin) == null || j.updateAttributes(O, ae(D)) : O.length === 3 ? (C = this.plugin) == null || C.updateAttributes(
3028
3029
  O,
3029
3030
  ae(D[r])
3030
3031
  ) : (k = this.plugin) == null || k.updateAttributes(O, !0));
@@ -3036,10 +3037,10 @@ const Ye = class Ye extends OM {
3036
3037
  const O = [this.authSpace];
3037
3038
  Object.keys(this.authStorage).length && O.push("renderAuth");
3038
3039
  const D = this.authStorage.renderAuth || {};
3039
- Object.keys(D).length && O.push(r), D[r] = D[r] || {}, this.authStorage.renderAuth = D, Object.keys(D[r]).length && O.push("clear"), D[r].clear = D[r].clear || {}, D[r].clear !== !0 && (Object.keys(D[r].clear).length && O.push(s), c ? D[r].clear[s] = !0 : delete D[r].clear[s]), t && (O.length === 1 ? (E = this.plugin) == null || E.updateAttributes(
3040
+ Object.keys(D).length && O.push(r), D[r] = D[r] || {}, this.authStorage.renderAuth = D, Object.keys(D[r]).length && O.push("clear"), D[r].clear = D[r].clear || {}, D[r].clear !== !0 && (Object.keys(D[r].clear).length && O.push(s), c ? D[r].clear[s] = !0 : delete D[r].clear[s]), t && (O.length === 1 ? (L = this.plugin) == null || L.updateAttributes(
3040
3041
  O,
3041
3042
  ae(this.authStorage)
3042
- ) : O.length === 2 ? (L = this.plugin) == null || L.updateAttributes(O, ae(D)) : O.length === 3 ? (P = this.plugin) == null || P.updateAttributes(
3043
+ ) : O.length === 2 ? (E = this.plugin) == null || E.updateAttributes(O, ae(D)) : O.length === 3 ? (P = this.plugin) == null || P.updateAttributes(
3043
3044
  O,
3044
3045
  ae(D[r])
3045
3046
  ) : (z = this.plugin) == null || z.updateAttributes(O, c ? !0 : void 0));
@@ -3234,7 +3235,7 @@ class RM {
3234
3235
  const i = this.control.viewContainerManager.focuedViewId;
3235
3236
  for (const [t, n] of this.animationDrawWorkers.entries()) {
3236
3237
  const { viewId: r, uid: s } = this.getUidAndviewId(t);
3237
- s !== ((e = this.control.collector) == null ? void 0 : e.uid) && r !== i && n.workState === j.Done && (n.consumPoint = [void 0, void 0]);
3238
+ s !== ((e = this.control.collector) == null ? void 0 : e.uid) && r !== i && n.workState === x.Done && (n.consumPoint = [void 0, void 0]);
3238
3239
  }
3239
3240
  }
3240
3241
  animationCursor() {
@@ -3260,7 +3261,7 @@ class RM {
3260
3261
  for (const [t, n] of this.cursorInfoMap.entries())
3261
3262
  if (n)
3262
3263
  for (const [r, s] of n.entries())
3263
- s.type === 1 && s.workState !== j.Done && e.add(r);
3264
+ s.type === 1 && s.workState !== x.Done && e.add(r);
3264
3265
  else
3265
3266
  this.cursorInfoMap.delete(t);
3266
3267
  for (const [t, n] of this.willConsumeEventWorkers.entries()) {
@@ -3353,7 +3354,7 @@ class RM {
3353
3354
  );
3354
3355
  l = [u, g];
3355
3356
  }
3356
- if (n === j.Start) {
3357
+ if (n === x.Start) {
3357
3358
  for (const u of this.cursorInfoMap.values())
3358
3359
  if (u != null && u.size)
3359
3360
  for (const g of u.keys())
@@ -3365,9 +3366,9 @@ class RM {
3365
3366
  viewId: r,
3366
3367
  timestamp: this.control.worker.now
3367
3368
  };
3368
- if (n === j.Start || n === j.Done) {
3369
+ if (n === x.Start || n === x.Done) {
3369
3370
  const u = this.willConsumeEventWorkers.get(t);
3370
- n === j.Start && u && this.willConsumeEventWorkers.delete(t), u && n === j.Done && (h.timestamp = h.timestamp - this.expirationTime);
3371
+ n === x.Start && u && this.willConsumeEventWorkers.delete(t), u && n === x.Done && (h.timestamp = h.timestamp - this.expirationTime);
3371
3372
  }
3372
3373
  this.animationDrawWorkers.set(c, h), this.runAnimation();
3373
3374
  }
@@ -3470,7 +3471,7 @@ class $e {
3470
3471
  var i;
3471
3472
  if (this.lastEmtData) {
3472
3473
  this.useEmtMsg = !0;
3473
- const e = { ...this.lastEmtData, workState: j.Done };
3474
+ const e = { ...this.lastEmtData, workState: x.Done };
3474
3475
  this.collect(e, !0), (i = ze.InternalMsgEmitter) == null || i.emit(
3475
3476
  U.ActiveMethod,
3476
3477
  !1
@@ -3525,7 +3526,7 @@ class UM extends $e {
3525
3526
  });
3526
3527
  break;
3527
3528
  }
3528
- if (p.toolsType === v.Text && p.opt && p.opt.workState && p.opt.workState !== j.Done) {
3529
+ if (p.toolsType === T.Text && p.opt && p.opt.workState && p.opt.workState !== x.Done) {
3529
3530
  const d = p && this.copyText({
3530
3531
  viewId: n,
3531
3532
  store: p
@@ -3576,15 +3577,15 @@ class UM extends $e {
3576
3577
  t[0] - n[0] + u,
3577
3578
  t[1] - n[1] + u
3578
3579
  ] || [u / g, u / g], I = (this.serviceColloctor.isLocalId(s) ? s : this.serviceColloctor.getLocalId(s.toString())) + "-" + l;
3579
- if (r.toolsType === v.Text && r.opt) {
3580
+ if (r.toolsType === T.Text && r.opt) {
3580
3581
  const f = r.opt;
3581
3582
  if (f && f.boxPoint && f.text) {
3582
- f.workState = j.Done;
3583
- const T = f.boxPoint;
3583
+ f.workState = x.Done;
3584
+ const N = f.boxPoint;
3584
3585
  f.boxPoint = [
3585
- Math.round(T[0] + p[0]),
3586
- Math.round(T[1] + p[1])
3587
- ], f.workState = j.Done;
3586
+ Math.round(N[0] + p[0]),
3587
+ Math.round(N[1] + p[1])
3588
+ ], f.workState = x.Done;
3588
3589
  const S = this.control.viewContainerManager.transformToOriginPoint(
3589
3590
  f.boxPoint,
3590
3591
  a
@@ -3613,7 +3614,7 @@ class UM extends $e {
3613
3614
  }
3614
3615
  }
3615
3616
  copySelector(e) {
3616
- var I, m, M, f, T, S, N, C, x;
3617
+ var I, m, M, f, N, S, v, j, C;
3617
3618
  const { viewId: t, store: n } = e, r = this.control.viewContainerManager.getView(t), s = n.selectIds;
3618
3619
  if (!this.serviceColloctor || !(s != null && s.length) || !r)
3619
3620
  return;
@@ -3627,7 +3628,7 @@ class UM extends $e {
3627
3628
  centerY: ((m = r.cameraOpt) == null ? void 0 : m.centerY) || 0,
3628
3629
  scale: ((M = r.cameraOpt) == null ? void 0 : M.scale) || 1
3629
3630
  }
3630
- }, l = this.control.hasOffscreenCanvas && ((f = r.displayer.canvasBgRef.current) == null ? void 0 : f.getBoundingClientRect()) || ((T = r.displayer.canvasContainerRef.current) == null ? void 0 : T.getBoundingClientRect()), h = (N = (S = r.displayer) == null ? void 0 : S.floatBarRef.current) == null ? void 0 : N.getBoundingClientRect(), u = l && [
3631
+ }, l = this.control.hasOffscreenCanvas && ((f = r.displayer.canvasBgRef.current) == null ? void 0 : f.getBoundingClientRect()) || ((N = r.displayer.canvasContainerRef.current) == null ? void 0 : N.getBoundingClientRect()), h = (v = (S = r.displayer) == null ? void 0 : S.floatBarRef.current) == null ? void 0 : v.getBoundingClientRect(), u = l && [
3631
3632
  l.x + l.width / 2,
3632
3633
  l.y + l.height / 2
3633
3634
  ], g = h && [
@@ -3645,11 +3646,11 @@ class UM extends $e {
3645
3646
  y: p.y - d.y
3646
3647
  });
3647
3648
  for (const k of s) {
3648
- const E = (x = (C = this.serviceColloctor) == null ? void 0 : C.getStorageData(
3649
+ const L = (C = (j = this.serviceColloctor) == null ? void 0 : j.getStorageData(
3649
3650
  r.id,
3650
3651
  r.focusScenePath
3651
- )) == null ? void 0 : x[k];
3652
- E && a.set(k, E);
3652
+ )) == null ? void 0 : C[k];
3653
+ L && a.set(k, L);
3653
3654
  }
3654
3655
  return {
3655
3656
  copyStores: a,
@@ -3657,7 +3658,7 @@ class UM extends $e {
3657
3658
  };
3658
3659
  }
3659
3660
  pasteSelector(e) {
3660
- var m, M, f, T;
3661
+ var m, M, f, N;
3661
3662
  const { copyStores: t, copyCoordInfo: n, viewId: r, scenePath: s, undoTickerId: a } = e, c = this.control.viewContainerManager.getView(r);
3662
3663
  if (!t.size || !this.serviceColloctor || !c)
3663
3664
  return;
@@ -3665,26 +3666,26 @@ class UM extends $e {
3665
3666
  l.x + g,
3666
3667
  l.y + g
3667
3668
  ] || [g / u, g / u], d = [], I = [];
3668
- for (const [S, N] of t.entries()) {
3669
- const x = (this.serviceColloctor.isLocalId(S) ? S : this.serviceColloctor.getLocalId(S.toString())) + "-" + a, k = { useAnimation: !1 };
3670
- if (N.toolsType === v.Text && N.opt) {
3671
- const E = N.opt;
3672
- if (E && E.boxPoint && E.text) {
3673
- E.workState = j.Done;
3674
- const L = E.boxPoint;
3675
- E.boxPoint = [
3676
- Math.round(L[0] + p[0]),
3677
- Math.round(L[1] + p[1])
3678
- ], E.workState = j.Done;
3669
+ for (const [S, v] of t.entries()) {
3670
+ const C = (this.serviceColloctor.isLocalId(S) ? S : this.serviceColloctor.getLocalId(S.toString())) + "-" + a, k = { useAnimation: !1 };
3671
+ if (v.toolsType === T.Text && v.opt) {
3672
+ const L = v.opt;
3673
+ if (L && L.boxPoint && L.text) {
3674
+ L.workState = x.Done;
3675
+ const E = L.boxPoint;
3676
+ L.boxPoint = [
3677
+ Math.round(E[0] + p[0]),
3678
+ Math.round(E[1] + p[1])
3679
+ ], L.workState = x.Done;
3679
3680
  const P = this.control.viewContainerManager.transformToOriginPoint(
3680
- E.boxPoint,
3681
+ L.boxPoint,
3681
3682
  r
3682
3683
  );
3683
3684
  this.control.textEditorManager.createTextForMasterController({
3684
- workId: x,
3685
+ workId: C,
3685
3686
  x: P[0],
3686
3687
  y: P[1],
3687
- opt: E,
3688
+ opt: L,
3688
3689
  scale: ((m = c.cameraOpt) == null ? void 0 : m.scale) || 1,
3689
3690
  type: He.Text,
3690
3691
  isActive: !1,
@@ -3693,44 +3694,44 @@ class UM extends $e {
3693
3694
  });
3694
3695
  }
3695
3696
  I.push({
3696
- ...N,
3697
- opt: E,
3697
+ ...v,
3698
+ opt: L,
3698
3699
  type: R.FullWork,
3699
- workId: x,
3700
+ workId: C,
3700
3701
  viewId: r,
3701
3702
  scenePath: s
3702
3703
  });
3703
3704
  continue;
3704
3705
  }
3705
- if (N.toolsType === v.Image && (N.opt.uuid = x, N.opt.centerX = N.opt.centerX + p[0], N.opt.centerY = N.opt.centerY + p[1]), N.ops) {
3706
- const E = Zi(N.ops).map(
3706
+ if (v.toolsType === T.Image && (v.opt.uuid = C, v.opt.centerX = v.opt.centerX + p[0], v.opt.centerY = v.opt.centerY + p[1]), v.ops) {
3707
+ const L = Zi(v.ops).map(
3707
3708
  (P, z) => {
3708
3709
  const O = z % 3;
3709
3710
  return O === 0 ? P + p[0] : O === 1 ? P + p[1] : P;
3710
3711
  }
3711
- ), L = qt(E);
3712
- N.ops = L;
3713
- }
3714
- if ((M = N == null ? void 0 : N.opt) != null && M.eraserlines && (f = N == null ? void 0 : N.opt) != null && f.eraserlines.length)
3715
- for (const E of (T = N == null ? void 0 : N.opt) == null ? void 0 : T.eraserlines) {
3716
- const { op: L } = E;
3717
- for (let P = 0; P < L.length; P++) {
3718
- const z = L[P].map((O, D) => D % 2 ? O + p[1] : O + p[0]);
3719
- E.op[P] = z;
3712
+ ), E = qt(L);
3713
+ v.ops = E;
3714
+ }
3715
+ if ((M = v == null ? void 0 : v.opt) != null && M.eraserlines && (f = v == null ? void 0 : v.opt) != null && f.eraserlines.length)
3716
+ for (const L of (N = v == null ? void 0 : v.opt) == null ? void 0 : N.eraserlines) {
3717
+ const { op: E } = L;
3718
+ for (let P = 0; P < E.length; P++) {
3719
+ const z = E[P].map((O, D) => D % 2 ? O + p[1] : O + p[0]);
3720
+ L.op[P] = z;
3720
3721
  }
3721
3722
  }
3722
3723
  I.push({
3723
- ...N,
3724
+ ...v,
3724
3725
  updateNodeOpt: k,
3725
3726
  type: R.FullWork,
3726
- workId: x,
3727
+ workId: C,
3727
3728
  viewId: r,
3728
3729
  scenePath: s
3729
3730
  }), d.push([
3730
3731
  {
3731
- ...N,
3732
+ ...v,
3732
3733
  updateNodeOpt: k,
3733
- workId: x,
3734
+ workId: C,
3734
3735
  msgType: R.FullWork,
3735
3736
  dataType: q.Local,
3736
3737
  emitEventType: U.CopyNode,
@@ -3740,7 +3741,7 @@ class UM extends $e {
3740
3741
  needUndoTicker: this.control.viewContainerManager.getUndoTickerId(r)
3741
3742
  },
3742
3743
  {
3743
- workId: x,
3744
+ workId: C,
3744
3745
  msgType: R.FullWork,
3745
3746
  emitEventType: U.CopyNode
3746
3747
  }
@@ -3767,7 +3768,7 @@ class WM extends $e {
3767
3768
  }));
3768
3769
  }
3769
3770
  collect(e) {
3770
- var f, T;
3771
+ var f, N;
3771
3772
  if (!this.serviceColloctor || !this.mainEngine)
3772
3773
  return;
3773
3774
  const {
@@ -3784,7 +3785,7 @@ class WM extends $e {
3784
3785
  if (!(g != null && g.displayer))
3785
3786
  return;
3786
3787
  const p = g.focusScenePath, d = [...t], I = this.serviceColloctor.storage, m = [], M = {};
3787
- for ((l === j.Start || !this.undoTickerId && l === j.Done) && (this.undoTickerId = this.mainEngine.now, this.mainEngine.internalMsgEmitter.emit(
3788
+ for ((l === x.Start || !this.undoTickerId && l === x.Done) && (this.undoTickerId = this.mainEngine.now, this.mainEngine.internalMsgEmitter.emit(
3788
3789
  "addUndoTicker",
3789
3790
  this.undoTickerId,
3790
3791
  c
@@ -3792,60 +3793,60 @@ class WM extends $e {
3792
3793
  const S = d.pop();
3793
3794
  if (!S)
3794
3795
  continue;
3795
- const N = S.toString(), C = this.serviceColloctor.isLocalId(N), x = C ? this.serviceColloctor.transformKey(S) : N;
3796
- let k = N;
3797
- !C && this.serviceColloctor.isOwn(k) && (k = this.serviceColloctor.getLocalId(k));
3798
- const E = (T = (f = I == null ? void 0 : I[c]) == null ? void 0 : f[p]) == null ? void 0 : T[x];
3799
- if (E) {
3800
- const L = E.updateNodeOpt || {};
3796
+ const v = S.toString(), j = this.serviceColloctor.isLocalId(v), C = j ? this.serviceColloctor.transformKey(S) : v;
3797
+ let k = v;
3798
+ !j && this.serviceColloctor.isOwn(k) && (k = this.serviceColloctor.getLocalId(k));
3799
+ const L = (N = (f = I == null ? void 0 : I[c]) == null ? void 0 : f[p]) == null ? void 0 : N[C];
3800
+ if (L) {
3801
+ const E = L.updateNodeOpt || {};
3801
3802
  if (s || a) {
3802
3803
  if (s) {
3803
- L.fontColor = s;
3804
+ E.fontColor = s;
3804
3805
  const [z, O, D, F] = Wt(s);
3805
3806
  M.textColor = [z, O, D], M.textOpacity = F;
3806
3807
  }
3807
3808
  if (a)
3808
- if (L.fontBgColor = Bt(a) ? "transparent" : a, Bt(a))
3809
+ if (E.fontBgColor = Bt(a) ? "transparent" : a, Bt(a))
3809
3810
  M.textBgColor = void 0, M.textBgOpacity = void 0;
3810
3811
  else {
3811
3812
  const [z, O, D, F] = Wt(a);
3812
3813
  M.textBgColor = [z, O, D], M.textBgOpacity = F;
3813
3814
  }
3814
- if (E.toolsType === v.Text && E.opt && l !== j.Start) {
3815
+ if (L.toolsType === T.Text && L.opt && l !== x.Start) {
3815
3816
  this.setTextColor(
3816
3817
  k,
3817
- ci(E),
3818
- L,
3818
+ ci(L),
3819
+ E,
3819
3820
  c
3820
- ), l === j.Done && (this.undoTickerId = void 0);
3821
+ ), l === x.Done && (this.undoTickerId = void 0);
3821
3822
  continue;
3822
3823
  }
3823
3824
  }
3824
3825
  if (n) {
3825
- L.strokeColor = n;
3826
+ E.strokeColor = n;
3826
3827
  const [z, O, D, F] = Wt(n);
3827
3828
  M.strokeColor = [z, O, D], M.strokeOpacity = F;
3828
3829
  }
3829
3830
  if (r)
3830
- if (L.fillColor = Bt(r) ? "transparent" : r, Bt(r))
3831
+ if (E.fillColor = Bt(r) ? "transparent" : r, Bt(r))
3831
3832
  M.fillColor = void 0, M.fillOpacity = void 0;
3832
3833
  else {
3833
3834
  const [z, O, D, F] = Wt(r);
3834
3835
  M.fillColor = [z, O, D], M.fillOpacity = F;
3835
3836
  }
3836
- h && (L.thickness = h, M.strokeWidth = h), u && (L.strokeType = u, M.strokeType = u);
3837
+ h && (E.thickness = h, M.strokeWidth = h), u && (E.strokeType = u, M.strokeType = u);
3837
3838
  const P = {
3838
3839
  workId: k,
3839
3840
  msgType: R.UpdateNode,
3840
3841
  dataType: q.Local,
3841
- updateNodeOpt: L,
3842
+ updateNodeOpt: E,
3842
3843
  emitEventType: this.emitEventType,
3843
3844
  willRefresh: !0,
3844
3845
  willRefreshSelector: !0,
3845
3846
  willSyncService: !0,
3846
3847
  textUpdateForWoker: !0,
3847
3848
  viewId: c,
3848
- needUndoTicker: l === j.Done && this.control.viewContainerManager.getUndoTickerId(c) || void 0
3849
+ needUndoTicker: l === x.Done && this.control.viewContainerManager.getUndoTickerId(c) || void 0
3849
3850
  };
3850
3851
  m.push([
3851
3852
  P,
@@ -3857,7 +3858,7 @@ class WM extends $e {
3857
3858
  ]);
3858
3859
  }
3859
3860
  }
3860
- m.length && (l === j.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(m)), Object.keys(M).length && setTimeout(() => {
3861
+ m.length && (l === x.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(m)), Object.keys(M).length && setTimeout(() => {
3861
3862
  var S;
3862
3863
  (S = this.control.room) == null || S.setMemberState(M);
3863
3864
  }, 0);
@@ -3926,17 +3927,17 @@ class BM extends $e {
3926
3927
  let M = d;
3927
3928
  !I && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
3928
3929
  const f = ci(l[r][a][m]);
3929
- let T;
3930
+ let N;
3930
3931
  if (f && M === Z) {
3931
3932
  if (f.selectIds) {
3932
- u.push(...f.selectIds), u.sort((x, k) => {
3933
+ u.push(...f.selectIds), u.sort((C, k) => {
3933
3934
  var P, z, O, D;
3934
- const E = ((z = (P = l[g(x, this.serviceColloctor)]) == null ? void 0 : P.opt) == null ? void 0 : z.zIndex) || 0, L = ((D = (O = l[g(x, this.serviceColloctor)]) == null ? void 0 : O.opt) == null ? void 0 : D.zIndex) || 0;
3935
- return E > L ? 1 : x < k ? -1 : 0;
3935
+ const L = ((z = (P = l[g(C, this.serviceColloctor)]) == null ? void 0 : P.opt) == null ? void 0 : z.zIndex) || 0, E = ((D = (O = l[g(C, this.serviceColloctor)]) == null ? void 0 : O.opt) == null ? void 0 : D.zIndex) || 0;
3936
+ return L > E ? 1 : C < k ? -1 : 0;
3936
3937
  });
3937
3938
  const S = f.updateNodeOpt || {};
3938
3939
  S.zIndexLayer = n;
3939
- const N = {
3940
+ const v = {
3940
3941
  workId: p,
3941
3942
  msgType: R.UpdateNode,
3942
3943
  dataType: q.Local,
@@ -3945,18 +3946,18 @@ class BM extends $e {
3945
3946
  willRefreshSelector: !0,
3946
3947
  willSyncService: !0,
3947
3948
  viewId: r
3948
- }, C = /* @__PURE__ */ new Map();
3949
- n === Gt.Top ? (this.addMaxLayer(r), T = this.getMaxZIndex(r)) : (this.addMinLayer(r), T = this.getMinZIndex(r)), u.forEach((x) => {
3949
+ }, j = /* @__PURE__ */ new Map();
3950
+ n === Gt.Top ? (this.addMaxLayer(r), N = this.getMaxZIndex(r)) : (this.addMinLayer(r), N = this.getMinZIndex(r)), u.forEach((C) => {
3950
3951
  var P, z, O, D, F;
3951
- const k = (P = this.serviceColloctor) == null ? void 0 : P.isLocalId(x);
3952
- let E = k && ((z = this.serviceColloctor) == null ? void 0 : z.transformKey(x)) || x;
3953
- const L = (D = (O = l == null ? void 0 : l[r]) == null ? void 0 : O[a]) == null ? void 0 : D[E];
3954
- L && (!k && ((F = this.serviceColloctor) != null && F.isOwn(E)) && (E = this.serviceColloctor.getLocalId(E)), S.zIndex = T, L != null && L.opt && (L.opt.zIndex = T), L != null && L.opt && C.set(E, {
3955
- updateNodeOpt: L.updateNodeOpt,
3956
- opt: L.opt
3952
+ const k = (P = this.serviceColloctor) == null ? void 0 : P.isLocalId(C);
3953
+ let L = k && ((z = this.serviceColloctor) == null ? void 0 : z.transformKey(C)) || C;
3954
+ const E = (D = (O = l == null ? void 0 : l[r]) == null ? void 0 : O[a]) == null ? void 0 : D[L];
3955
+ E && (!k && ((F = this.serviceColloctor) != null && F.isOwn(L)) && (L = this.serviceColloctor.getLocalId(L)), S.zIndex = N, E != null && E.opt && (E.opt.zIndex = N), E != null && E.opt && j.set(L, {
3956
+ updateNodeOpt: E.updateNodeOpt,
3957
+ opt: E.opt
3957
3958
  }));
3958
- }), N.selectStore = C, N.willSerializeData = !0, h.push([
3959
- N,
3959
+ }), v.selectStore = j, v.willSerializeData = !0, h.push([
3960
+ v,
3960
3961
  {
3961
3962
  workId: p,
3962
3963
  msgType: R.UpdateNode,
@@ -3989,7 +3990,7 @@ class FM extends $e {
3989
3990
  const c = this.control.viewContainerManager.getView(a);
3990
3991
  if (!(c != null && c.displayer))
3991
3992
  return;
3992
- const l = c.focusScenePath, h = [...n], u = (d = this.serviceColloctor) == null ? void 0 : d.storage, g = [], p = s === j.Start && this.mainEngine.now || void 0;
3993
+ const l = c.focusScenePath, h = [...n], u = (d = this.serviceColloctor) == null ? void 0 : d.storage, g = [], p = s === x.Start && this.mainEngine.now || void 0;
3993
3994
  for (p && this.mainEngine.internalMsgEmitter.emit(
3994
3995
  "addUndoTicker",
3995
3996
  p,
@@ -3997,23 +3998,23 @@ class FM extends $e {
3997
3998
  ); h.length; ) {
3998
3999
  const M = h.pop();
3999
4000
  if (!M) continue;
4000
- const f = M.toString(), T = this.serviceColloctor.isLocalId(f), S = T && this.serviceColloctor.transformKey(M) || f;
4001
- let N = f;
4002
- !T && this.serviceColloctor.isOwn(N) && (N = this.serviceColloctor.getLocalId(N));
4003
- const C = (m = (I = u == null ? void 0 : u[a]) == null ? void 0 : I[l]) == null ? void 0 : m[S];
4004
- if (C && N === Z) {
4005
- if (C.selectIds) {
4006
- const x = this.control.viewContainerManager.transformToScenePoint(
4001
+ const f = M.toString(), N = this.serviceColloctor.isLocalId(f), S = N && this.serviceColloctor.transformKey(M) || f;
4002
+ let v = f;
4003
+ !N && this.serviceColloctor.isOwn(v) && (v = this.serviceColloctor.getLocalId(v));
4004
+ const j = (m = (I = u == null ? void 0 : u[a]) == null ? void 0 : I[l]) == null ? void 0 : m[S];
4005
+ if (j && v === Z) {
4006
+ if (j.selectIds) {
4007
+ const C = this.control.viewContainerManager.transformToScenePoint(
4007
4008
  [r.x, r.y],
4008
4009
  a
4009
4010
  );
4010
- if (s === j.Start && (this.cachePosition = x), this.cachePosition) {
4011
- const k = C.updateNodeOpt || {};
4011
+ if (s === x.Start && (this.cachePosition = C), this.cachePosition) {
4012
+ const k = j.updateNodeOpt || {};
4012
4013
  k.translate = [
4013
- x[0] - this.cachePosition[0],
4014
- x[1] - this.cachePosition[1]
4015
- ], k.workState = s, this.control.cursor.isEnableCursor ? k.useAnimation = !1 : (k.uid = this.serviceColloctor.uid, s === j.Start ? k.useAnimation = !1 : s === j.Done && (k.useAnimation = !0));
4016
- const E = {
4014
+ C[0] - this.cachePosition[0],
4015
+ C[1] - this.cachePosition[1]
4016
+ ], k.workState = s, this.control.cursor.isEnableCursor ? k.useAnimation = !1 : (k.uid = this.serviceColloctor.uid, s === x.Start ? k.useAnimation = !1 : s === x.Done && (k.useAnimation = !0));
4017
+ const L = {
4017
4018
  workId: M,
4018
4019
  msgType: R.UpdateNode,
4019
4020
  dataType: q.Local,
@@ -4024,8 +4025,8 @@ class FM extends $e {
4024
4025
  viewId: a,
4025
4026
  smoothSync: this.mainEngine.smoothSync
4026
4027
  };
4027
- s === j.Done && (E.textUpdateForWoker = !0, E.willSerializeData = !0, this.cachePosition = void 0, E.needUndoTicker = this.control.viewContainerManager.getUndoTickerId(a)), g.push([
4028
- E,
4028
+ s === x.Done && (L.textUpdateForWoker = !0, L.willSerializeData = !0, this.cachePosition = void 0, L.needUndoTicker = this.control.viewContainerManager.getUndoTickerId(a)), g.push([
4029
+ L,
4029
4030
  {
4030
4031
  workId: M,
4031
4032
  msgType: R.UpdateNode,
@@ -4038,7 +4039,7 @@ class FM extends $e {
4038
4039
  continue;
4039
4040
  }
4040
4041
  }
4041
- s === j.Start ? this.mainEngine.unWritable() : s === j.Done && (this.mainEngine.abled(), this.lastEmtData = void 0), g.length && this.collectForLocalWorker(g, t);
4042
+ s === x.Start ? this.mainEngine.unWritable() : s === x.Done && (this.mainEngine.abled(), this.lastEmtData = void 0), g.length && this.collectForLocalWorker(g, t);
4042
4043
  }
4043
4044
  }
4044
4045
  class QM extends $e {
@@ -4061,12 +4062,12 @@ class QM extends $e {
4061
4062
  continue;
4062
4063
  const I = d.toString(), m = this.serviceColloctor.isLocalId(I), M = m ? this.serviceColloctor.transformKey(d) : I, f = (p = (g = a == null ? void 0 : a[n]) == null ? void 0 : g[s]) == null ? void 0 : p[M];
4063
4064
  if (f) {
4064
- let T = I;
4065
- if (!m && this.serviceColloctor.isOwn(T) && (T = this.serviceColloctor.getLocalId(T)), f.toolsType === v.Text) {
4066
- this.control.textEditorManager.delete(T, !0, !0);
4065
+ let N = I;
4066
+ if (!m && this.serviceColloctor.isOwn(N) && (N = this.serviceColloctor.getLocalId(N)), f.toolsType === T.Text) {
4067
+ this.control.textEditorManager.delete(N, !0, !0);
4067
4068
  continue;
4068
4069
  }
4069
- h.push(T);
4070
+ h.push(N);
4070
4071
  }
4071
4072
  }
4072
4073
  h.length && (this.mainEngine.internalMsgEmitter.emit(
@@ -4107,7 +4108,7 @@ class VM extends $e {
4107
4108
  return { key: e, textInfo: r };
4108
4109
  }
4109
4110
  async collect(e, t) {
4110
- var f, T, S, N, C, x, k;
4111
+ var f, N, S, v, j, C, k;
4111
4112
  if (!this.serviceColloctor || !this.mainEngine)
4112
4113
  return;
4113
4114
  const {
@@ -4124,32 +4125,32 @@ class VM extends $e {
4124
4125
  const g = this.control.viewContainerManager.getView(s);
4125
4126
  if (!(g != null && g.displayer))
4126
4127
  return;
4127
- const p = g.focusScenePath, d = [...n], I = (f = this.serviceColloctor) == null ? void 0 : f.storage, m = [], M = r === j.Start && this.mainEngine.now || void 0;
4128
+ const p = g.focusScenePath, d = [...n], I = (f = this.serviceColloctor) == null ? void 0 : f.storage, m = [], M = r === x.Start && this.mainEngine.now || void 0;
4128
4129
  for (M && this.mainEngine.internalMsgEmitter.emit(
4129
4130
  "addUndoTicker",
4130
4131
  M,
4131
4132
  s
4132
4133
  ); d.length; ) {
4133
- const E = d.pop();
4134
- if (!E)
4134
+ const L = d.pop();
4135
+ if (!L)
4135
4136
  continue;
4136
- const L = E.toString(), P = this.serviceColloctor.isLocalId(L), z = P && this.serviceColloctor.transformKey(E) || L;
4137
- let O = L;
4137
+ const E = L.toString(), P = this.serviceColloctor.isLocalId(E), z = P && this.serviceColloctor.transformKey(L) || E;
4138
+ let O = E;
4138
4139
  !P && this.serviceColloctor.isOwn(O) && (O = this.serviceColloctor.getLocalId(O));
4139
- const D = (S = (T = I == null ? void 0 : I[s]) == null ? void 0 : T[p]) == null ? void 0 : S[z];
4140
+ const D = (S = (N = I == null ? void 0 : I[s]) == null ? void 0 : N[p]) == null ? void 0 : S[z];
4140
4141
  if (D && O === Z && D.selectIds) {
4141
4142
  const F = D.updateNodeOpt || {};
4142
- if (F.dir = l, F.originPoint = a, F.scenePoint = c, F.workState = r, F.scale = h, F.translate = u, r === j.Start) {
4143
+ if (F.dir = l, F.originPoint = a, F.scenePoint = c, F.workState = r, F.scale = h, F.translate = u, r === x.Start) {
4143
4144
  this.cacheTextInfo.clear();
4144
4145
  for (const W of D.selectIds) {
4145
- const J = (N = this.serviceColloctor) == null ? void 0 : N.isLocalId(W), ne = J && ((C = this.serviceColloctor) == null ? void 0 : C.transformKey(W)) || W;
4146
+ const J = (v = this.serviceColloctor) == null ? void 0 : v.isLocalId(W), ne = J && ((j = this.serviceColloctor) == null ? void 0 : j.transformKey(W)) || W;
4146
4147
  let le = ne;
4147
- !J && ((x = this.serviceColloctor) != null && x.isOwn(ne)) && (le = this.serviceColloctor.getLocalId(ne));
4148
+ !J && ((C = this.serviceColloctor) != null && C.isOwn(ne)) && (le = this.serviceColloctor.getLocalId(ne));
4148
4149
  const oe = this.control.textEditorManager.get(le);
4149
- oe && r === j.Start && this.targetText.set(le, ci(oe));
4150
+ oe && r === x.Start && this.targetText.set(le, ci(oe));
4150
4151
  }
4151
4152
  }
4152
- if (this.targetText.size && r !== j.Start && h) {
4153
+ if (this.targetText.size && r !== x.Start && h) {
4153
4154
  const W = [];
4154
4155
  for (const [ne, le] of this.targetText.entries()) {
4155
4156
  const { opt: oe } = le, X = Math.floor(oe.fontSize * h[0]), $ = this.cacheTextInfo.get(ne), Me = !$ && oe.fontSize !== X || $ && $.fontSize !== X || !1, Je = (k = this.control.textEditorManager.get(ne)) == null ? void 0 : k.opt;
@@ -4174,9 +4175,9 @@ class VM extends $e {
4174
4175
  }
4175
4176
  F.textInfos = this.cacheTextInfo;
4176
4177
  }
4177
- this.control.cursor.isEnableCursor ? F.useAnimation = !1 : (F.uid = this.serviceColloctor.uid, r === j.Start ? F.useAnimation = !1 : r === j.Done && (F.useAnimation = !0));
4178
+ this.control.cursor.isEnableCursor ? F.useAnimation = !1 : (F.uid = this.serviceColloctor.uid, r === x.Start ? F.useAnimation = !1 : r === x.Done && (F.useAnimation = !0));
4178
4179
  const _ = {
4179
- workId: E,
4180
+ workId: L,
4180
4181
  msgType: R.UpdateNode,
4181
4182
  dataType: q.Local,
4182
4183
  updateNodeOpt: F,
@@ -4186,10 +4187,10 @@ class VM extends $e {
4186
4187
  viewId: s,
4187
4188
  smoothSync: this.mainEngine.smoothSync
4188
4189
  };
4189
- r === j.Done && (_.willSerializeData = !0, this.targetText.clear(), _.needUndoTicker = this.control.viewContainerManager.getUndoTickerId(s)), m.push([
4190
+ r === x.Done && (_.willSerializeData = !0, this.targetText.clear(), _.needUndoTicker = this.control.viewContainerManager.getUndoTickerId(s)), m.push([
4190
4191
  _,
4191
4192
  {
4192
- workId: E,
4193
+ workId: L,
4193
4194
  msgType: R.UpdateNode,
4194
4195
  emitEventType: this.emitEventType,
4195
4196
  workState: r
@@ -4198,7 +4199,7 @@ class VM extends $e {
4198
4199
  continue;
4199
4200
  }
4200
4201
  }
4201
- r === j.Start ? this.mainEngine.unWritable() : r === j.Done && (this.mainEngine.abled(), this.lastEmtData = void 0), m.length && this.collectForLocalWorker(m, t);
4202
+ r === x.Start ? this.mainEngine.unWritable() : r === x.Done && (this.mainEngine.abled(), this.lastEmtData = void 0), m.length && this.collectForLocalWorker(m, t);
4202
4203
  }
4203
4204
  }
4204
4205
  class ZM extends $e {
@@ -4209,7 +4210,7 @@ class ZM extends $e {
4209
4210
  y(this, "cacheOriginRotate", 0);
4210
4211
  }
4211
4212
  collect(e, t) {
4212
- var d, I, m, M, f, T, S;
4213
+ var d, I, m, M, f, N, S;
4213
4214
  if (!this.serviceColloctor || !this.mainEngine)
4214
4215
  return;
4215
4216
  const { workIds: n, angle: r, workState: s, viewId: a } = e;
@@ -4217,30 +4218,30 @@ class ZM extends $e {
4217
4218
  const c = this.control.viewContainerManager.getView(a);
4218
4219
  if (!(c != null && c.displayer))
4219
4220
  return;
4220
- const l = c.focusScenePath, h = [...n], u = (d = this.serviceColloctor) == null ? void 0 : d.storage, g = [], p = s === j.Start && this.mainEngine.now || void 0;
4221
+ const l = c.focusScenePath, h = [...n], u = (d = this.serviceColloctor) == null ? void 0 : d.storage, g = [], p = s === x.Start && this.mainEngine.now || void 0;
4221
4222
  for (p && this.mainEngine.internalMsgEmitter.emit(
4222
4223
  "addUndoTicker",
4223
4224
  p,
4224
4225
  a
4225
4226
  ); h.length; ) {
4226
- const N = h.pop();
4227
- if (!N)
4227
+ const v = h.pop();
4228
+ if (!v)
4228
4229
  continue;
4229
- const C = N.toString(), x = this.serviceColloctor.isLocalId(C), k = x && this.serviceColloctor.transformKey(N) || C;
4230
- let E = C;
4231
- !x && this.serviceColloctor.isOwn(E) && (E = this.serviceColloctor.getLocalId(E));
4232
- const L = (m = (I = u == null ? void 0 : u[a]) == null ? void 0 : I[l]) == null ? void 0 : m[k];
4233
- if (L && E === Z) {
4234
- if (((M = L.selectIds) == null ? void 0 : M.length) === 1) {
4235
- const P = L.selectIds[0];
4236
- if (s === j.Start) {
4237
- const F = ((f = this.serviceColloctor) == null ? void 0 : f.isLocalId(P)) && ((T = this.serviceColloctor) == null ? void 0 : T.transformKey(P)) || P, _ = u[a][l][F];
4230
+ const j = v.toString(), C = this.serviceColloctor.isLocalId(j), k = C && this.serviceColloctor.transformKey(v) || j;
4231
+ let L = j;
4232
+ !C && this.serviceColloctor.isOwn(L) && (L = this.serviceColloctor.getLocalId(L));
4233
+ const E = (m = (I = u == null ? void 0 : u[a]) == null ? void 0 : I[l]) == null ? void 0 : m[k];
4234
+ if (E && L === Z) {
4235
+ if (((M = E.selectIds) == null ? void 0 : M.length) === 1) {
4236
+ const P = E.selectIds[0];
4237
+ if (s === x.Start) {
4238
+ const F = ((f = this.serviceColloctor) == null ? void 0 : f.isLocalId(P)) && ((N = this.serviceColloctor) == null ? void 0 : N.transformKey(P)) || P, _ = u[a][l][F];
4238
4239
  this.cacheOriginRotate = ((S = _ == null ? void 0 : _.opt) == null ? void 0 : S.rotate) || 0;
4239
4240
  }
4240
- const z = L.updateNodeOpt || {};
4241
- z.angle = (r + this.cacheOriginRotate) % 360, z.workState = s, this.control.cursor.isEnableCursor ? z.useAnimation = !1 : (z.uid = this.serviceColloctor.uid, s === j.Start ? z.useAnimation = !1 : s === j.Done && (z.useAnimation = !0));
4241
+ const z = E.updateNodeOpt || {};
4242
+ z.angle = (r + this.cacheOriginRotate) % 360, z.workState = s, this.control.cursor.isEnableCursor ? z.useAnimation = !1 : (z.uid = this.serviceColloctor.uid, s === x.Start ? z.useAnimation = !1 : s === x.Done && (z.useAnimation = !0));
4242
4243
  const O = {
4243
- workId: N,
4244
+ workId: v,
4244
4245
  msgType: R.UpdateNode,
4245
4246
  dataType: q.Local,
4246
4247
  updateNodeOpt: z,
@@ -4250,10 +4251,10 @@ class ZM extends $e {
4250
4251
  viewId: a,
4251
4252
  smoothSync: this.mainEngine.smoothSync
4252
4253
  };
4253
- s === j.Done && (O.willRefreshSelector = !0, O.willSerializeData = !0, this.cacheOriginRotate = 0, O.needUndoTicker = this.control.viewContainerManager.getUndoTickerId(a)), g.push([
4254
+ s === x.Done && (O.willRefreshSelector = !0, O.willSerializeData = !0, this.cacheOriginRotate = 0, O.needUndoTicker = this.control.viewContainerManager.getUndoTickerId(a)), g.push([
4254
4255
  O,
4255
4256
  {
4256
- workId: N,
4257
+ workId: v,
4257
4258
  msgType: R.UpdateNode,
4258
4259
  emitEventType: this.emitEventType,
4259
4260
  workState: s
@@ -4263,20 +4264,20 @@ class ZM extends $e {
4263
4264
  continue;
4264
4265
  }
4265
4266
  }
4266
- s === j.Start ? this.mainEngine.unWritable() : s === j.Done && (this.mainEngine.abled(), this.lastEmtData = void 0), g.length && this.collectForLocalWorker(g, t);
4267
+ s === x.Start ? this.mainEngine.unWritable() : s === x.Done && (this.mainEngine.abled(), this.lastEmtData = void 0), g.length && this.collectForLocalWorker(g, t);
4267
4268
  }
4268
4269
  }
4269
4270
  function $M(o) {
4270
4271
  switch (o) {
4271
- case v.Text:
4272
+ case T.Text:
4272
4273
  return He.Text;
4273
- case v.SpeechBalloon:
4274
- case v.Star:
4275
- case v.Ellipse:
4276
- case v.Rectangle:
4277
- case v.Triangle:
4278
- case v.Rhombus:
4279
- case v.Polygon:
4274
+ case T.SpeechBalloon:
4275
+ case T.Star:
4276
+ case T.Ellipse:
4277
+ case T.Rectangle:
4278
+ case T.Triangle:
4279
+ case T.Rhombus:
4280
+ case T.Polygon:
4280
4281
  return He.Shape;
4281
4282
  }
4282
4283
  }
@@ -4305,7 +4306,7 @@ class HM extends $e {
4305
4306
  }
4306
4307
  }
4307
4308
  async collect(e) {
4308
- var f, T, S, N, C, x;
4309
+ var f, N, S, v, j, C;
4309
4310
  if (!this.serviceColloctor || !this.mainEngine)
4310
4311
  return;
4311
4312
  const { workIds: t, bold: n, italic: r, lineThrough: s, underline: a, viewId: c, fontSize: l } = e, h = this.control.viewContainerManager.getView(c);
@@ -4322,13 +4323,13 @@ class HM extends $e {
4322
4323
  const k = g.pop();
4323
4324
  if (!k)
4324
4325
  continue;
4325
- const E = k.toString(), L = this.serviceColloctor.isLocalId(E), P = L ? this.serviceColloctor.transformKey(k) : E;
4326
- let z = E;
4327
- !L && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
4328
- const O = (T = (f = p == null ? void 0 : p[c]) == null ? void 0 : f[u]) == null ? void 0 : T[P];
4326
+ const L = k.toString(), E = this.serviceColloctor.isLocalId(L), P = E ? this.serviceColloctor.transformKey(k) : L;
4327
+ let z = L;
4328
+ !E && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
4329
+ const O = (N = (f = p == null ? void 0 : p[c]) == null ? void 0 : f[u]) == null ? void 0 : N[P];
4329
4330
  if (O) {
4330
4331
  const D = O.updateNodeOpt || {};
4331
- if (n && (D.bold = n, d.bold = n === "bold"), r && (D.italic = r, d.italic = r === "italic"), Be(s) && (D.lineThrough = s, d.lineThrough = s), Be(a) && (D.underline = a, d.underline = a), l && (D.fontSize = l, d.textSize = l), O.toolsType === v.Text && O.opt) {
4332
+ if (n && (D.bold = n, d.bold = n === "bold"), r && (D.italic = r, d.italic = r === "italic"), Be(s) && (D.lineThrough = s, d.lineThrough = s), Be(a) && (D.underline = a, d.underline = a), l && (D.fontSize = l, d.textSize = l), O.toolsType === T.Text && O.opt) {
4332
4333
  const F = this.setTextStyle(
4333
4334
  z,
4334
4335
  ae(O),
@@ -4340,10 +4341,10 @@ class HM extends $e {
4340
4341
  }
4341
4342
  if (O && z === Z && ((S = O.selectIds) != null && S.length))
4342
4343
  for (const F of O.selectIds) {
4343
- const _ = (N = this.serviceColloctor) == null ? void 0 : N.isLocalId(F);
4344
- let W = _ && ((C = this.serviceColloctor) == null ? void 0 : C.transformKey(F)) || F;
4344
+ const _ = (v = this.serviceColloctor) == null ? void 0 : v.isLocalId(F);
4345
+ let W = _ && ((j = this.serviceColloctor) == null ? void 0 : j.transformKey(F)) || F;
4345
4346
  const J = p[c][u][W] || void 0;
4346
- if (!_ && ((x = this.serviceColloctor) != null && x.isOwn(W)) && (W = this.serviceColloctor.getLocalId(W)), J && J.toolsType === v.Text && O.opt) {
4347
+ if (!_ && ((C = this.serviceColloctor) != null && C.isOwn(W)) && (W = this.serviceColloctor.getLocalId(W)), J && J.toolsType === T.Text && O.opt) {
4347
4348
  const ne = this.setTextStyle(
4348
4349
  W,
4349
4350
  ae(J),
@@ -4359,8 +4360,8 @@ class HM extends $e {
4359
4360
  const M = await Promise.all(m);
4360
4361
  for (const k of M)
4361
4362
  if (k) {
4362
- const { key: E, textInfo: L } = k;
4363
- L && (L.canSync = !0, L.canWorker = !0, this.control.textEditorManager.updateForViewEdited(E, L));
4363
+ const { key: L, textInfo: E } = k;
4364
+ E && (E.canSync = !0, E.canWorker = !0, this.control.textEditorManager.updateForViewEdited(L, E));
4364
4365
  }
4365
4366
  Object.keys(d).length && (this.timerId && (clearTimeout(this.timerId), this.timerId = void 0), this.timerId = setTimeout(() => {
4366
4367
  var k;
@@ -4376,13 +4377,13 @@ class GM extends $e {
4376
4377
  y(this, "undoTickerId");
4377
4378
  }
4378
4379
  collect(e) {
4379
- var f, T, S;
4380
+ var f, N, S;
4380
4381
  if (!this.serviceColloctor || !this.mainEngine)
4381
4382
  return;
4382
4383
  const { workId: t, pointMap: n, workState: r, viewId: s } = e, a = this.control.viewContainerManager.getView(s);
4383
4384
  if (!(a != null && a.displayer))
4384
4385
  return;
4385
- const c = a.focusScenePath, l = (f = this.serviceColloctor) == null ? void 0 : f.storage, h = [], u = r === j.Start && this.mainEngine.now || void 0;
4386
+ const c = a.focusScenePath, l = (f = this.serviceColloctor) == null ? void 0 : f.storage, h = [], u = r === x.Start && this.mainEngine.now || void 0;
4386
4387
  u && (this.undoTickerId = u, this.mainEngine.internalMsgEmitter.emit(
4387
4388
  "addUndoTicker",
4388
4389
  u,
@@ -4394,23 +4395,23 @@ class GM extends $e {
4394
4395
  const p = g.toString(), d = this.serviceColloctor.isLocalId(p), I = d && this.serviceColloctor.transformKey(g) || p;
4395
4396
  let m = p;
4396
4397
  !d && this.serviceColloctor.isOwn(m) && (m = this.serviceColloctor.getLocalId(m));
4397
- const M = (S = (T = l == null ? void 0 : l[s]) == null ? void 0 : T[c]) == null ? void 0 : S[I];
4398
+ const M = (S = (N = l == null ? void 0 : l[s]) == null ? void 0 : N[c]) == null ? void 0 : S[I];
4398
4399
  if (M && m === Z && M.selectIds) {
4399
- const N = M.updateNodeOpt || {};
4400
- N.pointMap = n, N.workState = r;
4401
- const C = {
4400
+ const v = M.updateNodeOpt || {};
4401
+ v.pointMap = n, v.workState = r;
4402
+ const j = {
4402
4403
  workId: g,
4403
4404
  msgType: R.UpdateNode,
4404
4405
  dataType: q.Local,
4405
- updateNodeOpt: N,
4406
+ updateNodeOpt: v,
4406
4407
  emitEventType: this.emitEventType,
4407
4408
  willRefreshSelector: !0,
4408
4409
  willSyncService: !0,
4409
4410
  viewId: s,
4410
- needUndoTicker: r === j.Done && this.control.viewContainerManager.getUndoTickerId(s) || void 0
4411
+ needUndoTicker: r === x.Done && this.control.viewContainerManager.getUndoTickerId(s) || void 0
4411
4412
  };
4412
- r === j.Done && (C.undoTickerId = this.undoTickerId), h.push([
4413
- C,
4413
+ r === x.Done && (j.undoTickerId = this.undoTickerId), h.push([
4414
+ j,
4414
4415
  {
4415
4416
  workId: g,
4416
4417
  msgType: R.UpdateNode,
@@ -4418,7 +4419,7 @@ class GM extends $e {
4418
4419
  }
4419
4420
  ]);
4420
4421
  }
4421
- r === j.Start ? this.mainEngine.unWritable() : r === j.Done && this.mainEngine.abled(), h.length && this.collectForLocalWorker(h);
4422
+ r === x.Start ? this.mainEngine.unWritable() : r === x.Done && this.mainEngine.abled(), h.length && this.collectForLocalWorker(h);
4422
4423
  }
4423
4424
  }
4424
4425
  class JM extends $e {
@@ -4446,11 +4447,11 @@ class JM extends $e {
4446
4447
  const I = d.toString(), m = this.serviceColloctor.isLocalId(I), M = m ? this.serviceColloctor.transformKey(d) : I;
4447
4448
  let f = I;
4448
4449
  !m && this.serviceColloctor.isOwn(f) && (f = this.serviceColloctor.getLocalId(f));
4449
- const T = (p = (g = l == null ? void 0 : l[r]) == null ? void 0 : g[a]) == null ? void 0 : p[M];
4450
- if (T) {
4451
- const S = T.updateNodeOpt || {};
4450
+ const N = (p = (g = l == null ? void 0 : l[r]) == null ? void 0 : g[a]) == null ? void 0 : p[M];
4451
+ if (N) {
4452
+ const S = N.updateNodeOpt || {};
4452
4453
  S.isLocked = n;
4453
- const N = {
4454
+ const v = {
4454
4455
  workId: f,
4455
4456
  msgType: R.UpdateNode,
4456
4457
  dataType: q.Local,
@@ -4463,7 +4464,7 @@ class JM extends $e {
4463
4464
  needUndoTicker: this.control.viewContainerManager.getUndoTickerId(r)
4464
4465
  };
4465
4466
  h.push([
4466
- N,
4467
+ v,
4467
4468
  {
4468
4469
  workId: f,
4469
4470
  msgType: R.UpdateNode,
@@ -4500,15 +4501,15 @@ class XM extends $e {
4500
4501
  const I = d.toString(), m = this.serviceColloctor.isLocalId(I), M = m ? this.serviceColloctor.transformKey(d) : I;
4501
4502
  let f = I;
4502
4503
  !m && this.serviceColloctor.isOwn(f) && (f = this.serviceColloctor.getLocalId(f));
4503
- const T = (p = (g = l == null ? void 0 : l[n]) == null ? void 0 : g[a]) == null ? void 0 : p[M];
4504
- if (T) {
4504
+ const N = (p = (g = l == null ? void 0 : l[n]) == null ? void 0 : g[a]) == null ? void 0 : p[M];
4505
+ if (N) {
4505
4506
  const S = {
4506
- ...T.updateNodeOpt,
4507
+ ...N.updateNodeOpt,
4507
4508
  ...r,
4508
4509
  willRefresh: !0
4509
4510
  };
4510
- if (T && f === Z) {
4511
- const N = {
4511
+ if (N && f === Z) {
4512
+ const v = {
4512
4513
  workId: f,
4513
4514
  msgType: R.UpdateNode,
4514
4515
  dataType: q.Local,
@@ -4521,7 +4522,7 @@ class XM extends $e {
4521
4522
  needUndoTicker: this.control.viewContainerManager.getUndoTickerId(n)
4522
4523
  };
4523
4524
  h.push([
4524
- N,
4525
+ v,
4525
4526
  {
4526
4527
  workId: f,
4527
4528
  msgType: R.UpdateNode,
@@ -4824,7 +4825,7 @@ class _M extends qM {
4824
4825
  const { control: t, internalMsgEmitter: n, publicMsgEmitter: r } = e;
4825
4826
  this.control = t, this.maxLastSyncTime = this.control.pluginOptions.extras.syncOpt.interval, this.combineUnitTime = this.control.pluginOptions.extras.bezier.combineUnitTime || this.combineUnitTime, this.smoothSync = Be(
4826
4827
  this.control.pluginOptions.extras.syncOpt.smoothSync
4827
- ) ? this.control.pluginOptions.extras.syncOpt.smoothSync : this.smoothSync, this.maxCombineEraserTime = this.control.pluginOptions.extras.pencilEraser.maxCombineTime || this.maxCombineEraserTime, this.fullWorkerUrl = this.control.pluginOptions.cdn.fullWorkerUrl || "", this.subWorkerUrl = this.control.pluginOptions.cdn.subWorkerUrl || "", this.internalMsgEmitter = n, this.publicMsgEmitter = r, this.currentLocalWorkData = { workState: j.Pending };
4828
+ ) ? this.control.pluginOptions.extras.syncOpt.smoothSync : this.smoothSync, this.maxCombineEraserTime = this.control.pluginOptions.extras.pencilEraser.maxCombineTime || this.maxCombineEraserTime, this.fullWorkerUrl = this.control.pluginOptions.cdn.fullWorkerUrl || "", this.subWorkerUrl = this.control.pluginOptions.cdn.subWorkerUrl || "", this.internalMsgEmitter = n, this.publicMsgEmitter = r, this.currentLocalWorkData = { workState: x.Pending };
4828
4829
  }
4829
4830
  get isBezier() {
4830
4831
  return this.control.pluginOptions.extras.bezier.enable;
@@ -4854,42 +4855,42 @@ class _M extends qM {
4854
4855
  get isRunSubWork() {
4855
4856
  var t;
4856
4857
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4857
- return e === v.Pencil || e === v.PencilEraser || e === v.BitMapEraser || e === v.LaserPen || e === v.Arrow || e === v.Straight || e === v.Ellipse || e === v.Rectangle || e === v.Star || e === v.Polygon || e === v.SpeechBalloon || e === v.Selector;
4858
+ return e === T.Pencil || e === T.PencilEraser || e === T.BitMapEraser || e === T.LaserPen || e === T.Arrow || e === T.Straight || e === T.Ellipse || e === T.Rectangle || e === T.Star || e === T.Polygon || e === T.SpeechBalloon || e === T.Selector;
4858
4859
  }
4859
4860
  get isCanDrawWork() {
4860
4861
  var t;
4861
4862
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4862
- return e === v.Pencil || e === v.LaserPen || e === v.Arrow || e === v.Straight || e === v.Ellipse || e === v.Rectangle || e === v.Star || e === v.Polygon || e === v.SpeechBalloon || e === v.Triangle || e === v.Rhombus || e === v.BitMapEraser || e === v.PencilEraser;
4863
+ return e === T.Pencil || e === T.LaserPen || e === T.Arrow || e === T.Straight || e === T.Ellipse || e === T.Rectangle || e === T.Star || e === T.Polygon || e === T.SpeechBalloon || e === T.Triangle || e === T.Rhombus || e === T.BitMapEraser || e === T.PencilEraser;
4863
4864
  }
4864
4865
  get isUseZIndex() {
4865
4866
  var t;
4866
4867
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4867
- return e === v.Pencil || e === v.Arrow || e === v.Straight || e === v.Ellipse || e === v.Rectangle || e === v.Star || e === v.Polygon || e === v.SpeechBalloon || e === v.Text || e === v.Image;
4868
+ return e === T.Pencil || e === T.Arrow || e === T.Straight || e === T.Ellipse || e === T.Rectangle || e === T.Star || e === T.Polygon || e === T.SpeechBalloon || e === T.Text || e === T.Image;
4868
4869
  }
4869
4870
  get isCanRecordUndoRedo() {
4870
4871
  var t;
4871
4872
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4872
- return e === v.Pencil || e === v.Eraser || e === v.PencilEraser || e === v.BitMapEraser || e === v.Arrow || e === v.Straight || e === v.Ellipse || e === v.Rectangle || e === v.Star || e === v.Polygon || e === v.SpeechBalloon || e === v.Text || e === v.Image;
4873
+ return e === T.Pencil || e === T.Eraser || e === T.PencilEraser || e === T.BitMapEraser || e === T.Arrow || e === T.Straight || e === T.Ellipse || e === T.Rectangle || e === T.Star || e === T.Polygon || e === T.SpeechBalloon || e === T.Text || e === T.Image;
4873
4874
  }
4874
4875
  get isCanSentCursor() {
4875
4876
  var t;
4876
4877
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4877
- return e === v.Pencil || e === v.Text || e === v.LaserPen || e === v.Arrow || e === v.Straight || e === v.Ellipse || e === v.Rectangle || e === v.Star || e === v.Polygon || e === v.SpeechBalloon || e === v.Triangle || e === v.Rhombus || e === v.Eraser || e === v.PencilEraser || e === v.BitMapEraser || e === v.Selector;
4878
+ return e === T.Pencil || e === T.Text || e === T.LaserPen || e === T.Arrow || e === T.Straight || e === T.Ellipse || e === T.Rectangle || e === T.Star || e === T.Polygon || e === T.SpeechBalloon || e === T.Triangle || e === T.Rhombus || e === T.Eraser || e === T.PencilEraser || e === T.BitMapEraser || e === T.Selector;
4878
4879
  }
4879
4880
  get isPostCountType() {
4880
4881
  var t;
4881
4882
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4882
- return e === v.Pencil || e === v.Arrow || e === v.Straight || e === v.Ellipse || e === v.Rectangle || e === v.Star || e === v.Polygon || e === v.SpeechBalloon || e === v.Triangle || e === v.Rhombus || e === v.Eraser || e === v.PencilEraser || e === v.BitMapEraser || e === v.Selector;
4883
+ return e === T.Pencil || e === T.Arrow || e === T.Straight || e === T.Ellipse || e === T.Rectangle || e === T.Star || e === T.Polygon || e === T.SpeechBalloon || e === T.Triangle || e === T.Rhombus || e === T.Eraser || e === T.PencilEraser || e === T.BitMapEraser || e === T.Selector;
4883
4884
  }
4884
4885
  get isCanPostDraw() {
4885
4886
  var t;
4886
4887
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4887
- return e === v.Pencil || e === v.PencilEraser || e === v.BitMapEraser;
4888
+ return e === T.Pencil || e === T.PencilEraser || e === T.BitMapEraser;
4888
4889
  }
4889
4890
  get isCanStartEventConsum() {
4890
4891
  var t;
4891
4892
  const e = (t = this.currentToolsData) == null ? void 0 : t.toolsType;
4892
- return e === v.Selector || e === v.Eraser || e === v.PencilEraser || e === v.BitMapEraser;
4893
+ return e === T.Selector || e === T.Eraser || e === T.PencilEraser || e === T.BitMapEraser;
4893
4894
  }
4894
4895
  async init() {
4895
4896
  this.destroy(), await this.on(), this.internalMsgEmitterListener(), this.isActive = !0;
@@ -4900,7 +4901,7 @@ class _M extends qM {
4900
4901
  "set font faces in main thread success"
4901
4902
  );
4902
4903
  });
4903
- const { MainThreadManagerImpl: e } = await import("./index-CZDpWIAs.mjs");
4904
+ const { MainThreadManagerImpl: e } = await import("./index-DcI2VOUH.mjs");
4904
4905
  this.mainThread = new e(this);
4905
4906
  }
4906
4907
  async on() {
@@ -5070,7 +5071,7 @@ class _M extends qM {
5070
5071
  }
5071
5072
  }
5072
5073
  get isBusy() {
5073
- return this.getTasksqueueState() === j.Doing;
5074
+ return this.getTasksqueueState() === x.Doing;
5074
5075
  }
5075
5076
  getLockSentEventCursor() {
5076
5077
  return this.isLockSentEventCursor;
@@ -5079,7 +5080,7 @@ class _M extends qM {
5079
5080
  this.isLockSentEventCursor = e;
5080
5081
  }
5081
5082
  getTasksqueueState() {
5082
- return this.useTasksqueue && j.Doing || j.Done;
5083
+ return this.useTasksqueue && x.Doing || x.Done;
5083
5084
  }
5084
5085
  setMaxDrawCount(e) {
5085
5086
  this.maxDrawCount = e;
@@ -5121,14 +5122,14 @@ class _M extends qM {
5121
5122
  isSync: m,
5122
5123
  imageBitmap: M,
5123
5124
  canvasHeight: f,
5124
- canvasWidth: T,
5125
+ canvasWidth: N,
5125
5126
  rect: S,
5126
- op: N,
5127
- canTextEdit: C,
5128
- points: x,
5127
+ op: v,
5128
+ canTextEdit: j,
5129
+ points: C,
5129
5130
  selectorColor: k,
5130
- canRotate: E,
5131
- scaleType: L,
5131
+ canRotate: L,
5132
+ scaleType: E,
5132
5133
  textOpt: P,
5133
5134
  toolsType: z,
5134
5135
  workId: O,
@@ -5162,8 +5163,8 @@ class _M extends qM {
5162
5163
  const qe = c.scenePath || this.viewContainerManager.getCurScenePath(D);
5163
5164
  switch (l) {
5164
5165
  case R.Select: {
5165
- const V = h != null && h.length ? { ...g, selectIds: h, canvasHeight: f, canvasWidth: T, points: x } : void 0;
5166
- V && (u != null && u.strokeColor) && (V.selectorColor = u.strokeColor), V && k && (V.selectorColor = k), V && p && (V.strokeColor = p), V && (u != null && u.fillColor) && (V.fillColor = u.fillColor), V && d && (V.fillColor = d), V && Be(E) && (V.canRotate = E), V && L && (V.scaleType = L), V && C && (V.canTextEdit = C), V && P && (V.textOpt = P), V && Be(_) && (V.canLock = _), V && Be(W) && (V.isLocked = W), V && J && (V.shapeOpt = J), V && ne && (V.toolsTypes = ne), V && le && (V.thickness = le), V && oe && (V.strokeType = oe), V && Be(X) && (V.useStroke = X), D && this.viewContainerManager.showFloatBar(D, !!V, V), I && ((n = this.collector) == null || n.dispatch({
5166
+ const V = h != null && h.length ? { ...g, selectIds: h, canvasHeight: f, canvasWidth: N, points: C } : void 0;
5167
+ V && (u != null && u.strokeColor) && (V.selectorColor = u.strokeColor), V && k && (V.selectorColor = k), V && p && (V.strokeColor = p), V && (u != null && u.fillColor) && (V.fillColor = u.fillColor), V && d && (V.fillColor = d), V && Be(L) && (V.canRotate = L), V && E && (V.scaleType = E), V && j && (V.canTextEdit = j), V && P && (V.textOpt = P), V && Be(_) && (V.canLock = _), V && Be(W) && (V.isLocked = W), V && J && (V.shapeOpt = J), V && ne && (V.toolsTypes = ne), V && le && (V.thickness = le), V && oe && (V.strokeType = oe), V && Be(X) && (V.useStroke = X), D && this.viewContainerManager.showFloatBar(D, !!V, V), I && ((n = this.collector) == null || n.dispatch({
5167
5168
  type: l,
5168
5169
  selectIds: h,
5169
5170
  opt: u,
@@ -5186,7 +5187,7 @@ class _M extends qM {
5186
5187
  }
5187
5188
  break;
5188
5189
  case R.Cursor:
5189
- N && this.control.cursor.collectServiceCursor({ ...c });
5190
+ v && this.control.cursor.collectServiceCursor({ ...c });
5190
5191
  break;
5191
5192
  case R.Clear:
5192
5193
  if (D) {
@@ -5196,7 +5197,7 @@ class _M extends qM {
5196
5197
  }
5197
5198
  break;
5198
5199
  case R.TextUpdate:
5199
- if (z === v.Text && O && D) {
5200
+ if (z === T.Text && O && D) {
5200
5201
  const V = this.viewContainerManager.transformToOriginPoint(
5201
5202
  (u == null ? void 0 : u.boxPoint) || [0, 0],
5202
5203
  D
@@ -5222,7 +5223,7 @@ class _M extends qM {
5222
5223
  }
5223
5224
  break;
5224
5225
  case R.GetTextActive:
5225
- z === v.Text && O && D && this.control.textEditorManager.updateTextForWorker(
5226
+ z === T.Text && O && D && this.control.textEditorManager.updateTextForWorker(
5226
5227
  {
5227
5228
  workId: O,
5228
5229
  isActive: !0,
@@ -5299,9 +5300,9 @@ class _M extends qM {
5299
5300
  toolsType: m,
5300
5301
  isSync: M,
5301
5302
  viewId: f,
5302
- isLockSentEventCursor: T,
5303
+ isLockSentEventCursor: N,
5303
5304
  nextTasks: S,
5304
- needUndoTicker: N
5305
+ needUndoTicker: v
5305
5306
  } = a;
5306
5307
  if (!f) {
5307
5308
  console.error(
@@ -5310,18 +5311,18 @@ class _M extends qM {
5310
5311
  );
5311
5312
  return;
5312
5313
  }
5313
- const C = a.scenePath || this.viewContainerManager.getCurScenePath(f);
5314
+ const j = a.scenePath || this.viewContainerManager.getCurScenePath(f);
5314
5315
  switch (c) {
5315
5316
  case R.None: {
5316
- T && st(
5317
+ N && st(
5317
5318
  () => {
5318
5319
  this.setLockSentEventCursor(!1);
5319
5320
  },
5320
5321
  this.maxLastSyncTime,
5321
5322
  this.control.hasPolyfillMethod("requestIdleCallback")
5322
- ), N && Number(N) && st(
5323
+ ), v && Number(v) && st(
5323
5324
  () => {
5324
- this.foceUndoTickerEnd(Number(N), f);
5325
+ this.foceUndoTickerEnd(Number(v), f);
5325
5326
  },
5326
5327
  0,
5327
5328
  this.control.hasPolyfillMethod("requestIdleCallback")
@@ -5338,7 +5339,7 @@ class _M extends qM {
5338
5339
  index: u,
5339
5340
  isSync: M,
5340
5341
  viewId: f,
5341
- scenePath: C,
5342
+ scenePath: j,
5342
5343
  updateNodeOpt: I
5343
5344
  });
5344
5345
  break;
@@ -5353,7 +5354,7 @@ class _M extends qM {
5353
5354
  toolsType: m,
5354
5355
  isSync: M,
5355
5356
  viewId: f,
5356
- scenePath: C
5357
+ scenePath: j
5357
5358
  }), this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
5358
5359
  this.setShapeSelectorByWorkId(
5359
5360
  this.willSelectorWorkId,
@@ -5372,7 +5373,7 @@ class _M extends qM {
5372
5373
  op: l,
5373
5374
  isSync: M,
5374
5375
  viewId: f,
5375
- scenePath: C
5376
+ scenePath: j
5376
5377
  });
5377
5378
  break;
5378
5379
  }
@@ -5382,7 +5383,7 @@ class _M extends qM {
5382
5383
  removeIds: g,
5383
5384
  isSync: M,
5384
5385
  viewId: f,
5385
- scenePath: C
5386
+ scenePath: j
5386
5387
  }), this.willSelectorWorkId && (g != null && g.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
5387
5388
  break;
5388
5389
  }
@@ -5397,11 +5398,11 @@ class _M extends qM {
5397
5398
  return;
5398
5399
  const { focusScenePath: r, cameraOpt: s } = n, a = this.viewContainerManager.transformToScenePoint(e, t), c = [];
5399
5400
  for (const h of this.localPointsBatchData.keys())
5400
- if (((l = this.currentToolsData) == null ? void 0 : l.toolsType) === v.Text) {
5401
+ if (((l = this.currentToolsData) == null ? void 0 : l.toolsType) === T.Text) {
5401
5402
  const u = this.getLocalPointInfo(h), g = u == null ? void 0 : u.state;
5402
- if (g && g === j.Start) {
5403
+ if (g && g === x.Start) {
5403
5404
  const p = this.currentLocalWorkData.toolsOpt;
5404
- p.workState = j.Doing, p.boxPoint = [Math.round(a[0]), Math.round(a[1])], p.boxSize = [p.fontSize, p.fontSize], this.control.textEditorManager.checkEmptyTextBlur(), this.control.textEditorManager.createTextForMasterController(
5405
+ p.workState = x.Doing, p.boxPoint = [Math.round(a[0]), Math.round(a[1])], p.boxSize = [p.fontSize, p.fontSize], this.control.textEditorManager.checkEmptyTextBlur(), this.control.textEditorManager.createTextForMasterController(
5405
5406
  {
5406
5407
  workId: this.newWorkId,
5407
5408
  x: e[0],
@@ -5419,7 +5420,7 @@ class _M extends qM {
5419
5420
  this.deleteLocalPoint(h);
5420
5421
  continue;
5421
5422
  } else
5422
- this.pushLocalPoint(h, a, j.Done, t), c.push(h);
5423
+ this.pushLocalPoint(h, a, x.Done, t), c.push(h);
5423
5424
  if (c.length) {
5424
5425
  try {
5425
5426
  if (await new Promise((u) => {
@@ -5442,20 +5443,20 @@ class _M extends qM {
5442
5443
  }
5443
5444
  onLocalEventDoing(e, t) {
5444
5445
  var r;
5445
- if (((r = this.currentToolsData) == null ? void 0 : r.toolsType) === v.Text)
5446
+ if (((r = this.currentToolsData) == null ? void 0 : r.toolsType) === T.Text)
5446
5447
  return;
5447
- this.currentLocalWorkData.workState === j.Start && this.setCurrentLocalWorkData({
5448
+ this.currentLocalWorkData.workState === x.Start && this.setCurrentLocalWorkData({
5448
5449
  ...this.currentLocalWorkData,
5449
- workState: j.Doing
5450
+ workState: x.Doing
5450
5451
  });
5451
5452
  let n = !1;
5452
5453
  for (const [s, { state: a }] of this.localPointsBatchData.entries())
5453
- if (this.isAbled() && a !== j.Pending) {
5454
+ if (this.isAbled() && a !== x.Pending) {
5454
5455
  const c = this.viewContainerManager.transformToScenePoint(e, t);
5455
5456
  this.pushLocalPoint(
5456
5457
  s,
5457
5458
  c,
5458
- a === j.Start ? j.Doing : a,
5459
+ a === x.Start ? x.Doing : a,
5459
5460
  t
5460
5461
  ), n = !0;
5461
5462
  }
@@ -5467,14 +5468,14 @@ class _M extends qM {
5467
5468
  onLocalEventStart(e, t) {
5468
5469
  var c, l;
5469
5470
  this.viewContainerManager.focuedViewId !== t && this.viewContainerManager.setFocuedViewId(t), this.isCanDrawWork && this.control.room && !this.control.room.disableDeviceInputs && (this.control.room.disableDeviceInputs = !0);
5470
- const n = (c = this.currentToolsData) == null ? void 0 : c.toolsType, r = n === v.Selector ? Z : this.newWorkId, s = this.setZIndex(t);
5471
+ const n = (c = this.currentToolsData) == null ? void 0 : c.toolsType, r = n === T.Selector ? Z : this.newWorkId, s = this.setZIndex(t);
5471
5472
  this.setCurrentLocalWorkData({
5472
- workState: j.Start,
5473
+ workState: x.Start,
5473
5474
  toolsOpt: s,
5474
5475
  viewId: t
5475
5476
  });
5476
5477
  const a = this.viewContainerManager.transformToScenePoint(e, t);
5477
- if (this.pushLocalPoint(r, a, j.Start, t, s), n !== v.Text) {
5478
+ if (this.pushLocalPoint(r, a, x.Start, t, s), n !== T.Text) {
5478
5479
  if (this.control.textEditorManager.checkEmptyTextBlur(), this.isCanRecordUndoRedo && this.internalMsgEmitter.emit("addUndoTicker", this.now, t), r && s && n && this.isCanStartEventConsum && this.prepareOnceWork({ workId: r, toolsOpt: s, viewId: t }, n), this.consumeCount = 0, this.postCount = 0, this.maxDrawCount = 0, this.fullWorkerDrawCount = 0, this.subWorkerDrawCount = 0, this.clearReRenders(1 / 0), this.isCanDrawWork) {
5479
5480
  const h = this.viewContainerManager.getCurScenePath(t);
5480
5481
  h && ((l = this.collector) != null && l.hasSelector(t, h)) && this.blurSelector(t, h);
@@ -5488,8 +5489,8 @@ class _M extends qM {
5488
5489
  }
5489
5490
  pushLocalPoint(e, t, n, r, s) {
5490
5491
  let a = this.getLocalPointInfo(e);
5491
- n === j.Start ? a = {
5492
- state: j.Start,
5492
+ n === x.Start ? a = {
5493
+ state: x.Start,
5493
5494
  points: t,
5494
5495
  opt: s || this.currentLocalWorkData.toolsOpt,
5495
5496
  isFullWork: !1,
@@ -5540,11 +5541,11 @@ class _M extends qM {
5540
5541
  const r = (c = this.collector) == null ? void 0 : c.uid, s = this.viewContainerManager.getCurScenePath(n);
5541
5542
  if (r && !this.control.renderControl.isWritable)
5542
5543
  return;
5543
- const a = ((l = this.currentToolsData) == null ? void 0 : l.toolsType) === v.Selector;
5544
+ const a = ((l = this.currentToolsData) == null ? void 0 : l.toolsType) === T.Selector;
5544
5545
  switch ((h = this.currentToolsData) == null ? void 0 : h.toolsType) {
5545
- case v.Eraser:
5546
- case v.PencilEraser:
5547
- case v.BitMapEraser: {
5546
+ case T.Eraser:
5547
+ case T.PencilEraser:
5548
+ case T.BitMapEraser: {
5548
5549
  if (r && !this.control.renderControl.isClearAble({ uid: r, viewId: n, scenePath: s }))
5549
5550
  return;
5550
5551
  break;
@@ -5555,7 +5556,23 @@ class _M extends qM {
5555
5556
  break;
5556
5557
  }
5557
5558
  }
5558
- switch (this.control.isUseSimple || st(
5559
+ switch (e) {
5560
+ case x.Start:
5561
+ this.isLocalWorkActive = !0, this.setLocalWorkViewId(n), n && this.onLocalEventStart(t, n), a && this.viewContainerManager.showFloatBarBtn(n, !1);
5562
+ break;
5563
+ case x.Doing:
5564
+ n && n === this.getLocalWorkViewId() && this.onLocalEventDoing(t, n);
5565
+ break;
5566
+ case x.Done:
5567
+ n && n === this.getLocalWorkViewId() && (this.setCurrentLocalWorkData({
5568
+ ...this.currentLocalWorkData,
5569
+ workState: x.Done
5570
+ }), await this.onLocalEventEnd(t, n), setTimeout(() => {
5571
+ this.isLocalWorkActive = !1, this.setCurrentLocalWorkData({ workState: x.Pending }), a && this.viewContainerManager.showFloatBarBtn(n, !0), this.setLocalWorkViewId(void 0);
5572
+ }, 0));
5573
+ break;
5574
+ }
5575
+ this.isLocalWorkActive && this.viewContainerManager.focuedViewId === n && this.publicMsgEmitter.emit("workState", e, n), st(
5559
5576
  () => {
5560
5577
  var u;
5561
5578
  (u = this.control.pluginManager) == null || u.dispatchPluginEvent(
@@ -5567,23 +5584,7 @@ class _M extends qM {
5567
5584
  },
5568
5585
  Gn,
5569
5586
  this.control.hasPolyfillMethod("requestIdleCallback")
5570
- ), e) {
5571
- case j.Start:
5572
- this.isLocalWorkActive = !0, this.setLocalWorkViewId(n), n && this.onLocalEventStart(t, n), a && this.viewContainerManager.showFloatBarBtn(n, !1);
5573
- break;
5574
- case j.Doing:
5575
- n && n === this.getLocalWorkViewId() && this.onLocalEventDoing(t, n);
5576
- break;
5577
- case j.Done:
5578
- n && n === this.getLocalWorkViewId() && (this.setCurrentLocalWorkData({
5579
- ...this.currentLocalWorkData,
5580
- workState: j.Done
5581
- }), await this.onLocalEventEnd(t, n), setTimeout(() => {
5582
- this.isLocalWorkActive = !1, this.setCurrentLocalWorkData({ workState: j.Pending }), a && this.viewContainerManager.showFloatBarBtn(n, !0), this.setLocalWorkViewId(void 0);
5583
- }, 0));
5584
- break;
5585
- }
5586
- this.isLocalWorkActive && this.viewContainerManager.focuedViewId === n && this.publicMsgEmitter.emit("workState", e, n);
5587
+ );
5587
5588
  }
5588
5589
  getLocalWorkViewId() {
5589
5590
  return this.localWorkViewId;
@@ -5665,7 +5666,7 @@ class _M extends qM {
5665
5666
  }), this.control.renderControl.destoryByViewId(e, t);
5666
5667
  }
5667
5668
  onServiceDerive(e, t) {
5668
- var p, d, I, m, M, f, T, S;
5669
+ var p, d, I, m, M, f, N, S;
5669
5670
  const { newValue: n, oldValue: r, viewId: s, scenePath: a } = t, c = ae(n) || {}, l = e;
5670
5671
  let h = c.type;
5671
5672
  if (!n && r) {
@@ -5673,15 +5674,15 @@ class _M extends qM {
5673
5674
  this.collector.isOwn(l) ? this.blurSelector(s, a) : this.blurSelector(s, a, l);
5674
5675
  return;
5675
5676
  }
5676
- if (h = R.RemoveNode, r.toolsType === v.LaserPen)
5677
+ if (h = R.RemoveNode, r.toolsType === T.LaserPen)
5677
5678
  return;
5678
5679
  }
5679
5680
  const u = (d = this.viewContainerManager.getView(s)) == null ? void 0 : d.focusScenePath;
5680
5681
  if (u && u !== a)
5681
5682
  return;
5682
5683
  if ((I = this.collector) != null && I.isSelector(e)) {
5683
- const N = (m = this.collector) == null ? void 0 : m.getUidFromKey(e);
5684
- if (N && !this.control.roomMember.isOnLine(N))
5684
+ const v = (m = this.collector) == null ? void 0 : m.getUidFromKey(e);
5685
+ if (v && !this.control.roomMember.isOnLine(v))
5685
5686
  return;
5686
5687
  }
5687
5688
  if (h && l) {
@@ -5690,21 +5691,21 @@ class _M extends qM {
5690
5691
  h
5691
5692
  ))
5692
5693
  return;
5693
- const N = c;
5694
- if (N.workId = (M = this.collector) != null && M.isOwn(l) ? (f = this.collector) == null ? void 0 : f.getLocalId(l) : l, N.msgType = h, N.toolsType === v.LaserPen && (N.isRunSubWork = !0), N.dataType = q.Service, N.viewId = s, N.scenePath = a, N.useAnimation = this.smoothSync && ((T = N.updateNodeOpt) == null ? void 0 : T.useAnimation) || !1, N.selectIds && (N.selectIds = N.selectIds.map((C) => {
5695
- var x, k;
5696
- return (x = this.collector) != null && x.isOwn(C) ? (k = this.collector) == null ? void 0 : k.getLocalId(C) : C;
5697
- })), N && N.toolsType === v.Text || (r == null ? void 0 : r.toolsType) === v.Text) {
5698
- this.control.textEditorManager.onServiceDerive(N);
5694
+ const v = c;
5695
+ if (v.workId = (M = this.collector) != null && M.isOwn(l) ? (f = this.collector) == null ? void 0 : f.getLocalId(l) : l, v.msgType = h, v.toolsType === T.LaserPen && (v.isRunSubWork = !0), v.dataType = q.Service, v.viewId = s, v.scenePath = a, v.useAnimation = this.smoothSync && ((N = v.updateNodeOpt) == null ? void 0 : N.useAnimation) || !1, v.selectIds && (v.selectIds = v.selectIds.map((j) => {
5696
+ var C, k;
5697
+ return (C = this.collector) != null && C.isOwn(j) ? (k = this.collector) == null ? void 0 : k.getLocalId(j) : j;
5698
+ })), v && v.toolsType === T.Text || (r == null ? void 0 : r.toolsType) === T.Text) {
5699
+ this.control.textEditorManager.onServiceDerive(v);
5699
5700
  return;
5700
5701
  }
5701
- N.isEnableCursor = this.control.cursor.isEnableCursor, this.taskBatchData.add(N);
5702
+ v.isEnableCursor = this.control.cursor.isEnableCursor, this.taskBatchData.add(v);
5702
5703
  }
5703
5704
  this.runAnimation();
5704
5705
  const g = t.newValue && ((S = t.newValue.opt) == null ? void 0 : S.zIndex);
5705
5706
  if (this.zIndexNodeMethod && te(g)) {
5706
- const N = this.zIndexNodeMethod.getMinZIndex(s);
5707
- this.zIndexNodeMethod.getMaxZIndex(s) < g && this.zIndexNodeMethod.setMaxZIndex(g, s), N > g && this.zIndexNodeMethod.setMinZIndex(g, s);
5707
+ const v = this.zIndexNodeMethod.getMinZIndex(s);
5708
+ this.zIndexNodeMethod.getMaxZIndex(s) < g && this.zIndexNodeMethod.setMaxZIndex(g, s), v > g && this.zIndexNodeMethod.setMinZIndex(g, s);
5708
5709
  }
5709
5710
  }
5710
5711
  pullServiceData(e, t, n = {
@@ -5731,10 +5732,10 @@ class _M extends qM {
5731
5732
  ))
5732
5733
  continue;
5733
5734
  const f = r[m];
5734
- if (f.workId = (g = this.collector) != null && g.isOwn(m) ? (p = this.collector) == null ? void 0 : p.getLocalId(m) : m, f.msgType = M, f.dataType = q.Service, f.viewId = e, f.scenePath = t, f.useAnimation = this.smoothSync && (f.ops ? !!a : (d = f.updateNodeOpt) == null ? void 0 : d.useAnimation) || !1, f.selectIds && (f.selectIds = f.selectIds.map((T) => {
5735
- var S, N;
5736
- return (S = this.collector) != null && S.isOwn(T) ? (N = this.collector) == null ? void 0 : N.getLocalId(T) : T;
5737
- })), f.toolsType === v.Text) {
5735
+ if (f.workId = (g = this.collector) != null && g.isOwn(m) ? (p = this.collector) == null ? void 0 : p.getLocalId(m) : m, f.msgType = M, f.dataType = q.Service, f.viewId = e, f.scenePath = t, f.useAnimation = this.smoothSync && (f.ops ? !!a : (d = f.updateNodeOpt) == null ? void 0 : d.useAnimation) || !1, f.selectIds && (f.selectIds = f.selectIds.map((N) => {
5736
+ var S, v;
5737
+ return (S = this.collector) != null && S.isOwn(N) ? (v = this.collector) == null ? void 0 : v.getLocalId(N) : N;
5738
+ })), f.toolsType === T.Text) {
5738
5739
  this.control.textEditorManager.onServiceDerive(f);
5739
5740
  continue;
5740
5741
  }
@@ -5765,16 +5766,16 @@ class _M extends qM {
5765
5766
  n,
5766
5767
  { state: r, isFullWork: s, points: a, opt: c }
5767
5768
  ] of this.localPointsBatchData.entries()) {
5768
- if (r === j.Done && !s || r === j.Start && !this.isCanStartEventConsum)
5769
+ if (r === x.Done && !s || r === x.Start && !this.isCanStartEventConsum)
5769
5770
  continue;
5770
5771
  const l = a.map((h) => h);
5771
5772
  if (l.length) {
5772
- if (this.isPostCountType && r === j.Doing) {
5773
+ if (this.isPostCountType && r === x.Doing) {
5773
5774
  if (this.postCount > this.consumeCount)
5774
5775
  continue;
5775
5776
  this.postCount++;
5776
5777
  }
5777
- this.delayWorkStateToDoneResolve && r === j.Done && (this.delayWorkStateToDoneResolve(!0), this.setLockSentEventCursor(!0)), this.taskBatchData.add({
5778
+ this.delayWorkStateToDoneResolve && r === x.Done && (this.delayWorkStateToDoneResolve(!0), this.setLockSentEventCursor(!0)), this.taskBatchData.add({
5778
5779
  op: l,
5779
5780
  workState: r,
5780
5781
  workId: n,
@@ -5792,20 +5793,20 @@ class _M extends qM {
5792
5793
  disableEraseText: this.control.disableEraseText,
5793
5794
  postCount: this.isPostCountType && this.postCount || void 0,
5794
5795
  fullWorkerDrawCount: this.isCanPostDraw && this.fullWorkerDrawCount || void 0,
5795
- needUndoTicker: r === j.Done && this.viewContainerManager.getUndoTickerId(e) || void 0
5796
+ needUndoTicker: r === x.Done && this.viewContainerManager.getUndoTickerId(e) || void 0
5796
5797
  }), a.length = 0;
5797
5798
  }
5798
5799
  }
5799
5800
  this.taskBatchData.size && (this.post(this.taskBatchData), this.taskBatchData.clear()), this.taskBatchData.size && (this.animationId = requestAnimationFrame(this.consume.bind(this)));
5800
5801
  }
5801
5802
  unWritable() {
5802
- this.setCurrentLocalWorkData({ workState: j.Unwritable }), this.setLockSentEventCursor(!0);
5803
+ this.setCurrentLocalWorkData({ workState: x.Unwritable }), this.setLockSentEventCursor(!0);
5803
5804
  }
5804
5805
  abled() {
5805
- this.setCurrentLocalWorkData({ workState: j.Pending }), this.setLockSentEventCursor(!1);
5806
+ this.setCurrentLocalWorkData({ workState: x.Pending }), this.setLockSentEventCursor(!1);
5806
5807
  }
5807
5808
  isAbled() {
5808
- return this.currentLocalWorkData.workState !== j.Unwritable;
5809
+ return this.currentLocalWorkData.workState !== x.Unwritable;
5809
5810
  }
5810
5811
  post(e) {
5811
5812
  if (!this.control.hasOffscreenCanvas) {
@@ -5977,8 +5978,8 @@ class _M extends qM {
5977
5978
  c,
5978
5979
  { state: l, viewId: h, points: u, opt: g }
5979
5980
  ] of this.localPointsBatchData.entries())
5980
- if (e === h && l === j.Start || l === j.Doing) {
5981
- if (l === j.Doing && this.isCanDrawWork) {
5981
+ if (e === h && l === x.Start || l === x.Doing) {
5982
+ if (l === x.Doing && this.isCanDrawWork) {
5982
5983
  Number(c) && Number(c) + 60 > this.now && (n.push(c.toString()), this.taskBatchData.add({
5983
5984
  msgType: R.RemoveNode,
5984
5985
  workId: c,
@@ -5989,7 +5990,7 @@ class _M extends qM {
5989
5990
  const p = u.map((d) => d);
5990
5991
  this.taskBatchData.add({
5991
5992
  op: p,
5992
- workState: j.Done,
5993
+ workState: x.Done,
5993
5994
  workId: c,
5994
5995
  dataType: q.Local,
5995
5996
  msgType: R.DrawWork,
@@ -6019,7 +6020,7 @@ class _M extends qM {
6019
6020
  s,
6020
6021
  { state: a, viewId: c }
6021
6022
  ] of this.localPointsBatchData.entries())
6022
- (e === c && a === j.Start || a === j.Doing) && (this.deleteLocalPoint(s), a === j.Doing && this.isCanDrawWork && (t.push(s.toString()), this.taskBatchData.add({
6023
+ (e === c && a === x.Start || a === x.Doing) && (this.deleteLocalPoint(s), a === x.Doing && this.isCanDrawWork && (t.push(s.toString()), this.taskBatchData.add({
6023
6024
  msgType: R.RemoveNode,
6024
6025
  workId: s,
6025
6026
  viewId: c,
@@ -6059,7 +6060,7 @@ class _M extends qM {
6059
6060
  }
6060
6061
  hoverCursor(e, t) {
6061
6062
  var n;
6062
- if (((n = this.currentToolsData) == null ? void 0 : n.toolsType) === v.Selector && !this.isBusy) {
6063
+ if (((n = this.currentToolsData) == null ? void 0 : n.toolsType) === T.Selector && !this.isBusy) {
6063
6064
  const r = this.viewContainerManager.getView(t);
6064
6065
  if (r && r.displayer && r.displayer.vDom) {
6065
6066
  const c = r.displayer.vDom.state.floatBarData;
@@ -6090,7 +6091,7 @@ class _M extends qM {
6090
6091
  }
6091
6092
  blurCursor(e) {
6092
6093
  var n;
6093
- if (((n = this.currentToolsData) == null ? void 0 : n.toolsType) !== v.Selector)
6094
+ if (((n = this.currentToolsData) == null ? void 0 : n.toolsType) !== T.Selector)
6094
6095
  return;
6095
6096
  const t = {
6096
6097
  msgType: R.CursorBlur,
@@ -6108,16 +6109,16 @@ class _M extends qM {
6108
6109
  }
6109
6110
  sendCursorEvent(e, t) {
6110
6111
  var c, l, h;
6111
- if (!this.currentLocalWorkData || this.currentLocalWorkData.workState === j.Unwritable || this.isBusy)
6112
+ if (!this.currentLocalWorkData || this.currentLocalWorkData.workState === x.Unwritable || this.isBusy)
6112
6113
  return;
6113
6114
  const n = (c = this.currentToolsData) == null ? void 0 : c.toolsType;
6114
- if (!this.useTasksqueue && this.workState === j.Pending && n === v.Selector && (te(e[0]) && te(e[1]) ? this.hoverCursor(e, t) : e[0] === void 0 && e[1] === void 0 && this.blurCursor(t)), !this.currentToolsData || !this.isCanSentCursor || !this.control.pluginOptions.extras.cursor.enable)
6115
+ if (!this.useTasksqueue && this.workState === x.Pending && n === T.Selector && (te(e[0]) && te(e[1]) ? this.hoverCursor(e, t) : e[0] === void 0 && e[1] === void 0 && this.blurCursor(t)), !this.currentToolsData || !this.isCanSentCursor || !this.control.pluginOptions.extras.cursor.enable)
6115
6116
  return;
6116
6117
  const r = (l = this.collector) == null ? void 0 : l.uid, s = this.viewContainerManager.getCurScenePath(t);
6117
6118
  switch ((h = this.currentToolsData) == null ? void 0 : h.toolsType) {
6118
- case v.Eraser:
6119
- case v.PencilEraser:
6120
- case v.BitMapEraser: {
6119
+ case T.Eraser:
6120
+ case T.PencilEraser:
6121
+ case T.BitMapEraser: {
6121
6122
  if (r && !this.control.renderControl.isClearAble({
6122
6123
  uid: r,
6123
6124
  viewId: t,
@@ -6242,7 +6243,7 @@ class _M extends qM {
6242
6243
  this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayer(e), l.zIndex = this.zIndexNodeMethod.getMaxZIndex(e)), this.taskBatchData.add({
6243
6244
  msgType: R.FullWork,
6244
6245
  dataType: q.Local,
6245
- toolsType: v.Image,
6246
+ toolsType: T.Image,
6246
6247
  workId: t.uuid,
6247
6248
  opt: l,
6248
6249
  viewId: e,
@@ -6275,7 +6276,7 @@ class _M extends qM {
6275
6276
  this.zIndexNodeMethod && (this.zIndexNodeMethod.addMaxLayer(e), l.zIndex = this.zIndexNodeMethod.getMaxZIndex(e)), this.taskBatchData.add({
6276
6277
  msgType: R.FullWork,
6277
6278
  dataType: q.Local,
6278
- toolsType: v.Image,
6279
+ toolsType: T.Image,
6279
6280
  workId: t.uuid,
6280
6281
  opt: l,
6281
6282
  viewId: e,
@@ -6296,7 +6297,7 @@ class _M extends qM {
6296
6297
  if (!l)
6297
6298
  return;
6298
6299
  for (const [h, u] of Object.entries(l))
6299
- if (u && u.toolsType === v.Image && u.opt.uuid === t) {
6300
+ if (u && u.toolsType === T.Image && u.opt.uuid === t) {
6300
6301
  const g = this.now;
6301
6302
  ze.InternalMsgEmitter.emit(
6302
6303
  "addUndoTicker",
@@ -6311,7 +6312,7 @@ class _M extends qM {
6311
6312
  this.taskBatchData.add({
6312
6313
  msgType: R.FullWork,
6313
6314
  dataType: q.Local,
6314
- toolsType: v.Image,
6315
+ toolsType: T.Image,
6315
6316
  workId: p,
6316
6317
  opt: d,
6317
6318
  viewId: e,
@@ -6341,7 +6342,7 @@ class _M extends qM {
6341
6342
  if (!n)
6342
6343
  return t;
6343
6344
  for (const r of Object.values(n))
6344
- if (r && r.toolsType === v.Image) {
6345
+ if (r && r.toolsType === T.Image) {
6345
6346
  const s = r.opt;
6346
6347
  t.push({
6347
6348
  uuid: s.uuid,
@@ -6440,7 +6441,7 @@ class ep {
6440
6441
  }
6441
6442
  get isSelector() {
6442
6443
  var i;
6443
- return ((i = this.control.worker.currentToolsData) == null ? void 0 : i.toolsType) === v.Selector;
6444
+ return ((i = this.control.worker.currentToolsData) == null ? void 0 : i.toolsType) === T.Selector;
6444
6445
  }
6445
6446
  get collector() {
6446
6447
  return this.control.collector;
@@ -7266,7 +7267,7 @@ const ut = class ut {
7266
7267
  if (!this.room || !this.worker || !i || !this.room.isWritable)
7267
7268
  return;
7268
7269
  const e = this.getToolsKey(i), t = (s = this.worker.getCurrentToolsData()) == null ? void 0 : s.toolsType, n = this.viewContainerManager.focuedViewId;
7269
- n && t === v.Selector && e !== v.Selector && this.worker.blurCursor(n);
7270
+ n && t === T.Selector && e !== T.Selector && this.worker.blurCursor(n);
7270
7271
  const r = this.getToolsOpt(e, i);
7271
7272
  this.worker.setCurrentToolsData(r), (a = this.pluginManager) == null || a.dispatchPluginEvent("setToolkey", e), this.effectViewContainer(e), this.effectResolve && this.effectResolve(!0);
7272
7273
  },
@@ -7295,7 +7296,7 @@ const ut = class ut {
7295
7296
  internalMsgEmitter: ut.InternalMsgEmitter,
7296
7297
  publicMsgEmitter: ut.PublicMsgEmitter
7297
7298
  };
7298
- this.cursor = new RM(r), this.textEditorManager = new _g(r), this.worker = new _M(r), this.hotkeyManager = new ep(r), this.renderControl = new tp(r), this.isUseSimple || (this.miniMapManager = new ip(r), this.pluginManager = new op(r));
7299
+ this.cursor = new RM(r), this.textEditorManager = new _g(r), this.worker = new _M(r), this.hotkeyManager = new ep(r), this.renderControl = new tp(r), this.pluginManager = new op(r), this.isUseSimple || (this.miniMapManager = new ip(r));
7299
7300
  }
7300
7301
  hasPolyfillMethod(i) {
7301
7302
  return this._isPolyfill[i];
@@ -7407,7 +7408,7 @@ const ut = class ut {
7407
7408
  /** 监听读写状态变更 */
7408
7409
  onWritableChange(i) {
7409
7410
  var n;
7410
- i ? this.worker.abled() : this.worker.unWritable(), ((n = this.worker.getCurrentToolsData()) == null ? void 0 : n.toolsType) === v.Text && this.viewContainerManager.focuedViewId && (i ? this.viewContainerManager.activeTextEditor(
7411
+ i ? this.worker.abled() : this.worker.unWritable(), ((n = this.worker.getCurrentToolsData()) == null ? void 0 : n.toolsType) === T.Text && this.viewContainerManager.focuedViewId && (i ? this.viewContainerManager.activeTextEditor(
7411
7412
  this.viewContainerManager.focuedViewId
7412
7413
  ) : this.viewContainerManager.unActiveTextEditor(
7413
7414
  this.viewContainerManager.focuedViewId
@@ -7421,37 +7422,37 @@ const ut = class ut {
7421
7422
  const e = i.currentApplianceName;
7422
7423
  switch (this.hasSwitchToSelectorEffect = !1, e) {
7423
7424
  case ie.text:
7424
- return i.textCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), v.Text;
7425
+ return i.textCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Text;
7425
7426
  case ie.pencil:
7426
- return i.useLaserPen ? v.LaserPen : v.Pencil;
7427
+ return i.useLaserPen ? T.LaserPen : T.Pencil;
7427
7428
  case ie.eraser:
7428
- return v.Eraser;
7429
+ return T.Eraser;
7429
7430
  case ie.pencilEraser:
7430
- return this.pluginOptions.extras.pencilEraser.useBitMap === !1 ? v.PencilEraser : v.BitMapEraser;
7431
+ return this.pluginOptions.extras.pencilEraser.useBitMap === !1 ? T.PencilEraser : T.BitMapEraser;
7431
7432
  case ie.selector:
7432
- return v.Selector;
7433
+ return T.Selector;
7433
7434
  case ie.arrow:
7434
- return i.arrowCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), v.Arrow;
7435
+ return i.arrowCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Arrow;
7435
7436
  case ie.straight:
7436
- return i.straightCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), v.Straight;
7437
+ return i.straightCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Straight;
7437
7438
  case ie.ellipse:
7438
- return i.ellipseCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), v.Ellipse;
7439
+ return i.ellipseCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Ellipse;
7439
7440
  case ie.rectangle:
7440
- return i.rectangleCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), v.Rectangle;
7441
+ return i.rectangleCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), T.Rectangle;
7441
7442
  case ie.shape:
7442
7443
  if (i.shapeCompleteToSelector && (this.hasSwitchToSelectorEffect = !0), i.shapeType === _e.Pentagram || i.shapeType === _e.Star)
7443
- return v.Star;
7444
+ return T.Star;
7444
7445
  if (i.shapeType === _e.Polygon || i.shapeType === _e.Triangle || i.shapeType === _e.Rhombus)
7445
- return v.Polygon;
7446
+ return T.Polygon;
7446
7447
  if (i.shapeType === _e.SpeechBalloon)
7447
- return v.SpeechBalloon;
7448
+ return T.SpeechBalloon;
7448
7449
  break;
7449
7450
  }
7450
- return v.Clicker;
7451
+ return T.Clicker;
7451
7452
  }
7452
7453
  /** 获取当前工具默认配置 */
7453
7454
  getToolsOpt(i, e) {
7454
- if (i === v.Clicker)
7455
+ if (i === T.Clicker)
7455
7456
  return {
7456
7457
  toolsType: i,
7457
7458
  toolsOpt: {}
@@ -7467,7 +7468,7 @@ const ut = class ut {
7467
7468
  isOpacity: (e == null ? void 0 : e.strokeOpacity) && e.strokeOpacity < 1 || (e == null ? void 0 : e.fillOpacity) && e.fillOpacity < 1 || (e == null ? void 0 : e.textOpacity) && e.textOpacity < 1 || (e == null ? void 0 : e.textBgOpacity) && e.textBgOpacity < 1 || !1
7468
7469
  };
7469
7470
  switch (i) {
7470
- case v.Text:
7471
+ case T.Text:
7471
7472
  t.fontFamily = window.getComputedStyle(document.documentElement).getPropertyValue("font-family"), t.fontSize = (e == null ? void 0 : e.textSizeOverride) || (e == null ? void 0 : e.textSize) || Number(window.getComputedStyle(document.body).fontSize), t.textAlign = (e == null ? void 0 : e.textAlign) || "left", t.verticalAlign = (e == null ? void 0 : e.verticalAlign) || "middle", t.fontColor = (e == null ? void 0 : e.textColor) && bt(
7472
7473
  e.textColor[0],
7473
7474
  e.textColor[1],
@@ -7480,45 +7481,45 @@ const ut = class ut {
7480
7481
  e.textBgOpacity || 1
7481
7482
  ) || "transparent", t.bold = (e == null ? void 0 : e.bold) && "bold" || void 0, t.italic = (e == null ? void 0 : e.italic) && "italic" || void 0, t.underline = (e == null ? void 0 : e.underline) || void 0, t.lineThrough = (e == null ? void 0 : e.lineThrough) || void 0, t.text = "", t.strokeColor = void 0;
7482
7483
  break;
7483
- case v.Pencil: {
7484
+ case T.Pencil: {
7484
7485
  const n = (e == null ? void 0 : e.strokeType) || me.Normal;
7485
7486
  t.strokeType = n, t.lineCap = this.getLineCap(n), t.lineDash = this.getLineDash(n);
7486
7487
  break;
7487
7488
  }
7488
- case v.PencilEraser:
7489
- case v.BitMapEraser:
7490
- case v.Eraser:
7489
+ case T.PencilEraser:
7490
+ case T.BitMapEraser:
7491
+ case T.Eraser:
7491
7492
  t.thickness = Math.min(
7492
7493
  4,
7493
7494
  Math.max(1, Math.floor(e.pencilEraserSize || 1))
7494
7495
  ) - 1;
7495
7496
  break;
7496
- case v.LaserPen: {
7497
+ case T.LaserPen: {
7497
7498
  t.duration = (e == null ? void 0 : e.duration) || 1, e != null && e.strokeType && (e == null ? void 0 : e.strokeType) === me.Stroke ? t.strokeType = me.Normal : t.strokeType = (e == null ? void 0 : e.strokeType) || me.Normal;
7498
7499
  const n = t.strokeType;
7499
7500
  t.lineCap = this.getLineCap(n), t.lineDash = this.getLineDash(n);
7500
7501
  break;
7501
7502
  }
7502
- case v.Arrow:
7503
- case v.Straight: {
7503
+ case T.Arrow:
7504
+ case T.Straight: {
7504
7505
  e != null && e.strokeType && (e == null ? void 0 : e.strokeType) === me.Stroke ? t.strokeType = me.Normal : t.strokeType = (e == null ? void 0 : e.strokeType) || me.Normal;
7505
7506
  const n = t.strokeType;
7506
7507
  t.strokeType = n, t.lineCap = this.getLineCap(n), t.lineDash = this.getLineDash(n);
7507
7508
  break;
7508
7509
  }
7509
- case v.Ellipse:
7510
- case v.Rectangle:
7511
- case v.Star:
7512
- case v.Polygon:
7513
- case v.SpeechBalloon: {
7510
+ case T.Ellipse:
7511
+ case T.Rectangle:
7512
+ case T.Star:
7513
+ case T.Polygon:
7514
+ case T.SpeechBalloon: {
7514
7515
  e != null && e.strokeType && (e == null ? void 0 : e.strokeType) === me.Stroke ? t.strokeType = me.Normal : t.strokeType = (e == null ? void 0 : e.strokeType) || me.Normal;
7515
7516
  const n = t.strokeType;
7516
- t.lineCap = this.getLineCap(n), t.lineDash = this.getLineDash(n), i === v.Star && (e.shapeType === _e.Pentagram ? (t.vertices = 10, t.innerVerticeStep = 2, t.innerRatio = 0.4) : e != null && e.vertices && (e != null && e.innerVerticeStep) && (e != null && e.innerRatio) && (t.vertices = e.vertices, t.innerVerticeStep = e.innerVerticeStep, t.innerRatio = e.innerRatio)), i === v.Polygon && (e.shapeType === _e.Triangle ? t.vertices = 3 : e.shapeType === _e.Rhombus ? t.vertices = 4 : e.vertices && (t.vertices = e.vertices)), t.fillColor = (e == null ? void 0 : e.fillColor) && bt(
7517
+ t.lineCap = this.getLineCap(n), t.lineDash = this.getLineDash(n), i === T.Star && (e.shapeType === _e.Pentagram ? (t.vertices = 10, t.innerVerticeStep = 2, t.innerRatio = 0.4) : e != null && e.vertices && (e != null && e.innerVerticeStep) && (e != null && e.innerRatio) && (t.vertices = e.vertices, t.innerVerticeStep = e.innerVerticeStep, t.innerRatio = e.innerRatio)), i === T.Polygon && (e.shapeType === _e.Triangle ? t.vertices = 3 : e.shapeType === _e.Rhombus ? t.vertices = 4 : e.vertices && (t.vertices = e.vertices)), t.fillColor = (e == null ? void 0 : e.fillColor) && bt(
7517
7518
  e.fillColor[0],
7518
7519
  e.fillColor[1],
7519
7520
  e.fillColor[2],
7520
7521
  e == null ? void 0 : e.fillOpacity
7521
- ) || "transparent", i === v.SpeechBalloon && (t.placement = e.placement || "bottomLeft");
7522
+ ) || "transparent", i === T.SpeechBalloon && (t.placement = e.placement || "bottomLeft");
7522
7523
  break;
7523
7524
  }
7524
7525
  }
@@ -7561,26 +7562,26 @@ const ut = class ut {
7561
7562
  if (this.disableDeviceInputs === !0)
7562
7563
  this.room.disableDeviceInputs = !0, (e = this.worker) == null || e.unWritable(), (t = this.cursor) == null || t.unabled();
7563
7564
  else
7564
- switch (i !== v.Text && this.viewContainerManager.focuedViewId && this.viewContainerManager.unActiveTextEditor(
7565
+ switch (i !== T.Text && this.viewContainerManager.focuedViewId && this.viewContainerManager.unActiveTextEditor(
7565
7566
  this.viewContainerManager.focuedViewId
7566
7567
  ), i) {
7567
- case v.Text:
7568
- case v.Pencil:
7569
- case v.LaserPen:
7570
- case v.Arrow:
7571
- case v.Straight:
7572
- case v.Rectangle:
7573
- case v.Ellipse:
7574
- case v.Star:
7575
- case v.Polygon:
7576
- case v.SpeechBalloon:
7577
- case v.Triangle:
7578
- case v.Rhombus:
7579
- case v.Eraser:
7580
- case v.PencilEraser:
7581
- case v.BitMapEraser:
7582
- case v.Selector:
7583
- this.room.disableDeviceInputs = !0, (n = this.worker) == null || n.abled(), i === v.Text && this.viewContainerManager.focuedViewId && this.viewContainerManager.activeTextEditor(
7568
+ case T.Text:
7569
+ case T.Pencil:
7570
+ case T.LaserPen:
7571
+ case T.Arrow:
7572
+ case T.Straight:
7573
+ case T.Rectangle:
7574
+ case T.Ellipse:
7575
+ case T.Star:
7576
+ case T.Polygon:
7577
+ case T.SpeechBalloon:
7578
+ case T.Triangle:
7579
+ case T.Rhombus:
7580
+ case T.Eraser:
7581
+ case T.PencilEraser:
7582
+ case T.BitMapEraser:
7583
+ case T.Selector:
7584
+ this.room.disableDeviceInputs = !0, (n = this.worker) == null || n.abled(), i === T.Text && this.viewContainerManager.focuedViewId && this.viewContainerManager.activeTextEditor(
7584
7585
  this.viewContainerManager.focuedViewId
7585
7586
  );
7586
7587
  break;
@@ -8192,7 +8193,7 @@ const rt = class rt {
8192
8193
  especialDiff(i, e, t, n) {
8193
8194
  if (e === Qe.Update)
8194
8195
  switch (t == null ? void 0 : t.toolsType) {
8195
- case v.Text: {
8196
+ case T.Text: {
8196
8197
  if (n != null && n.opt && (t != null && t.opt)) {
8197
8198
  const {
8198
8199
  uid: s,
@@ -8205,19 +8206,19 @@ const rt = class rt {
8205
8206
  } = t == null ? void 0 : t.opt;
8206
8207
  if (i && ce(c, u))
8207
8208
  return !0;
8208
- n.opt.workState !== j.Done && (n.opt.workState = j.Done), t.opt.workState !== j.Done && (t.opt.workState = j.Done);
8209
+ n.opt.workState !== x.Done && (n.opt.workState = x.Done), t.opt.workState !== x.Done && (t.opt.workState = x.Done);
8209
8210
  }
8210
8211
  break;
8211
8212
  }
8212
8213
  }
8213
8214
  else if (e === Qe.Draw || e === Qe.Delete)
8214
8215
  switch (t == null ? void 0 : t.toolsType) {
8215
- case v.Text: {
8216
+ case T.Text: {
8216
8217
  if (t != null && t.opt) {
8217
8218
  const s = t.opt.text;
8218
8219
  if (i && !s)
8219
8220
  return !0;
8220
- t.opt.workState !== j.Done && (t.opt.workState = j.Done);
8221
+ t.opt.workState !== x.Done && (t.opt.workState = x.Done);
8221
8222
  }
8222
8223
  break;
8223
8224
  }
@@ -8279,7 +8280,7 @@ const rt = class rt {
8279
8280
  return !!e.includes(t);
8280
8281
  }
8281
8282
  refreshPlugin(i, e = !1) {
8282
- var a, c, l, h, u, g, p, d, I, m, M, f, T, S, N, C, x, k, E, L, P;
8283
+ var a, c, l, h, u, g, p, d, I, m, M, f, N, S, v, j, C, k, L, E, P;
8283
8284
  let t;
8284
8285
  const { scenePath: n } = i, r = i.data;
8285
8286
  if (!r || !this.collector)
@@ -8369,7 +8370,7 @@ const rt = class rt {
8369
8370
  if (t = e ? this.isNewEffectiveScene(z, W) : this.isOldEffectiveScene(z, W), t) {
8370
8371
  if (e && Array.isArray(D) && D.length === 2) {
8371
8372
  const J = D[1];
8372
- if ((T = J.updateNodeOpt) != null && T.useAnimation && (J.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(z.key)) === Z && ((N = this.collector) != null && N.isOwn(z.key))) {
8373
+ if ((N = J.updateNodeOpt) != null && N.useAnimation && (J.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(z.key)) === Z && ((v = this.collector) != null && v.isOwn(z.key))) {
8373
8374
  const ne = J.selectIds;
8374
8375
  if (ne) {
8375
8376
  const le = W.filter(
@@ -8386,11 +8387,11 @@ const rt = class rt {
8386
8387
  let oe = !1;
8387
8388
  for (const X of le)
8388
8389
  for (let $ = 0; $ < ne.length; $++)
8389
- X != null && X.selectIds && ((C = X.selectIds) != null && C.includes(ne[$])) && (delete ne[$], oe = !0);
8390
+ X != null && X.selectIds && ((j = X.selectIds) != null && j.includes(ne[$])) && (delete ne[$], oe = !0);
8390
8391
  oe && (J.selectIds = ne.filter((X) => !!X));
8391
8392
  }
8392
8393
  }
8393
- (x = this.collector) == null || x.updateValue(F, J, {
8394
+ (C = this.collector) == null || C.updateValue(F, J, {
8394
8395
  viewId: this.viewId,
8395
8396
  scenePath: n,
8396
8397
  isSync: !0,
@@ -8398,7 +8399,7 @@ const rt = class rt {
8398
8399
  });
8399
8400
  } else if (!e && Array.isArray(D) && D.length === 2) {
8400
8401
  const J = D[0];
8401
- if ((k = J.updateNodeOpt) != null && k.useAnimation && (J.updateNodeOpt.useAnimation = !1), ((E = this.collector) == null ? void 0 : E.getLocalId(z.key)) === Z && ((L = this.collector) != null && L.isOwn(z.key))) {
8402
+ if ((k = J.updateNodeOpt) != null && k.useAnimation && (J.updateNodeOpt.useAnimation = !1), ((L = this.collector) == null ? void 0 : L.getLocalId(z.key)) === Z && ((E = this.collector) != null && E.isOwn(z.key))) {
8402
8403
  const ne = J.selectIds;
8403
8404
  if (ne) {
8404
8405
  const le = W.filter(
@@ -8554,7 +8555,7 @@ class Et {
8554
8555
  }
8555
8556
  setFocuedViewId(i) {
8556
8557
  var e;
8557
- this.focuedViewId = i, i === pe ? this.focuedView = this.mainView : this.focuedView = i && ((e = this.appViews) == null ? void 0 : e.get(i)) || void 0, this.worker.currentToolsData && this.worker.currentToolsData.toolsType === v.Text && this.activeTextEditor(i), this.control.cursor.onFocusViewChange(), this.focuedView && this.focuedView.displayer.commiter.onFocusView();
8558
+ this.focuedViewId = i, i === pe ? this.focuedView = this.mainView : this.focuedView = i && ((e = this.appViews) == null ? void 0 : e.get(i)) || void 0, this.worker.currentToolsData && this.worker.currentToolsData.toolsType === T.Text && this.activeTextEditor(i), this.control.cursor.onFocusViewChange(), this.focuedView && this.focuedView.displayer.commiter.onFocusView();
8558
8559
  }
8559
8560
  setViewFocusScenePath(i, e) {
8560
8561
  var n;
@@ -8595,16 +8596,16 @@ class Et {
8595
8596
  /** 绘制view */
8596
8597
  render(i) {
8597
8598
  var e, t, n, r, s, a, c, l, h, u, g, p, d, I, m, M, f;
8598
- for (const T of i) {
8599
+ for (const N of i) {
8599
8600
  const {
8600
8601
  rect: S,
8601
- imageBitmap: N,
8602
- isClear: C,
8603
- isUnClose: x,
8602
+ imageBitmap: v,
8603
+ isClear: j,
8604
+ isUnClose: C,
8604
8605
  drawCanvas: k,
8605
- clearCanvas: E,
8606
- viewId: L
8607
- } = T, P = (e = this.getView(L)) == null ? void 0 : e.displayer;
8606
+ clearCanvas: L,
8607
+ viewId: E
8608
+ } = N, P = (e = this.getView(E)) == null ? void 0 : e.displayer;
8608
8609
  if (P && S) {
8609
8610
  const {
8610
8611
  dpr: z,
@@ -8613,8 +8614,8 @@ class Et {
8613
8614
  canvasServiceFloatRef: F,
8614
8615
  canvasTopRef: _
8615
8616
  } = P, W = Math.floor(S.w * z), J = Math.floor(S.h * z), ne = S.x * z, le = S.y * z;
8616
- if (C) {
8617
- switch (E) {
8617
+ if (j) {
8618
+ switch (L) {
8618
8619
  case nt.TopFloat:
8619
8620
  (n = (t = _ == null ? void 0 : _.current) == null ? void 0 : t.getContext("2d")) == null || n.clearRect(ne, le, W, J);
8620
8621
  break;
@@ -8630,27 +8631,27 @@ class Et {
8630
8631
  }
8631
8632
  continue;
8632
8633
  }
8633
- if (k && N)
8634
+ if (k && v)
8634
8635
  switch (k) {
8635
8636
  case nt.TopFloat:
8636
- (g = (u = _ == null ? void 0 : _.current) == null ? void 0 : u.getContext("2d")) == null || g.drawImage(N, 0, 0, W, J, ne, le, W, J);
8637
+ (g = (u = _ == null ? void 0 : _.current) == null ? void 0 : u.getContext("2d")) == null || g.drawImage(v, 0, 0, W, J, ne, le, W, J);
8637
8638
  break;
8638
8639
  case nt.Float: {
8639
- (d = (p = D.current) == null ? void 0 : p.getContext("2d")) == null || d.drawImage(N, 0, 0, W, J, ne, le, W, J);
8640
+ (d = (p = D.current) == null ? void 0 : p.getContext("2d")) == null || d.drawImage(v, 0, 0, W, J, ne, le, W, J);
8640
8641
  break;
8641
8642
  }
8642
8643
  case nt.ServiceFloat: {
8643
- (m = (I = F.current) == null ? void 0 : I.getContext("2d")) == null || m.drawImage(N, 0, 0, W, J, ne, le, W, J);
8644
+ (m = (I = F.current) == null ? void 0 : I.getContext("2d")) == null || m.drawImage(v, 0, 0, W, J, ne, le, W, J);
8644
8645
  break;
8645
8646
  }
8646
8647
  case nt.Bg: {
8647
- (f = (M = O.current) == null ? void 0 : M.getContext("2d")) == null || f.drawImage(N, 0, 0, W, J, ne, le, W, J);
8648
+ (f = (M = O.current) == null ? void 0 : M.getContext("2d")) == null || f.drawImage(v, 0, 0, W, J, ne, le, W, J);
8648
8649
  break;
8649
8650
  }
8650
8651
  }
8651
- if (x)
8652
+ if (C)
8652
8653
  continue;
8653
- N == null || N.close();
8654
+ v == null || v.close();
8654
8655
  }
8655
8656
  }
8656
8657
  }
@@ -8725,7 +8726,7 @@ class zo {
8725
8726
  this.toolsKey = (e = this.worker.getCurrentToolsData()) == null ? void 0 : e.toolsType, !this.worker.isAbled() && this.toolsKey && this.control.effectViewContainer(this.toolsKey), this.worker.checkDrawingWork(this.viewId), this.reflashContainerOffset();
8726
8727
  const t = this.getPoint(i);
8727
8728
  this.cachePoint = t, t && (this.worker.originalEventLintener(
8728
- j.Start,
8729
+ x.Start,
8729
8730
  t,
8730
8731
  this.viewId
8731
8732
  ), document.addEventListener("mousemove", this.mousemove, !1), document.addEventListener("mouseleave", this.mouseup, !1), document.addEventListener("mouseup", this.mouseup, !1));
@@ -8736,7 +8737,7 @@ class zo {
8736
8737
  const e = this.getPoint(i);
8737
8738
  if (this.cachePoint = e, this.checkConsumeCount()) return;
8738
8739
  e && this.worker.originalEventLintener(
8739
- j.Doing,
8740
+ x.Doing,
8740
8741
  e,
8741
8742
  this.viewId
8742
8743
  );
@@ -8745,7 +8746,7 @@ class zo {
8745
8746
  y(this, "mouseup", (i) => {
8746
8747
  if (this.active && i.button === 0 && this.viewId) {
8747
8748
  const e = this.getPoint(i) || this.cachePoint;
8748
- e ? (this.worker.originalEventLintener(j.Done, e, this.viewId).finally(() => {
8749
+ e ? (this.worker.originalEventLintener(x.Done, e, this.viewId).finally(() => {
8749
8750
  document.removeEventListener("mouseleave", this.mouseup, !1), document.removeEventListener("mousemove", this.mousemove, !1), document.removeEventListener("mouseup", this.mouseup, !1);
8750
8751
  }), this.cachePoint = void 0) : (document.removeEventListener("mouseleave", this.mouseup, !1), document.removeEventListener("mousemove", this.mousemove, !1), document.removeEventListener("mouseup", this.mouseup, !1));
8751
8752
  }
@@ -8761,7 +8762,7 @@ class zo {
8761
8762
  this.toolsKey = (e = this.worker.getCurrentToolsData()) == null ? void 0 : e.toolsType, !this.worker.isAbled() && this.toolsKey && this.control.effectViewContainer(this.toolsKey), this.worker.checkDrawingWork(this.viewId), this.reflashContainerOffset();
8762
8763
  const t = this.getPoint(i);
8763
8764
  this.cachePoint = t, t && (this.worker.originalEventLintener(
8764
- j.Start,
8765
+ x.Start,
8765
8766
  t,
8766
8767
  this.viewId
8767
8768
  ), document.addEventListener("touchmove", this.touchmove, !1), document.addEventListener("touchend", this.touchend, !1));
@@ -8778,7 +8779,7 @@ class zo {
8778
8779
  const e = this.getPoint(i);
8779
8780
  if (this.cachePoint = e, this.checkConsumeCount()) return;
8780
8781
  e && this.worker.originalEventLintener(
8781
- j.Doing,
8782
+ x.Doing,
8782
8783
  e,
8783
8784
  this.viewId
8784
8785
  );
@@ -8793,7 +8794,7 @@ class zo {
8793
8794
  }
8794
8795
  if (this.viewId) {
8795
8796
  const e = this.getPoint(i) || this.cachePoint;
8796
- e ? (this.worker.originalEventLintener(j.Done, e, this.viewId).finally(() => {
8797
+ e ? (this.worker.originalEventLintener(x.Done, e, this.viewId).finally(() => {
8797
8798
  document.removeEventListener("touchmove", this.touchmove, !1), document.removeEventListener("touchend", this.touchend, !1);
8798
8799
  }), this.cachePoint = void 0) : (document.removeEventListener("touchmove", this.touchmove, !1), document.removeEventListener("touchend", this.touchend, !1));
8799
8800
  }
@@ -8813,7 +8814,7 @@ class zo {
8813
8814
  this.toolsKey = (e = this.worker.getCurrentToolsData()) == null ? void 0 : e.toolsType, !this.worker.isAbled() && this.toolsKey && this.control.effectViewContainer(this.toolsKey), this.worker.checkDrawingWork(this.viewId), this.reflashContainerOffset();
8814
8815
  const t = this.getPoint(i);
8815
8816
  this.cachePoint = t, t && (this.currentDrawingPointerId = i.pointerId, this.worker.originalEventLintener(
8816
- j.Start,
8817
+ x.Start,
8817
8818
  t,
8818
8819
  this.viewId
8819
8820
  ), document.addEventListener("pointermove", this.pointermove, !1), document.addEventListener("pointerup", this.pointerup, !1), document.addEventListener("pointercancel", this.pointerup, !1));
@@ -8838,7 +8839,7 @@ class zo {
8838
8839
  const e = this.getPoint(i);
8839
8840
  if (this.cachePoint = e, this.checkConsumeCount()) return;
8840
8841
  e && this.worker.originalEventLintener(
8841
- j.Doing,
8842
+ x.Doing,
8842
8843
  e,
8843
8844
  this.viewId
8844
8845
  );
@@ -8857,7 +8858,7 @@ class zo {
8857
8858
  }
8858
8859
  if (i.button === 0 && this.viewId) {
8859
8860
  const e = this.getPoint(i) || this.cachePoint;
8860
- e ? (this.worker.originalEventLintener(j.Done, e, this.viewId).finally(() => {
8861
+ e ? (this.worker.originalEventLintener(x.Done, e, this.viewId).finally(() => {
8861
8862
  document.removeEventListener("pointermove", this.pointermove, !1), document.removeEventListener("pointerup", this.pointerup, !1), document.removeEventListener("pointercancel", this.pointerup, !1);
8862
8863
  }), this.cachePoint = void 0, this.currentDrawingPointerId = void 0) : (document.removeEventListener("pointermove", this.pointermove, !1), document.removeEventListener("pointerup", this.pointerup, !1), document.removeEventListener("pointercancel", this.pointerup, !1), this.currentDrawingPointerId = void 0);
8863
8864
  }
@@ -8908,21 +8909,21 @@ class zo {
8908
8909
  var n, r;
8909
8910
  const i = (r = (n = this.worker) == null ? void 0 : n.currentToolsData) == null ? void 0 : r.toolsType, e = this.control.renderControl.isWritable, t = this.worker.isAbled();
8910
8911
  switch (i) {
8911
- case v.Text:
8912
- case v.Pencil:
8913
- case v.LaserPen:
8914
- case v.Arrow:
8915
- case v.Straight:
8916
- case v.Rectangle:
8917
- case v.Ellipse:
8918
- case v.Star:
8919
- case v.Polygon:
8920
- case v.SpeechBalloon:
8921
- case v.Eraser:
8922
- case v.PencilEraser:
8923
- case v.BitMapEraser:
8924
- case v.Selector:
8925
- this.eventTragetElement && (this.eventTragetElement.className = e && t ? `netless-whiteboard ${i === v.Selector ? "cursor-selector" : i === v.Text ? "cursor-text" : i === v.Eraser || i === v.PencilEraser || i === v.BitMapEraser ? "cursor-eraser" : i === v.Pencil || i === v.LaserPen ? "cursor-pencil" : "cursor-arrow"}` : "netless-whiteboard");
8912
+ case T.Text:
8913
+ case T.Pencil:
8914
+ case T.LaserPen:
8915
+ case T.Arrow:
8916
+ case T.Straight:
8917
+ case T.Rectangle:
8918
+ case T.Ellipse:
8919
+ case T.Star:
8920
+ case T.Polygon:
8921
+ case T.SpeechBalloon:
8922
+ case T.Eraser:
8923
+ case T.PencilEraser:
8924
+ case T.BitMapEraser:
8925
+ case T.Selector:
8926
+ this.eventTragetElement && (this.eventTragetElement.className = e && t ? `netless-whiteboard ${i === T.Selector ? "cursor-selector" : i === T.Text ? "cursor-text" : i === T.Eraser || i === T.PencilEraser || i === T.BitMapEraser ? "cursor-eraser" : i === T.Pencil || i === T.LaserPen ? "cursor-pencil" : "cursor-arrow"}` : "netless-whiteboard");
8926
8927
  break;
8927
8928
  }
8928
8929
  }
@@ -8968,7 +8969,7 @@ class zo {
8968
8969
  }
8969
8970
  async stopEventHandler() {
8970
8971
  this.cachePoint && (await this.worker.originalEventLintener(
8971
- j.Done,
8972
+ x.Done,
8972
8973
  this.cachePoint,
8973
8974
  this.viewId
8974
8975
  ).finally(() => {
@@ -9007,7 +9008,7 @@ class zo {
9007
9008
  /** 检查是否超过最大绘制数量 */
9008
9009
  checkConsumeCount() {
9009
9010
  const i = this.worker.getConsumeCount();
9010
- return this.cachePoint && this.toolsKey && this.toolsKey === v.Pencil && i > this.maxDrawCount ? (this.stopEventHandler().finally(() => {
9011
+ return this.cachePoint && this.toolsKey && this.toolsKey === T.Pencil && i > this.maxDrawCount ? (this.stopEventHandler().finally(() => {
9011
9012
  this.worker.publicMsgEmitter.emit(
9012
9013
  "forceStop",
9013
9014
  Hn.longPencil,
@@ -9244,15 +9245,15 @@ const Np = (o) => {
9244
9245
  return null;
9245
9246
  const a = (u, g) => {
9246
9247
  const p = Math.min(Math.max(u - 8, 0), 100) / 100;
9247
- (i !== p || g === j.Done) && t(p, e, g);
9248
+ (i !== p || g === x.Done) && t(p, e, g);
9248
9249
  }, c = (u, g) => {
9249
9250
  g.x !== (n == null ? void 0 : n.x) && r({ x: g.x, y: 0 }), !s.current && (s.current = setTimeout(() => {
9250
- s.current = 0, a(g.x, j.Doing);
9251
+ s.current = 0, a(g.x, x.Doing);
9251
9252
  }, 100));
9252
9253
  }, l = () => {
9253
- t(i, e, j.Start);
9254
+ t(i, e, x.Start);
9254
9255
  }, h = (u, g) => {
9255
- g.x !== (n == null ? void 0 : n.x) && r({ x: g.x, y: 0 }), s.current && (clearTimeout(s.current), s.current = 0), a(g.x, j.Done);
9256
+ g.x !== (n == null ? void 0 : n.x) && r({ x: g.x, y: 0 }), s.current && (clearTimeout(s.current), s.current = 0), a(g.x, x.Done);
9256
9257
  };
9257
9258
  return /* @__PURE__ */ w.createElement(
9258
9259
  "div",
@@ -9262,7 +9263,7 @@ const Np = (o) => {
9262
9263
  onPointerUp: (u) => {
9263
9264
  s.current && (clearTimeout(s.current), s.current = 0);
9264
9265
  const g = u.nativeEvent.offsetX, p = Math.min(Math.max(g - 12, 0), 100) / 100;
9265
- r({ x: p * 100 + 8, y: 0 }), t(p, e, j.Done);
9266
+ r({ x: p * 100 + 8, y: 0 }), t(p, e, x.Done);
9266
9267
  }
9267
9268
  },
9268
9269
  /* @__PURE__ */ w.createElement(
@@ -9305,15 +9306,15 @@ const Np = (o) => {
9305
9306
  return null;
9306
9307
  const l = (p, d) => {
9307
9308
  const I = Math.ceil(Math.max(p - 8, 0) / 100 * (e - i) + i);
9308
- (t !== I || d === j.Done) && n(I, d);
9309
+ (t !== I || d === x.Done) && n(I, d);
9309
9310
  }, h = (p, d) => {
9310
9311
  d.x !== (s == null ? void 0 : s.x) && a({ x: d.x, y: 0 }), !c.current && (c.current = setTimeout(() => {
9311
- c.current = 0, l(d.x, j.Doing);
9312
+ c.current = 0, l(d.x, x.Doing);
9312
9313
  }, 100));
9313
9314
  }, u = () => {
9314
- n(t, j.Start);
9315
+ n(t, x.Start);
9315
9316
  }, g = (p, d) => {
9316
- d.x !== (s == null ? void 0 : s.x) && a({ x: d.x, y: 0 }), c.current && (clearTimeout(c.current), c.current = 0), l(d.x, j.Done);
9317
+ d.x !== (s == null ? void 0 : s.x) && a({ x: d.x, y: 0 }), c.current && (clearTimeout(c.current), c.current = 0), l(d.x, x.Done);
9317
9318
  };
9318
9319
  return /* @__PURE__ */ w.createElement(
9319
9320
  "div",
@@ -9325,7 +9326,7 @@ const Np = (o) => {
9325
9326
  const d = p.nativeEvent.offsetX, I = Math.ceil(
9326
9327
  Math.max(d - 12, 0) / 100 * (e - i) + i
9327
9328
  ), m = Math.ceil((I - i) / (e - i) * 100) + 8;
9328
- a({ x: m, y: 0 }), n(I, j.Done);
9329
+ a({ x: m, y: 0 }), n(I, x.Done);
9329
9330
  }
9330
9331
  },
9331
9332
  /* @__PURE__ */ w.createElement(
@@ -9403,8 +9404,8 @@ const Np = (o) => {
9403
9404
  const { open: i, setOpen: e, floatBarRef: t } = o, { floatBarData: n, floatBarColors: r, mananger: s, setFloatBarData: a } = Se(Te), [c, l] = se(), [h, u] = se(1);
9404
9405
  fe(() => {
9405
9406
  if (n != null && n.strokeColor) {
9406
- const [f, T] = li(n.strokeColor);
9407
- l(f), u(T);
9407
+ const [f, N] = li(n.strokeColor);
9408
+ l(f), u(N);
9408
9409
  }
9409
9410
  }, [n]);
9410
9411
  const g = G(() => {
@@ -9423,15 +9424,15 @@ const Np = (o) => {
9423
9424
  key: "strokeColors",
9424
9425
  opacity: h,
9425
9426
  activeColor: c,
9426
- setCurOpacity: (f, T, S) => {
9427
+ setCurOpacity: (f, N, S) => {
9427
9428
  u(f);
9428
- const N = be(T, f);
9429
- n != null && n.strokeColor && a({ strokeColor: N }), re.emitMethod(
9429
+ const v = be(N, f);
9430
+ n != null && n.strokeColor && a({ strokeColor: v }), re.emitMethod(
9430
9431
  ee.MainEngine,
9431
9432
  U.SetColorNode,
9432
9433
  {
9433
9434
  workIds: [Z],
9434
- strokeColor: N,
9435
+ strokeColor: v,
9435
9436
  workState: S,
9436
9437
  viewId: s == null ? void 0 : s.viewId
9437
9438
  }
@@ -9457,14 +9458,14 @@ const Np = (o) => {
9457
9458
  (s == null ? void 0 : s.control.pluginOptions.extras.strokeWidth.max) || je.strokeWidth.max
9458
9459
  ),
9459
9460
  activeNumber: n.thickness,
9460
- setActiveNumber: (f, T) => {
9461
+ setActiveNumber: (f, N) => {
9461
9462
  n != null && n.thickness && a({ thickness: f }), re.emitMethod(
9462
9463
  ee.MainEngine,
9463
9464
  U.SetColorNode,
9464
9465
  {
9465
9466
  workIds: [Z],
9466
9467
  thickness: f,
9467
- workState: T,
9468
+ workState: N,
9468
9469
  viewId: s == null ? void 0 : s.viewId
9469
9470
  }
9470
9471
  );
@@ -9491,7 +9492,7 @@ const Np = (o) => {
9491
9492
  {
9492
9493
  workIds: [Z],
9493
9494
  strokeType: f,
9494
- workState: j.Done,
9495
+ workState: x.Done,
9495
9496
  viewId: s == null ? void 0 : s.viewId
9496
9497
  }
9497
9498
  );
@@ -9510,24 +9511,24 @@ const Np = (o) => {
9510
9511
  I,
9511
9512
  d,
9512
9513
  /* @__PURE__ */ w.createElement("div", { className: "font-colors-line" }),
9513
- r.concat().map((f, T) => {
9514
+ r.concat().map((f, N) => {
9514
9515
  const S = Yt(...f);
9515
9516
  return /* @__PURE__ */ w.createElement(
9516
9517
  ui,
9517
9518
  {
9518
- key: T,
9519
+ key: N,
9519
9520
  color: S,
9520
9521
  activeColor: c,
9521
- onPointerUpHandler: (N) => {
9522
- N.stopPropagation(), l(S);
9523
- const C = be(S, h);
9524
- n != null && n.strokeColor && (n.strokeColor = C, a({ strokeColor: C })), re.emitMethod(
9522
+ onPointerUpHandler: (v) => {
9523
+ v.stopPropagation(), l(S);
9524
+ const j = be(S, h);
9525
+ n != null && n.strokeColor && (n.strokeColor = j, a({ strokeColor: j })), re.emitMethod(
9525
9526
  ee.MainEngine,
9526
9527
  U.SetColorNode,
9527
9528
  {
9528
9529
  workIds: [Z],
9529
- workState: j.Done,
9530
- strokeColor: C,
9530
+ workState: x.Done,
9531
+ strokeColor: j,
9531
9532
  viewId: s == null ? void 0 : s.viewId
9532
9533
  }
9533
9534
  );
@@ -9593,8 +9594,8 @@ const Np = (o) => {
9593
9594
  activeColor: c,
9594
9595
  setCurOpacity: (m, M, f) => {
9595
9596
  u(m);
9596
- const T = be(M, m);
9597
- n != null && n.fillColor && (n.fillColor = T, a({ fillColor: T })), re.emitMethod(
9597
+ const N = be(M, m);
9598
+ n != null && n.fillColor && (n.fillColor = N, a({ fillColor: N })), re.emitMethod(
9598
9599
  ee.MainEngine,
9599
9600
  U.SetColorNode,
9600
9601
  {
@@ -9627,7 +9628,7 @@ const Np = (o) => {
9627
9628
  U.SetColorNode,
9628
9629
  {
9629
9630
  workIds: [Z],
9630
- workState: j.Done,
9631
+ workState: x.Done,
9631
9632
  fillColor: M,
9632
9633
  viewId: s == null ? void 0 : s.viewId
9633
9634
  }
@@ -9643,15 +9644,15 @@ const Np = (o) => {
9643
9644
  key: M,
9644
9645
  color: f,
9645
9646
  activeColor: c,
9646
- onPointerUpHandler: (T) => {
9647
- T.cancelable && T.preventDefault(), T.stopPropagation(), l(f);
9647
+ onPointerUpHandler: (N) => {
9648
+ N.cancelable && N.preventDefault(), N.stopPropagation(), l(f);
9648
9649
  const S = be(f, h);
9649
9650
  n != null && n.fillColor && (n.fillColor = S, a({ fillColor: S })), re.emitMethod(
9650
9651
  ee.MainEngine,
9651
9652
  U.SetColorNode,
9652
9653
  {
9653
9654
  workIds: [Z],
9654
- workState: j.Done,
9655
+ workState: x.Done,
9655
9656
  fillColor: S,
9656
9657
  viewId: s == null ? void 0 : s.viewId
9657
9658
  }
@@ -9696,8 +9697,8 @@ const Np = (o) => {
9696
9697
  } = o, { floatBarColors: s, mananger: a, setFloatBarData: c, floatBarData: l } = Se(Te), [h, u] = se(), [g, p] = se(1);
9697
9698
  fe(() => {
9698
9699
  if (t != null && t.fontColor) {
9699
- const [f, T] = (t == null ? void 0 : t.fontColor) === "transparent" && ["transparent", 0] || li(t.fontColor);
9700
- u(f), p(T);
9700
+ const [f, N] = (t == null ? void 0 : t.fontColor) === "transparent" && ["transparent", 0] || li(t.fontColor);
9701
+ u(f), p(N);
9701
9702
  }
9702
9703
  }, [t == null ? void 0 : t.fontColor]);
9703
9704
  const d = G(() => {
@@ -9716,15 +9717,15 @@ const Np = (o) => {
9716
9717
  key: "fontColors",
9717
9718
  opacity: g,
9718
9719
  activeColor: h,
9719
- setCurOpacity: (f, T, S) => {
9720
+ setCurOpacity: (f, N, S) => {
9720
9721
  p(f);
9721
- const N = be(T, f);
9722
- l != null && l.textOpt && (l.textOpt.fontColor = N, c({ textOpt: l.textOpt })), re.emitMethod(
9722
+ const v = be(N, f);
9723
+ l != null && l.textOpt && (l.textOpt.fontColor = v, c({ textOpt: l.textOpt })), re.emitMethod(
9723
9724
  ee.MainEngine,
9724
9725
  U.SetColorNode,
9725
9726
  {
9726
9727
  workIds: n || [Z],
9727
- fontColor: h && N,
9728
+ fontColor: h && v,
9728
9729
  workState: S,
9729
9730
  viewId: a == null ? void 0 : a.viewId
9730
9731
  }
@@ -9748,24 +9749,24 @@ const Np = (o) => {
9748
9749
  f.stopPropagation(), f.nativeEvent.stopImmediatePropagation();
9749
9750
  }
9750
9751
  },
9751
- s.map((f, T) => {
9752
+ s.map((f, N) => {
9752
9753
  const S = Yt(...f);
9753
9754
  return /* @__PURE__ */ w.createElement(
9754
9755
  ui,
9755
9756
  {
9756
- key: T,
9757
+ key: N,
9757
9758
  color: S,
9758
9759
  activeColor: h,
9759
- onPointerUpHandler: (N) => {
9760
- N.stopPropagation(), u(S);
9761
- const C = be(S, g);
9762
- l != null && l.textOpt && (l.textOpt.fontColor = C, c({ textOpt: l.textOpt })), re.emitMethod(
9760
+ onPointerUpHandler: (v) => {
9761
+ v.stopPropagation(), u(S);
9762
+ const j = be(S, g);
9763
+ l != null && l.textOpt && (l.textOpt.fontColor = j, c({ textOpt: l.textOpt })), re.emitMethod(
9763
9764
  ee.MainEngine,
9764
9765
  U.SetColorNode,
9765
9766
  {
9766
9767
  workIds: n || [Z],
9767
- workState: j.Done,
9768
- fontColor: C,
9768
+ workState: x.Done,
9769
+ fontColor: j,
9769
9770
  viewId: a == null ? void 0 : a.viewId
9770
9771
  }
9771
9772
  );
@@ -9811,8 +9812,8 @@ const Np = (o) => {
9811
9812
  } = o, { floatBarColors: s, mananger: a, setFloatBarData: c, floatBarData: l } = Se(Te), [h, u] = se(), [g, p] = se(1);
9812
9813
  fe(() => {
9813
9814
  if (t != null && t.fontBgColor) {
9814
- const [f, T] = (t == null ? void 0 : t.fontBgColor) === "transparent" && ["transparent", 1] || li(t.fontBgColor);
9815
- u(f), p(T);
9815
+ const [f, N] = (t == null ? void 0 : t.fontBgColor) === "transparent" && ["transparent", 1] || li(t.fontBgColor);
9816
+ u(f), p(N);
9816
9817
  }
9817
9818
  }, [t == null ? void 0 : t.fontBgColor]);
9818
9819
  const d = G(() => {
@@ -9831,15 +9832,15 @@ const Np = (o) => {
9831
9832
  key: "fontBgColor",
9832
9833
  opacity: g || 0,
9833
9834
  activeColor: h,
9834
- setCurOpacity: (f, T, S) => {
9835
+ setCurOpacity: (f, N, S) => {
9835
9836
  p(f);
9836
- const N = be(T, f);
9837
- l != null && l.textOpt && (l.textOpt.fontBgColor = N, c({ textOpt: l.textOpt })), re.emitMethod(
9837
+ const v = be(N, f);
9838
+ l != null && l.textOpt && (l.textOpt.fontBgColor = v, c({ textOpt: l.textOpt })), re.emitMethod(
9838
9839
  ee.MainEngine,
9839
9840
  U.SetColorNode,
9840
9841
  {
9841
9842
  workIds: n || [Z],
9842
- fontBgColor: h && be(T, f),
9843
+ fontBgColor: h && be(N, f),
9843
9844
  workState: S,
9844
9845
  viewId: a == null ? void 0 : a.viewId
9845
9846
  }
@@ -9868,37 +9869,37 @@ const Np = (o) => {
9868
9869
  activeColor: h,
9869
9870
  onPointerUpHandler: (f) => {
9870
9871
  f.stopPropagation();
9871
- const T = "transparent";
9872
- u(T), l != null && l.textOpt && (l.textOpt.fontBgColor = T, c({ textOpt: l.textOpt })), re.emitMethod(
9872
+ const N = "transparent";
9873
+ u(N), l != null && l.textOpt && (l.textOpt.fontBgColor = N, c({ textOpt: l.textOpt })), re.emitMethod(
9873
9874
  ee.MainEngine,
9874
9875
  U.SetColorNode,
9875
9876
  {
9876
9877
  workIds: n || [Z],
9877
- workState: j.Done,
9878
- fontBgColor: T,
9878
+ workState: x.Done,
9879
+ fontBgColor: N,
9879
9880
  viewId: a == null ? void 0 : a.viewId
9880
9881
  }
9881
9882
  );
9882
9883
  }
9883
9884
  }
9884
9885
  ),
9885
- s.map((f, T) => {
9886
+ s.map((f, N) => {
9886
9887
  const S = Yt(...f);
9887
9888
  return /* @__PURE__ */ w.createElement(
9888
9889
  ui,
9889
9890
  {
9890
- key: T,
9891
+ key: N,
9891
9892
  color: S,
9892
9893
  activeColor: h,
9893
- onPointerUpHandler: (N) => {
9894
- N.stopPropagation(), u(S);
9895
- const C = be(S, g);
9896
- l != null && l.textOpt && (l.textOpt.fontBgColor = C, c({ textOpt: l.textOpt })), re.emitMethod(
9894
+ onPointerUpHandler: (v) => {
9895
+ v.stopPropagation(), u(S);
9896
+ const j = be(S, g);
9897
+ l != null && l.textOpt && (l.textOpt.fontBgColor = j, c({ textOpt: l.textOpt })), re.emitMethod(
9897
9898
  ee.MainEngine,
9898
9899
  U.SetColorNode,
9899
9900
  {
9900
9901
  workIds: n || [Z],
9901
- workState: j.Done,
9902
+ workState: x.Done,
9902
9903
  fontBgColor: be(S, g),
9903
9904
  viewId: a == null ? void 0 : a.viewId
9904
9905
  }
@@ -10008,11 +10009,11 @@ const Np = (o) => {
10008
10009
  const M = G(() => {
10009
10010
  if (r && (s != null && s.current) && te(c == null ? void 0 : c.y) && (a != null && a.height)) {
10010
10011
  if (s.current.offsetTop && s.current.offsetTop + c.y > 180) {
10011
- const T = {};
10012
- return T.top = "inherit", T.bottom = 50, T;
10012
+ const N = {};
10013
+ return N.top = "inherit", N.bottom = 50, N;
10013
10014
  } else if (!s.current.offsetTop && (a == null ? void 0 : a.height) - s.current.offsetTop - c.y < 120) {
10014
- const T = {};
10015
- return T.top = "inherit", T.bottom = 50, T;
10015
+ const N = {};
10016
+ return N.top = "inherit", N.bottom = 50, N;
10016
10017
  }
10017
10018
  }
10018
10019
  }, [r, s == null ? void 0 : s.current, c, a]), f = G(() => i ? /* @__PURE__ */ w.createElement(
@@ -10020,8 +10021,8 @@ const Np = (o) => {
10020
10021
  {
10021
10022
  className: "font-style-menu",
10022
10023
  style: M,
10023
- onPointerUp: (T) => {
10024
- T.stopPropagation(), T.nativeEvent.stopImmediatePropagation();
10024
+ onPointerUp: (N) => {
10025
+ N.stopPropagation(), N.nativeEvent.stopImmediatePropagation();
10025
10026
  }
10026
10027
  },
10027
10028
  /* @__PURE__ */ w.createElement(
@@ -10074,8 +10075,8 @@ const Np = (o) => {
10074
10075
  "div",
10075
10076
  {
10076
10077
  className: `button normal-button ${i && "active"}`,
10077
- onPointerUp: (T) => {
10078
- T.stopPropagation(), T.nativeEvent.stopImmediatePropagation(), e(!i);
10078
+ onPointerUp: (N) => {
10079
+ N.stopPropagation(), N.nativeEvent.stopImmediatePropagation(), e(!i);
10079
10080
  }
10080
10081
  },
10081
10082
  /* @__PURE__ */ w.createElement(
@@ -10216,8 +10217,8 @@ const Np = (o) => {
10216
10217
  },
10217
10218
  onKeyDown: (M) => {
10218
10219
  if (M.key === "Backspace") {
10219
- const f = window.getSelection(), T = f == null ? void 0 : f.getRangeAt(0);
10220
- if (T != null && T.collapsed)
10220
+ const f = window.getSelection(), N = f == null ? void 0 : f.getRangeAt(0);
10221
+ if (N != null && N.collapsed)
10221
10222
  return M.cancelable && M.preventDefault(), document.execCommand("delete", !1), !1;
10222
10223
  }
10223
10224
  return !1;
@@ -10225,7 +10226,7 @@ const Np = (o) => {
10225
10226
  onKeyUp: (M) => {
10226
10227
  var f;
10227
10228
  if (i.current) {
10228
- const T = i.current.value, S = parseInt(T);
10229
+ const N = i.current.value, S = parseInt(N);
10229
10230
  isNaN(S) ? i.current.value = "0" : i.current.value = S.toString(), S && M.key === "Enter" && (m(S), (f = i.current) == null || f.blur(), t(!1));
10230
10231
  }
10231
10232
  }
@@ -10446,7 +10447,7 @@ const Np = (o) => {
10446
10447
  U.SetShapeOpt,
10447
10448
  {
10448
10449
  workIds: [Z],
10449
- toolsType: v.Star,
10450
+ toolsType: T.Star,
10450
10451
  viewId: n.viewId,
10451
10452
  vertices: l
10452
10453
  }
@@ -10457,7 +10458,7 @@ const Np = (o) => {
10457
10458
  U.SetShapeOpt,
10458
10459
  {
10459
10460
  workIds: [Z],
10460
- toolsType: v.Star,
10461
+ toolsType: T.Star,
10461
10462
  viewId: n.viewId,
10462
10463
  innerVerticeStep: l
10463
10464
  }
@@ -10468,7 +10469,7 @@ const Np = (o) => {
10468
10469
  U.SetShapeOpt,
10469
10470
  {
10470
10471
  workIds: [Z],
10471
- toolsType: v.Star,
10472
+ toolsType: T.Star,
10472
10473
  viewId: n.viewId,
10473
10474
  innerRatio: l
10474
10475
  }
@@ -10512,7 +10513,7 @@ const Np = (o) => {
10512
10513
  U.SetShapeOpt,
10513
10514
  {
10514
10515
  workIds: [Z],
10515
- toolsType: v.Polygon,
10516
+ toolsType: T.Polygon,
10516
10517
  viewId: i.viewId,
10517
10518
  vertices: r
10518
10519
  }
@@ -10536,7 +10537,7 @@ const Np = (o) => {
10536
10537
  U.SetShapeOpt,
10537
10538
  {
10538
10539
  workIds: [Z],
10539
- toolsType: v.SpeechBalloon,
10540
+ toolsType: T.SpeechBalloon,
10540
10541
  viewId: i.viewId,
10541
10542
  placement: r
10542
10543
  }
@@ -10563,18 +10564,18 @@ const Np = (o) => {
10563
10564
  }, Hp = (o) => {
10564
10565
  const { toolsTypes: i, style: e, mananger: t, shapeOpt: n, setShapeOpt: r } = o, [s, a] = se();
10565
10566
  fe(() => {
10566
- i.includes(v.Polygon) ? a(v.Polygon) : i.includes(v.Star) ? a(v.Star) : a(v.SpeechBalloon);
10567
+ i.includes(T.Polygon) ? a(T.Polygon) : i.includes(T.Star) ? a(T.Star) : a(T.SpeechBalloon);
10567
10568
  }, [i]);
10568
10569
  const c = (g) => {
10569
10570
  a(g);
10570
- }, l = G(() => s === v.Polygon && t && n.vertices ? /* @__PURE__ */ w.createElement(
10571
+ }, l = G(() => s === T.Polygon && t && n.vertices ? /* @__PURE__ */ w.createElement(
10571
10572
  Zp,
10572
10573
  {
10573
10574
  vertices: n.vertices,
10574
10575
  mananger: t,
10575
10576
  setShapeOpt: r
10576
10577
  }
10577
- ) : null, [t, s, n, r]), h = G(() => s === v.Star && t && n.vertices && n.innerVerticeStep && n.innerRatio ? /* @__PURE__ */ w.createElement(
10578
+ ) : null, [t, s, n, r]), h = G(() => s === T.Star && t && n.vertices && n.innerVerticeStep && n.innerRatio ? /* @__PURE__ */ w.createElement(
10578
10579
  Vp,
10579
10580
  {
10580
10581
  mananger: t,
@@ -10583,7 +10584,7 @@ const Np = (o) => {
10583
10584
  innerRatio: n.innerRatio,
10584
10585
  setShapeOpt: r
10585
10586
  }
10586
- ) : null, [t, s, n, r]), u = G(() => s === v.SpeechBalloon && t && n.placement ? /* @__PURE__ */ w.createElement(
10587
+ ) : null, [t, s, n, r]), u = G(() => s === T.SpeechBalloon && t && n.placement ? /* @__PURE__ */ w.createElement(
10587
10588
  $p,
10588
10589
  {
10589
10590
  mananger: t,
@@ -10598,31 +10599,31 @@ const Np = (o) => {
10598
10599
  style: e,
10599
10600
  onPointerUp: Rt
10600
10601
  },
10601
- /* @__PURE__ */ w.createElement("div", { className: "shapeOpt-sub-menu-tabs" }, i.includes(v.Polygon) && /* @__PURE__ */ w.createElement(
10602
+ /* @__PURE__ */ w.createElement("div", { className: "shapeOpt-sub-menu-tabs" }, i.includes(T.Polygon) && /* @__PURE__ */ w.createElement(
10602
10603
  pi,
10603
10604
  {
10604
- isActive: s === v.Polygon,
10605
- icon: s === v.Polygon ? "polygon-active" : "polygon",
10605
+ isActive: s === T.Polygon,
10606
+ icon: s === T.Polygon ? "polygon-active" : "polygon",
10606
10607
  onPointerUpHandler: c.bind(
10607
10608
  void 0,
10608
- v.Polygon
10609
+ T.Polygon
10609
10610
  )
10610
10611
  }
10611
- ) || null, i.includes(v.Star) && /* @__PURE__ */ w.createElement(
10612
+ ) || null, i.includes(T.Star) && /* @__PURE__ */ w.createElement(
10612
10613
  pi,
10613
10614
  {
10614
- isActive: s === v.Star,
10615
- icon: s === v.Star ? "star-active" : "star",
10616
- onPointerUpHandler: c.bind(void 0, v.Star)
10615
+ isActive: s === T.Star,
10616
+ icon: s === T.Star ? "star-active" : "star",
10617
+ onPointerUpHandler: c.bind(void 0, T.Star)
10617
10618
  }
10618
- ) || null, i.includes(v.SpeechBalloon) && /* @__PURE__ */ w.createElement(
10619
+ ) || null, i.includes(T.SpeechBalloon) && /* @__PURE__ */ w.createElement(
10619
10620
  pi,
10620
10621
  {
10621
- isActive: s === v.SpeechBalloon,
10622
- icon: s === v.SpeechBalloon ? "speechBallon-active" : "speechBallon",
10622
+ isActive: s === T.SpeechBalloon,
10623
+ icon: s === T.SpeechBalloon ? "speechBallon-active" : "speechBallon",
10623
10624
  onPointerUpHandler: c.bind(
10624
10625
  void 0,
10625
- v.SpeechBalloon
10626
+ T.SpeechBalloon
10626
10627
  )
10627
10628
  }
10628
10629
  ) || null),
@@ -10686,16 +10687,16 @@ const Np = (o) => {
10686
10687
  /* none */
10687
10688
  ), [u, g] = w.useState(), p = xe(null);
10688
10689
  fe(() => {
10689
- var L, P, z, O;
10690
- const x = {}, k = (a == null ? void 0 : a.w) || ((L = i == null ? void 0 : i.boxSize) == null ? void 0 : L[0]) || 0, E = (a == null ? void 0 : a.h) || ((P = i == null ? void 0 : i.boxSize) == null ? void 0 : P[1]) || 0;
10691
- if (n && k && E && (c != null && c.width) && (c != null && c.height)) {
10692
- if (n.y < 60 ? n.y + E < c.height - 60 ? x.bottom = -120 : n.y + E < c.height ? x.bottom = -58 : n.y > 0 ? x.top = 62 : x.top = -n.y + 62 : x.top = 0, n.x < 0)
10693
- x.left = -n.x + 3;
10690
+ var E, P, z, O;
10691
+ const C = {}, k = (a == null ? void 0 : a.w) || ((E = i == null ? void 0 : i.boxSize) == null ? void 0 : E[0]) || 0, L = (a == null ? void 0 : a.h) || ((P = i == null ? void 0 : i.boxSize) == null ? void 0 : P[1]) || 0;
10692
+ if (n && k && L && (c != null && c.width) && (c != null && c.height)) {
10693
+ if (n.y < 60 ? n.y + L < c.height - 60 ? C.bottom = -120 : n.y + L < c.height ? C.bottom = -58 : n.y > 0 ? C.top = 62 : C.top = -n.y + 62 : C.top = 0, n.x < 0)
10694
+ C.left = -n.x + 3;
10694
10695
  else if (n.x + (((z = p.current) == null ? void 0 : z.offsetWidth) || k) > c.width) {
10695
10696
  const D = c.width - (((O = p.current) == null ? void 0 : O.offsetWidth) || k) - n.x;
10696
- x.left = D;
10697
+ C.left = D;
10697
10698
  }
10698
- g(x);
10699
+ g(C);
10699
10700
  return;
10700
10701
  }
10701
10702
  g(void 0);
@@ -10713,9 +10714,9 @@ const Np = (o) => {
10713
10714
  {
10714
10715
  floatBarRef: p,
10715
10716
  open: l === 3,
10716
- setOpen: (x) => {
10717
+ setOpen: (C) => {
10717
10718
  h(
10718
- x === !0 ? 3 : 0
10719
+ C === !0 ? 3 : 0
10719
10720
  /* FillColor */
10720
10721
  );
10721
10722
  }
@@ -10725,9 +10726,9 @@ const Np = (o) => {
10725
10726
  {
10726
10727
  floatBarRef: p,
10727
10728
  open: l === 2,
10728
- setOpen: (x) => {
10729
+ setOpen: (C) => {
10729
10730
  h(
10730
- x === !0 ? 2 : 0
10731
+ C === !0 ? 2 : 0
10731
10732
  /* StrokeColor */
10732
10733
  );
10733
10734
  }
@@ -10737,9 +10738,9 @@ const Np = (o) => {
10737
10738
  {
10738
10739
  floatBarRef: p,
10739
10740
  open: l === 4,
10740
- setOpen: (x) => {
10741
+ setOpen: (C) => {
10741
10742
  h(
10742
- x === !0 ? 4 : 0
10743
+ C === !0 ? 4 : 0
10743
10744
  /* TextColor */
10744
10745
  );
10745
10746
  },
@@ -10751,9 +10752,9 @@ const Np = (o) => {
10751
10752
  {
10752
10753
  floatBarRef: p,
10753
10754
  open: l === 5,
10754
- setOpen: (x) => {
10755
+ setOpen: (C) => {
10755
10756
  h(
10756
- x === !0 ? 5 : 0
10757
+ C === !0 ? 5 : 0
10757
10758
  /* TextBgColor */
10758
10759
  );
10759
10760
  },
@@ -10765,9 +10766,9 @@ const Np = (o) => {
10765
10766
  {
10766
10767
  floatBarRef: p,
10767
10768
  open: l === 6,
10768
- setOpen: (x) => {
10769
+ setOpen: (C) => {
10769
10770
  h(
10770
- x === !0 ? 6 : 0
10771
+ C === !0 ? 6 : 0
10771
10772
  /* FontStyle */
10772
10773
  );
10773
10774
  },
@@ -10775,13 +10776,13 @@ const Np = (o) => {
10775
10776
  workIds: e,
10776
10777
  style: u
10777
10778
  }
10778
- ) : null, [i, l, e, c, u, p]), T = G(() => i && (c != null && c.viewId) ? /* @__PURE__ */ w.createElement(
10779
+ ) : null, [i, l, e, c, u, p]), N = G(() => i && (c != null && c.viewId) ? /* @__PURE__ */ w.createElement(
10779
10780
  Rp,
10780
10781
  {
10781
10782
  open: l === 7,
10782
- setOpen: (x) => {
10783
+ setOpen: (C) => {
10783
10784
  h(
10784
- x === !0 ? 7 : 0
10785
+ C === !0 ? 7 : 0
10785
10786
  /* FontSize */
10786
10787
  );
10787
10788
  },
@@ -10793,28 +10794,28 @@ const Np = (o) => {
10793
10794
  vp,
10794
10795
  {
10795
10796
  open: l === 1,
10796
- setOpen: (x) => {
10797
+ setOpen: (C) => {
10797
10798
  h(
10798
- x === !0 ? 1 : 0
10799
+ C === !0 ? 1 : 0
10799
10800
  /* Layer */
10800
10801
  );
10801
10802
  },
10802
10803
  floatBarRef: p
10803
10804
  }
10804
- ), [t, l, p]), N = G(() => a != null && a.canLock && c ? /* @__PURE__ */ w.createElement(
10805
+ ), [t, l, p]), v = G(() => a != null && a.canLock && c ? /* @__PURE__ */ w.createElement(
10805
10806
  Up,
10806
10807
  {
10807
10808
  workIds: e,
10808
10809
  mananger: c,
10809
10810
  islocked: a.isLocked
10810
10811
  }
10811
- ) : null, [a, c, e]), C = G(() => c && (c != null && c.viewId) && u && (a != null && a.shapeOpt) && (a != null && a.toolsTypes) ? /* @__PURE__ */ w.createElement(
10812
+ ) : null, [a, c, e]), j = G(() => c && (c != null && c.viewId) && u && (a != null && a.shapeOpt) && (a != null && a.toolsTypes) ? /* @__PURE__ */ w.createElement(
10812
10813
  Gp,
10813
10814
  {
10814
10815
  open: l === 8,
10815
- setOpen: (x) => {
10816
+ setOpen: (C) => {
10816
10817
  h(
10817
- x === !0 ? 8 : 0
10818
+ C === !0 ? 8 : 0
10818
10819
  /* ShapeOpt */
10819
10820
  );
10820
10821
  },
@@ -10824,7 +10825,7 @@ const Np = (o) => {
10824
10825
  shapeOpt: a.shapeOpt
10825
10826
  }
10826
10827
  ) : null, [a, c, l, u, e, p]);
10827
- return /* @__PURE__ */ w.createElement("div", { className: "appliance-plugin-floatbtns", style: u, ref: p }, c && !r && /* @__PURE__ */ w.createElement(Np, { workIds: e, mananger: c }), S, N, !!(c != null && c.viewId) && !s && /* @__PURE__ */ w.createElement(Tp, { workIds: e, viewId: c.viewId }), C, f, T, m, M, I, d);
10828
+ return /* @__PURE__ */ w.createElement("div", { className: "appliance-plugin-floatbtns", style: u, ref: p }, c && !r && /* @__PURE__ */ w.createElement(Np, { workIds: e, mananger: c }), S, v, !!(c != null && c.viewId) && !s && /* @__PURE__ */ w.createElement(Tp, { workIds: e, viewId: c.viewId }), j, f, N, m, M, I, d);
10828
10829
  }
10829
10830
  ), Jp = (o) => {
10830
10831
  const { data: i, workId: e, updateOptInfo: t, handlePointerDown: n, handlePointerUp: r } = o, { opt: s, scale: a, translate: c, x: l, y: h } = i, u = xe(null), { floatBarData: g } = Se(Te), p = G(() => {
@@ -10832,31 +10833,31 @@ const Np = (o) => {
10832
10833
  fontSize: m,
10833
10834
  fontFamily: M,
10834
10835
  underline: f,
10835
- fontColor: T,
10836
+ fontColor: N,
10836
10837
  lineThrough: S,
10837
- textAlign: N,
10838
- strokeColor: C,
10839
- lineHeight: x,
10838
+ textAlign: v,
10839
+ strokeColor: j,
10840
+ lineHeight: C,
10840
10841
  bold: k,
10841
- italic: E
10842
- } = s, L = x || m * 1.2, P = {
10842
+ italic: L
10843
+ } = s, E = C || m * 1.2, P = {
10843
10844
  fontSize: `${m}px`,
10844
- lineHeight: `${L}px`,
10845
+ lineHeight: `${E}px`,
10845
10846
  color: "transparent",
10846
- caretColor: T,
10847
- borderColor: C,
10848
- minHeight: `${L}px`,
10847
+ caretColor: N,
10848
+ borderColor: j,
10849
+ minHeight: `${E}px`,
10849
10850
  pointerEvents: "none",
10850
- paddingRight: `${E === "italic" ? Math.round(m * 0.3) : 5}px`
10851
+ paddingRight: `${L === "italic" ? Math.round(m * 0.3) : 5}px`
10851
10852
  };
10852
- return M && (P.fontFamily = `${M}`), (S || f) && (P.textDecoration = `${S && "line-through" || ""}${f && " underline" || ""}`), N && (P.textAlign = `${N}`), k && (P.fontWeight = `${k}`), E && (P.fontStyle = `${E}`), P;
10853
+ return M && (P.fontFamily = `${M}`), (S || f) && (P.textDecoration = `${S && "line-through" || ""}${f && " underline" || ""}`), v && (P.textAlign = `${v}`), k && (P.fontWeight = `${k}`), L && (P.fontStyle = `${L}`), P;
10853
10854
  }, [s]), d = G(() => {
10854
10855
  const m = [];
10855
10856
  if (s.text) {
10856
10857
  const M = Zi(s.text);
10857
10858
  for (let f = 0; f < M.length; f++) {
10858
- const T = M[f];
10859
- T === "" ? m.push(/* @__PURE__ */ w.createElement("div", { key: f })) : m.push(/* @__PURE__ */ w.createElement("div", { key: f }, T));
10859
+ const N = M[f];
10860
+ N === "" ? m.push(/* @__PURE__ */ w.createElement("div", { key: f })) : m.push(/* @__PURE__ */ w.createElement("div", { key: f }, N));
10860
10861
  }
10861
10862
  }
10862
10863
  return m.length ? m : /* @__PURE__ */ w.createElement("div", null);
@@ -10878,15 +10879,15 @@ const Np = (o) => {
10878
10879
  if ((m = u.current) != null && m.offsetWidth && ((M = u.current) != null && M.offsetHeight)) {
10879
10880
  const f = s.boxSize;
10880
10881
  if ((f == null ? void 0 : f[0]) !== u.current.offsetWidth || f[1] !== u.current.offsetHeight || !f) {
10881
- const T = [
10882
+ const N = [
10882
10883
  u.current.offsetWidth,
10883
10884
  u.current.offsetHeight
10884
10885
  ];
10885
10886
  t({
10886
10887
  activeTextId: e,
10887
10888
  update: {
10888
- boxSize: T,
10889
- workState: j.Done
10889
+ boxSize: N,
10890
+ workState: x.Done
10890
10891
  }
10891
10892
  });
10892
10893
  }
@@ -10970,45 +10971,45 @@ const Np = (o) => {
10970
10971
  } = o, { activeTextEditor: l, activeTextId: h, mananger: u } = Se(Te), { opt: g, scale: p, translate: d, x: I, y: m } = i, {
10971
10972
  fontSize: M,
10972
10973
  fontFamily: f,
10973
- underline: T,
10974
+ underline: N,
10974
10975
  fontColor: S,
10975
- lineThrough: N,
10976
- textAlign: C,
10977
- lineHeight: x,
10976
+ lineThrough: v,
10977
+ textAlign: j,
10978
+ lineHeight: C,
10978
10979
  bold: k,
10979
- italic: E
10980
- } = g, L = xe(null), P = G(() => {
10981
- const B = M, H = x || B * 1.2, K = {
10980
+ italic: L
10981
+ } = g, E = xe(null), P = G(() => {
10982
+ const B = M, H = C || B * 1.2, K = {
10982
10983
  fontSize: `${B}px`,
10983
10984
  lineHeight: `${H}px`,
10984
10985
  caretColor: S,
10985
10986
  color: "transparent",
10986
10987
  minHeight: `${H}px`,
10987
- paddingRight: `${E === "italic" ? Math.round(B * 0.3) : 5}px`,
10988
+ paddingRight: `${L === "italic" ? Math.round(B * 0.3) : 5}px`,
10988
10989
  borderWidth: 0
10989
10990
  };
10990
- return f && (K.fontFamily = `${f}`), (N || T) && (K.textDecoration = `${N && "line-through" || ""} ${T && " underline" || ""}`), C && (K.textAlign = `${C}`), k && (K.fontWeight = `${k}`), E && (K.fontStyle = `${E}`), K;
10991
+ return f && (K.fontFamily = `${f}`), (v || N) && (K.textDecoration = `${v && "line-through" || ""} ${N && " underline" || ""}`), j && (K.textAlign = `${j}`), k && (K.fontWeight = `${k}`), L && (K.fontStyle = `${L}`), K;
10991
10992
  }, [
10992
10993
  k,
10993
10994
  S,
10994
10995
  f,
10995
10996
  M,
10996
- E,
10997
- x,
10998
- N,
10999
- p,
10997
+ L,
11000
10998
  C,
11001
- T
10999
+ v,
11000
+ p,
11001
+ j,
11002
+ N
11002
11003
  ]), z = xe(!1), O = xe(6), D = xe({
11003
11004
  fontSize: P.fontSize,
11004
11005
  lineHeight: P.lineHeight,
11005
11006
  fontStyle: P.fontStyle,
11006
11007
  fontWeight: P.fontWeight,
11007
11008
  fontFamily: P.fontFamily
11008
- }), F = G(() => h === e ? "hover" : g.workState === j.Doing || g.workState === j.Start ? "editing" : l ? "active" : "none", [h, e, g.workState, l]);
11009
+ }), F = G(() => h === e ? "hover" : g.workState === x.Doing || g.workState === x.Start ? "editing" : l ? "active" : "none", [h, e, g.workState, l]);
11009
11010
  function _(B) {
11010
- if (L.current) {
11011
- const H = window == null ? void 0 : window.getSelection(), K = L.current, he = (ge, ye) => {
11011
+ if (E.current) {
11012
+ const H = window == null ? void 0 : window.getSelection(), K = E.current, he = (ge, ye) => {
11012
11013
  var de;
11013
11014
  const Ie = document.createRange();
11014
11015
  if (ye.childNodes.length > 0) {
@@ -11039,7 +11040,7 @@ const Np = (o) => {
11039
11040
  he(H, K);
11040
11041
  } else
11041
11042
  he(H, K);
11042
- L.current.focus();
11043
+ E.current.focus();
11043
11044
  }
11044
11045
  }
11045
11046
  const W = G(() => {
@@ -11104,14 +11105,14 @@ const Np = (o) => {
11104
11105
  return null;
11105
11106
  }, [g, t, e, I, m, p, F]);
11106
11107
  fe(() => {
11107
- h === e && L.current && (document.activeElement !== L.current && _(), r(L.current));
11108
+ h === e && E.current && (document.activeElement !== E.current && _(), r(E.current));
11108
11109
  }, [h, r, e]), fe(() => {
11109
- if (L.current) {
11110
- const B = parseInt(getComputedStyle(L.current).paddingRight, 10) + parseInt(getComputedStyle(L.current).borderWidth, 10);
11110
+ if (E.current) {
11111
+ const B = parseInt(getComputedStyle(E.current).paddingRight, 10) + parseInt(getComputedStyle(E.current).borderWidth, 10);
11111
11112
  O.current = Number(B);
11112
11113
  }
11113
11114
  }, []), fe(() => {
11114
- if (L.current) {
11115
+ if (E.current) {
11115
11116
  const B = {
11116
11117
  fontSize: P.fontSize,
11117
11118
  lineHeight: P.lineHeight,
@@ -11122,8 +11123,8 @@ const Np = (o) => {
11122
11123
  if (!ce(D.current, B)) {
11123
11124
  D.current = B;
11124
11125
  const H = [
11125
- L.current.offsetWidth,
11126
- L.current.offsetHeight
11126
+ E.current.offsetWidth,
11127
+ E.current.offsetHeight
11127
11128
  ];
11128
11129
  a(e, H);
11129
11130
  }
@@ -11133,8 +11134,8 @@ const Np = (o) => {
11133
11134
  (B) => {
11134
11135
  var ye, Ie;
11135
11136
  const H = u == null ? void 0 : u.parentElement;
11136
- if (!H || !L.current || !c) return !1;
11137
- const K = L.current.lastChild;
11137
+ if (!H || !E.current || !c) return !1;
11138
+ const K = E.current.lastChild;
11138
11139
  if (!K || K instanceof Text)
11139
11140
  return !1;
11140
11141
  const he = K == null ? void 0 : K.getBoundingClientRect(), ge = H == null ? void 0 : H.getBoundingClientRect();
@@ -11184,7 +11185,7 @@ const Np = (o) => {
11184
11185
  const Ee = ((ye = de.textContent) == null ? void 0 : ye.slice(0, Pe)) || "", ct = ((Ie = de.textContent) == null ? void 0 : Ie.slice(Pe)) || "";
11185
11186
  de.textContent = Ee;
11186
11187
  const mt = document.createElement("div");
11187
- return g.fontBgColor && (mt.style.backgroundColor = g.fontBgColor), ct && (mt.textContent = ct), L.current.appendChild(mt), le(B), !0;
11188
+ return g.fontBgColor && (mt.style.backgroundColor = g.fontBgColor), ct && (mt.textContent = ct), E.current.appendChild(mt), le(B), !0;
11188
11189
  }
11189
11190
  }
11190
11191
  return !1;
@@ -11243,7 +11244,7 @@ const Np = (o) => {
11243
11244
  }
11244
11245
  }
11245
11246
  function Me(B) {
11246
- if (B.cancelable && B.preventDefault(), B.stopPropagation(), B.nativeEvent.stopImmediatePropagation(), L.current) {
11247
+ if (B.cancelable && B.preventDefault(), B.stopPropagation(), B.nativeEvent.stopImmediatePropagation(), E.current) {
11247
11248
  const H = (B.clipboardData || window.clipboardData).getData("text"), K = window == null ? void 0 : window.getSelection();
11248
11249
  if (!(K != null && K.rangeCount)) return;
11249
11250
  if (H && K && K.anchorNode) {
@@ -11255,7 +11256,7 @@ const Np = (o) => {
11255
11256
  stripIgnoreTagBody: ["script"]
11256
11257
  // script标签较特殊,需要过滤标签中间的内容
11257
11258
  });
11258
- X(he, L.current), le((p || 1) * O.current), n(L.current);
11259
+ X(he, E.current), le((p || 1) * O.current), n(E.current);
11259
11260
  }
11260
11261
  s();
11261
11262
  }
@@ -11282,13 +11283,13 @@ const Np = (o) => {
11282
11283
  }
11283
11284
  }
11284
11285
  const Xe = yt(() => {
11285
- const B = L.current;
11286
+ const B = E.current;
11286
11287
  s(() => {
11287
11288
  if (B) {
11288
11289
  if (Je(B), !z.current && le((p || 1) * O.current)) {
11289
11290
  const H = window.getSelection();
11290
11291
  if (!(H != null && H.rangeCount)) return !1;
11291
- const K = document.createRange(), he = L.current.lastChild;
11292
+ const K = document.createRange(), he = E.current.lastChild;
11292
11293
  K.selectNodeContents(he), K.collapse(!1), H.removeAllRanges(), H.addRange(K);
11293
11294
  }
11294
11295
  n(B);
@@ -11305,13 +11306,13 @@ const Np = (o) => {
11305
11306
  Xe(), s();
11306
11307
  }
11307
11308
  const qe = yt(() => {
11308
- if (F === "active" && L.current && L.current.parentElement) {
11309
- const B = L.current.parentElement;
11309
+ if (F === "active" && E.current && E.current.parentElement) {
11310
+ const B = E.current.parentElement;
11310
11311
  B.style.borderColor = S;
11311
11312
  }
11312
11313
  }, [F, S]), V = yt(() => {
11313
- if (F === "active" && L.current && L.current.parentElement) {
11314
- const B = L.current.parentElement;
11314
+ if (F === "active" && E.current && E.current.parentElement) {
11315
+ const B = E.current.parentElement;
11315
11316
  B.style.borderColor = "transparent";
11316
11317
  }
11317
11318
  }, [F]);
@@ -11356,7 +11357,7 @@ const Np = (o) => {
11356
11357
  suppressContentEditableWarning: !0,
11357
11358
  contentEditable: !0,
11358
11359
  className: "editor",
11359
- ref: L,
11360
+ ref: E,
11360
11361
  style: P,
11361
11362
  onKeyDown: oe,
11362
11363
  onPaste: Me,
@@ -11413,7 +11414,7 @@ const Np = (o) => {
11413
11414
  return p;
11414
11415
  }, a = (g) => {
11415
11416
  if (!e) return;
11416
- const p = g.id, d = e.control.textEditorManager.get(p), I = j.Doing, m = [
11417
+ const p = g.id, d = e.control.textEditorManager.get(p), I = x.Doing, m = [
11417
11418
  g.offsetWidth,
11418
11419
  g.offsetHeight
11419
11420
  ];
@@ -11429,24 +11430,24 @@ const Np = (o) => {
11429
11430
  }
11430
11431
  });
11431
11432
  }, c = (g) => {
11432
- var T, S;
11433
+ var N, S;
11433
11434
  if (!e) return;
11434
- const p = s(g), d = g.id, I = e.control.textEditorManager.get(d), m = qt(p), M = j.Doing, f = [g.offsetWidth, g.offsetHeight];
11435
+ const p = s(g), d = g.id, I = e.control.textEditorManager.get(d), m = qt(p), M = x.Doing, f = [g.offsetWidth, g.offsetHeight];
11435
11436
  if (!I || I && (I.opt.text !== m || !ce(I.opt.boxSize, f) || !ce(I.opt.workState, M))) {
11436
- const N = d && ae(
11437
- ((T = e.control.textEditorManager) == null ? void 0 : T.get(d)) || ((S = o.editors) == null ? void 0 : S.get(d))
11437
+ const v = d && ae(
11438
+ ((N = e.control.textEditorManager) == null ? void 0 : N.get(d)) || ((S = o.editors) == null ? void 0 : S.get(d))
11438
11439
  );
11439
- N && N.opt && (N.opt = {
11440
- ...N.opt,
11440
+ v && v.opt && (v.opt = {
11441
+ ...v.opt,
11441
11442
  text: m,
11442
11443
  boxSize: f,
11443
11444
  workState: M
11444
- }, N.canSync = !0, N.canWorker = !0, e.control.textEditorManager.updateForViewEdited(d, N)), e.control.textEditorManager.publicMsgEmitter.emit(
11445
+ }, v.canSync = !0, v.canWorker = !0, e.control.textEditorManager.updateForViewEdited(d, v)), e.control.textEditorManager.publicMsgEmitter.emit(
11445
11446
  "textChange",
11446
11447
  d,
11447
11448
  g,
11448
11449
  p,
11449
- N
11450
+ v
11450
11451
  );
11451
11452
  }
11452
11453
  }, l = (g, p) => {
@@ -11673,15 +11674,15 @@ const Np = (o) => {
11673
11674
  );
11674
11675
  }, oy = (o) => {
11675
11676
  const { className: i } = o, { floatBarData: e, angle: t, setAngle: n, setOperationType: r, mananger: s } = Se(Te), [a, c] = se(
11676
- j.Pending
11677
- ), [l, h] = se(), [u, g] = se(!1), [p, d] = se(new Ce()), [I, m] = se(new Ce()), [M, f] = se(!1), T = xe(0), S = xe(null), N = (L) => {
11678
- if (!L) {
11679
- f(!0), g(!1), r(U.None), c(j.Pending);
11677
+ x.Pending
11678
+ ), [l, h] = se(), [u, g] = se(!1), [p, d] = se(new Ce()), [I, m] = se(new Ce()), [M, f] = se(!1), N = xe(0), S = xe(null), v = (E) => {
11679
+ if (!E) {
11680
+ f(!0), g(!1), r(U.None), c(x.Pending);
11680
11681
  return;
11681
11682
  }
11682
11683
  f(!1);
11683
- }, C = (L, P) => {
11684
- T.current && (clearTimeout(T.current), T.current = 0), c(j.Done), g(!1);
11684
+ }, j = (E, P) => {
11685
+ N.current && (clearTimeout(N.current), N.current = 0), c(x.Done), g(!1);
11685
11686
  const z = Math.round(
11686
11687
  Ce.GetAngleByPoints(
11687
11688
  p,
@@ -11695,31 +11696,31 @@ const Np = (o) => {
11695
11696
  {
11696
11697
  workIds: [Z],
11697
11698
  angle: z,
11698
- workState: j.Done,
11699
+ workState: x.Done,
11699
11700
  viewId: s == null ? void 0 : s.viewId
11700
11701
  }
11701
11702
  ), s == null || s.focusElement();
11702
11703
  };
11703
- fe(() => (re.activeListener(N), () => {
11704
- re.unmountActiveListener(N);
11704
+ fe(() => (re.activeListener(v), () => {
11705
+ re.unmountActiveListener(v);
11705
11706
  }), []), fe(() => {
11706
- if (e && (a === j.Pending || a === j.Done)) {
11707
- const L = {
11707
+ if (e && (a === x.Pending || a === x.Done)) {
11708
+ const E = {
11708
11709
  x: (e == null ? void 0 : e.x) - 20,
11709
11710
  y: (e == null ? void 0 : e.y) + (e == null ? void 0 : e.h)
11710
11711
  }, P = {
11711
11712
  x: (e == null ? void 0 : e.x) + (e == null ? void 0 : e.w) / 2,
11712
11713
  y: (e == null ? void 0 : e.y) + (e == null ? void 0 : e.h) / 2
11713
11714
  };
11714
- m(new Ce(P.x, P.y)), d(new Ce(L.x, L.y)), h({ x: L.x, y: L.y });
11715
+ m(new Ce(P.x, P.y)), d(new Ce(E.x, E.y)), h({ x: E.x, y: E.y });
11715
11716
  }
11716
11717
  }, [e, a]);
11717
- const x = (L, P) => {
11718
+ const C = (E, P) => {
11718
11719
  if (s != null && s.control.worker.isBusy) {
11719
- f(!0), c(j.Pending);
11720
+ f(!0), c(x.Pending);
11720
11721
  return;
11721
11722
  }
11722
- T.current && (clearTimeout(T.current), T.current = 0), c(j.Start), g(!0);
11723
+ N.current && (clearTimeout(N.current), N.current = 0), c(x.Start), g(!0);
11723
11724
  const z = Math.round(
11724
11725
  Ce.GetAngleByPoints(
11725
11726
  p,
@@ -11733,23 +11734,23 @@ const Np = (o) => {
11733
11734
  {
11734
11735
  workIds: [Z],
11735
11736
  angle: 0,
11736
- workState: j.Start,
11737
+ workState: x.Start,
11737
11738
  viewId: s == null ? void 0 : s.viewId
11738
11739
  }
11739
11740
  );
11740
- }, k = (L, P) => {
11741
+ }, k = (E, P) => {
11741
11742
  if (s != null && s.control.worker.isBusy) {
11742
- f(!0), C(L, P);
11743
+ f(!0), j(E, P);
11743
11744
  return;
11744
11745
  }
11745
- C(L, P);
11746
- }, E = (L, P) => {
11746
+ j(E, P);
11747
+ }, L = (E, P) => {
11747
11748
  if (s != null && s.control.worker.isBusy) {
11748
- f(!0), C(L, P);
11749
+ f(!0), j(E, P);
11749
11750
  return;
11750
11751
  }
11751
- T.current || (h({ x: P.x, y: P.y }), g(!0), T.current = setTimeout(() => {
11752
- T.current = 0;
11752
+ N.current || (h({ x: P.x, y: P.y }), g(!0), N.current = setTimeout(() => {
11753
+ N.current = 0;
11753
11754
  const z = Math.round(
11754
11755
  Ce.GetAngleByPoints(
11755
11756
  p,
@@ -11757,13 +11758,13 @@ const Np = (o) => {
11757
11758
  new Ce(P.x, P.y)
11758
11759
  )
11759
11760
  ) || 0;
11760
- n(z), r(U.RotateNode), c(j.Doing), re.emitMethod(
11761
+ n(z), r(U.RotateNode), c(x.Doing), re.emitMethod(
11761
11762
  ee.MainEngine,
11762
11763
  U.RotateNode,
11763
11764
  {
11764
11765
  workIds: [Z],
11765
11766
  angle: z,
11766
- workState: j.Doing,
11767
+ workState: x.Doing,
11767
11768
  viewId: s == null ? void 0 : s.viewId
11768
11769
  }
11769
11770
  );
@@ -11774,8 +11775,8 @@ const Np = (o) => {
11774
11775
  {
11775
11776
  disabled: M,
11776
11777
  position: l,
11777
- onStart: x,
11778
- onDrag: E,
11778
+ onStart: C,
11779
+ onDrag: L,
11779
11780
  onStop: k
11780
11781
  },
11781
11782
  /* @__PURE__ */ w.createElement(
@@ -11809,7 +11810,7 @@ const Np = (o) => {
11809
11810
  );
11810
11811
  }, ry = w.memo(
11811
11812
  (o) => {
11812
- const { editors: i, canSelectorSwitch: e } = o, { floatBarData: t, setOperationType: n, mananger: r, isNoPointerEvents: s } = Se(Te), [a, c] = se(), [l, h] = se(!1), u = xe(0), g = xe(), p = xe(j.Pending), d = G(() => !!((t == null ? void 0 : t.scaleType) === Fe.none && (t != null && t.canLock)), [t]), I = G(() => t && t.w && t.h ? {
11813
+ const { editors: i, canSelectorSwitch: e } = o, { floatBarData: t, setOperationType: n, mananger: r, isNoPointerEvents: s } = Se(Te), [a, c] = se(), [l, h] = se(!1), u = xe(0), g = xe(), p = xe(x.Pending), d = G(() => !!((t == null ? void 0 : t.scaleType) === Fe.none && (t != null && t.canLock)), [t]), I = G(() => t && t.w && t.h ? {
11813
11814
  position: "absolute",
11814
11815
  left: 0,
11815
11816
  top: 0,
@@ -11818,22 +11819,22 @@ const Np = (o) => {
11818
11819
  zIndex: 2,
11819
11820
  pointerEvents: d || s ? "none" : "auto",
11820
11821
  touchAction: "none"
11821
- } : { display: "none", pointerEvents: "none" }, [t, d, s]), m = (x) => {
11822
- if (!x || t != null && t.isLocked) {
11823
- h(!0), p.current = j.Pending, n(U.None);
11822
+ } : { display: "none", pointerEvents: "none" }, [t, d, s]), m = (C) => {
11823
+ if (!C || t != null && t.isLocked) {
11824
+ h(!0), p.current = x.Pending, n(U.None);
11824
11825
  return;
11825
11826
  }
11826
11827
  h(!1);
11827
- }, M = (x, k) => {
11828
+ }, M = (C, k) => {
11828
11829
  u.current && (clearTimeout(u.current), u.current = 0);
11829
- const E = { x: k.x, y: k.y };
11830
- n(U.None), p.current = j.Done, c(E), re.emitMethod(
11830
+ const L = { x: k.x, y: k.y };
11831
+ n(U.None), p.current = x.Done, c(L), re.emitMethod(
11831
11832
  ee.MainEngine,
11832
11833
  U.TranslateNode,
11833
11834
  {
11834
11835
  workIds: [Z],
11835
- position: E,
11836
- workState: j.Done,
11836
+ position: L,
11837
+ workState: x.Done,
11837
11838
  viewId: r == null ? void 0 : r.viewId
11838
11839
  }
11839
11840
  );
@@ -11847,58 +11848,58 @@ const Np = (o) => {
11847
11848
  }
11848
11849
  h(!1);
11849
11850
  }, [t, r == null ? void 0 : r.control.worker.isBusy]), fe(() => {
11850
- (p.current === j.Pending || p.current === j.Done) && te(t == null ? void 0 : t.x) && te(t == null ? void 0 : t.y) && c({ x: t == null ? void 0 : t.x, y: t == null ? void 0 : t.y });
11851
+ (p.current === x.Pending || p.current === x.Done) && te(t == null ? void 0 : t.x) && te(t == null ? void 0 : t.y) && c({ x: t == null ? void 0 : t.x, y: t == null ? void 0 : t.y });
11851
11852
  }, [t == null ? void 0 : t.x, t == null ? void 0 : t.y]);
11852
11853
  const f = () => {
11853
11854
  if (r != null && r.control.worker.isBusy) {
11854
11855
  h(!0);
11855
11856
  return;
11856
11857
  }
11857
- u.current && (clearTimeout(u.current), u.current = 0), te(t == null ? void 0 : t.x) && te(t == null ? void 0 : t.y) && (n(U.TranslateNode), p.current = j.Start, re.emitMethod(
11858
+ u.current && (clearTimeout(u.current), u.current = 0), te(t == null ? void 0 : t.x) && te(t == null ? void 0 : t.y) && (n(U.TranslateNode), p.current = x.Start, re.emitMethod(
11858
11859
  ee.MainEngine,
11859
11860
  U.TranslateNode,
11860
11861
  {
11861
11862
  workIds: [Z],
11862
11863
  position: { x: t == null ? void 0 : t.x, y: t == null ? void 0 : t.y },
11863
- workState: j.Start,
11864
+ workState: x.Start,
11864
11865
  viewId: r == null ? void 0 : r.viewId
11865
11866
  }
11866
11867
  ));
11867
- }, T = (x, k) => {
11868
+ }, N = (C, k) => {
11868
11869
  var P;
11869
11870
  r != null && r.control.worker.isBusy && h(!0);
11870
- const E = p.current, L = g.current;
11871
- if (M(x, k), g.current && (g.current = void 0), E === j.Start && (i != null && i.size) && L) {
11871
+ const L = p.current, E = g.current;
11872
+ if (M(C, k), g.current && (g.current = void 0), L === x.Start && (i != null && i.size) && E) {
11872
11873
  const z = (P = r == null ? void 0 : r.control.viewContainerManager.getView(
11873
11874
  r.viewId
11874
11875
  )) == null ? void 0 : P.focusScenePath;
11875
11876
  z && (r == null || r.control.worker.blurSelector(r.viewId, z));
11876
11877
  }
11877
11878
  r == null || r.focusElement();
11878
- }, S = (x, k) => {
11879
+ }, S = (C, k) => {
11879
11880
  if (r != null && r.control.worker.isBusy) {
11880
- h(!0), M(x, k);
11881
+ h(!0), M(C, k);
11881
11882
  return;
11882
11883
  }
11883
11884
  if (u.current)
11884
11885
  return;
11885
- const E = { x: k.x, y: k.y };
11886
- c(E), u.current = setTimeout(() => {
11887
- u.current = 0, (E.x !== (a == null ? void 0 : a.x) || E.y !== (a == null ? void 0 : a.y)) && (g.current && (g.current = void 0), p.current = j.Doing, re.emitMethod(
11886
+ const L = { x: k.x, y: k.y };
11887
+ c(L), u.current = setTimeout(() => {
11888
+ u.current = 0, (L.x !== (a == null ? void 0 : a.x) || L.y !== (a == null ? void 0 : a.y)) && (g.current && (g.current = void 0), p.current = x.Doing, re.emitMethod(
11888
11889
  ee.MainEngine,
11889
11890
  U.TranslateNode,
11890
11891
  {
11891
11892
  workIds: [Z],
11892
- position: E,
11893
- workState: j.Doing,
11893
+ position: L,
11894
+ workState: x.Doing,
11894
11895
  viewId: r == null ? void 0 : r.viewId
11895
11896
  }
11896
11897
  ));
11897
11898
  }, 60);
11898
- }, N = (x) => {
11899
- e && (g.current = x);
11900
- }, C = () => {
11901
- r && e && p.current === j.Start && g.current && r.control.textEditorManager.active(g.current);
11899
+ }, v = (C) => {
11900
+ e && (g.current = C);
11901
+ }, j = () => {
11902
+ r && e && p.current === x.Start && g.current && r.control.textEditorManager.active(g.current);
11902
11903
  };
11903
11904
  return /* @__PURE__ */ w.createElement(
11904
11905
  Ct,
@@ -11907,15 +11908,15 @@ const Np = (o) => {
11907
11908
  position: a,
11908
11909
  onStart: f,
11909
11910
  onDrag: S,
11910
- onStop: T
11911
+ onStop: N
11911
11912
  },
11912
11913
  /* @__PURE__ */ w.createElement("div", { style: I }, /* @__PURE__ */ w.createElement(
11913
11914
  sy,
11914
11915
  {
11915
11916
  editors: i,
11916
11917
  selectIds: (t == null ? void 0 : t.selectIds) || [],
11917
- handleTextEditorPointerDown: N,
11918
- handleTextEditorPointerUp: C
11918
+ handleTextEditorPointerDown: v,
11919
+ handleTextEditorPointerUp: j
11919
11920
  }
11920
11921
  ))
11921
11922
  );
@@ -11962,7 +11963,7 @@ const Np = (o) => {
11962
11963
  }
11963
11964
  M(!1);
11964
11965
  }, [u == null ? void 0 : u.control.worker.isBusy]);
11965
- const T = () => {
11966
+ const N = () => {
11966
11967
  if (f.current && (clearTimeout(f.current), f.current = 0), d) {
11967
11968
  const { scale: P, translate: z } = d;
11968
11969
  p(U.None), re.emitMethod(
@@ -11975,7 +11976,7 @@ const Np = (o) => {
11975
11976
  translate: z,
11976
11977
  originPoint: n,
11977
11978
  scenePoint: s,
11978
- workState: j.Done,
11979
+ workState: x.Done,
11979
11980
  viewId: u == null ? void 0 : u.viewId
11980
11981
  }
11981
11982
  );
@@ -11987,12 +11988,12 @@ const Np = (o) => {
11987
11988
  return;
11988
11989
  }
11989
11990
  M(!1);
11990
- }, N = (P) => [
11991
+ }, v = (P) => [
11991
11992
  [P.x, P.y],
11992
11993
  [P.x + P.w, P.y],
11993
11994
  [P.x + P.w, P.y + P.h],
11994
11995
  [P.x, P.y + P.h]
11995
- ], C = (P, z) => {
11996
+ ], j = (P, z) => {
11996
11997
  switch (z) {
11997
11998
  case "top":
11998
11999
  case "topLeft":
@@ -12007,7 +12008,7 @@ const Np = (o) => {
12007
12008
  case "bottomLeft":
12008
12009
  return P[1];
12009
12010
  }
12010
- }, x = (P, z, O, D) => {
12011
+ }, C = (P, z, O, D) => {
12011
12012
  let F = !1, _ = !1;
12012
12013
  const W = {
12013
12014
  x: e.x,
@@ -12066,12 +12067,12 @@ const Np = (o) => {
12066
12067
  }
12067
12068
  }
12068
12069
  J[0] = W.w / e.w, J[1] = W.h / e.h;
12069
- const oe = N(W).map(
12070
+ const oe = v(W).map(
12070
12071
  ($) => O.control.viewContainerManager.transformToScenePoint(
12071
12072
  $,
12072
12073
  O.viewId
12073
12074
  )
12074
- ), X = C(oe, P);
12075
+ ), X = j(oe, P);
12075
12076
  return _ && (ne[1] = X[1] - D[1]), F && (ne[0] = X[0] - D[0]), { scale: J, translate: ne };
12076
12077
  }, k = (P, z) => {
12077
12078
  if (f.current && (clearTimeout(f.current), f.current = 0), u != null && u.control.worker.isBusy) {
@@ -12084,12 +12085,12 @@ const Np = (o) => {
12084
12085
  y: h.y,
12085
12086
  w: h.w,
12086
12087
  h: h.h
12087
- }, D = N(O), F = D.map(
12088
+ }, D = v(O), F = D.map(
12088
12089
  (J) => u.control.viewContainerManager.transformToScenePoint(
12089
12090
  J,
12090
12091
  u.viewId
12091
12092
  )
12092
- ), _ = C(D, z), W = C(F, z);
12093
+ ), _ = j(D, z), W = j(F, z);
12093
12094
  t(O), r(_), a(W), l(z), p(U.ScaleNode), re.emitMethod(
12094
12095
  ee.MainEngine,
12095
12096
  U.ScaleNode,
@@ -12097,20 +12098,20 @@ const Np = (o) => {
12097
12098
  workIds: [Z],
12098
12099
  originPoint: _,
12099
12100
  scenePoint: W,
12100
- workState: j.Start,
12101
+ workState: x.Start,
12101
12102
  viewId: u.viewId
12102
12103
  }
12103
12104
  );
12104
12105
  }
12105
- }, E = (P, z, O, D) => {
12106
+ }, L = (P, z, O, D) => {
12106
12107
  if (!(!u || !n || !s)) {
12107
12108
  if (u != null && u.control.worker.isBusy) {
12108
- M(!0), T();
12109
+ M(!0), N();
12109
12110
  return;
12110
12111
  }
12111
12112
  f.current || (f.current = setTimeout(() => {
12112
12113
  f.current = 0;
12113
- const { scale: F, translate: _ } = x(z, D, u, s);
12114
+ const { scale: F, translate: _ } = C(z, D, u, s);
12114
12115
  (!ce(F, d == null ? void 0 : d.scale) || !ce(_, d == null ? void 0 : d.translate)) && (I({ scale: F, translate: _ }), p(U.ScaleNode), re.emitMethod(
12115
12116
  ee.MainEngine,
12116
12117
  U.ScaleNode,
@@ -12121,14 +12122,14 @@ const Np = (o) => {
12121
12122
  translate: _,
12122
12123
  originPoint: n,
12123
12124
  scenePoint: s,
12124
- workState: j.Doing,
12125
+ workState: x.Doing,
12125
12126
  viewId: u.viewId
12126
12127
  }
12127
12128
  ));
12128
12129
  }, 60));
12129
12130
  }
12130
- }, L = () => {
12131
- u != null && u.control.worker.isBusy && M(!0), T();
12131
+ }, E = () => {
12132
+ u != null && u.control.worker.isBusy && M(!0), N();
12132
12133
  };
12133
12134
  return /* @__PURE__ */ w.createElement(
12134
12135
  Ro,
@@ -12159,8 +12160,8 @@ const Np = (o) => {
12159
12160
  },
12160
12161
  lockAspectRatio: (h == null ? void 0 : h.scaleType) === Fe.proportional,
12161
12162
  onResizeStart: k,
12162
- onResize: E,
12163
- onResizeStop: L
12163
+ onResize: L,
12164
+ onResizeStop: E
12164
12165
  }
12165
12166
  );
12166
12167
  }, Yn = (o) => {
@@ -12168,13 +12169,13 @@ const Np = (o) => {
12168
12169
  x: 0,
12169
12170
  y: 0
12170
12171
  }), [h, u] = se(
12171
- j.Pending
12172
+ x.Pending
12172
12173
  ), [g, p] = se(!1), d = xe(0), I = G(() => a ? {
12173
12174
  left: 0,
12174
12175
  top: 0
12175
- } : {}, [a]), m = (N) => {
12176
- if (!N || a != null && a.isLocked) {
12177
- p(!0), u(j.Pending), r(U.None);
12176
+ } : {}, [a]), m = (v) => {
12177
+ if (!v || a != null && a.isLocked) {
12178
+ p(!0), u(x.Pending), r(U.None);
12178
12179
  return;
12179
12180
  }
12180
12181
  p(!1);
@@ -12182,7 +12183,7 @@ const Np = (o) => {
12182
12183
  fe(() => (re.activeListener(m), () => {
12183
12184
  re.unmountActiveListener(m);
12184
12185
  }), []), fe(() => {
12185
- te(e.x) && te(e.y) && (h === j.Pending || h === j.Done) && l({ x: e.x, y: e.y });
12186
+ te(e.x) && te(e.y) && (h === x.Pending || h === x.Done) && l({ x: e.x, y: e.y });
12186
12187
  }, [e, h]), fe(() => {
12187
12188
  if (a && (a != null && a.isLocked) || s != null && s.control.worker.isBusy) {
12188
12189
  p(!0);
@@ -12190,21 +12191,21 @@ const Np = (o) => {
12190
12191
  }
12191
12192
  p(!1);
12192
12193
  }, [a, s == null ? void 0 : s.control.worker.isBusy]);
12193
- const M = (N, C) => {
12194
- d.current && (clearTimeout(d.current), d.current = 0), r(U.None), u(j.Done);
12195
- const x = { x: C.x, y: C.y };
12196
- if (l(x), s != null && s.control.viewContainerManager) {
12194
+ const M = (v, j) => {
12195
+ d.current && (clearTimeout(d.current), d.current = 0), r(U.None), u(x.Done);
12196
+ const C = { x: j.x, y: j.y };
12197
+ if (l(C), s != null && s.control.viewContainerManager) {
12197
12198
  const k = s.control.viewContainerManager.transformToScenePoint(
12198
- [x.x, x.y],
12199
+ [C.x, C.y],
12199
12200
  s.viewId
12200
- ), E = t.get(i);
12201
- E && n === "start" ? E[0] = k : E && n === "end" && (E[1] = k), re.emitMethod(
12201
+ ), L = t.get(i);
12202
+ L && n === "start" ? L[0] = k : L && n === "end" && (L[1] = k), re.emitMethod(
12202
12203
  ee.MainEngine,
12203
12204
  U.SetPoint,
12204
12205
  {
12205
12206
  workId: Z,
12206
12207
  pointMap: t,
12207
- workState: j.Done,
12208
+ workState: x.Done,
12208
12209
  viewId: s == null ? void 0 : s.viewId
12209
12210
  }
12210
12211
  );
@@ -12215,44 +12216,44 @@ const Np = (o) => {
12215
12216
  p(!0);
12216
12217
  return;
12217
12218
  }
12218
- te(e.x) && te(e.y) && (r(U.SetPoint), u(j.Start), re.emitMethod(
12219
+ te(e.x) && te(e.y) && (r(U.SetPoint), u(x.Start), re.emitMethod(
12219
12220
  ee.MainEngine,
12220
12221
  U.SetPoint,
12221
12222
  {
12222
12223
  workId: Z,
12223
12224
  pointMap: t,
12224
- workState: j.Start,
12225
+ workState: x.Start,
12225
12226
  viewId: s == null ? void 0 : s.viewId
12226
12227
  }
12227
12228
  ));
12228
- }, T = (N, C) => {
12229
+ }, N = (v, j) => {
12229
12230
  if (s != null && s.control.worker.isBusy) {
12230
- p(!0), M(N, C);
12231
+ p(!0), M(v, j);
12231
12232
  return;
12232
12233
  }
12233
12234
  if (d.current)
12234
12235
  return;
12235
- const x = { x: C.x, y: C.y };
12236
- l(x), d.current = setTimeout(() => {
12237
- if (d.current = 0, (x.x !== (C == null ? void 0 : C.x) || x.y !== (C == null ? void 0 : C.y)) && (s != null && s.control.viewContainerManager)) {
12236
+ const C = { x: j.x, y: j.y };
12237
+ l(C), d.current = setTimeout(() => {
12238
+ if (d.current = 0, (C.x !== (j == null ? void 0 : j.x) || C.y !== (j == null ? void 0 : j.y)) && (s != null && s.control.viewContainerManager)) {
12238
12239
  const k = s.control.viewContainerManager.transformToScenePoint(
12239
- [x.x, x.y],
12240
+ [C.x, C.y],
12240
12241
  s.viewId
12241
- ), E = t.get(i);
12242
- E && n === "start" ? E[0] = k : E && n === "end" && (E[1] = k), u(j.Doing), re.emitMethod(
12242
+ ), L = t.get(i);
12243
+ L && n === "start" ? L[0] = k : L && n === "end" && (L[1] = k), u(x.Doing), re.emitMethod(
12243
12244
  ee.MainEngine,
12244
12245
  U.SetPoint,
12245
12246
  {
12246
12247
  workId: Z,
12247
12248
  pointMap: t,
12248
- workState: j.Doing,
12249
+ workState: x.Doing,
12249
12250
  viewId: s == null ? void 0 : s.viewId
12250
12251
  }
12251
12252
  );
12252
12253
  }
12253
12254
  }, 60);
12254
- }, S = (N, C) => {
12255
- s != null && s.control.worker.isBusy && p(!0), M(N, C);
12255
+ }, S = (v, j) => {
12256
+ s != null && s.control.worker.isBusy && p(!0), M(v, j);
12256
12257
  };
12257
12258
  return /* @__PURE__ */ w.createElement(
12258
12259
  Ct,
@@ -12260,7 +12261,7 @@ const Np = (o) => {
12260
12261
  disabled: g,
12261
12262
  position: c,
12262
12263
  onStart: f,
12263
- onDrag: T,
12264
+ onDrag: N,
12264
12265
  onStop: S
12265
12266
  },
12266
12267
  /* @__PURE__ */ w.createElement(
@@ -12672,40 +12673,40 @@ const fy = (o) => {
12672
12673
  const { width: p, height: d } = r.getBoundingClientRect(), I = Math.min(
12673
12674
  p / u.width,
12674
12675
  d / u.height
12675
- ), m = g.width / g.scale, M = g.height / g.scale, f = [g.centerX, g.centerY], T = [
12676
+ ), m = g.width / g.scale, M = g.height / g.scale, f = [g.centerX, g.centerY], N = [
12676
12677
  u.centerX,
12677
12678
  u.centerY
12678
12679
  ], S = [
12679
- f[0] - T[0],
12680
- f[1] - T[1]
12681
- ], N = Math.min(
12680
+ f[0] - N[0],
12681
+ f[1] - N[1]
12682
+ ], v = Math.min(
12682
12683
  u.scale * I,
12683
12684
  u.scale * I
12684
- ), C = [
12685
- S[0] * N,
12686
- S[1] * N,
12685
+ ), j = [
12686
+ S[0] * v,
12687
+ S[1] * v,
12687
12688
  m,
12688
12689
  M,
12689
- N
12690
+ v
12690
12691
  ];
12691
- a(C);
12692
+ a(j);
12692
12693
  }, h = (u) => {
12693
12694
  var g;
12694
12695
  if (n.control.renderControl.isWritable) {
12695
12696
  const p = u.nativeEvent.target || u.nativeEvent.srcElement;
12696
12697
  if (p && u.nativeEvent && s) {
12697
- const { width: d, height: I } = p.getBoundingClientRect(), [m, M] = [d / 2, I / 2], [f, T] = [
12698
+ const { width: d, height: I } = p.getBoundingClientRect(), [m, M] = [d / 2, I / 2], [f, N] = [
12698
12699
  (u.nativeEvent.offsetX - m) / s[4],
12699
12700
  (u.nativeEvent.offsetY - M) / s[4]
12700
12701
  ], S = n.maps.get(i);
12701
12702
  if (S != null && S.viewCamera) {
12702
- const [N, C] = [
12703
+ const [v, j] = [
12703
12704
  S.miniMapCamera.centerX + f,
12704
- S.miniMapCamera.centerY + T
12705
+ S.miniMapCamera.centerY + N
12705
12706
  ];
12706
12707
  (g = n.control.room) == null || g.moveCamera({
12707
- centerX: N,
12708
- centerY: C,
12708
+ centerX: v,
12709
+ centerY: j,
12709
12710
  animationMode: "immediately"
12710
12711
  });
12711
12712
  }
@@ -13564,7 +13565,7 @@ class lt extends ze {
13564
13565
  })), this.worker.blurSelector(r.id, r.focusScenePath, u);
13565
13566
  else {
13566
13567
  const p = this.textEditorManager.editors.get(u);
13567
- p && p.opt && (p.opt.workState === j.Doing || p.opt.workState === j.Start) && (p.opt.text && p.opt.text.replace(/\s*,/g, "") ? this.textEditorManager.unActive(u) : this.textEditorManager.delete(u));
13568
+ p && p.opt && (p.opt.workState === x.Doing || p.opt.workState === x.Start) && (p.opt.text && p.opt.text.replace(/\s*,/g, "") ? this.textEditorManager.unActive(u) : this.textEditorManager.delete(u));
13568
13569
  }
13569
13570
  }
13570
13571
  }
@@ -13639,91 +13640,91 @@ const b = class b extends Vn {
13639
13640
  b.logger.info(
13640
13641
  "[ApplianceMultiPlugin] getBoundingRectAsync"
13641
13642
  );
13642
- const f = (e.mainView || n).getBoundingRect(M), T = await ((S = b.currentManager) == null ? void 0 : S.getBoundingRect(M));
13643
- return !f.width || !f.height ? T : Ji(f, T);
13643
+ const f = (e.mainView || n).getBoundingRect(M), N = await ((S = b.currentManager) == null ? void 0 : S.getBoundingRect(M));
13644
+ return !f.width || !f.height ? N : Ji(f, N);
13644
13645
  },
13645
- screenshotToCanvasAsync: async function(M, f, T, S, N, C) {
13646
+ screenshotToCanvasAsync: async function(M, f, N, S, v, j) {
13646
13647
  var z;
13647
13648
  b.logger.info(
13648
13649
  "[ApplianceMultiPlugin] screenshotToCanvasAsync"
13649
13650
  );
13650
- let x = T, k = S, E = N.scale;
13651
- x > this.maxScreenshotWidth && (E = this.maxScreenshotWidth / x * E, x = this.maxScreenshotWidth), k > this.maxScreenshotHeight && (E = Math.min(this.maxScreenshotHeight / k * E, E), k = this.maxScreenshotHeight), N.scale = E;
13652
- const L = document.createElement("canvas"), P = L.getContext("2d");
13653
- L.width = x * (C || 1), L.height = k * (C || 1), P && ((e.mainView || n).screenshotToCanvas(
13651
+ let C = N, k = S, L = v.scale;
13652
+ C > this.maxScreenshotWidth && (L = this.maxScreenshotWidth / C * L, C = this.maxScreenshotWidth), k > this.maxScreenshotHeight && (L = Math.min(this.maxScreenshotHeight / k * L, L), k = this.maxScreenshotHeight), v.scale = L;
13653
+ const E = document.createElement("canvas"), P = E.getContext("2d");
13654
+ E.width = C * (j || 1), E.height = k * (j || 1), P && ((e.mainView || n).screenshotToCanvas(
13654
13655
  P,
13655
13656
  f,
13656
- x,
13657
+ C,
13657
13658
  k,
13658
- N,
13659
- C
13659
+ v,
13660
+ j
13660
13661
  ), M.drawImage(
13661
- L,
13662
- Math.floor((T - x) / 2),
13662
+ E,
13663
+ Math.floor((N - C) / 2),
13663
13664
  Math.floor((S - k) / 2),
13664
- x * (C || 1),
13665
- k * (C || 1),
13665
+ C * (j || 1),
13666
+ k * (j || 1),
13666
13667
  0,
13667
13668
  0,
13668
- x,
13669
+ C,
13669
13670
  k
13670
- ), L.remove()), b.currentManager && await ((z = b.currentManager) == null ? void 0 : z.screenshotToCanvas(
13671
+ ), E.remove()), b.currentManager && await ((z = b.currentManager) == null ? void 0 : z.screenshotToCanvas(
13671
13672
  M,
13672
13673
  f,
13673
- x,
13674
+ C,
13674
13675
  k,
13675
- N,
13676
- Math.floor((T - x) / 2),
13676
+ v,
13677
+ Math.floor((N - C) / 2),
13677
13678
  Math.floor((S - k) / 2)
13678
13679
  ));
13679
13680
  },
13680
- scenePreviewAsync: async function(M, f, T, S, N) {
13681
+ scenePreviewAsync: async function(M, f, N, S, v) {
13681
13682
  b.logger.info(
13682
13683
  "[ApplianceMultiPlugin] scenePreviewAsync"
13683
13684
  ), (e.mainView || n).scenePreview(
13684
13685
  M,
13685
13686
  f,
13686
- T,
13687
+ N,
13687
13688
  S,
13688
- N
13689
+ v
13689
13690
  );
13690
- const C = document.createElement("img");
13691
- C.className = "appliance-plugin-fill-scene-snapshot-img", f.append(C), getComputedStyle(f).position || (f.style.position = "relative"), b.currentManager && await b.currentManager.scenePreview(
13691
+ const j = document.createElement("img");
13692
+ j.className = "appliance-plugin-fill-scene-snapshot-img", f.append(j), getComputedStyle(f).position || (f.style.position = "relative"), b.currentManager && await b.currentManager.scenePreview(
13692
13693
  M,
13693
- C
13694
+ j
13694
13695
  );
13695
13696
  },
13696
- fillSceneSnapshotAsync: async function(M, f, T, S, N) {
13697
+ fillSceneSnapshotAsync: async function(M, f, N, S, v) {
13697
13698
  b.logger.info(
13698
13699
  "[ApplianceMultiPlugin] fillSceneSnapshotAsync"
13699
13700
  ), f.innerHTML = "", (e.mainView || n).fillSceneSnapshot(
13700
13701
  M,
13701
13702
  f,
13702
- T,
13703
+ N,
13703
13704
  S,
13704
- N
13705
+ v
13705
13706
  );
13706
- const C = T || e.mainView.size.width, x = S || e.mainView.size.height;
13707
+ const j = N || e.mainView.size.width, C = S || e.mainView.size.height;
13707
13708
  let k = await this.getBoundingRectAsync(M);
13708
13709
  k || (k = {
13709
13710
  originX: 0,
13710
13711
  originY: 0,
13711
- width: C,
13712
- height: x
13712
+ width: j,
13713
+ height: C
13713
13714
  });
13714
- let E = Math.max(k == null ? void 0 : k.width, C), L = Math.max(k == null ? void 0 : k.height, x), P = 1;
13715
- const z = E > C && Math.min(C / E, P) || P, O = L > x && Math.min(x / L, P) || P;
13716
- z <= O ? (E = z < 1 && C || E, L = Math.floor(L * z) + 1, P = z) : z > O && (L = O < 1 && x || L, E = Math.floor(E * O) + 1, P = O);
13715
+ let L = Math.max(k == null ? void 0 : k.width, j), E = Math.max(k == null ? void 0 : k.height, C), P = 1;
13716
+ const z = L > j && Math.min(j / L, P) || P, O = E > C && Math.min(C / E, P) || P;
13717
+ z <= O ? (L = z < 1 && j || L, E = Math.floor(E * z) + 1, P = z) : z > O && (E = O < 1 && C || E, L = Math.floor(L * O) + 1, P = O);
13717
13718
  const D = {
13718
13719
  scale: P,
13719
13720
  centerX: k.originX + k.width / 2,
13720
13721
  centerY: k.originY + k.height / 2
13721
13722
  }, F = document.createElement("canvas"), _ = F.getContext("2d");
13722
- F.width = E, F.height = L, _ && await this.screenshotToCanvasAsync(
13723
+ F.width = L, F.height = E, _ && await this.screenshotToCanvasAsync(
13723
13724
  _,
13724
13725
  M,
13725
- E,
13726
13726
  L,
13727
+ E,
13727
13728
  D,
13728
13729
  devicePixelRatio
13729
13730
  );
@@ -13754,7 +13755,7 @@ const b = class b extends Vn {
13754
13755
  const M = b.currentManager.viewContainerManager.focuedView, f = M == null ? void 0 : M.focusScenePath;
13755
13756
  if (M && f)
13756
13757
  return M.displayer.commiter.redoStack.filter(
13757
- (T) => T.scenePath === f
13758
+ (N) => N.scenePath === f
13758
13759
  ).length;
13759
13760
  }
13760
13761
  return 0;
@@ -13764,7 +13765,7 @@ const b = class b extends Vn {
13764
13765
  const M = b.currentManager.viewContainerManager.focuedView, f = M == null ? void 0 : M.focusScenePath;
13765
13766
  if (M && f)
13766
13767
  return M.displayer.commiter.undoStack.filter(
13767
- (N) => N.scenePath === f
13768
+ (v) => v.scenePath === f
13768
13769
  ).length;
13769
13770
  }
13770
13771
  return 0;
@@ -13791,9 +13792,9 @@ const b = class b extends Vn {
13791
13792
  },
13792
13793
  lockImage: function(M, f) {
13793
13794
  if (b.logger.info("[ApplianceMultiPlugin] lockImage"), b.currentManager && Q(n) && n.isWritable) {
13794
- const T = b.currentManager.viewContainerManager.focuedViewId || pe;
13795
+ const N = b.currentManager.viewContainerManager.focuedViewId || pe;
13795
13796
  b.currentManager.worker.lockImage(
13796
- T,
13797
+ N,
13797
13798
  M,
13798
13799
  f
13799
13800
  );
@@ -13803,9 +13804,9 @@ const b = class b extends Vn {
13803
13804
  if (b.logger.info(
13804
13805
  "[ApplianceMultiPlugin] completeImageUpload"
13805
13806
  ), b.currentManager && Q(n) && n.isWritable) {
13806
- const T = b.currentManager.viewContainerManager.focuedViewId || pe;
13807
+ const N = b.currentManager.viewContainerManager.focuedViewId || pe;
13807
13808
  b.currentManager.worker.completeImageUpload(
13808
- T,
13809
+ N,
13809
13810
  M,
13810
13811
  f
13811
13812
  );
@@ -13818,14 +13819,14 @@ const b = class b extends Vn {
13818
13819
  M
13819
13820
  ) : [];
13820
13821
  },
13821
- insertText: function(M, f, T) {
13822
+ insertText: function(M, f, N) {
13822
13823
  if (b.logger.info("[ApplianceMultiPlugin] insertText"), b.currentManager && Q(n) && n.isWritable) {
13823
13824
  const S = b.currentManager.viewContainerManager.focuedViewId || pe;
13824
13825
  return b.currentManager.textEditorManager.insertText(
13825
13826
  S,
13826
13827
  M,
13827
13828
  f,
13828
- T
13829
+ N
13829
13830
  );
13830
13831
  }
13831
13832
  },
@@ -13847,7 +13848,7 @@ const b = class b extends Vn {
13847
13848
  b.currentManager && (b.logger.info("[ApplianceMultiPlugin] destroy"), b.currentManager.destroy(), b.currentManager = void 0);
13848
13849
  },
13849
13850
  setMemberState(M) {
13850
- var T;
13851
+ var N;
13851
13852
  b.logger.info(
13852
13853
  `[ApplianceMultiPlugin] setMemberState ${JSON.stringify(M)}`
13853
13854
  );
@@ -13855,7 +13856,7 @@ const b = class b extends Vn {
13855
13856
  if (Q(n) && n.isWritable) {
13856
13857
  if (f.includes("currentApplianceName"))
13857
13858
  if (M.currentApplianceName && M.currentApplianceName === ie.laserPen) {
13858
- if ((T = b.currentManager) != null && T.isUseSimple)
13859
+ if ((N = b.currentManager) != null && N.isUseSimple)
13859
13860
  throw new Error(
13860
13861
  "[ApplianceMultiPlugin] laserPen must be not support in simple mode"
13861
13862
  );
@@ -13883,14 +13884,14 @@ const b = class b extends Vn {
13883
13884
  ), b.currentManager && Q(n) && n.isWritable)
13884
13885
  return b.currentManager.destroyMiniMap(M);
13885
13886
  },
13886
- filterRenderByUid(M, f, T) {
13887
+ filterRenderByUid(M, f, N) {
13887
13888
  if (b.logger.info(
13888
13889
  "[ApplianceMultiPlugin] filterRenderByUid"
13889
13890
  ), b.currentManager && Q(n) && n.isWritable)
13890
13891
  return b.currentManager.filterRenderByUid(
13891
13892
  M,
13892
13893
  f,
13893
- T
13894
+ N
13894
13895
  );
13895
13896
  },
13896
13897
  cancelFilterRender(M, f) {
@@ -13953,35 +13954,35 @@ const b = class b extends Vn {
13953
13954
  ), Q(n) && h && (await ((f = b.currentManager) == null ? void 0 : f.setWritable(M)), await h.call(n, M));
13954
13955
  },
13955
13956
  requestIdleCallback: (M, f) => {
13956
- const T = (f == null ? void 0 : f.timeout) || 0, S = performance.now();
13957
- let N;
13958
- const C = new MessageChannel();
13959
- let x;
13960
- const k = (E) => {
13957
+ const N = (f == null ? void 0 : f.timeout) || 0, S = performance.now();
13958
+ let v;
13959
+ const j = new MessageChannel();
13960
+ let C;
13961
+ const k = (L) => {
13961
13962
  try {
13962
13963
  M({
13963
- didTimeout: E,
13964
+ didTimeout: L,
13964
13965
  timeRemaining: () => {
13965
13966
  const P = performance.now() - S;
13966
- return Math.max(0, T - P);
13967
+ return Math.max(0, N - P);
13967
13968
  }
13968
13969
  });
13969
- } catch (L) {
13970
+ } catch (E) {
13970
13971
  b.logger.error(
13971
13972
  "[ApplianceMultiPlugin] requestIdleCallback error:",
13972
- L
13973
+ E
13973
13974
  );
13974
13975
  } finally {
13975
- C.port1.close(), C.port2.close(), N !== void 0 && cancelAnimationFrame(N), x !== void 0 && clearTimeout(x);
13976
+ j.port1.close(), j.port2.close(), v !== void 0 && cancelAnimationFrame(v), C !== void 0 && clearTimeout(C);
13976
13977
  }
13977
13978
  };
13978
- return C.port1.onmessage = () => {
13979
- N = requestAnimationFrame(() => {
13980
- T > 0 && performance.now() - S >= T ? k(!0) : k(!1);
13979
+ return j.port1.onmessage = () => {
13980
+ v = requestAnimationFrame(() => {
13981
+ N > 0 && performance.now() - S >= N ? k(!0) : k(!1);
13981
13982
  });
13982
- }, C.port2.postMessage(null), T > 0 && (x = setTimeout(() => {
13983
+ }, j.port2.postMessage(null), N > 0 && (C = setTimeout(() => {
13983
13984
  k(!0);
13984
- }, T)), x || N || 0;
13985
+ }, N)), C || v || 0;
13985
13986
  },
13986
13987
  cancelIdleCallback: (M) => {
13987
13988
  try {
@@ -14008,23 +14009,23 @@ const b = class b extends Vn {
14008
14009
  b.logger.info("[ApplianceMultiPlugin] blurText"), b.currentManager && Q(n) && n.isWritable && b.currentManager.textEditorManager.checkEmptyTextBlur();
14009
14010
  },
14010
14011
  hasElements: (M, f) => {
14011
- var T;
14012
+ var N;
14012
14013
  if (b.logger.info(
14013
14014
  `[ApplianceMultiPlugin] hasElements ${M}`
14014
14015
  ), b.currentManager && Q(n) && n.isWritable) {
14015
14016
  let S = M;
14016
14017
  if (!S) {
14017
- const N = b.currentManager.viewContainerManager.focuedView;
14018
- S = N == null ? void 0 : N.focusScenePath;
14018
+ const v = b.currentManager.viewContainerManager.focuedView;
14019
+ S = v == null ? void 0 : v.focusScenePath;
14019
14020
  }
14020
14021
  if (S) {
14021
- const N = (T = b.currentManager.collector) == null ? void 0 : T.getScenePathData(
14022
+ const v = (N = b.currentManager.collector) == null ? void 0 : N.getScenePathData(
14022
14023
  S
14023
14024
  );
14024
- if (N) {
14025
- const C = Object.values(N);
14026
- return C.length > 0 ? f ? C.some(
14027
- (x) => f(x.toolsType)
14025
+ if (v) {
14026
+ const j = Object.values(v);
14027
+ return j.length > 0 ? f ? j.some(
14028
+ (C) => f(C.toolsType)
14028
14029
  ) : !0 : !1;
14029
14030
  }
14030
14031
  return !1;
@@ -14033,22 +14034,22 @@ const b = class b extends Vn {
14033
14034
  }
14034
14035
  },
14035
14036
  getElements: (M, f) => {
14036
- var T;
14037
+ var N;
14037
14038
  if (b.logger.info(
14038
14039
  `[ApplianceMultiPlugin] getElements ${M}`
14039
14040
  ), b.currentManager && Q(n) && n.isWritable) {
14040
14041
  let S = M;
14041
14042
  if (!S) {
14042
- const N = b.currentManager.viewContainerManager.focuedView;
14043
- S = N == null ? void 0 : N.focusScenePath;
14043
+ const v = b.currentManager.viewContainerManager.focuedView;
14044
+ S = v == null ? void 0 : v.focusScenePath;
14044
14045
  }
14045
14046
  if (S) {
14046
- const N = (T = b.currentManager.collector) == null ? void 0 : T.getScenePathData(
14047
+ const v = (N = b.currentManager.collector) == null ? void 0 : N.getScenePathData(
14047
14048
  S
14048
- ), C = N && Object.values(N) || [];
14049
- return N && C.length > 0 && f ? C.filter(
14050
- (x) => f(x.toolsType)
14051
- ) : C;
14049
+ ), j = v && Object.values(v) || [];
14050
+ return v && j.length > 0 && f ? j.filter(
14051
+ (C) => f(C.toolsType)
14052
+ ) : j;
14052
14053
  }
14053
14054
  return [];
14054
14055
  }
@@ -14077,10 +14078,10 @@ const b = class b extends Vn {
14077
14078
  return g.canRedoSteps();
14078
14079
  }
14079
14080
  });
14080
- const p = (M, f, T = 3) => {
14081
+ const p = (M, f, N = 3) => {
14081
14082
  const S = e.focused || pe;
14082
- T > 0 && S !== M ? setTimeout(() => {
14083
- p(M, f, T - 1);
14083
+ N > 0 && S !== M ? setTimeout(() => {
14084
+ p(M, f, N - 1);
14084
14085
  }, 100) : e.emitter.emit("canUndoStepsChange", f);
14085
14086
  };
14086
14087
  lt.InternalMsgEmitter.on(
@@ -14089,10 +14090,10 @@ const b = class b extends Vn {
14089
14090
  p(f, M);
14090
14091
  }
14091
14092
  );
14092
- const d = (M, f, T = 3) => {
14093
+ const d = (M, f, N = 3) => {
14093
14094
  const S = e.focused || pe;
14094
- T > 0 && S !== M ? setTimeout(() => {
14095
- d(M, f, T - 1);
14095
+ N > 0 && S !== M ? setTimeout(() => {
14096
+ d(M, f, N - 1);
14096
14097
  }, 100) : e.emitter.emit("canRedoStepsChange", f);
14097
14098
  };
14098
14099
  lt.InternalMsgEmitter.on(
@@ -14234,39 +14235,39 @@ function Hy(o, i, e) {
14234
14235
  if (typeof o != "function")
14235
14236
  throw new TypeError(Vy);
14236
14237
  i = Bn(i) || 0, Qy(e) && (h = !!e.leading, u = "maxWait" in e, r = u ? Zy(Bn(e.maxWait) || 0, i) : r, g = "trailing" in e ? !!e.trailing : g);
14237
- function p(C) {
14238
- var x = t, k = n;
14239
- return t = n = void 0, l = C, s = o.apply(k, x), s;
14238
+ function p(j) {
14239
+ var C = t, k = n;
14240
+ return t = n = void 0, l = j, s = o.apply(k, C), s;
14240
14241
  }
14241
- function d(C) {
14242
- return l = C, a = setTimeout(M, i), h ? p(C) : s;
14242
+ function d(j) {
14243
+ return l = j, a = setTimeout(M, i), h ? p(j) : s;
14243
14244
  }
14244
- function I(C) {
14245
- var x = C - c, k = C - l, E = i - x;
14246
- return u ? $y(E, r - k) : E;
14245
+ function I(j) {
14246
+ var C = j - c, k = j - l, L = i - C;
14247
+ return u ? $y(L, r - k) : L;
14247
14248
  }
14248
- function m(C) {
14249
- var x = C - c, k = C - l;
14250
- return c === void 0 || x >= i || x < 0 || u && k >= r;
14249
+ function m(j) {
14250
+ var C = j - c, k = j - l;
14251
+ return c === void 0 || C >= i || C < 0 || u && k >= r;
14251
14252
  }
14252
14253
  function M() {
14253
- var C = yi();
14254
- if (m(C))
14255
- return f(C);
14256
- a = setTimeout(M, I(C));
14254
+ var j = yi();
14255
+ if (m(j))
14256
+ return f(j);
14257
+ a = setTimeout(M, I(j));
14257
14258
  }
14258
- function f(C) {
14259
- return a = void 0, g && t ? p(C) : (t = n = void 0, s);
14259
+ function f(j) {
14260
+ return a = void 0, g && t ? p(j) : (t = n = void 0, s);
14260
14261
  }
14261
- function T() {
14262
+ function N() {
14262
14263
  a !== void 0 && clearTimeout(a), l = 0, t = c = n = a = void 0;
14263
14264
  }
14264
14265
  function S() {
14265
14266
  return a === void 0 ? s : f(yi());
14266
14267
  }
14267
- function N() {
14268
- var C = yi(), x = m(C);
14269
- if (t = arguments, n = this, c = C, x) {
14268
+ function v() {
14269
+ var j = yi(), C = m(j);
14270
+ if (t = arguments, n = this, c = j, C) {
14270
14271
  if (a === void 0)
14271
14272
  return d(c);
14272
14273
  if (u)
@@ -14274,7 +14275,7 @@ function Hy(o, i, e) {
14274
14275
  }
14275
14276
  return a === void 0 && (a = setTimeout(M, i)), s;
14276
14277
  }
14277
- return N.cancel = T, N.flush = S, N;
14278
+ return v.cancel = N, v.flush = S, v;
14278
14279
  }
14279
14280
  var Gy = Hy, Jy = Gy, Xy = ht, Ky = "Expected a function";
14280
14281
  function qy(o, i, e) {
@@ -14555,7 +14556,7 @@ class Ze extends ze {
14555
14556
  })), this.worker.blurSelector(n.id, n.focusScenePath, g);
14556
14557
  else {
14557
14558
  const d = this.textEditorManager.editors.get(g);
14558
- d && d.opt && (d.opt.workState === j.Doing || d.opt.workState === j.Start) && (d.opt.text && d.opt.text.replace(/\s*,/g, "") ? this.textEditorManager.unActive(g) : this.textEditorManager.delete(g));
14559
+ d && d.opt && (d.opt.workState === x.Doing || d.opt.workState === x.Start) && (d.opt.text && d.opt.text.replace(/\s*,/g, "") ? this.textEditorManager.unActive(g) : this.textEditorManager.delete(g));
14559
14560
  }
14560
14561
  }
14561
14562
  }
@@ -14639,49 +14640,49 @@ const A = class A extends Vn {
14639
14640
  ));
14640
14641
  return !I.width || !I.height ? m : Ji(I, m);
14641
14642
  },
14642
- screenshotToCanvasAsync: async function(d, I, m, M, f, T) {
14643
- var E;
14643
+ screenshotToCanvasAsync: async function(d, I, m, M, f, N) {
14644
+ var L;
14644
14645
  A.logger.info(
14645
14646
  "[ApplianceSinglePlugin] screenshotToCanvasAsync"
14646
14647
  );
14647
- let S = m, N = M, C = f.scale;
14648
- S > this.maxScreenshotWidth && (C = this.maxScreenshotWidth / S * C, S = this.maxScreenshotWidth), N > this.maxScreenshotHeight && (C = Math.min(this.maxScreenshotHeight / N * C, C), N = this.maxScreenshotHeight), f.scale = C;
14649
- const x = document.createElement("canvas"), k = x.getContext("2d");
14650
- x.width = S * (T || 1), x.height = N * (T || 1), k && (e.screenshotToCanvas(
14648
+ let S = m, v = M, j = f.scale;
14649
+ S > this.maxScreenshotWidth && (j = this.maxScreenshotWidth / S * j, S = this.maxScreenshotWidth), v > this.maxScreenshotHeight && (j = Math.min(this.maxScreenshotHeight / v * j, j), v = this.maxScreenshotHeight), f.scale = j;
14650
+ const C = document.createElement("canvas"), k = C.getContext("2d");
14651
+ C.width = S * (N || 1), C.height = v * (N || 1), k && (e.screenshotToCanvas(
14651
14652
  k,
14652
14653
  I,
14653
14654
  S,
14654
- N,
14655
+ v,
14655
14656
  f,
14656
- T
14657
+ N
14657
14658
  ), d.drawImage(
14658
- x,
14659
+ C,
14659
14660
  Math.floor((m - S) / 2),
14660
- Math.floor((M - N) / 2),
14661
- S * (T || 1),
14662
- N * (T || 1),
14661
+ Math.floor((M - v) / 2),
14662
+ S * (N || 1),
14663
+ v * (N || 1),
14663
14664
  0,
14664
14665
  0,
14665
14666
  S,
14666
- N
14667
- ), x.remove()), A.currentManager && await ((E = A.currentManager) == null ? void 0 : E.screenshotToCanvas(
14667
+ v
14668
+ ), C.remove()), A.currentManager && await ((L = A.currentManager) == null ? void 0 : L.screenshotToCanvas(
14668
14669
  d,
14669
14670
  I,
14670
14671
  S,
14671
- N,
14672
+ v,
14672
14673
  f,
14673
14674
  Math.floor((m - S) / 2),
14674
- Math.floor((M - N) / 2)
14675
+ Math.floor((M - v) / 2)
14675
14676
  ));
14676
14677
  },
14677
14678
  scenePreviewAsync: async function(d, I, m, M, f) {
14678
14679
  A.logger.info(
14679
14680
  "[ApplianceSinglePlugin] scenePreviewAsync"
14680
14681
  ), e.scenePreview(d, I, m, M, f);
14681
- const T = document.createElement("img");
14682
- T.className = "appliance-plugin-fill-scene-snapshot-img", I.append(T), getComputedStyle(I).position || (I.style.position = "relative"), A.currentManager && await A.currentManager.scenePreview(
14682
+ const N = document.createElement("img");
14683
+ N.className = "appliance-plugin-fill-scene-snapshot-img", I.append(N), getComputedStyle(I).position || (I.style.position = "relative"), A.currentManager && await A.currentManager.scenePreview(
14683
14684
  d,
14684
- T
14685
+ N
14685
14686
  );
14686
14687
  },
14687
14688
  fillSceneSnapshotAsync: async function(d, I, m, M, f) {
@@ -14689,27 +14690,27 @@ const A = class A extends Vn {
14689
14690
  A.logger.info(
14690
14691
  "[ApplianceSinglePlugin] fillSceneSnapshotAsync"
14691
14692
  ), I.innerHTML = "", e.fillSceneSnapshot(d, I, m, M, f);
14692
- const T = m || ((F = e.state.cameraState) == null ? void 0 : F.width) || 0, S = M || ((_ = e.state.cameraState) == null ? void 0 : _.height) || 0;
14693
- let N = await this.getBoundingRectAsync(d);
14694
- N || (N = {
14693
+ const N = m || ((F = e.state.cameraState) == null ? void 0 : F.width) || 0, S = M || ((_ = e.state.cameraState) == null ? void 0 : _.height) || 0;
14694
+ let v = await this.getBoundingRectAsync(d);
14695
+ v || (v = {
14695
14696
  originX: 0,
14696
14697
  originY: 0,
14697
- width: T,
14698
+ width: N,
14698
14699
  height: S
14699
14700
  });
14700
- let C = Math.max(N == null ? void 0 : N.width, T), x = Math.max(N == null ? void 0 : N.height, S), k = 1;
14701
- const E = C > T && Math.min(T / C, k) || k, L = x > S && Math.min(S / x, k) || k;
14702
- E <= L ? (C = E < 1 && T || C, x = Math.floor(x * E) + 1, k = E) : E > L && (x = L < 1 && S || x, C = Math.floor(C * L) + 1, k = L);
14701
+ let j = Math.max(v == null ? void 0 : v.width, N), C = Math.max(v == null ? void 0 : v.height, S), k = 1;
14702
+ const L = j > N && Math.min(N / j, k) || k, E = C > S && Math.min(S / C, k) || k;
14703
+ L <= E ? (j = L < 1 && N || j, C = Math.floor(C * L) + 1, k = L) : L > E && (C = E < 1 && S || C, j = Math.floor(j * E) + 1, k = E);
14703
14704
  const P = {
14704
14705
  scale: k,
14705
- centerX: N.originX + N.width / 2,
14706
- centerY: N.originY + N.height / 2
14706
+ centerX: v.originX + v.width / 2,
14707
+ centerY: v.originY + v.height / 2
14707
14708
  }, z = document.createElement("canvas"), O = z.getContext("2d");
14708
- z.width = C, z.height = x, O && await this.screenshotToCanvasAsync(
14709
+ z.width = j, z.height = C, O && await this.screenshotToCanvasAsync(
14709
14710
  O,
14710
14711
  d,
14712
+ j,
14711
14713
  C,
14712
- x,
14713
14714
  P,
14714
14715
  devicePixelRatio
14715
14716
  );
@@ -14932,32 +14933,32 @@ const A = class A extends Vn {
14932
14933
  requestIdleCallback: (d, I) => {
14933
14934
  const m = (I == null ? void 0 : I.timeout) || 0, M = performance.now();
14934
14935
  let f;
14935
- const T = new MessageChannel();
14936
+ const N = new MessageChannel();
14936
14937
  let S;
14937
- const N = (C) => {
14938
+ const v = (j) => {
14938
14939
  try {
14939
14940
  d({
14940
- didTimeout: C,
14941
+ didTimeout: j,
14941
14942
  timeRemaining: () => {
14942
14943
  const k = performance.now() - M;
14943
14944
  return Math.max(0, m - k);
14944
14945
  }
14945
14946
  });
14946
- } catch (x) {
14947
+ } catch (C) {
14947
14948
  A.logger.error(
14948
14949
  "[ApplianceSinglePlugin] requestIdleCallback error:",
14949
- x
14950
+ C
14950
14951
  );
14951
14952
  } finally {
14952
- T.port1.close(), T.port2.close(), f !== void 0 && cancelAnimationFrame(f), S !== void 0 && clearTimeout(S);
14953
+ N.port1.close(), N.port2.close(), f !== void 0 && cancelAnimationFrame(f), S !== void 0 && clearTimeout(S);
14953
14954
  }
14954
14955
  };
14955
- return T.port1.onmessage = () => {
14956
+ return N.port1.onmessage = () => {
14956
14957
  f = requestAnimationFrame(() => {
14957
- m > 0 && performance.now() - M >= m ? N(!0) : N(!1);
14958
+ m > 0 && performance.now() - M >= m ? v(!0) : v(!1);
14958
14959
  });
14959
- }, T.port2.postMessage(null), m > 0 && (S = setTimeout(() => {
14960
- N(!0);
14960
+ }, N.port2.postMessage(null), m > 0 && (S = setTimeout(() => {
14961
+ v(!0);
14961
14962
  }, m)), S || f || 0;
14962
14963
  },
14963
14964
  cancelIdleCallback: (d) => {
@@ -14997,8 +14998,8 @@ const A = class A extends Vn {
14997
14998
  M
14998
14999
  );
14999
15000
  if (f) {
15000
- const T = Object.values(f);
15001
- return T.length > 0 ? I ? T.some(
15001
+ const N = Object.values(f);
15002
+ return N.length > 0 ? I ? N.some(
15002
15003
  (S) => I(S.toolsType)
15003
15004
  ) : !0 : !1;
15004
15005
  }
@@ -15020,10 +15021,10 @@ const A = class A extends Vn {
15020
15021
  if (M) {
15021
15022
  const f = (m = A.currentManager.collector) == null ? void 0 : m.getScenePathData(
15022
15023
  M
15023
- ), T = f && Object.values(f) || [];
15024
- return f && T.length > 0 && I ? T.filter(
15024
+ ), N = f && Object.values(f) || [];
15025
+ return f && N.length > 0 && I ? N.filter(
15025
15026
  (S) => I(S.toolsType)
15026
- ) : T;
15027
+ ) : N;
15027
15028
  }
15028
15029
  return [];
15029
15030
  }
@@ -15220,7 +15221,7 @@ class UI extends np {
15220
15221
  onCreate() {
15221
15222
  }
15222
15223
  onSetToolkey(e) {
15223
- e === v.Pencil ? this.isActive = !0 : (this.isActive && (this.localStorage.length = 0, this.timer && clearTimeout(this.timer), this.timer = void 0, this.iconRect && (this.iconRect = void 0), this.icons.length = 0), this.isActive = !1);
15224
+ e === T.Pencil ? this.isActive = !0 : (this.isActive && (this.localStorage.length = 0, this.timer && clearTimeout(this.timer), this.timer = void 0, this.iconRect && (this.iconRect = void 0), this.icons.length = 0), this.isActive = !1);
15224
15225
  }
15225
15226
  syncStorage(e, t) {
15226
15227
  if (!this.isActive || e !== this.viewId)
@@ -15243,7 +15244,7 @@ class UI extends np {
15243
15244
  return n ? Object.keys(n).filter(
15244
15245
  (c) => {
15245
15246
  var l, h;
15246
- return ((l = this.collector) == null ? void 0 : l.isOwn(c)) && ((h = n[c]) == null ? void 0 : h.toolsType) === v.Pencil && !this.excludeStorage.includes(c);
15247
+ return ((l = this.collector) == null ? void 0 : l.isOwn(c)) && ((h = n[c]) == null ? void 0 : h.toolsType) === T.Pencil && !this.excludeStorage.includes(c);
15247
15248
  }
15248
15249
  ) : [];
15249
15250
  }
@@ -15341,12 +15342,12 @@ class UI extends np {
15341
15342
  }
15342
15343
  localEvent(e, t) {
15343
15344
  var n;
15344
- if (e === this.viewId && ((n = this.control.worker.currentToolsData) == null ? void 0 : n.toolsType) === v.Pencil)
15345
+ if (e === this.viewId && ((n = this.control.worker.currentToolsData) == null ? void 0 : n.toolsType) === T.Pencil)
15345
15346
  switch (t) {
15346
- case j.Start:
15347
+ case x.Start:
15347
15348
  this.timer && (clearTimeout(this.timer), this.timer = void 0);
15348
15349
  break;
15349
- case j.Done:
15350
+ case x.Done:
15350
15351
  this.timer && clearTimeout(this.timer), this.timer = setTimeout(async () => {
15351
15352
  this.timer = void 0;
15352
15353
  const r = await this.batchLocalDraw();
@@ -15429,13 +15430,13 @@ export {
15429
15430
  CI as h,
15430
15431
  It as i,
15431
15432
  xI as j,
15432
- v as k,
15433
+ T as k,
15433
15434
  Zt as l,
15434
15435
  Fe as m,
15435
15436
  R as n,
15436
15437
  q as o,
15437
15438
  PI as p,
15438
- j as q,
15439
+ x as q,
15439
15440
  jI as r,
15440
15441
  DI as s,
15441
15442
  me as t,