@mlightcad/cad-simple-viewer 1.0.19 → 1.0.21

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AcDbLayout as et, AcCmEventManager as M, AcGePoint2d as S, AcGeBox2d as L, AcCmColor as Pe, AcGeBox3d as tt, AcDbDatabase as vt, AcDbFileType as ve, AcGeMathUtil as re, AcGeVector3d as be, AcGeGeometryUtil as St, AcGeVector2d as Te, acdbHostApplicationServices as it, AcDbViewport as nt, AcDbRasterImage as st, AcDbRay as rt, AcDbXline as ot, AcDbHatch as De, AcGePolyline2d as at, AcDbLine as ct, AcDbTextStyleTableRecord as ht, AcDbMText as lt, AcGiMTextAttachmentPoint as It, AcGePoint3d as ze, AcGeLoop2d as dt, AcGeCircArc2d as ut, AcGeLine2d as mt, AcDbArc as gt, AcGeLine3d as K, AcDbDatabaseConverter as Bt, createWorkerApi as Mt, AcDbLinetypeTableRecord as At, AcDbDimStyleTableRecord as Ct, AcDbLayerTableRecord as Lt, AcDbViewportTableRecord as Et, AcDbBlockTableRecord as Tt, AcDbBatchProcessing as Dt, AcDbRasterImageDef as zt, AcDbCircle as Pt, AcDbEllipse as Rt, AcDbSpline as je, AcDbPoint as Ot, AcDbTrace as Vt, AcDbPolyline as Ge, AcGeEllipseArc2d as jt, AcGeSpline3d as ke, AcDbTable as Gt, AcDbText as kt, AcDbLeader as Ft, AcDbAlignedDimension as Nt, AcDb3PointAngularDimension as Ut, AcDbOrdinateDimension as Wt, AcDbRadialDimension as Xt, AcDbDiametricDimension as $t, AcDbBlockReference as Yt, AcDbDxfConverter as Ht, AcDbDatabaseConverterManager as Fe } from "@mlightcad/data-model";
1
+ import { AcDbLayout as tt, AcCmEventManager as M, AcGePoint2d as S, AcGeBox2d as L, AcCmColor as Re, AcGeBox3d as it, AcDbDatabase as vt, AcDbFileType as ve, AcGeMathUtil as re, AcGeVector3d as be, AcGeGeometryUtil as St, AcGeVector2d as Te, acdbHostApplicationServices as nt, AcDbViewport as st, AcDbRasterImage as rt, AcDbRay as ot, AcDbXline as at, AcDbHatch as De, AcGePolyline2d as ct, AcDbLine as ht, AcDbTextStyleTableRecord as lt, AcDbMText as dt, AcGiMTextAttachmentPoint as It, AcGePoint3d as ze, AcGeLoop2d as ut, AcGeCircArc2d as mt, AcGeLine2d as gt, AcDbArc as pt, AcGeLine3d as K, AcDbDatabaseConverter as Bt, createWorkerApi as Mt, AcDbLinetypeTableRecord as At, AcDbDimStyleTableRecord as Ct, AcDbLayerTableRecord as Lt, AcDbViewportTableRecord as Et, AcDbBlockTableRecord as Tt, AcDbBatchProcessing as Dt, AcDbRasterImageDef as zt, AcDbCircle as Pt, AcDbEllipse as Rt, AcDbSpline as Ge, AcDbPoint as Ot, AcDbTrace as Vt, AcDbPolyline as ke, AcGeEllipseArc2d as jt, AcGeSpline3d as Fe, AcDbTable as Gt, AcDbText as kt, AcDbLeader as Ft, AcDbAlignedDimension as Nt, AcDb3PointAngularDimension as Ut, AcDbOrdinateDimension as Wt, AcDbRadialDimension as Xt, AcDbDiametricDimension as $t, AcDbBlockReference as Yt, AcDbDxfConverter as Ht, AcDbDatabaseConverterManager as Ne } from "@mlightcad/data-model";
2
2
  import * as d from "three";
3
3
  import { UnifiedRenderer as qt, FontManager as ee } from "@mlightcad/mtext-renderer";
4
4
  import { mergeGeometries as Qt } from "three/examples/jsm/utils/BufferGeometryUtils.js";
