@netless/appliance-plugin 1.0.7 → 1.0.8

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.
@@ -1021,12 +1021,12 @@ function Ze(r, o, t, e, i, n) {
1021
1021
  return p;
1022
1022
  n.set(r, s), Xd(r) ? r.forEach(function(M) {
1023
1023
  s.add(Ze(M, o, t, M, r, n));
1024
- }) : Gd(r) && r.forEach(function(M, I) {
1025
- s.set(I, Ze(M, o, t, I, r, n));
1024
+ }) : Gd(r) && r.forEach(function(M, v) {
1025
+ s.set(v, Ze(M, o, t, v, r, n));
1026
1026
  });
1027
1027
  var f = l ? c ? Bd : Ud : c ? Kd : qd, m = h ? void 0 : f(r);
1028
- return Dd(m || r, function(M, I) {
1029
- m && (I = M, M = r[I]), Pd(s, I, Ze(M, o, t, I, r, n));
1028
+ return Dd(m || r, function(M, v) {
1029
+ m && (v = M, M = r[v]), Pd(s, v, Ze(M, o, t, v, r, n));
1030
1030
  }), s;
1031
1031
  }
1032
1032
  var kp = Ze, Sp = kp, zp = 1, xp = 4;
@@ -1034,7 +1034,7 @@ function Lp(r) {
1034
1034
  return Sp(r, zp | xp);
1035
1035
  }
1036
1036
  var jp = Lp;
1037
- const se = /* @__PURE__ */ Oe(jp), Ms = "1.0.7", bp = "@netless/appliance-plugin", ys = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1037
+ const se = /* @__PURE__ */ Oe(jp), Ms = "1.0.8", bp = "@netless/appliance-plugin", ys = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1038
1038
  if (typeof window < "u") {
1039
1039
  let r = window.__netlessUA || "";
1040
1040
  r += ` ${bp}@${Ms}_${ys}`, window.__netlessUA = r;
@@ -1150,38 +1150,38 @@ const Bt = {
1150
1150
  const M = s && se(s) || i.get(t.name);
1151
1151
  if (!M) return;
1152
1152
  qt(a) && (t.setAttribute("zIndex", a), M.opt.zIndex = a);
1153
- const I = t.parent;
1154
- if (I) {
1153
+ const v = t.parent;
1154
+ if (v) {
1155
1155
  if (h && d && s) {
1156
1156
  const w = [M.op[0], M.op[1]];
1157
1157
  Vo(M.op, u, d, c);
1158
- const N = [M.op[0], M.op[1]], v = [N[0] - w[0], N[1] - w[1]];
1159
- M.centerPos = [M.centerPos[0] + v[0], M.centerPos[1] + v[1]], M.opt.translate = void 0, M.opt.scale = void 0;
1158
+ const N = [M.op[0], M.op[1]], I = [N[0] - w[0], N[1] - w[1]];
1159
+ M.centerPos = [M.centerPos[0] + I[0], M.centerPos[1] + I[1]], M.opt.translate = void 0, M.opt.scale = void 0;
1160
1160
  } else if (c)
1161
1161
  if (t.setAttribute("translate", c), M.opt.translate = c, s) {
1162
- const w = [c[0] * I.worldScaling[0], c[1] * I.worldScaling[1]];
1162
+ const w = [c[0] * v.worldScaling[0], c[1] * v.worldScaling[1]];
1163
1163
  m = Vf(M.rect, w), M.rect = m;
1164
1164
  } else {
1165
- const w = Pt.getRectFromLayer(I, t.name);
1165
+ const w = Pt.getRectFromLayer(v, t.name);
1166
1166
  M.rect = w || M.rect;
1167
1167
  }
1168
1168
  else if (qt(l))
1169
1169
  if (t.setAttribute("rotate", l), M.opt.rotate = l, s)
1170
1170
  m = bs(M.rect, l), M.rect = m;
1171
1171
  else {
1172
- const w = Pt.getRectFromLayer(I, t.name);
1172
+ const w = Pt.getRectFromLayer(v, t.name);
1173
1173
  M.rect = w || M.rect;
1174
1174
  }
1175
1175
  if (p) {
1176
1176
  const w = p.get(t.name);
1177
1177
  if (w)
1178
- for (let N = 0, v = 0; N < M.op.length; N += 3, v++)
1179
- M.op[N] = w[v][0], M.op[N + 1] = w[v][1];
1178
+ for (let N = 0, I = 0; N < M.op.length; N += 3, I++)
1179
+ M.op[N] = w[I][0], M.op[N + 1] = w[I][1];
1180
1180
  }
1181
1181
  if (f && ((y = M == null ? void 0 : M.opt) != null && y.thickness) && (M.opt.thickness = f), n && !(h && d && s)) {
1182
1182
  if (c) {
1183
- const w = M.op.map((N, v) => {
1184
- const k = v % 3;
1183
+ const w = M.op.map((N, I) => {
1184
+ const k = I % 3;
1185
1185
  return k === 0 ? N + c[0] : k === 1 ? N + c[1] : N;
1186
1186
  });
1187
1187
  M.op = w, M.centerPos = [M.centerPos[0] + c[0], M.centerPos[1] + c[1]], M != null && M.opt && (M.opt.translate = void 0);
@@ -1391,15 +1391,15 @@ class ws extends R {
1391
1391
  type: x.DrawWork,
1392
1392
  dataType: W.Local
1393
1393
  };
1394
- const I = [];
1394
+ const v = [];
1395
1395
  return this.tmpPoints.slice(M).forEach((y) => {
1396
- I.push(y.x, y.y, this.computRadius(y.z, this.workOptions.thickness));
1396
+ v.push(y.x, y.y, this.computRadius(y.z, this.workOptions.thickness));
1397
1397
  }), {
1398
1398
  ...this.baseConsumeResult,
1399
1399
  type: x.DrawWork,
1400
1400
  dataType: W.Local,
1401
1401
  rect: f,
1402
- op: m ? I : void 0,
1402
+ op: m ? v : void 0,
1403
1403
  index: m ? M * 3 : void 0,
1404
1404
  updateNodeOpt: {
1405
1405
  useAnimation: !0
@@ -1491,18 +1491,18 @@ class ws extends R {
1491
1491
  draw(t) {
1492
1492
  const { attrs: e, tasks: i, replaceId: n, effects: s, layer: a } = t, { strokeColor: c, strokeType: l, thickness: h, zIndex: u, scale: d, rotate: p, translate: f } = this.workOptions;
1493
1493
  s != null && s.size && (s.forEach((N) => {
1494
- var v;
1495
- (v = a.getElementById(N + "")) == null || v.remove();
1494
+ var I;
1495
+ (I = a.getElementById(N + "")) == null || I.remove();
1496
1496
  }), s.clear());
1497
1497
  let m;
1498
- const M = [], I = a.worldPosition, y = a.worldScaling;
1498
+ const M = [], v = a.worldPosition, y = a.worldScaling;
1499
1499
  for (let N = 0; N < i.length; N++) {
1500
- const { pos: v, points: k } = i[N], { ps: z, rect: L } = this.computDrawPoints(k);
1500
+ const { pos: I, points: k } = i[N], { ps: z, rect: L } = this.computDrawPoints(k);
1501
1501
  let b;
1502
1502
  const A = k.length === 1;
1503
1503
  l === _.Stroke || A ? b = he(z, !0) : b = he(z, !1);
1504
1504
  const P = {
1505
- pos: v,
1505
+ pos: I,
1506
1506
  d: b,
1507
1507
  fillColor: l === _.Stroke || A ? c : void 0,
1508
1508
  lineDash: l === _.Dotted && !A ? [1, h * 2] : l === _.LongDotted && !A ? [h, h * 2] : void 0,
@@ -1511,8 +1511,8 @@ class ws extends R {
1511
1511
  lineWidth: l === _.Stroke || A ? 0 : h
1512
1512
  };
1513
1513
  m = pt(m, {
1514
- x: Math.floor((L.x + v[0]) * y[0] + I[0] - R.SafeBorderPadding),
1515
- y: Math.floor((L.y + v[1]) * y[1] + I[1] - R.SafeBorderPadding),
1514
+ x: Math.floor((L.x + I[0]) * y[0] + v[0] - R.SafeBorderPadding),
1515
+ y: Math.floor((L.y + I[1]) * y[1] + v[1] - R.SafeBorderPadding),
1516
1516
  w: Math.floor(L.w * y[0] + 2 * R.SafeBorderPadding),
1517
1517
  h: Math.floor(L.h * y[1] + 2 * R.SafeBorderPadding)
1518
1518
  }), M.push(P);
@@ -1529,7 +1529,7 @@ class ws extends R {
1529
1529
  size: [(m.w - 2 * R.SafeBorderPadding) / y[0], (m.h - 2 * R.SafeBorderPadding) / y[1]],
1530
1530
  zIndex: u
1531
1531
  });
1532
- const N = M.map((v) => (v.pos = [v.pos[0] - this.centerPos[0], v.pos[1] - this.centerPos[1]], new ue(v)));
1532
+ const N = M.map((I) => (I.pos = [I.pos[0] - this.centerPos[0], I.pos[1] - this.centerPos[1]], new ue(I)));
1533
1533
  w.append(...N), l === _.Stroke && w.seal(), this.replace(a, n || e.workId, w);
1534
1534
  }
1535
1535
  if (d || p || f) {
@@ -1601,8 +1601,8 @@ class ws extends R {
1601
1601
  point: new $(p, f, m, t[n].v),
1602
1602
  radius: M
1603
1603
  }), n > 0 && n < t.length - 1) {
1604
- const I = t[n].getAngleByPoints(t[n - 1], t[n + 1]);
1605
- if (I < 90 || I > 270) {
1604
+ const v = t[n].getAngleByPoints(t[n - 1], t[n + 1]);
1605
+ if (v < 90 || v > 270) {
1606
1606
  const y = (u = l.pop()) == null ? void 0 : u.point.clone();
1607
1607
  y && i.push({
1608
1608
  taskId: h,
@@ -1641,12 +1641,12 @@ class ws extends R {
1641
1641
  if (u.isNear(p, e)) {
1642
1642
  if (p.z < this.MAX_REPEAR) {
1643
1643
  if (p.setz(Math.min(p.z + 1, this.MAX_REPEAR)), a = Math.min(a, d), h > 1) {
1644
- let I = h - 1;
1645
- for (; I > 0; ) {
1646
- const y = this.tmpPoints[I].distance(this.tmpPoints[I - 1]), w = Math.max(this.tmpPoints[I].z - this.uniThickness * y, 0);
1647
- if (this.tmpPoints[I - 1].z >= w)
1644
+ let v = h - 1;
1645
+ for (; v > 0; ) {
1646
+ const y = this.tmpPoints[v].distance(this.tmpPoints[v - 1]), w = Math.max(this.tmpPoints[v].z - this.uniThickness * y, 0);
1647
+ if (this.tmpPoints[v - 1].z >= w)
1648
1648
  break;
1649
- this.tmpPoints[I - 1].setz(w), a = Math.min(a, I - 1), I--;
1649
+ this.tmpPoints[v - 1].setz(w), a = Math.min(a, v - 1), v--;
1650
1650
  }
1651
1651
  }
1652
1652
  } else
@@ -1786,12 +1786,12 @@ class ms extends R {
1786
1786
  anchor: [0.5, 0.5]
1787
1787
  }, m = this.getTaskPoints(p);
1788
1788
  if (m.length) {
1789
- const I = Date.now();
1790
- I - this.syncTimestamp > this.syncUnitTime && (u = !0, this.syncTimestamp = I, this.syncIndex = this.tmpPoints.length), i && this.draw({ attrs: f, tasks: m, isDot: !1, layer: this.drawLayer || this.fullLayer });
1789
+ const v = Date.now();
1790
+ v - this.syncTimestamp > this.syncUnitTime && (u = !0, this.syncTimestamp = v, this.syncIndex = this.tmpPoints.length), i && this.draw({ attrs: f, tasks: m, isDot: !1, layer: this.drawLayer || this.fullLayer });
1791
1791
  }
1792
1792
  const M = [];
1793
- return this.tmpPoints.slice(d).forEach((I) => {
1794
- M.push(I.x, I.y);
1793
+ return this.tmpPoints.slice(d).forEach((v) => {
1794
+ M.push(v.x, v.y);
1795
1795
  }), {
1796
1796
  rect: {
1797
1797
  x: h.x * this.fullLayer.worldScaling[0] + this.fullLayer.worldPosition[0],
@@ -1926,10 +1926,10 @@ class ms extends R {
1926
1926
  });
1927
1927
  const { vertex: p, fragment: f } = this.workOptions;
1928
1928
  if (p && f) {
1929
- const m = s.renderer.createProgram({ vertex: p, fragment: f }), { width: M, height: I } = s.getResolution();
1929
+ const m = s.renderer.createProgram({ vertex: p, fragment: f }), { width: M, height: v } = s.getResolution();
1930
1930
  l.setUniforms({
1931
1931
  u_time: 0,
1932
- u_resolution: [M, I]
1932
+ u_resolution: [M, v]
1933
1933
  }), l.setProgram(m);
1934
1934
  }
1935
1935
  s.appendChild(l), l.transition(a).attr({
@@ -2167,8 +2167,8 @@ function Xp(r, o, t, e, i, n) {
2167
2167
  break;
2168
2168
  }
2169
2169
  if (p) {
2170
- if (!Vp(o, function(I, y) {
2171
- if (!Zp(p, y) && (f === I || i(f, I, t, e, n)))
2170
+ if (!Vp(o, function(v, y) {
2171
+ if (!Zp(p, y) && (f === v || i(f, v, t, e, n)))
2172
2172
  return p.push(y);
2173
2173
  })) {
2174
2174
  d = !1;
@@ -2248,18 +2248,18 @@ function Cf(r, o, t, e, i, n) {
2248
2248
  n.set(r, o), n.set(o, r);
2249
2249
  for (var M = s; ++u < c; ) {
2250
2250
  d = a[u];
2251
- var I = r[d], y = o[d];
2251
+ var v = r[d], y = o[d];
2252
2252
  if (e)
2253
- var w = s ? e(y, I, d, o, r, n) : e(I, y, d, r, o, n);
2254
- if (!(w === void 0 ? I === y || i(I, y, t, e, n) : w)) {
2253
+ var w = s ? e(y, v, d, o, r, n) : e(v, y, d, r, o, n);
2254
+ if (!(w === void 0 ? v === y || i(v, y, t, e, n) : w)) {
2255
2255
  m = !1;
2256
2256
  break;
2257
2257
  }
2258
2258
  M || (M = d == "constructor");
2259
2259
  }
2260
2260
  if (m && !M) {
2261
- var N = r.constructor, v = o.constructor;
2262
- N != v && "constructor" in r && "constructor" in o && !(typeof N == "function" && N instanceof N && typeof v == "function" && v instanceof v) && (m = !1);
2261
+ var N = r.constructor, I = o.constructor;
2262
+ N != I && "constructor" in r && "constructor" in o && !(typeof N == "function" && N instanceof N && typeof I == "function" && I instanceof I) && (m = !1);
2263
2263
  }
2264
2264
  return n.delete(r), n.delete(o), m;
2265
2265
  }
@@ -2557,10 +2557,10 @@ const Be = /* @__PURE__ */ Oe(Yf), ro = class ro extends R {
2557
2557
  if (!u)
2558
2558
  return;
2559
2559
  let d;
2560
- const p = /* @__PURE__ */ new Map(), { originPoint: f, workState: m, angle: M, translate: I, dir: y, scale: w } = e;
2561
- h && (I ? e.translate = [I[0] + h[0], I[1] + h[1]] : e.translate = h);
2560
+ const p = /* @__PURE__ */ new Map(), { originPoint: f, workState: m, angle: M, translate: v, dir: y, scale: w } = e;
2561
+ h && (v ? e.translate = [v[0] + h[0], v[1] + h[1]] : e.translate = h);
2562
2562
  let N;
2563
- if (f || I || qt(M)) {
2563
+ if (f || v || qt(M)) {
2564
2564
  if (m === j.Start && i)
2565
2565
  return n.setTargetAssignKeys(i), {
2566
2566
  type: x.Select,
@@ -2626,31 +2626,31 @@ const Be = /* @__PURE__ */ Oe(Yf), ro = class ro extends R {
2626
2626
  }
2627
2627
  }
2628
2628
  N && m === j.Done && (n.deleteLastTarget(), N = void 0);
2629
- const v = d;
2630
- if (f && I && w && y && v && !h) {
2629
+ const I = d;
2630
+ if (f && v && w && y && I && !h) {
2631
2631
  const L = [
2632
- [v.x, v.y],
2633
- [v.x + v.w, v.y],
2634
- [v.x + v.w, v.y + v.h],
2635
- [v.x, v.y + v.h]
2632
+ [I.x, I.y],
2633
+ [I.x + I.w, I.y],
2634
+ [I.x + I.w, I.y + I.h],
2635
+ [I.x, I.y + I.h]
2636
2636
  ];
2637
2637
  let b;
2638
2638
  switch (y) {
2639
2639
  case "top":
2640
2640
  case "topLeft":
2641
2641
  case "left":
2642
- I[0] > 0 && I[1] > 0 ? b = L[0] : I[0] > 0 ? b = L[3] : I[1] > 0 ? b = L[1] : b = L[2];
2642
+ v[0] > 0 && v[1] > 0 ? b = L[0] : v[0] > 0 ? b = L[3] : v[1] > 0 ? b = L[1] : b = L[2];
2643
2643
  break;
2644
2644
  case "topRight":
2645
- I[0] < 0 && I[1] > 0 ? b = L[1] : I[0] < 0 ? b = L[2] : I[1] > 0 ? b = L[0] : b = L[3];
2645
+ v[0] < 0 && v[1] > 0 ? b = L[1] : v[0] < 0 ? b = L[2] : v[1] > 0 ? b = L[0] : b = L[3];
2646
2646
  break;
2647
2647
  case "right":
2648
2648
  case "bottomRight":
2649
2649
  case "bottom":
2650
- I[0] < 0 && I[1] < 0 ? b = L[2] : I[0] < 0 ? b = L[1] : I[1] < 0 ? b = L[3] : b = L[0];
2650
+ v[0] < 0 && v[1] < 0 ? b = L[2] : v[0] < 0 ? b = L[1] : v[1] < 0 ? b = L[3] : b = L[0];
2651
2651
  break;
2652
2652
  case "bottomLeft":
2653
- I[0] > 0 && I[1] < 0 ? b = L[3] : I[0] > 0 ? b = L[0] : I[1] < 0 ? b = L[2] : b = L[1];
2653
+ v[0] > 0 && v[1] < 0 ? b = L[3] : v[0] > 0 ? b = L[0] : v[1] < 0 ? b = L[2] : b = L[1];
2654
2654
  break;
2655
2655
  }
2656
2656
  const A = b && [f[0] - b[0], f[1] - b[1]] || [0, 0];
@@ -2660,15 +2660,15 @@ const Be = /* @__PURE__ */ Oe(Yf), ro = class ro extends R {
2660
2660
  this.getSelecteorInfo(p), this.draw(U, u, {
2661
2661
  selectIds: i || [],
2662
2662
  subNodeMap: p,
2663
- intersectRect: v
2663
+ intersectRect: I
2664
2664
  });
2665
- const k = pt(this.oldSelectRect, v);
2666
- return this.oldSelectRect = v, {
2665
+ const k = pt(this.oldSelectRect, I);
2666
+ return this.oldSelectRect = I, {
2667
2667
  type: x.Select,
2668
2668
  dataType: W.Local,
2669
- selectRect: v,
2669
+ selectRect: I,
2670
2670
  renderRect: d,
2671
- rect: pt(k, v),
2671
+ rect: pt(k, I),
2672
2672
  selectIds: i
2673
2673
  };
2674
2674
  }
@@ -2832,10 +2832,10 @@ class Ns extends R {
2832
2832
  };
2833
2833
  }
2834
2834
  draw(t) {
2835
- const { workId: e, layer: i } = t, { strokeColor: n, thickness: s, zIndex: a, scale: c, rotate: l, translate: h, strokeType: u } = this.workOptions, d = i.worldPosition, p = i.worldScaling, { points: f, pos: m, rect: M, isTriangle: I, trianglePoints: y, trianglePos: w } = this.computDrawPoints(s), N = [
2835
+ const { workId: e, layer: i } = t, { strokeColor: n, thickness: s, zIndex: a, scale: c, rotate: l, translate: h, strokeType: u } = this.workOptions, d = i.worldPosition, p = i.worldScaling, { points: f, pos: m, rect: M, isTriangle: v, trianglePoints: y, trianglePos: w } = this.computDrawPoints(s), N = [
2836
2836
  M.x + M.w / 2,
2837
2837
  M.y + M.h / 2
2838
- ], v = {
2838
+ ], I = {
2839
2839
  pos: N,
2840
2840
  name: e,
2841
2841
  id: e,
@@ -2843,8 +2843,8 @@ class Ns extends R {
2843
2843
  anchor: [0.5, 0.5],
2844
2844
  size: [M.w, M.h]
2845
2845
  };
2846
- c && (v.scale = c), l && (v.rotate = l), h && (v.translate = h);
2847
- const k = new Ut(v), z = {
2846
+ c && (I.scale = c), l && (I.rotate = l), h && (I.translate = h);
2847
+ const k = new Ut(I), z = {
2848
2848
  points: y,
2849
2849
  pos: [w[0] - N[0], w[1] - N[1]],
2850
2850
  fillColor: n,
@@ -2852,13 +2852,13 @@ class Ns extends R {
2852
2852
  lineWidth: 0,
2853
2853
  normalize: !1
2854
2854
  }, L = new oe(z);
2855
- if (k.append(L), !I && f && m) {
2855
+ if (k.append(L), !v && f && m) {
2856
2856
  const b = {
2857
2857
  points: f,
2858
2858
  pos: [m[0] - N[0], m[1] - N[1]],
2859
2859
  fillColor: n,
2860
2860
  strokeColor: n,
2861
- lineDash: u === _.Dotted && !I ? [1, s * 2] : u === _.LongDotted && !I ? [s, s * 2] : void 0,
2861
+ lineDash: u === _.Dotted && !v ? [1, s * 2] : u === _.LongDotted && !v ? [s, s * 2] : void 0,
2862
2862
  lineCap: u === _.Normal ? void 0 : "round",
2863
2863
  lineWidth: s,
2864
2864
  normalize: !1
@@ -2887,9 +2887,9 @@ class Ns extends R {
2887
2887
  computFullArrowPoints(t) {
2888
2888
  const e = S.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), i = S.Per(e).mul(t / 2), n = $.Sub(this.tmpPoints[0], i), s = $.Add(this.tmpPoints[0], i), a = S.Mul(e, this.arrowTipWidth), c = S.Sub(this.tmpPoints[1], a), l = $.Sub(c, i), h = $.Add(c, i), u = S.Per(e).mul(t * 1.5), d = $.Sub(c, u), p = $.Add(c, u), f = [this.tmpPoints[0], c], m = [d, this.tmpPoints[1], p], M = [n, s, ...m, l, h];
2889
2889
  return {
2890
- trianglePoints: m.map((I) => $.Sub(I, this.tmpPoints[1]).XY).flat(1),
2890
+ trianglePoints: m.map((v) => $.Sub(v, this.tmpPoints[1]).XY).flat(1),
2891
2891
  trianglePos: this.tmpPoints[1].XY,
2892
- points: f.map((I) => $.Sub(I, this.tmpPoints[0]).XY).flat(1),
2892
+ points: f.map((v) => $.Sub(v, this.tmpPoints[0]).XY).flat(1),
2893
2893
  rect: yt(M),
2894
2894
  isTriangle: !1,
2895
2895
  pos: this.tmpPoints[0].XY
@@ -3016,8 +3016,8 @@ class Ts extends R {
3016
3016
  };
3017
3017
  }
3018
3018
  draw(t) {
3019
- const { workId: e, layer: i, isDrawing: n } = t, { strokeColor: s, fillColor: a, thickness: c, zIndex: l, scale: h, rotate: u, translate: d, strokeType: p } = this.workOptions, f = i.worldScaling, { radius: m, rect: M, pos: I } = this.computDrawPoints(c), y = {
3020
- pos: I,
3019
+ const { workId: e, layer: i, isDrawing: n } = t, { strokeColor: s, fillColor: a, thickness: c, zIndex: l, scale: h, rotate: u, translate: d, strokeType: p } = this.workOptions, f = i.worldScaling, { radius: m, rect: M, pos: v } = this.computDrawPoints(c), y = {
3020
+ pos: v,
3021
3021
  name: e,
3022
3022
  id: e,
3023
3023
  radius: m,
@@ -3032,7 +3032,7 @@ class Ts extends R {
3032
3032
  name: e,
3033
3033
  id: e,
3034
3034
  zIndex: l,
3035
- pos: I,
3035
+ pos: v,
3036
3036
  anchor: [0.5, 0.5],
3037
3037
  size: [M.w, M.h]
3038
3038
  };
@@ -3049,11 +3049,11 @@ class Ts extends R {
3049
3049
  });
3050
3050
  N.append(z);
3051
3051
  }
3052
- const v = new Bs({
3052
+ const I = new Bs({
3053
3053
  ...y,
3054
3054
  pos: [0, 0]
3055
3055
  });
3056
- N.append(v), this.replace(i, e, N);
3056
+ N.append(I), this.replace(i, e, N);
3057
3057
  const k = N.getBoundingClientRect();
3058
3058
  return {
3059
3059
  x: Math.floor(k.x - R.SafeBorderPadding),
@@ -3210,7 +3210,7 @@ class Cs extends R {
3210
3210
  };
3211
3211
  }
3212
3212
  draw(t) {
3213
- const { workId: e, layer: i, isDrawing: n, ps: s, replaceId: a } = t, { strokeColor: c, fillColor: l, thickness: h, zIndex: u, scale: d, rotate: p, translate: f, strokeType: m } = this.workOptions, M = i.worldPosition, I = i.worldScaling, { points: y, rect: w, pos: N } = this.computDrawPoints(s), v = {
3213
+ const { workId: e, layer: i, isDrawing: n, ps: s, replaceId: a } = t, { strokeColor: c, fillColor: l, thickness: h, zIndex: u, scale: d, rotate: p, translate: f, strokeType: m } = this.workOptions, M = i.worldPosition, v = i.worldScaling, { points: y, rect: w, pos: N } = this.computDrawPoints(s), I = {
3214
3214
  close: !0,
3215
3215
  normalize: !0,
3216
3216
  points: y,
@@ -3221,10 +3221,10 @@ class Cs extends R {
3221
3221
  lineCap: "round",
3222
3222
  lineDash: m === _.Dotted ? [1, h * 2] : m === _.LongDotted ? [h, h * 2] : void 0
3223
3223
  }, k = {
3224
- x: Math.floor(w.x * I[0] + M[0] - R.SafeBorderPadding),
3225
- y: Math.floor(w.y * I[1] + M[1] - R.SafeBorderPadding),
3226
- w: Math.floor(w.w * I[0] + 2 * R.SafeBorderPadding),
3227
- h: Math.floor(w.h * I[0] + 2 * R.SafeBorderPadding)
3224
+ x: Math.floor(w.x * v[0] + M[0] - R.SafeBorderPadding),
3225
+ y: Math.floor(w.y * v[1] + M[1] - R.SafeBorderPadding),
3226
+ w: Math.floor(w.w * v[0] + 2 * R.SafeBorderPadding),
3227
+ h: Math.floor(w.h * v[0] + 2 * R.SafeBorderPadding)
3228
3228
  }, z = new Ut({
3229
3229
  name: e,
3230
3230
  id: e,
@@ -3239,7 +3239,7 @@ class Cs extends R {
3239
3239
  rotate: p,
3240
3240
  translate: f
3241
3241
  }), L = new oe({
3242
- ...v,
3242
+ ...I,
3243
3243
  pos: [0, 0]
3244
3244
  });
3245
3245
  if (z.appendChild(L), n) {
@@ -3249,7 +3249,7 @@ class Cs extends R {
3249
3249
  pos: [0, 0],
3250
3250
  strokeColor: c,
3251
3251
  lineWidth: 1,
3252
- scale: [1 / I[0], 1 / I[1]]
3252
+ scale: [1 / v[0], 1 / v[1]]
3253
3253
  });
3254
3254
  z.appendChild(b);
3255
3255
  }
@@ -3312,10 +3312,10 @@ class Cs extends R {
3312
3312
  fontSize: f,
3313
3313
  strokeType: m
3314
3314
  } = i, M = n.get(e.name);
3315
- let I = e;
3316
- if (e.tagName === "GROUP" && (I = e.children[0]), s && (I.setAttribute("strokeColor", s), (y = M == null ? void 0 : M.opt) != null && y.strokeColor && (M.opt.strokeColor = s)), a && (a === "transparent" ? I.setAttribute("fillColor", "rgba(0,0,0,0)") : I.setAttribute("fillColor", a), (w = M == null ? void 0 : M.opt) != null && w.fillColor && (M.opt.fillColor = a)), M != null && M.opt.textOpt) {
3317
- const v = M.opt.textOpt;
3318
- c && v.fontColor && (v.fontColor = c), l && v.fontBgColor && (v.fontBgColor = l), h && (v.bold = h), u && (v.italic = u), le(d) && (v.lineThrough = d), le(p) && (v.underline = p), f && (v.fontSize = f);
3315
+ let v = e;
3316
+ if (e.tagName === "GROUP" && (v = e.children[0]), s && (v.setAttribute("strokeColor", s), (y = M == null ? void 0 : M.opt) != null && y.strokeColor && (M.opt.strokeColor = s)), a && (a === "transparent" ? v.setAttribute("fillColor", "rgba(0,0,0,0)") : v.setAttribute("fillColor", a), (w = M == null ? void 0 : M.opt) != null && w.fillColor && (M.opt.fillColor = a)), M != null && M.opt.textOpt) {
3317
+ const I = M.opt.textOpt;
3318
+ c && I.fontColor && (I.fontColor = c), l && I.fontBgColor && (I.fontBgColor = l), h && (I.bold = h), u && (I.italic = u), le(d) && (I.lineThrough = d), le(p) && (I.underline = p), f && (I.fontSize = f);
3319
3319
  }
3320
3320
  return m && (M != null && M.opt) && ((N = M.opt) != null && N.strokeType) && (M.opt.strokeType = m), M && n.setInfo(e.name, M), R.updateNodeOpt(t);
3321
3321
  }
@@ -3392,7 +3392,7 @@ class ks extends R {
3392
3392
  };
3393
3393
  }
3394
3394
  draw(t) {
3395
- const { workId: e, layer: i, isDrawing: n } = t, { strokeColor: s, fillColor: a, thickness: c, zIndex: l, vertices: h, innerVerticeStep: u, innerRatio: d, scale: p, rotate: f, translate: m, strokeType: M } = this.workOptions, I = i.worldScaling, { rect: y, pos: w, points: N } = this.computDrawPoints(c, h, u, d), v = {
3395
+ const { workId: e, layer: i, isDrawing: n } = t, { strokeColor: s, fillColor: a, thickness: c, zIndex: l, vertices: h, innerVerticeStep: u, innerRatio: d, scale: p, rotate: f, translate: m, strokeType: M } = this.workOptions, v = i.worldScaling, { rect: y, pos: w, points: N } = this.computDrawPoints(c, h, u, d), I = {
3396
3396
  close: !0,
3397
3397
  points: N,
3398
3398
  lineWidth: c,
@@ -3419,12 +3419,12 @@ class ks extends R {
3419
3419
  pos: [0, 0],
3420
3420
  strokeColor: s,
3421
3421
  lineWidth: 1,
3422
- scale: [1 / I[0], 1 / I[1]]
3422
+ scale: [1 / v[0], 1 / v[1]]
3423
3423
  });
3424
3424
  z.append(A);
3425
3425
  }
3426
3426
  const L = new oe({
3427
- ...v,
3427
+ ...I,
3428
3428
  pos: [0, 0]
3429
3429
  });
3430
3430
  z.append(L), this.replace(i, e, z);
@@ -3440,8 +3440,8 @@ class ks extends R {
3440
3440
  const s = yt(this.tmpPoints), a = [Math.floor(s.x + s.w / 2), Math.floor(s.y + s.h / 2)], c = Ds(s.w, s.h), l = Math.floor(Math.min(s.w, s.h) / 2), h = n * l, u = [], d = 2 * Math.PI / e;
3441
3441
  for (let f = 0; f < e; f++) {
3442
3442
  const m = f * d - 0.5 * Math.PI;
3443
- let M, I;
3444
- f % i === 1 ? (M = h * c[0] * Math.cos(m), I = h * c[1] * Math.sin(m)) : (M = l * c[0] * Math.cos(m), I = l * c[1] * Math.sin(m), u.push(M, I)), u.push(M, I);
3443
+ let M, v;
3444
+ f % i === 1 ? (M = h * c[0] * Math.cos(m), v = h * c[1] * Math.sin(m)) : (M = l * c[0] * Math.cos(m), v = l * c[1] * Math.sin(m), u.push(M, v)), u.push(M, v);
3445
3445
  }
3446
3446
  return {
3447
3447
  rect: yt(this.tmpPoints, t),
@@ -3562,7 +3562,7 @@ class Ss extends R {
3562
3562
  };
3563
3563
  }
3564
3564
  draw(t) {
3565
- const { workId: e, layer: i, isDrawing: n } = t, { strokeColor: s, fillColor: a, thickness: c, zIndex: l, vertices: h, scale: u, rotate: d, translate: p, strokeType: f } = this.workOptions, m = i.worldScaling, { rect: M, pos: I, points: y } = this.computDrawPoints(c, h), w = {
3565
+ const { workId: e, layer: i, isDrawing: n } = t, { strokeColor: s, fillColor: a, thickness: c, zIndex: l, vertices: h, scale: u, rotate: d, translate: p, strokeType: f } = this.workOptions, m = i.worldScaling, { rect: M, pos: v, points: y } = this.computDrawPoints(c, h), w = {
3566
3566
  close: !0,
3567
3567
  points: y,
3568
3568
  lineWidth: c,
@@ -3576,12 +3576,12 @@ class Ss extends R {
3576
3576
  name: e,
3577
3577
  id: e,
3578
3578
  zIndex: l,
3579
- pos: I,
3579
+ pos: v,
3580
3580
  anchor: [0.5, 0.5],
3581
3581
  size: [M.w, M.h]
3582
3582
  };
3583
3583
  u && (N.scale = u), d && (N.rotate = d), p && (N.translate = p);
3584
- const v = new Ut(N);
3584
+ const I = new Ut(N);
3585
3585
  if (n) {
3586
3586
  const L = new ue({
3587
3587
  d: "M-4,0H4M0,-4V4",
@@ -3591,14 +3591,14 @@ class Ss extends R {
3591
3591
  lineWidth: 1,
3592
3592
  scale: [1 / m[0], 1 / m[1]]
3593
3593
  });
3594
- v.append(L);
3594
+ I.append(L);
3595
3595
  }
3596
3596
  const k = new oe({
3597
3597
  ...w,
3598
3598
  pos: [0, 0]
3599
3599
  });
3600
- v.append(k), this.replace(i, e, v);
3601
- const z = v.getBoundingClientRect();
3600
+ I.append(k), this.replace(i, e, I);
3601
+ const z = I.getBoundingClientRect();
3602
3602
  return {
3603
3603
  x: Math.floor(z.x - R.SafeBorderPadding),
3604
3604
  y: Math.floor(z.y - R.SafeBorderPadding),
@@ -3798,7 +3798,7 @@ class zs extends R {
3798
3798
  };
3799
3799
  }
3800
3800
  draw(t) {
3801
- const { workId: e, layer: i } = t, { strokeColor: n, fillColor: s, thickness: a, zIndex: c, placement: l, scale: h, rotate: u, translate: d, strokeType: p } = this.workOptions, { rect: f, pos: m, points: M } = this.computDrawPoints(a, l), I = {
3801
+ const { workId: e, layer: i } = t, { strokeColor: n, fillColor: s, thickness: a, zIndex: c, placement: l, scale: h, rotate: u, translate: d, strokeType: p } = this.workOptions, { rect: f, pos: m, points: M } = this.computDrawPoints(a, l), v = {
3802
3802
  points: M.map((k) => k.XY),
3803
3803
  lineWidth: a,
3804
3804
  fillColor: s !== "transparent" && s || void 0,
@@ -3819,16 +3819,16 @@ class zs extends R {
3819
3819
  };
3820
3820
  h && (y.scale = h), u && (y.rotate = u), d && (y.translate = d);
3821
3821
  const w = new Ut(y), N = new oe({
3822
- ...I,
3822
+ ...v,
3823
3823
  pos: [0, 0]
3824
3824
  });
3825
3825
  w.append(N), this.replace(i, e, w);
3826
- const v = w.getBoundingClientRect();
3826
+ const I = w.getBoundingClientRect();
3827
3827
  return {
3828
- x: Math.floor(v.x - R.SafeBorderPadding),
3829
- y: Math.floor(v.y - R.SafeBorderPadding),
3830
- w: Math.floor(v.width + R.SafeBorderPadding * 2),
3831
- h: Math.floor(v.height + R.SafeBorderPadding * 2)
3828
+ x: Math.floor(I.x - R.SafeBorderPadding),
3829
+ y: Math.floor(I.y - R.SafeBorderPadding),
3830
+ w: Math.floor(I.width + R.SafeBorderPadding * 2),
3831
+ h: Math.floor(I.height + R.SafeBorderPadding * 2)
3832
3832
  };
3833
3833
  }
3834
3834
  transformControlPoints(t) {
@@ -3881,66 +3881,66 @@ class zs extends R {
3881
3881
  }
3882
3882
  }
3883
3883
  computDrawPoints(t, e) {
3884
- const i = yt(this.tmpPoints), n = this.transformControlPoints(e), s = Math.floor(i.w * 0.1), a = Math.floor(i.h * 0.1), c = [], l = S.Add(n[0], new S(0, a, 0)), h = S.Add(n[0], new S(s, 0, 0)), u = Wt.getBezierPoints(10, l, n[0], h), d = S.Sub(n[1], new S(s, 0, 0)), p = S.Add(n[1], new S(0, a, 0)), f = Wt.getBezierPoints(10, d, n[1], p), m = S.Sub(n[2], new S(0, a, 0)), M = S.Sub(n[2], new S(s, 0, 0)), I = Wt.getBezierPoints(10, m, n[2], M), y = S.Add(n[3], new S(s, 0, 0)), w = S.Sub(n[3], new S(0, a, 0)), N = Wt.getBezierPoints(10, y, n[3], w), v = s * (1 - this.ratio) * 10, k = a * (1 - this.ratio) * 10;
3884
+ const i = yt(this.tmpPoints), n = this.transformControlPoints(e), s = Math.floor(i.w * 0.1), a = Math.floor(i.h * 0.1), c = [], l = S.Add(n[0], new S(0, a, 0)), h = S.Add(n[0], new S(s, 0, 0)), u = Wt.getBezierPoints(10, l, n[0], h), d = S.Sub(n[1], new S(s, 0, 0)), p = S.Add(n[1], new S(0, a, 0)), f = Wt.getBezierPoints(10, d, n[1], p), m = S.Sub(n[2], new S(0, a, 0)), M = S.Sub(n[2], new S(s, 0, 0)), v = Wt.getBezierPoints(10, m, n[2], M), y = S.Add(n[3], new S(s, 0, 0)), w = S.Sub(n[3], new S(0, a, 0)), N = Wt.getBezierPoints(10, y, n[3], w), I = s * (1 - this.ratio) * 10, k = a * (1 - this.ratio) * 10;
3885
3885
  switch (e) {
3886
3886
  case "bottom": {
3887
- const b = S.Sub(n[2], new S(s * 5 - v / 2, 0, 0)), A = S.Sub(n[2], new S(s * 5, -k, 0)), P = S.Sub(n[2], new S(s * 5 + v / 2, 0, 0));
3888
- c.push(A, P, ...N, ...u, ...f, ...I, b);
3887
+ const b = S.Sub(n[2], new S(s * 5 - I / 2, 0, 0)), A = S.Sub(n[2], new S(s * 5, -k, 0)), P = S.Sub(n[2], new S(s * 5 + I / 2, 0, 0));
3888
+ c.push(A, P, ...N, ...u, ...f, ...v, b);
3889
3889
  break;
3890
3890
  }
3891
3891
  case "bottomRight": {
3892
- const b = S.Sub(n[2], new S(s * 1.1, 0, 0)), A = S.Sub(n[2], new S(s * 1.1 + v / 2, -k, 0)), P = S.Sub(n[2], new S(s * 1.1 + v, 0, 0));
3893
- c.push(A, P, ...N, ...u, ...f, ...I, b);
3892
+ const b = S.Sub(n[2], new S(s * 1.1, 0, 0)), A = S.Sub(n[2], new S(s * 1.1 + I / 2, -k, 0)), P = S.Sub(n[2], new S(s * 1.1 + I, 0, 0));
3893
+ c.push(A, P, ...N, ...u, ...f, ...v, b);
3894
3894
  break;
3895
3895
  }
3896
3896
  case "bottomLeft": {
3897
- const b = S.Add(n[3], new S(s * 1.1 + v, 0, 0)), A = S.Add(n[3], new S(s * 1.1 + v / 2, k, 0)), P = S.Add(n[3], new S(s * 1.1, 0, 0));
3898
- c.push(A, P, ...N, ...u, ...f, ...I, b);
3897
+ const b = S.Add(n[3], new S(s * 1.1 + I, 0, 0)), A = S.Add(n[3], new S(s * 1.1 + I / 2, k, 0)), P = S.Add(n[3], new S(s * 1.1, 0, 0));
3898
+ c.push(A, P, ...N, ...u, ...f, ...v, b);
3899
3899
  break;
3900
3900
  }
3901
3901
  case "top": {
3902
- const b = S.Sub(n[1], new S(s * 5 - v / 2, 0, 0)), A = S.Sub(n[1], new S(s * 5, k, 0)), P = S.Sub(n[1], new S(s * 5 + v / 2, 0, 0));
3903
- c.push(A, b, ...f, ...I, ...N, ...u, P);
3902
+ const b = S.Sub(n[1], new S(s * 5 - I / 2, 0, 0)), A = S.Sub(n[1], new S(s * 5, k, 0)), P = S.Sub(n[1], new S(s * 5 + I / 2, 0, 0));
3903
+ c.push(A, b, ...f, ...v, ...N, ...u, P);
3904
3904
  break;
3905
3905
  }
3906
3906
  case "topRight": {
3907
- const b = S.Sub(n[1], new S(s * 1.1, 0, 0)), A = S.Sub(n[1], new S(s * 1.1 + v / 2, k, 0)), P = S.Sub(n[1], new S(s * 1.1 + v, 0, 0));
3908
- c.push(A, b, ...f, ...I, ...N, ...u, P);
3907
+ const b = S.Sub(n[1], new S(s * 1.1, 0, 0)), A = S.Sub(n[1], new S(s * 1.1 + I / 2, k, 0)), P = S.Sub(n[1], new S(s * 1.1 + I, 0, 0));
3908
+ c.push(A, b, ...f, ...v, ...N, ...u, P);
3909
3909
  break;
3910
3910
  }
3911
3911
  case "topLeft": {
3912
- const b = S.Add(n[0], new S(s * 1.1 + v, 0, 0)), A = S.Add(n[0], new S(s * 1.1 + v / 2, -k, 0)), P = S.Add(n[0], new S(s * 1.1, 0, 0));
3913
- c.push(A, b, ...f, ...I, ...N, ...u, P);
3912
+ const b = S.Add(n[0], new S(s * 1.1 + I, 0, 0)), A = S.Add(n[0], new S(s * 1.1 + I / 2, -k, 0)), P = S.Add(n[0], new S(s * 1.1, 0, 0));
3913
+ c.push(A, b, ...f, ...v, ...N, ...u, P);
3914
3914
  break;
3915
3915
  }
3916
3916
  case "left": {
3917
- const b = S.Add(n[0], new S(0, a * 5 - k / 2, 0)), A = S.Add(n[0], new S(-v, a * 5, 0)), P = S.Add(n[0], new S(0, a * 5 + k / 2, 0));
3918
- c.push(A, b, ...u, ...f, ...I, ...N, P);
3917
+ const b = S.Add(n[0], new S(0, a * 5 - k / 2, 0)), A = S.Add(n[0], new S(-I, a * 5, 0)), P = S.Add(n[0], new S(0, a * 5 + k / 2, 0));
3918
+ c.push(A, b, ...u, ...f, ...v, ...N, P);
3919
3919
  break;
3920
3920
  }
3921
3921
  case "leftTop": {
3922
- const b = S.Add(n[0], new S(0, a * 1.1, 0)), A = S.Add(n[0], new S(-v, a * 1.1 + k / 2, 0)), P = S.Add(n[0], new S(0, a * 1.1 + k, 0));
3923
- c.push(A, b, ...u, ...f, ...I, ...N, P);
3922
+ const b = S.Add(n[0], new S(0, a * 1.1, 0)), A = S.Add(n[0], new S(-I, a * 1.1 + k / 2, 0)), P = S.Add(n[0], new S(0, a * 1.1 + k, 0));
3923
+ c.push(A, b, ...u, ...f, ...v, ...N, P);
3924
3924
  break;
3925
3925
  }
3926
3926
  case "leftBottom": {
3927
- const b = S.Sub(n[3], new S(0, a * 1.1 + k, 0)), A = S.Sub(n[3], new S(v, a * 1.1 + k / 2, 0)), P = S.Sub(n[3], new S(0, a * 1.1, 0));
3928
- c.push(A, b, ...u, ...f, ...I, ...N, P);
3927
+ const b = S.Sub(n[3], new S(0, a * 1.1 + k, 0)), A = S.Sub(n[3], new S(I, a * 1.1 + k / 2, 0)), P = S.Sub(n[3], new S(0, a * 1.1, 0));
3928
+ c.push(A, b, ...u, ...f, ...v, ...N, P);
3929
3929
  break;
3930
3930
  }
3931
3931
  case "right": {
3932
- const b = S.Add(n[1], new S(0, a * 5 - k / 2, 0)), A = S.Add(n[1], new S(v, a * 5, 0)), P = S.Add(n[1], new S(0, a * 5 + k / 2, 0));
3933
- c.push(A, P, ...I, ...N, ...u, ...f, b);
3932
+ const b = S.Add(n[1], new S(0, a * 5 - k / 2, 0)), A = S.Add(n[1], new S(I, a * 5, 0)), P = S.Add(n[1], new S(0, a * 5 + k / 2, 0));
3933
+ c.push(A, P, ...v, ...N, ...u, ...f, b);
3934
3934
  break;
3935
3935
  }
3936
3936
  case "rightTop": {
3937
- const b = S.Add(n[1], new S(0, a * 1.1, 0)), A = S.Add(n[1], new S(v, a * 1.1 + k / 2, 0)), P = S.Add(n[1], new S(0, a * 1.1 + k, 0));
3938
- c.push(A, P, ...I, ...N, ...u, ...f, b);
3937
+ const b = S.Add(n[1], new S(0, a * 1.1, 0)), A = S.Add(n[1], new S(I, a * 1.1 + k / 2, 0)), P = S.Add(n[1], new S(0, a * 1.1 + k, 0));
3938
+ c.push(A, P, ...v, ...N, ...u, ...f, b);
3939
3939
  break;
3940
3940
  }
3941
3941
  case "rightBottom": {
3942
- const b = S.Sub(n[2], new S(0, a * 1.1 + k, 0)), A = S.Sub(n[2], new S(-v, a * 1.1 + k / 2, 0)), P = S.Sub(n[2], new S(0, a * 1.1, 0));
3943
- c.push(A, P, ...I, ...N, ...u, ...f, b);
3942
+ const b = S.Sub(n[2], new S(0, a * 1.1 + k, 0)), A = S.Sub(n[2], new S(-I, a * 1.1 + k / 2, 0)), P = S.Sub(n[2], new S(0, a * 1.1, 0));
3943
+ c.push(A, P, ...v, ...N, ...u, ...f, b);
3944
3944
  break;
3945
3945
  }
3946
3946
  }
@@ -4010,43 +4010,46 @@ class Ee extends R {
4010
4010
  return { type: x.None };
4011
4011
  }
4012
4012
  draw(t) {
4013
- const { layer: e, workId: i, replaceId: n, imageBitmap: s, isMainThread: a } = t, { centerX: c, centerY: l, width: h, height: u, rotate: d, zIndex: p } = this.workOptions, f = !!e.parent.gl, m = {
4013
+ const { layer: e, workId: i, replaceId: n, imageBitmap: s } = t, { centerX: a, centerY: c, width: l, height: h, rotate: u, zIndex: d } = this.workOptions, p = {
4014
4014
  anchor: [0.5, 0.5],
4015
- pos: [c, l],
4015
+ pos: [a, c],
4016
4016
  name: i,
4017
- size: [h, u],
4018
- zIndex: p,
4019
- rotate: !a && !f && 180 + (d || 0) || d,
4017
+ size: [l, h],
4018
+ zIndex: d,
4019
+ rotate: u,
4020
4020
  texture: s
4021
- }, M = new $s(m);
4022
- this.replace(e, n || i, M);
4023
- const I = M.getBoundingClientRect();
4024
- if (I)
4021
+ }, f = new $s(p);
4022
+ this.replace(e, n || i, f);
4023
+ const m = f.getBoundingClientRect();
4024
+ if (m)
4025
4025
  return {
4026
- x: Math.floor(I.x - R.SafeBorderPadding),
4027
- y: Math.floor(I.y - R.SafeBorderPadding),
4028
- w: Math.floor(I.width + R.SafeBorderPadding * 2),
4029
- h: Math.floor(I.height + R.SafeBorderPadding * 2)
4026
+ x: Math.floor(m.x - R.SafeBorderPadding),
4027
+ y: Math.floor(m.y - R.SafeBorderPadding),
4028
+ w: Math.floor(m.width + R.SafeBorderPadding * 2),
4029
+ h: Math.floor(m.height + R.SafeBorderPadding * 2)
4030
4030
  };
4031
4031
  }
4032
4032
  consumeService() {
4033
4033
  }
4034
4034
  async consumeServiceAsync(t) {
4035
- var u, d, p, f;
4036
- const { isFullWork: e, replaceId: i, scene: n, isMainThread: s } = t, { src: a, uuid: c } = this.workOptions, l = ((u = this.workId) == null ? void 0 : u.toString()) || c, h = e ? this.fullLayer : this.drawLayer || this.fullLayer;
4037
- if (a) {
4038
- const m = await n.preload({
4039
- id: c,
4040
- src: this.workOptions.src
4041
- }), M = this.draw({ workId: l, layer: h, replaceId: i, imageBitmap: m[0], isMainThread: s });
4042
- return this.oldRect = l && ((p = (d = this.vNodes) == null ? void 0 : d.get(l)) == null ? void 0 : p.rect) || void 0, (f = this.vNodes) == null || f.setInfo(l, {
4035
+ var h, u, d, p;
4036
+ const { isFullWork: e, replaceId: i, isMainThread: n } = t, { src: s, uuid: a } = this.workOptions, c = ((h = this.workId) == null ? void 0 : h.toString()) || a, l = e ? this.fullLayer : this.drawLayer || this.fullLayer;
4037
+ if (s) {
4038
+ const f = !!l.parent.gl, m = await fetch(s, {
4039
+ method: "GET",
4040
+ mode: "cors",
4041
+ cache: "default"
4042
+ }).then((v) => v.blob()).then((v) => createImageBitmap(v, {
4043
+ imageOrientation: f ? "flipY" : "none"
4044
+ }).then((y) => y)), M = this.draw({ workId: c, layer: l, replaceId: i, imageBitmap: m, isMainThread: n });
4045
+ return this.oldRect = c && ((d = (u = this.vNodes) == null ? void 0 : u.get(c)) == null ? void 0 : d.rect) || void 0, (p = this.vNodes) == null || p.setInfo(c, {
4043
4046
  rect: M,
4044
4047
  op: [],
4045
4048
  opt: this.workOptions,
4046
4049
  toolsType: this.toolsType,
4047
4050
  scaleType: this.scaleType,
4048
4051
  canRotate: this.canRotate,
4049
- centerPos: M && R.getCenterPos(M, h)
4052
+ centerPos: M && R.getCenterPos(M, l)
4050
4053
  }), M;
4051
4054
  }
4052
4055
  }
@@ -4063,10 +4066,10 @@ class Ee extends R {
4063
4066
  const m = e.parent;
4064
4067
  if (m) {
4065
4068
  if (qt(p) && (e.setAttribute("zIndex", p), f.opt.zIndex = p), le(d) && (f.opt.locked = d), c && l && h) {
4066
- const { centerX: M, centerY: I, width: y, height: w, uniformScale: N } = f.opt, v = N !== !1 ? [h[0], h[0]] : h, k = [M, I], z = [M, I];
4067
- Vo(z, l, v, a);
4069
+ const { centerX: M, centerY: v, width: y, height: w, uniformScale: N } = f.opt, I = N !== !1 ? [h[0], h[0]] : h, k = [M, v], z = [M, v];
4070
+ Vo(z, l, I, a);
4068
4071
  const L = [z[0] - k[0], z[1] - k[1]];
4069
- f.centerPos = [f.centerPos[0] + L[0], f.centerPos[1] + L[1]], f.opt.width = Math.round(y * v[0]), f.opt.height = Math.round(w * v[1]), f.opt.centerX = z[0], f.opt.centerY = z[1];
4072
+ f.centerPos = [f.centerPos[0] + L[0], f.centerPos[1] + L[1]], f.opt.width = Math.round(y * I[0]), f.opt.height = Math.round(w * I[1]), f.opt.centerX = z[0], f.opt.centerY = z[1];
4070
4073
  } else if (a)
4071
4074
  f.opt.centerX = f.opt.centerX + a[0], f.opt.centerY = f.opt.centerY + a[1], f.centerPos = [f.centerPos[0] + a[0], f.centerPos[1] + a[1]];
4072
4075
  else if (qt(u))
@@ -4154,11 +4157,11 @@ class xs extends R {
4154
4157
  };
4155
4158
  }
4156
4159
  draw(t) {
4157
- const { workId: e, layer: i } = t, { strokeColor: n, thickness: s, zIndex: a, scale: c, rotate: l, translate: h, strokeType: u } = this.workOptions, d = i.worldPosition, p = i.worldScaling, { d: f, rect: m, isDot: M } = this.computDrawPoints(s, u), I = [
4160
+ const { workId: e, layer: i } = t, { strokeColor: n, thickness: s, zIndex: a, scale: c, rotate: l, translate: h, strokeType: u } = this.workOptions, d = i.worldPosition, p = i.worldScaling, { d: f, rect: m, isDot: M } = this.computDrawPoints(s, u), v = [
4158
4161
  m.x + m.w / 2,
4159
4162
  m.y + m.h / 2
4160
4163
  ], y = {
4161
- pos: I,
4164
+ pos: v,
4162
4165
  name: e,
4163
4166
  id: e,
4164
4167
  d: f,
@@ -4167,19 +4170,19 @@ class xs extends R {
4167
4170
  lineDash: u === _.Dotted && !M ? [1, s * 2] : u === _.LongDotted && !M ? [s, s * 2] : void 0,
4168
4171
  lineCap: u === _.Normal || M ? void 0 : "round",
4169
4172
  lineWidth: u === _.Normal || M ? 0 : s,
4170
- className: `${I[0]},${I[1]}`,
4173
+ className: `${v[0]},${v[1]}`,
4171
4174
  normalize: !0,
4172
4175
  zIndex: a
4173
4176
  };
4174
4177
  c && (y.scale = c), l && (y.rotate = l), h && (y.translate = h);
4175
4178
  const w = new ue(y);
4176
4179
  if (this.replace(i, e, w), l || c || h) {
4177
- const v = w.getBoundingClientRect();
4180
+ const I = w.getBoundingClientRect();
4178
4181
  return {
4179
- x: Math.floor(v.x - R.SafeBorderPadding),
4180
- y: Math.floor(v.y - R.SafeBorderPadding),
4181
- w: Math.floor(v.width + R.SafeBorderPadding * 2),
4182
- h: Math.floor(v.height + R.SafeBorderPadding * 2)
4182
+ x: Math.floor(I.x - R.SafeBorderPadding),
4183
+ y: Math.floor(I.y - R.SafeBorderPadding),
4184
+ w: Math.floor(I.width + R.SafeBorderPadding * 2),
4185
+ h: Math.floor(I.height + R.SafeBorderPadding * 2)
4183
4186
  };
4184
4187
  }
4185
4188
  return {
@@ -4297,8 +4300,8 @@ const te = class te extends R {
4297
4300
  h: Math.floor(p.h * h[1]) + 2
4298
4301
  };
4299
4302
  if (this.replace(i, e, d), n && i && this.workOptions.text) {
4300
- const m = await te.createLabels(this.workOptions, i, f), { labels: M, maxWidth: I } = m;
4301
- d.append(...M), f.w = Math.ceil(Math.max(I * i.worldScaling[0], f.w));
4303
+ const m = await te.createLabels(this.workOptions, i, f), { labels: M, maxWidth: v } = m;
4304
+ d.append(...M), f.w = Math.ceil(Math.max(v * i.worldScaling[0], f.w));
4302
4305
  }
4303
4306
  return f;
4304
4307
  }
@@ -4358,7 +4361,7 @@ const te = class te extends R {
4358
4361
  }
4359
4362
  static async createLabels(t, e, i) {
4360
4363
  var P;
4361
- const n = [], { x: s, y: a } = i, { width: c, height: l } = (P = e.parent) == null ? void 0 : P.parent, h = Re(t.text), u = h.length, { fontSize: d, lineHeight: p, bold: f, textAlign: m, italic: M, fontFamily: I, verticalAlign: y, fontColor: w, fontBgColor: N, underline: v, lineThrough: k } = t, z = te.getSafetySnippetRatio(e) || 1, L = Math.floor(d * z), b = te.getSafetySnippetFontLength(L);
4364
+ const n = [], { x: s, y: a } = i, { width: c, height: l } = (P = e.parent) == null ? void 0 : P.parent, h = Re(t.text), u = h.length, { fontSize: d, lineHeight: p, bold: f, textAlign: m, italic: M, fontFamily: v, verticalAlign: y, fontColor: w, fontBgColor: N, underline: I, lineThrough: k } = t, z = te.getSafetySnippetRatio(e) || 1, L = Math.floor(d * z), b = te.getSafetySnippetFontLength(L);
4362
4365
  let A = 0;
4363
4366
  for (let O = 0; O < u; O++) {
4364
4367
  const D = h[O], Z = p || L * 1.5;
@@ -4377,7 +4380,7 @@ const te = class te extends R {
4377
4380
  anchor: [0, 0],
4378
4381
  pos: J,
4379
4382
  text: st,
4380
- fontFamily: I,
4383
+ fontFamily: v,
4381
4384
  fontSize: L,
4382
4385
  lineHeight: Z,
4383
4386
  strokeColor: w,
@@ -4400,7 +4403,7 @@ const te = class te extends R {
4400
4403
  F[0] = Q, M === "italic" && (F[0] = F[0] + H * d), A = Math.max(A, F[0]);
4401
4404
  let X = !0;
4402
4405
  if (((it[0] + F[0]) * e.worldScaling[0] + s <= 0 || it[0] * e.worldScaling[0] + s >= c || (it[1] + F[1]) * e.worldScaling[0] + a <= 0 || it[1] * e.worldScaling[1] + a >= l) && (X = !1), X) {
4403
- if (v) {
4406
+ if (I) {
4404
4407
  const tt = Math.floor(d / 10), ut = {
4405
4408
  normalize: !1,
4406
4409
  pos: [0, d * 1.1 + tt / 2],
@@ -4446,7 +4449,7 @@ const te = class te extends R {
4446
4449
  italic: f,
4447
4450
  lineThrough: m,
4448
4451
  underline: M,
4449
- fontSize: I,
4452
+ fontSize: v,
4450
4453
  textInfos: y,
4451
4454
  zIndex: w
4452
4455
  } = i, N = s && se(s) || n.get(e.name);
@@ -4458,7 +4461,7 @@ const te = class te extends R {
4458
4461
  });
4459
4462
  })), a && k.fontBgColor && (k.fontBgColor = a, e.children.forEach((z) => {
4460
4463
  z.tagName === "GROUP" && z.setAttribute("bgcolor", a);
4461
- })), p && (k.bold = p), f && (k.italic = f), le(m) && (k.lineThrough = m), le(M) && (k.underline = M), I && (k.fontSize = I), h && u && d && s && k.boxPoint) {
4464
+ })), p && (k.bold = p), f && (k.italic = f), le(m) && (k.lineThrough = m), le(M) && (k.underline = M), v && (k.fontSize = v), h && u && d && s && k.boxPoint) {
4462
4465
  const z = y == null ? void 0 : y.get(e.name);
4463
4466
  if (z) {
4464
4467
  const { fontSize: P, boxSize: O } = z;
@@ -4564,8 +4567,8 @@ const Ie = class Ie extends R {
4564
4567
  if (p !== -1 && p > -1) {
4565
4568
  const f = [], m = d.slice(0, p + 1);
4566
4569
  if (S.Equals(d[p], l[0]) || m.push(l[0].clone().setz(d[p].z)), m.length > 1 && f.push(m), p + l.length - 1 < d.length - 1) {
4567
- const M = p + l.length - 1, I = d.slice(M), y = l[l.length - 1];
4568
- S.Equals(d[M], y) || I.unshift(y.clone().setz(d[M].z)), I.length > 1 && f.push(I);
4570
+ const M = p + l.length - 1, v = d.slice(M), y = l[l.length - 1];
4571
+ S.Equals(d[M], y) || v.unshift(y.clone().setz(d[M].z)), v.length > 1 && f.push(v);
4569
4572
  }
4570
4573
  return h.splice(u, 1, ...f), h;
4571
4574
  }
@@ -4611,11 +4614,11 @@ const Ie = class Ie extends R {
4611
4614
  if (p.length > 1) {
4612
4615
  const m = Fi.polyline(p.map((M) => M.XY), this.eraserPolyline);
4613
4616
  if (m.length && (i.add(c.name), !u)) {
4614
- const M = this.translateIntersect(m), I = this.cutPolyline(M, p);
4615
- for (let y = 0; y < I.length; y++) {
4617
+ const M = this.translateIntersect(m), v = this.cutPolyline(M, p);
4618
+ for (let y = 0; y < v.length; y++) {
4616
4619
  const w = `${a}_s_${y}`, N = [];
4617
- I[y].forEach((v) => {
4618
- N.push((v.x - this.worldPosition[0]) / this.worldScaling[0], (v.y - this.worldPosition[1]) / this.worldScaling[1], v.z);
4620
+ v[y].forEach((I) => {
4621
+ N.push((I.x - this.worldPosition[0]) / this.worldScaling[0], (I.y - this.worldPosition[1]) / this.worldScaling[1], I.z);
4619
4622
  }), c.opt && c.toolsType && this.vNodes && (this.vNodes.setInfo(w, {
4620
4623
  rect: f,
4621
4624
  op: N,
@@ -5118,8 +5121,8 @@ const Jt = class Jt extends Kf {
5118
5121
  break;
5119
5122
  case x.CreateWork:
5120
5123
  if (f && i && c && a) {
5121
- const v = this.isLocalId(i.toString()) ? this.transformKey(i) : i;
5122
- this.updateValue(v.toString(), {
5124
+ const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i;
5125
+ this.updateValue(I.toString(), {
5123
5126
  type: x.CreateWork,
5124
5127
  workId: i,
5125
5128
  toolsType: c,
@@ -5129,11 +5132,11 @@ const Jt = class Jt extends Kf {
5129
5132
  break;
5130
5133
  case x.DrawWork:
5131
5134
  if (f && i && typeof s == "number" && (u != null && u.length)) {
5132
- const v = this.isLocalId(i.toString()) ? this.transformKey(i) : i, k = this.storage[m] && this.storage[m][f] && this.storage[m][f][v] || void 0;
5135
+ const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i, k = this.storage[m] && this.storage[m][f] && this.storage[m][f][I] || void 0;
5133
5136
  if (k != null && k.ops || (k == null ? void 0 : k.type) === x.FullWork)
5134
5137
  return;
5135
5138
  const z = s ? ((k == null ? void 0 : k.op) || []).slice(0, s).concat(u) : u || (k == null ? void 0 : k.op), L = c || (k == null ? void 0 : k.toolsType), b = a || (k == null ? void 0 : k.opt), A = h || (k == null ? void 0 : k.updateNodeOpt);
5136
- i && L && b && z && this.updateValue(v.toString(), {
5139
+ i && L && b && z && this.updateValue(I.toString(), {
5137
5140
  ...k,
5138
5141
  type: x.DrawWork,
5139
5142
  workId: i,
@@ -5147,11 +5150,11 @@ const Jt = class Jt extends Kf {
5147
5150
  break;
5148
5151
  case x.FullWork:
5149
5152
  if (f && i) {
5150
- const v = this.isLocalId(i.toString()) ? this.transformKey(i) : i, k = this.storage[m] && this.storage[m][f] && this.storage[m][f][v] || void 0, z = h || (k == null ? void 0 : k.updateNodeOpt), L = c || (k == null ? void 0 : k.toolsType), b = a || (k == null ? void 0 : k.opt), A = n || (k == null ? void 0 : k.ops);
5151
- L && b && this.updateValue(v.toString(), {
5153
+ const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i, k = this.storage[m] && this.storage[m][f] && this.storage[m][f][I] || void 0, z = h || (k == null ? void 0 : k.updateNodeOpt), L = c || (k == null ? void 0 : k.toolsType), b = a || (k == null ? void 0 : k.opt), A = n || (k == null ? void 0 : k.ops);
5154
+ L && b && this.updateValue(I.toString(), {
5152
5155
  type: x.FullWork,
5153
5156
  updateNodeOpt: z,
5154
- workId: v,
5157
+ workId: I,
5155
5158
  toolsType: L,
5156
5159
  opt: b,
5157
5160
  ops: A
@@ -5160,29 +5163,29 @@ const Jt = class Jt extends Kf {
5160
5163
  break;
5161
5164
  case x.RemoveNode:
5162
5165
  if (f && (l != null && l.length)) {
5163
- const v = l.map((k) => this.isLocalId(k + "") ? this.transformKey(k) : k);
5166
+ const I = l.map((k) => this.isLocalId(k + "") ? this.transformKey(k) : k);
5164
5167
  this.storage[m] && this.storage[m][f] && Object.keys(this.storage[m][f]).map((k) => {
5165
- v != null && v.includes(k) && this.updateValue(k, void 0, { isSync: p, viewId: m, scenePath: f });
5168
+ I != null && I.includes(k) && this.updateValue(k, void 0, { isSync: p, viewId: m, scenePath: f });
5166
5169
  });
5167
5170
  }
5168
5171
  break;
5169
5172
  case x.UpdateNode:
5170
5173
  if (f && i && (h || n || a)) {
5171
- const v = this.isLocalId(i.toString()) ? this.transformKey(i) : i, k = this.storage[m] && this.storage[m][f] && this.storage[m][f][v] || void 0;
5172
- k && (k.updateNodeOpt = h, (n || u) && (k.ops = n, k.op = u), a && (k.opt = a), k.type = x.FullWork, this.updateValue(v.toString(), k, { isSync: p, viewId: m, scenePath: f }));
5174
+ const I = this.isLocalId(i.toString()) ? this.transformKey(i) : i, k = this.storage[m] && this.storage[m][f] && this.storage[m][f][I] || void 0;
5175
+ k && (k.updateNodeOpt = h, (n || u) && (k.ops = n, k.op = u), a && (k.opt = a), k.type = x.FullWork, this.updateValue(I.toString(), k, { isSync: p, viewId: m, scenePath: f }));
5173
5176
  }
5174
5177
  break;
5175
5178
  case x.Select:
5176
5179
  if (!f)
5177
5180
  return;
5178
- let I;
5179
- d != null && d.length && (I = d.map((v) => this.isLocalId(v + "") ? this.transformKey(v) : v));
5181
+ let v;
5182
+ d != null && d.length && (v = d.map((I) => this.isLocalId(I + "") ? this.transformKey(I) : I));
5180
5183
  const y = this.transformKey(U), w = this.storage[m] && this.storage[m][f] && this.storage[m][f][y] || void 0, N = a || (w == null ? void 0 : w.opt);
5181
- I && this.checkOtherSelector(y, I, { isSync: p, viewId: m, scenePath: f }), this.updateValue(y, I && {
5184
+ v && this.checkOtherSelector(y, v, { isSync: p, viewId: m, scenePath: f }), this.updateValue(y, v && {
5182
5185
  type: x.Select,
5183
5186
  toolsType: C.Selector,
5184
5187
  opt: N,
5185
- selectIds: I
5188
+ selectIds: v
5186
5189
  }, { isSync: p, viewId: m, scenePath: f });
5187
5190
  break;
5188
5191
  }
@@ -5408,7 +5411,7 @@ class tg {
5408
5411
  get interceptors() {
5409
5412
  return {
5410
5413
  set: (o, t) => {
5411
- var p, f, m, M, I, y, w, N;
5414
+ var p, f, m, M, v, y, w, N;
5412
5415
  if (!this.collector)
5413
5416
  return !0;
5414
5417
  const { viewId: e, scenePath: i, canSync: n, canWorker: s, type: a, opt: c, dataType: l } = t;
@@ -5418,9 +5421,9 @@ class tg {
5418
5421
  d ? d.toolsType === C.Text && (s && (this.control.worker.queryTaskBatchData({
5419
5422
  workId: o,
5420
5423
  msgType: x.UpdateNode
5421
- }).forEach((v) => {
5424
+ }).forEach((I) => {
5422
5425
  var k;
5423
- (k = this.control.worker) == null || k.taskBatchData.delete(v);
5426
+ (k = this.control.worker) == null || k.taskBatchData.delete(I);
5424
5427
  }), (w = this.control.worker) == null || w.taskBatchData.add({
5425
5428
  workId: o,
5426
5429
  msgType: x.UpdateNode,
@@ -5432,8 +5435,8 @@ class tg {
5432
5435
  willRefresh: !0
5433
5436
  // willSyncService: canSync
5434
5437
  }), (N = this.control.worker) == null || N.runAnimation()), n && Te(() => {
5435
- var v;
5436
- (v = this.collector) == null || v.dispatch({
5438
+ var I;
5439
+ (I = this.collector) == null || I.dispatch({
5437
5440
  type: x.UpdateNode,
5438
5441
  workId: o,
5439
5442
  toolsType: C.Text,
@@ -5449,7 +5452,7 @@ class tg {
5449
5452
  isSync: !0,
5450
5453
  viewId: e,
5451
5454
  scenePath: i
5452
- })), s && ((I = this.control.worker) == null || I.taskBatchData.add({
5455
+ })), s && ((v = this.control.worker) == null || v.taskBatchData.add({
5453
5456
  workId: o,
5454
5457
  msgType: c.text && x.FullWork || x.CreateWork,
5455
5458
  dataType: l || W.Local,
@@ -5969,7 +5972,7 @@ class og extends Et {
5969
5972
  };
5970
5973
  }
5971
5974
  pasteText(t) {
5972
- var M, I;
5975
+ var M, v;
5973
5976
  const { bgCenter: e, textCenter: i, store: n, key: s, viewId: a, scenePath: c, undoTickerId: l } = t, h = this.control.viewContainerManager.getView(a);
5974
5977
  if (!this.serviceColloctor || !h)
5975
5978
  return;
@@ -5986,7 +5989,7 @@ class og extends Et {
5986
5989
  x: N[0],
5987
5990
  y: N[1],
5988
5991
  opt: y,
5989
- scale: ((I = h.cameraOpt) == null ? void 0 : I.scale) || 1,
5992
+ scale: ((v = h.cameraOpt) == null ? void 0 : v.scale) || 1,
5990
5993
  type: Vt.Text,
5991
5994
  isActive: !1,
5992
5995
  viewId: a,
@@ -6003,7 +6006,7 @@ class og extends Et {
6003
6006
  }
6004
6007
  }
6005
6008
  copySelector(t) {
6006
- var m, M, I, y, w, N, v, k, z;
6009
+ var m, M, v, y, w, N, I, k, z;
6007
6010
  const { viewId: e, store: i } = t, n = this.control.viewContainerManager.getView(e), s = i.selectIds;
6008
6011
  if (!this.serviceColloctor || !(s != null && s.length) || !n)
6009
6012
  return;
@@ -6015,9 +6018,9 @@ class og extends Et {
6015
6018
  cameraOpt: {
6016
6019
  centerX: ((m = n.cameraOpt) == null ? void 0 : m.centerX) || 0,
6017
6020
  centerY: ((M = n.cameraOpt) == null ? void 0 : M.centerY) || 0,
6018
- scale: ((I = n.cameraOpt) == null ? void 0 : I.scale) || 1
6021
+ scale: ((v = n.cameraOpt) == null ? void 0 : v.scale) || 1
6019
6022
  }
6020
- }, l = this.control.hasOffscreenCanvas() && ((y = n.displayer.canvasBgRef.current) == null ? void 0 : y.getBoundingClientRect()) || ((w = n.displayer.canvasContainerRef.current) == null ? void 0 : w.getBoundingClientRect()), h = (v = (N = n.displayer) == null ? void 0 : N.floatBarRef.current) == null ? void 0 : v.getBoundingClientRect(), u = l && [l.x + l.width / 2, l.y + l.height / 2], d = h && [h.x + h.width / 2, h.y + h.height / 2], p = u && n.viewData && n.viewData.convertToPointInWorld({ x: u[0], y: u[1] }), f = d && n.viewData && n.viewData.convertToPointInWorld({ x: d[0], y: d[1] });
6023
+ }, l = this.control.hasOffscreenCanvas() && ((y = n.displayer.canvasBgRef.current) == null ? void 0 : y.getBoundingClientRect()) || ((w = n.displayer.canvasContainerRef.current) == null ? void 0 : w.getBoundingClientRect()), h = (I = (N = n.displayer) == null ? void 0 : N.floatBarRef.current) == null ? void 0 : I.getBoundingClientRect(), u = l && [l.x + l.width / 2, l.y + l.height / 2], d = h && [h.x + h.width / 2, h.y + h.height / 2], p = u && n.viewData && n.viewData.convertToPointInWorld({ x: u[0], y: u[1] }), f = d && n.viewData && n.viewData.convertToPointInWorld({ x: d[0], y: d[1] });
6021
6024
  p && f && (c.offset = {
6022
6025
  x: p.x - f.x,
6023
6026
  y: p.y - f.y
@@ -6037,20 +6040,20 @@ class og extends Et {
6037
6040
  if (!e.size || !this.serviceColloctor || !c)
6038
6041
  return;
6039
6042
  const { offset: l, cameraOpt: h } = i, u = Math.floor(Math.random() * 30 + 1), d = [l.x + u, l.y + u], p = [], f = [];
6040
- for (const [M, I] of e.entries()) {
6043
+ for (const [M, v] of e.entries()) {
6041
6044
  const w = (this.serviceColloctor.isLocalId(M) ? M : this.serviceColloctor.getLocalId(M.toString())) + "-" + a, N = { useAnimation: !1 };
6042
- if (I.toolsType === C.Text && I.opt) {
6043
- const v = I.opt;
6044
- if (v && v.boxPoint && v.text) {
6045
- v.workState = j.Done;
6046
- const k = v.boxPoint;
6047
- v.boxPoint = [k[0] + d[0], k[1] + d[1]], v.workState = j.Done;
6048
- const z = this.control.viewContainerManager.transformToOriginPoint(v.boxPoint, n);
6045
+ if (v.toolsType === C.Text && v.opt) {
6046
+ const I = v.opt;
6047
+ if (I && I.boxPoint && I.text) {
6048
+ I.workState = j.Done;
6049
+ const k = I.boxPoint;
6050
+ I.boxPoint = [k[0] + d[0], k[1] + d[1]], I.workState = j.Done;
6051
+ const z = this.control.viewContainerManager.transformToOriginPoint(I.boxPoint, n);
6049
6052
  this.control.textEditorManager.createTextForMasterController({
6050
6053
  workId: w,
6051
6054
  x: z[0],
6052
6055
  y: z[1],
6053
- opt: v,
6056
+ opt: I,
6054
6057
  scale: ((m = c.cameraOpt) == null ? void 0 : m.scale) || 1,
6055
6058
  type: Vt.Text,
6056
6059
  isActive: !1,
@@ -6059,8 +6062,8 @@ class og extends Et {
6059
6062
  });
6060
6063
  }
6061
6064
  f.push({
6062
- ...I,
6063
- opt: v,
6065
+ ...v,
6066
+ opt: I,
6064
6067
  type: x.FullWork,
6065
6068
  workId: w,
6066
6069
  viewId: n,
@@ -6068,22 +6071,22 @@ class og extends Et {
6068
6071
  });
6069
6072
  continue;
6070
6073
  }
6071
- if (I.toolsType === C.Image && (I.opt.uuid = w, I.opt.centerX = I.opt.centerX + d[0], I.opt.centerY = I.opt.centerY + d[1]), I.ops) {
6072
- const v = Re(I.ops).map((z, L) => {
6074
+ if (v.toolsType === C.Image && (v.opt.uuid = w, v.opt.centerX = v.opt.centerX + d[0], v.opt.centerY = v.opt.centerY + d[1]), v.ops) {
6075
+ const I = Re(v.ops).map((z, L) => {
6073
6076
  const b = L % 3;
6074
6077
  return b === 0 ? z + d[0] : b === 1 ? z + d[1] : z;
6075
- }), k = Ft(v);
6076
- I.ops = k;
6078
+ }), k = Ft(I);
6079
+ v.ops = k;
6077
6080
  }
6078
6081
  f.push({
6079
- ...I,
6082
+ ...v,
6080
6083
  updateNodeOpt: N,
6081
6084
  type: x.FullWork,
6082
6085
  workId: w,
6083
6086
  viewId: n,
6084
6087
  scenePath: s
6085
6088
  }), p.push([{
6086
- ...I,
6089
+ ...v,
6087
6090
  updateNodeOpt: N,
6088
6091
  workId: w,
6089
6092
  msgType: x.FullWork,
@@ -6140,29 +6143,29 @@ class ig extends Et {
6140
6143
  const { workIds: e, strokeColor: i, fillColor: n, fontColor: s, fontBgColor: a, viewId: c, workState: l, thickness: h, strokeType: u } = t, d = this.control.viewContainerManager.getView(c);
6141
6144
  if (!(d != null && d.displayer))
6142
6145
  return;
6143
- const p = d.focusScenePath, f = [...e], m = this.serviceColloctor.storage, M = [], I = {};
6146
+ const p = d.focusScenePath, f = [...e], m = this.serviceColloctor.storage, M = [], v = {};
6144
6147
  for ((l === j.Start || !this.undoTickerId && l === j.Done) && (this.undoTickerId = Date.now(), this.mainEngine.internalMsgEmitter.emit("addUndoTicker", this.undoTickerId, c)); f.length; ) {
6145
6148
  const y = f.pop();
6146
6149
  if (!y)
6147
6150
  continue;
6148
- const w = y.toString(), N = this.serviceColloctor.isLocalId(w), v = N ? this.serviceColloctor.transformKey(y) : w;
6151
+ const w = y.toString(), N = this.serviceColloctor.isLocalId(w), I = N ? this.serviceColloctor.transformKey(y) : w;
6149
6152
  let k = w;
6150
6153
  !N && this.serviceColloctor.isOwn(k) && (k = this.serviceColloctor.getLocalId(k));
6151
- const z = m[c][p][v] || void 0;
6154
+ const z = m[c][p][I] || void 0;
6152
6155
  if (z) {
6153
6156
  const L = z.updateNodeOpt || {};
6154
6157
  if (s || a) {
6155
6158
  if (s) {
6156
6159
  L.fontColor = s;
6157
6160
  const [A, P, O, D] = Fe(s);
6158
- I.textColor = [A, P, O], I.textOpacity = D;
6161
+ v.textColor = [A, P, O], v.textOpacity = D;
6159
6162
  }
6160
6163
  if (a)
6161
6164
  if (L.fontBgColor = He(a) ? "transparent" : a, He(a))
6162
- I.textBgColor = void 0, I.textBgOpacity = void 0;
6165
+ v.textBgColor = void 0, v.textBgOpacity = void 0;
6163
6166
  else {
6164
6167
  const [A, P, O, D] = Fe(a);
6165
- I.textBgColor = [A, P, O], I.textBgOpacity = D;
6168
+ v.textBgColor = [A, P, O], v.textBgOpacity = D;
6166
6169
  }
6167
6170
  if (z.toolsType === C.Text && z.opt && l !== j.Start) {
6168
6171
  this.setTextColor(k, se(z), L, c), l === j.Done && (this.undoTickerId = void 0);
@@ -6172,16 +6175,16 @@ class ig extends Et {
6172
6175
  if (i) {
6173
6176
  L.strokeColor = i;
6174
6177
  const [A, P, O, D] = Fe(i);
6175
- I.strokeColor = [A, P, O], I.strokeOpacity = D;
6178
+ v.strokeColor = [A, P, O], v.strokeOpacity = D;
6176
6179
  }
6177
6180
  if (n)
6178
6181
  if (L.fillColor = He(n) ? "transparent" : n, He(n))
6179
- I.fillColor = void 0, I.fillOpacity = void 0;
6182
+ v.fillColor = void 0, v.fillOpacity = void 0;
6180
6183
  else {
6181
6184
  const [A, P, O, D] = Fe(n);
6182
- I.fillColor = [A, P, O], I.fillOpacity = D;
6185
+ v.fillColor = [A, P, O], v.fillOpacity = D;
6183
6186
  }
6184
- h && (L.thickness = h, I.strokeWidth = h), u && (L.strokeType = u, I.strokeType = u);
6187
+ h && (L.thickness = h, v.strokeWidth = h), u && (L.strokeType = u, v.strokeType = u);
6185
6188
  const b = {
6186
6189
  workId: k,
6187
6190
  msgType: x.UpdateNode,
@@ -6201,9 +6204,9 @@ class ig extends Et {
6201
6204
  }]);
6202
6205
  }
6203
6206
  }
6204
- M.length && (l === j.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(M)), Object.keys(I).length && setTimeout(() => {
6207
+ M.length && (l === j.Done && (this.undoTickerId = void 0), this.collectForLocalWorker(M)), Object.keys(v).length && setTimeout(() => {
6205
6208
  var y;
6206
- (y = this.control.room) == null || y.setMemberState(I);
6209
+ (y = this.control.room) == null || y.setMemberState(v);
6207
6210
  }, 0);
6208
6211
  }
6209
6212
  }
@@ -6267,11 +6270,11 @@ class sg extends Et {
6267
6270
  if (!p)
6268
6271
  continue;
6269
6272
  const f = p.toString(), m = this.serviceColloctor.isLocalId(f), M = m ? this.serviceColloctor.transformKey(p) : f;
6270
- let I = f;
6271
- !m && this.serviceColloctor.isOwn(I) && (I = this.serviceColloctor.getLocalId(I));
6273
+ let v = f;
6274
+ !m && this.serviceColloctor.isOwn(v) && (v = this.serviceColloctor.getLocalId(v));
6272
6275
  const y = se(l[n][a][M]);
6273
6276
  let w;
6274
- if (y && I === U) {
6277
+ if (y && v === U) {
6275
6278
  if (y.selectIds) {
6276
6279
  u.push(...y.selectIds), u.sort((z, L) => {
6277
6280
  var P, O, D, Z;
@@ -6280,7 +6283,7 @@ class sg extends Et {
6280
6283
  });
6281
6284
  const N = y.updateNodeOpt || {};
6282
6285
  N.zIndexLayer = i;
6283
- const v = {
6286
+ const I = {
6284
6287
  workId: p,
6285
6288
  msgType: x.UpdateNode,
6286
6289
  dataType: W.Local,
@@ -6299,7 +6302,7 @@ class sg extends Et {
6299
6302
  updateNodeOpt: A.updateNodeOpt,
6300
6303
  opt: A.opt
6301
6304
  });
6302
- }), v.selectStore = k, v.willSerializeData = !0, h.push([v, {
6305
+ }), I.selectStore = k, I.willSerializeData = !0, h.push([I, {
6303
6306
  workId: p,
6304
6307
  msgType: x.UpdateNode,
6305
6308
  emitEventType: this.emitEventType
@@ -6334,16 +6337,16 @@ class ng extends Et {
6334
6337
  for (p && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", p, a); h.length; ) {
6335
6338
  const m = h.pop();
6336
6339
  if (!m) continue;
6337
- const M = m.toString(), I = this.serviceColloctor.isLocalId(M), y = I && this.serviceColloctor.transformKey(m) || M;
6340
+ const M = m.toString(), v = this.serviceColloctor.isLocalId(M), y = v && this.serviceColloctor.transformKey(m) || M;
6338
6341
  let w = M;
6339
- !I && this.serviceColloctor.isOwn(w) && (w = this.serviceColloctor.getLocalId(w));
6342
+ !v && this.serviceColloctor.isOwn(w) && (w = this.serviceColloctor.getLocalId(w));
6340
6343
  const N = u[a][l][y];
6341
6344
  if (N && w === U) {
6342
6345
  if (N.selectIds) {
6343
- const v = this.control.viewContainerManager.transformToScenePoint([n.x, n.y], a);
6344
- if (s === j.Start && (this.cachePosition = v), this.cachePosition) {
6346
+ const I = this.control.viewContainerManager.transformToScenePoint([n.x, n.y], a);
6347
+ if (s === j.Start && (this.cachePosition = I), this.cachePosition) {
6345
6348
  const k = N.updateNodeOpt || {};
6346
- k.translate = [v[0] - this.cachePosition[0], v[1] - this.cachePosition[1]], k.workState = s;
6349
+ k.translate = [I[0] - this.cachePosition[0], I[1] - this.cachePosition[1]], k.workState = s;
6347
6350
  const z = {
6348
6351
  workId: m,
6349
6352
  msgType: x.UpdateNode,
@@ -6386,12 +6389,12 @@ class rg extends Et {
6386
6389
  continue;
6387
6390
  const p = d.toString(), f = this.serviceColloctor.isLocalId(p), m = f ? this.serviceColloctor.transformKey(d) : p, M = a[i][s][m];
6388
6391
  if (M) {
6389
- let I = p;
6390
- if (!f && this.serviceColloctor.isOwn(I) && (I = this.serviceColloctor.getLocalId(I)), M.toolsType === C.Text) {
6391
- this.control.textEditorManager.delete(I, !0, !0);
6392
+ let v = p;
6393
+ if (!f && this.serviceColloctor.isOwn(v) && (v = this.serviceColloctor.getLocalId(v)), M.toolsType === C.Text) {
6394
+ this.control.textEditorManager.delete(v, !0, !0);
6392
6395
  continue;
6393
6396
  }
6394
- h.push(I);
6397
+ h.push(v);
6395
6398
  }
6396
6399
  }
6397
6400
  h.length && (l.push([{
@@ -6424,7 +6427,7 @@ class ag extends Et {
6424
6427
  return { key: t, textInfo: n };
6425
6428
  }
6426
6429
  async collect(t, e) {
6427
- var y, w, N, v, k;
6430
+ var y, w, N, I, k;
6428
6431
  if (!this.serviceColloctor || !this.mainEngine)
6429
6432
  return;
6430
6433
  const { workIds: i, workState: n, viewId: s, originPoint: a, scenePoint: c, dir: l, scale: h, translate: u } = t;
@@ -6432,8 +6435,8 @@ class ag extends Et {
6432
6435
  const d = this.control.viewContainerManager.getView(s);
6433
6436
  if (!(d != null && d.displayer))
6434
6437
  return;
6435
- const p = d.focusScenePath, f = [...i], m = (y = this.serviceColloctor) == null ? void 0 : y.storage, M = [], I = n === j.Start && Date.now() || void 0;
6436
- for (I && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", I, s); f.length; ) {
6438
+ const p = d.focusScenePath, f = [...i], m = (y = this.serviceColloctor) == null ? void 0 : y.storage, M = [], v = n === j.Start && Date.now() || void 0;
6439
+ for (v && this.mainEngine.internalMsgEmitter.emit("addUndoTicker", v, s); f.length; ) {
6437
6440
  const z = f.pop();
6438
6441
  if (!z)
6439
6442
  continue;
@@ -6448,7 +6451,7 @@ class ag extends Et {
6448
6451
  for (const ct of O.selectIds) {
6449
6452
  const it = (w = this.serviceColloctor) == null ? void 0 : w.isLocalId(ct), F = it && ((N = this.serviceColloctor) == null ? void 0 : N.transformKey(ct)) || ct;
6450
6453
  let J = F;
6451
- !it && ((v = this.serviceColloctor) != null && v.isOwn(F)) && (J = this.serviceColloctor.getLocalId(F));
6454
+ !it && ((I = this.serviceColloctor) != null && I.isOwn(F)) && (J = this.serviceColloctor.getLocalId(F));
6452
6455
  const H = this.control.textEditorManager.get(J);
6453
6456
  H && n === j.Start && this.targetText.set(J, se(H));
6454
6457
  }
@@ -6625,7 +6628,7 @@ class cg extends Et {
6625
6628
  g(this, "cacheOriginRotate", 0);
6626
6629
  }
6627
6630
  collect(t, e) {
6628
- var f, m, M, I, y;
6631
+ var f, m, M, v, y;
6629
6632
  if (!this.serviceColloctor || !this.mainEngine)
6630
6633
  return;
6631
6634
  const { workIds: i, angle: n, workState: s, viewId: a } = t;
@@ -6638,15 +6641,15 @@ class cg extends Et {
6638
6641
  const w = h.pop();
6639
6642
  if (!w)
6640
6643
  continue;
6641
- const N = w.toString(), v = this.serviceColloctor.isLocalId(N), k = v && this.serviceColloctor.transformKey(w) || N;
6644
+ const N = w.toString(), I = this.serviceColloctor.isLocalId(N), k = I && this.serviceColloctor.transformKey(w) || N;
6642
6645
  let z = N;
6643
- !v && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
6646
+ !I && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
6644
6647
  const L = u[a][l][k];
6645
6648
  if (L && z === U) {
6646
6649
  if (((m = L.selectIds) == null ? void 0 : m.length) === 1) {
6647
6650
  const b = L.selectIds[0];
6648
6651
  if (s === j.Start) {
6649
- const D = ((M = this.serviceColloctor) == null ? void 0 : M.isLocalId(b)) && ((I = this.serviceColloctor) == null ? void 0 : I.transformKey(b)) || b, Z = u[a][l][D];
6652
+ const D = ((M = this.serviceColloctor) == null ? void 0 : M.isLocalId(b)) && ((v = this.serviceColloctor) == null ? void 0 : v.transformKey(b)) || b, Z = u[a][l][D];
6650
6653
  this.cacheOriginRotate = ((y = Z == null ? void 0 : Z.opt) == null ? void 0 : y.rotate) || 0;
6651
6654
  }
6652
6655
  const A = L.updateNodeOpt || {};
@@ -6710,7 +6713,7 @@ class hg extends Et {
6710
6713
  }
6711
6714
  }
6712
6715
  async collect(t) {
6713
- var y, w, N, v;
6716
+ var y, w, N, I;
6714
6717
  if (!this.serviceColloctor || !this.mainEngine)
6715
6718
  return;
6716
6719
  const { workIds: e, bold: i, italic: n, lineThrough: s, underline: a, viewId: c, fontSize: l } = t, h = this.control.viewContainerManager.getView(c);
@@ -6739,7 +6742,7 @@ class hg extends Et {
6739
6742
  const Z = (w = this.serviceColloctor) == null ? void 0 : w.isLocalId(D);
6740
6743
  let ct = Z && ((N = this.serviceColloctor) == null ? void 0 : N.transformKey(D)) || D;
6741
6744
  const it = p[c][u][ct] || void 0;
6742
- if (!Z && ((v = this.serviceColloctor) != null && v.isOwn(ct)) && (ct = this.serviceColloctor.getLocalId(ct)), it && it.toolsType === C.Text && P.opt) {
6745
+ if (!Z && ((I = this.serviceColloctor) != null && I.isOwn(ct)) && (ct = this.serviceColloctor.getLocalId(ct)), it && it.toolsType === C.Text && P.opt) {
6743
6746
  const F = this.setTextStyle(ct, Nt(it), O, c);
6744
6747
  M.push(F);
6745
6748
  continue;
@@ -6747,8 +6750,8 @@ class hg extends Et {
6747
6750
  }
6748
6751
  }
6749
6752
  }
6750
- const I = await Promise.all(M);
6751
- for (const k of I)
6753
+ const v = await Promise.all(M);
6754
+ for (const k of v)
6752
6755
  if (k) {
6753
6756
  const { key: z, textInfo: L } = k;
6754
6757
  L && (L.canSync = !0, L.canWorker = !0, this.control.textEditorManager.updateForViewEdited(z, L));
@@ -6781,9 +6784,9 @@ class ug extends Et {
6781
6784
  const p = d.toString(), f = this.serviceColloctor.isLocalId(p), m = f && this.serviceColloctor.transformKey(d) || p;
6782
6785
  let M = p;
6783
6786
  !f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
6784
- const I = l[s][c][m];
6785
- if (I && M === U && I.selectIds) {
6786
- const w = I.updateNodeOpt || {};
6787
+ const v = l[s][c][m];
6788
+ if (v && M === U && v.selectIds) {
6789
+ const w = v.updateNodeOpt || {};
6787
6790
  w.pointMap = i, w.workState = n;
6788
6791
  const N = {
6789
6792
  workId: d,
@@ -6824,9 +6827,9 @@ class dg extends Et {
6824
6827
  const p = d.toString(), f = this.serviceColloctor.isLocalId(p), m = f ? this.serviceColloctor.transformKey(d) : p;
6825
6828
  let M = p;
6826
6829
  !f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
6827
- const I = l[n][a][m] || void 0;
6828
- if (I) {
6829
- const y = I.updateNodeOpt || {};
6830
+ const v = l[n][a][m] || void 0;
6831
+ if (v) {
6832
+ const y = v.updateNodeOpt || {};
6830
6833
  y.isLocked = i;
6831
6834
  const w = {
6832
6835
  workId: M,
@@ -6869,14 +6872,14 @@ class pg extends Et {
6869
6872
  const p = d.toString(), f = this.serviceColloctor.isLocalId(p), m = f ? this.serviceColloctor.transformKey(d) : p;
6870
6873
  let M = p;
6871
6874
  !f && this.serviceColloctor.isOwn(M) && (M = this.serviceColloctor.getLocalId(M));
6872
- const I = l[i][a][m] || void 0;
6873
- if (I) {
6875
+ const v = l[i][a][m] || void 0;
6876
+ if (v) {
6874
6877
  const y = {
6875
- ...I.updateNodeOpt,
6878
+ ...v.updateNodeOpt,
6876
6879
  ...n,
6877
6880
  willRefresh: !0
6878
6881
  };
6879
- if (I && M === U) {
6882
+ if (v && M === U) {
6880
6883
  const w = {
6881
6884
  workId: M,
6882
6885
  msgType: x.UpdateNode,
@@ -7330,7 +7333,7 @@ class wg extends yg {
7330
7333
  async on() {
7331
7334
  if (!this.control.hasOffscreenCanvas()) {
7332
7335
  console.info("no OffscreenCanvas");
7333
- const { MainThreadManagerImpl: t } = await import("./index-C7xQ-iwn.mjs");
7336
+ const { MainThreadManagerImpl: t } = await import("./index-DBzmxM2f.mjs");
7334
7337
  this.mainThread = new t(this);
7335
7338
  return;
7336
7339
  }
@@ -7436,11 +7439,11 @@ class wg extends yg {
7436
7439
  willSyncService: f,
7437
7440
  isSync: m,
7438
7441
  imageBitmap: M,
7439
- canvasHeight: I,
7442
+ canvasHeight: v,
7440
7443
  canvasWidth: y,
7441
7444
  rect: w,
7442
7445
  op: N,
7443
- canTextEdit: v,
7446
+ canTextEdit: I,
7444
7447
  points: k,
7445
7448
  selectorColor: z,
7446
7449
  canRotate: L,
@@ -7463,8 +7466,8 @@ class wg extends yg {
7463
7466
  const rt = a.scenePath || this.viewContainerManager.getCurScenePath(D);
7464
7467
  switch (c) {
7465
7468
  case x.Select: {
7466
- const X = l != null && l.length ? { ...u, selectIds: l, canvasHeight: I, canvasWidth: y, points: k } : void 0;
7467
- X && (h != null && h.strokeColor) && (X.selectorColor = h.strokeColor), X && z && (X.selectorColor = z), X && d && (X.strokeColor = d), X && (h != null && h.fillColor) && (X.fillColor = h.fillColor), X && p && (X.fillColor = p), X && Lt(L) && (X.canRotate = L), X && b && (X.scaleType = b), X && v && (X.canTextEdit = v), X && A && (X.textOpt = A), X && Lt(ct) && (X.canLock = ct), X && Lt(it) && (X.isLocked = it), X && F && (X.shapeOpt = F), X && J && (X.toolsTypes = J), X && H && (X.thickness = H), X && Q && (X.strokeType = Q), X && Lt(K) && (X.useStroke = K), D && this.viewContainerManager.showFloatBar(D, !!X, X), f && ((i = this.collector) == null || i.dispatch({ type: c, selectIds: l, opt: h, isSync: m, viewId: D, scenePath: rt }));
7469
+ const X = l != null && l.length ? { ...u, selectIds: l, canvasHeight: v, canvasWidth: y, points: k } : void 0;
7470
+ X && (h != null && h.strokeColor) && (X.selectorColor = h.strokeColor), X && z && (X.selectorColor = z), X && d && (X.strokeColor = d), X && (h != null && h.fillColor) && (X.fillColor = h.fillColor), X && p && (X.fillColor = p), X && Lt(L) && (X.canRotate = L), X && b && (X.scaleType = b), X && I && (X.canTextEdit = I), X && A && (X.textOpt = A), X && Lt(ct) && (X.canLock = ct), X && Lt(it) && (X.isLocked = it), X && F && (X.shapeOpt = F), X && J && (X.toolsTypes = J), X && H && (X.thickness = H), X && Q && (X.strokeType = Q), X && Lt(K) && (X.useStroke = K), D && this.viewContainerManager.showFloatBar(D, !!X, X), f && ((i = this.collector) == null || i.dispatch({ type: c, selectIds: l, opt: h, isSync: m, viewId: D, scenePath: rt }));
7468
7471
  break;
7469
7472
  }
7470
7473
  case x.Snapshot:
@@ -7529,7 +7532,7 @@ class wg extends yg {
7529
7532
  collectorAsyncData(t) {
7530
7533
  var e, i, n, s;
7531
7534
  for (const a of t) {
7532
- const { type: c, op: l, workId: h, index: u, removeIds: d, ops: p, opt: f, updateNodeOpt: m, toolsType: M, isSync: I, viewId: y, isLockSentEventCursor: w } = a;
7535
+ const { type: c, op: l, workId: h, index: u, removeIds: d, ops: p, opt: f, updateNodeOpt: m, toolsType: M, isSync: v, viewId: y, isLockSentEventCursor: w } = a;
7533
7536
  if (!y) {
7534
7537
  console.error("collectorAsyncData", a);
7535
7538
  return;
@@ -7544,7 +7547,7 @@ class wg extends yg {
7544
7547
  toolsType: M,
7545
7548
  workId: h,
7546
7549
  index: u,
7547
- isSync: I,
7550
+ isSync: v,
7548
7551
  viewId: y,
7549
7552
  scenePath: N,
7550
7553
  updateNodeOpt: m
@@ -7559,7 +7562,7 @@ class wg extends yg {
7559
7562
  updateNodeOpt: m,
7560
7563
  opt: f,
7561
7564
  toolsType: M,
7562
- isSync: I,
7565
+ isSync: v,
7563
7566
  viewId: y,
7564
7567
  scenePath: N
7565
7568
  }), this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
@@ -7570,11 +7573,11 @@ class wg extends yg {
7570
7573
  break;
7571
7574
  }
7572
7575
  case x.UpdateNode: {
7573
- (n = this.collector) == null || n.dispatch({ type: c, updateNodeOpt: m, workId: h, opt: f, ops: p, op: l, isSync: I, viewId: y, scenePath: N });
7576
+ (n = this.collector) == null || n.dispatch({ type: c, updateNodeOpt: m, workId: h, opt: f, ops: p, op: l, isSync: v, viewId: y, scenePath: N });
7574
7577
  break;
7575
7578
  }
7576
7579
  case x.RemoveNode: {
7577
- d && this.control.textEditorManager.deleteBatch(d, !1, !1), (s = this.collector) == null || s.dispatch({ type: c, removeIds: d, isSync: I, viewId: y, scenePath: N }), this.willSelectorWorkId && (d != null && d.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
7580
+ d && this.control.textEditorManager.deleteBatch(d, !1, !1), (s = this.collector) == null || s.dispatch({ type: c, removeIds: d, isSync: v, viewId: y, scenePath: N }), this.willSelectorWorkId && (d != null && d.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
7578
7581
  break;
7579
7582
  }
7580
7583
  }
@@ -7796,7 +7799,7 @@ class wg extends yg {
7796
7799
  });
7797
7800
  }
7798
7801
  onServiceDerive(t, e) {
7799
- var p, f, m, M, I;
7802
+ var p, f, m, M, v;
7800
7803
  const { newValue: i, oldValue: n, viewId: s, scenePath: a } = e, c = Nt(i) || {}, l = t;
7801
7804
  let h = c.type;
7802
7805
  if (!i && n) {
@@ -7813,8 +7816,8 @@ class wg extends yg {
7813
7816
  if (h && l) {
7814
7817
  const y = c;
7815
7818
  if (y.workId = (m = this.collector) != null && m.isOwn(l) ? (M = this.collector) == null ? void 0 : M.getLocalId(l) : l, y.msgType = h, y.toolsType === C.LaserPen && (y.isRunSubWork = !0), y.dataType = W.Service, y.viewId = s, y.scenePath = a, y.selectIds && (y.selectIds = y.selectIds.map((w) => {
7816
- var N, v;
7817
- return (N = this.collector) != null && N.isOwn(w) ? (v = this.collector) == null ? void 0 : v.getLocalId(w) : w;
7819
+ var N, I;
7820
+ return (N = this.collector) != null && N.isOwn(w) ? (I = this.collector) == null ? void 0 : I.getLocalId(w) : w;
7818
7821
  })), y && y.toolsType === C.Text || (n == null ? void 0 : n.toolsType) === C.Text) {
7819
7822
  this.control.textEditorManager.onServiceDerive(y);
7820
7823
  return;
@@ -7822,7 +7825,7 @@ class wg extends yg {
7822
7825
  this.taskBatchData.add(y);
7823
7826
  }
7824
7827
  this.runAnimation();
7825
- const d = e.newValue && ((I = e.newValue.opt) == null ? void 0 : I.zIndex);
7828
+ const d = e.newValue && ((v = e.newValue.opt) == null ? void 0 : v.zIndex);
7826
7829
  if (this.zIndexNodeMethod && et(d)) {
7827
7830
  const y = this.zIndexNodeMethod.getMinZIndex(s);
7828
7831
  this.zIndexNodeMethod.getMaxZIndex(s) < d && this.zIndexNodeMethod.setMaxZIndex(d, s), y > d && this.zIndexNodeMethod.setMinZIndex(d, s);
@@ -7843,8 +7846,8 @@ class wg extends yg {
7843
7846
  if (f && p) {
7844
7847
  const m = n[p];
7845
7848
  if (m.workId = (h = this.collector) != null && h.isOwn(p) ? (u = this.collector) == null ? void 0 : u.getLocalId(p) : p, m.msgType = f, m.dataType = W.Service, m.viewId = t, m.scenePath = e, m.useAnimation = !!a, m.selectIds && (m.selectIds = m.selectIds.map((M) => {
7846
- var I, y;
7847
- return (I = this.collector) != null && I.isOwn(M) ? (y = this.collector) == null ? void 0 : y.getLocalId(M) : M;
7849
+ var v, y;
7850
+ return (v = this.collector) != null && v.isOwn(M) ? (y = this.collector) == null ? void 0 : y.getLocalId(M) : M;
7848
7851
  })), m.toolsType === C.Text) {
7849
7852
  this.control.textEditorManager.onServiceDerive(m);
7850
7853
  continue;
@@ -8188,7 +8191,7 @@ class wg extends yg {
8188
8191
  const f = this.viewContainerManager.mainView;
8189
8192
  if (!f)
8190
8193
  return;
8191
- const m = e || ((h = f.cameraOpt) == null ? void 0 : h.width), M = i || ((u = f.cameraOpt) == null ? void 0 : u.height), I = {
8194
+ const m = e || ((h = f.cameraOpt) == null ? void 0 : h.width), M = i || ((u = f.cameraOpt) == null ? void 0 : u.height), v = {
8192
8195
  msgType: x.Snapshot,
8193
8196
  dataType: W.Local,
8194
8197
  scenePath: t,
@@ -8204,7 +8207,7 @@ class wg extends yg {
8204
8207
  viewId: f.id
8205
8208
  // maxZIndex: this.zIndexNodeMethod?.getMaxZIndex(viewId)
8206
8209
  };
8207
- return this.taskBatchData.add(I), this.runAnimation(), new Promise((y) => {
8210
+ return this.taskBatchData.add(v), this.runAnimation(), new Promise((y) => {
8208
8211
  this.snapshotMap.set(t, y);
8209
8212
  }).then((y) => (this.snapshotMap.delete(t), y));
8210
8213
  }
@@ -8430,7 +8433,7 @@ function Vg(r, o, t) {
8430
8433
  return e = i = void 0, l = k, s = r.apply(L, z), s;
8431
8434
  }
8432
8435
  function f(k) {
8433
- return l = k, a = setTimeout(I, o), h ? p(k) : s;
8436
+ return l = k, a = setTimeout(v, o), h ? p(k) : s;
8434
8437
  }
8435
8438
  function m(k) {
8436
8439
  var z = k - c, L = k - l, b = o - z;
@@ -8440,11 +8443,11 @@ function Vg(r, o, t) {
8440
8443
  var z = k - c, L = k - l;
8441
8444
  return c === void 0 || z >= o || z < 0 || u && L >= n;
8442
8445
  }
8443
- function I() {
8446
+ function v() {
8444
8447
  var k = Co();
8445
8448
  if (M(k))
8446
8449
  return y(k);
8447
- a = setTimeout(I, m(k));
8450
+ a = setTimeout(v, m(k));
8448
8451
  }
8449
8452
  function y(k) {
8450
8453
  return a = void 0, d && e ? p(k) : (e = i = void 0, s);
@@ -8455,17 +8458,17 @@ function Vg(r, o, t) {
8455
8458
  function N() {
8456
8459
  return a === void 0 ? s : y(Co());
8457
8460
  }
8458
- function v() {
8461
+ function I() {
8459
8462
  var k = Co(), z = M(k);
8460
8463
  if (e = arguments, i = this, c = k, z) {
8461
8464
  if (a === void 0)
8462
8465
  return f(c);
8463
8466
  if (u)
8464
- return clearTimeout(a), a = setTimeout(I, o), p(c);
8467
+ return clearTimeout(a), a = setTimeout(v, o), p(c);
8465
8468
  }
8466
- return a === void 0 && (a = setTimeout(I, o)), s;
8469
+ return a === void 0 && (a = setTimeout(v, o)), s;
8467
8470
  }
8468
- return v.cancel = w, v.flush = N, v;
8471
+ return I.cancel = w, I.flush = N, I;
8469
8472
  }
8470
8473
  var Zg = Vg, Gg = Zg, Jg = ie, Xg = "Expected a function";
8471
8474
  function qg(r, o, t) {
@@ -9086,7 +9089,7 @@ const ce = class ce {
9086
9089
  return !!t.includes(e);
9087
9090
  }
9088
9091
  refreshPlugin(o, t = !1) {
9089
- var s, a, c, l, h, u, d, p, f, m, M, I, y, w, N, v, k, z, L, b, A;
9092
+ var s, a, c, l, h, u, d, p, f, m, M, v, y, w, N, I, k, z, L, b, A;
9090
9093
  let e;
9091
9094
  const { scenePath: i } = o, n = o.data;
9092
9095
  if (!(!n || !this.collector))
@@ -9138,7 +9141,7 @@ const ce = class ce {
9138
9141
  H && (D.selectIds = F.filter((Q) => !!Q));
9139
9142
  }
9140
9143
  }
9141
- (I = this.collector) == null || I.updateValue(P.key, P.data, { isAfterUpdate: !0, viewId: this.viewId, scenePath: i, isSync: !0 });
9144
+ (v = this.collector) == null || v.updateValue(P.key, P.data, { isAfterUpdate: !0, viewId: this.viewId, scenePath: i, isSync: !0 });
9142
9145
  }
9143
9146
  }
9144
9147
  break;
@@ -9159,7 +9162,7 @@ const ce = class ce {
9159
9162
  let Q = !1;
9160
9163
  for (const K of H)
9161
9164
  for (let rt = 0; rt < J.length; rt++)
9162
- K != null && K.selectIds && ((v = K.selectIds) != null && v.includes(J[rt])) && (delete J[rt], Q = !0);
9165
+ K != null && K.selectIds && ((I = K.selectIds) != null && I.includes(J[rt])) && (delete J[rt], Q = !0);
9163
9166
  Q && (F.selectIds = J.filter((K) => !!K));
9164
9167
  }
9165
9168
  }
@@ -9341,9 +9344,9 @@ class Pe {
9341
9344
  }
9342
9345
  /** 绘制view */
9343
9346
  render(o) {
9344
- var t, e, i, n, s, a, c, l, h, u, d, p, f, m, M, I, y;
9347
+ var t, e, i, n, s, a, c, l, h, u, d, p, f, m, M, v, y;
9345
9348
  for (const w of o) {
9346
- const { rect: N, imageBitmap: v, isClear: k, isUnClose: z, drawCanvas: L, clearCanvas: b, viewId: A } = w, P = (t = this.getView(A)) == null ? void 0 : t.displayer;
9349
+ const { rect: N, imageBitmap: I, isClear: k, isUnClose: z, drawCanvas: L, clearCanvas: b, viewId: A } = w, P = (t = this.getView(A)) == null ? void 0 : t.displayer;
9347
9350
  if (P && N) {
9348
9351
  const { dpr: O, canvasBgRef: D, canvasFloatRef: Z, canvasServiceFloatRef: ct, canvasTopRef: it } = P, F = Math.floor(N.w * O), J = Math.floor(N.h * O), H = N.x * O, Q = N.y * O;
9349
9352
  if (k) {
@@ -9363,27 +9366,27 @@ class Pe {
9363
9366
  }
9364
9367
  continue;
9365
9368
  }
9366
- if (L && v)
9369
+ if (L && I)
9367
9370
  switch (L) {
9368
9371
  case Gt.TopFloat:
9369
- (d = (u = it.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(v, 0, 0, F, J, H, Q, F, J);
9372
+ (d = (u = it.current) == null ? void 0 : u.getContext("2d")) == null || d.drawImage(I, 0, 0, F, J, H, Q, F, J);
9370
9373
  break;
9371
9374
  case Gt.Float: {
9372
- (f = (p = Z.current) == null ? void 0 : p.getContext("2d")) == null || f.drawImage(v, 0, 0, F, J, H, Q, F, J);
9375
+ (f = (p = Z.current) == null ? void 0 : p.getContext("2d")) == null || f.drawImage(I, 0, 0, F, J, H, Q, F, J);
9373
9376
  break;
9374
9377
  }
9375
9378
  case Gt.ServiceFloat: {
9376
- (M = (m = ct.current) == null ? void 0 : m.getContext("2d")) == null || M.drawImage(v, 0, 0, F, J, H, Q, F, J);
9379
+ (M = (m = ct.current) == null ? void 0 : m.getContext("2d")) == null || M.drawImage(I, 0, 0, F, J, H, Q, F, J);
9377
9380
  break;
9378
9381
  }
9379
9382
  case Gt.Bg: {
9380
- (y = (I = D.current) == null ? void 0 : I.getContext("2d")) == null || y.drawImage(v, 0, 0, F, J, H, Q, F, J);
9383
+ (y = (v = D.current) == null ? void 0 : v.getContext("2d")) == null || y.drawImage(I, 0, 0, F, J, H, Q, F, J);
9381
9384
  break;
9382
9385
  }
9383
9386
  }
9384
9387
  if (z)
9385
9388
  continue;
9386
- v == null || v.close();
9389
+ I == null || I.close();
9387
9390
  }
9388
9391
  }
9389
9392
  }
@@ -10133,11 +10136,11 @@ const MM = (r) => {
10133
10136
  }
10134
10137
  }, [(e == null ? void 0 : e.current) && i, s == null ? void 0 : s.height]), p = G(() => /* @__PURE__ */ T.createElement(wo, { key: "strokeColors", opacity: h, activeColor: c, setCurOpacity: (y, w, N) => {
10135
10138
  N === j.Start && (s != null && s.control.room) && (s.control.room.disableDeviceInputs = !0), N === j.Done && (s != null && s.control.room) && (s.control.room.disableDeviceInputs = !1), u(y);
10136
- const v = mt(w, y);
10137
- i != null && i.strokeColor && a({ strokeColor: v }), q.emitMethod(
10139
+ const I = mt(w, y);
10140
+ i != null && i.strokeColor && a({ strokeColor: I }), q.emitMethod(
10138
10141
  V.MainEngine,
10139
10142
  E.SetColorNode,
10140
- { workIds: [U], strokeColor: v, workState: N, viewId: s == null ? void 0 : s.viewId }
10143
+ { workIds: [U], strokeColor: I, workState: N, viewId: s == null ? void 0 : s.viewId }
10141
10144
  );
10142
10145
  } }), [h, c, s == null ? void 0 : s.control.room, s == null ? void 0 : s.viewId, i]), f = G(() => c && (i != null && i.thickness) ? /* @__PURE__ */ T.createElement(
10143
10146
  IM,
@@ -10193,8 +10196,8 @@ const MM = (r) => {
10193
10196
  key: w,
10194
10197
  color: N,
10195
10198
  activeColor: c,
10196
- onTouchEndHandler: (v) => {
10197
- v.stopPropagation(), l(N);
10199
+ onTouchEndHandler: (I) => {
10200
+ I.stopPropagation(), l(N);
10198
10201
  const k = mt(N, h);
10199
10202
  i != null && i.strokeColor && (i.strokeColor = k, a({ strokeColor: k })), q.emitMethod(
10200
10203
  V.MainEngine,
@@ -10202,8 +10205,8 @@ const MM = (r) => {
10202
10205
  { workIds: [U], workState: j.Done, strokeColor: k, viewId: s == null ? void 0 : s.viewId }
10203
10206
  );
10204
10207
  },
10205
- onClickHandler: (v) => {
10206
- v.cancelable && v.preventDefault(), v.stopPropagation(), l(N);
10208
+ onClickHandler: (I) => {
10209
+ I.cancelable && I.preventDefault(), I.stopPropagation(), l(N);
10207
10210
  const k = mt(N, h);
10208
10211
  i != null && i.strokeColor && (i.strokeColor = k, a({ strokeColor: k })), q.emitMethod(
10209
10212
  V.MainEngine,
@@ -10215,7 +10218,7 @@ const MM = (r) => {
10215
10218
  );
10216
10219
  }),
10217
10220
  p
10218
- ) : null, [o, n, p, c, h, i, s == null ? void 0 : s.viewId, d]), I = G(() => c ? /* @__PURE__ */ T.createElement("div", { className: "color-bar-ring", style: { backgroundColor: mt(c, h) } }, /* @__PURE__ */ T.createElement("div", { className: "circle" })) : null, [c, h]);
10221
+ ) : null, [o, n, p, c, h, i, s == null ? void 0 : s.viewId, d]), v = G(() => c ? /* @__PURE__ */ T.createElement("div", { className: "color-bar-ring", style: { backgroundColor: mt(c, h) } }, /* @__PURE__ */ T.createElement("div", { className: "circle" })) : null, [c, h]);
10219
10222
  return /* @__PURE__ */ T.createElement(
10220
10223
  "div",
10221
10224
  {
@@ -10227,15 +10230,15 @@ const MM = (r) => {
10227
10230
  y.cancelable && y.preventDefault(), y.stopPropagation(), y.nativeEvent.stopImmediatePropagation(), t(!o);
10228
10231
  }
10229
10232
  },
10230
- I,
10233
+ v,
10231
10234
  M
10232
10235
  );
10233
10236
  }, TM = (r) => {
10234
10237
  const { open: o, setOpen: t, floatBarRef: e } = r, { floatBarData: i, floatBarColors: n, mananger: s, setFloatBarData: a } = vt(It), [c, l] = ot(), [h, u] = ot(1);
10235
10238
  dt(() => {
10236
10239
  if (i != null && i.fillColor) {
10237
- const [M, I] = (i == null ? void 0 : i.fillColor) === "transparent" && ["transparent", 1] || Mo(i.fillColor);
10238
- l(M), u(I);
10240
+ const [M, v] = (i == null ? void 0 : i.fillColor) === "transparent" && ["transparent", 1] || Mo(i.fillColor);
10241
+ l(M), u(v);
10239
10242
  }
10240
10243
  }, [i]);
10241
10244
  const d = G(() => {
@@ -10248,13 +10251,13 @@ const MM = (r) => {
10248
10251
  return M.top = "inherit", M.bottom = 50, M;
10249
10252
  }
10250
10253
  }
10251
- }, [e == null ? void 0 : e.current, i, s == null ? void 0 : s.height]), p = G(() => c && c !== "transparent" ? /* @__PURE__ */ T.createElement(wo, { key: "fillColors", opacity: h || 0, activeColor: c, setCurOpacity: (M, I, y) => {
10254
+ }, [e == null ? void 0 : e.current, i, s == null ? void 0 : s.height]), p = G(() => c && c !== "transparent" ? /* @__PURE__ */ T.createElement(wo, { key: "fillColors", opacity: h || 0, activeColor: c, setCurOpacity: (M, v, y) => {
10252
10255
  y === j.Start && (s != null && s.control.room) && (s.control.room.disableDeviceInputs = !0), y === j.Done && (s != null && s.control.room) && (s.control.room.disableDeviceInputs = !1), u(M);
10253
- const w = mt(I, M);
10256
+ const w = mt(v, M);
10254
10257
  i != null && i.fillColor && (i.fillColor = w, a({ fillColor: w })), q.emitMethod(
10255
10258
  V.MainEngine,
10256
10259
  E.SetColorNode,
10257
- { workIds: [U], fillColor: c && mt(I, M), workState: y, viewId: s == null ? void 0 : s.viewId }
10260
+ { workIds: [U], fillColor: c && mt(v, M), workState: y, viewId: s == null ? void 0 : s.viewId }
10258
10261
  );
10259
10262
  } }) : null, [c, h, s == null ? void 0 : s.control.room, s == null ? void 0 : s.viewId, i]), f = G(() => o ? /* @__PURE__ */ T.createElement(
10260
10263
  "div",
@@ -10274,30 +10277,30 @@ const MM = (r) => {
10274
10277
  activeColor: c,
10275
10278
  onTouchEndHandler: (M) => {
10276
10279
  M.stopPropagation(), l("transparent");
10277
- const I = "transparent";
10278
- i != null && i.fillColor && (i.fillColor = I, a({ fillColor: I })), q.emitMethod(
10280
+ const v = "transparent";
10281
+ i != null && i.fillColor && (i.fillColor = v, a({ fillColor: v })), q.emitMethod(
10279
10282
  V.MainEngine,
10280
10283
  E.SetColorNode,
10281
- { workIds: [U], workState: j.Done, fillColor: I, viewId: s == null ? void 0 : s.viewId }
10284
+ { workIds: [U], workState: j.Done, fillColor: v, viewId: s == null ? void 0 : s.viewId }
10282
10285
  );
10283
10286
  },
10284
10287
  onClickHandler: (M) => {
10285
10288
  M.cancelable && M.preventDefault(), M.stopPropagation(), l("transparent");
10286
- const I = "transparent";
10287
- i != null && i.fillColor && (i.fillColor = I, a({ fillColor: I })), q.emitMethod(
10289
+ const v = "transparent";
10290
+ i != null && i.fillColor && (i.fillColor = v, a({ fillColor: v })), q.emitMethod(
10288
10291
  V.MainEngine,
10289
10292
  E.SetColorNode,
10290
- { workIds: [U], workState: j.Done, fillColor: I, viewId: s == null ? void 0 : s.viewId }
10293
+ { workIds: [U], workState: j.Done, fillColor: v, viewId: s == null ? void 0 : s.viewId }
10291
10294
  );
10292
10295
  }
10293
10296
  }
10294
10297
  ),
10295
- n.map((M, I) => {
10298
+ n.map((M, v) => {
10296
10299
  const y = Ye(...M);
10297
10300
  return /* @__PURE__ */ T.createElement(
10298
10301
  yo,
10299
10302
  {
10300
- key: I,
10303
+ key: v,
10301
10304
  color: y,
10302
10305
  activeColor: c,
10303
10306
  onTouchEndHandler: (w) => {
@@ -10360,13 +10363,13 @@ const MM = (r) => {
10360
10363
  }
10361
10364
  }, [n == null ? void 0 : n.current, l, a]), m = G(() => h && h !== "transparent" ? /* @__PURE__ */ T.createElement(wo, { key: "fontColors", opacity: d, activeColor: h, setCurOpacity: (y, w, N) => {
10362
10365
  N === j.Start && (a != null && a.control.room) && (a.control.room.disableDeviceInputs = !0), N === j.Done && (a != null && a.control.room) && (a.control.room.disableDeviceInputs = !1), p(y);
10363
- const v = mt(w, y);
10364
- l != null && l.textOpt && (l.textOpt.fontColor = v, c({ textOpt: l.textOpt })), q.emitMethod(
10366
+ const I = mt(w, y);
10367
+ l != null && l.textOpt && (l.textOpt.fontColor = I, c({ textOpt: l.textOpt })), q.emitMethod(
10365
10368
  V.MainEngine,
10366
10369
  E.SetColorNode,
10367
10370
  {
10368
10371
  workIds: i || [U],
10369
- fontColor: h && v,
10372
+ fontColor: h && I,
10370
10373
  workState: N,
10371
10374
  viewId: a == null ? void 0 : a.viewId
10372
10375
  }
@@ -10391,8 +10394,8 @@ const MM = (r) => {
10391
10394
  key: w,
10392
10395
  color: N,
10393
10396
  activeColor: h,
10394
- onTouchEndHandler: (v) => {
10395
- v.stopPropagation(), u(N);
10397
+ onTouchEndHandler: (I) => {
10398
+ I.stopPropagation(), u(N);
10396
10399
  const k = mt(N, d);
10397
10400
  l != null && l.textOpt && (l.textOpt.fontColor = k, c({ textOpt: l.textOpt })), q.emitMethod(
10398
10401
  V.MainEngine,
@@ -10400,8 +10403,8 @@ const MM = (r) => {
10400
10403
  { workIds: i || [U], workState: j.Done, fontColor: k, viewId: a == null ? void 0 : a.viewId }
10401
10404
  );
10402
10405
  },
10403
- onClickHandler: (v) => {
10404
- v.cancelable && v.preventDefault(), v.stopPropagation(), u(N);
10406
+ onClickHandler: (I) => {
10407
+ I.cancelable && I.preventDefault(), I.stopPropagation(), u(N);
10405
10408
  const k = mt(N, d);
10406
10409
  l != null && l.textOpt && (l.textOpt.fontColor = k, c({ textOpt: l.textOpt })), q.emitMethod(
10407
10410
  V.MainEngine,
@@ -10413,7 +10416,7 @@ const MM = (r) => {
10413
10416
  );
10414
10417
  }),
10415
10418
  m
10416
- ) : null, [o, s, m, h, d, l == null ? void 0 : l.textOpt, i, a == null ? void 0 : a.viewId, f]), I = G(() => {
10419
+ ) : null, [o, s, m, h, d, l == null ? void 0 : l.textOpt, i, a == null ? void 0 : a.viewId, f]), v = G(() => {
10417
10420
  const y = h && h !== "transparent" && mt(h, d) || "transparent";
10418
10421
  return /* @__PURE__ */ T.createElement("div", { className: "color-bar" }, /* @__PURE__ */ T.createElement("div", { className: "color-bar-color", style: { backgroundColor: y } }));
10419
10422
  }, [h, d]);
@@ -10429,7 +10432,7 @@ const MM = (r) => {
10429
10432
  }
10430
10433
  },
10431
10434
  /* @__PURE__ */ T.createElement("img", { alt: "icon", src: kt("font-colors") }),
10432
- I,
10435
+ v,
10433
10436
  M
10434
10437
  );
10435
10438
  }, kM = (r) => {
@@ -10452,8 +10455,8 @@ const MM = (r) => {
10452
10455
  }
10453
10456
  }, [n == null ? void 0 : n.current, l, a]), m = G(() => h && h !== "transparent" ? /* @__PURE__ */ T.createElement(wo, { key: "fontBgColor", opacity: d || 0, activeColor: h, setCurOpacity: (y, w, N) => {
10454
10457
  N === j.Start && (a != null && a.control.room) && (a.control.room.disableDeviceInputs = !0), N === j.Done && (a != null && a.control.room) && (a.control.room.disableDeviceInputs = !1), p(y);
10455
- const v = mt(w, y);
10456
- l != null && l.textOpt && (l.textOpt.fontBgColor = v, c({ textOpt: l.textOpt })), q.emitMethod(
10458
+ const I = mt(w, y);
10459
+ l != null && l.textOpt && (l.textOpt.fontBgColor = I, c({ textOpt: l.textOpt })), q.emitMethod(
10457
10460
  V.MainEngine,
10458
10461
  E.SetColorNode,
10459
10462
  {
@@ -10507,8 +10510,8 @@ const MM = (r) => {
10507
10510
  key: w,
10508
10511
  color: N,
10509
10512
  activeColor: h,
10510
- onTouchEndHandler: (v) => {
10511
- v.stopPropagation(), u(N);
10513
+ onTouchEndHandler: (I) => {
10514
+ I.stopPropagation(), u(N);
10512
10515
  const k = mt(N, d);
10513
10516
  l != null && l.textOpt && (l.textOpt.fontBgColor = k, c({ textOpt: l.textOpt })), q.emitMethod(
10514
10517
  V.MainEngine,
@@ -10516,8 +10519,8 @@ const MM = (r) => {
10516
10519
  { workIds: i || [U], workState: j.Done, fontBgColor: mt(N, d), viewId: a == null ? void 0 : a.viewId }
10517
10520
  );
10518
10521
  },
10519
- onClickHandler: (v) => {
10520
- v.cancelable && v.preventDefault(), v.stopPropagation(), u(N);
10522
+ onClickHandler: (I) => {
10523
+ I.cancelable && I.preventDefault(), I.stopPropagation(), u(N);
10521
10524
  const k = mt(N, d);
10522
10525
  l != null && l.textOpt && (l.textOpt.fontBgColor = k, c({ textOpt: l.textOpt })), q.emitMethod(
10523
10526
  V.MainEngine,
@@ -10529,7 +10532,7 @@ const MM = (r) => {
10529
10532
  );
10530
10533
  }),
10531
10534
  m
10532
- ) : null, [o, s, m, d, h, l == null ? void 0 : l.textOpt, i, a == null ? void 0 : a.viewId, f]), I = G(() => {
10535
+ ) : null, [o, s, m, d, h, l == null ? void 0 : l.textOpt, i, a == null ? void 0 : a.viewId, f]), v = G(() => {
10533
10536
  const y = h && h !== "transparent" && mt(h, d) || "transparent";
10534
10537
  return /* @__PURE__ */ T.createElement("div", { className: "color-bar", style: { marginTop: 0 } }, /* @__PURE__ */ T.createElement("div", { className: "color-bar-color", style: { backgroundColor: y } }));
10535
10538
  }, [h, d]);
@@ -10545,7 +10548,7 @@ const MM = (r) => {
10545
10548
  }
10546
10549
  },
10547
10550
  /* @__PURE__ */ T.createElement(mM, null),
10548
- I,
10551
+ v,
10549
10552
  M
10550
10553
  );
10551
10554
  }, SM = (r) => {
@@ -10625,7 +10628,7 @@ const MM = (r) => {
10625
10628
  dt(() => {
10626
10629
  e != null && e.bold && h(e.bold), Lt(e == null ? void 0 : e.underline) && f(e.underline || !1), Lt(e == null ? void 0 : e.lineThrough) && M(e.lineThrough || !1), e != null && e.italic && d(e.italic);
10627
10630
  }, [e]);
10628
- const I = G(() => {
10631
+ const v = G(() => {
10629
10632
  if (n && (s != null && s.current) && et(c == null ? void 0 : c.y) && (a != null && a.height)) {
10630
10633
  if (s.current.offsetTop && s.current.offsetTop + c.y > 180) {
10631
10634
  const w = {};
@@ -10639,7 +10642,7 @@ const MM = (r) => {
10639
10642
  "div",
10640
10643
  {
10641
10644
  className: "font-style-menu",
10642
- style: I,
10645
+ style: v,
10643
10646
  onTouchEnd: (w) => {
10644
10647
  w.stopPropagation(), w.nativeEvent.stopImmediatePropagation();
10645
10648
  },
@@ -10651,7 +10654,7 @@ const MM = (r) => {
10651
10654
  /* @__PURE__ */ T.createElement(zM, { workIds: i || [U], underline: p, setUnderline: f, viewId: a == null ? void 0 : a.viewId }),
10652
10655
  /* @__PURE__ */ T.createElement(xM, { workIds: i || [U], lineThrough: m, setLineThrough: M, viewId: a == null ? void 0 : a.viewId }),
10653
10656
  /* @__PURE__ */ T.createElement(LM, { workIds: i || [U], italic: u, setItalic: d, viewId: a == null ? void 0 : a.viewId })
10654
- ) : null, [o, i, l, a == null ? void 0 : a.viewId, p, m, u, I]);
10657
+ ) : null, [o, i, l, a == null ? void 0 : a.viewId, p, m, u, v]);
10655
10658
  return /* @__PURE__ */ T.createElement(
10656
10659
  "div",
10657
10660
  {
@@ -10745,7 +10748,7 @@ const MM = (r) => {
10745
10748
  const M = (w) => {
10746
10749
  var N;
10747
10750
  (N = o.current) == null || N.blur(), e(!1), y(w);
10748
- }, I = G(() => t ? /* @__PURE__ */ T.createElement(bM, { onClickHandler: M, style: f }) : null, [t, M, f]), y = (w) => {
10751
+ }, v = G(() => t ? /* @__PURE__ */ T.createElement(bM, { onClickHandler: M, style: f }) : null, [t, M, f]), y = (w) => {
10749
10752
  w > At[p] && (w = At[p]), w < At[0] && (w = At[0]), m(w);
10750
10753
  };
10751
10754
  return dt(() => () => {
@@ -10775,8 +10778,8 @@ const MM = (r) => {
10775
10778
  },
10776
10779
  onKeyDown: (w) => {
10777
10780
  if (w.key === "Backspace") {
10778
- const N = window.getSelection(), v = N == null ? void 0 : N.getRangeAt(0);
10779
- if (v != null && v.collapsed)
10781
+ const N = window.getSelection(), I = N == null ? void 0 : N.getRangeAt(0);
10782
+ if (I != null && I.collapsed)
10780
10783
  return w.cancelable && w.preventDefault(), document.execCommand("delete", !1), !1;
10781
10784
  }
10782
10785
  return !1;
@@ -10784,7 +10787,7 @@ const MM = (r) => {
10784
10787
  onKeyUp: (w) => {
10785
10788
  var N;
10786
10789
  if (o.current) {
10787
- const v = o.current.value, k = parseInt(v);
10790
+ const I = o.current.value, k = parseInt(I);
10788
10791
  isNaN(k) ? o.current.value = "0" : o.current.value = k.toString(), k && w.key === "Enter" && (y(k), (N = o.current) == null || N.blur(), e(!1));
10789
10792
  }
10790
10793
  },
@@ -10819,7 +10822,7 @@ const MM = (r) => {
10819
10822
  }
10820
10823
  }
10821
10824
  )),
10822
- I
10825
+ v
10823
10826
  );
10824
10827
  }, PM = (r) => {
10825
10828
  const { workIds: o, mananger: t, islocked: e } = r;
@@ -11169,57 +11172,57 @@ const MM = (r) => {
11169
11172
  ), [l, h] = T.useState(), u = Ce(null);
11170
11173
  dt(() => {
11171
11174
  var L, b, A, P;
11172
- const v = {}, k = (n == null ? void 0 : n.w) || ((L = o == null ? void 0 : o.boxSize) == null ? void 0 : L[0]) || 0, z = (n == null ? void 0 : n.h) || ((b = o == null ? void 0 : o.boxSize) == null ? void 0 : b[1]) || 0;
11175
+ const I = {}, k = (n == null ? void 0 : n.w) || ((L = o == null ? void 0 : o.boxSize) == null ? void 0 : L[0]) || 0, z = (n == null ? void 0 : n.h) || ((b = o == null ? void 0 : o.boxSize) == null ? void 0 : b[1]) || 0;
11173
11176
  if (i && k && z && (s != null && s.width) && (s != null && s.height)) {
11174
- if (i.y < 60 ? i.y + z < s.height - 60 ? v.bottom = -120 : i.y + z < s.height ? v.bottom = -58 : i.y > 0 ? v.top = 62 : v.top = -i.y + 62 : v.top = 0, i.x < 0)
11175
- v.left = -i.x + 3;
11177
+ if (i.y < 60 ? i.y + z < s.height - 60 ? I.bottom = -120 : i.y + z < s.height ? I.bottom = -58 : i.y > 0 ? I.top = 62 : I.top = -i.y + 62 : I.top = 0, i.x < 0)
11178
+ I.left = -i.x + 3;
11176
11179
  else if (i.x + (((A = u.current) == null ? void 0 : A.offsetWidth) || k) > s.width) {
11177
11180
  const O = s.width - (((P = u.current) == null ? void 0 : P.offsetWidth) || k) - i.x;
11178
- v.left = O;
11181
+ I.left = O;
11179
11182
  }
11180
- h(v);
11183
+ h(I);
11181
11184
  return;
11182
11185
  }
11183
11186
  h(void 0);
11184
11187
  }, [u, i, n == null ? void 0 : n.w, n == null ? void 0 : n.h, s == null ? void 0 : s.width, s == null ? void 0 : s.height, o == null ? void 0 : o.boxSize]);
11185
- const d = G(() => n != null && n.fillColor ? /* @__PURE__ */ T.createElement(TM, { floatBarRef: u, open: a === 3, setOpen: (v) => {
11188
+ const d = G(() => n != null && n.fillColor ? /* @__PURE__ */ T.createElement(TM, { floatBarRef: u, open: a === 3, setOpen: (I) => {
11186
11189
  c(
11187
- v === !0 ? 3 : 0
11190
+ I === !0 ? 3 : 0
11188
11191
  /* FillColor */
11189
11192
  );
11190
- } }) : null, [n == null ? void 0 : n.fillColor, a, u]), p = G(() => n != null && n.strokeColor ? /* @__PURE__ */ T.createElement(NM, { floatBarRef: u, open: a === 2, setOpen: (v) => {
11193
+ } }) : null, [n == null ? void 0 : n.fillColor, a, u]), p = G(() => n != null && n.strokeColor ? /* @__PURE__ */ T.createElement(NM, { floatBarRef: u, open: a === 2, setOpen: (I) => {
11191
11194
  c(
11192
- v === !0 ? 2 : 0
11195
+ I === !0 ? 2 : 0
11193
11196
  /* StrokeColor */
11194
11197
  );
11195
- } }) : null, [n == null ? void 0 : n.strokeColor, a, u]), f = G(() => o != null && o.fontColor && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(CM, { floatBarRef: u, open: a === 4, setOpen: (v) => {
11198
+ } }) : null, [n == null ? void 0 : n.strokeColor, a, u]), f = G(() => o != null && o.fontColor && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(CM, { floatBarRef: u, open: a === 4, setOpen: (I) => {
11196
11199
  c(
11197
- v === !0 ? 4 : 0
11200
+ I === !0 ? 4 : 0
11198
11201
  /* TextColor */
11199
11202
  );
11200
- }, textOpt: o, workIds: t }) : null, [o, a, t, s, u]), m = G(() => o != null && o.fontBgColor && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(kM, { floatBarRef: u, open: a === 5, setOpen: (v) => {
11203
+ }, textOpt: o, workIds: t }) : null, [o, a, t, s, u]), m = G(() => o != null && o.fontBgColor && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(kM, { floatBarRef: u, open: a === 5, setOpen: (I) => {
11201
11204
  c(
11202
- v === !0 ? 5 : 0
11205
+ I === !0 ? 5 : 0
11203
11206
  /* TextBgColor */
11204
11207
  );
11205
- }, textOpt: o, workIds: t }) : null, [o, a, t, s, u]), M = G(() => o && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(jM, { floatBarRef: u, open: a === 6, setOpen: (v) => {
11208
+ }, textOpt: o, workIds: t }) : null, [o, a, t, s, u]), M = G(() => o && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(jM, { floatBarRef: u, open: a === 6, setOpen: (I) => {
11206
11209
  c(
11207
- v === !0 ? 6 : 0
11210
+ I === !0 ? 6 : 0
11208
11211
  /* FontStyle */
11209
11212
  );
11210
- }, textOpt: o, workIds: t, style: l }) : null, [o, a, t, s, l, u]), I = G(() => o && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(DM, { open: a === 7, setOpen: (v) => {
11213
+ }, textOpt: o, workIds: t, style: l }) : null, [o, a, t, s, l, u]), v = G(() => o && (s != null && s.viewId) ? /* @__PURE__ */ T.createElement(DM, { open: a === 7, setOpen: (I) => {
11211
11214
  c(
11212
- v === !0 ? 7 : 0
11215
+ I === !0 ? 7 : 0
11213
11216
  /* FontSize */
11214
11217
  );
11215
- }, textOpt: o, workIds: t, floatBarRef: u }) : null, [o, a, t, s, u]), y = G(() => e ? null : /* @__PURE__ */ T.createElement(wM, { open: a === 1, setOpen: (v) => {
11218
+ }, textOpt: o, workIds: t, floatBarRef: u }) : null, [o, a, t, s, u]), y = G(() => e ? null : /* @__PURE__ */ T.createElement(wM, { open: a === 1, setOpen: (I) => {
11216
11219
  c(
11217
- v === !0 ? 1 : 0
11220
+ I === !0 ? 1 : 0
11218
11221
  /* Layer */
11219
11222
  );
11220
- }, floatBarRef: u }), [e, a, u]), w = G(() => n != null && n.canLock && s ? /* @__PURE__ */ T.createElement(PM, { workIds: t, mananger: s, islocked: n.isLocked }) : null, [n, s, t]), N = G(() => s && (s != null && s.viewId) && l && (n != null && n.shapeOpt) && (n != null && n.toolsTypes) ? /* @__PURE__ */ T.createElement($M, { open: a === 8, setOpen: (v) => {
11223
+ }, floatBarRef: u }), [e, a, u]), w = G(() => n != null && n.canLock && s ? /* @__PURE__ */ T.createElement(PM, { workIds: t, mananger: s, islocked: n.isLocked }) : null, [n, s, t]), N = G(() => s && (s != null && s.viewId) && l && (n != null && n.shapeOpt) && (n != null && n.toolsTypes) ? /* @__PURE__ */ T.createElement($M, { open: a === 8, setOpen: (I) => {
11221
11224
  c(
11222
- v === !0 ? 8 : 0
11225
+ I === !0 ? 8 : 0
11223
11226
  /* ShapeOpt */
11224
11227
  );
11225
11228
  }, floatBarRef: u, workIds: t, toolsTypes: n.toolsTypes, shapeOpt: n.shapeOpt }) : null, [n, s, a, l, t, u]);
@@ -11229,15 +11232,15 @@ const MM = (r) => {
11229
11232
  className: "appliance-plugin-floatbtns",
11230
11233
  style: l,
11231
11234
  ref: u,
11232
- onMouseOver: (v) => (v.stopPropagation(), v.cancelable && v.preventDefault(), s == null || s.control.worker.blurCursor(s.viewId), !1),
11233
- onMouseMove: (v) => (v.stopPropagation(), v.cancelable && v.preventDefault(), !1)
11235
+ onMouseOver: (I) => (I.stopPropagation(), I.cancelable && I.preventDefault(), s == null || s.control.worker.blurCursor(s.viewId), !1),
11236
+ onMouseMove: (I) => (I.stopPropagation(), I.cancelable && I.preventDefault(), !1)
11234
11237
  },
11235
11238
  s && /* @__PURE__ */ T.createElement(MM, { workIds: t, mananger: s }),
11236
11239
  y,
11237
11240
  w,
11238
11241
  !!(s != null && s.viewId) && /* @__PURE__ */ T.createElement(yM, { workIds: t, viewId: s.viewId }),
11239
11242
  N,
11240
- I,
11243
+ v,
11241
11244
  M,
11242
11245
  f,
11243
11246
  m,
@@ -11252,24 +11255,24 @@ const MM = (r) => {
11252
11255
  fontColor: f,
11253
11256
  lineThrough: m,
11254
11257
  textAlign: M,
11255
- strokeColor: I,
11258
+ strokeColor: v,
11256
11259
  lineHeight: y,
11257
11260
  bold: w,
11258
11261
  italic: N,
11259
- uid: v,
11262
+ uid: I,
11260
11263
  workState: k
11261
11264
  } = n, z = u, L = y || z * 1.2, b = {
11262
11265
  fontSize: `${z}px`,
11263
11266
  lineHeight: `${L}px`,
11264
11267
  color: f,
11265
- borderColor: I,
11268
+ borderColor: v,
11266
11269
  minHeight: `${L}px`,
11267
11270
  paddingRight: `${N === "italic" ? Math.round(z * 0.3) : 5}px`
11268
11271
  };
11269
11272
  d && (b.fontFamily = `${d}`), (m || p) && (b.textDecoration = `${m && "line-through" || ""}${p && " underline" || ""}`), w && (b.fontWeight = `${w}`), N && (b.fontStyle = `${N}`), M && (b.textAlign = `${M}`);
11270
11273
  function A() {
11271
11274
  var O;
11272
- t && (v && v === ((O = e.control.collector) == null ? void 0 : O.uid) || !v) && e.control.textEditorManager.active(i);
11275
+ t && (I && I === ((O = e.control.collector) == null ? void 0 : O.uid) || !I) && e.control.textEditorManager.active(i);
11273
11276
  }
11274
11277
  const P = G(() => {
11275
11278
  const O = [];
@@ -11331,18 +11334,18 @@ const MM = (r) => {
11331
11334
  fontColor: f,
11332
11335
  lineThrough: m,
11333
11336
  textAlign: M,
11334
- strokeColor: I,
11337
+ strokeColor: v,
11335
11338
  lineHeight: y,
11336
11339
  bold: w,
11337
11340
  italic: N
11338
- } = s, v = u, k = y || v * 1.2, z = {
11339
- fontSize: `${v}px`,
11341
+ } = s, I = u, k = y || I * 1.2, z = {
11342
+ fontSize: `${I}px`,
11340
11343
  lineHeight: `${k}px`,
11341
11344
  color: f,
11342
- borderColor: I,
11345
+ borderColor: v,
11343
11346
  minHeight: `${k}px`,
11344
11347
  pointerEvents: "none",
11345
- paddingRight: `${N === "italic" ? Math.round(v * 0.3) : 5}px`
11348
+ paddingRight: `${N === "italic" ? Math.round(I * 0.3) : 5}px`
11346
11349
  };
11347
11350
  d && (z.fontFamily = `${d}`), (m || p) && (z.textDecoration = `${m && "line-through" || ""}${p && " underline" || ""}`), M && (z.textAlign = `${M}`), w && (z.fontWeight = `${w}`), N && (z.fontStyle = `${N}`);
11348
11351
  const L = G(() => {
@@ -11384,11 +11387,11 @@ const MM = (r) => {
11384
11387
  (r, o) => !(r.workId !== o.workId || r.left !== o.left || r.top !== o.top || !ft(r.data, o.data))
11385
11388
  ), QM = (r) => {
11386
11389
  const { data: o, workId: t, isSelect: e, showFloatBtns: i, handleKeyUp: n, handleFocus: s, updateOptInfo: a, manager: c, runAnimation: l } = r, [h, u] = ot(), { opt: d, scale: p, translate: f, x: m, y: M } = o, {
11387
- fontSize: I,
11390
+ fontSize: v,
11388
11391
  fontFamily: y,
11389
11392
  underline: w,
11390
11393
  fontColor: N,
11391
- lineThrough: v,
11394
+ lineThrough: I,
11392
11395
  textAlign: k,
11393
11396
  strokeColor: z,
11394
11397
  lineHeight: L,
@@ -11396,7 +11399,7 @@ const MM = (r) => {
11396
11399
  italic: A,
11397
11400
  boxSize: P
11398
11401
  } = d, O = Ce(null), D = G(() => {
11399
- const st = I, at = L || st * 1.2, tt = {
11402
+ const st = v, at = L || st * 1.2, tt = {
11400
11403
  fontSize: `${st}px`,
11401
11404
  lineHeight: `${at}px`,
11402
11405
  color: N,
@@ -11405,8 +11408,8 @@ const MM = (r) => {
11405
11408
  paddingRight: `${A === "italic" ? Math.round(st * 0.3) : 5}px`,
11406
11409
  borderWidth: `${Math.max(Math.round(1 / (p || 1)), 1)}px`
11407
11410
  };
11408
- return y && (tt.fontFamily = `${y}`), (v || w) && (tt.textDecoration = `${v && "line-through" || ""} ${w && " underline" || ""}`), k && (tt.textAlign = `${k}`), b && (tt.fontWeight = `${b}`), A && (tt.fontStyle = `${A}`), tt;
11409
- }, [b, N, y, I, A, L, v, p, z, k, w]), Z = G(() => {
11411
+ return y && (tt.fontFamily = `${y}`), (I || w) && (tt.textDecoration = `${I && "line-through" || ""} ${w && " underline" || ""}`), k && (tt.textAlign = `${k}`), b && (tt.fontWeight = `${b}`), A && (tt.fontStyle = `${A}`), tt;
11412
+ }, [b, N, y, v, A, L, I, p, z, k, w]), Z = G(() => {
11410
11413
  const st = `scale(${p || 1}) ${f && "translate(" + f[0] + "px," + f[1] + "px)" || ""}`;
11411
11414
  return {
11412
11415
  left: `${m}px`,
@@ -11827,23 +11830,23 @@ const ZM = () => {
11827
11830
  return;
11828
11831
  }
11829
11832
  c(!0);
11830
- const v = Math.round($.GetAngleByPoints(l, u, new $(N.x, N.y))) || 0;
11831
- i(v), n(E.RotateNode), s != null && s.control.room && (s.control.room.disableDeviceInputs = !0), q.emitMethod(
11833
+ const I = Math.round($.GetAngleByPoints(l, u, new $(N.x, N.y))) || 0;
11834
+ i(I), n(E.RotateNode), s != null && s.control.room && (s.control.room.disableDeviceInputs = !0), q.emitMethod(
11832
11835
  V.MainEngine,
11833
11836
  E.RotateNode,
11834
- { workIds: [U], angle: v, workState: j.Start, viewId: s == null ? void 0 : s.viewId }
11837
+ { workIds: [U], angle: I, workState: j.Start, viewId: s == null ? void 0 : s.viewId }
11835
11838
  );
11836
- }, I = so((w, N) => {
11839
+ }, v = so((w, N) => {
11837
11840
  if (w.cancelable && w.preventDefault(), w.stopPropagation(), s != null && s.control.worker.isBusy) {
11838
11841
  f(!0);
11839
11842
  return;
11840
11843
  }
11841
11844
  c(!1);
11842
- const v = Math.round($.GetAngleByPoints(l, u, new $(N.x, N.y))) || 0;
11843
- i(v), n(E.None), s != null && s.control.room && (s.control.room.disableDeviceInputs = !1), q.emitMethod(
11845
+ const I = Math.round($.GetAngleByPoints(l, u, new $(N.x, N.y))) || 0;
11846
+ i(I), n(E.None), s != null && s.control.room && (s.control.room.disableDeviceInputs = !1), q.emitMethod(
11844
11847
  V.MainEngine,
11845
11848
  E.RotateNode,
11846
- { workIds: [U], angle: v, workState: j.Done, viewId: s == null ? void 0 : s.viewId }
11849
+ { workIds: [U], angle: I, workState: j.Done, viewId: s == null ? void 0 : s.viewId }
11847
11850
  );
11848
11851
  }, 100, { leading: !1 }), y = so((w, N) => {
11849
11852
  if (w.cancelable && w.preventDefault(), w.stopPropagation(), s != null && s.control.worker.isBusy) {
@@ -11851,11 +11854,11 @@ const ZM = () => {
11851
11854
  return;
11852
11855
  }
11853
11856
  c(!0);
11854
- const v = Math.round($.GetAngleByPoints(l, u, new $(N.x, N.y))) || 0;
11855
- i(v), n(E.RotateNode), q.emitMethod(
11857
+ const I = Math.round($.GetAngleByPoints(l, u, new $(N.x, N.y))) || 0;
11858
+ i(I), n(E.RotateNode), q.emitMethod(
11856
11859
  V.MainEngine,
11857
11860
  E.RotateNode,
11858
- { workIds: [U], angle: v, workState: j.Doing, viewId: s == null ? void 0 : s.viewId }
11861
+ { workIds: [U], angle: I, workState: j.Doing, viewId: s == null ? void 0 : s.viewId }
11859
11862
  );
11860
11863
  }, 100, { leading: !1 });
11861
11864
  return /* @__PURE__ */ T.createElement(
@@ -11865,7 +11868,7 @@ const ZM = () => {
11865
11868
  handle: ".appliance-plugin-rotate-mouse-pointer",
11866
11869
  onStart: M,
11867
11870
  onDrag: y,
11868
- onStop: I
11871
+ onStop: v
11869
11872
  },
11870
11873
  /* @__PURE__ */ T.createElement(
11871
11874
  "div",
@@ -11919,24 +11922,24 @@ const ZM = () => {
11919
11922
  return;
11920
11923
  }
11921
11924
  w.stopPropagation();
11922
- const v = { x: N.x, y: N.y };
11925
+ const I = { x: N.x, y: N.y };
11923
11926
  t(E.None), s(j.Done), e != null && e.control.room && (e.control.room.disableDeviceInputs = !1), q.emitMethod(
11924
11927
  V.MainEngine,
11925
11928
  E.TranslateNode,
11926
- { workIds: [U], position: v, workState: j.Done, viewId: e == null ? void 0 : e.viewId }
11929
+ { workIds: [U], position: I, workState: j.Done, viewId: e == null ? void 0 : e.viewId }
11927
11930
  );
11928
11931
  }, 100, { leading: !1 }), M = St((w, N) => {
11929
11932
  if (w.cancelable && w.preventDefault(), w.stopPropagation(), e != null && e.control.worker.isBusy) {
11930
11933
  d(!0), s(j.Pending);
11931
11934
  return;
11932
11935
  }
11933
- const v = { x: N.x, y: N.y };
11936
+ const I = { x: N.x, y: N.y };
11934
11937
  (N.x !== (o == null ? void 0 : o.x) || N.y !== (o == null ? void 0 : o.y)) && (s(j.Doing), q.emitMethod(
11935
11938
  V.MainEngine,
11936
11939
  E.TranslateNode,
11937
- { workIds: [U], position: v, workState: j.Doing, viewId: e == null ? void 0 : e.viewId }
11940
+ { workIds: [U], position: I, workState: j.Doing, viewId: e == null ? void 0 : e.viewId }
11938
11941
  ));
11939
- }, 100, { leading: !1 }), I = G(() => !!((o == null ? void 0 : o.scaleType) === ht.none && (o != null && o.canLock)), [o]), y = St((w) => (w.stopPropagation(), w.cancelable && w.preventDefault(), (a == null ? void 0 : a.x) === (o == null ? void 0 : o.x) && (a == null ? void 0 : a.y) === (o == null ? void 0 : o.y) && i(w), !1), 100, { leading: !1 });
11942
+ }, 100, { leading: !1 }), v = G(() => !!((o == null ? void 0 : o.scaleType) === ht.none && (o != null && o.canLock)), [o]), y = St((w) => (w.stopPropagation(), w.cancelable && w.preventDefault(), (a == null ? void 0 : a.x) === (o == null ? void 0 : o.x) && (a == null ? void 0 : a.y) === (o == null ? void 0 : o.y) && i(w), !1), 100, { leading: !1 });
11940
11943
  return /* @__PURE__ */ T.createElement(
11941
11944
  ke,
11942
11945
  {
@@ -11956,7 +11959,7 @@ const ZM = () => {
11956
11959
  width: o.w,
11957
11960
  height: o.h,
11958
11961
  zIndex: 2,
11959
- pointerEvents: I ? "none" : "auto",
11962
+ pointerEvents: v ? "none" : "auto",
11960
11963
  touchAction: "none"
11961
11964
  } : void 0,
11962
11965
  onClick: (w) => {
@@ -11986,7 +11989,7 @@ const ZM = () => {
11986
11989
  return;
11987
11990
  }
11988
11991
  m(!1), (L = u == null ? void 0 : u.control.room) != null && L.disableDeviceInputs && (u.control.room.disableDeviceInputs = !1);
11989
- }, I = (z) => [
11992
+ }, v = (z) => [
11990
11993
  [z.x, z.y],
11991
11994
  [z.x + z.w, z.y],
11992
11995
  [z.x + z.w, z.y + z.h],
@@ -12065,7 +12068,7 @@ const ZM = () => {
12065
12068
  }
12066
12069
  }
12067
12070
  Z[0] = D.w / t.w, Z[1] = D.h / t.h;
12068
- const F = I(D).map((H) => b.control.viewContainerManager.transformToScenePoint(H, b.viewId)), J = y(F, z);
12071
+ const F = v(D).map((H) => b.control.viewContainerManager.transformToScenePoint(H, b.viewId)), J = y(F, z);
12069
12072
  return O && (ct[1] = J[1] - A[1]), P && (ct[0] = J[0] - A[0]), { scale: Z, translate: ct };
12070
12073
  }, N = (z, L) => {
12071
12074
  if (z.cancelable && z.preventDefault(), z.stopPropagation(), u != null && u.control.worker.isBusy) {
@@ -12073,14 +12076,14 @@ const ZM = () => {
12073
12076
  return;
12074
12077
  }
12075
12078
  if (h != null && h.w && (h != null && h.h) && u) {
12076
- const b = { x: h.x, y: h.y, w: h.w, h: h.h }, A = I(b), P = A.map((Z) => u.control.viewContainerManager.transformToScenePoint(Z, u.viewId)), O = y(A, L), D = y(P, L);
12079
+ const b = { x: h.x, y: h.y, w: h.w, h: h.h }, A = v(b), P = A.map((Z) => u.control.viewContainerManager.transformToScenePoint(Z, u.viewId)), O = y(A, L), D = y(P, L);
12077
12080
  e(b), n(O), a(D), l(L), u != null && u.control.room && (u.control.room.disableDeviceInputs = !0), q.emitMethod(
12078
12081
  V.MainEngine,
12079
12082
  E.ScaleNode,
12080
12083
  { workIds: [U], originPoint: O, scenePoint: D, workState: j.Start, viewId: u.viewId }
12081
12084
  );
12082
12085
  }
12083
- }, v = St((z, L, b, A) => {
12086
+ }, I = St((z, L, b, A) => {
12084
12087
  if (z.cancelable && z.preventDefault(), z.stopPropagation(), !u || !i || !s)
12085
12088
  return;
12086
12089
  if (u != null && u.control.worker.isBusy) {
@@ -12141,7 +12144,7 @@ const ZM = () => {
12141
12144
  },
12142
12145
  lockAspectRatio: (h == null ? void 0 : h.scaleType) === ht.proportional,
12143
12146
  onResizeStart: N,
12144
- onResize: v,
12147
+ onResize: I,
12145
12148
  onResizeStop: k
12146
12149
  }
12147
12150
  );
@@ -12178,14 +12181,14 @@ const ZM = () => {
12178
12181
  }
12179
12182
  const N = { x: w.x, y: w.y };
12180
12183
  if ((N.x !== (t == null ? void 0 : t.x) || N.y !== (t == null ? void 0 : t.y)) && (s != null && s.control.viewContainerManager)) {
12181
- const v = s.control.viewContainerManager.transformToScenePoint([N.x, N.y], s.viewId), k = e.get(o);
12182
- k && i === "start" ? k[0] = v : k && i === "end" && (k[1] = v), u(j.Doing), q.emitMethod(
12184
+ const I = s.control.viewContainerManager.transformToScenePoint([N.x, N.y], s.viewId), k = e.get(o);
12185
+ k && i === "start" ? k[0] = I : k && i === "end" && (k[1] = I), u(j.Doing), q.emitMethod(
12183
12186
  V.MainEngine,
12184
12187
  E.SetPoint,
12185
12188
  { workId: U, pointMap: e, workState: j.Doing, viewId: s == null ? void 0 : s.viewId }
12186
12189
  );
12187
12190
  }
12188
- }, 100, { leading: !1 }), I = St((y, w) => {
12191
+ }, 100, { leading: !1 }), v = St((y, w) => {
12189
12192
  if (y.cancelable && y.preventDefault(), s != null && s.control.worker.isBusy) {
12190
12193
  p(!0), u(j.Pending);
12191
12194
  return;
@@ -12193,8 +12196,8 @@ const ZM = () => {
12193
12196
  y.stopPropagation(), n(E.None), u(j.Done);
12194
12197
  const N = { x: w.x, y: w.y };
12195
12198
  if (s != null && s.control.viewContainerManager) {
12196
- const v = s.control.viewContainerManager.transformToScenePoint([N.x, N.y], s.viewId), k = e.get(o);
12197
- k && i === "start" ? k[0] = v : k && i === "end" && (k[1] = v), s != null && s.control.room && (s.control.room.disableDeviceInputs = !1), q.emitMethod(
12199
+ const I = s.control.viewContainerManager.transformToScenePoint([N.x, N.y], s.viewId), k = e.get(o);
12200
+ k && i === "start" ? k[0] = I : k && i === "end" && (k[1] = I), s != null && s.control.room && (s.control.room.disableDeviceInputs = !1), q.emitMethod(
12198
12201
  V.MainEngine,
12199
12202
  E.SetPoint,
12200
12203
  { workId: U, pointMap: e, workState: j.Done, viewId: s == null ? void 0 : s.viewId }
@@ -12208,7 +12211,7 @@ const ZM = () => {
12208
12211
  position: c,
12209
12212
  onStart: m,
12210
12213
  onDrag: M,
12211
- onStop: I
12214
+ onStop: v
12212
12215
  },
12213
12216
  /* @__PURE__ */ T.createElement(
12214
12217
  "div",
@@ -13022,21 +13025,21 @@ const B = class B extends Bi {
13022
13025
  const f = (t.mainView || i).getBoundingRect(p), m = await ((M = B.currentManager) == null ? void 0 : M.getBoundingRect(p));
13023
13026
  return !f.width || !f.height ? m : js(f, m);
13024
13027
  },
13025
- screenshotToCanvasAsync: async function(p, f, m, M, I, y) {
13028
+ screenshotToCanvasAsync: async function(p, f, m, M, v, y) {
13026
13029
  var L;
13027
13030
  B.logger.info("[ApplianceMultiPlugin] screenshotToCanvasAsync");
13028
- let w = m, N = M, v = I.scale;
13029
- w > this.maxScreenshotWidth && (v = this.maxScreenshotWidth / w * v, w = this.maxScreenshotWidth), N > this.maxScreenshotHeight && (v = Math.min(this.maxScreenshotHeight / N * v, v), N = this.maxScreenshotHeight), I.scale = v;
13031
+ let w = m, N = M, I = v.scale;
13032
+ w > this.maxScreenshotWidth && (I = this.maxScreenshotWidth / w * I, w = this.maxScreenshotWidth), N > this.maxScreenshotHeight && (I = Math.min(this.maxScreenshotHeight / N * I, I), N = this.maxScreenshotHeight), v.scale = I;
13030
13033
  const k = document.createElement("canvas"), z = k.getContext("2d");
13031
- k.width = w * (y || 1), k.height = N * (y || 1), z && ((t.mainView || i).screenshotToCanvas(z, f, w, N, I, y), p.drawImage(k, Math.floor((m - w) / 2), Math.floor((M - N) / 2), w * (y || 1), N * (y || 1), 0, 0, w, N), k.remove()), B.currentManager && await ((L = B.currentManager) == null ? void 0 : L.screenshotToCanvas(p, f, w, N, I, Math.floor((m - w) / 2), Math.floor((M - N) / 2)));
13034
+ k.width = w * (y || 1), k.height = N * (y || 1), z && ((t.mainView || i).screenshotToCanvas(z, f, w, N, v, y), p.drawImage(k, Math.floor((m - w) / 2), Math.floor((M - N) / 2), w * (y || 1), N * (y || 1), 0, 0, w, N), k.remove()), B.currentManager && await ((L = B.currentManager) == null ? void 0 : L.screenshotToCanvas(p, f, w, N, v, Math.floor((m - w) / 2), Math.floor((M - N) / 2)));
13032
13035
  },
13033
- scenePreviewAsync: async function(p, f, m, M, I) {
13034
- B.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || i).scenePreview(p, f, m, M, I);
13036
+ scenePreviewAsync: async function(p, f, m, M, v) {
13037
+ B.logger.info("[ApplianceMultiPlugin] scenePreviewAsync"), (t.mainView || i).scenePreview(p, f, m, M, v);
13035
13038
  const y = document.createElement("img");
13036
13039
  y.className = "appliance-plugin-fill-scene-snapshot-img", f.append(y), getComputedStyle(f).position || (f.style.position = "relative"), B.currentManager && await B.currentManager.scenePreview(p, y);
13037
13040
  },
13038
- fillSceneSnapshotAsync: async function(p, f, m, M, I) {
13039
- B.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), f.innerHTML = "", (t.mainView || i).fillSceneSnapshot(p, f, m, M, I);
13041
+ fillSceneSnapshotAsync: async function(p, f, m, M, v) {
13042
+ B.logger.info("[ApplianceMultiPlugin] fillSceneSnapshotAsync"), f.innerHTML = "", (t.mainView || i).fillSceneSnapshot(p, f, m, M, v);
13040
13043
  const y = m || t.mainView.size.width, w = M || t.mainView.size.height;
13041
13044
  let N = await this.getBoundingRectAsync(p);
13042
13045
  N || (N = {
@@ -13045,15 +13048,15 @@ const B = class B extends Bi {
13045
13048
  width: y,
13046
13049
  height: w
13047
13050
  });
13048
- let v = Math.max(N == null ? void 0 : N.width, y), k = Math.max(N == null ? void 0 : N.height, w), z = 1;
13049
- const L = v > y && Math.min(y / v, z) || z, b = k > w && Math.min(w / k, z) || z;
13050
- L <= b ? (v = L < 1 && y || v, k = Math.floor(k * L) + 1, z = L) : L > b && (k = b < 1 && w || k, v = Math.floor(v * b) + 1, z = b);
13051
+ let I = Math.max(N == null ? void 0 : N.width, y), k = Math.max(N == null ? void 0 : N.height, w), z = 1;
13052
+ const L = I > y && Math.min(y / I, z) || z, b = k > w && Math.min(w / k, z) || z;
13053
+ L <= b ? (I = L < 1 && y || I, k = Math.floor(k * L) + 1, z = L) : L > b && (k = b < 1 && w || k, I = Math.floor(I * b) + 1, z = b);
13051
13054
  const A = {
13052
13055
  scale: z,
13053
13056
  centerX: N.originX + N.width / 2,
13054
13057
  centerY: N.originY + N.height / 2
13055
13058
  }, P = document.createElement("canvas"), O = P.getContext("2d");
13056
- P.width = v, P.height = k, O && await this.screenshotToCanvasAsync(O, p, v, k, A, devicePixelRatio);
13059
+ P.width = I, P.height = k, O && await this.screenshotToCanvasAsync(O, p, I, k, A, devicePixelRatio);
13057
13060
  const D = document.createElement("img");
13058
13061
  D.className = "appliance-plugin-fill-scene-snapshot-img", D.src = P.toDataURL(), D.onload = () => {
13059
13062
  P.remove();
@@ -13468,39 +13471,39 @@ const Y = class Y extends Bi {
13468
13471
  const p = t.getBoundingRect(d), f = await ((m = Y.currentManager) == null ? void 0 : m.getBoundingRect(d));
13469
13472
  return !p.width || !p.height ? f : js(p, f);
13470
13473
  },
13471
- screenshotToCanvasAsync: async function(d, p, f, m, M, I) {
13474
+ screenshotToCanvasAsync: async function(d, p, f, m, M, v) {
13472
13475
  var z;
13473
13476
  Y.logger.info("[ApplianceSinglePlugin] screenshotToCanvasAsync");
13474
13477
  let y = f, w = m, N = M.scale;
13475
13478
  y > this.maxScreenshotWidth && (N = this.maxScreenshotWidth / y * N, y = this.maxScreenshotWidth), w > this.maxScreenshotHeight && (N = Math.min(this.maxScreenshotHeight / w * N, N), w = this.maxScreenshotHeight), M.scale = N;
13476
- const v = document.createElement("canvas"), k = v.getContext("2d");
13477
- v.width = y * (I || 1), v.height = w * (I || 1), k && (t.screenshotToCanvas(k, p, y, w, M, I), d.drawImage(v, Math.floor((f - y) / 2), Math.floor((m - w) / 2), y * (I || 1), w * (I || 1), 0, 0, y, w), v.remove()), Y.currentManager && await ((z = Y.currentManager) == null ? void 0 : z.screenshotToCanvas(d, p, y, w, M, Math.floor((f - y) / 2), Math.floor((m - w) / 2)));
13479
+ const I = document.createElement("canvas"), k = I.getContext("2d");
13480
+ I.width = y * (v || 1), I.height = w * (v || 1), k && (t.screenshotToCanvas(k, p, y, w, M, v), d.drawImage(I, Math.floor((f - y) / 2), Math.floor((m - w) / 2), y * (v || 1), w * (v || 1), 0, 0, y, w), I.remove()), Y.currentManager && await ((z = Y.currentManager) == null ? void 0 : z.screenshotToCanvas(d, p, y, w, M, Math.floor((f - y) / 2), Math.floor((m - w) / 2)));
13478
13481
  },
13479
13482
  scenePreviewAsync: async function(d, p, f, m, M) {
13480
13483
  Y.logger.info("[ApplianceSinglePlugin] scenePreviewAsync"), t.scenePreview(d, p, f, m, M);
13481
- const I = document.createElement("img");
13482
- I.className = "appliance-plugin-fill-scene-snapshot-img", p.append(I), getComputedStyle(p).position || (p.style.position = "relative"), Y.currentManager && await Y.currentManager.scenePreview(d, I);
13484
+ const v = document.createElement("img");
13485
+ v.className = "appliance-plugin-fill-scene-snapshot-img", p.append(v), getComputedStyle(p).position || (p.style.position = "relative"), Y.currentManager && await Y.currentManager.scenePreview(d, v);
13483
13486
  },
13484
13487
  fillSceneSnapshotAsync: async function(d, p, f, m, M) {
13485
13488
  var D, Z;
13486
13489
  Y.logger.info("[ApplianceSinglePlugin] fillSceneSnapshotAsync"), p.innerHTML = "", t.fillSceneSnapshot(d, p, f, m, M);
13487
- const I = f || ((D = t.state.cameraState) == null ? void 0 : D.width) || 0, y = m || ((Z = t.state.cameraState) == null ? void 0 : Z.height) || 0;
13490
+ const v = f || ((D = t.state.cameraState) == null ? void 0 : D.width) || 0, y = m || ((Z = t.state.cameraState) == null ? void 0 : Z.height) || 0;
13488
13491
  let w = await this.getBoundingRectAsync(d);
13489
13492
  w || (w = {
13490
13493
  originX: 0,
13491
13494
  originY: 0,
13492
- width: I,
13495
+ width: v,
13493
13496
  height: y
13494
13497
  });
13495
- let N = Math.max(w == null ? void 0 : w.width, I), v = Math.max(w == null ? void 0 : w.height, y), k = 1;
13496
- const z = N > I && Math.min(I / N, k) || k, L = v > y && Math.min(y / v, k) || k;
13497
- z <= L ? (N = z < 1 && I || N, v = Math.floor(v * z) + 1, k = z) : z > L && (v = L < 1 && y || v, N = Math.floor(N * L) + 1, k = L);
13498
+ let N = Math.max(w == null ? void 0 : w.width, v), I = Math.max(w == null ? void 0 : w.height, y), k = 1;
13499
+ const z = N > v && Math.min(v / N, k) || k, L = I > y && Math.min(y / I, k) || k;
13500
+ z <= L ? (N = z < 1 && v || N, I = Math.floor(I * z) + 1, k = z) : z > L && (I = L < 1 && y || I, N = Math.floor(N * L) + 1, k = L);
13498
13501
  const b = {
13499
13502
  scale: k,
13500
13503
  centerX: w.originX + w.width / 2,
13501
13504
  centerY: w.originY + w.height / 2
13502
13505
  }, A = document.createElement("canvas"), P = A.getContext("2d");
13503
- A.width = N, A.height = v, P && await this.screenshotToCanvasAsync(P, d, N, v, b, devicePixelRatio);
13506
+ A.width = N, A.height = I, P && await this.screenshotToCanvasAsync(P, d, N, I, b, devicePixelRatio);
13504
13507
  const O = document.createElement("img");
13505
13508
  O.className = "appliance-plugin-fill-scene-snapshot-img", O.src = A.toDataURL(), O.onload = () => {
13506
13509
  A.remove();