@@ -28,7 +28,7 @@ class ii {
28
28
  }), t.database.events.headerSysVarChanged.addEventListener((i) => {
29
29
  i.name == "pdmode" && this._view.rerenderPoints(i.database.pdmode);
30
30
  }), t.database.events.dictObjetSet.addEventListener((i) => {
31
- i.object instanceof et && this._view.addLayout(i.object);
31
+ i.object instanceof tt && this._view.addLayout(i.object);
32
32
  }), e.selectionSet.events.selectionAdded.addEventListener((i) => {
33
33
  e.highlight(i.ids);
34
34
  }), e.selectionSet.events.selectionRemoved.addEventListener((i) => {
@@ -245,10 +245,10 @@ const z = class z {
245
245
  i || (i = t);
246
246
  let s = this._defaultCommandGroup;
247
247
  if (e) {
248
- const o = this._commandsByGroup.find(
249
- (r) => r.groupName == e
248
+ const r = this._commandsByGroup.find(
249
+ (o) => o.groupName == e
250
250
  );
251
- o ? s = o : s = {
251
+ r ? s = r : s = {
252
252
  groupName: e,
253
253
  commandsByGlobalName: /* @__PURE__ */ new Map(),
254
254
  commandsByLocalName: /* @__PURE__ */ new Map()
@@ -427,7 +427,7 @@ class ri {
427
427
  * @returns Return svg string of the icon
428
428
  */
429
429
  createRectCrossIcon(e, t, i = "white") {
430
- const n = e / 2, s = e + 2 * t, o = `
430
+ const n = e / 2, s = e + 2 * t, r = `
431
431
  <svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${s}" viewBox="0 0 ${s} ${s}">
432
432
  <rect x="${t}" y="${t}" width="${e}" height="${e}" fill="none" stroke="${i}" />
433
433
  <line x1="${n + t}" y1="0" x2="${n + t}" y2="${t}" stroke="${i}" />
@@ -437,13 +437,13 @@ class ri {
437
437
  </svg>
438
438
  `;
439
439
  return this.encodeSvgToCursor(
440
- o,
440
+ r,
441
441
  n + t,
442
442
  n + t
443
443
  );
444
444
  }
445
445
  }
446
- class Re {
446
+ class Oe {
447
447
  /**
448
448
  * Creates a new base input instance.
449
449
  *
@@ -509,7 +509,7 @@ class Re {
509
509
  });
510
510
  }
511
511
  }
512
- class oi extends Re {
512
+ class oi extends Oe {
513
513
  /**
514
514
  * Creates a new jig loop instance.
515
515
  *
@@ -679,7 +679,7 @@ class ai {
679
679
  }
680
680
  }
681
681
  const ci = 16777215, hi = "1px";
682
- class li extends Re {
682
+ class li extends Oe {
683
683
  /**
684
684
  * Creates a new box selector instance.
685
685
  *
@@ -701,11 +701,11 @@ class li extends Re {
701
701
  const s = new S(
702
702
  Math.min(this.mouseDownPositionX, i.x),
703
703
  Math.min(this.mouseDownPositionY, i.y)
704
- ), o = new S(
704
+ ), r = new S(
705
705
  Math.max(this.mouseDownPositionX, i.x),
706
706
  Math.max(this.mouseDownPositionY, i.y)
707
707
  );
708
- this.drawRect(s, o);
708
+ this.drawRect(s, r);
709
709
  }
710
710
  }, this.mouseup = (t) => {
711
711
  if (this.mouseDown && this.mouseMove) {
@@ -715,8 +715,8 @@ class li extends Re {
715
715
  ), s = new S(
716
716
  Math.max(this.mouseDownPositionX, i.x),
717
717
  Math.max(this.mouseDownPositionY, i.y)
718
- ), o = new L(n, s);
719
- this.resolve(this.toWcs(o));
718
+ ), r = new L(n, s);
719
+ this.resolve(this.toWcs(r));
720
720
  }
721
721
  this.mouseDown = !1, this.mouseMove = !1, this.mouseDownPositionX = -1, this.mouseDownPositionY = -1;
722
722
  }, this.container = e.canvas, this.color = ci;
@@ -756,7 +756,7 @@ class li extends Re {
756
756
  */
757
757
  drawRect(e, t) {
758
758
  if (!this.boxDom) {
759
- const s = new Pe();
759
+ const s = new Re();
760
760
  s.color = this.color, this.boxDom = document.createElement("div"), this.boxDom.style.cssText = `position: absolute;border: ${hi} solid ${s.cssColor};`, document.body.appendChild(this.boxDom);
761
761
  }
762
762
  this.setRectDomVisible(!0), e.x <= 0 && (e.x = 0), e.y <= 0 && (e.y = 0), t.x >= this.container.clientWidth - 2 && (t.x = this.container.clientWidth - 2), t.y >= this.container.clientHeight - 2 && (t.y = this.container.clientHeight - 2), this.boxDom.style.left = `${e.x}px`, this.boxDom.style.top = `${e.y}px`;
@@ -784,7 +784,7 @@ class li extends Re {
784
784
  return t.expandByPoint(this.view.cwcs2Wcs(i)), t.expandByPoint(this.view.cwcs2Wcs(n)), t;
785
785
  }
786
786
  }
787
- class di extends Re {
787
+ class di extends Oe {
788
788
  /**
789
789
  * Creates a new point input instance.
790
790
  *
@@ -1031,7 +1031,7 @@ class gi {
1031
1031
  unhover: new M()
1032
1032
  }, this._canvas = e;
1033
1033
  const t = e.getBoundingClientRect();
1034
- this._bbox = new tt(), this._width = t.width, this._height = t.height, this._curPos = new S(), this._curScreenPos = new S(), this._selectionSet = new mi(), this._editor = new ui(this), this._canvas.addEventListener("mousemove", (i) => this.onMouseMove(i)), this._canvas.addEventListener("mousedown", (i) => {
1034
+ this._bbox = new it(), this._width = t.width, this._height = t.height, this._curPos = new S(), this._curScreenPos = new S(), this._selectionSet = new mi(), this._editor = new ui(this), this._canvas.addEventListener("mousemove", (i) => this.onMouseMove(i)), this._canvas.addEventListener("mousedown", (i) => {
1035
1035
  i.button === 1 && this._editor.setCursor(de.Grab);
1036
1036
  }), this._canvas.addEventListener("mouseup", (i) => {
1037
1037
  i.button === 1 && this._editor.restoreCursor();
@@ -1238,14 +1238,14 @@ class pi {
1238
1238
  let n = !0;
1239
1239
  this._fileName = e;
1240
1240
  try {
1241
- const o = (s = e.split(".").pop()) == null ? void 0 : s.toLocaleLowerCase();
1241
+ const r = (s = e.split(".").pop()) == null ? void 0 : s.toLocaleLowerCase();
1242
1242
  await this._database.read(
1243
1243
  t,
1244
1244
  i,
1245
- o == "dwg" ? ve.DWG : ve.DXF
1245
+ r == "dwg" ? ve.DWG : ve.DXF
1246
1246
  ), this.docTitle = this._fileName;
1247
- } catch (o) {
1248
- n = !1, V.emit("failed-to-open-file", { fileName: e }), console.error(o);
1247
+ } catch (r) {
1248
+ n = !1, V.emit("failed-to-open-file", { fileName: e }), console.error(r);
1249
1249
  }
1250
1250
  return n;
1251
1251
  }
@@ -1423,9 +1423,9 @@ class fi extends Me {
1423
1423
  else {
1424
1424
  const i = e.startPoint, n = e.endPoint, s = re.radToDeg(
1425
1425
  e.majorAxis.angleTo(be.X_AXIS)
1426
- ), o = e.clockwise ? 0 : 1;
1426
+ ), r = e.clockwise ? 0 : 1;
1427
1427
  this.svg = `
1428
- <path d="M${i.x},${i.y} A${e.majorAxisRadius},${e.minorAxisRadius} ${s} ${e.isLargeArc},${o} ${n.x},${n.y}"/>`;
1428
+ <path d="M${i.x},${i.y} A${e.majorAxisRadius},${e.minorAxisRadius} ${s} ${e.isLargeArc},${r} ${n.x},${n.y}"/>`;
1429
1429
  }
1430
1430
  const t = e.box;
1431
1431
  this._box.min.copy(t.min), this._box.max.copy(t.max);
@@ -1703,19 +1703,19 @@ class Li {
1703
1703
  return this.pointsSameX(e, t) ? this.pointsSameY(e, t) ? 0 : e[1] < t[1] ? -1 : 1 : e[0] < t[0] ? -1 : 1;
1704
1704
  }
1705
1705
  }
1706
- class pt extends Li {
1706
+ class yt extends Li {
1707
1707
  constructor(e = 1e-10) {
1708
1708
  super(), this.epsilon = e;
1709
1709
  }
1710
1710
  pointAboveOrOnLine(e, t, i) {
1711
- const n = t[0], s = t[1], o = i[0], r = i[1], a = e[0], h = e[1];
1712
- return (o - n) * (h - s) - (r - s) * (a - n) >= -this.epsilon;
1711
+ const n = t[0], s = t[1], r = i[0], o = i[1], a = e[0], h = e[1];
1712
+ return (r - n) * (h - s) - (o - s) * (a - n) >= -this.epsilon;
1713
1713
  }
1714
1714
  pointBetween(e, t, i) {
1715
- const n = e[1] - t[1], s = i[0] - t[0], o = e[0] - t[0], r = i[1] - t[1], a = o * s + n * r;
1715
+ const n = e[1] - t[1], s = i[0] - t[0], r = e[0] - t[0], o = i[1] - t[1], a = r * s + n * o;
1716
1716
  if (a < this.epsilon)
1717
1717
  return !1;
1718
- const h = s * s + r * r;
1718
+ const h = s * s + o * o;
1719
1719
  return !(a - h > -this.epsilon);
1720
1720
  }
1721
1721
  pointsSameX(e, t) {
@@ -1725,14 +1725,14 @@ class pt extends Li {
1725
1725
  return Math.abs(e[1] - t[1]) < this.epsilon;
1726
1726
  }
1727
1727
  pointsCollinear(e, t, i) {
1728
- const n = e[0] - t[0], s = e[1] - t[1], o = t[0] - i[0], r = t[1] - i[1];
1729
- return Math.abs(n * r - o * s) < this.epsilon;
1728
+ const n = e[0] - t[0], s = e[1] - t[1], r = t[0] - i[0], o = t[1] - i[1];
1729
+ return Math.abs(n * o - r * s) < this.epsilon;
1730
1730
  }
1731
1731
  linesIntersect(e, t, i, n) {
1732
- const s = t[0] - e[0], o = t[1] - e[1], r = n[0] - i[0], a = n[1] - i[1], h = s * a - o * r;
1732
+ const s = t[0] - e[0], r = t[1] - e[1], o = n[0] - i[0], a = n[1] - i[1], h = s * a - r * o;
1733
1733
  if (Math.abs(h) < this.epsilon)
1734
1734
  return null;
1735
- const l = e[0] - i[0], m = e[1] - i[1], u = (r * m - a * l) / h, p = (s * m - o * l) / h, g = (f) => f <= -this.epsilon ? B.BeforeStart : f < this.epsilon ? B.EqualStart : f - 1 <= -this.epsilon ? B.BetweenStartAndEnd : f - 1 < this.epsilon ? B.EqualEnd : B.AfterEnd, y = [e[0] + u * s, e[1] + u * o];
1735
+ const l = e[0] - i[0], m = e[1] - i[1], u = (o * m - a * l) / h, p = (s * m - r * l) / h, g = (f) => f <= -this.epsilon ? B.BeforeStart : f < this.epsilon ? B.EqualStart : f - 1 <= -this.epsilon ? B.BetweenStartAndEnd : f - 1 < this.epsilon ? B.EqualEnd : B.AfterEnd, y = [e[0] + u * s, e[1] + u * r];
1736
1736
  return {
1737
1737
  alongA: g(u),
1738
1738
  alongB: g(p),
@@ -1740,7 +1740,7 @@ class pt extends Li {
1740
1740
  };
1741
1741
  }
1742
1742
  }
1743
- class Ne {
1743
+ class Ue {
1744
1744
  constructor() {
1745
1745
  this.nodes = [];
1746
1746
  }
@@ -1766,15 +1766,15 @@ class Ne {
1766
1766
  findTransition(e, t) {
1767
1767
  var i, n;
1768
1768
  const s = (a, h) => t(h) - t(a);
1769
- let o = 0, r = this.nodes.length;
1770
- for (; o < r; ) {
1771
- const a = o + r >> 1;
1772
- s(this.nodes[a], e) > 0 ? r = a : o = a + 1;
1769
+ let r = 0, o = this.nodes.length;
1770
+ for (; r < o; ) {
1771
+ const a = r + o >> 1;
1772
+ s(this.nodes[a], e) > 0 ? o = a : r = a + 1;
1773
1773
  }
1774
1774
  return {
1775
- before: o <= 0 ? null : (i = this.nodes[o - 1]) !== null && i !== void 0 ? i : null,
1776
- after: (n = this.nodes[o]) !== null && n !== void 0 ? n : null,
1777
- insert: (a) => (this.nodes.splice(o, 0, a), a)
1775
+ before: r <= 0 ? null : (i = this.nodes[r - 1]) !== null && i !== void 0 ? i : null,
1776
+ after: (n = this.nodes[r]) !== null && n !== void 0 ? n : null,
1777
+ insert: (a) => (this.nodes.splice(r, 0, a), a)
1778
1778
  };
1779
1779
  }
1780
1780
  }
@@ -1787,22 +1787,22 @@ class Z {
1787
1787
  };
1788
1788
  }
1789
1789
  }
1790
- class Ue {
1790
+ class We {
1791
1791
  constructor(e, t, i, n) {
1792
1792
  this.status = null, this.isStart = e, this.p = t, this.seg = i, this.primary = n;
1793
1793
  }
1794
1794
  }
1795
- class We {
1795
+ class Xe {
1796
1796
  constructor(e, t, i = null) {
1797
- this.events = new Ne(), this.status = new Ne(), this.selfIntersection = e, this.geo = t, this.log = i;
1797
+ this.events = new Ue(), this.status = new Ue(), this.selfIntersection = e, this.geo = t, this.log = i;
1798
1798
  }
1799
- compareEvents(e, t, i, n, s, o) {
1800
- const r = this.geo.pointsCompare(t, s);
1801
- return r !== 0 ? r : this.geo.pointsSame(i, o) ? 0 : e !== n ? e ? 1 : -1 : this.geo.pointAboveOrOnLine(
1799
+ compareEvents(e, t, i, n, s, r) {
1800
+ const o = this.geo.pointsCompare(t, s);
1801
+ return o !== 0 ? o : this.geo.pointsSame(i, r) ? 0 : e !== n ? e ? 1 : -1 : this.geo.pointAboveOrOnLine(
1802
1802
  i,
1803
- n ? s : o,
1803
+ n ? s : r,
1804
1804
  // order matters
1805
- n ? o : s
1805
+ n ? r : s
1806
1806
  ) ? 1 : -1;
1807
1807
  }
1808
1808
  addEvent(e) {
@@ -1818,7 +1818,7 @@ class We {
1818
1818
  return i === 0 ? null : i < 0 ? new Z(e, t, null, this.log) : new Z(t, e, null, this.log);
1819
1819
  }
1820
1820
  addSegment(e, t) {
1821
- const i = new Ue(!0, e.start, e, t), n = new Ue(!1, e.end, e, t);
1821
+ const i = new We(!0, e.start, e, t), n = new We(!1, e.end, e, t);
1822
1822
  return i.other = n, n.other = i, this.addEvent(i), this.addEvent(n), i;
1823
1823
  }
1824
1824
  addRegion(e) {
@@ -1830,33 +1830,33 @@ class We {
1830
1830
  }
1831
1831
  }
1832
1832
  compareStatus(e, t) {
1833
- const i = e.seg.start, n = e.seg.end, s = t.seg.start, o = t.seg.end;
1834
- return this.geo.pointsCollinear(i, s, o) ? this.geo.pointsCollinear(n, s, o) || this.geo.pointAboveOrOnLine(n, s, o) ? 1 : -1 : this.geo.pointAboveOrOnLine(i, s, o) ? 1 : -1;
1833
+ const i = e.seg.start, n = e.seg.end, s = t.seg.start, r = t.seg.end;
1834
+ return this.geo.pointsCollinear(i, s, r) ? this.geo.pointsCollinear(n, s, r) || this.geo.pointAboveOrOnLine(n, s, r) ? 1 : -1 : this.geo.pointAboveOrOnLine(i, s, r) ? 1 : -1;
1835
1835
  }
1836
1836
  statusFindSurrounding(e) {
1837
1837
  return this.status.findTransition(e, (t) => t === e ? 0 : -this.compareStatus(e, t));
1838
1838
  }
1839
1839
  checkIntersection(e, t) {
1840
1840
  var i;
1841
- const n = e.seg, s = t.seg, o = n.start, r = n.end, a = s.start, h = s.end;
1841
+ const n = e.seg, s = t.seg, r = n.start, o = n.end, a = s.start, h = s.end;
1842
1842
  (i = this.log) === null || i === void 0 || i.checkIntersection(n, s);
1843
- const l = this.geo.linesIntersect(o, r, a, h);
1843
+ const l = this.geo.linesIntersect(r, o, a, h);
1844
1844
  if (l === null) {
1845
- if (!this.geo.pointsCollinear(o, r, a) || this.geo.pointsSame(o, h) || this.geo.pointsSame(r, a))
1845
+ if (!this.geo.pointsCollinear(r, o, a) || this.geo.pointsSame(r, h) || this.geo.pointsSame(o, a))
1846
1846
  return null;
1847
- const m = this.geo.pointsSame(o, a), u = this.geo.pointsSame(r, h);
1847
+ const m = this.geo.pointsSame(r, a), u = this.geo.pointsSame(o, h);
1848
1848
  if (m && u)
1849
1849
  return t;
1850
- const p = !m && this.geo.pointBetween(o, a, h), g = !u && this.geo.pointBetween(r, a, h);
1850
+ const p = !m && this.geo.pointBetween(r, a, h), g = !u && this.geo.pointBetween(o, a, h);
1851
1851
  if (m)
1852
- return g ? this.divideEvent(t, r) : this.divideEvent(e, h), t;
1853
- p && (u || (g ? this.divideEvent(t, r) : this.divideEvent(e, h)), this.divideEvent(t, o));
1852
+ return g ? this.divideEvent(t, o) : this.divideEvent(e, h), t;
1853
+ p && (u || (g ? this.divideEvent(t, o) : this.divideEvent(e, h)), this.divideEvent(t, r));
1854
1854
  } else
1855
- l.alongA === B.BetweenStartAndEnd && (l.alongB === B.EqualStart ? this.divideEvent(e, a) : l.alongB === B.BetweenStartAndEnd ? this.divideEvent(e, l.p) : l.alongB === B.EqualEnd && this.divideEvent(e, h)), l.alongB === B.BetweenStartAndEnd && (l.alongA === B.EqualStart ? this.divideEvent(t, o) : l.alongA === B.BetweenStartAndEnd ? this.divideEvent(t, l.p) : l.alongA === B.EqualEnd && this.divideEvent(t, r));
1855
+ l.alongA === B.BetweenStartAndEnd && (l.alongB === B.EqualStart ? this.divideEvent(e, a) : l.alongB === B.BetweenStartAndEnd ? this.divideEvent(e, l.p) : l.alongB === B.EqualEnd && this.divideEvent(e, h)), l.alongB === B.BetweenStartAndEnd && (l.alongA === B.EqualStart ? this.divideEvent(t, r) : l.alongA === B.BetweenStartAndEnd ? this.divideEvent(t, l.p) : l.alongA === B.EqualEnd && this.divideEvent(t, o));
1856
1856
  return null;
1857
1857
  }
1858
1858
  calculate(e, t) {
1859
- var i, n, s, o, r, a, h, l;
1859
+ var i, n, s, r, o, a, h, l;
1860
1860
  const m = [];
1861
1861
  for (; !this.events.isEmpty(); ) {
1862
1862
  const u = this.events.getHead();
@@ -1878,10 +1878,10 @@ class We {
1878
1878
  u.seg.myFill.below === null ? x = !0 : x = u.seg.myFill.above !== u.seg.myFill.below, x && (_.seg.myFill.above = !_.seg.myFill.above);
1879
1879
  } else
1880
1880
  _.seg.otherFill = u.seg.myFill;
1881
- (o = this.log) === null || o === void 0 || o.segmentUpdate(_.seg), this.events.remove(u.other), this.events.remove(u);
1881
+ (r = this.log) === null || r === void 0 || r.segmentUpdate(_.seg), this.events.remove(u.other), this.events.remove(u);
1882
1882
  }
1883
1883
  if (this.events.getHead() !== u) {
1884
- (r = this.log) === null || r === void 0 || r.rewind(u.seg);
1884
+ (o = this.log) === null || o === void 0 || o.rewind(u.seg);
1885
1885
  continue;
1886
1886
  }
1887
1887
  if (this.selfIntersection) {
@@ -1930,8 +1930,8 @@ function te(c, e, t) {
1930
1930
  for (const n of c) {
1931
1931
  const s = (n.myFill.above ? 8 : 0) + (n.myFill.below ? 4 : 0) + (n.otherFill && n.otherFill.above ? 2 : 0) + (n.otherFill && n.otherFill.below ? 1 : 0);
1932
1932
  if (e[s] !== 0) {
1933
- const o = new Z(n.start, n.end, null, t);
1934
- o.myFill.above = e[s] === 1, o.myFill.below = e[s] === 2, i.push(o);
1933
+ const r = new Z(n.start, n.end, null, t);
1934
+ r.myFill.above = e[s] === 1, r.myFill.below = e[s] === 2, i.push(r);
1935
1935
  }
1936
1936
  }
1937
1937
  return t == null || t.selected(i), i;
@@ -1966,8 +1966,8 @@ function Ei(c, e, t) {
1966
1966
  const P = w[w.length - 2], v = b[0], G = b[1];
1967
1967
  e.pointsCollinear(P, I, v) && (t == null || t.chainRemoveTail(_, I), w.pop(), I = P), e.pointsCollinear(I, v, G) && (t == null || t.chainRemoveHead(x, v), b.shift()), t == null || t.chainJoin(_, x), i[_] = w.concat(b), i.splice(x, 1);
1968
1968
  };
1969
- const o = s.start, r = s.end;
1970
- if (e.pointsSame(o, r)) {
1969
+ const r = s.start, o = s.end;
1970
+ if (e.pointsSame(r, o)) {
1971
1971
  console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");
1972
1972
  continue;
1973
1973
  }
@@ -1984,25 +1984,25 @@ function Ei(c, e, t) {
1984
1984
  let l = a;
1985
1985
  for (let _ = 0; _ < i.length; _++) {
1986
1986
  const x = i[_], w = x[0], b = x[x.length - 1];
1987
- if (e.pointsSame(w, o)) {
1987
+ if (e.pointsSame(w, r)) {
1988
1988
  if (m(_, !0, !0))
1989
1989
  break;
1990
- } else if (e.pointsSame(w, r)) {
1990
+ } else if (e.pointsSame(w, o)) {
1991
1991
  if (m(_, !0, !1))
1992
1992
  break;
1993
- } else if (e.pointsSame(b, o)) {
1993
+ } else if (e.pointsSame(b, r)) {
1994
1994
  if (m(_, !1, !0))
1995
1995
  break;
1996
- } else if (e.pointsSame(b, r) && m(_, !1, !1))
1996
+ } else if (e.pointsSame(b, o) && m(_, !1, !1))
1997
1997
  break;
1998
1998
  }
1999
1999
  if (l === a) {
2000
- i.push([o, r]), t == null || t.chainNew(o, r);
2000
+ i.push([r, o]), t == null || t.chainNew(r, o);
2001
2001
  continue;
2002
2002
  }
2003
2003
  if (l === h) {
2004
2004
  t == null || t.chainMatch(a.index);
2005
- const _ = a.index, x = a.matches_pt1 ? r : o, w = a.matches_head, b = i[_];
2005
+ const _ = a.index, x = a.matches_pt1 ? o : r, w = a.matches_head, b = i[_];
2006
2006
  let I = w ? b[0] : b[b.length - 1];
2007
2007
  const P = w ? b[1] : b[b.length - 2], v = w ? b[b.length - 1] : b[0], G = w ? b[b.length - 2] : b[1];
2008
2008
  if (e.pointsCollinear(P, I, x) && (w ? (t == null || t.chainRemoveHead(a.index, x), b.shift()) : (t == null || t.chainRemoveTail(a.index, x), b.pop()), I = P), e.pointsSame(v, x)) {
@@ -2099,7 +2099,7 @@ class Ti {
2099
2099
  this.push("done", null);
2100
2100
  }
2101
2101
  }
2102
- class yt {
2102
+ class ft {
2103
2103
  constructor(e) {
2104
2104
  this.log = null, this.geo = e;
2105
2105
  }
@@ -2108,7 +2108,7 @@ class yt {
2108
2108
  return this.log = e ? new Ti() : null, (t = this.log) === null || t === void 0 ? void 0 : t.list;
2109
2109
  }
2110
2110
  segments(e) {
2111
- const t = new We(!0, this.geo, this.log);
2111
+ const t = new Xe(!0, this.geo, this.log);
2112
2112
  for (const i of e.regions)
2113
2113
  t.addRegion(i);
2114
2114
  return {
@@ -2117,7 +2117,7 @@ class yt {
2117
2117
  };
2118
2118
  }
2119
2119
  combine(e, t) {
2120
- const i = new We(!1, this.geo, this.log);
2120
+ const i = new Xe(!1, this.geo, this.log);
2121
2121
  for (const n of e.segments)
2122
2122
  i.addSegment(new Z(n.start, n.end, n, this.log), !0);
2123
2123
  for (const n of t.segments)
@@ -2166,27 +2166,27 @@ class yt {
2166
2166
  }
2167
2167
  // helper functions for common operations
2168
2168
  union(e, t) {
2169
- const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), o = this.selectUnion(s);
2170
- return this.polygon(o);
2169
+ const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), r = this.selectUnion(s);
2170
+ return this.polygon(r);
2171
2171
  }
2172
2172
  intersect(e, t) {
2173
- const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), o = this.selectIntersect(s);
2174
- return this.polygon(o);
2173
+ const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), r = this.selectIntersect(s);
2174
+ return this.polygon(r);
2175
2175
  }
2176
2176
  difference(e, t) {
2177
- const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), o = this.selectDifference(s);
2178
- return this.polygon(o);
2177
+ const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), r = this.selectDifference(s);
2178
+ return this.polygon(r);
2179
2179
  }
2180
2180
  differenceRev(e, t) {
2181
- const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), o = this.selectDifferenceRev(s);
2182
- return this.polygon(o);
2181
+ const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), r = this.selectDifferenceRev(s);
2182
+ return this.polygon(r);
2183
2183
  }
2184
2184
  xor(e, t) {
2185
- const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), o = this.selectXor(s);
2186
- return this.polygon(o);
2185
+ const i = this.segments(e), n = this.segments(t), s = this.combine(i, n), r = this.selectXor(s);
2186
+ return this.polygon(r);
2187
2187
  }
2188
2188
  }
2189
- new yt(new pt());
2189
+ new ft(new yt());
2190
2190
  class Se extends d.Object3D {
2191
2191
  /**
2192
2192
  * Flatten the hierarchy of the specified object so that all children are moved to be direct
@@ -2199,10 +2199,10 @@ class Se extends d.Object3D {
2199
2199
  function i(s) {
2200
2200
  s.position.set(0, 0, 0), s.rotation.set(0, 0, 0), s.scale.set(1, 1, 1), s.matrix.identity();
2201
2201
  }
2202
- function n(s, o) {
2203
- const r = [...s.children];
2204
- for (const a of r)
2205
- a.applyMatrix4(o), i(a), a.children.length > 0 ? n(a, a.matrixWorld) : t.push(a);
2202
+ function n(s, r) {
2203
+ const o = [...s.children];
2204
+ for (const a of o)
2205
+ a.applyMatrix4(r), i(a), a.children.length > 0 ? n(a, a.matrixWorld) : t.push(a);
2206
2206
  s.children = [];
2207
2207
  }
2208
2208
  e.updateMatrixWorld(!0), n(e, e.matrixWorld);
@@ -2217,8 +2217,8 @@ class Se extends d.Object3D {
2217
2217
  */
2218
2218
  static disposeObject(e, t = !0) {
2219
2219
  t && e.removeFromParent(), (e instanceof d.Mesh || e instanceof d.Line || e instanceof d.Points) && e.geometry && e.geometry.dispose(), (e instanceof d.Mesh || e instanceof d.Line || e instanceof d.Points) && (Array.isArray(e.material) ? e.material : [e.material]).forEach((i) => {
2220
- var n, s, o, r, a, h, l, m;
2221
- i.dispose(), (n = i.map) == null || n.dispose(), (s = i.envMap) == null || s.dispose(), (o = i.lightMap) == null || o.dispose(), (r = i.bumpMap) == null || r.dispose(), (a = i.normalMap) == null || a.dispose(), (h = i.roughnessMap) == null || h.dispose(), (l = i.metalnessMap) == null || l.dispose(), (m = i.alphaMap) == null || m.dispose();
2220
+ var n, s, r, o, a, h, l, m;
2221
+ i.dispose(), (n = i.map) == null || n.dispose(), (s = i.envMap) == null || s.dispose(), (r = i.lightMap) == null || r.dispose(), (o = i.bumpMap) == null || o.dispose(), (a = i.normalMap) == null || a.dispose(), (h = i.roughnessMap) == null || h.dispose(), (l = i.metalnessMap) == null || l.dispose(), (m = i.alphaMap) == null || m.dispose();
2222
2222
  }), e.children.forEach((i) => this.disposeObject(i)), "geometry" in e && (e.geometry = null), "material" in e && (e.material = null), e.children = [];
2223
2223
  }
2224
2224
  /**
@@ -2833,7 +2833,7 @@ class R {
2833
2833
  throw new Error(
2834
2834
  `[AcTrPointSymbolCreator] Invalid point type value: '${e}'!`
2835
2835
  );
2836
- ne.copy(t), Xe.identity().makeTranslation(ne), i.line = n.clone().applyMatrix4(Xe), (e == 32 || e == 64 || e == 96) && (i.point = new d.BufferGeometry().setFromPoints([ne]));
2836
+ ne.copy(t), $e.identity().makeTranslation(ne), i.line = n.clone().applyMatrix4($e), (e == 32 || e == 64 || e == 96) && (i.point = new d.BufferGeometry().setFromPoints([ne]));
2837
2837
  }
2838
2838
  return i;
2839
2839
  }
@@ -2848,7 +2848,7 @@ class R {
2848
2848
  }), e;
2849
2849
  }
2850
2850
  }
2851
- const Xe = /* @__PURE__ */ new d.Matrix4(), ne = /* @__PURE__ */ new d.Vector3(), zi = new d.Color(583902);
2851
+ const $e = /* @__PURE__ */ new d.Matrix4(), ne = /* @__PURE__ */ new d.Vector3(), zi = new d.Color(583902);
2852
2852
  class Ie {
2853
2853
  /**
2854
2854
  * Clone given material(s)
@@ -2901,12 +2901,12 @@ class ue {
2901
2901
  if (s === "string") return n.length * 2;
2902
2902
  if (s === "symbol" || s === "function" || t.has(n)) return 0;
2903
2903
  if (t.add(n), Array.isArray(n))
2904
- return n.map(i).reduce((o, r) => o + r, 0);
2904
+ return n.map(i).reduce((r, o) => r + o, 0);
2905
2905
  if (s === "object") {
2906
- let o = 0;
2907
- for (const r in n)
2908
- Object.prototype.hasOwnProperty.call(n, r) && (o += r.length * 2, o += i(n[r]));
2909
- return o;
2906
+ let r = 0;
2907
+ for (const o in n)
2908
+ Object.prototype.hasOwnProperty.call(n, o) && (r += o.length * 2, r += i(n[o]));
2909
+ return r;
2910
2910
  }
2911
2911
  return 0;
2912
2912
  }
@@ -2924,16 +2924,16 @@ class ue {
2924
2924
  return e;
2925
2925
  }
2926
2926
  }
2927
- function Oe(c, e) {
2927
+ function Ve(c, e) {
2928
2928
  return c - e;
2929
2929
  }
2930
- function Ve(c, e, t = 0) {
2930
+ function je(c, e, t = 0) {
2931
2931
  const i = e.itemSize;
2932
2932
  if (c.isInterleavedBufferAttribute || c.array.constructor !== e.array.constructor) {
2933
2933
  const n = c.count;
2934
2934
  for (let s = 0; s < n; s++)
2935
- for (let o = 0; o < i; o++)
2936
- e.setComponent(s + t, o, c.getComponent(s, o));
2935
+ for (let r = 0; r < i; r++)
2936
+ e.setComponent(s + t, r, c.getComponent(s, r));
2937
2937
  } else
2938
2938
  e.array.set(c.array, t * i);
2939
2939
  e.needsUpdate = !0;
@@ -2948,7 +2948,7 @@ function J(c, e) {
2948
2948
  e.set(new c.constructor(c.buffer, 0, t));
2949
2949
  }
2950
2950
  }
2951
- const $e = /* @__PURE__ */ new d.Box3(), F = /* @__PURE__ */ new d.Vector3(), N = /* @__PURE__ */ new d.LineSegments(), me = [];
2951
+ const Ye = /* @__PURE__ */ new d.Box3(), F = /* @__PURE__ */ new d.Vector3(), N = /* @__PURE__ */ new d.LineSegments(), me = [];
2952
2952
  class Pi extends d.LineSegments {
2953
2953
  constructor(e = 1e3, t = e * 2, i) {
2954
2954
  super(new d.BufferGeometry(), i), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e, this._maxIndexCount = t;
@@ -2974,7 +2974,7 @@ class Pi extends d.LineSegments {
2974
2974
  const t = this.geometry, i = this._maxVertexCount, n = this._maxIndexCount;
2975
2975
  if (this._geometryInitialized === !1) {
2976
2976
  for (const s in e.attributes) {
2977
- const o = e.getAttribute(s), { array: r, itemSize: a, normalized: h } = o, l = new r.constructor(i * a), m = new d.BufferAttribute(
2977
+ const r = e.getAttribute(s), { array: o, itemSize: a, normalized: h } = r, l = new o.constructor(i * a), m = new d.BufferAttribute(
2978
2978
  l,
2979
2979
  a,
2980
2980
  h
@@ -3012,8 +3012,8 @@ class Pi extends d.LineSegments {
3012
3012
  let n = this._maxIndexCount;
3013
3013
  i && this.unusedIndexCount < t.count && (n = (this._maxIndexCount + t.count) * 1.5);
3014
3014
  const s = e.getAttribute("position");
3015
- let o = this._maxVertexCount;
3016
- s && this.unusedVertexCount < s.count && (o = (this._maxVertexCount + s.count) * 1.5), (n > this._maxIndexCount || o > this._maxVertexCount) && this.setGeometrySize(o, n);
3015
+ let r = this._maxVertexCount;
3016
+ s && this.unusedVertexCount < s.count && (r = (this._maxVertexCount + s.count) * 1.5), (n > this._maxIndexCount || r > this._maxVertexCount) && this.setGeometrySize(r, n);
3017
3017
  }
3018
3018
  validateGeometryId(e) {
3019
3019
  const t = this._geometryInfo;
@@ -3043,8 +3043,8 @@ class Pi extends d.LineSegments {
3043
3043
  if (n.position) {
3044
3044
  const s = i.create(e, n.position);
3045
3045
  if (s.line) {
3046
- const o = this.addGeometry(s.line);
3047
- this.setGeometryInfo(o, n);
3046
+ const r = this.addGeometry(s.line);
3047
+ this.setGeometryInfo(r, n);
3048
3048
  }
3049
3049
  }
3050
3050
  });
@@ -3087,13 +3087,13 @@ class Pi extends d.LineSegments {
3087
3087
  visible: !0
3088
3088
  }, s = this._geometryInfo;
3089
3089
  n.vertexStart = this._nextVertexStart, n.reservedVertexCount = t === -1 ? e.getAttribute("position").count : t;
3090
- const o = e.getIndex();
3091
- if (o !== null && (n.indexStart = this._nextIndexStart, n.reservedIndexCount = i === -1 ? o.count : i), n.indexStart !== -1 && n.indexStart + n.reservedIndexCount > this._maxIndexCount || n.vertexStart + n.reservedVertexCount > this._maxVertexCount)
3090
+ const r = e.getIndex();
3091
+ if (r !== null && (n.indexStart = this._nextIndexStart, n.reservedIndexCount = i === -1 ? r.count : i), n.indexStart !== -1 && n.indexStart + n.reservedIndexCount > this._maxIndexCount || n.vertexStart + n.reservedVertexCount > this._maxVertexCount)
3092
3092
  throw new Error(
3093
3093
  "AcTrBatchedLine: Reserved space request exceeds the maximum buffer size."
3094
3094
  );
3095
- let r;
3096
- return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Oe), r = this._availableGeometryIds.shift(), s[r] = n) : (r = this._geometryCount, this._geometryCount++, s.push(n)), this.setGeometryAt(r, e), this._nextIndexStart = n.indexStart + n.reservedIndexCount, this._nextVertexStart = n.vertexStart + n.reservedVertexCount, r;
3095
+ let o;
3096
+ return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Ve), o = this._availableGeometryIds.shift(), s[o] = n) : (o = this._geometryCount, this._geometryCount++, s.push(n)), this.setGeometryAt(o, e), this._nextIndexStart = n.indexStart + n.reservedIndexCount, this._nextVertexStart = n.vertexStart + n.reservedVertexCount, o;
3097
3097
  }
3098
3098
  setGeometryInfo(e, t) {
3099
3099
  if (e >= this._geometryCount)
@@ -3105,18 +3105,18 @@ class Pi extends d.LineSegments {
3105
3105
  if (e >= this._geometryCount)
3106
3106
  throw new Error("AcTrBatchedLine: Maximum geometry count reached.");
3107
3107
  this._validateGeometry(t);
3108
- const i = this.geometry, n = i.getIndex() !== null, s = i.getIndex(), o = t.getIndex(), r = this._geometryInfo[e];
3109
- if (n && o.count > r.reservedIndexCount || t.attributes.position.count > r.reservedVertexCount)
3108
+ const i = this.geometry, n = i.getIndex() !== null, s = i.getIndex(), r = t.getIndex(), o = this._geometryInfo[e];
3109
+ if (n && r.count > o.reservedIndexCount || t.attributes.position.count > o.reservedVertexCount)
3110
3110
  throw new Error(
3111
3111
  "AcTrBatchedLine: Reserved space not large enough for provided geometry."
3112
3112
  );
3113
- const a = r.vertexStart, h = r.reservedVertexCount;
3114
- r.vertexCount = t.getAttribute("position").count;
3113
+ const a = o.vertexStart, h = o.reservedVertexCount;
3114
+ o.vertexCount = t.getAttribute("position").count;
3115
3115
  for (const l in i.attributes) {
3116
3116
  const m = t.getAttribute(l), u = i.getAttribute(
3117
3117
  l
3118
3118
  );
3119
- Ve(m, u, a);
3119
+ je(m, u, a);
3120
3120
  const p = m.itemSize;
3121
3121
  for (let g = m.count, y = h; g < y; g++) {
3122
3122
  const f = a + g;
@@ -3129,15 +3129,15 @@ class Pi extends d.LineSegments {
3129
3129
  );
3130
3130
  }
3131
3131
  if (n && s) {
3132
- const l = r.indexStart, m = r.reservedIndexCount;
3133
- r.indexCount = t.getIndex().count;
3134
- for (let u = 0; u < o.count; u++)
3135
- s.setX(l + u, a + o.getX(u));
3136
- for (let u = o.count, p = m; u < p; u++)
3132
+ const l = o.indexStart, m = o.reservedIndexCount;
3133
+ o.indexCount = t.getIndex().count;
3134
+ for (let u = 0; u < r.count; u++)
3135
+ s.setX(l + u, a + r.getX(u));
3136
+ for (let u = r.count, p = m; u < p; u++)
3137
3137
  s.setX(l + u, a);
3138
- s.needsUpdate = !0, s.addUpdateRange(l, r.reservedIndexCount);
3138
+ s.needsUpdate = !0, s.addUpdateRange(l, o.reservedIndexCount);
3139
3139
  }
3140
- return r.start = n ? r.indexStart : r.vertexStart, r.count = n ? r.indexCount : r.vertexCount, r.boundingBox = null, t.boundingBox !== null && (r.boundingBox = t.boundingBox.clone()), r.boundingSphere = null, t.boundingSphere !== null && (r.boundingSphere = t.boundingSphere.clone()), e;
3140
+ return o.start = n ? o.indexStart : o.vertexStart, o.count = n ? o.indexCount : o.vertexCount, o.boundingBox = null, t.boundingBox !== null && (o.boundingBox = t.boundingBox.clone()), o.boundingSphere = null, t.boundingSphere !== null && (o.boundingSphere = t.boundingSphere.clone()), e;
3141
3141
  }
3142
3142
  deleteGeometry(e) {
3143
3143
  const t = this._geometryInfo;
@@ -3145,9 +3145,9 @@ class Pi extends d.LineSegments {
3145
3145
  }
3146
3146
  optimize() {
3147
3147
  let e = 0, t = 0;
3148
- const i = this._geometryInfo, n = i.map((o, r) => r).sort((o, r) => i[o].vertexStart - i[r].vertexStart), s = this.geometry;
3149
- for (let o = 0, r = i.length; o < r; o++) {
3150
- const a = n[o], h = i[a];
3148
+ const i = this._geometryInfo, n = i.map((r, o) => o).sort((r, o) => i[r].vertexStart - i[o].vertexStart), s = this.geometry;
3149
+ for (let r = 0, o = i.length; r < o; r++) {
3150
+ const a = n[r], h = i[a];
3151
3151
  if (h.active !== !1) {
3152
3152
  if (s.index !== null) {
3153
3153
  if (h.indexStart !== t) {
@@ -3188,10 +3188,10 @@ class Pi extends d.LineSegments {
3188
3188
  return null;
3189
3189
  const i = this.geometry, n = this._geometryInfo[e];
3190
3190
  if (n.boundingBox === null) {
3191
- const s = new d.Box3(), o = i.index, r = i.attributes.position;
3191
+ const s = new d.Box3(), r = i.index, o = i.attributes.position;
3192
3192
  for (let a = n.start, h = n.start + n.count; a < h; a++) {
3193
3193
  let l = a;
3194
- o && (l = o.getX(l)), s.expandByPoint(F.fromBufferAttribute(r, l));
3194
+ r && (l = r.getX(l)), s.expandByPoint(F.fromBufferAttribute(o, l));
3195
3195
  }
3196
3196
  n.boundingBox = s;
3197
3197
  }
@@ -3204,12 +3204,12 @@ class Pi extends d.LineSegments {
3204
3204
  const i = this.geometry, n = this._geometryInfo[e];
3205
3205
  if (n.boundingSphere === null) {
3206
3206
  const s = new d.Sphere();
3207
- this.getBoundingBoxAt(e, $e), $e.getCenter(s.center);
3208
- const o = i.index, r = i.attributes.position;
3207
+ this.getBoundingBoxAt(e, Ye), Ye.getCenter(s.center);
3208
+ const r = i.index, o = i.attributes.position;
3209
3209
  let a = 0;
3210
3210
  for (let h = n.start, l = n.start + n.count; h < l; h++) {
3211
3211
  let m = h;
3212
- o && (m = o.getX(m)), F.fromBufferAttribute(r, m), a = Math.max(
3212
+ r && (m = r.getX(m)), F.fromBufferAttribute(o, m), a = Math.max(
3213
3213
  a,
3214
3214
  s.center.distanceToSquared(F)
3215
3215
  );
@@ -3268,9 +3268,9 @@ class Pi extends d.LineSegments {
3268
3268
  if (n.bboxIntersectionCheck) {
3269
3269
  const s = n.boundingBox;
3270
3270
  if (t.ray.intersectBox(s, F)) {
3271
- const o = t.ray.origin.distanceTo(F);
3271
+ const r = t.ray.origin.distanceTo(F);
3272
3272
  i.push({
3273
- distance: o,
3273
+ distance: r,
3274
3274
  point: F.clone(),
3275
3275
  object: this,
3276
3276
  face: null,
@@ -3288,9 +3288,9 @@ class Pi extends d.LineSegments {
3288
3288
  n.start,
3289
3289
  n.count
3290
3290
  ), N.raycast(t, me);
3291
- for (let s = 0, o = me.length; s < o; s++) {
3292
- const r = me[s];
3293
- r.object = this, r.batchId = e, r.objectId = n.objectId, i.push(r);
3291
+ for (let s = 0, r = me.length; s < r; s++) {
3292
+ const o = me[s];
3293
+ o.object = this, o.batchId = e, o.objectId = n.objectId, i.push(o);
3294
3294
  }
3295
3295
  me.length = 0;
3296
3296
  }
@@ -3313,7 +3313,7 @@ class Pi extends d.LineSegments {
3313
3313
  return this.geometry.dispose(), this;
3314
3314
  }
3315
3315
  }
3316
- const Ye = /* @__PURE__ */ new d.Box3(), U = /* @__PURE__ */ new d.Vector3(), W = /* @__PURE__ */ new d.Mesh(), ge = [];
3316
+ const He = /* @__PURE__ */ new d.Box3(), U = /* @__PURE__ */ new d.Vector3(), W = /* @__PURE__ */ new d.Mesh(), ge = [];
3317
3317
  class Ri extends d.Mesh {
3318
3318
  constructor(e = 1e3, t = e * 2, i) {
3319
3319
  super(new d.BufferGeometry(), i), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e, this._maxIndexCount = t;
@@ -3336,7 +3336,7 @@ class Ri extends d.Mesh {
3336
3336
  const t = this.geometry, i = this._maxVertexCount, n = this._maxIndexCount;
3337
3337
  if (this._geometryInitialized === !1) {
3338
3338
  for (const s in e.attributes) {
3339
- const o = e.getAttribute(s), { array: r, itemSize: a, normalized: h } = o, l = new r.constructor(i * a), m = new d.BufferAttribute(
3339
+ const r = e.getAttribute(s), { array: o, itemSize: a, normalized: h } = r, l = new o.constructor(i * a), m = new d.BufferAttribute(
3340
3340
  l,
3341
3341
  a,
3342
3342
  h
@@ -3374,8 +3374,8 @@ class Ri extends d.Mesh {
3374
3374
  let n = this._maxIndexCount;
3375
3375
  i && this.unusedIndexCount < t.count && (n = (this._maxIndexCount + t.count) * 1.5);
3376
3376
  const s = e.getAttribute("position");
3377
- let o = this._maxVertexCount;
3378
- s && this.unusedVertexCount < s.count && (o = (this._maxVertexCount + s.count) * 1.5), (n > this._maxIndexCount || o > this._maxVertexCount) && this.setGeometrySize(o, n);
3377
+ let r = this._maxVertexCount;
3378
+ s && this.unusedVertexCount < s.count && (r = (this._maxVertexCount + s.count) * 1.5), (n > this._maxIndexCount || r > this._maxVertexCount) && this.setGeometrySize(r, n);
3379
3379
  }
3380
3380
  validateGeometryId(e) {
3381
3381
  const t = this._geometryInfo;
@@ -3422,13 +3422,13 @@ class Ri extends d.Mesh {
3422
3422
  visible: !0
3423
3423
  }, s = this._geometryInfo;
3424
3424
  n.vertexStart = this._nextVertexStart, n.reservedVertexCount = t === -1 ? e.getAttribute("position").count : t;
3425
- const o = e.getIndex();
3426
- if (o !== null && (n.indexStart = this._nextIndexStart, n.reservedIndexCount = i === -1 ? o.count : i), n.indexStart !== -1 && n.indexStart + n.reservedIndexCount > this._maxIndexCount || n.vertexStart + n.reservedVertexCount > this._maxVertexCount)
3425
+ const r = e.getIndex();
3426
+ if (r !== null && (n.indexStart = this._nextIndexStart, n.reservedIndexCount = i === -1 ? r.count : i), n.indexStart !== -1 && n.indexStart + n.reservedIndexCount > this._maxIndexCount || n.vertexStart + n.reservedVertexCount > this._maxVertexCount)
3427
3427
  throw new Error(
3428
3428
  "AcTrBatchedMesh: Reserved space request exceeds the maximum buffer size."
3429
3429
  );
3430
- let r;
3431
- return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Oe), r = this._availableGeometryIds.shift(), s[r] = n) : (r = this._geometryCount, this._geometryCount++, s.push(n)), this.setGeometryAt(r, e), this._nextIndexStart = n.indexStart + n.reservedIndexCount, this._nextVertexStart = n.vertexStart + n.reservedVertexCount, r;
3430
+ let o;
3431
+ return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Ve), o = this._availableGeometryIds.shift(), s[o] = n) : (o = this._geometryCount, this._geometryCount++, s.push(n)), this.setGeometryAt(o, e), this._nextIndexStart = n.indexStart + n.reservedIndexCount, this._nextVertexStart = n.vertexStart + n.reservedVertexCount, o;
3432
3432
  }
3433
3433
  setGeometryInfo(e, t) {
3434
3434
  if (e >= this._geometryCount)
@@ -3440,18 +3440,18 @@ class Ri extends d.Mesh {
3440
3440
  if (e >= this._geometryCount)
3441
3441
  throw new Error("AcTrBatchedMesh: Maximum geometry count reached.");
3442
3442
  this._validateGeometry(t);
3443
- const i = this.geometry, n = i.getIndex() !== null, s = i.getIndex(), o = t.getIndex(), r = this._geometryInfo[e];
3444
- if (n && o.count > r.reservedIndexCount || t.attributes.position.count > r.reservedVertexCount)
3443
+ const i = this.geometry, n = i.getIndex() !== null, s = i.getIndex(), r = t.getIndex(), o = this._geometryInfo[e];
3444
+ if (n && r.count > o.reservedIndexCount || t.attributes.position.count > o.reservedVertexCount)
3445
3445
  throw new Error(
3446
3446
  "AcTrBatchedMesh: Reserved space not large enough for provided geometry."
3447
3447
  );
3448
- const a = r.vertexStart, h = r.reservedVertexCount;
3449
- r.vertexCount = t.getAttribute("position").count;
3448
+ const a = o.vertexStart, h = o.reservedVertexCount;
3449
+ o.vertexCount = t.getAttribute("position").count;
3450
3450
  for (const l in i.attributes) {
3451
3451
  const m = t.getAttribute(l), u = i.getAttribute(
3452
3452
  l
3453
3453
  );
3454
- Ve(m, u, a);
3454
+ je(m, u, a);
3455
3455
  const p = m.itemSize;
3456
3456
  for (let g = m.count, y = h; g < y; g++) {
3457
3457
  const f = a + g;
@@ -3464,15 +3464,15 @@ class Ri extends d.Mesh {
3464
3464
  );
3465
3465
  }
3466
3466
  if (n && s) {
3467
- const l = r.indexStart, m = r.reservedIndexCount;
3468
- r.indexCount = t.getIndex().count;
3469
- for (let u = 0; u < o.count; u++)
3470
- s.setX(l + u, a + o.getX(u));
3471
- for (let u = o.count, p = m; u < p; u++)
3467
+ const l = o.indexStart, m = o.reservedIndexCount;
3468
+ o.indexCount = t.getIndex().count;
3469
+ for (let u = 0; u < r.count; u++)
3470
+ s.setX(l + u, a + r.getX(u));
3471
+ for (let u = r.count, p = m; u < p; u++)
3472
3472
  s.setX(l + u, a);
3473
- s.needsUpdate = !0, s.addUpdateRange(l, r.reservedIndexCount);
3473
+ s.needsUpdate = !0, s.addUpdateRange(l, o.reservedIndexCount);
3474
3474
  }
3475
- return r.start = n ? r.indexStart : r.vertexStart, r.count = n ? r.indexCount : r.vertexCount, r.boundingBox = null, t.boundingBox !== null && (r.boundingBox = t.boundingBox.clone()), r.boundingSphere = null, t.boundingSphere !== null && (r.boundingSphere = t.boundingSphere.clone()), e;
3475
+ return o.start = n ? o.indexStart : o.vertexStart, o.count = n ? o.indexCount : o.vertexCount, o.boundingBox = null, t.boundingBox !== null && (o.boundingBox = t.boundingBox.clone()), o.boundingSphere = null, t.boundingSphere !== null && (o.boundingSphere = t.boundingSphere.clone()), e;
3476
3476
  }
3477
3477
  deleteGeometry(e) {
3478
3478
  const t = this._geometryInfo;
@@ -3480,9 +3480,9 @@ class Ri extends d.Mesh {
3480
3480
  }
3481
3481
  optimize() {
3482
3482
  let e = 0, t = 0;
3483
- const i = this._geometryInfo, n = i.map((o, r) => r).sort((o, r) => i[o].vertexStart - i[r].vertexStart), s = this.geometry;
3484
- for (let o = 0, r = i.length; o < r; o++) {
3485
- const a = n[o], h = i[a];
3483
+ const i = this._geometryInfo, n = i.map((r, o) => o).sort((r, o) => i[r].vertexStart - i[o].vertexStart), s = this.geometry;
3484
+ for (let r = 0, o = i.length; r < o; r++) {
3485
+ const a = n[r], h = i[a];
3486
3486
  if (h.active !== !1) {
3487
3487
  if (s.index !== null) {
3488
3488
  if (h.indexStart !== t) {
@@ -3523,10 +3523,10 @@ class Ri extends d.Mesh {
3523
3523
  return null;
3524
3524
  const i = this.geometry, n = this._geometryInfo[e];
3525
3525
  if (n.boundingBox === null) {
3526
- const s = new d.Box3(), o = i.index, r = i.attributes.position;
3526
+ const s = new d.Box3(), r = i.index, o = i.attributes.position;
3527
3527
  for (let a = n.start, h = n.start + n.count; a < h; a++) {
3528
3528
  let l = a;
3529
- o && (l = o.getX(l)), s.expandByPoint(U.fromBufferAttribute(r, l));
3529
+ r && (l = r.getX(l)), s.expandByPoint(U.fromBufferAttribute(o, l));
3530
3530
  }
3531
3531
  n.boundingBox = s;
3532
3532
  }
@@ -3539,12 +3539,12 @@ class Ri extends d.Mesh {
3539
3539
  const i = this.geometry, n = this._geometryInfo[e];
3540
3540
  if (n.boundingSphere === null) {
3541
3541
  const s = new d.Sphere();
3542
- this.getBoundingBoxAt(e, Ye), Ye.getCenter(s.center);
3543
- const o = i.index, r = i.attributes.position;
3542
+ this.getBoundingBoxAt(e, He), He.getCenter(s.center);
3543
+ const r = i.index, o = i.attributes.position;
3544
3544
  let a = 0;
3545
3545
  for (let h = n.start, l = n.start + n.count; h < l; h++) {
3546
3546
  let m = h;
3547
- o && (m = o.getX(m)), U.fromBufferAttribute(r, m), a = Math.max(
3547
+ r && (m = r.getX(m)), U.fromBufferAttribute(o, m), a = Math.max(
3548
3548
  a,
3549
3549
  s.center.distanceToSquared(U)
3550
3550
  );
@@ -3603,9 +3603,9 @@ class Ri extends d.Mesh {
3603
3603
  if (n.bboxIntersectionCheck) {
3604
3604
  const s = n.boundingBox;
3605
3605
  if (t.ray.intersectBox(s, U)) {
3606
- const o = t.ray.origin.distanceTo(U);
3606
+ const r = t.ray.origin.distanceTo(U);
3607
3607
  i.push({
3608
- distance: o,
3608
+ distance: r,
3609
3609
  point: U.clone(),
3610
3610
  object: this,
3611
3611
  face: null,
@@ -3623,9 +3623,9 @@ class Ri extends d.Mesh {
3623
3623
  n.start,
3624
3624
  n.count
3625
3625
  ), W.raycast(t, ge);
3626
- for (let s = 0, o = ge.length; s < o; s++) {
3627
- const r = ge[s];
3628
- r.object = this, r.batchId = e, r.objectId = n.objectId, i.push(r);
3626
+ for (let s = 0, r = ge.length; s < r; s++) {
3627
+ const o = ge[s];
3628
+ o.object = this, o.batchId = e, o.objectId = n.objectId, i.push(o);
3629
3629
  }
3630
3630
  ge.length = 0;
3631
3631
  }
@@ -3648,7 +3648,7 @@ class Ri extends d.Mesh {
3648
3648
  return this.geometry.dispose(), this;
3649
3649
  }
3650
3650
  }
3651
- const He = /* @__PURE__ */ new d.Box3(), X = /* @__PURE__ */ new d.Vector3(), $ = /* @__PURE__ */ new d.Points(), pe = [];
3651
+ const qe = /* @__PURE__ */ new d.Box3(), X = /* @__PURE__ */ new d.Vector3(), $ = /* @__PURE__ */ new d.Points(), pe = [];
3652
3652
  class Oi extends d.Points {
3653
3653
  constructor(e = 1e3, t) {
3654
3654
  super(new d.BufferGeometry(), t), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e;
@@ -3671,9 +3671,9 @@ class Oi extends d.Points {
3671
3671
  const t = this.geometry, i = this._maxVertexCount;
3672
3672
  if (this._geometryInitialized === !1) {
3673
3673
  for (const n in e.attributes) {
3674
- const s = e.getAttribute(n), { array: o, itemSize: r, normalized: a } = s, h = new o.constructor(i * r), l = new d.BufferAttribute(
3674
+ const s = e.getAttribute(n), { array: r, itemSize: o, normalized: a } = s, h = new r.constructor(i * o), l = new d.BufferAttribute(
3675
3675
  h,
3676
- r,
3676
+ o,
3677
3677
  a
3678
3678
  );
3679
3679
  t.setAttribute(n, l);
@@ -3744,7 +3744,7 @@ class Oi extends d.Points {
3744
3744
  }, n = this._geometryInfo;
3745
3745
  i.vertexStart = this._nextVertexStart, i.reservedVertexCount = t === -1 ? e.getAttribute("position").count : t;
3746
3746
  let s;
3747
- return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Oe), s = this._availableGeometryIds.shift(), n[s] = i) : (s = this._geometryCount, this._geometryCount++, n.push(i)), this.setGeometryAt(s, e), this._nextVertexStart = i.vertexStart + i.reservedVertexCount, this.geometry.setDrawRange(0, this._nextVertexStart), s;
3747
+ return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Ve), s = this._availableGeometryIds.shift(), n[s] = i) : (s = this._geometryCount, this._geometryCount++, n.push(i)), this.setGeometryAt(s, e), this._nextVertexStart = i.vertexStart + i.reservedVertexCount, this.geometry.setDrawRange(0, this._nextVertexStart), s;
3748
3748
  }
3749
3749
  setGeometryInfo(e, t) {
3750
3750
  if (e >= this._geometryCount)
@@ -3756,22 +3756,22 @@ class Oi extends d.Points {
3756
3756
  if (e >= this._geometryCount)
3757
3757
  throw new Error("AcTrBatchedLine: Maximum geometry count reached.");
3758
3758
  this._validateGeometry(t);
3759
- const i = this.geometry, n = this._geometryInfo[e], s = n.vertexStart, o = n.reservedVertexCount;
3759
+ const i = this.geometry, n = this._geometryInfo[e], s = n.vertexStart, r = n.reservedVertexCount;
3760
3760
  n.vertexCount = t.getAttribute("position").count;
3761
- for (const r in i.attributes) {
3762
- const a = t.getAttribute(r), h = i.getAttribute(
3763
- r
3761
+ for (const o in i.attributes) {
3762
+ const a = t.getAttribute(o), h = i.getAttribute(
3763
+ o
3764
3764
  );
3765
- Ve(a, h, s);
3765
+ je(a, h, s);
3766
3766
  const l = a.itemSize;
3767
- for (let m = a.count, u = o; m < u; m++) {
3767
+ for (let m = a.count, u = r; m < u; m++) {
3768
3768
  const p = s + m;
3769
3769
  for (let g = 0; g < l; g++)
3770
3770
  h.setComponent(p, g, 0);
3771
3771
  }
3772
3772
  h.needsUpdate = !0, h.addUpdateRange(
3773
3773
  s * l,
3774
- o * l
3774
+ r * l
3775
3775
  );
3776
3776
  }
3777
3777
  return n.boundingBox = null, t.boundingBox !== null && (n.boundingBox = t.boundingBox.clone()), n.boundingSphere = null, t.boundingSphere !== null && (n.boundingSphere = t.boundingSphere.clone()), e;
@@ -3782,9 +3782,9 @@ class Oi extends d.Points {
3782
3782
  }
3783
3783
  optimize() {
3784
3784
  let e = 0;
3785
- const t = this._geometryInfo, i = t.map((s, o) => o).sort((s, o) => t[s].vertexStart - t[o].vertexStart), n = this.geometry;
3786
- for (let s = 0, o = t.length; s < o; s++) {
3787
- const r = i[s], a = t[r];
3785
+ const t = this._geometryInfo, i = t.map((s, r) => r).sort((s, r) => t[s].vertexStart - t[r].vertexStart), n = this.geometry;
3786
+ for (let s = 0, r = t.length; s < r; s++) {
3787
+ const o = i[s], a = t[o];
3788
3788
  if (a.active !== !1) {
3789
3789
  if (a.vertexStart !== e) {
3790
3790
  const { vertexStart: h, reservedVertexCount: l } = a, m = n.attributes;
@@ -3812,10 +3812,10 @@ class Oi extends d.Points {
3812
3812
  return null;
3813
3813
  const i = this.geometry, n = this._geometryInfo[e];
3814
3814
  if (n.boundingBox === null) {
3815
- const s = new d.Box3(), o = i.index, r = i.attributes.position;
3815
+ const s = new d.Box3(), r = i.index, o = i.attributes.position;
3816
3816
  for (let a = n.vertexStart, h = n.vertexStart + n.vertexCount; a < h; a++) {
3817
3817
  let l = a;
3818
- o && (l = o.getX(l)), s.expandByPoint(X.fromBufferAttribute(r, l));
3818
+ r && (l = r.getX(l)), s.expandByPoint(X.fromBufferAttribute(o, l));
3819
3819
  }
3820
3820
  n.boundingBox = s;
3821
3821
  }
@@ -3828,12 +3828,12 @@ class Oi extends d.Points {
3828
3828
  const i = this.geometry, n = this._geometryInfo[e];
3829
3829
  if (n.boundingSphere === null) {
3830
3830
  const s = new d.Sphere();
3831
- this.getBoundingBoxAt(e, He), He.getCenter(s.center);
3832
- const o = i.index, r = i.attributes.position;
3831
+ this.getBoundingBoxAt(e, qe), qe.getCenter(s.center);
3832
+ const r = i.index, o = i.attributes.position;
3833
3833
  let a = 0;
3834
3834
  for (let h = n.vertexStart, l = n.vertexStart + n.vertexCount; h < l; h++) {
3835
3835
  let m = h;
3836
- o && (m = o.getX(m)), X.fromBufferAttribute(r, m), a = Math.max(
3836
+ r && (m = r.getX(m)), X.fromBufferAttribute(o, m), a = Math.max(
3837
3837
  a,
3838
3838
  s.center.distanceToSquared(X)
3839
3839
  );
@@ -3892,9 +3892,9 @@ class Oi extends d.Points {
3892
3892
  if (n.bboxIntersectionCheck) {
3893
3893
  const s = n.boundingBox;
3894
3894
  if (t.ray.intersectBox(s, X)) {
3895
- const o = t.ray.origin.distanceTo(X);
3895
+ const r = t.ray.origin.distanceTo(X);
3896
3896
  i.push({
3897
- distance: o,
3897
+ distance: r,
3898
3898
  point: X.clone(),
3899
3899
  object: this,
3900
3900
  face: null,
@@ -3912,9 +3912,9 @@ class Oi extends d.Points {
3912
3912
  n.vertexStart,
3913
3913
  n.vertexCount
3914
3914
  ), $.raycast(t, pe);
3915
- for (let s = 0, o = pe.length; s < o; s++) {
3916
- const r = pe[s];
3917
- r.object = this, r.batchId = e, r.objectId = n.objectId, i.push(r);
3915
+ for (let s = 0, r = pe.length; s < r; s++) {
3916
+ const o = pe[s];
3917
+ o.object = this, o.batchId = e, o.objectId = n.objectId, i.push(o);
3918
3918
  }
3919
3919
  pe.length = 0;
3920
3920
  }
@@ -4065,11 +4065,11 @@ class Vi extends d.Group {
4065
4065
  const i = this._entitiesMap.get(e);
4066
4066
  if (i) {
4067
4067
  const n = [];
4068
- for (let s = 0, o = i.length; s < o; s++) {
4069
- const r = i[s];
4068
+ for (let s = 0, r = i.length; s < r; s++) {
4069
+ const o = i[s];
4070
4070
  if (this.getObjectById(
4071
- r.batchedObjectId
4072
- ).intersectWith(r.batchId, t, n), n.length > 0) return !0;
4071
+ o.batchedObjectId
4072
+ ).intersectWith(o.batchId, t, n), n.length > 0) return !0;
4073
4073
  }
4074
4074
  }
4075
4075
  return !1;
@@ -4091,8 +4091,8 @@ class Vi extends d.Group {
4091
4091
  i && i.forEach((n) => {
4092
4092
  const s = this.getObjectById(
4093
4093
  n.batchedObjectId
4094
- ).getObjectAt(n.batchId), o = Ie.cloneMaterial(s.material);
4095
- Ie.setMaterialColor(o), s.material = o, s.userData.objectId = e, t.add(s);
4094
+ ).getObjectAt(n.batchId), r = Ie.cloneMaterial(s.material);
4095
+ Ie.setMaterialColor(r), s.material = r, s.userData.objectId = e, t.add(s);
4096
4096
  });
4097
4097
  }
4098
4098
  unhighlight(e, t) {
@@ -4105,20 +4105,20 @@ class Vi extends d.Group {
4105
4105
  const i = e.material, n = this.getMatchedLineBatches(e);
4106
4106
  let s = n.get(i.id);
4107
4107
  s == null && (s = new Pi(1e3, 2e3, i), n.set(i.id, s), this.add(s)), e.geometry.applyMatrix4(e.matrixWorld);
4108
- const o = s.addGeometry(e.geometry);
4109
- return s.setGeometryInfo(o, t), {
4108
+ const r = s.addGeometry(e.geometry);
4109
+ return s.setGeometryInfo(r, t), {
4110
4110
  batchedObjectId: s.id,
4111
- batchId: o
4111
+ batchId: r
4112
4112
  };
4113
4113
  }
4114
4114
  addMesh(e, t) {
4115
4115
  const i = e.material, n = this.getMatchedMeshBatches(e);
4116
4116
  let s = n.get(i.id);
4117
4117
  s == null && (s = new Ri(1e3, 2e3, i), n.set(i.id, s), this.add(s)), e.geometry.applyMatrix4(e.matrixWorld);
4118
- const o = s.addGeometry(e.geometry);
4119
- return s.setGeometryInfo(o, t), {
4118
+ const r = s.addGeometry(e.geometry);
4119
+ return s.setGeometryInfo(r, t), {
4120
4120
  batchedObjectId: s.id,
4121
- batchId: o
4121
+ batchId: r
4122
4122
  };
4123
4123
  }
4124
4124
  addPoint(e, t) {
@@ -4171,7 +4171,7 @@ class Vi extends d.Group {
4171
4171
  return t;
4172
4172
  }
4173
4173
  }
4174
- class ft extends Se {
4174
+ class xt extends Se {
4175
4175
  constructor(e) {
4176
4176
  super(), this._styleManager = e;
4177
4177
  }
@@ -4185,7 +4185,7 @@ class ft extends Se {
4185
4185
  return this._styleManager = e._styleManager, super.copy(e, t);
4186
4186
  }
4187
4187
  }
4188
- class E extends ft {
4188
+ class E extends xt {
4189
4189
  constructor(e) {
4190
4190
  super(e), this._objectId = "", this._ownerId = "", this._layerName = "", this._box = new d.Box3();
4191
4191
  }
@@ -4315,13 +4315,13 @@ class E extends ft {
4315
4315
  });
4316
4316
  }
4317
4317
  createColorArray(e, t) {
4318
- const i = (e >> 16 & 255) / 256, n = (e >> 8 & 255) / 256, s = (e & 255) / 256, o = new Float32Array(t * 3);
4319
- for (let r = 0, a = 0; r < t; r++)
4320
- o[a] = i, o[a + 1] = n, o[a + 2] = s, a += 3;
4321
- return o;
4318
+ const i = (e >> 16 & 255) / 256, n = (e >> 8 & 255) / 256, s = (e & 255) / 256, r = new Float32Array(t * 3);
4319
+ for (let o = 0, a = 0; o < t; o++)
4320
+ r[a] = i, r[a + 1] = n, r[a + 2] = s, a += 3;
4321
+ return r;
4322
4322
  }
4323
4323
  }
4324
- const xt = class H {
4324
+ const _t = class H {
4325
4325
  constructor() {
4326
4326
  }
4327
4327
  /**
@@ -4359,8 +4359,8 @@ const xt = class H {
4359
4359
  this._renderer && (this._renderer.destroy(), this._renderer = void 0), H._instance = null;
4360
4360
  }
4361
4361
  };
4362
- xt._instance = null;
4363
- let _t = xt;
4362
+ _t._instance = null;
4363
+ let Pe = _t;
4364
4364
  class ji extends E {
4365
4365
  constructor(e, t) {
4366
4366
  super(t), e.forEach((i) => {
@@ -4377,12 +4377,12 @@ class Gi extends E {
4377
4377
  super(i);
4378
4378
  const n = URL.createObjectURL(e), s = new d.TextureLoader().load(n);
4379
4379
  s.colorSpace = d.SRGBColorSpace;
4380
- const o = new d.MeshBasicMaterial({
4380
+ const r = new d.MeshBasicMaterial({
4381
4381
  side: d.DoubleSide,
4382
4382
  map: s
4383
- }), r = new d.Shape(t.boundary), a = new d.ShapeGeometry(r);
4383
+ }), o = new d.Shape(t.boundary), a = new d.ShapeGeometry(o);
4384
4384
  this.generateUVs(a);
4385
- const h = new d.Mesh(a, o);
4385
+ const h = new d.Mesh(a, r);
4386
4386
  this.add(h);
4387
4387
  }
4388
4388
  /**
@@ -4391,10 +4391,10 @@ class Gi extends E {
4391
4391
  * @param geometry Input geometry to generate UVs
4392
4392
  */
4393
4393
  generateUVs(e) {
4394
- const t = e.attributes.position.array, i = new Float32Array(t.length / 3 * 2), n = Math.min(...t.filter((l, m) => m % 3 === 0)), s = Math.max(...t.filter((l, m) => m % 3 === 0)), o = Math.min(...t.filter((l, m) => m % 3 === 1)), r = Math.max(...t.filter((l, m) => m % 3 === 1)), a = s - n, h = r - o;
4394
+ const t = e.attributes.position.array, i = new Float32Array(t.length / 3 * 2), n = Math.min(...t.filter((l, m) => m % 3 === 0)), s = Math.max(...t.filter((l, m) => m % 3 === 0)), r = Math.min(...t.filter((l, m) => m % 3 === 1)), o = Math.max(...t.filter((l, m) => m % 3 === 1)), a = s - n, h = o - r;
4395
4395
  for (let l = 0; l < t.length; l += 3) {
4396
4396
  const m = t[l], u = t[l + 1];
4397
- i[l / 3 * 2] = (m - n) / a, i[l / 3 * 2 + 1] = (u - o) / h;
4397
+ i[l / 3 * 2] = (m - n) / a, i[l / 3 * 2 + 1] = (u - r) / h;
4398
4398
  }
4399
4399
  e.setAttribute("uv", new d.BufferAttribute(i, 2));
4400
4400
  }
@@ -4426,13 +4426,13 @@ class le {
4426
4426
  return t;
4427
4427
  }
4428
4428
  static createGeometryAttributeByIndex(e, t) {
4429
- const i = t.count, n = e.itemSize, s = e.array.constructor, o = new s(i * n);
4430
- for (let r = 0; r < i; r++) {
4431
- const a = t.getX(r) * n;
4429
+ const i = t.count, n = e.itemSize, s = e.array.constructor, r = new s(i * n);
4430
+ for (let o = 0; o < i; o++) {
4431
+ const a = t.getX(o) * n;
4432
4432
  for (let h = 0; h < n; h++)
4433
- o[r * n + h] = e.array[a + h];
4433
+ r[o * n + h] = e.array[a + h];
4434
4434
  }
4435
- return new d.BufferAttribute(o, n, e.normalized);
4435
+ return new d.BufferAttribute(r, n, e.normalized);
4436
4436
  }
4437
4437
  /**
4438
4438
  * Converts InterleavedBufferAttribute to BufferAttribute, because mergeGeometries doesn't support InterleavedBufferAttribute.
@@ -4449,9 +4449,9 @@ class le {
4449
4449
  }
4450
4450
  static createBufferGeometryByPoints(e) {
4451
4451
  const t = new d.BufferGeometry(), i = new Float32Array(e.length * 3), n = new Uint16Array((e.length - 1) * 2);
4452
- return e.forEach((s, o) => {
4453
- let r = o * 3;
4454
- i[r] = s.x, i[r + 1] = s.y, i[r + 2] = s.z, o > 0 && (r = (o - 1) * 2, n[r] = o - 1, n[r + 1] = o);
4452
+ return e.forEach((s, r) => {
4453
+ let o = r * 3;
4454
+ i[o] = s.x, i[o + 1] = s.y, i[o + 2] = s.z, r > 0 && (o = (r - 1) * 2, n[o] = r - 1, n[o + 1] = r);
4455
4455
  }), t.setAttribute(
4456
4456
  "position",
4457
4457
  new d.Float32BufferAttribute(i, 3)
@@ -4466,18 +4466,18 @@ class le {
4466
4466
  const s = i.attributes.position;
4467
4467
  if (!s || s.count === 0)
4468
4468
  return;
4469
- const o = [];
4469
+ const r = [];
4470
4470
  if (t)
4471
- for (let r = 0, a = s.count; r < a; r += 2)
4472
- ye.fromBufferAttribute(s, r).applyMatrix4(n), fe.fromBufferAttribute(s, r + 1).applyMatrix4(n), o[r] = r === 0 ? 0 : o[r - 1], o[r + 1] = o[r] + ye.distanceTo(fe);
4471
+ for (let o = 0, a = s.count; o < a; o += 2)
4472
+ ye.fromBufferAttribute(s, o).applyMatrix4(n), fe.fromBufferAttribute(s, o + 1).applyMatrix4(n), r[o] = o === 0 ? 0 : r[o - 1], r[o + 1] = r[o] + ye.distanceTo(fe);
4473
4473
  else {
4474
- o[0] = 0;
4475
- for (let r = 1, a = s.count; r < a; r++)
4476
- ye.fromBufferAttribute(s, r - 1).applyMatrix4(n), fe.fromBufferAttribute(s, r).applyMatrix4(n), o[r] = o[r - 1], o[r] += ye.distanceTo(fe);
4474
+ r[0] = 0;
4475
+ for (let o = 1, a = s.count; o < a; o++)
4476
+ ye.fromBufferAttribute(s, o - 1).applyMatrix4(n), fe.fromBufferAttribute(s, o).applyMatrix4(n), r[o] = r[o - 1], r[o] += ye.distanceTo(fe);
4477
4477
  }
4478
4478
  i.setAttribute(
4479
4479
  "lineDistance",
4480
- new d.Float32BufferAttribute(o, 1)
4480
+ new d.Float32BufferAttribute(r, 1)
4481
4481
  ), e.geometry.dispose(), e.geometry = i;
4482
4482
  }
4483
4483
  }
@@ -4495,16 +4495,16 @@ class le {
4495
4495
  * @param scale Input scale factor
4496
4496
  */
4497
4497
  static apply2dTransform(e, t, i = 0, n = 1) {
4498
- const s = e.attributes.position, o = s.itemSize, r = s.array;
4498
+ const s = e.attributes.position, r = s.itemSize, o = s.array;
4499
4499
  if (i != 0) {
4500
4500
  const a = Math.cos(i), h = Math.sin(i);
4501
- for (let l = 0; l < r.length; l += o) {
4502
- const m = r[l], u = r[l + 1], p = m * a - u * h, g = m * h + u * a;
4503
- r[l] = p * n + t.x, r[l + 1] = g * n + t.y;
4501
+ for (let l = 0; l < o.length; l += r) {
4502
+ const m = o[l], u = o[l + 1], p = m * a - u * h, g = m * h + u * a;
4503
+ o[l] = p * n + t.x, o[l + 1] = g * n + t.y;
4504
4504
  }
4505
4505
  } else
4506
- for (let a = 0; a < r.length; a += o)
4507
- r[a] = r[a] * n + t.x, r[a + 1] += r[a + 1] * n + t.y;
4506
+ for (let a = 0; a < o.length; a += r)
4507
+ o[a] = o[a] * n + t.x, o[a + 1] += o[a + 1] * n + t.y;
4508
4508
  return s.needsUpdate = !0, e;
4509
4509
  }
4510
4510
  /**
@@ -4514,12 +4514,12 @@ class le {
4514
4514
  * @param rotation Input roatation (in radians) around x-axis, y-axis, and z-axis
4515
4515
  */
4516
4516
  static apply3dTransform(e, t, i) {
4517
- const n = e.attributes.position, s = n.itemSize, o = n.array, r = Math.cos(i.x), a = Math.sin(i.x), h = Math.cos(i.y), l = Math.sin(i.y), m = Math.cos(i.z), u = Math.sin(i.z);
4518
- for (let p = 0; p < o.length; p += s) {
4519
- let g = o[p], y = o[p + 1], f = o[p + 2], _ = y * r - f * a, x = y * a + f * r;
4517
+ const n = e.attributes.position, s = n.itemSize, r = n.array, o = Math.cos(i.x), a = Math.sin(i.x), h = Math.cos(i.y), l = Math.sin(i.y), m = Math.cos(i.z), u = Math.sin(i.z);
4518
+ for (let p = 0; p < r.length; p += s) {
4519
+ let g = r[p], y = r[p + 1], f = r[p + 2], _ = y * o - f * a, x = y * a + f * o;
4520
4520
  y = _, f = x;
4521
4521
  let w = g * h + f * l;
4522
- x = -g * l + f * h, g = w, f = x, w = g * m - y * u, _ = g * u + y * m, g = w, y = _, o[p] = g + t.x, o[p + 1] = y + t.y, o[p + 2] = f + t.z;
4522
+ x = -g * l + f * h, g = w, f = x, w = g * m - y * u, _ = g * u + y * m, g = w, y = _, r[p] = g + t.x, r[p + 1] = y + t.y, r[p + 2] = f + t.z;
4523
4523
  }
4524
4524
  return n.needsUpdate = !0, e;
4525
4525
  }
@@ -4530,15 +4530,15 @@ class ki extends E {
4530
4530
  let n;
4531
4531
  const s = t ? t.color : 16777215;
4532
4532
  t ? n = this.styleManager.getLineShaderMaterial(t, 1) : n = new d.LineBasicMaterial({ color: s });
4533
- const o = e.length, r = new Float32Array(o * 3), a = o * 2 > 65535 ? new Uint32Array(o * 2) : new Uint16Array(o * 2);
4534
- for (let m = 0, u = 0; m < o; m++) {
4533
+ const r = e.length, o = new Float32Array(r * 3), a = r * 2 > 65535 ? new Uint32Array(r * 2) : new Uint16Array(r * 2);
4534
+ for (let m = 0, u = 0; m < r; m++) {
4535
4535
  const p = e[m];
4536
- r[u++] = p.x, r[u++] = p.y, r[u++] = p.z ?? 0;
4536
+ o[u++] = p.x, o[u++] = p.y, o[u++] = p.z ?? 0;
4537
4537
  }
4538
- for (let m = 0, u = 0; m < o - 1; m++)
4538
+ for (let m = 0, u = 0; m < r - 1; m++)
4539
4539
  a[u++] = m, a[u++] = m + 1;
4540
4540
  const h = new d.BufferGeometry();
4541
- h.setAttribute("position", new d.BufferAttribute(r, 3)), h.setIndex(new d.BufferAttribute(a, 1)), this.setBoundingBox(h), this.geometry = h;
4541
+ h.setAttribute("position", new d.BufferAttribute(o, 3)), h.setIndex(new d.BufferAttribute(a, 1)), this.setBoundingBox(h), this.geometry = h;
4542
4542
  const l = new d.LineSegments(h, n);
4543
4543
  le.computeLineDistances(l), this.add(l);
4544
4544
  }
@@ -4549,14 +4549,14 @@ class ki extends E {
4549
4549
  class Fi extends E {
4550
4550
  constructor(e, t, i, n, s) {
4551
4551
  super(s);
4552
- let o;
4553
- n ? o = this.styleManager.getLineShaderMaterial(n, 1) : o = new d.LineBasicMaterial({ color: 16777215 });
4554
- const r = new d.BufferGeometry();
4555
- r.setAttribute(
4552
+ let r;
4553
+ n ? r = this.styleManager.getLineShaderMaterial(n, 1) : r = new d.LineBasicMaterial({ color: 16777215 });
4554
+ const o = new d.BufferGeometry();
4555
+ o.setAttribute(
4556
4556
  "position",
4557
4557
  new d.BufferAttribute(e, t)
4558
- ), r.setIndex(new d.BufferAttribute(i, 1)), r.computeBoundingBox(), this.box = r.boundingBox;
4559
- const a = new d.LineSegments(r, o);
4558
+ ), o.setIndex(new d.BufferAttribute(i, 1)), o.computeBoundingBox(), this.box = o.boundingBox;
4559
+ const a = new d.LineSegments(o, r);
4560
4560
  le.computeLineDistances(a), this.add(a);
4561
4561
  }
4562
4562
  }
@@ -4565,7 +4565,7 @@ class Ni extends E {
4565
4565
  super(i), this._text = e, this._style = t;
4566
4566
  }
4567
4567
  async draw() {
4568
- const e = _t.getInstance();
4568
+ const e = Pe.getInstance();
4569
4569
  if (e)
4570
4570
  try {
4571
4571
  const t = this._style;
@@ -4606,8 +4606,8 @@ class Wi extends E {
4606
4606
  this.isShowPoint = n.point != null;
4607
4607
  const s = n.point ?? new d.BufferGeometry().setFromPoints([Ui.copy(e)]);
4608
4608
  s.computeBoundingBox(), s.boundingBox && this.box.union(s.boundingBox);
4609
- const o = this.styleManager.getPointsMaterial(t.color), r = new d.Points(s, o);
4610
- if (r.userData.bboxIntersectionCheck = !0, r.visible = this.isShowPoint, this.add(r), n.line) {
4609
+ const r = this.styleManager.getPointsMaterial(t.color), o = new d.Points(s, r);
4610
+ if (o.userData.bboxIntersectionCheck = !0, o.visible = this.isShowPoint, this.add(o), n.line) {
4611
4611
  const a = n.line;
4612
4612
  a.computeBoundingBox(), a.boundingBox && this.box.union(a.boundingBox);
4613
4613
  const h = this.styleManager.getLineBasicMaterial(t.color), l = new d.LineSegments(a, h);
@@ -4619,10 +4619,10 @@ class Xi extends E {
4619
4619
  constructor(e, t, i) {
4620
4620
  var n;
4621
4621
  super(i);
4622
- const s = e.getPoints(100), o = e.buildHierarchy(), r = [];
4623
- this.buildHatchGeometry(s, o, r);
4622
+ const s = e.getPoints(100), r = e.buildHierarchy(), o = [];
4623
+ this.buildHatchGeometry(s, r, o);
4624
4624
  let a;
4625
- if (r.length > 0 && (a = Qt(r)), !a || !a.getIndex() || ((n = a.getIndex()) == null ? void 0 : n.count) === 0)
4625
+ if (o.length > 0 && (a = Qt(o)), !a || !a.getIndex() || ((n = a.getIndex()) == null ? void 0 : n.count) === 0)
4626
4626
  console.warn("Failed to convert hatch boundaries!");
4627
4627
  else {
4628
4628
  a.computeBoundingBox(), this.box = a.boundingBox;
@@ -4643,7 +4643,7 @@ class Xi extends E {
4643
4643
  a.children.map((h) => h.index)
4644
4644
  );
4645
4645
  });
4646
- const o = (a) => {
4646
+ const r = (a) => {
4647
4647
  try {
4648
4648
  const h = new d.ShapeGeometry(a);
4649
4649
  h.hasAttribute("uv") && h.deleteAttribute("uv"), h.hasAttribute("normal") && h.deleteAttribute("normal"), i.push(h);
@@ -4658,9 +4658,9 @@ class Xi extends E {
4658
4658
  if (h.length === 0)
4659
4659
  return;
4660
4660
  const l = new d.Shape(h);
4661
- o(l);
4661
+ r(l);
4662
4662
  });
4663
- const r = (a) => a.map((h) => h.toArray());
4663
+ const o = (a) => a.map((h) => h.toArray());
4664
4664
  for (const a of s) {
4665
4665
  const h = new d.Shape(
4666
4666
  e[a[0]]
@@ -4678,15 +4678,15 @@ class Xi extends E {
4678
4678
  try {
4679
4679
  p.forEach((f, _) => {
4680
4680
  y = Math.min(e[f][0].relativeEps(), 1e-6);
4681
- const x = new yt(new pt(y));
4681
+ const x = new ft(new yt(y));
4682
4682
  if (_ === 0)
4683
4683
  g = x.segments({
4684
- regions: [r(e[f])],
4684
+ regions: [o(e[f])],
4685
4685
  inverted: !1
4686
4686
  });
4687
4687
  else {
4688
4688
  const w = x.segments({
4689
- regions: [r(e[f])],
4689
+ regions: [o(e[f])],
4690
4690
  inverted: !1
4691
4691
  }), b = x.combine(g, w);
4692
4692
  l = x.polygon(x.selectUnion(b)), l.regions.length > 0 ? l.regions.forEach((I) => {
@@ -4710,7 +4710,7 @@ class Xi extends E {
4710
4710
  new d.Path(e[g])
4711
4711
  );
4712
4712
  }
4713
- o(h);
4713
+ r(h);
4714
4714
  }
4715
4715
  t.children.forEach((a) => {
4716
4716
  a.children.forEach((h) => {
@@ -4721,17 +4721,17 @@ class Xi extends E {
4721
4721
  findIntersectHole(e, t) {
4722
4722
  const i = t.length, n = [];
4723
4723
  for (let s = 0; s < i; s++) {
4724
- const o = e[t[s]];
4725
- let r = !1;
4724
+ const r = e[t[s]];
4725
+ let o = !1;
4726
4726
  const a = [];
4727
4727
  for (let h = s + 1; h < i; h++) {
4728
4728
  const l = e[t[h]];
4729
4729
  St.isPolygonIntersect(
4730
- o,
4730
+ r,
4731
4731
  l
4732
- ) && (r = !0, a.push(t[h]));
4732
+ ) && (o = !0, a.push(t[h]));
4733
4733
  }
4734
- r && (a.push(t[s]), n.push(a));
4734
+ o && (a.push(t[s]), n.push(a));
4735
4735
  }
4736
4736
  return n;
4737
4737
  }
@@ -4742,7 +4742,7 @@ function $i(c, e, t, i, n = 0) {
4742
4742
  u_patternLines: { value: c },
4743
4743
  u_patternAngle: { value: e },
4744
4744
  u_color: { value: i }
4745
- }, o = (
4745
+ }, r = (
4746
4746
  /*glsl*/
4747
4747
  `
4748
4748
  varying vec3 v_pos;
@@ -4756,7 +4756,7 @@ function $i(c, e, t, i, n = 0) {
4756
4756
  #include <project_vertex>
4757
4757
  #include <clipping_planes_vertex>
4758
4758
  }`
4759
- ), r = (
4759
+ ), o = (
4760
4760
  /*glsl*/
4761
4761
  `
4762
4762
  uniform mat4 modelMatrix;
@@ -4951,8 +4951,8 @@ function $i(c, e, t, i, n = 0) {
4951
4951
  );
4952
4952
  return new d.ShaderMaterial({
4953
4953
  uniforms: s,
4954
- vertexShader: o,
4955
- fragmentShader: r,
4954
+ vertexShader: r,
4955
+ fragmentShader: o,
4956
4956
  clipping: !0
4957
4957
  });
4958
4958
  }
@@ -4962,17 +4962,17 @@ class Yi {
4962
4962
  * Note: remember to call line.computeLineDistances() in order to make it work!
4963
4963
  */
4964
4964
  static createLineShaderMaterial(e, t, i, n, s) {
4965
- let o = 0;
4966
- const r = [];
4965
+ let r = 0;
4966
+ const o = [];
4967
4967
  for (let m = 0; m < e.length; m++)
4968
- r[m] = e[m].elementLength * i, o += Math.abs(r[m]);
4969
- for (let m = 0; m < r.length; m++)
4970
- r[m] === 0 && (r[m] = o * 0.01 * i, o += r[m]);
4968
+ o[m] = e[m].elementLength * i, r += Math.abs(o[m]);
4969
+ for (let m = 0; m < o.length; m++)
4970
+ o[m] === 0 && (o[m] = r * 0.01 * i, r += o[m]);
4971
4971
  const a = d.UniformsUtils.merge([
4972
4972
  d.UniformsLib.common,
4973
4973
  {
4974
- pattern: { value: r },
4975
- patternLength: { value: o },
4974
+ pattern: { value: o },
4975
+ patternLength: { value: r },
4976
4976
  u_color: { value: new d.Color(t) }
4977
4977
  }
4978
4978
  ]);
@@ -5091,12 +5091,12 @@ const we = class oe {
5091
5091
  const n = this.findMatchedHatchShaderMaterial(e);
5092
5092
  if (n)
5093
5093
  return n;
5094
- const s = 5e-3, o = 0.05;
5095
- let r = 2;
5094
+ const s = 5e-3, r = 0.05;
5095
+ let o = 2;
5096
5096
  e.patternLines.forEach((u) => {
5097
- r = Math.max(
5097
+ o = Math.max(
5098
5098
  u.dashPattern.length,
5099
- r
5099
+ o
5100
5100
  );
5101
5101
  });
5102
5102
  let a = 0;
@@ -5122,14 +5122,14 @@ const we = class oe {
5122
5122
  const G = u.dashPattern[v];
5123
5123
  G > 0 && (f = !1), _ += Math.abs(G);
5124
5124
  }
5125
- const x = f ? o : s, w = [], b = [];
5125
+ const x = f ? r : s, w = [], b = [];
5126
5126
  let I = 0;
5127
5127
  b[0] = I;
5128
5128
  for (let v = 0; v < y; ++v)
5129
5129
  w[v] = u.dashPattern[v], w[v] === 0 && (w[v] = x * _), I += Math.abs(w[v]), b[v + 1] = I;
5130
- for (let v = y; v < r; ++v)
5130
+ for (let v = y; v < o; ++v)
5131
5131
  w[v] = 0;
5132
- for (let v = b.length; v < r + 1; ++v)
5132
+ for (let v = b.length; v < o + 1; ++v)
5133
5133
  b[v] = I;
5134
5134
  const P = {
5135
5135
  origin: p,
@@ -5139,7 +5139,7 @@ const we = class oe {
5139
5139
  patternSum: b,
5140
5140
  patternLength: I
5141
5141
  };
5142
- if (a += 4, a += r, a += r + 1, a > oe.MaxFragmentUniforms) {
5142
+ if (a += 4, a += o, a += o + 1, a > oe.MaxFragmentUniforms) {
5143
5143
  console.warn(
5144
5144
  "There will be warning in fragment shader when number of uniforms exceeds 1024, so extra hatch line patterns are ignored here!"
5145
5145
  );
@@ -5154,7 +5154,7 @@ const we = class oe {
5154
5154
  new d.Color(e.color)
5155
5155
  );
5156
5156
  return m.defines = {
5157
- MAX_PATTERN_SEGMENT_COUNT: r
5157
+ MAX_PATTERN_SEGMENT_COUNT: o
5158
5158
  }, this.hatchShaderMaterials.push({
5159
5159
  patternLines: e.patternLines,
5160
5160
  patternAngle: e.patternAngle,
@@ -5173,15 +5173,15 @@ const we = class oe {
5173
5173
  if (!i(a[l], h[l]))
5174
5174
  return !1;
5175
5175
  return !0;
5176
- }, s = (a, h) => i(a.angle, h.angle) && i(a.delta.x, h.delta.x) && i(a.delta.y, h.delta.y) && i(a.origin.x, h.origin.x) && i(a.origin.y, h.origin.y) && n(a.dashPattern, h.dashPattern), o = (a, h) => {
5176
+ }, s = (a, h) => i(a.angle, h.angle) && i(a.delta.x, h.delta.x) && i(a.delta.y, h.delta.y) && i(a.origin.x, h.origin.x) && i(a.origin.y, h.origin.y) && n(a.dashPattern, h.dashPattern), r = (a, h) => {
5177
5177
  if (a.length !== h.length)
5178
5178
  return !1;
5179
5179
  for (let l = 0; l < a.length; ++l)
5180
5180
  if (!s(a[l], h[l]))
5181
5181
  return !1;
5182
5182
  return !0;
5183
- }, r = this.hatchShaderMaterials.find((a) => a.color === e.color && a.patternAngle === e.patternAngle && o(a.patternLines, t));
5184
- return r == null ? void 0 : r.material;
5183
+ }, o = this.hatchShaderMaterials.find((a) => a.color === e.color && a.patternAngle === e.patternAngle && r(a.patternLines, t));
5184
+ return o == null ? void 0 : o.material;
5185
5185
  }
5186
5186
  };
5187
5187
  we.CameraZoomUniform = { value: 1 }, we.ViewportScaleUniform = { value: 1 }, we.MaxFragmentUniforms = 1024;
@@ -5282,7 +5282,7 @@ class qi {
5282
5282
  * Create one empty drawable object
5283
5283
  */
5284
5284
  createObject() {
5285
- return new ft(this._styleManager);
5285
+ return new xt(this._styleManager);
5286
5286
  }
5287
5287
  /**
5288
5288
  * Create one empty entity
@@ -5565,7 +5565,7 @@ class bt {
5565
5565
  e.getCenter(n);
5566
5566
  const s = new d.Vector3(n.x, n.y, 0);
5567
5567
  this._camera.position.set(n.x, n.y, this._camera.position.z), this._camera.lookAt(s), this._camera.setRotationFromEuler(new d.Euler(0, 0, 0));
5568
- const o = i.x * t, r = i.y * t, a = this._width / o, h = this._height / r;
5568
+ const r = i.x * t, o = i.y * t, a = this._width / r, h = this._height / o;
5569
5569
  this._camera.zoom = Math.min(a, h), this._cameraControls.target = s, this.updateCameraFrustum();
5570
5570
  }
5571
5571
  updateCameraFrustum(e, t) {
@@ -5651,7 +5651,7 @@ class Be extends bt {
5651
5651
  }
5652
5652
  }
5653
5653
  }
5654
- const Zi = (c) => new tt(c.min, c.max), Ji = (c) => new L(
5654
+ const Zi = (c) => new it(c.min, c.max), Ji = (c) => new L(
5655
5655
  c.min,
5656
5656
  c.max
5657
5657
  ), Ki = (c) => new d.Box3(
@@ -5725,53 +5725,53 @@ class on extends d.Object3D {
5725
5725
  }
5726
5726
  calculateViewportPos() {
5727
5727
  const e = this.renderer.domElement, t = e.offsetWidth, i = e.offsetHeight, n = this.gizmoPos, s = this.gizmoDim;
5728
- let o = t - s, r = i - s;
5728
+ let r = t - s, o = i - s;
5729
5729
  switch (n) {
5730
5730
  case 0:
5731
- o = 0, r = 0;
5731
+ r = 0, o = 0;
5732
5732
  break;
5733
5733
  case 1:
5734
- o = 0;
5734
+ r = 0;
5735
5735
  break;
5736
5736
  case 4:
5737
- r = 0;
5737
+ o = 0;
5738
5738
  break;
5739
5739
  }
5740
- return { x: o, y: r };
5740
+ return { x: r, y: o };
5741
5741
  }
5742
5742
  calculateViewportBbox() {
5743
- const e = this.renderer.domElement, t = e.offsetWidth, i = e.offsetHeight, n = this.gizmoPos, s = this.gizmoDim, o = new d.Box2(
5743
+ const e = this.renderer.domElement, t = e.offsetWidth, i = e.offsetHeight, n = this.gizmoPos, s = this.gizmoDim, r = new d.Box2(
5744
5744
  new d.Vector2(t - s, 0),
5745
5745
  new d.Vector2(t, s)
5746
5746
  );
5747
5747
  switch (n) {
5748
5748
  case 0:
5749
- o.set(
5749
+ r.set(
5750
5750
  new d.Vector2(0, i - s),
5751
5751
  new d.Vector2(s, i)
5752
5752
  );
5753
5753
  break;
5754
5754
  case 1:
5755
- o.set(new d.Vector2(0, 0), new d.Vector2(s, s));
5755
+ r.set(new d.Vector2(0, 0), new d.Vector2(s, s));
5756
5756
  break;
5757
5757
  case 4:
5758
- o.set(
5758
+ r.set(
5759
5759
  new d.Vector2(t - s, i - s),
5760
5760
  new d.Vector2(t, i)
5761
5761
  );
5762
5762
  break;
5763
5763
  }
5764
- return o;
5764
+ return r;
5765
5765
  }
5766
5766
  }
5767
5767
  function an(c, e) {
5768
- const t = e.font || "Helvetica", i = e.fontSize || 30, n = e.width || 200, s = e.height || 200, o = e.bgColor ? e.bgColor.join(", ") : "255, 255, 255, 1.0", r = e.color ? e.color.join(", ") : "0, 0, 0, 1.0", a = document.createElement("canvas");
5768
+ const t = e.font || "Helvetica", i = e.fontSize || 30, n = e.width || 200, s = e.height || 200, r = e.bgColor ? e.bgColor.join(", ") : "255, 255, 255, 1.0", o = e.color ? e.color.join(", ") : "0, 0, 0, 1.0", a = document.createElement("canvas");
5769
5769
  a.width = n, a.height = s;
5770
5770
  const h = a.getContext("2d");
5771
5771
  if (h) {
5772
- h.font = `bold ${i}px ${t}`, h.fillStyle = `rgba(${o})`, h.fillRect(0, 0, n, s);
5772
+ h.font = `bold ${i}px ${t}`, h.fillStyle = `rgba(${r})`, h.fillRect(0, 0, n, s);
5773
5773
  const u = h.measureText(c).width;
5774
- h.fillStyle = `rgba(${r})`, h.fillText(
5774
+ h.fillStyle = `rgba(${o})`, h.fillText(
5775
5775
  c,
5776
5776
  n / 2 - u / 2,
5777
5777
  s / 2 + i / 2 - 2
@@ -5802,18 +5802,18 @@ class hn extends on {
5802
5802
  ...i
5803
5803
  };
5804
5804
  super(e, t, n.size, i.pos), this.hasZAxis = n.hasZAxis;
5805
- const s = [0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0], o = [1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0];
5806
- this.hasZAxis && (s.push(0, 0, 0, 0, 0, 2), o.push(0, 0, 1, 0, 0.6, 1));
5807
- const r = new d.BufferGeometry();
5808
- r.setAttribute(
5805
+ const s = [0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0], r = [1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0];
5806
+ this.hasZAxis && (s.push(0, 0, 0, 0, 0, 2), r.push(0, 0, 1, 0, 0.6, 1));
5807
+ const o = new d.BufferGeometry();
5808
+ o.setAttribute(
5809
5809
  "position",
5810
5810
  new d.Float32BufferAttribute(s, 3)
5811
- ), r.setAttribute("color", new d.Float32BufferAttribute(o, 3));
5811
+ ), o.setAttribute("color", new d.Float32BufferAttribute(r, 3));
5812
5812
  const a = new d.LineBasicMaterial({
5813
5813
  vertexColors: !0,
5814
5814
  toneMapped: !1
5815
5815
  });
5816
- this.axes = new d.LineSegments(r, a), this.axes.position.set(-1, -1, -1), this.add(this.axes), this.xText = Ce("X"), this.xText.position.set(1.5, -1, -1), this.add(this.xText), this.yText = Ce("Y"), this.yText.position.set(-1, 1.5, -1), this.add(this.yText), this.hasZAxis && (this.zText = Ce("Z"), this.zText.position.set(-1, -1, 1.5), this.add(this.zText));
5816
+ this.axes = new d.LineSegments(o, a), this.axes.position.set(-1, -1, -1), this.add(this.axes), this.xText = Ce("X"), this.xText.position.set(1.5, -1, -1), this.add(this.xText), this.yText = Ce("Y"), this.yText.position.set(-1, 1.5, -1), this.add(this.yText), this.hasZAxis && (this.zText = Ce("Z"), this.zText.position.set(-1, -1, 1.5), this.add(this.zText));
5817
5817
  }
5818
5818
  /**
5819
5819
  * Set color of x-axis and y-axis
@@ -6055,12 +6055,12 @@ function wt(c, e, t = 0, i = c.length - 1, n = un) {
6055
6055
  wt(c, e, p, g, n);
6056
6056
  }
6057
6057
  const s = c[e];
6058
- let o = t, r = i;
6059
- for (se(c, t, e), n(c[i], s) > 0 && se(c, t, i); o < r; ) {
6060
- for (se(c, o, r), o++, r--; n(c[o], s) < 0; ) o++;
6061
- for (; n(c[r], s) > 0; ) r--;
6058
+ let r = t, o = i;
6059
+ for (se(c, t, e), n(c[i], s) > 0 && se(c, t, i); r < o; ) {
6060
+ for (se(c, r, o), r++, o--; n(c[r], s) < 0; ) r++;
6061
+ for (; n(c[o], s) > 0; ) o--;
6062
6062
  }
6063
- n(c[t], s) === 0 ? se(c, t, r) : (r++, se(c, r, i)), r <= e && (t = r + 1), e <= r && (i = r - 1);
6063
+ n(c[t], s) === 0 ? se(c, t, o) : (o++, se(c, o, i)), o <= e && (t = o + 1), e <= o && (i = o - 1);
6064
6064
  }
6065
6065
  }
6066
6066
  function se(c, e, t) {
@@ -6083,9 +6083,9 @@ class mn {
6083
6083
  if (!_e(e, t)) return i;
6084
6084
  const n = this.toBBox, s = [];
6085
6085
  for (; t; ) {
6086
- for (let o = 0; o < t.children.length; o++) {
6087
- const r = t.children[o], a = t.leaf ? n(r) : r;
6088
- _e(e, a) && (t.leaf ? i.push(r) : Ee(e, a) ? this._all(r, i) : s.push(r));
6086
+ for (let r = 0; r < t.children.length; r++) {
6087
+ const o = t.children[r], a = t.leaf ? n(o) : o;
6088
+ _e(e, a) && (t.leaf ? i.push(o) : Ee(e, a) ? this._all(o, i) : s.push(o));
6089
6089
  }
6090
6090
  t = s.pop();
6091
6091
  }
@@ -6097,9 +6097,9 @@ class mn {
6097
6097
  const i = [];
6098
6098
  for (; t; ) {
6099
6099
  for (let n = 0; n < t.children.length; n++) {
6100
- const s = t.children[n], o = t.leaf ? this.toBBox(s) : s;
6101
- if (_e(e, o)) {
6102
- if (t.leaf || Ee(e, o)) return !0;
6100
+ const s = t.children[n], r = t.leaf ? this.toBBox(s) : s;
6101
+ if (_e(e, r)) {
6102
+ if (t.leaf || Ee(e, r)) return !0;
6103
6103
  i.push(s);
6104
6104
  }
6105
6105
  }
@@ -6137,15 +6137,15 @@ class mn {
6137
6137
  remove(e, t) {
6138
6138
  if (!e) return this;
6139
6139
  let i = this.data;
6140
- const n = this.toBBox(e), s = [], o = [];
6141
- let r, a, h;
6140
+ const n = this.toBBox(e), s = [], r = [];
6141
+ let o, a, h;
6142
6142
  for (; i || s.length; ) {
6143
- if (i || (i = s.pop(), a = s[s.length - 1], r = o.pop(), h = !0), i.leaf) {
6143
+ if (i || (i = s.pop(), a = s[s.length - 1], o = r.pop(), h = !0), i.leaf) {
6144
6144
  const l = gn(e, i.children, t);
6145
6145
  if (l !== -1)
6146
6146
  return i.children.splice(l, 1), s.push(i), this._condense(s), this;
6147
6147
  }
6148
- !h && !i.leaf && Ee(i, n) ? (s.push(i), o.push(r), r = 0, a = i, i = i.children[0]) : a ? (r++, i = a.children[r], h = !1) : i = null;
6148
+ !h && !i.leaf && Ee(i, n) ? (s.push(i), r.push(o), o = 0, a = i, i = i.children[0]) : a ? (o++, i = a.children[o], h = !1) : i = null;
6149
6149
  }
6150
6150
  return this;
6151
6151
  }
@@ -6172,36 +6172,36 @@ class mn {
6172
6172
  }
6173
6173
  _build(e, t, i, n) {
6174
6174
  const s = i - t + 1;
6175
- let o = this._maxEntries, r;
6176
- if (s <= o)
6177
- return r = q(e.slice(t, i + 1)), Y(r, this.toBBox), r;
6178
- n || (n = Math.ceil(Math.log(s) / Math.log(o)), o = Math.ceil(s / Math.pow(o, n - 1))), r = q([]), r.leaf = !1, r.height = n;
6179
- const a = Math.ceil(s / o), h = a * Math.ceil(Math.sqrt(o));
6180
- qe(e, t, i, h, this.compareMinX);
6175
+ let r = this._maxEntries, o;
6176
+ if (s <= r)
6177
+ return o = q(e.slice(t, i + 1)), Y(o, this.toBBox), o;
6178
+ n || (n = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, n - 1))), o = q([]), o.leaf = !1, o.height = n;
6179
+ const a = Math.ceil(s / r), h = a * Math.ceil(Math.sqrt(r));
6180
+ Qe(e, t, i, h, this.compareMinX);
6181
6181
  for (let l = t; l <= i; l += h) {
6182
6182
  const m = Math.min(l + h - 1, i);
6183
- qe(e, l, m, a, this.compareMinY);
6183
+ Qe(e, l, m, a, this.compareMinY);
6184
6184
  for (let u = l; u <= m; u += a) {
6185
6185
  const p = Math.min(u + a - 1, m);
6186
- r.children.push(this._build(e, u, p, n - 1));
6186
+ o.children.push(this._build(e, u, p, n - 1));
6187
6187
  }
6188
6188
  }
6189
- return Y(r, this.toBBox), r;
6189
+ return Y(o, this.toBBox), o;
6190
6190
  }
6191
6191
  _chooseSubtree(e, t, i, n) {
6192
6192
  for (; n.push(t), !(t.leaf || n.length - 1 === i); ) {
6193
- let s = 1 / 0, o = 1 / 0, r;
6193
+ let s = 1 / 0, r = 1 / 0, o;
6194
6194
  for (let a = 0; a < t.children.length; a++) {
6195
6195
  const h = t.children[a], l = Le(h), m = fn(e, h) - l;
6196
- m < o ? (o = m, s = l < s ? l : s, r = h) : m === o && l < s && (s = l, r = h);
6196
+ m < r ? (r = m, s = l < s ? l : s, o = h) : m === r && l < s && (s = l, o = h);
6197
6197
  }
6198
- t = r || t.children[0];
6198
+ t = o || t.children[0];
6199
6199
  }
6200
6200
  return t;
6201
6201
  }
6202
6202
  _insert(e, t, i) {
6203
- const n = i ? e : this.toBBox(e), s = [], o = this._chooseSubtree(n, this.data, t, s);
6204
- for (o.children.push(e), ce(o, n); t >= 0 && s[t].children.length > this._maxEntries; )
6203
+ const n = i ? e : this.toBBox(e), s = [], r = this._chooseSubtree(n, this.data, t, s);
6204
+ for (r.children.push(e), ce(r, n); t >= 0 && s[t].children.length > this._maxEntries; )
6205
6205
  this._split(s, t), t--;
6206
6206
  this._adjustParentBBoxes(n, s, t);
6207
6207
  }
@@ -6209,37 +6209,37 @@ class mn {
6209
6209
  _split(e, t) {
6210
6210
  const i = e[t], n = i.children.length, s = this._minEntries;
6211
6211
  this._chooseSplitAxis(i, s, n);
6212
- const o = this._chooseSplitIndex(i, s, n), r = q(i.children.splice(o, i.children.length - o));
6213
- r.height = i.height, r.leaf = i.leaf, Y(i, this.toBBox), Y(r, this.toBBox), t ? e[t - 1].children.push(r) : this._splitRoot(i, r);
6212
+ const r = this._chooseSplitIndex(i, s, n), o = q(i.children.splice(r, i.children.length - r));
6213
+ o.height = i.height, o.leaf = i.leaf, Y(i, this.toBBox), Y(o, this.toBBox), t ? e[t - 1].children.push(o) : this._splitRoot(i, o);
6214
6214
  }
6215
6215
  _splitRoot(e, t) {
6216
6216
  this.data = q([e, t]), this.data.height = e.height + 1, this.data.leaf = !1, Y(this.data, this.toBBox);
6217
6217
  }
6218
6218
  _chooseSplitIndex(e, t, i) {
6219
- let n, s = 1 / 0, o = 1 / 0;
6220
- for (let r = t; r <= i - t; r++) {
6221
- const a = ae(e, 0, r, this.toBBox), h = ae(e, r, i, this.toBBox), l = xn(a, h), m = Le(a) + Le(h);
6222
- l < s ? (s = l, n = r, o = m < o ? m : o) : l === s && m < o && (o = m, n = r);
6219
+ let n, s = 1 / 0, r = 1 / 0;
6220
+ for (let o = t; o <= i - t; o++) {
6221
+ const a = ae(e, 0, o, this.toBBox), h = ae(e, o, i, this.toBBox), l = xn(a, h), m = Le(a) + Le(h);
6222
+ l < s ? (s = l, n = o, r = m < r ? m : r) : l === s && m < r && (r = m, n = o);
6223
6223
  }
6224
6224
  return n || i - t;
6225
6225
  }
6226
6226
  // sorts node children by the best axis for split
6227
6227
  _chooseSplitAxis(e, t, i) {
6228
- const n = e.leaf ? this.compareMinX : pn, s = e.leaf ? this.compareMinY : yn, o = this._allDistMargin(e, t, i, n), r = this._allDistMargin(e, t, i, s);
6229
- o < r && e.children.sort(n);
6228
+ const n = e.leaf ? this.compareMinX : pn, s = e.leaf ? this.compareMinY : yn, r = this._allDistMargin(e, t, i, n), o = this._allDistMargin(e, t, i, s);
6229
+ r < o && e.children.sort(n);
6230
6230
  }
6231
6231
  // total margin of all possible split distributions where each node is at least m full
6232
6232
  _allDistMargin(e, t, i, n) {
6233
6233
  e.children.sort(n);
6234
- const s = this.toBBox, o = ae(e, 0, t, s), r = ae(e, i - t, i, s);
6235
- let a = xe(o) + xe(r);
6234
+ const s = this.toBBox, r = ae(e, 0, t, s), o = ae(e, i - t, i, s);
6235
+ let a = xe(r) + xe(o);
6236
6236
  for (let h = t; h < i - t; h++) {
6237
6237
  const l = e.children[h];
6238
- ce(o, e.leaf ? s(l) : l), a += xe(o);
6238
+ ce(r, e.leaf ? s(l) : l), a += xe(r);
6239
6239
  }
6240
6240
  for (let h = i - t - 1; h >= t; h--) {
6241
6241
  const l = e.children[h];
6242
- ce(r, e.leaf ? s(l) : l), a += xe(r);
6242
+ ce(o, e.leaf ? s(l) : l), a += xe(o);
6243
6243
  }
6244
6244
  return a;
6245
6245
  }
@@ -6264,8 +6264,8 @@ function Y(c, e) {
6264
6264
  function ae(c, e, t, i, n) {
6265
6265
  n || (n = q(null)), n.minX = 1 / 0, n.minY = 1 / 0, n.maxX = -1 / 0, n.maxY = -1 / 0;
6266
6266
  for (let s = e; s < t; s++) {
6267
- const o = c.children[s];
6268
- ce(n, c.leaf ? i(o) : o);
6267
+ const r = c.children[s];
6268
+ ce(n, c.leaf ? i(r) : r);
6269
6269
  }
6270
6270
  return n;
6271
6271
  }
@@ -6308,12 +6308,12 @@ function q(c) {
6308
6308
  maxY: -1 / 0
6309
6309
  };
6310
6310
  }
6311
- function qe(c, e, t, i, n) {
6311
+ function Qe(c, e, t, i, n) {
6312
6312
  const s = [e, t];
6313
6313
  for (; s.length; ) {
6314
6314
  if (t = s.pop(), e = s.pop(), t - e <= i) continue;
6315
- const o = e + Math.ceil((t - e) / i / 2) * i;
6316
- wt(c, o, e, t, n), s.push(e, o, o, t);
6315
+ const r = e + Math.ceil((t - e) / i / 2) * i;
6316
+ wt(c, r, e, t, n), s.push(e, r, r, t);
6317
6317
  }
6318
6318
  }
6319
6319
  class _n {
@@ -6493,10 +6493,10 @@ class bn {
6493
6493
  */
6494
6494
  get stats() {
6495
6495
  const e = [];
6496
- let t = 0, i = 0, n = 0, s = 0, o = 0;
6497
- return this._layers.forEach((r) => {
6498
- const a = r.stats;
6499
- e.push(a), n += a.line.indexed.geometrySize + a.line.nonIndexed.geometrySize, s += a.mesh.indexed.geometrySize + a.mesh.nonIndexed.geometrySize, o += a.point.indexed.geometrySize + a.point.nonIndexed.geometrySize, t += a.summary.totalGeometrySize, i += a.summary.totalMappingSize;
6496
+ let t = 0, i = 0, n = 0, s = 0, r = 0;
6497
+ return this._layers.forEach((o) => {
6498
+ const a = o.stats;
6499
+ e.push(a), n += a.line.indexed.geometrySize + a.line.nonIndexed.geometrySize, s += a.mesh.indexed.geometrySize + a.mesh.nonIndexed.geometrySize, r += a.point.indexed.geometrySize + a.point.nonIndexed.geometrySize, t += a.summary.totalGeometrySize, i += a.summary.totalMappingSize;
6500
6500
  }), {
6501
6501
  layers: e,
6502
6502
  summary: {
@@ -6504,7 +6504,7 @@ class bn {
6504
6504
  totalSize: {
6505
6505
  line: n,
6506
6506
  mesh: s,
6507
- point: o,
6507
+ point: r,
6508
6508
  geometry: t,
6509
6509
  mapping: i
6510
6510
  }
@@ -6871,7 +6871,7 @@ class wn {
6871
6871
  }), this;
6872
6872
  }
6873
6873
  }
6874
- const Qe = {
6874
+ const Ze = {
6875
6875
  background: 0
6876
6876
  };
6877
6877
  class vn extends gi {
@@ -6883,9 +6883,9 @@ class vn extends gi {
6883
6883
  * @param options.calculateSizeCallback - Optional callback function to calculate canvas size on window resize
6884
6884
  * @param options.background - Optional background color as hex number (default: 0x000000)
6885
6885
  */
6886
- constructor(e = Qe) {
6886
+ constructor(e = Ze) {
6887
6887
  const t = {
6888
- ...Qe,
6888
+ ...Ze,
6889
6889
  ...e
6890
6890
  }, i = new d.WebGLRenderer({
6891
6891
  antialias: !0,
@@ -6905,7 +6905,7 @@ class vn extends gi {
6905
6905
  this.mode == O.SELECTION && this.select();
6906
6906
  }), document.addEventListener("keydown", (s) => {
6907
6907
  s.code === "Escape" && this.selectionSet.clear();
6908
- }), it().layoutManager.events.layoutSwitched.addEventListener(
6908
+ }), nt().layoutManager.events.layoutSwitched.addEventListener(
6909
6909
  (s) => {
6910
6910
  this.activeLayoutBtrId = s.layout.blockTableRecordId;
6911
6911
  }
@@ -7076,8 +7076,8 @@ class vn extends gi {
7076
7076
  e == null && (e = this.curPos);
7077
7077
  const t = [], i = this._scene.activeLayout;
7078
7078
  if (i) {
7079
- const n = this.activeLayoutView, s = n.pointToBox(e, this.selectionBoxSize), o = this._scene.search(s), r = Math.max(s.size.width / 2, s.size.height / 2), a = n.resetRaycaster(e, r);
7080
- o.forEach((h) => {
7079
+ const n = this.activeLayoutView, s = n.pointToBox(e, this.selectionBoxSize), r = this._scene.search(s), o = Math.max(s.size.width / 2, s.size.height / 2), a = n.resetRaycaster(e, o);
7080
+ r.forEach((h) => {
7081
7081
  const l = h.id;
7082
7082
  i.isIntersectWith(l, a) && t.push(l);
7083
7083
  });
@@ -7109,7 +7109,9 @@ class vn extends gi {
7109
7109
  */
7110
7110
  addEntity(e) {
7111
7111
  const t = Array.isArray(e) ? e : [e];
7112
- this.batchConvert(t);
7112
+ setTimeout(async () => {
7113
+ await this.batchConvert(t);
7114
+ });
7113
7115
  }
7114
7116
  /**
7115
7117
  * Remove the specified entity from this view.
@@ -7217,39 +7219,37 @@ class vn extends gi {
7217
7219
  * @param entities - The database entities
7218
7220
  * @returns The converted three entities
7219
7221
  */
7220
- batchConvert(e) {
7221
- const t = [];
7222
- for (let i = 0; i < e.length; ++i) {
7223
- const n = e[i], s = n.draw(
7222
+ async batchConvert(e) {
7223
+ for (let t = 0; t < e.length; ++t) {
7224
+ const i = e[t], n = i.draw(
7224
7225
  this._renderer
7225
7226
  );
7226
- if (s) {
7227
- s.objectId = n.objectId, s.ownerId = n.ownerId, s.layerName = n.layer, s.visible = n.visibility;
7228
- const o = !(n instanceof rt || n instanceof ot);
7229
- if (s.draw().then(() => {
7230
- this._scene.addEntity(s, o), s.dispose(), this._isDirty = !0;
7231
- }), n instanceof nt) {
7232
- if (n.number > 1) {
7233
- const r = this._layoutViewManager.getAt(n.ownerId);
7227
+ if (n) {
7228
+ n.objectId = i.objectId, n.ownerId = i.ownerId, n.layerName = i.layer, n.visible = i.visibility;
7229
+ const s = !(i instanceof ot || i instanceof at);
7230
+ if (await n.draw().then(() => {
7231
+ this._scene.addEntity(n, s), n.dispose(), this._isDirty = !0;
7232
+ }), i instanceof st) {
7233
+ if (i.number > 1) {
7234
+ const r = this._layoutViewManager.getAt(i.ownerId);
7234
7235
  if (r) {
7235
- const a = new Be(
7236
+ const o = new Be(
7236
7237
  r,
7237
- n.toGiViewport(),
7238
+ i.toGiViewport(),
7238
7239
  this._renderer
7239
7240
  );
7240
- r.addViewport(a);
7241
+ r.addViewport(o);
7241
7242
  }
7242
7243
  }
7243
- } else if (n instanceof st) {
7244
- const r = n.imageFileName;
7245
- r && this._missedImages.set(n.objectId, r);
7244
+ } else if (i instanceof rt) {
7245
+ const r = i.imageFileName;
7246
+ r && this._missedImages.set(i.objectId, r);
7246
7247
  }
7247
7248
  }
7248
7249
  }
7249
- return t;
7250
7250
  }
7251
7251
  }
7252
- const Ze = "simsun";
7252
+ const Je = "simsun";
7253
7253
  class Q {
7254
7254
  /**
7255
7255
  * Gets the singleton instance of the document creator.
@@ -7278,8 +7278,8 @@ class Q {
7278
7278
  createExampleDoc1(e) {
7279
7279
  for (let n = 0; n < 2; ++n)
7280
7280
  for (let s = 0; s < 2; ++s) {
7281
- const o = new De(), r = new at();
7282
- r.addVertexAt(0, { x: s * 100, y: n * 100, bulge: 1 }), r.addVertexAt(1, { x: s * 100 + 100, y: n * 100, bulge: 1 }), r.closed = !0, o.add(r), e.tables.blockTable.modelSpace.appendEntity(o);
7281
+ const r = new De(), o = new ct();
7282
+ o.addVertexAt(0, { x: s * 100, y: n * 100, bulge: 1 }), o.addVertexAt(1, { x: s * 100 + 100, y: n * 100, bulge: 1 }), o.closed = !0, r.add(o), e.tables.blockTable.modelSpace.appendEntity(r);
7283
7283
  }
7284
7284
  }
7285
7285
  /**
@@ -7308,7 +7308,7 @@ class Q {
7308
7308
  const t = e.tables.blockTable.modelSpace;
7309
7309
  t.appendEntity(this.createArc()), this.createLines().forEach((n) => {
7310
7310
  e.tables.blockTable.modelSpace.appendEntity(
7311
- new ct(n.startPoint, n.endPoint)
7311
+ new ht(n.startPoint, n.endPoint)
7312
7312
  );
7313
7313
  }), t.appendEntity(this.createHatch()), e.tables.textStyleTable.add(this.createTextStyle()), t.appendEntity(this.createMText());
7314
7314
  }
@@ -7316,9 +7316,9 @@ class Q {
7316
7316
  const e = {
7317
7317
  bigFont: "",
7318
7318
  color: 16777215,
7319
- extendedFont: Ze,
7319
+ extendedFont: Je,
7320
7320
  fixedTextHeight: 0,
7321
- font: Ze,
7321
+ font: Je,
7322
7322
  lastHeight: 0.2,
7323
7323
  name: "Standard",
7324
7324
  obliqueAngle: 0,
@@ -7326,16 +7326,16 @@ class Q {
7326
7326
  textGenerationFlag: 0,
7327
7327
  widthFactor: 0.667
7328
7328
  };
7329
- return new ht(e);
7329
+ return new lt(e);
7330
7330
  }
7331
7331
  createMText() {
7332
- const e = new lt();
7333
- return e.attachmentPoint = It.MiddleLeft, e.color = new Pe().setColorName("red"), e.layer = "0", e.location = new ze(9850, 86773, 0), e.contents = "{\\W0.667;\\T1.1;智慧8081}", e.height = 200, e.width = 1e3, e.styleName = "Standard", e;
7332
+ const e = new dt();
7333
+ return e.attachmentPoint = It.MiddleLeft, e.color = new Re().setColorName("red"), e.layer = "0", e.location = new ze(9850, 86773, 0), e.contents = "{\\W0.667;\\T1.1;智慧8081}", e.height = 200, e.width = 1e3, e.styleName = "Standard", e;
7334
7334
  }
7335
7335
  createHatch() {
7336
- const e = this.createLines(), t = new De(), i = new dt();
7336
+ const e = this.createLines(), t = new De(), i = new ut();
7337
7337
  return i.add(
7338
- new ut(
7338
+ new mt(
7339
7339
  { x: 20241.23355899991, y: 174118.6312674369 },
7340
7340
  89258.30757455899,
7341
7341
  re.degToRad(262.2471115358437),
@@ -7343,11 +7343,11 @@ class Q {
7343
7343
  !1
7344
7344
  )
7345
7345
  ), e.forEach((n) => {
7346
- i.add(new mt(n.startPoint, n.endPoint));
7346
+ i.add(new gt(n.startPoint, n.endPoint));
7347
7347
  }), t.add(i), t;
7348
7348
  }
7349
7349
  createArc() {
7350
- return new gt(
7350
+ return new pt(
7351
7351
  { x: 20241.23355899991, y: 174118.6312674369, z: 0 },
7352
7352
  89258.30757455899,
7353
7353
  re.degToRad(262.2471115358437),
@@ -7466,8 +7466,8 @@ class Sn {
7466
7466
  await this.getAvaiableFonts();
7467
7467
  const t = [];
7468
7468
  e.forEach((n) => {
7469
- const s = n.toLowerCase(), o = Jt(this._avaiableFonts, (r) => Kt(r.name, (a) => a.toLowerCase() == s) >= 0);
7470
- o && t.push(o.url);
7469
+ const s = n.toLowerCase(), r = Jt(this._avaiableFonts, (o) => Kt(o.name, (a) => a.toLowerCase() == s) >= 0);
7470
+ r && t.push(r.url);
7471
7471
  }), (await this._cadRenderer.loadFonts(t)).forEach((n) => {
7472
7472
  n.status || V.emit("font-not-loaded", {
7473
7473
  fontName: n.fontName,
@@ -7507,7 +7507,7 @@ class C {
7507
7507
  width: window.innerWidth,
7508
7508
  height: window.innerHeight - 30
7509
7509
  }), n = new vn({ canvas: e, calculateSizeCallback: i });
7510
- this._context = new ii(n, t), this._fontLoader = new Sn(n.renderer), it().workingDatabase = t.database, this.registerCommands();
7510
+ this._context = new ii(n, t), this._fontLoader = new Sn(n.renderer), nt().workingDatabase = t.database, this.registerCommands();
7511
7511
  }
7512
7512
  /**
7513
7513
  * Creates the singleton instance with an optional canvas element.
@@ -7827,7 +7827,7 @@ class C {
7827
7827
  e.activeLayoutBtrId = this.curDocument.database.currentSpaceId, e.modelSpaceBtrId = this.curDocument.database.currentSpaceId;
7828
7828
  }
7829
7829
  }
7830
- class Je {
7830
+ class Ke {
7831
7831
  convert(e) {
7832
7832
  const t = this.createEntity(e);
7833
7833
  return t && this.processCommonAttrs(e, t), t;
@@ -7841,7 +7841,7 @@ class Je {
7841
7841
  return e.type == "ARC" ? this.convertArc(e) : e.type == "CIRCLE" ? this.convertCirle(e) : e.type == "DIMENSION" ? this.convertDimension(e) : e.type == "ELLIPSE" ? this.convertEllipse(e) : e.type == "HATCH" ? this.convertHatch(e) : e.type == "IMAGE" ? this.convertImage(e) : e.type == "LEADER" ? this.convertLeader(e) : e.type == "LINE" ? this.convertLine(e) : e.type == "LWPOLYLINE" ? this.convertLWPolyline(e) : e.type == "MTEXT" ? this.convertMText(e) : e.type == "POINT" ? this.convertPoint(e) : e.type == "POLYLINE" ? this.convertPolyline(e) : e.type == "RAY" ? this.convertRay(e) : e.type == "SPLINE" ? this.convertSpline(e) : e.type == "ACAD_TABLE" ? this.convertTable(e) : e.type == "TEXT" ? this.convertText(e) : e.type == "SOLID" ? this.convertSolid(e) : e.type == "VIEWPORT" ? this.convertViewport(e) : e.type == "XLINE" ? this.convertXline(e) : e.type == "INSERT" ? this.convertBlockReference(e) : null;
7842
7842
  }
7843
7843
  convertArc(e) {
7844
- return new gt(
7844
+ return new pt(
7845
7845
  e.center,
7846
7846
  e.radius,
7847
7847
  e.startAngle,
@@ -7865,19 +7865,19 @@ class Je {
7865
7865
  }
7866
7866
  convertLine(e) {
7867
7867
  const t = e.startPoint, i = e.endPoint;
7868
- return new ct(
7868
+ return new ht(
7869
7869
  new ze(t.x, t.y, t.z),
7870
7870
  new ze(i.x, i.y, i.z)
7871
7871
  );
7872
7872
  }
7873
7873
  convertSpline(e) {
7874
- return e.numberOfControlPoints > 0 && e.numberOfKnots > 0 ? new je(
7874
+ return e.numberOfControlPoints > 0 && e.numberOfKnots > 0 ? new Ge(
7875
7875
  e.controlPoints,
7876
7876
  e.knots,
7877
7877
  e.weights,
7878
7878
  e.degree,
7879
7879
  !!(e.flag & 1)
7880
- ) : e.numberOfFitPoints > 0 ? new je(
7880
+ ) : e.numberOfFitPoints > 0 ? new Ge(
7881
7881
  e.fitPoints,
7882
7882
  "Uniform",
7883
7883
  e.degree,
@@ -7896,7 +7896,7 @@ class Je {
7896
7896
  ), t.thickness = e.thickness, t;
7897
7897
  }
7898
7898
  convertLWPolyline(e) {
7899
- const t = new Ge();
7899
+ const t = new ke();
7900
7900
  return t.closed = !!(e.flag & 512), e.vertices.forEach((i, n) => {
7901
7901
  t.addVertexAt(
7902
7902
  n,
@@ -7908,7 +7908,7 @@ class Je {
7908
7908
  }), t;
7909
7909
  }
7910
7910
  convertPolyline(e) {
7911
- const t = new Ge();
7911
+ const t = new ke();
7912
7912
  return t.closed = !!(e.flag & 1), e.vertices.forEach((i, n) => {
7913
7913
  t.addVertexAt(
7914
7914
  n,
@@ -7931,24 +7931,24 @@ class Je {
7931
7931
  });
7932
7932
  }), i.hatchStyle = e.hatchStyle, i.patternName = e.patternName, i.patternType = e.patternType, i.patternAngle = e.patternAngle == null ? 0 : e.patternAngle, i.patternScale = e.patternScale == null ? 0 : e.patternScale, e.boundaryPaths.forEach((n) => {
7933
7933
  if (n.boundaryPathTypeFlag & 2) {
7934
- const s = n, o = new at();
7935
- o.closed = s.isClosed, s.vertices.forEach((r, a) => {
7936
- o.addVertexAt(a, {
7937
- x: r.x,
7938
- y: r.y,
7939
- bulge: r.bulge
7934
+ const s = n, r = new ct();
7935
+ r.closed = s.isClosed, s.vertices.forEach((o, a) => {
7936
+ r.addVertexAt(a, {
7937
+ x: o.x,
7938
+ y: o.y,
7939
+ bulge: o.bulge
7940
7940
  });
7941
- }), i.add(o);
7941
+ }), i.add(r);
7942
7942
  } else {
7943
- const s = n, o = new dt();
7944
- s.edges.forEach((r) => {
7945
- if (r.type == 1) {
7946
- const a = r;
7947
- o.add(new mt(a.start, a.end));
7948
- } else if (r.type == 2) {
7949
- const a = r;
7950
- o.add(
7951
- new ut(
7943
+ const s = n, r = new ut();
7944
+ s.edges.forEach((o) => {
7945
+ if (o.type == 1) {
7946
+ const a = o;
7947
+ r.add(new gt(a.start, a.end));
7948
+ } else if (o.type == 2) {
7949
+ const a = o;
7950
+ r.add(
7951
+ new mt(
7952
7952
  a.center,
7953
7953
  a.radius,
7954
7954
  a.startAngle,
@@ -7956,15 +7956,15 @@ class Je {
7956
7956
  !a.isCCW
7957
7957
  )
7958
7958
  );
7959
- } else if (r.type == 3) {
7960
- const a = r;
7959
+ } else if (o.type == 3) {
7960
+ const a = o;
7961
7961
  new Te().subVectors(a.end, a.center);
7962
7962
  const h = Math.sqrt(
7963
7963
  Math.pow(a.end.x, 2) + Math.pow(a.end.y, 2)
7964
7964
  ), l = h * a.lengthOfMinorAxis;
7965
7965
  let m = a.startAngle, u = a.endAngle;
7966
7966
  const p = Math.atan2(a.end.y, a.end.x);
7967
- a.isCCW || (m = Math.PI * 2 - m, u = Math.PI * 2 - u), o.add(
7967
+ a.isCCW || (m = Math.PI * 2 - m, u = Math.PI * 2 - u), r.add(
7968
7968
  new jt(
7969
7969
  { ...a.center, z: 0 },
7970
7970
  h,
@@ -7975,8 +7975,8 @@ class Je {
7975
7975
  p
7976
7976
  )
7977
7977
  );
7978
- } else if (r.type == 4) {
7979
- const a = r;
7978
+ } else if (o.type == 4) {
7979
+ const a = o;
7980
7980
  if (a.numberOfControlPoints > 0 && a.numberOfKnots > 0) {
7981
7981
  const h = a.controlPoints.map(
7982
7982
  (u) => ({
@@ -7987,8 +7987,8 @@ class Je {
7987
7987
  );
7988
7988
  let l = !0;
7989
7989
  const m = a.controlPoints.map((u) => (u.weight == null && (l = !1), u.weight || 1));
7990
- o.add(
7991
- new ke(
7990
+ r.add(
7991
+ new Fe(
7992
7992
  h,
7993
7993
  a.knots,
7994
7994
  l ? m : void 0
@@ -8000,10 +8000,10 @@ class Je {
8000
8000
  y: l.y,
8001
8001
  z: 0
8002
8002
  }));
8003
- o.add(new ke(h, "Uniform"));
8003
+ r.add(new Fe(h, "Uniform"));
8004
8004
  }
8005
8005
  }
8006
- }), i.add(o);
8006
+ }), i.add(r);
8007
8007
  }
8008
8008
  }), i;
8009
8009
  }
@@ -8026,7 +8026,7 @@ class Je {
8026
8026
  return t.textString = e.text, t.styleName = e.styleName, t.height = e.textHeight, t.position.copy(e.startPoint), t.rotation = e.rotation, t.oblique = e.obliqueAngle ?? 0, t.thickness = e.thickness, t.horizontalMode = e.halign, t.verticalMode = e.valign, t.widthFactor = e.xScale ?? 1, t;
8027
8027
  }
8028
8028
  convertMText(e) {
8029
- const t = new lt();
8029
+ const t = new dt();
8030
8030
  return t.contents = e.text, e.styleName != null && (t.styleName = e.styleName), t.height = e.textHeight, t.width = e.rectWidth, t.rotation = e.rotation || 0, t.location = e.insertionPoint, t.attachmentPoint = e.attachmentPoint, e.direction && (t.direction = new be(e.direction)), t.drawingDirection = e.drawingDirection, t;
8031
8031
  }
8032
8032
  convertLeader(e) {
@@ -8084,7 +8084,7 @@ class Je {
8084
8084
  ) * e.imageSize.y, t.rotation = Math.atan2(e.uPixel.y, e.uPixel.x);
8085
8085
  }
8086
8086
  convertImage(e) {
8087
- const t = new st();
8087
+ const t = new rt();
8088
8088
  return this.processImage(e, t), t;
8089
8089
  }
8090
8090
  // private convertWipeout(wipeout: WipeoutEntity) {
@@ -8093,15 +8093,15 @@ class Je {
8093
8093
  // return dbWipeout
8094
8094
  // }
8095
8095
  convertViewport(e) {
8096
- const t = new nt();
8096
+ const t = new st();
8097
8097
  return t.number = e.viewportId, t.centerPoint.copy(e.viewportCenter), t.height = e.height, t.width = e.width, t.viewCenter.copy(e.displayCenter), t.viewHeight = e.viewHeight, t;
8098
8098
  }
8099
8099
  convertRay(e) {
8100
- const t = new rt();
8100
+ const t = new ot();
8101
8101
  return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
8102
8102
  }
8103
8103
  convertXline(e) {
8104
- const t = new ot();
8104
+ const t = new at();
8105
8105
  return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
8106
8106
  }
8107
8107
  convertBlockReference(e) {
@@ -8137,19 +8137,19 @@ class In extends Bt {
8137
8137
  */
8138
8138
  getFonts(e) {
8139
8139
  const t = /* @__PURE__ */ new Map();
8140
- e.tables.BLOCK_RECORD.entries.forEach((o) => {
8141
- t.set(o.name, o);
8140
+ e.tables.BLOCK_RECORD.entries.forEach((r) => {
8141
+ t.set(r.name, r);
8142
8142
  });
8143
- const i = /* @__PURE__ */ new Map(), n = (o) => {
8144
- if (o) {
8145
- const r = o.lastIndexOf(".");
8146
- return r >= 0 ? o.substring(0, r).toLowerCase() : o.toLowerCase();
8143
+ const i = /* @__PURE__ */ new Map(), n = (r) => {
8144
+ if (r) {
8145
+ const o = r.lastIndexOf(".");
8146
+ return o >= 0 ? r.substring(0, o).toLowerCase() : r.toLowerCase();
8147
8147
  }
8148
8148
  };
8149
- e.tables.STYLE.entries.forEach((o) => {
8150
- const r = [];
8151
- let a = n(o.font);
8152
- a && r.push(a), a = n(o.bigFont), a && r.push(a), i.set(o.name, r);
8149
+ e.tables.STYLE.entries.forEach((r) => {
8150
+ const o = [];
8151
+ let a = n(r.font);
8152
+ a && o.push(a), a = n(r.bigFont), a && o.push(a), i.set(r.name, o);
8153
8153
  });
8154
8154
  const s = /* @__PURE__ */ new Set();
8155
8155
  return this.getFontsInBlock(e.entities, t, i, s), Array.from(s);
@@ -8159,19 +8159,19 @@ class In extends Bt {
8159
8159
  */
8160
8160
  getFontsInBlock(e, t, i, n) {
8161
8161
  const s = /\\f(.*?)\|/g;
8162
- e.forEach((o) => {
8163
- if (o.type == "MTEXT") {
8164
- const r = o;
8165
- [...r.text.matchAll(s)].forEach((h) => {
8162
+ e.forEach((r) => {
8163
+ if (r.type == "MTEXT") {
8164
+ const o = r;
8165
+ [...o.text.matchAll(s)].forEach((h) => {
8166
8166
  n.add(h[1].toLowerCase());
8167
8167
  });
8168
- const a = i.get(r.styleName);
8168
+ const a = i.get(o.styleName);
8169
8169
  a == null || a.forEach((h) => n.add(h));
8170
- } else if (o.type == "TEXT") {
8171
- const r = o, a = i.get(r.styleName);
8170
+ } else if (r.type == "TEXT") {
8171
+ const o = r, a = i.get(o.styleName);
8172
8172
  a == null || a.forEach((h) => n.add(h));
8173
- } else if (o.type == "INSERT") {
8174
- const r = o, a = t.get(r.name);
8173
+ } else if (r.type == "INSERT") {
8174
+ const o = r, a = t.get(o.name);
8175
8175
  a && this.getFontsInBlock(a.entities, t, i, n);
8176
8176
  }
8177
8177
  });
@@ -8190,7 +8190,7 @@ class In extends Bt {
8190
8190
  }
8191
8191
  processTextStyles(e, t) {
8192
8192
  e.tables.STYLE.entries.forEach((i) => {
8193
- const n = new ht(i);
8193
+ const n = new lt(i);
8194
8194
  this.processCommonTableEntryAttrs(i, n), t.tables.textStyleTable.add(n);
8195
8195
  });
8196
8196
  }
@@ -8276,7 +8276,7 @@ class In extends Bt {
8276
8276
  }
8277
8277
  processLayers(e, t) {
8278
8278
  e.tables.LAYER.entries.forEach((i) => {
8279
- const n = new Pe();
8279
+ const n = new Re();
8280
8280
  n.colorIndex = i.colorIndex;
8281
8281
  const s = new Lt({
8282
8282
  name: i.name,
@@ -8305,9 +8305,9 @@ class In extends Bt {
8305
8305
  processBlocks(e, t) {
8306
8306
  }
8307
8307
  async processEntitiesInBlock(e, t) {
8308
- const i = new Je(), n = e.length, s = [];
8309
- for (let o = 0; o < n; o++) {
8310
- const r = e[o], a = i.convert(r);
8308
+ const i = new Ke(), n = e.length, s = [];
8309
+ for (let r = 0; r < n; r++) {
8310
+ const o = e[r], a = i.convert(o);
8311
8311
  a && s.push(a);
8312
8312
  }
8313
8313
  t.appendEntity(s);
@@ -8318,19 +8318,19 @@ class In extends Bt {
8318
8318
  * smaller pieces and executed in small intervals to allow the UI to remain responsive.
8319
8319
  */
8320
8320
  async processEntities(e, t, i, n, s) {
8321
- const o = new Je();
8322
- let r = e.entities;
8323
- const a = r.length, h = new Dt(
8321
+ const r = new Ke();
8322
+ let o = e.entities;
8323
+ const a = o.length, h = new Dt(
8324
8324
  a,
8325
8325
  100 - n.value,
8326
8326
  i
8327
8327
  );
8328
- this.config.convertByEntityType && (r = this.groupAndFlattenByType(r));
8328
+ this.config.convertByEntityType && (o = this.groupAndFlattenByType(o));
8329
8329
  const l = t.tables.blockTable.modelSpace;
8330
8330
  await h.processChunk(async (m, u) => {
8331
8331
  const p = [];
8332
8332
  for (let g = m; g < u; g++) {
8333
- const y = r[g], f = o.convert(y);
8333
+ const y = o[g], f = r.convert(y);
8334
8334
  f && p.push(f);
8335
8335
  }
8336
8336
  if (l.appendEntity(p), s) {
@@ -8352,13 +8352,13 @@ class In extends Bt {
8352
8352
  processLayouts(e, t) {
8353
8353
  const i = t.dictionaries.layouts;
8354
8354
  e.objects.LAYOUT.forEach((n) => {
8355
- const s = new et();
8355
+ const s = new tt();
8356
8356
  s.layoutName = n.layoutName, s.tabOrder = n.tabOrder;
8357
- const o = t.tables.blockTable.newIterator();
8357
+ const r = t.tables.blockTable.newIterator();
8358
8358
  s.objectId = n.handle.toString();
8359
- for (const r of o)
8360
- if (r.layoutId === s.objectId) {
8361
- s.blockTableRecordId = r.objectId;
8359
+ for (const o of r)
8360
+ if (o.layoutId === s.objectId) {
8361
+ s.blockTableRecordId = o.objectId;
8362
8362
  break;
8363
8363
  }
8364
8364
  s.limits.min.copy(n.minLimit), s.limits.max.copy(n.maxLimit), s.extents.min.copy(n.minExtent), s.extents.max.copy(n.maxExtent), this.processCommonObjectAttrs(n, s), i.setAt(s.layoutName, s);
@@ -8401,7 +8401,7 @@ function Bn() {
8401
8401
  useWorker: !0,
8402
8402
  parserWorkerUrl: "./assets/dxf-parser-worker.js"
8403
8403
  });
8404
- Fe.instance.register(ve.DXF, c);
8404
+ Ne.instance.register(ve.DXF, c);
8405
8405
  } catch (c) {
8406
8406
  console.error("Failed to register dxf converter: ", c);
8407
8407
  }
@@ -8411,13 +8411,15 @@ function Bn() {
8411
8411
  useWorker: !0,
8412
8412
  parserWorkerUrl: "./assets/libredwg-parser-worker.js"
8413
8413
  });
8414
- Fe.instance.register(ve.DWG, c);
8414
+ Ne.instance.register(ve.DWG, c);
8415
8415
  } catch (c) {
8416
8416
  console.error("Failed to register dwg converter: ", c);
8417
8417
  }
8418
8418
  }
8419
8419
  function Pn() {
8420
- Bn(), _t.getInstance().initialize("/assets/mtext-renderer-worker.js");
8420
+ Bn(), typeof window < "u" && !!window.location && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") ? Pe.getInstance().initialize(
8421
+ "/assets/mtext-renderer-worker.js"
8422
+ ) : Pe.getInstance().initialize("./mtext-renderer-worker.js");
8421
8423
  }
8422
8424
  const Mn = {
8423
8425
  isDebug: !1,
@@ -8426,7 +8428,7 @@ const Mn = {
8426
8428
  isShowToolbar: !0,
8427
8429
  isShowStats: !1,
8428
8430
  fontMapping: {}
8429
- }, Ke = "settings";
8431
+ }, et = "settings";
8430
8432
  class he {
8431
8433
  constructor() {
8432
8434
  this.events = {
@@ -8461,7 +8463,7 @@ class he {
8461
8463
  */
8462
8464
  set(e, t) {
8463
8465
  const i = this.settings;
8464
- i[e] = t, localStorage.setItem(Ke, JSON.stringify(i)), this.events.modified.dispatch({
8466
+ i[e] = t, localStorage.setItem(et, JSON.stringify(i)), this.events.modified.dispatch({
8465
8467
  key: e,
8466
8468
  value: t
8467
8469
  });
@@ -8616,7 +8618,7 @@ class he {
8616
8618
  * @returns The current settings object
8617
8619
  */
8618
8620
  get settings() {
8619
- const e = localStorage.getItem(Ke), t = e == null ? {} : JSON.parse(e);
8621
+ const e = localStorage.getItem(et), t = e == null ? {} : JSON.parse(e);
8620
8622
  return ei(t, Mn);
8621
8623
  }
8622
8624
  }
@@ -8643,7 +8645,7 @@ export {
8643
8645
  O as AcEdViewMode,
8644
8646
  ui as AcEditor,
8645
8647
  vn as AcTrView2d,
8646
- Qe as DEFAULT_VIEW_2D_OPTIONS,
8648
+ Ze as DEFAULT_VIEW_2D_OPTIONS,
8647
8649
  zn as acedAlert,
8648
8650
  V as eventBus,
8649
8651
  Bn as registerConverters,