@threepipe/plugin-svg-renderer 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/dist/BasicSVGRendererPlugin.d.ts +1 -1
  3. package/dist/ThreeSVGRendererPlugin.d.ts +1 -1
  4. package/dist/dependencies.txt +15 -15
  5. package/dist/index.d.ts +5 -5
  6. package/dist/index.js +618 -665
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +741 -788
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/three-mesh-halfedge/core/Face.d.ts +3 -3
  11. package/dist/three-mesh-halfedge/core/Halfedge.d.ts +3 -3
  12. package/dist/three-mesh-halfedge/core/HalfedgeDS.d.ts +4 -4
  13. package/dist/three-mesh-halfedge/core/Vertex.d.ts +3 -3
  14. package/dist/three-mesh-halfedge/index.d.ts +4 -4
  15. package/dist/three-mesh-halfedge/operations/addEdge.d.ts +3 -3
  16. package/dist/three-mesh-halfedge/operations/addFace.d.ts +3 -3
  17. package/dist/three-mesh-halfedge/operations/addVertex.d.ts +3 -3
  18. package/dist/three-mesh-halfedge/operations/cutFace.d.ts +4 -4
  19. package/dist/three-mesh-halfedge/operations/removeEdge.d.ts +2 -2
  20. package/dist/three-mesh-halfedge/operations/removeFace.d.ts +2 -2
  21. package/dist/three-mesh-halfedge/operations/removeVertex.d.ts +2 -2
  22. package/dist/three-mesh-halfedge/operations/setFromGeometry.d.ts +2 -2
  23. package/dist/three-mesh-halfedge/operations/splitEdge.d.ts +4 -4
  24. package/dist/three-mesh-halfedge/utils/geometry.d.ts +1 -1
  25. package/dist/three-svg-renderer/SVGRenderer.d.ts +3 -3
  26. package/dist/three-svg-renderer/core/SVGMesh.d.ts +5 -5
  27. package/dist/three-svg-renderer/core/index.d.ts +3 -3
  28. package/dist/three-svg-renderer/core/svg/SVGDrawHandler.d.ts +3 -3
  29. package/dist/three-svg-renderer/core/svg/index.d.ts +2 -2
  30. package/dist/three-svg-renderer/core/svg/passes/ChainPass.d.ts +3 -3
  31. package/dist/three-svg-renderer/core/svg/passes/DrawPass.d.ts +1 -1
  32. package/dist/three-svg-renderer/core/svg/passes/FillPass.d.ts +2 -2
  33. package/dist/three-svg-renderer/core/svg/passes/SingularityPointPass.d.ts +2 -2
  34. package/dist/three-svg-renderer/core/svg/passes/index.d.ts +4 -4
  35. package/dist/three-svg-renderer/core/svg/svgutils.d.ts +1 -1
  36. package/dist/three-svg-renderer/core/viewmap/Chain.d.ts +5 -5
  37. package/dist/three-svg-renderer/core/viewmap/Polygon.d.ts +2 -2
  38. package/dist/three-svg-renderer/core/viewmap/ViewEdge.d.ts +4 -4
  39. package/dist/three-svg-renderer/core/viewmap/ViewVertex.d.ts +3 -3
  40. package/dist/three-svg-renderer/core/viewmap/Viewmap.d.ts +10 -10
  41. package/dist/three-svg-renderer/core/viewmap/index.d.ts +5 -5
  42. package/dist/three-svg-renderer/core/viewmap/operations/assignPolygons.d.ts +2 -2
  43. package/dist/three-svg-renderer/core/viewmap/operations/computeChainsVisibility.d.ts +3 -3
  44. package/dist/three-svg-renderer/core/viewmap/operations/computeMeshIntersections.d.ts +2 -2
  45. package/dist/three-svg-renderer/core/viewmap/operations/computePolygons.d.ts +1 -5
  46. package/dist/three-svg-renderer/core/viewmap/operations/computePolygons.d.ts.map +1 -1
  47. package/dist/three-svg-renderer/core/viewmap/operations/createChains.d.ts +4 -4
  48. package/dist/three-svg-renderer/core/viewmap/operations/createViewVertex.d.ts +3 -3
  49. package/dist/three-svg-renderer/core/viewmap/operations/find2dSingularities.d.ts +1 -1
  50. package/dist/three-svg-renderer/core/viewmap/operations/find3dSingularities.d.ts +5 -5
  51. package/dist/three-svg-renderer/core/viewmap/operations/meshIntersectionCb.d.ts +3 -3
  52. package/dist/three-svg-renderer/core/viewmap/operations/setupEdges.d.ts +4 -4
  53. package/dist/three-svg-renderer/core/viewmap/operations/splitEdge.d.ts +4 -4
  54. package/dist/three-svg-renderer/index.d.ts +3 -3
  55. package/dist/three-svg-renderer/utils/buffergeometry.d.ts +2 -2
  56. package/dist/three-svg-renderer/utils/geometry.d.ts +1 -1
  57. package/dist/three-svg-renderer/utils/index.d.ts +3 -3
  58. package/dist/three-svg-renderer/utils/orientationtests.d.ts +1 -1
  59. package/docs/assets/hierarchy.js +1 -1
  60. package/docs/assets/icons.js +1 -1
  61. package/docs/assets/icons.svg +1 -1
  62. package/docs/assets/main.js +2 -2
  63. package/docs/assets/search.js +1 -1
  64. package/docs/assets/style.css +3 -3
  65. package/docs/classes/BasicSVGRenderer.html +2 -2
  66. package/docs/classes/BasicSVGRendererPlugin.html +5 -4
  67. package/docs/classes/DrawPass.html +6 -6
  68. package/docs/classes/FillPass.html +6 -6
  69. package/docs/classes/SVGDrawHandler.html +2 -2
  70. package/docs/classes/SVGDrawInfo.html +2 -2
  71. package/docs/classes/SVGMesh.html +3 -3
  72. package/docs/classes/SVGRenderInfo.html +2 -2
  73. package/docs/classes/SVGRenderer.html +10 -10
  74. package/docs/classes/ThreeSVGRendererPlugin.html +15 -14
  75. package/docs/classes/Viewmap.html +2 -2
  76. package/docs/classes/ViewmapBuildInfo.html +3 -3
  77. package/docs/hierarchy.html +1 -1
  78. package/docs/interfaces/FillPassOptions.html +5 -5
  79. package/docs/interfaces/SVGDrawOptions.html +2 -2
  80. package/docs/interfaces/SVGMeshOptions.html +2 -2
  81. package/docs/interfaces/SVGTexture.html +3 -3
  82. package/docs/interfaces/ViewmapOptions.html +2 -2
  83. package/package.json +14 -3
  84. package/src/three-svg-renderer/core/viewmap/operations/computePolygons.ts +2 -2
  85. package/tsconfig.json +46 -0
  86. package/docs/.nojekyll +0 -1
package/dist/index.mjs CHANGED
@@ -1,10 +1,3 @@
1
- /**
2
- * @license
3
- * @threepipe/plugin-svg-renderer v0.2.4
4
- * Copyright 2022-2025 repalash <palash@shaders.app>
5
- * GPLV3 License
6
- * See ./dependencies.txt for any bundled third-party dependencies and licenses.
7
- */
8
1
  import { Vector3, Vector4, Box3, Matrix4, Frustum, Vector2, Color as Color$1, Matrix3, DoubleSide, Box2, SRGBColorSpace, Camera, uiToggle, uiConfig, uiButton, uiFolderContainer, AViewerPluginSync, computeMorphedAttributes, Triangle, BufferAttribute, Plane, Line3 as Line3$1, Sphere, BackSide, FrontSide, Ray, Mesh, onChange, uiVector, timeout } from "threepipe";
9
2
  import { Vector3 as Vector3$1, Matrix4 as Matrix4$1, Vector2 as Vector2$1, Color as Color$2, Raycaster, DoubleSide as DoubleSide$1, Line3, PerspectiveCamera, Box2 as Box2$1, Triangle as Triangle$1, Mesh as Mesh$1 } from "threepipe";
10
3
  class RenderableObject {
@@ -96,13 +89,13 @@ class Projector {
96
89
  positionScreen.z *= invW;
97
90
  vertex.visible = positionScreen.x >= -1 && positionScreen.x <= 1 && positionScreen.y >= -1 && positionScreen.y <= 1 && positionScreen.z >= -1 && positionScreen.z <= 1;
98
91
  }
99
- function pushVertex(x2, y2, z) {
92
+ function pushVertex(x2, y2, z2) {
100
93
  _vertex = getNextVertexInPool();
101
- _vertex.position.set(x2, y2, z);
94
+ _vertex.position.set(x2, y2, z2);
102
95
  projectVertex(_vertex);
103
96
  }
104
- function pushNormal(x2, y2, z) {
105
- normals.push(x2, y2, z);
97
+ function pushNormal(x2, y2, z2) {
98
+ normals.push(x2, y2, z2);
106
99
  }
107
100
  function pushColor(r, g, b2) {
108
101
  colors.push(r, g, b2);
@@ -110,29 +103,29 @@ class Projector {
110
103
  function pushUv(x2, y2) {
111
104
  uvs.push(x2, y2);
112
105
  }
113
- function checkTriangleVisibility(v1, v2, v3) {
114
- if (v1.visible === true || v2.visible === true || v3.visible === true) return true;
106
+ function checkTriangleVisibility(v1, v22, v3) {
107
+ if (v1.visible === true || v22.visible === true || v3.visible === true) return true;
115
108
  _points3[0] = v1.positionScreen;
116
- _points3[1] = v2.positionScreen;
109
+ _points3[1] = v22.positionScreen;
117
110
  _points3[2] = v3.positionScreen;
118
111
  return _clipBox.intersectsBox(_boundingBox.setFromPoints(_points3));
119
112
  }
120
- function checkBackfaceCulling(v1, v2, v3) {
121
- return (v3.positionScreen.x - v1.positionScreen.x) * (v2.positionScreen.y - v1.positionScreen.y) - (v3.positionScreen.y - v1.positionScreen.y) * (v2.positionScreen.x - v1.positionScreen.x) < 0;
113
+ function checkBackfaceCulling(v1, v22, v3) {
114
+ return (v3.positionScreen.x - v1.positionScreen.x) * (v22.positionScreen.y - v1.positionScreen.y) - (v3.positionScreen.y - v1.positionScreen.y) * (v22.positionScreen.x - v1.positionScreen.x) < 0;
122
115
  }
123
116
  function pushLine(a, b2) {
124
117
  const v1 = _vertexPool[a];
125
- const v2 = _vertexPool[b2];
118
+ const v22 = _vertexPool[b2];
126
119
  v1.positionScreen.copy(v1.position).applyMatrix4(_modelViewProjectionMatrix);
127
- v2.positionScreen.copy(v2.position).applyMatrix4(_modelViewProjectionMatrix);
128
- if (clipLine(v1.positionScreen, v2.positionScreen) === true) {
120
+ v22.positionScreen.copy(v22.position).applyMatrix4(_modelViewProjectionMatrix);
121
+ if (clipLine(v1.positionScreen, v22.positionScreen) === true) {
129
122
  v1.positionScreen.multiplyScalar(1 / v1.positionScreen.w);
130
- v2.positionScreen.multiplyScalar(1 / v2.positionScreen.w);
123
+ v22.positionScreen.multiplyScalar(1 / v22.positionScreen.w);
131
124
  _line2 = getNextLineInPool();
132
125
  _line2.id = object.id;
133
126
  _line2.v1.copy(v1);
134
- _line2.v2.copy(v2);
135
- _line2.z = Math.max(v1.positionScreen.z, v2.positionScreen.z);
127
+ _line2.v2.copy(v22);
128
+ _line2.z = Math.max(v1.positionScreen.z, v22.positionScreen.z);
136
129
  _line2.renderOrder = object.renderOrder;
137
130
  _line2.material = object.material;
138
131
  if (object.material.vertexColors) {
@@ -142,21 +135,21 @@ class Projector {
142
135
  _renderData.elements.push(_line2);
143
136
  }
144
137
  }
145
- function pushTriangle(a, b2, c2, material) {
138
+ function pushTriangle(a, b2, c, material) {
146
139
  const v1 = _vertexPool[a];
147
- const v2 = _vertexPool[b2];
148
- const v3 = _vertexPool[c2];
149
- if (checkTriangleVisibility(v1, v2, v3) === false) return;
150
- if (material.side === DoubleSide || checkBackfaceCulling(v1, v2, v3) === true) {
140
+ const v22 = _vertexPool[b2];
141
+ const v3 = _vertexPool[c];
142
+ if (checkTriangleVisibility(v1, v22, v3) === false) return;
143
+ if (material.side === DoubleSide || checkBackfaceCulling(v1, v22, v3) === true) {
151
144
  _face = getNextFaceInPool();
152
145
  _face.id = object.id;
153
146
  _face.v1.copy(v1);
154
- _face.v2.copy(v2);
147
+ _face.v2.copy(v22);
155
148
  _face.v3.copy(v3);
156
- _face.z = (v1.positionScreen.z + v2.positionScreen.z + v3.positionScreen.z) / 3;
149
+ _face.z = (v1.positionScreen.z + v22.positionScreen.z + v3.positionScreen.z) / 3;
157
150
  _face.renderOrder = object.renderOrder;
158
- _vector3.subVectors(v3.position, v2.position);
159
- _vector4.subVectors(v1.position, v2.position);
151
+ _vector3.subVectors(v3.position, v22.position);
152
+ _vector4.subVectors(v1.position, v22.position);
160
153
  _vector3.cross(_vector4);
161
154
  _face.normalModel.copy(_vector3);
162
155
  _face.normalModel.applyMatrix3(normalMatrix).normalize();
@@ -203,7 +196,7 @@ class Projector {
203
196
  addObject(object);
204
197
  }
205
198
  const children = object.children;
206
- for (let i = 0, l = children.length; i < l; i++) {
199
+ for (let i = 0, l2 = children.length; i < l2; i++) {
207
200
  projectObject(children[i]);
208
201
  }
209
202
  }
@@ -248,10 +241,10 @@ class Projector {
248
241
  const groups = geometry.groups;
249
242
  if (attributes.position === void 0) continue;
250
243
  const positions = attributes.position.array;
251
- for (let i = 0, l = positions.length; i < l; i += 3) {
244
+ for (let i = 0, l2 = positions.length; i < l2; i += 3) {
252
245
  let x2 = positions[i];
253
246
  let y2 = positions[i + 1];
254
- let z = positions[i + 2];
247
+ let z2 = positions[i + 2];
255
248
  const morphTargets = geometry.morphAttributes.position;
256
249
  if (morphTargets !== void 0) {
257
250
  const morphTargetsRelative = geometry.morphTargetsRelative;
@@ -263,31 +256,31 @@ class Projector {
263
256
  if (morphTargetsRelative) {
264
257
  x2 += target.getX(i / 3) * influence;
265
258
  y2 += target.getY(i / 3) * influence;
266
- z += target.getZ(i / 3) * influence;
259
+ z2 += target.getZ(i / 3) * influence;
267
260
  } else {
268
261
  x2 += (target.getX(i / 3) - positions[i]) * influence;
269
262
  y2 += (target.getY(i / 3) - positions[i + 1]) * influence;
270
- z += (target.getZ(i / 3) - positions[i + 2]) * influence;
263
+ z2 += (target.getZ(i / 3) - positions[i + 2]) * influence;
271
264
  }
272
265
  }
273
266
  }
274
- renderList.pushVertex(x2, y2, z);
267
+ renderList.pushVertex(x2, y2, z2);
275
268
  }
276
269
  if (attributes.normal !== void 0) {
277
270
  const normals = attributes.normal.array;
278
- for (let i = 0, l = normals.length; i < l; i += 3) {
271
+ for (let i = 0, l2 = normals.length; i < l2; i += 3) {
279
272
  renderList.pushNormal(normals[i], normals[i + 1], normals[i + 2]);
280
273
  }
281
274
  }
282
275
  if (attributes.color !== void 0) {
283
276
  const colors = attributes.color.array;
284
- for (let i = 0, l = colors.length; i < l; i += 3) {
277
+ for (let i = 0, l2 = colors.length; i < l2; i += 3) {
285
278
  renderList.pushColor(colors[i], colors[i + 1], colors[i + 2]);
286
279
  }
287
280
  }
288
281
  if (attributes.uv !== void 0) {
289
282
  const uvs = attributes.uv.array;
290
- for (let i = 0, l = uvs.length; i < l; i += 2) {
283
+ for (let i = 0, l2 = uvs.length; i < l2; i += 2) {
291
284
  renderList.pushUv(uvs[i], uvs[i + 1]);
292
285
  }
293
286
  }
@@ -298,12 +291,12 @@ class Projector {
298
291
  const group = groups[g];
299
292
  material = isMultiMaterial === true ? object.material[group.materialIndex] : object.material;
300
293
  if (material === void 0) continue;
301
- for (let i = group.start, l = group.start + group.count; i < l; i += 3) {
294
+ for (let i = group.start, l2 = group.start + group.count; i < l2; i += 3) {
302
295
  renderList.pushTriangle(indices[i], indices[i + 1], indices[i + 2], material);
303
296
  }
304
297
  }
305
298
  } else {
306
- for (let i = 0, l = indices.length; i < l; i += 3) {
299
+ for (let i = 0, l2 = indices.length; i < l2; i += 3) {
307
300
  renderList.pushTriangle(indices[i], indices[i + 1], indices[i + 2], material);
308
301
  }
309
302
  }
@@ -313,12 +306,12 @@ class Projector {
313
306
  const group = groups[g];
314
307
  material = isMultiMaterial === true ? object.material[group.materialIndex] : object.material;
315
308
  if (material === void 0) continue;
316
- for (let i = group.start, l = group.start + group.count; i < l; i += 3) {
309
+ for (let i = group.start, l2 = group.start + group.count; i < l2; i += 3) {
317
310
  renderList.pushTriangle(i, i + 1, i + 2, material);
318
311
  }
319
312
  }
320
313
  } else {
321
- for (let i = 0, l = positions.length / 3; i < l; i += 3) {
314
+ for (let i = 0, l2 = positions.length / 3; i < l2; i += 3) {
322
315
  renderList.pushTriangle(i, i + 1, i + 2, material);
323
316
  }
324
317
  }
@@ -328,23 +321,23 @@ class Projector {
328
321
  const attributes = geometry.attributes;
329
322
  if (attributes.position !== void 0) {
330
323
  const positions = attributes.position.array;
331
- for (let i = 0, l = positions.length; i < l; i += 3) {
324
+ for (let i = 0, l2 = positions.length; i < l2; i += 3) {
332
325
  renderList.pushVertex(positions[i], positions[i + 1], positions[i + 2]);
333
326
  }
334
327
  if (attributes.color !== void 0) {
335
328
  const colors = attributes.color.array;
336
- for (let i = 0, l = colors.length; i < l; i += 3) {
329
+ for (let i = 0, l2 = colors.length; i < l2; i += 3) {
337
330
  renderList.pushColor(colors[i], colors[i + 1], colors[i + 2]);
338
331
  }
339
332
  }
340
333
  if (geometry.index !== null) {
341
334
  const indices = geometry.index.array;
342
- for (let i = 0, l = indices.length; i < l; i += 2) {
335
+ for (let i = 0, l2 = indices.length; i < l2; i += 2) {
343
336
  renderList.pushLine(indices[i], indices[i + 1]);
344
337
  }
345
338
  } else {
346
339
  const step = object.isLineSegments ? 2 : 1;
347
- for (let i = 0, l = positions.length / 3 - 1; i < l; i += step) {
340
+ for (let i = 0, l2 = positions.length / 3 - 1; i < l2; i += step) {
348
341
  renderList.pushLine(i, i + 1);
349
342
  }
350
343
  }
@@ -354,7 +347,7 @@ class Projector {
354
347
  const attributes = geometry.attributes;
355
348
  if (attributes.position !== void 0) {
356
349
  const positions = attributes.position.array;
357
- for (let i = 0, l = positions.length; i < l; i += 3) {
350
+ for (let i = 0, l2 = positions.length; i < l2; i += 3) {
358
351
  _vector4.set(positions[i], positions[i + 1], positions[i + 2], 1);
359
352
  _vector4.applyMatrix4(_modelViewProjectionMatrix);
360
353
  pushPoint(_vector4, object, camera);
@@ -537,8 +530,8 @@ let SVGRenderer$1 = class SVGRenderer {
537
530
  _svg.removeChild(_svg.childNodes[0]);
538
531
  }
539
532
  }
540
- function convert(c2) {
541
- return _precision !== null ? c2.toFixed(_precision) : c2;
533
+ function convert(c) {
534
+ return _precision !== null ? c.toFixed(_precision) : c;
542
535
  }
543
536
  this.clear = function() {
544
537
  removeChildNodes();
@@ -634,8 +627,8 @@ let SVGRenderer$1 = class SVGRenderer {
634
627
  _ambientLight.setRGB(0, 0, 0);
635
628
  _directionalLights.setRGB(0, 0, 0);
636
629
  _pointLights.setRGB(0, 0, 0);
637
- for (let l = 0, ll = lights.length; l < ll; l++) {
638
- const light = lights[l];
630
+ for (let l2 = 0, ll = lights.length; l2 < ll; l2++) {
631
+ const light = lights[l2];
639
632
  const lightColor = light.color;
640
633
  if (light.isAmbientLight) {
641
634
  _ambientLight.r += lightColor.r;
@@ -653,8 +646,8 @@ let SVGRenderer$1 = class SVGRenderer {
653
646
  }
654
647
  }
655
648
  function calculateLight(lights, position2, normal, color) {
656
- for (let l = 0, ll = lights.length; l < ll; l++) {
657
- const light = lights[l];
649
+ for (let l2 = 0, ll = lights.length; l2 < ll; l2++) {
650
+ const light = lights[l2];
658
651
  const lightColor = light.color;
659
652
  if (light.isDirectionalLight) {
660
653
  const lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld).sub(_normal2.setFromMatrixPosition(light.target.matrixWorld)).normalize();
@@ -691,8 +684,8 @@ let SVGRenderer$1 = class SVGRenderer {
691
684
  }
692
685
  addPath(style, path);
693
686
  }
694
- function renderLine(v1, v2, material) {
695
- const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v2.positionScreen.x) + "," + convert(v2.positionScreen.y);
687
+ function renderLine(v1, v22, material) {
688
+ const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v22.positionScreen.x) + "," + convert(v22.positionScreen.y);
696
689
  if (material.isLineBasicMaterial) {
697
690
  let style = "fill:none;stroke:" + material.color.getStyle(_this.outputColorSpace) + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.linewidth + ";stroke-linecap:" + material.linecap;
698
691
  if (material.isLineDashedMaterial) {
@@ -701,10 +694,10 @@ let SVGRenderer$1 = class SVGRenderer {
701
694
  addPath(style, path);
702
695
  }
703
696
  }
704
- function renderFace3(v1, v2, v3, element, material) {
697
+ function renderFace3(v1, v22, v3, element, material) {
705
698
  _this.info.render.vertices += 3;
706
699
  _this.info.render.faces++;
707
- const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v2.positionScreen.x) + "," + convert(v2.positionScreen.y) + "L" + convert(v3.positionScreen.x) + "," + convert(v3.positionScreen.y) + "z";
700
+ const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v22.positionScreen.x) + "," + convert(v22.positionScreen.y) + "L" + convert(v3.positionScreen.x) + "," + convert(v3.positionScreen.y) + "z";
708
701
  let style = "";
709
702
  if (material.isMeshBasicMaterial) {
710
703
  _color2.copy(material.color);
@@ -717,7 +710,7 @@ let SVGRenderer$1 = class SVGRenderer {
717
710
  _diffuseColor.multiply(element.color);
718
711
  }
719
712
  _color2.copy(_ambientLight);
720
- _centroid.copy(v1.positionWorld).add(v2.positionWorld).add(v3.positionWorld).divideScalar(3);
713
+ _centroid.copy(v1.positionWorld).add(v22.positionWorld).add(v3.positionWorld).divideScalar(3);
721
714
  calculateLight(_lights, _centroid, element.normalModel, _color2);
722
715
  _color2.multiply(_diffuseColor).add(material.emissive);
723
716
  } else if (material.isMeshNormalMaterial) {
@@ -731,15 +724,15 @@ let SVGRenderer$1 = class SVGRenderer {
731
724
  }
732
725
  addPath(style, path);
733
726
  }
734
- function expand(v1, v2, pixels) {
735
- let x2 = v2.x - v1.x, y2 = v2.y - v1.y;
727
+ function expand(v1, v22, pixels) {
728
+ let x2 = v22.x - v1.x, y2 = v22.y - v1.y;
736
729
  const det = x2 * x2 + y2 * y2;
737
730
  if (det === 0) return;
738
731
  const idet = pixels / Math.sqrt(det);
739
732
  x2 *= idet;
740
733
  y2 *= idet;
741
- v2.x += x2;
742
- v2.y += y2;
734
+ v22.x += x2;
735
+ v22.y += y2;
743
736
  v1.x -= x2;
744
737
  v1.y -= y2;
745
738
  }
@@ -774,16 +767,6 @@ let SVGRenderer$1 = class SVGRenderer {
774
767
  }
775
768
  }
776
769
  };
777
- /**
778
- * @license
779
- * ts-browser-helpers v0.19.4
780
- * Copyright 2022-2025 repalash <palash@shaders.app>
781
- * MIT License
782
- * See ./dependencies.txt for bundled third-party dependencies and licenses.
783
- */
784
- function Fe(t, ...e) {
785
- return t;
786
- }
787
770
  function L(t, e) {
788
771
  return Object.hasOwn ? Object.hasOwn(t, e) : t.hasOwnProperty(e);
789
772
  }
@@ -797,8 +780,8 @@ const k = class k2 {
797
780
  let o = i;
798
781
  for (; o; ) {
799
782
  const s = Object.values(Object.getOwnPropertyDescriptors(o));
800
- for (let a of s)
801
- if (a.value === e)
783
+ for (let c of s)
784
+ if (c.value === e)
802
785
  return r.set(e, true), e.call(i, ...n);
803
786
  o = Object.getPrototypeOf(o);
804
787
  }
@@ -817,12 +800,12 @@ function I(t, e = "param") {
817
800
  return this[`_oc_${n}`];
818
801
  },
819
802
  set(s) {
820
- var u;
821
- const a = this[`_oc_${n}`];
822
- if (a === s) return;
803
+ var l2;
804
+ const c = this[`_oc_${n}`];
805
+ if (c === s) return;
823
806
  this[`_oc_${n}`] = s;
824
- const c2 = e === "param" ? [n, s, a, this] : e === "object" ? [{ key: n, value: s, oldValue: a, target: this }] : [];
825
- typeof t == "string" ? (u = this[t]) == null || u.call(this, ...c2) : typeof t == "function" && U$1.callFunction(t, this, c2);
807
+ const a = e === "param" ? [n, s, c, this] : e === "object" ? [{ key: n, value: s, oldValue: c, target: this }] : [];
808
+ typeof t == "string" ? (l2 = this[t]) == null || l2.call(this, ...a) : typeof t == "function" && U$1.callFunction(t, this, a);
826
809
  }
827
810
  };
828
811
  if (r)
@@ -834,40 +817,34 @@ function Ke(t, e = "void") {
834
817
  if (!t) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
835
818
  return I(t, e);
836
819
  }
837
- function xt() {
820
+ function bt() {
838
821
  const t = (n, r) => n.toString(16).padStart(r, "0"), e = crypto.getRandomValues(new Uint8Array(16));
839
822
  e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
840
823
  const i = new DataView(e.buffer);
841
824
  return `${t(i.getUint32(0), 8)}-${t(i.getUint16(4), 4)}-${t(i.getUint16(6), 4)}-${t(i.getUint16(8), 4)}-${t(i.getUint32(10), 8)}${t(i.getUint16(14), 4)}`;
842
825
  }
843
- /**
844
- * @license
845
- * uiconfig.js v0.3.1
846
- * Copyright 2022-2025 repalash <palash@shaders.app>
847
- * MIT License
848
- * See ./dependencies.txt for bundled third-party dependencies and licenses.
849
- */
850
- const C = class C2 {
826
+ const v = class v2 {
851
827
  };
852
- C.Map = /* @__PURE__ */ new Map();
853
- let c = C;
854
- function v(n, e, t, r, i = true) {
855
- r = r ?? n[e], t = t ?? e + "";
856
- const o = r == null ? void 0 : r.uiConfig;
857
- let s;
828
+ v.Map = /* @__PURE__ */ new WeakMap();
829
+ let p = v;
830
+ function b(n, e, t, r, s = true) {
831
+ r = r !== void 0 ? r : n[e], t = t ?? e + "";
832
+ const o = r?.uiConfig;
833
+ let i;
858
834
  if (o)
859
- s = o;
835
+ i = o;
860
836
  else {
861
- const a = T(r);
862
- a === "folder" ? s = U(t, r, {}, "folder", i) : a && (s = {
863
- type: a,
837
+ const u = T(r);
838
+ u === "folder" ? i = E(t, r, {}, "folder", s, e + "") : u && (i = {
839
+ type: u,
864
840
  label: t,
865
- property: [n, e]
841
+ property: [n, e],
842
+ propertyKey: e + ""
866
843
  });
867
844
  }
868
- return s && !s.label && (s.label = t), s;
845
+ return i && !i.label && (i.label = t), i;
869
846
  }
870
- function _(n) {
847
+ function V(n) {
871
848
  if (!n) return [];
872
849
  let e = n.constructor || Object;
873
850
  e === Array && (e = Object);
@@ -875,62 +852,62 @@ function _(n) {
875
852
  for (; e && e !== Object; )
876
853
  r.push(e), e = Object.getPrototypeOf(e);
877
854
  if (!r.length || Array.isArray(n)) {
878
- const i = typeof n == "object" ? Object.keys(n) : Array.isArray(n) ? n.map((o, s) => s) : [];
879
- for (const o of i) {
880
- const s = n[o];
881
- if (s == null) continue;
882
- const a = v(n, o, o + "", s, true);
883
- a && t.push(a);
884
- }
885
- }
886
- return r.reverse().forEach((i) => {
887
- var o;
888
- (o = c.Map.get(i)) == null || o.forEach(({ params: s, propKey: a, uiType: u }) => {
889
- let d;
890
- if (u || (d = () => v(n, a)), d || (d = {
891
- property: [n, a],
855
+ const s = typeof n == "object" ? Object.keys(n) : Array.isArray(n) ? n.map((o, i) => i) : [];
856
+ for (const o of s) {
857
+ const i = n[o];
858
+ if (i == null) continue;
859
+ const u = b(n, o, o + "", i, true);
860
+ u && t.push(u);
861
+ }
862
+ }
863
+ return r.reverse().forEach((s) => {
864
+ p.Map.get(s)?.forEach(({ params: o, propKey: i, uiType: u }) => {
865
+ let a;
866
+ if (u || (a = () => b(n, i)), a || (a = {
867
+ property: [n, i],
892
868
  type: u || "input"
893
869
  // ...params,
894
870
  // ...extraParams,
895
- }), s) {
896
- const y2 = typeof s.params == "function" ? s.params(n) : s.params || {}, p = { ...s };
897
- if (delete p.params, typeof d == "function") {
898
- const m = d;
899
- d = () => {
900
- const l = m();
901
- return l && Object.assign(l, { ...p, ...y2 });
871
+ }), o) {
872
+ const d = typeof o.params == "function" ? o.params(n) : o.params || {}, c = { ...o };
873
+ if (delete c.params, typeof a == "function") {
874
+ const y2 = a;
875
+ a = () => {
876
+ const m = y2();
877
+ return m && Object.assign(m, { ...c, ...d });
902
878
  };
903
879
  } else
904
- Object.assign(d, { ...p, ...y2 });
880
+ Object.assign(a, { ...c, ...d });
905
881
  }
906
- t.push(d);
882
+ t.push(a);
907
883
  });
908
884
  }), t;
909
885
  }
910
- function U(n, e, t = {}, r = "folder", i = false) {
886
+ function E(n, e, t = {}, r = "folder", s = false, o) {
911
887
  return {
912
888
  type: r,
913
889
  label: n,
914
- children: i ? [() => _(e)] : _(e),
915
- uuid: xt(),
890
+ children: s ? [() => V(e)] : V(e),
891
+ uuid: bt(),
892
+ propertyKey: o,
916
893
  ...t
917
894
  };
918
895
  }
919
896
  function T(n) {
920
897
  return n == null ? null : Array.isArray(n) ? "folder" : typeof n == "boolean" ? "checkbox" : typeof n == "number" ? "number" : typeof n == "string" ? "input" : typeof n == "function" ? "button" : typeof n.x == "number" ? "vec" : typeof n.r == "number" ? "color" : n.isTexture ? "image" : typeof n == "object" ? "folder" : null;
921
898
  }
922
- function B(n) {
899
+ function Q(n) {
923
900
  return (e, t) => {
924
901
  const r = e.constructor;
925
902
  if (r === Object) throw new Error("Not possible to use uiConfig decorator on an object, use class instead");
926
- c.Map.has(r) || c.Map.set(r, []), n(e, t, c.Map.get(r));
903
+ p.Map.has(r) || p.Map.set(r, []), n(e, t, p.Map.get(r));
927
904
  };
928
905
  }
929
- function h(n, e) {
930
- return B((t, r, i) => {
931
- const o = i.findIndex((s) => s.propKey === r);
906
+ function l(n, e) {
907
+ return Q((t, r, s) => {
908
+ const o = s.findIndex((i) => i.propKey === r);
932
909
  if (o && o < 0)
933
- i.push({
910
+ s.push({
934
911
  params: e || {},
935
912
  propKey: r,
936
913
  uiType: n
@@ -939,24 +916,24 @@ function h(n, e) {
939
916
  throw new Error(`Property ${r} already has a uiConfig decorator`);
940
917
  });
941
918
  }
942
- function b(n, e, t = "panel") {
919
+ function U(n, e, t = "panel") {
943
920
  return (r) => class extends r {
944
921
  constructor() {
945
- super(...arguments), this.uiConfig = U(Fe(n, this) || "", this, {}, t);
922
+ super(...arguments), this.uiConfig = E(n, this, {}, t);
946
923
  }
947
924
  };
948
925
  }
949
- function N(n, e, t) {
950
- return Array.isArray(e) && typeof e[0] == "string" && (e = e.map((r) => ({ label: r, value: r }))), h("dropdown", { label: n, children: e, params: t });
926
+ function W(n, e, t) {
927
+ return Array.isArray(e) && typeof e[0] == "string" && (e = e.map((r) => ({ label: r, value: r }))), l("dropdown", { label: n, children: e, params: t });
951
928
  }
952
- function H(n, e) {
953
- return h("number", { label: n, params: e });
929
+ function z(n, e) {
930
+ return l("number", { label: n, params: e });
954
931
  }
955
- function G$1(n, e) {
956
- return h("checkbox", { label: n, params: e });
932
+ function K(n, e) {
933
+ return l("checkbox", { label: n, params: e });
957
934
  }
958
935
  function X(n, e) {
959
- return b(n, e, "folder");
936
+ return U(n, e, "folder");
960
937
  }
961
938
  var __defProp$2 = Object.defineProperty;
962
939
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
@@ -978,19 +955,19 @@ let BasicSVGRenderer = class extends SVGRenderer$1 {
978
955
  }
979
956
  };
980
957
  __decorateClass$2([
981
- G$1()
958
+ K()
982
959
  ], BasicSVGRenderer.prototype, "autoClear", 2);
983
960
  __decorateClass$2([
984
- G$1()
961
+ K()
985
962
  ], BasicSVGRenderer.prototype, "sortObjects", 2);
986
963
  __decorateClass$2([
987
- G$1()
964
+ K()
988
965
  ], BasicSVGRenderer.prototype, "sortElements", 2);
989
966
  __decorateClass$2([
990
- H()
967
+ z()
991
968
  ], BasicSVGRenderer.prototype, "overdraw", 2);
992
969
  __decorateClass$2([
993
- N(void 0, ["low", "high"]),
970
+ W(void 0, ["low", "high"]),
994
971
  Ke(BasicSVGRenderer.prototype._refresh)
995
972
  ], BasicSVGRenderer.prototype, "quality", 2);
996
973
  BasicSVGRenderer = __decorateClass$2([
@@ -1019,7 +996,7 @@ let BasicSVGRendererPlugin = class extends AViewerPluginSync {
1019
996
  this._lastStyles = void 0;
1020
997
  this.autoRender = true;
1021
998
  this._viewerListeners = {
1022
- postRender: (_2) => {
999
+ postRender: (_) => {
1023
1000
  if (this.autoRender) this.render();
1024
1001
  }
1025
1002
  };
@@ -1029,7 +1006,6 @@ let BasicSVGRendererPlugin = class extends AViewerPluginSync {
1029
1006
  this.renderer.domElement.style.display = "none";
1030
1007
  }
1031
1008
  onAdded(viewer) {
1032
- var _a;
1033
1009
  super.onAdded(viewer);
1034
1010
  this.renderer.setSize(viewer.canvas.clientWidth, viewer.canvas.clientHeight);
1035
1011
  this._refreshParams();
@@ -1045,7 +1021,7 @@ let BasicSVGRendererPlugin = class extends AViewerPluginSync {
1045
1021
  element.style.width = canvasStyles.width;
1046
1022
  element.style.height = canvasStyles.height;
1047
1023
  } else {
1048
- (_a = this._viewer) == null ? void 0 : _a.console.warn("BasicSVGRendererPlugin: canvas position should be absolute for proper rendering");
1024
+ this._viewer?.console.warn("BasicSVGRendererPlugin: canvas position should be absolute for proper rendering");
1049
1025
  }
1050
1026
  viewer.renderManager.addEventListener("resize", this._onResize);
1051
1027
  }
@@ -1069,10 +1045,9 @@ let BasicSVGRendererPlugin = class extends AViewerPluginSync {
1069
1045
  this.renderer.render(this._viewer.scene, this._viewer.scene.mainCamera);
1070
1046
  }
1071
1047
  download() {
1072
- var _a;
1073
1048
  const svg2 = this.renderer.domElement.outerHTML;
1074
1049
  const blob = new Blob([svg2], { type: "image/svg+xml" });
1075
- (_a = this._viewer) == null ? void 0 : _a.exportBlob(blob, "scene.svg");
1050
+ this._viewer?.exportBlob(blob, "scene.svg");
1076
1051
  }
1077
1052
  get svgNode() {
1078
1053
  return this.renderer.domElement;
@@ -1142,7 +1117,7 @@ class ViewEdge {
1142
1117
  }
1143
1118
  toJSON() {
1144
1119
  return {
1145
- id: [...this.a.vertices].map((v2) => v2.id).join(",") + "-" + [...this.b.vertices].map((v2) => v2.id).join(",")
1120
+ id: [...this.a.vertices].map((v3) => v3.id).join(",") + "-" + [...this.b.vertices].map((v3) => v3.id).join(",")
1146
1121
  };
1147
1122
  }
1148
1123
  clone() {
@@ -1268,7 +1243,7 @@ function vectors2Equal(a, b2, tolerance = 1e-10) {
1268
1243
  return Math.abs(a.x - b2.x) < tolerance && Math.abs(a.y - b2.y) < tolerance;
1269
1244
  }
1270
1245
  const _matrix$3 = new Matrix4$1();
1271
- function orient3D$2(a, b2, c2, d, epsilon = 1e-10) {
1246
+ function orient3D$2(a, b2, c, d, epsilon = 1e-10) {
1272
1247
  _matrix$3.set(
1273
1248
  a.x,
1274
1249
  a.y,
@@ -1278,9 +1253,9 @@ function orient3D$2(a, b2, c2, d, epsilon = 1e-10) {
1278
1253
  b2.y,
1279
1254
  b2.z,
1280
1255
  1,
1281
- c2.x,
1282
- c2.y,
1283
- c2.z,
1256
+ c.x,
1257
+ c.y,
1258
+ c.z,
1284
1259
  1,
1285
1260
  d.x,
1286
1261
  d.y,
@@ -1295,11 +1270,11 @@ function orient3D$2(a, b2, c2, d, epsilon = 1e-10) {
1295
1270
  }
1296
1271
  return 0;
1297
1272
  }
1298
- function frontSide$1(a, b2, c2, d, epsilon = 1e-10) {
1299
- return orient3D$2(d, b2, c2, a, epsilon) > 0;
1273
+ function frontSide$1(a, b2, c, d, epsilon = 1e-10) {
1274
+ return orient3D$2(d, b2, c, a, epsilon) > 0;
1300
1275
  }
1301
- function sameSide(a, b2, c2, d, e, epsilon = 1e-10) {
1302
- return orient3D$2(a, b2, c2, d, epsilon) > 0 === orient3D$2(a, b2, c2, e, epsilon) > 0;
1276
+ function sameSide(a, b2, c, d, e, epsilon = 1e-10) {
1277
+ return orient3D$2(a, b2, c, d, epsilon) > 0 === orient3D$2(a, b2, c, e, epsilon) > 0;
1303
1278
  }
1304
1279
  function round(num, divider = 100) {
1305
1280
  return Math.round(num * divider) / divider;
@@ -1411,7 +1386,7 @@ let Polygon$1 = class Polygon {
1411
1386
  };
1412
1387
  var Arrangement2D = (() => {
1413
1388
  var _scriptDir = import.meta.url;
1414
- return function(Arrangement2D2) {
1389
+ return (function(Arrangement2D2) {
1415
1390
  Arrangement2D2 = Arrangement2D2 || {};
1416
1391
  var Module = typeof Arrangement2D2 != "undefined" ? Arrangement2D2 : {};
1417
1392
  var readyPromiseResolve, readyPromiseReject;
@@ -2419,8 +2394,8 @@ var Arrangement2D = (() => {
2419
2394
  function createWasm() {
2420
2395
  var info = { "env": asmLibraryArg, "wasi_snapshot_preview1": asmLibraryArg };
2421
2396
  function receiveInstance(instance, module) {
2422
- var exports2 = instance.exports;
2423
- Module["asm"] = exports2;
2397
+ var exports$12 = instance.exports;
2398
+ Module["asm"] = exports$12;
2424
2399
  wasmMemory = Module["asm"]["memory"];
2425
2400
  assert(wasmMemory, "memory not found in wasm exports");
2426
2401
  updateGlobalBufferAndViews(wasmMemory.buffer);
@@ -2465,8 +2440,8 @@ var Arrangement2D = (() => {
2465
2440
  }
2466
2441
  if (Module["instantiateWasm"]) {
2467
2442
  try {
2468
- var exports = Module["instantiateWasm"](info, receiveInstance);
2469
- return exports;
2443
+ var exports$1 = Module["instantiateWasm"](info, receiveInstance);
2444
+ return exports$1;
2470
2445
  } catch (e) {
2471
2446
  err("Module.instantiateWasm callback failed with error: " + e);
2472
2447
  return false;
@@ -2963,7 +2938,7 @@ var Arrangement2D = (() => {
2963
2938
  bytes[i] = decoded.charCodeAt(i);
2964
2939
  }
2965
2940
  return bytes;
2966
- } catch (_2) {
2941
+ } catch (_) {
2967
2942
  throw new Error("Converting base64 string to bytes failed.");
2968
2943
  }
2969
2944
  }
@@ -3644,7 +3619,7 @@ var Arrangement2D = (() => {
3644
3619
  _emscripten_bind_ContourList___destroy___0(self2);
3645
3620
  };
3646
3621
  return Arrangement2D2.ready;
3647
- };
3622
+ });
3648
3623
  })();
3649
3624
  const Arr2DPromise = Arrangement2D();
3650
3625
  class PolygonsInfo {
@@ -3656,7 +3631,7 @@ class PolygonsInfo {
3656
3631
  async function computePolygons(viewmap, info = new PolygonsInfo()) {
3657
3632
  const { chains, polygons } = viewmap;
3658
3633
  const Arr2D = await Arr2DPromise;
3659
- const visibleChains = chains.filter((c2) => c2.visibility === ChainVisibility.Visible);
3634
+ const visibleChains = chains.filter((c) => c.visibility === ChainVisibility.Visible);
3660
3635
  const points = new Arr2D.PointList();
3661
3636
  let a, b2;
3662
3637
  for (const chain of visibleChains) {
@@ -3670,7 +3645,7 @@ async function computePolygons(viewmap, info = new PolygonsInfo()) {
3670
3645
  }
3671
3646
  const builder = new Arr2D.ArrangementBuilder();
3672
3647
  const arr2DPolygonlist = builder.getPolygons(points);
3673
- const p = new Arr2D.Point();
3648
+ const p2 = new Arr2D.Point();
3674
3649
  info.smallAreaIgnored = 0;
3675
3650
  info.insidePointErrors = 0;
3676
3651
  for (let i = 0; i < arr2DPolygonlist.size(); i++) {
@@ -3680,8 +3655,8 @@ async function computePolygons(viewmap, info = new PolygonsInfo()) {
3680
3655
  const contour = convertContour(arr2DPolygon.contour);
3681
3656
  const holes = convertContourList(arr2DPolygon.holes);
3682
3657
  const polygon = new Polygon$1(i, contour, holes);
3683
- if (arr2DPolygon.getInsidePoint(p)) {
3684
- polygon.insidePoint.set(p.x, p.y);
3658
+ if (arr2DPolygon.getInsidePoint(p2)) {
3659
+ polygon.insidePoint.set(p2.x, p2.y);
3685
3660
  polygons.push(polygon);
3686
3661
  } else {
3687
3662
  info.insidePointErrors += 1;
@@ -3692,7 +3667,7 @@ async function computePolygons(viewmap, info = new PolygonsInfo()) {
3692
3667
  Arr2D.destroy(arr2DPolygon);
3693
3668
  }
3694
3669
  Arr2D.destroy(arr2DPolygonlist);
3695
- Arr2D.destroy(p);
3670
+ Arr2D.destroy(p2);
3696
3671
  }
3697
3672
  function convertContourList(vector) {
3698
3673
  const array2 = new Array();
@@ -3704,8 +3679,8 @@ function convertContourList(vector) {
3704
3679
  function convertContour(contour) {
3705
3680
  const array2 = new Array();
3706
3681
  for (let i = 0; i < contour.size(); i++) {
3707
- const p = contour.at(i);
3708
- array2.push(new Vector2$1(p.x, p.y));
3682
+ const p2 = contour.at(i);
3683
+ array2.push(new Vector2$1(p2.x, p2.y));
3709
3684
  }
3710
3685
  return array2;
3711
3686
  }
@@ -3740,18 +3715,18 @@ function setupEdges(viewmap, options) {
3740
3715
  const meshv1 = halfedge.vertex;
3741
3716
  const meshv2 = halfedge.twin.vertex;
3742
3717
  const v1 = createViewVertex(viewmap, meshv1.position);
3743
- const v2 = createViewVertex(viewmap, meshv2.position);
3718
+ const v22 = createViewVertex(viewmap, meshv2.position);
3744
3719
  meshv1.viewVertex = v1;
3745
- meshv2.viewVertex = v2;
3720
+ meshv2.viewVertex = v22;
3746
3721
  v1.vertices.add(meshv1);
3747
- v2.vertices.add(meshv2);
3748
- const viewEdge = new ViewEdge(v1, v2, props.nature, halfedge);
3722
+ v22.vertices.add(meshv2);
3723
+ const viewEdge = new ViewEdge(v1, v22, props.nature, halfedge);
3749
3724
  viewEdge.faceAngle = props.faceAngle;
3750
3725
  viewEdge.isConcave = props.isConcave;
3751
3726
  viewEdge.isBack = props.isBack;
3752
3727
  viewEdge.meshes.push(mesh);
3753
3728
  v1.viewEdges.push(viewEdge);
3754
- v2.viewEdges.push(viewEdge);
3729
+ v22.viewEdges.push(viewEdge);
3755
3730
  if (halfedge.face) {
3756
3731
  halfedge.face.viewEdges.push(viewEdge);
3757
3732
  viewEdge.faces.push(halfedge.face);
@@ -3924,8 +3899,8 @@ function isTriDegenerated(tri) {
3924
3899
  _tmp1.cross(_tmp2);
3925
3900
  return _tmp1.x > -EPSILON$1 && _tmp1.x < EPSILON$1 && _tmp1.y > -EPSILON$1 && _tmp1.y < EPSILON$1 && _tmp1.z > -EPSILON$1 && _tmp1.z < EPSILON$1;
3926
3901
  }
3927
- function orient3D$1(a, b2, c2, d) {
3928
- _matrix4.set(a.x, a.y, a.z, 1, b2.x, b2.y, b2.z, 1, c2.x, c2.y, c2.z, 1, d.x, d.y, d.z, 1);
3902
+ function orient3D$1(a, b2, c, d) {
3903
+ _matrix4.set(a.x, a.y, a.z, 1, b2.x, b2.y, b2.z, 1, c.x, c.y, c.z, 1, d.x, d.y, d.z, 1);
3929
3904
  const det = _matrix4.determinant();
3930
3905
  if (det < -EPSILON$1)
3931
3906
  return -1;
@@ -3934,8 +3909,8 @@ function orient3D$1(a, b2, c2, d) {
3934
3909
  else
3935
3910
  return 0;
3936
3911
  }
3937
- function orient2D(a, b2, c2) {
3938
- _matrix3.set(a.x, a.y, 1, b2.x, b2.y, 1, c2.x, c2.y, 1);
3912
+ function orient2D(a, b2, c) {
3913
+ _matrix3.set(a.x, a.y, 1, b2.x, b2.y, 1, c.x, c.y, 1);
3939
3914
  const det = _matrix3.determinant();
3940
3915
  if (det < -EPSILON$1)
3941
3916
  return -1;
@@ -4022,9 +3997,9 @@ function makeTriAVertexPositive(tri, other) {
4022
3997
  other.b = tmp;
4023
3998
  }
4024
3999
  }
4025
- function intersectPlane(a, b2, p, n, target) {
4000
+ function intersectPlane(a, b2, p2, n, target) {
4026
4001
  _u$1$1.subVectors(b2, a);
4027
- _v$1$1.subVectors(a, p);
4002
+ _v$1$1.subVectors(a, p2);
4028
4003
  const dot1 = n.dot(_u$1$1);
4029
4004
  const dot2 = n.dot(_v$1$1);
4030
4005
  _u$1$1.multiplyScalar(-dot2 / dot1);
@@ -4125,8 +4100,8 @@ function coplanarIntersect(t1, t2, target) {
4125
4100
  if (intersecting && target) {
4126
4101
  clipTriangle(t1, t2, target);
4127
4102
  _matrix$2.invert();
4128
- for (const p of target) {
4129
- p.applyMatrix4(_matrix$2);
4103
+ for (const p3 of target) {
4104
+ p3.applyMatrix4(_matrix$2);
4130
4105
  }
4131
4106
  }
4132
4107
  return intersecting;
@@ -4347,8 +4322,8 @@ function splitViewEdge3d(viewmap, edge, position2) {
4347
4322
  _u$2.subVectors(position2, edge.a.pos3d);
4348
4323
  _v$1.subVectors(edge.b.pos3d, edge.a.pos3d);
4349
4324
  const cross = _u$2.cross(_v$1);
4350
- const v2 = cross.x + cross.y + cross.z;
4351
- if (v2 > 1e-10 || v2 < -1e-10) {
4325
+ const v3 = cross.x + cross.y + cross.z;
4326
+ if (v3 > 1e-10 || v3 < -1e-10) {
4352
4327
  return null;
4353
4328
  }
4354
4329
  if (_u$2.dot(_v$1) < -1e-10) {
@@ -4441,8 +4416,8 @@ function computeMeshIntersections(viewmap, info = new MeshIntersectionInfo()) {
4441
4416
  return;
4442
4417
  }
4443
4418
  const v1 = createViewVertex(viewmap, line.start);
4444
- const v2 = createViewVertex(viewmap, line.end);
4445
- const intersectionViewVertices = [v1, v2];
4419
+ const v22 = createViewVertex(viewmap, line.end);
4420
+ const intersectionViewVertices = [v1, v22];
4446
4421
  const faceViewEdges = /* @__PURE__ */ new Set([...faceA.viewEdges, ...faceB.viewEdges]);
4447
4422
  for (const e of faceViewEdges) {
4448
4423
  _line$1.set(e.a.pos3d, e.b.pos3d);
@@ -4464,12 +4439,12 @@ function computeMeshIntersections(viewmap, info = new MeshIntersectionInfo()) {
4464
4439
  });
4465
4440
  for (let i = 0; i < intersectionViewVertices.length - 1; i++) {
4466
4441
  const v12 = intersectionViewVertices[i];
4467
- const v22 = intersectionViewVertices[i + 1];
4468
- const viewEdge = new ViewEdge(v12, v22, ViewEdgeNature.MeshIntersection);
4442
+ const v222 = intersectionViewVertices[i + 1];
4443
+ const viewEdge = new ViewEdge(v12, v222, ViewEdgeNature.MeshIntersection);
4469
4444
  viewEdge.meshes.push(meshA, meshB);
4470
4445
  viewEdge.faces.push(faceA, faceB);
4471
4446
  v12.viewEdges.push(viewEdge);
4472
- v22.viewEdges.push(viewEdge);
4447
+ v222.viewEdges.push(viewEdge);
4473
4448
  faceA.viewEdges.push(viewEdge);
4474
4449
  faceB.viewEdges.push(viewEdge);
4475
4450
  viewmap.viewEdges.push(viewEdge);
@@ -4542,9 +4517,9 @@ function splay(i, t, comparator) {
4542
4517
  if (t === null) {
4543
4518
  return t;
4544
4519
  }
4545
- var l, r, y2;
4546
- var N2 = new Node();
4547
- l = r = N2;
4520
+ var l2, r, y2;
4521
+ var N = new Node();
4522
+ l2 = r = N;
4548
4523
  while (true) {
4549
4524
  var cmp = comparator(i, t.key);
4550
4525
  if (cmp < 0) {
@@ -4576,17 +4551,17 @@ function splay(i, t, comparator) {
4576
4551
  break;
4577
4552
  }
4578
4553
  }
4579
- l.right = t;
4580
- l = t;
4554
+ l2.right = t;
4555
+ l2 = t;
4581
4556
  t = t.right;
4582
4557
  } else {
4583
4558
  break;
4584
4559
  }
4585
4560
  }
4586
- l.right = t.left;
4561
+ l2.right = t.left;
4587
4562
  r.left = t.right;
4588
- t.left = N2.right;
4589
- t.right = N2.left;
4563
+ t.left = N.right;
4564
+ t.right = N.left;
4590
4565
  return t;
4591
4566
  }
4592
4567
  function insert(i, data2, t, comparator, tree) {
@@ -4653,24 +4628,24 @@ function remove(i, t, comparator, tree) {
4653
4628
  }
4654
4629
  return t;
4655
4630
  }
4656
- function split(key, v2, comparator) {
4631
+ function split(key, v3, comparator) {
4657
4632
  var left, right;
4658
- if (v2 === null) {
4633
+ if (v3 === null) {
4659
4634
  left = right = null;
4660
4635
  } else {
4661
- v2 = splay(key, v2, comparator);
4662
- var cmp = comparator(v2.key, key);
4636
+ v3 = splay(key, v3, comparator);
4637
+ var cmp = comparator(v3.key, key);
4663
4638
  if (cmp === 0) {
4664
- left = v2.left;
4665
- right = v2.right;
4639
+ left = v3.left;
4640
+ right = v3.right;
4666
4641
  } else if (cmp < 0) {
4667
- right = v2.right;
4668
- v2.right = null;
4669
- left = v2;
4642
+ right = v3.right;
4643
+ v3.right = null;
4644
+ left = v3;
4670
4645
  } else {
4671
- left = v2.left;
4672
- v2.left = null;
4673
- right = v2;
4646
+ left = v3.left;
4647
+ v3.left = null;
4648
+ right = v3;
4674
4649
  }
4675
4650
  }
4676
4651
  return { left, right };
@@ -4767,15 +4742,15 @@ Tree.prototype.contains = function contains(key) {
4767
4742
  };
4768
4743
  Tree.prototype.forEach = function forEach(visitor, ctx) {
4769
4744
  var current = this._root;
4770
- var Q = [];
4745
+ var Q2 = [];
4771
4746
  var done = false;
4772
4747
  while (!done) {
4773
4748
  if (current !== null) {
4774
- Q.push(current);
4749
+ Q2.push(current);
4775
4750
  current = current.left;
4776
4751
  } else {
4777
- if (Q.length !== 0) {
4778
- current = Q.pop();
4752
+ if (Q2.length !== 0) {
4753
+ current = Q2.pop();
4779
4754
  visitor.call(ctx, current);
4780
4755
  current = current.right;
4781
4756
  } else {
@@ -4787,15 +4762,15 @@ Tree.prototype.forEach = function forEach(visitor, ctx) {
4787
4762
  };
4788
4763
  Tree.prototype.range = function range(low, high, fn, ctx) {
4789
4764
  var this$1$1 = this;
4790
- var Q = [];
4765
+ var Q2 = [];
4791
4766
  var compare = this._comparator;
4792
4767
  var node = this._root, cmp;
4793
- while (Q.length !== 0 || node) {
4768
+ while (Q2.length !== 0 || node) {
4794
4769
  if (node) {
4795
- Q.push(node);
4770
+ Q2.push(node);
4796
4771
  node = node.left;
4797
4772
  } else {
4798
- node = Q.pop();
4773
+ node = Q2.pop();
4799
4774
  cmp = compare(node.key, high);
4800
4775
  if (cmp > 0) {
4801
4776
  break;
@@ -4857,14 +4832,14 @@ Tree.prototype.maxNode = function maxNode(t) {
4857
4832
  };
4858
4833
  Tree.prototype.at = function at(index) {
4859
4834
  var current = this._root, done = false, i = 0;
4860
- var Q = [];
4835
+ var Q2 = [];
4861
4836
  while (!done) {
4862
4837
  if (current) {
4863
- Q.push(current);
4838
+ Q2.push(current);
4864
4839
  current = current.left;
4865
4840
  } else {
4866
- if (Q.length > 0) {
4867
- current = Q.pop();
4841
+ if (Q2.length > 0) {
4842
+ current = Q2.pop();
4868
4843
  if (i === index) {
4869
4844
  return current;
4870
4845
  }
@@ -4963,8 +4938,8 @@ Tree.prototype.toString = function toString(printNode) {
4963
4938
  return n.key;
4964
4939
  };
4965
4940
  var out = [];
4966
- printRow(this._root, "", true, function(v2) {
4967
- return out.push(v2);
4941
+ printRow(this._root, "", true, function(v3) {
4942
+ return out.push(v3);
4968
4943
  }, printNode);
4969
4944
  return out.join("");
4970
4945
  };
@@ -5000,32 +4975,32 @@ function loadRecursive(parent, keys2, values2, start, end) {
5000
4975
  }
5001
4976
  function createList(keys2, values2) {
5002
4977
  var head = { next: null };
5003
- var p = head;
4978
+ var p2 = head;
5004
4979
  for (var i = 0; i < keys2.length; i++) {
5005
- p = p.next = { key: keys2[i], data: values2[i] };
4980
+ p2 = p2.next = { key: keys2[i], data: values2[i] };
5006
4981
  }
5007
- p.next = null;
4982
+ p2.next = null;
5008
4983
  return head.next;
5009
4984
  }
5010
4985
  function toList(root2) {
5011
4986
  var current = root2;
5012
- var Q = [], done = false;
4987
+ var Q2 = [], done = false;
5013
4988
  var head = { next: null };
5014
- var p = head;
4989
+ var p2 = head;
5015
4990
  while (!done) {
5016
4991
  if (current) {
5017
- Q.push(current);
4992
+ Q2.push(current);
5018
4993
  current = current.left;
5019
4994
  } else {
5020
- if (Q.length > 0) {
5021
- current = p = p.next = Q.pop();
4995
+ if (Q2.length > 0) {
4996
+ current = p2 = p2.next = Q2.pop();
5022
4997
  current = current.right;
5023
4998
  } else {
5024
4999
  done = true;
5025
5000
  }
5026
5001
  }
5027
5002
  }
5028
- p.next = null;
5003
+ p2.next = null;
5029
5004
  return head.next;
5030
5005
  }
5031
5006
  function sortedListToBST(list, start, end) {
@@ -5046,23 +5021,23 @@ function mergeLists(l1, l2, compare) {
5046
5021
  return a - b2;
5047
5022
  };
5048
5023
  var head = {};
5049
- var p = head;
5024
+ var p2 = head;
5050
5025
  var p1 = l1;
5051
- var p2 = l2;
5052
- while (p1 !== null && p2 !== null) {
5053
- if (compare(p1.key, p2.key) < 0) {
5054
- p.next = p1;
5026
+ var p22 = l2;
5027
+ while (p1 !== null && p22 !== null) {
5028
+ if (compare(p1.key, p22.key) < 0) {
5029
+ p2.next = p1;
5055
5030
  p1 = p1.next;
5056
5031
  } else {
5057
- p.next = p2;
5058
- p2 = p2.next;
5032
+ p2.next = p22;
5033
+ p22 = p22.next;
5059
5034
  }
5060
- p = p.next;
5035
+ p2 = p2.next;
5061
5036
  }
5062
5037
  if (p1 !== null) {
5063
- p.next = p1;
5064
- } else if (p2 !== null) {
5065
- p.next = p2;
5038
+ p2.next = p1;
5039
+ } else if (p22 !== null) {
5040
+ p2.next = p22;
5066
5041
  }
5067
5042
  return head.next;
5068
5043
  }
@@ -5332,7 +5307,7 @@ function swap(values2, boxes, indices, i, j) {
5332
5307
  var m = 4 * j;
5333
5308
  var a = boxes[k3];
5334
5309
  var b2 = boxes[k3 + 1];
5335
- var c2 = boxes[k3 + 2];
5310
+ var c = boxes[k3 + 2];
5336
5311
  var d = boxes[k3 + 3];
5337
5312
  boxes[k3] = boxes[m];
5338
5313
  boxes[k3 + 1] = boxes[m + 1];
@@ -5340,7 +5315,7 @@ function swap(values2, boxes, indices, i, j) {
5340
5315
  boxes[k3 + 3] = boxes[m + 3];
5341
5316
  boxes[m] = a;
5342
5317
  boxes[m + 1] = b2;
5343
- boxes[m + 2] = c2;
5318
+ boxes[m + 2] = c;
5344
5319
  boxes[m + 3] = d;
5345
5320
  var e = indices[i];
5346
5321
  indices[i] = indices[j];
@@ -5349,35 +5324,35 @@ function swap(values2, boxes, indices, i, j) {
5349
5324
  function hilbert(x2, y2) {
5350
5325
  var a = x2 ^ y2;
5351
5326
  var b2 = 65535 ^ a;
5352
- var c2 = 65535 ^ (x2 | y2);
5327
+ var c = 65535 ^ (x2 | y2);
5353
5328
  var d = x2 & (y2 ^ 65535);
5354
5329
  var A2 = a | b2 >> 1;
5355
- var B2 = a >> 1 ^ a;
5356
- var C3 = c2 >> 1 ^ b2 & d >> 1 ^ c2;
5357
- var D = a & c2 >> 1 ^ d >> 1 ^ d;
5330
+ var B = a >> 1 ^ a;
5331
+ var C = c >> 1 ^ b2 & d >> 1 ^ c;
5332
+ var D = a & c >> 1 ^ d >> 1 ^ d;
5358
5333
  a = A2;
5359
- b2 = B2;
5360
- c2 = C3;
5334
+ b2 = B;
5335
+ c = C;
5361
5336
  d = D;
5362
5337
  A2 = a & a >> 2 ^ b2 & b2 >> 2;
5363
- B2 = a & b2 >> 2 ^ b2 & (a ^ b2) >> 2;
5364
- C3 ^= a & c2 >> 2 ^ b2 & d >> 2;
5365
- D ^= b2 & c2 >> 2 ^ (a ^ b2) & d >> 2;
5338
+ B = a & b2 >> 2 ^ b2 & (a ^ b2) >> 2;
5339
+ C ^= a & c >> 2 ^ b2 & d >> 2;
5340
+ D ^= b2 & c >> 2 ^ (a ^ b2) & d >> 2;
5366
5341
  a = A2;
5367
- b2 = B2;
5368
- c2 = C3;
5342
+ b2 = B;
5343
+ c = C;
5369
5344
  d = D;
5370
5345
  A2 = a & a >> 4 ^ b2 & b2 >> 4;
5371
- B2 = a & b2 >> 4 ^ b2 & (a ^ b2) >> 4;
5372
- C3 ^= a & c2 >> 4 ^ b2 & d >> 4;
5373
- D ^= b2 & c2 >> 4 ^ (a ^ b2) & d >> 4;
5346
+ B = a & b2 >> 4 ^ b2 & (a ^ b2) >> 4;
5347
+ C ^= a & c >> 4 ^ b2 & d >> 4;
5348
+ D ^= b2 & c >> 4 ^ (a ^ b2) & d >> 4;
5374
5349
  a = A2;
5375
- b2 = B2;
5376
- c2 = C3;
5350
+ b2 = B;
5351
+ c = C;
5377
5352
  d = D;
5378
- C3 ^= a & c2 >> 8 ^ b2 & d >> 8;
5379
- D ^= b2 & c2 >> 8 ^ (a ^ b2) & d >> 8;
5380
- a = C3 ^ C3 >> 1;
5353
+ C ^= a & c >> 8 ^ b2 & d >> 8;
5354
+ D ^= b2 & c >> 8 ^ (a ^ b2) & d >> 8;
5355
+ a = C ^ C >> 1;
5381
5356
  b2 = D ^ D >> 1;
5382
5357
  var i0 = x2 ^ y2;
5383
5358
  var i1 = b2 | 65535 ^ (i0 | a);
@@ -5471,9 +5446,9 @@ function bush(lines, options) {
5471
5446
  }
5472
5447
  index.add(minX, minY, maxX, maxY);
5473
5448
  }
5474
- function defaultIntersectionReporter(p, interior) {
5449
+ function defaultIntersectionReporter(p2, interior) {
5475
5450
  results.push({
5476
- point: p,
5451
+ point: p2,
5477
5452
  segments: interior
5478
5453
  });
5479
5454
  }
@@ -5514,20 +5489,20 @@ function find2dSingularities(viewmap) {
5514
5489
  }
5515
5490
  if (splitViewVertices.length === 0) ;
5516
5491
  else if (splitViewVertices.length === 1) {
5517
- const v2 = splitViewVertices[0];
5518
- v2.singularity = ViewVertexSingularity.ImageIntersection;
5492
+ const v3 = splitViewVertices[0];
5493
+ v3.singularity = ViewVertexSingularity.ImageIntersection;
5519
5494
  } else {
5520
5495
  const v1 = splitViewVertices[0];
5521
- const v2 = splitViewVertices[1];
5496
+ const v22 = splitViewVertices[1];
5522
5497
  const d1 = v1.pos3d.distanceTo(viewmap.camera.position);
5523
- const d2 = v2.pos3d.distanceTo(viewmap.camera.position);
5498
+ const d2 = v22.pos3d.distanceTo(viewmap.camera.position);
5524
5499
  if (d1 > d2 + 1e-10) {
5525
5500
  v1.singularity = ViewVertexSingularity.ImageIntersection;
5526
5501
  } else if (d2 > d1 + 1e-10) {
5527
- v2.singularity = ViewVertexSingularity.ImageIntersection;
5502
+ v22.singularity = ViewVertexSingularity.ImageIntersection;
5528
5503
  } else {
5529
5504
  v1.singularity = ViewVertexSingularity.ImageIntersection;
5530
- v2.singularity = ViewVertexSingularity.ImageIntersection;
5505
+ v22.singularity = ViewVertexSingularity.ImageIntersection;
5531
5506
  }
5532
5507
  }
5533
5508
  }
@@ -5545,8 +5520,8 @@ function singularityForPoint(viewVertex, camera) {
5545
5520
  for (const edge of viewVertex.viewEdges) {
5546
5521
  natures.add(edge.nature);
5547
5522
  if (edge.faces.length > 1 && edge.nature === ViewEdgeNature.Silhouette) {
5548
- concaveSilhouetteEdgeFound || (concaveSilhouetteEdgeFound = edge.isConcave);
5549
- convexSilhouetteEdgeFound || (convexSilhouetteEdgeFound = !edge.isConcave);
5523
+ concaveSilhouetteEdgeFound ||= edge.isConcave;
5524
+ convexSilhouetteEdgeFound ||= !edge.isConcave;
5550
5525
  }
5551
5526
  }
5552
5527
  if (natures.size === 0) {
@@ -5597,8 +5572,8 @@ function isAnyFaceOverlappingBoundary(viewVertex, camera) {
5597
5572
  }
5598
5573
  }
5599
5574
  if (farthestHalfedge && otherVertex) {
5600
- const c2 = camera.position;
5601
- const p = vertex.position;
5575
+ const c = camera.position;
5576
+ const p2 = vertex.position;
5602
5577
  const e = otherVertex.position;
5603
5578
  const boundaryFace = farthestHalfedge.twin.face;
5604
5579
  if (boundaryFace) {
@@ -5606,7 +5581,7 @@ function isAnyFaceOverlappingBoundary(viewVertex, camera) {
5606
5581
  if (halfedge.face !== boundaryFace) {
5607
5582
  const q = halfedge.next.vertex.position;
5608
5583
  const r = halfedge.next.vertex.position;
5609
- if (!sameSide(p, q, r, c2, e) && sameSide(c2, p, q, e, r) && sameSide(c2, p, r, e, q)) {
5584
+ if (!sameSide(p2, q, r, c, e) && sameSide(c, p2, q, e, r) && sameSide(c, p2, r, e, q)) {
5610
5585
  return true;
5611
5586
  }
5612
5587
  }
@@ -5706,7 +5681,7 @@ class Viewmap {
5706
5681
  };
5707
5682
  if (this.skipActions) res();
5708
5683
  else {
5709
- actions[idx].process().catch((_2) => {
5684
+ actions[idx].process().catch((_) => {
5710
5685
  }).then(res);
5711
5686
  }
5712
5687
  } else {
@@ -5841,10 +5816,10 @@ class Viewmap {
5841
5816
  return actions;
5842
5817
  }
5843
5818
  visibleChains() {
5844
- return this.chains.filter((c2) => c2.visibility === ChainVisibility.Visible);
5819
+ return this.chains.filter((c) => c.visibility === ChainVisibility.Visible);
5845
5820
  }
5846
5821
  hiddenChains() {
5847
- return this.chains.filter((c2) => c2.visibility === ChainVisibility.Hidden);
5822
+ return this.chains.filter((c) => c.visibility === ChainVisibility.Hidden);
5848
5823
  }
5849
5824
  }
5850
5825
  const methods$1 = {};
@@ -6064,24 +6039,24 @@ function prev2() {
6064
6039
  }
6065
6040
  function forward() {
6066
6041
  const i = this.position();
6067
- const p = this.parent();
6068
- p.add(this.remove(), i + 1);
6042
+ const p2 = this.parent();
6043
+ p2.add(this.remove(), i + 1);
6069
6044
  return this;
6070
6045
  }
6071
6046
  function backward() {
6072
6047
  const i = this.position();
6073
- const p = this.parent();
6074
- p.add(this.remove(), i ? i - 1 : 0);
6048
+ const p2 = this.parent();
6049
+ p2.add(this.remove(), i ? i - 1 : 0);
6075
6050
  return this;
6076
6051
  }
6077
6052
  function front() {
6078
- const p = this.parent();
6079
- p.add(this.remove());
6053
+ const p2 = this.parent();
6054
+ p2.add(this.remove());
6080
6055
  return this;
6081
6056
  }
6082
6057
  function back() {
6083
- const p = this.parent();
6084
- p.add(this.remove(), 0);
6058
+ const p2 = this.parent();
6059
+ p2.add(this.remove(), 0);
6085
6060
  return this;
6086
6061
  }
6087
6062
  function before(element) {
@@ -6152,8 +6127,8 @@ function addClass(name) {
6152
6127
  }
6153
6128
  function removeClass(name) {
6154
6129
  if (this.hasClass(name)) {
6155
- this.attr("class", this.classes().filter(function(c2) {
6156
- return c2 !== name;
6130
+ this.attr("class", this.classes().filter(function(c) {
6131
+ return c !== name;
6157
6132
  }).join(" "));
6158
6133
  }
6159
6134
  return this;
@@ -6216,7 +6191,7 @@ registerMethods("Dom", {
6216
6191
  hide,
6217
6192
  visible
6218
6193
  });
6219
- function data(a, v2, r) {
6194
+ function data(a, v3, r) {
6220
6195
  if (a == null) {
6221
6196
  return this.data(map(filter(this.node.attributes, (el) => el.nodeName.indexOf("data-") === 0), (el) => el.nodeName.slice(5)));
6222
6197
  } else if (a instanceof Array) {
@@ -6226,8 +6201,8 @@ function data(a, v2, r) {
6226
6201
  }
6227
6202
  return data2;
6228
6203
  } else if (typeof a === "object") {
6229
- for (v2 in a) {
6230
- this.data(v2, a[v2]);
6204
+ for (v3 in a) {
6205
+ this.data(v3, a[v3]);
6231
6206
  }
6232
6207
  } else if (arguments.length < 2) {
6233
6208
  try {
@@ -6236,14 +6211,14 @@ function data(a, v2, r) {
6236
6211
  return this.attr("data-" + a);
6237
6212
  }
6238
6213
  } else {
6239
- this.attr("data-" + a, v2 === null ? null : r === true || typeof v2 === "string" || typeof v2 === "number" ? v2 : JSON.stringify(v2));
6214
+ this.attr("data-" + a, v3 === null ? null : r === true || typeof v3 === "string" || typeof v3 === "number" ? v3 : JSON.stringify(v3));
6240
6215
  }
6241
6216
  return this;
6242
6217
  }
6243
6218
  registerMethods("Dom", {
6244
6219
  data
6245
6220
  });
6246
- function remember(k3, v2) {
6221
+ function remember(k3, v3) {
6247
6222
  if (typeof arguments[0] === "object") {
6248
6223
  for (const key in k3) {
6249
6224
  this.remember(key, k3[key]);
@@ -6251,7 +6226,7 @@ function remember(k3, v2) {
6251
6226
  } else if (arguments.length === 1) {
6252
6227
  return this.memory()[k3];
6253
6228
  } else {
6254
- this.memory()[k3] = v2;
6229
+ this.memory()[k3] = v3;
6255
6230
  }
6256
6231
  return this;
6257
6232
  }
@@ -6343,13 +6318,13 @@ function cieSpace(space) {
6343
6318
  return false;
6344
6319
  }
6345
6320
  }
6346
- function hueToRgb(p, q, t) {
6321
+ function hueToRgb(p2, q, t) {
6347
6322
  if (t < 0) t += 1;
6348
6323
  if (t > 1) t -= 1;
6349
- if (t < 1 / 6) return p + (q - p) * 6 * t;
6324
+ if (t < 1 / 6) return p2 + (q - p2) * 6 * t;
6350
6325
  if (t < 1 / 2) return q;
6351
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
6352
- return p;
6326
+ if (t < 2 / 3) return p2 + (q - p2) * (2 / 3 - t) * 6;
6327
+ return p2;
6353
6328
  }
6354
6329
  class Color {
6355
6330
  constructor(...inputs) {
@@ -6374,10 +6349,10 @@ class Color {
6374
6349
  PI: pi
6375
6350
  } = Math;
6376
6351
  if (mode === "vibrant") {
6377
- const l = (81 - 57) * random() + 57;
6378
- const c2 = (83 - 45) * random() + 45;
6379
- const h2 = 360 * random();
6380
- const color = new Color(l, c2, h2, "lch");
6352
+ const l2 = (81 - 57) * random() + 57;
6353
+ const c = (83 - 45) * random() + 45;
6354
+ const h = 360 * random();
6355
+ const color = new Color(l2, c, h, "lch");
6381
6356
  return color;
6382
6357
  } else if (mode === "sine") {
6383
6358
  t = t == null ? random() : t;
@@ -6387,16 +6362,16 @@ class Color {
6387
6362
  const color = new Color(r, g, b2);
6388
6363
  return color;
6389
6364
  } else if (mode === "pastel") {
6390
- const l = (94 - 86) * random() + 86;
6391
- const c2 = (26 - 9) * random() + 9;
6392
- const h2 = 360 * random();
6393
- const color = new Color(l, c2, h2, "lch");
6365
+ const l2 = (94 - 86) * random() + 86;
6366
+ const c = (26 - 9) * random() + 9;
6367
+ const h = 360 * random();
6368
+ const color = new Color(l2, c, h, "lch");
6394
6369
  return color;
6395
6370
  } else if (mode === "dark") {
6396
- const l = 10 + 10 * random();
6397
- const c2 = (125 - 75) * random() + 86;
6398
- const h2 = 360 * random();
6399
- const color = new Color(l, c2, h2, "lch");
6371
+ const l2 = 10 + 10 * random();
6372
+ const c = (125 - 75) * random() + 86;
6373
+ const h = 360 * random();
6374
+ const color = new Color(l2, c, h, "lch");
6400
6375
  return color;
6401
6376
  } else if (mode === "rgb") {
6402
6377
  const r = 255 * random();
@@ -6405,10 +6380,10 @@ class Color {
6405
6380
  const color = new Color(r, g, b2);
6406
6381
  return color;
6407
6382
  } else if (mode === "lab") {
6408
- const l = 100 * random();
6383
+ const l2 = 100 * random();
6409
6384
  const a = 256 * random() - 128;
6410
6385
  const b2 = 256 * random() - 128;
6411
- const color = new Color(l, a, b2, "lab");
6386
+ const color = new Color(l2, a, b2, "lab");
6412
6387
  return color;
6413
6388
  } else if (mode === "grey") {
6414
6389
  const grey = 255 * random();
@@ -6428,15 +6403,15 @@ class Color {
6428
6403
  _b,
6429
6404
  _c
6430
6405
  } = this.rgb();
6431
- const [r, g, b2] = [_a, _b, _c].map((v2) => v2 / 255);
6406
+ const [r, g, b2] = [_a, _b, _c].map((v3) => v3 / 255);
6432
6407
  const k3 = Math.min(1 - r, 1 - g, 1 - b2);
6433
6408
  if (k3 === 1) {
6434
6409
  return new Color(0, 0, 0, 1, "cmyk");
6435
6410
  }
6436
- const c2 = (1 - r - k3) / (1 - k3);
6411
+ const c = (1 - r - k3) / (1 - k3);
6437
6412
  const m = (1 - g - k3) / (1 - k3);
6438
6413
  const y2 = (1 - b2 - k3) / (1 - k3);
6439
- const color = new Color(c2, m, y2, k3, "cmyk");
6414
+ const color = new Color(c, m, y2, k3, "cmyk");
6440
6415
  return color;
6441
6416
  }
6442
6417
  hsl() {
@@ -6445,18 +6420,18 @@ class Color {
6445
6420
  _b,
6446
6421
  _c
6447
6422
  } = this.rgb();
6448
- const [r, g, b2] = [_a, _b, _c].map((v2) => v2 / 255);
6423
+ const [r, g, b2] = [_a, _b, _c].map((v3) => v3 / 255);
6449
6424
  const max2 = Math.max(r, g, b2);
6450
6425
  const min2 = Math.min(r, g, b2);
6451
- const l = (max2 + min2) / 2;
6426
+ const l2 = (max2 + min2) / 2;
6452
6427
  const isGrey = max2 === min2;
6453
6428
  const delta = max2 - min2;
6454
- const s = isGrey ? 0 : l > 0.5 ? delta / (2 - max2 - min2) : delta / (max2 + min2);
6455
- const h2 = isGrey ? 0 : max2 === r ? ((g - b2) / delta + (g < b2 ? 6 : 0)) / 6 : max2 === g ? ((b2 - r) / delta + 2) / 6 : max2 === b2 ? ((r - g) / delta + 4) / 6 : 0;
6456
- const color = new Color(360 * h2, 100 * s, 100 * l, "hsl");
6429
+ const s = isGrey ? 0 : l2 > 0.5 ? delta / (2 - max2 - min2) : delta / (max2 + min2);
6430
+ const h = isGrey ? 0 : max2 === r ? ((g - b2) / delta + (g < b2 ? 6 : 0)) / 6 : max2 === g ? ((b2 - r) / delta + 2) / 6 : max2 === b2 ? ((r - g) / delta + 4) / 6 : 0;
6431
+ const color = new Color(360 * h, 100 * s, 100 * l2, "hsl");
6457
6432
  return color;
6458
6433
  }
6459
- init(a = 0, b2 = 0, c2 = 0, d = 0, space = "rgb") {
6434
+ init(a = 0, b2 = 0, c = 0, d = 0, space = "rgb") {
6460
6435
  a = !a ? 0 : a;
6461
6436
  if (this.space) {
6462
6437
  for (const component in this.space) {
@@ -6469,7 +6444,7 @@ class Color {
6469
6444
  Object.assign(this, {
6470
6445
  _a: a,
6471
6446
  _b: b2,
6472
- _c: c2,
6447
+ _c: c,
6473
6448
  _d: d,
6474
6449
  space
6475
6450
  });
@@ -6487,7 +6462,7 @@ class Color {
6487
6462
  } else if (typeof a === "string") {
6488
6463
  if (isRgb.test(a)) {
6489
6464
  const noWhitespace = a.replace(whitespace, "");
6490
- const [_a2, _b2, _c2] = rgb.exec(noWhitespace).slice(1, 4).map((v2) => parseInt(v2));
6465
+ const [_a2, _b2, _c2] = rgb.exec(noWhitespace).slice(1, 4).map((v3) => parseInt(v3));
6491
6466
  Object.assign(this, {
6492
6467
  _a: _a2,
6493
6468
  _b: _b2,
@@ -6496,7 +6471,7 @@ class Color {
6496
6471
  space: "rgb"
6497
6472
  });
6498
6473
  } else if (isHex.test(a)) {
6499
- const hexParse = (v2) => parseInt(v2, 16);
6474
+ const hexParse = (v3) => parseInt(v3, 16);
6500
6475
  const [, _a2, _b2, _c2] = hex.exec(sixDigitHex(a)).map(hexParse);
6501
6476
  Object.assign(this, {
6502
6477
  _a: _a2,
@@ -6545,27 +6520,27 @@ class Color {
6545
6520
  const {
6546
6521
  x: x2,
6547
6522
  y: y2,
6548
- z
6523
+ z: z2
6549
6524
  } = this.xyz();
6550
- const l = 116 * y2 - 16;
6525
+ const l2 = 116 * y2 - 16;
6551
6526
  const a = 500 * (x2 - y2);
6552
- const b2 = 200 * (y2 - z);
6553
- const color = new Color(l, a, b2, "lab");
6527
+ const b2 = 200 * (y2 - z2);
6528
+ const color = new Color(l2, a, b2, "lab");
6554
6529
  return color;
6555
6530
  }
6556
6531
  lch() {
6557
6532
  const {
6558
- l,
6533
+ l: l2,
6559
6534
  a,
6560
6535
  b: b2
6561
6536
  } = this.lab();
6562
- const c2 = Math.sqrt(a ** 2 + b2 ** 2);
6563
- let h2 = 180 * Math.atan2(b2, a) / Math.PI;
6564
- if (h2 < 0) {
6565
- h2 *= -1;
6566
- h2 = 360 - h2;
6537
+ const c = Math.sqrt(a ** 2 + b2 ** 2);
6538
+ let h = 180 * Math.atan2(b2, a) / Math.PI;
6539
+ if (h < 0) {
6540
+ h *= -1;
6541
+ h = 360 - h;
6567
6542
  }
6568
- const color = new Color(l, c2, h2, "lch");
6543
+ const color = new Color(l2, c, h, "lch");
6569
6544
  return color;
6570
6545
  }
6571
6546
  /*
@@ -6578,24 +6553,24 @@ class Color {
6578
6553
  let {
6579
6554
  x: x2,
6580
6555
  y: y2,
6581
- z
6556
+ z: z2
6582
6557
  } = this;
6583
6558
  if (this.space === "lab" || this.space === "lch") {
6584
6559
  let {
6585
- l,
6560
+ l: l2,
6586
6561
  a,
6587
6562
  b: b3
6588
6563
  } = this;
6589
6564
  if (this.space === "lch") {
6590
6565
  const {
6591
- c: c2,
6592
- h: h2
6566
+ c,
6567
+ h
6593
6568
  } = this;
6594
6569
  const dToR = Math.PI / 180;
6595
- a = c2 * Math.cos(dToR * h2);
6596
- b3 = c2 * Math.sin(dToR * h2);
6570
+ a = c * Math.cos(dToR * h);
6571
+ b3 = c * Math.sin(dToR * h);
6597
6572
  }
6598
- const yL = (l + 16) / 116;
6573
+ const yL = (l2 + 16) / 116;
6599
6574
  const xL = a / 500 + yL;
6600
6575
  const zL = yL - b3 / 200;
6601
6576
  const ct = 16 / 116;
@@ -6603,11 +6578,11 @@ class Color {
6603
6578
  const nm = 7.787;
6604
6579
  x2 = 0.95047 * (xL ** 3 > mx ? xL ** 3 : (xL - ct) / nm);
6605
6580
  y2 = 1 * (yL ** 3 > mx ? yL ** 3 : (yL - ct) / nm);
6606
- z = 1.08883 * (zL ** 3 > mx ? zL ** 3 : (zL - ct) / nm);
6581
+ z2 = 1.08883 * (zL ** 3 > mx ? zL ** 3 : (zL - ct) / nm);
6607
6582
  }
6608
- const rU = x2 * 3.2406 + y2 * -1.5372 + z * -0.4986;
6609
- const gU = x2 * -0.9689 + y2 * 1.8758 + z * 0.0415;
6610
- const bU = x2 * 0.0557 + y2 * -0.204 + z * 1.057;
6583
+ const rU = x2 * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
6584
+ const gU = x2 * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
6585
+ const bU = x2 * 0.0557 + y2 * -0.204 + z2 * 1.057;
6611
6586
  const pow = Math.pow;
6612
6587
  const bd = 31308e-7;
6613
6588
  const r = rU > bd ? 1.055 * pow(rU, 1 / 2.4) - 0.055 : 12.92 * rU;
@@ -6617,33 +6592,33 @@ class Color {
6617
6592
  return color;
6618
6593
  } else if (this.space === "hsl") {
6619
6594
  let {
6620
- h: h2,
6595
+ h,
6621
6596
  s,
6622
- l
6597
+ l: l2
6623
6598
  } = this;
6624
- h2 /= 360;
6599
+ h /= 360;
6625
6600
  s /= 100;
6626
- l /= 100;
6601
+ l2 /= 100;
6627
6602
  if (s === 0) {
6628
- l *= 255;
6629
- const color2 = new Color(l, l, l);
6603
+ l2 *= 255;
6604
+ const color2 = new Color(l2, l2, l2);
6630
6605
  return color2;
6631
6606
  }
6632
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
6633
- const p = 2 * l - q;
6634
- const r = 255 * hueToRgb(p, q, h2 + 1 / 3);
6635
- const g = 255 * hueToRgb(p, q, h2);
6636
- const b2 = 255 * hueToRgb(p, q, h2 - 1 / 3);
6607
+ const q = l2 < 0.5 ? l2 * (1 + s) : l2 + s - l2 * s;
6608
+ const p2 = 2 * l2 - q;
6609
+ const r = 255 * hueToRgb(p2, q, h + 1 / 3);
6610
+ const g = 255 * hueToRgb(p2, q, h);
6611
+ const b2 = 255 * hueToRgb(p2, q, h - 1 / 3);
6637
6612
  const color = new Color(r, g, b2);
6638
6613
  return color;
6639
6614
  } else if (this.space === "cmyk") {
6640
6615
  const {
6641
- c: c2,
6616
+ c,
6642
6617
  m,
6643
6618
  y: y2,
6644
6619
  k: k3
6645
6620
  } = this;
6646
- const r = 255 * (1 - Math.min(1, c2 * (1 - k3) + k3));
6621
+ const r = 255 * (1 - Math.min(1, c * (1 - k3) + k3));
6647
6622
  const g = 255 * (1 - Math.min(1, m * (1 - k3) + k3));
6648
6623
  const b2 = 255 * (1 - Math.min(1, y2 * (1 - k3) + k3));
6649
6624
  const color = new Color(r, g, b2);
@@ -6680,7 +6655,7 @@ class Color {
6680
6655
  _b: g255,
6681
6656
  _c: b255
6682
6657
  } = this.rgb();
6683
- const [r, g, b2] = [r255, g255, b255].map((v2) => v2 / 255);
6658
+ const [r, g, b2] = [r255, g255, b255].map((v3) => v3 / 255);
6684
6659
  const rL = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
6685
6660
  const gL = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
6686
6661
  const bL = b2 > 0.04045 ? Math.pow((b2 + 0.055) / 1.055, 2.4) : b2 / 12.92;
@@ -6689,8 +6664,8 @@ class Color {
6689
6664
  const zU = (rL * 0.0193 + gL * 0.1192 + bL * 0.9505) / 1.08883;
6690
6665
  const x2 = xU > 8856e-6 ? Math.pow(xU, 1 / 3) : 7.787 * xU + 16 / 116;
6691
6666
  const y2 = yU > 8856e-6 ? Math.pow(yU, 1 / 3) : 7.787 * yU + 16 / 116;
6692
- const z = zU > 8856e-6 ? Math.pow(zU, 1 / 3) : 7.787 * zU + 16 / 116;
6693
- const color = new Color(x2, y2, z, "xyz");
6667
+ const z2 = zU > 8856e-6 ? Math.pow(zU, 1 / 3) : 7.787 * zU + 16 / 116;
6668
+ const color = new Color(x2, y2, z2, "xyz");
6694
6669
  return color;
6695
6670
  }
6696
6671
  /*
@@ -6707,7 +6682,7 @@ class Color {
6707
6682
  min: min2,
6708
6683
  round: round2
6709
6684
  } = Math;
6710
- const format = (v2) => max2(0, min2(round2(v2), 255));
6685
+ const format = (v3) => max2(0, min2(round2(v3), 255));
6711
6686
  return [_a, _b, _c].map(format);
6712
6687
  }
6713
6688
  /*
@@ -6825,16 +6800,16 @@ class Matrix {
6825
6800
  return o.a != null || o.b != null || o.c != null || o.d != null || o.e != null || o.f != null;
6826
6801
  }
6827
6802
  // left matrix, right matrix, target matrix which is overwritten
6828
- static matrixMultiply(l, r, o) {
6829
- const a = l.a * r.a + l.c * r.b;
6830
- const b2 = l.b * r.a + l.d * r.b;
6831
- const c2 = l.a * r.c + l.c * r.d;
6832
- const d = l.b * r.c + l.d * r.d;
6833
- const e = l.e + l.a * r.e + l.c * r.f;
6834
- const f = l.f + l.b * r.e + l.d * r.f;
6803
+ static matrixMultiply(l2, r, o) {
6804
+ const a = l2.a * r.a + l2.c * r.b;
6805
+ const b2 = l2.b * r.a + l2.d * r.b;
6806
+ const c = l2.a * r.c + l2.c * r.d;
6807
+ const d = l2.b * r.c + l2.d * r.d;
6808
+ const e = l2.e + l2.a * r.e + l2.c * r.f;
6809
+ const f = l2.f + l2.b * r.e + l2.d * r.f;
6835
6810
  o.a = a;
6836
6811
  o.b = b2;
6837
- o.c = c2;
6812
+ o.c = c;
6838
6813
  o.d = d;
6839
6814
  o.e = e;
6840
6815
  o.f = f;
@@ -6857,19 +6832,19 @@ class Matrix {
6857
6832
  decompose(cx2 = 0, cy2 = 0) {
6858
6833
  const a = this.a;
6859
6834
  const b2 = this.b;
6860
- const c2 = this.c;
6835
+ const c = this.c;
6861
6836
  const d = this.d;
6862
6837
  const e = this.e;
6863
6838
  const f = this.f;
6864
- const determinant = a * d - b2 * c2;
6839
+ const determinant = a * d - b2 * c;
6865
6840
  const ccw = determinant > 0 ? 1 : -1;
6866
6841
  const sx = ccw * Math.sqrt(a * a + b2 * b2);
6867
6842
  const thetaRad = Math.atan2(ccw * b2, ccw * a);
6868
6843
  const theta = 180 / Math.PI * thetaRad;
6869
6844
  const ct = Math.cos(thetaRad);
6870
6845
  const st = Math.sin(thetaRad);
6871
- const lam = (a * c2 + b2 * d) / determinant;
6872
- const sy = c2 * sx / (lam * a - b2) || d * sx / (lam * b2 + a);
6846
+ const lam = (a * c + b2 * d) / determinant;
6847
+ const sy = c * sx / (lam * a - b2) || d * sx / (lam * b2 + a);
6873
6848
  const tx = e - cx2 + cx2 * ct * sx + cy2 * (lam * ct * sx - st * sy);
6874
6849
  const ty = f - cy2 + cx2 * st * sx + cy2 * (lam * st * sx + ct * sy);
6875
6850
  return {
@@ -6923,15 +6898,15 @@ class Matrix {
6923
6898
  inverseO() {
6924
6899
  const a = this.a;
6925
6900
  const b2 = this.b;
6926
- const c2 = this.c;
6901
+ const c = this.c;
6927
6902
  const d = this.d;
6928
6903
  const e = this.e;
6929
6904
  const f = this.f;
6930
- const det = a * d - b2 * c2;
6905
+ const det = a * d - b2 * c;
6931
6906
  if (!det) throw new Error("Cannot invert " + this);
6932
6907
  const na = d / det;
6933
6908
  const nb = -b2 / det;
6934
- const nc = -c2 / det;
6909
+ const nc = -c / det;
6935
6910
  const nd = a / det;
6936
6911
  const ne = -(na * e + nc * f);
6937
6912
  const nf = -(nb * e + nd * f);
@@ -6948,17 +6923,17 @@ class Matrix {
6948
6923
  }
6949
6924
  lmultiplyO(matrix) {
6950
6925
  const r = this;
6951
- const l = matrix instanceof Matrix ? matrix : new Matrix(matrix);
6952
- return Matrix.matrixMultiply(l, r, this);
6926
+ const l2 = matrix instanceof Matrix ? matrix : new Matrix(matrix);
6927
+ return Matrix.matrixMultiply(l2, r, this);
6953
6928
  }
6954
6929
  // Left multiplies by the given matrix
6955
6930
  multiply(matrix) {
6956
6931
  return this.clone().multiplyO(matrix);
6957
6932
  }
6958
6933
  multiplyO(matrix) {
6959
- const l = this;
6934
+ const l2 = this;
6960
6935
  const r = matrix instanceof Matrix ? matrix : new Matrix(matrix);
6961
- return Matrix.matrixMultiply(l, r, this);
6936
+ return Matrix.matrixMultiply(l2, r, this);
6962
6937
  }
6963
6938
  // Rotate matrix
6964
6939
  rotate(r, cx2, cy2) {
@@ -6971,15 +6946,15 @@ class Matrix {
6971
6946
  const {
6972
6947
  a,
6973
6948
  b: b2,
6974
- c: c2,
6949
+ c,
6975
6950
  d,
6976
6951
  e,
6977
6952
  f
6978
6953
  } = this;
6979
6954
  this.a = a * cos - b2 * sin;
6980
6955
  this.b = b2 * cos + a * sin;
6981
- this.c = c2 * cos - d * sin;
6982
- this.d = d * cos + c2 * sin;
6956
+ this.c = c * cos - d * sin;
6957
+ this.d = d * cos + c * sin;
6983
6958
  this.e = e * cos - f * sin + cy2 * sin - cx2 * cos + cx2;
6984
6959
  this.f = f * cos + e * sin - cx2 * sin - cy2 * cos + cy2;
6985
6960
  return this;
@@ -6997,14 +6972,14 @@ class Matrix {
6997
6972
  const {
6998
6973
  a,
6999
6974
  b: b2,
7000
- c: c2,
6975
+ c,
7001
6976
  d,
7002
6977
  e,
7003
6978
  f
7004
6979
  } = this;
7005
6980
  this.a = a * x2;
7006
6981
  this.b = b2 * y2;
7007
- this.c = c2 * x2;
6982
+ this.c = c * x2;
7008
6983
  this.d = d * y2;
7009
6984
  this.e = e * x2 - cx2 * x2 + cx2;
7010
6985
  this.f = f * y2 - cy2 * y2 + cy2;
@@ -7018,13 +6993,13 @@ class Matrix {
7018
6993
  const {
7019
6994
  a,
7020
6995
  b: b2,
7021
- c: c2,
6996
+ c,
7022
6997
  d,
7023
6998
  e,
7024
6999
  f
7025
7000
  } = this;
7026
7001
  this.a = a + b2 * lx;
7027
- this.c = c2 + d * lx;
7002
+ this.c = c + d * lx;
7028
7003
  this.e = e + f * lx - cy2 * lx;
7029
7004
  return this;
7030
7005
  }
@@ -7045,15 +7020,15 @@ class Matrix {
7045
7020
  const {
7046
7021
  a,
7047
7022
  b: b2,
7048
- c: c2,
7023
+ c,
7049
7024
  d,
7050
7025
  e,
7051
7026
  f
7052
7027
  } = this;
7053
7028
  this.a = a + b2 * lx;
7054
7029
  this.b = b2 + a * ly;
7055
- this.c = c2 + d * lx;
7056
- this.d = d + c2 * ly;
7030
+ this.c = c + d * lx;
7031
+ this.d = d + c * ly;
7057
7032
  this.e = e + f * lx - cy2 * lx;
7058
7033
  this.f = f + e * ly - cx2 * ly;
7059
7034
  return this;
@@ -7205,12 +7180,12 @@ class Box {
7205
7180
  let yMin = Infinity;
7206
7181
  let yMax = -Infinity;
7207
7182
  const pts = [new Point(this.x, this.y), new Point(this.x2, this.y), new Point(this.x, this.y2), new Point(this.x2, this.y2)];
7208
- pts.forEach(function(p) {
7209
- p = p.transform(m);
7210
- xMin = Math.min(xMin, p.x);
7211
- xMax = Math.max(xMax, p.x);
7212
- yMin = Math.min(yMin, p.y);
7213
- yMax = Math.max(yMax, p.y);
7183
+ pts.forEach(function(p2) {
7184
+ p2 = p2.transform(m);
7185
+ xMin = Math.min(xMin, p2.x);
7186
+ xMax = Math.max(xMax, p2.x);
7187
+ yMin = Math.min(yMin, p2.y);
7188
+ yMax = Math.max(yMax, p2.y);
7214
7189
  });
7215
7190
  return new Box(xMin, yMin, xMax - xMin, yMax - yMin);
7216
7191
  }
@@ -7277,17 +7252,17 @@ registerMethods({
7277
7252
  if (!width2 || !height2) {
7278
7253
  throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");
7279
7254
  }
7280
- const v2 = this.viewbox();
7281
- const zoomX = width2 / v2.width;
7282
- const zoomY = height2 / v2.height;
7255
+ const v3 = this.viewbox();
7256
+ const zoomX = width2 / v3.width;
7257
+ const zoomY = height2 / v3.height;
7283
7258
  const zoom = Math.min(zoomX, zoomY);
7284
7259
  if (level == null) {
7285
7260
  return zoom;
7286
7261
  }
7287
7262
  let zoomAmount = zoom / level;
7288
7263
  if (zoomAmount === Infinity) zoomAmount = Number.MAX_SAFE_INTEGER / 100;
7289
- point2 = point2 || new Point(width2 / 2 / zoomX + v2.x, height2 / 2 / zoomY + v2.y);
7290
- const box = new Box(v2).transform(new Matrix({
7264
+ point2 = point2 || new Point(width2 / 2 / zoomX + v3.x, height2 / 2 / zoomY + v3.y);
7265
+ const box = new Box(v3).transform(new Matrix({
7291
7266
  scale: zoomAmount,
7292
7267
  origin: point2
7293
7268
  }));
@@ -7360,7 +7335,7 @@ function clearEvents(instance) {
7360
7335
  if (n.events) n.events = {};
7361
7336
  }
7362
7337
  function on(node, events, listener, binding, options) {
7363
- const l = listener.bind(binding || node);
7338
+ const l2 = listener.bind(binding || node);
7364
7339
  const instance = makeInstance(node);
7365
7340
  const bag = getEvents(instance);
7366
7341
  const n = getEventTarget(instance);
@@ -7373,8 +7348,8 @@ function on(node, events, listener, binding, options) {
7373
7348
  const ns = event.split(".")[1] || "*";
7374
7349
  bag[ev] = bag[ev] || {};
7375
7350
  bag[ev][ns] = bag[ev][ns] || {};
7376
- bag[ev][ns][listener._svgjsListenerId] = l;
7377
- n.addEventListener(ev, l, options || false);
7351
+ bag[ev][ns][listener._svgjsListenerId] = l2;
7352
+ n.addEventListener(ev, l2, options || false);
7378
7353
  });
7379
7354
  }
7380
7355
  function off(node, events, listener, options) {
@@ -7389,7 +7364,7 @@ function off(node, events, listener, options) {
7389
7364
  events.forEach(function(event) {
7390
7365
  const ev = event && event.split(".")[0];
7391
7366
  const ns = event && event.split(".")[1];
7392
- let namespace, l;
7367
+ let namespace, l2;
7393
7368
  if (listener) {
7394
7369
  if (bag[ev] && bag[ev][ns || "*"]) {
7395
7370
  n.removeEventListener(ev, bag[ev][ns || "*"][listener], options || false);
@@ -7397,8 +7372,8 @@ function off(node, events, listener, options) {
7397
7372
  }
7398
7373
  } else if (ev && ns) {
7399
7374
  if (bag[ev] && bag[ev][ns]) {
7400
- for (l in bag[ev][ns]) {
7401
- off(n, [ev, ns].join("."), l);
7375
+ for (l2 in bag[ev][ns]) {
7376
+ off(n, [ev, ns].join("."), l2);
7402
7377
  }
7403
7378
  delete bag[ev][ns];
7404
7379
  }
@@ -7978,8 +7953,8 @@ class Element extends Dom {
7978
7953
  }
7979
7954
  // Get parent document
7980
7955
  root() {
7981
- const p = this.parent(getClass(root));
7982
- return p && p.root();
7956
+ const p2 = this.parent(getClass(root));
7957
+ return p2 && p2.root();
7983
7958
  }
7984
7959
  // set given data to the elements data property
7985
7960
  setData(o) {
@@ -7988,8 +7963,8 @@ class Element extends Dom {
7988
7963
  }
7989
7964
  // Set element size to given width and height
7990
7965
  size(width2, height2) {
7991
- const p = proportionalSize(this, width2, height2);
7992
- return this.width(new SVGNumber(p.width)).height(new SVGNumber(p.height));
7966
+ const p2 = proportionalSize(this, width2, height2);
7967
+ return this.width(new SVGNumber(p2.width)).height(new SVGNumber(p2.height));
7993
7968
  }
7994
7969
  // Set width of element
7995
7970
  width(width2) {
@@ -8050,11 +8025,11 @@ const sugar = {
8050
8025
  });
8051
8026
  registerMethods(["Element", "Runner"], {
8052
8027
  // Let the user set the matrix directly
8053
- matrix: function(mat, b2, c2, d, e, f) {
8028
+ matrix: function(mat, b2, c, d, e, f) {
8054
8029
  if (mat == null) {
8055
8030
  return new Matrix(this);
8056
8031
  }
8057
- return this.attr("transform", new Matrix(mat, b2, c2, d, e, f));
8032
+ return this.attr("transform", new Matrix(mat, b2, c, d, e, f));
8058
8033
  },
8059
8034
  // Map rotation to transform
8060
8035
  rotate: function(angle, cx2, cy2) {
@@ -8142,12 +8117,12 @@ registerMethods("Path", {
8142
8117
  });
8143
8118
  registerMethods(["Element", "Runner"], {
8144
8119
  // Set font
8145
- font: function(a, v2) {
8120
+ font: function(a, v3) {
8146
8121
  if (typeof a === "object") {
8147
- for (v2 in a) this.font(v2, a[v2]);
8122
+ for (v3 in a) this.font(v3, a[v3]);
8148
8123
  return this;
8149
8124
  }
8150
- return a === "leading" ? this.leading(v2) : a === "anchor" ? this.attr("text-anchor", v2) : a === "size" || a === "family" || a === "weight" || a === "stretch" || a === "variant" || a === "style" ? this.attr("font-" + a, v2) : this.attr(a, v2);
8125
+ return a === "leading" ? this.leading(v3) : a === "anchor" ? this.attr("text-anchor", v3) : a === "size" || a === "family" || a === "weight" || a === "stretch" || a === "variant" || a === "style" ? this.attr("font-" + a, v3) : this.attr(a, v3);
8151
8126
  }
8152
8127
  });
8153
8128
  const methods = ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mouseout", "mousemove", "mouseenter", "mouseleave", "touchstart", "touchmove", "touchleave", "touchend", "touchcancel"].reduce(function(last, event) {
@@ -8285,8 +8260,8 @@ class Ellipse extends Shape {
8285
8260
  super(nodeOrNew("ellipse", node), attrs2);
8286
8261
  }
8287
8262
  size(width2, height2) {
8288
- const p = proportionalSize(this, width2, height2);
8289
- return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2));
8263
+ const p2 = proportionalSize(this, width2, height2);
8264
+ return this.rx(new SVGNumber(p2.width).divide(2)).ry(new SVGNumber(p2.height).divide(2));
8290
8265
  }
8291
8266
  }
8292
8267
  extend(Ellipse, circled);
@@ -8345,9 +8320,9 @@ class Gradient extends Container {
8345
8320
  super(nodeOrNew(type + "Gradient", typeof type === "string" ? null : type), attrs2);
8346
8321
  }
8347
8322
  // custom attr to handle transform
8348
- attr(a, b2, c2) {
8323
+ attr(a, b2, c) {
8349
8324
  if (a === "transform") a = "gradientTransform";
8350
- return super.attr(a, b2, c2);
8325
+ return super.attr(a, b2, c);
8351
8326
  }
8352
8327
  bbox() {
8353
8328
  return new Box();
@@ -8394,9 +8369,9 @@ class Pattern extends Container {
8394
8369
  super(nodeOrNew("pattern", node), attrs2);
8395
8370
  }
8396
8371
  // custom attr to handle transform
8397
- attr(a, b2, c2) {
8372
+ attr(a, b2, c) {
8398
8373
  if (a === "transform") a = "patternTransform";
8399
- return super.attr(a, b2, c2);
8374
+ return super.attr(a, b2, c);
8400
8375
  }
8401
8376
  bbox() {
8402
8377
  return new Box();
@@ -8450,13 +8425,13 @@ class Image extends Shape {
8450
8425
  if (!url) return this;
8451
8426
  const img = new globals.window.Image();
8452
8427
  on(img, "load", function(e) {
8453
- const p = this.parent(Pattern);
8428
+ const p2 = this.parent(Pattern);
8454
8429
  if (this.width() === 0 && this.height() === 0) {
8455
8430
  this.size(img.width, img.height);
8456
8431
  }
8457
- if (p instanceof Pattern) {
8458
- if (p.width() === 0 && p.height() === 0) {
8459
- p.size(this.width(), this.height());
8432
+ if (p2 instanceof Pattern) {
8433
+ if (p2.width() === 0 && p2.height() === 0) {
8434
+ p2.size(this.width(), this.height());
8460
8435
  }
8461
8436
  }
8462
8437
  if (typeof callback === "function") {
@@ -8629,8 +8604,8 @@ class Line extends Shape {
8629
8604
  }
8630
8605
  // Set element size to given width and height
8631
8606
  size(width2, height2) {
8632
- const p = proportionalSize(this, width2, height2);
8633
- return this.attr(this.array().size(p.width, p.height).toLine());
8607
+ const p2 = proportionalSize(this, width2, height2);
8608
+ return this.attr(this.array().size(p2.width, p2.height).toLine());
8634
8609
  }
8635
8610
  }
8636
8611
  extend(Line, pointed);
@@ -8701,9 +8676,9 @@ registerMethods({
8701
8676
  });
8702
8677
  register(Marker, "Marker");
8703
8678
  function makeSetterGetter(k3, f) {
8704
- return function(v2) {
8705
- if (v2 == null) return this[k3];
8706
- this[k3] = v2;
8679
+ return function(v3) {
8680
+ if (v3 == null) return this[k3];
8681
+ this[k3] = v3;
8707
8682
  if (f) f.call(this);
8708
8683
  return this;
8709
8684
  };
@@ -8794,11 +8769,11 @@ class Controller extends Stepper {
8794
8769
  super();
8795
8770
  this.stepper = fn;
8796
8771
  }
8797
- done(c2) {
8798
- return c2.done;
8772
+ done(c) {
8773
+ return c.done;
8799
8774
  }
8800
- step(current, target, dt, c2) {
8801
- return this.stepper(current, target, dt, c2);
8775
+ step(current, target, dt, c) {
8776
+ return this.stepper(current, target, dt, c);
8802
8777
  }
8803
8778
  }
8804
8779
  function recalculate() {
@@ -8817,19 +8792,19 @@ class Spring extends Controller {
8817
8792
  super();
8818
8793
  this.duration(duration).overshoot(overshoot);
8819
8794
  }
8820
- step(current, target, dt, c2) {
8795
+ step(current, target, dt, c) {
8821
8796
  if (typeof current === "string") return current;
8822
- c2.done = dt === Infinity;
8797
+ c.done = dt === Infinity;
8823
8798
  if (dt === Infinity) return target;
8824
8799
  if (dt === 0) return current;
8825
8800
  if (dt > 100) dt = 16;
8826
8801
  dt /= 1e3;
8827
- const velocity = c2.velocity || 0;
8802
+ const velocity = c.velocity || 0;
8828
8803
  const acceleration = -this.d * velocity - this.k * (current - target);
8829
8804
  const newPosition = current + velocity * dt + acceleration * dt * dt / 2;
8830
- c2.velocity = velocity + acceleration * dt;
8831
- c2.done = Math.abs(target - newPosition) + Math.abs(velocity) < 2e-3;
8832
- return c2.done ? target : newPosition;
8805
+ c.velocity = velocity + acceleration * dt;
8806
+ c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 2e-3;
8807
+ return c.done ? target : newPosition;
8833
8808
  }
8834
8809
  }
8835
8810
  extend(Spring, {
@@ -8837,26 +8812,26 @@ extend(Spring, {
8837
8812
  overshoot: makeSetterGetter("_overshoot", recalculate)
8838
8813
  });
8839
8814
  class PID extends Controller {
8840
- constructor(p = 0.1, i = 0.01, d = 0, windup = 1e3) {
8815
+ constructor(p2 = 0.1, i = 0.01, d = 0, windup = 1e3) {
8841
8816
  super();
8842
- this.p(p).i(i).d(d).windup(windup);
8817
+ this.p(p2).i(i).d(d).windup(windup);
8843
8818
  }
8844
- step(current, target, dt, c2) {
8819
+ step(current, target, dt, c) {
8845
8820
  if (typeof current === "string") return current;
8846
- c2.done = dt === Infinity;
8821
+ c.done = dt === Infinity;
8847
8822
  if (dt === Infinity) return target;
8848
8823
  if (dt === 0) return current;
8849
- const p = target - current;
8850
- let i = (c2.integral || 0) + p * dt;
8851
- const d = (p - (c2.error || 0)) / dt;
8824
+ const p2 = target - current;
8825
+ let i = (c.integral || 0) + p2 * dt;
8826
+ const d = (p2 - (c.error || 0)) / dt;
8852
8827
  const windup = this._windup;
8853
8828
  if (windup !== false) {
8854
8829
  i = Math.max(-windup, Math.min(i, windup));
8855
8830
  }
8856
- c2.error = p;
8857
- c2.integral = i;
8858
- c2.done = Math.abs(p) < 1e-3;
8859
- return c2.done ? target : current + (this.P * p + this.I * i + this.D * d);
8831
+ c.error = p2;
8832
+ c.integral = i;
8833
+ c.done = Math.abs(p2) < 1e-3;
8834
+ return c.done ? target : current + (this.P * p2 + this.I * i + this.D * d);
8860
8835
  }
8861
8836
  }
8862
8837
  extend(PID, {
@@ -8878,72 +8853,72 @@ const segmentParameters = {
8878
8853
  Z: 0
8879
8854
  };
8880
8855
  const pathHandlers = {
8881
- M: function(c2, p, p0) {
8882
- p.x = p0.x = c2[0];
8883
- p.y = p0.y = c2[1];
8884
- return ["M", p.x, p.y];
8856
+ M: function(c, p2, p0) {
8857
+ p2.x = p0.x = c[0];
8858
+ p2.y = p0.y = c[1];
8859
+ return ["M", p2.x, p2.y];
8885
8860
  },
8886
- L: function(c2, p) {
8887
- p.x = c2[0];
8888
- p.y = c2[1];
8889
- return ["L", c2[0], c2[1]];
8861
+ L: function(c, p2) {
8862
+ p2.x = c[0];
8863
+ p2.y = c[1];
8864
+ return ["L", c[0], c[1]];
8890
8865
  },
8891
- H: function(c2, p) {
8892
- p.x = c2[0];
8893
- return ["H", c2[0]];
8866
+ H: function(c, p2) {
8867
+ p2.x = c[0];
8868
+ return ["H", c[0]];
8894
8869
  },
8895
- V: function(c2, p) {
8896
- p.y = c2[0];
8897
- return ["V", c2[0]];
8870
+ V: function(c, p2) {
8871
+ p2.y = c[0];
8872
+ return ["V", c[0]];
8898
8873
  },
8899
- C: function(c2, p) {
8900
- p.x = c2[4];
8901
- p.y = c2[5];
8902
- return ["C", c2[0], c2[1], c2[2], c2[3], c2[4], c2[5]];
8874
+ C: function(c, p2) {
8875
+ p2.x = c[4];
8876
+ p2.y = c[5];
8877
+ return ["C", c[0], c[1], c[2], c[3], c[4], c[5]];
8903
8878
  },
8904
- S: function(c2, p) {
8905
- p.x = c2[2];
8906
- p.y = c2[3];
8907
- return ["S", c2[0], c2[1], c2[2], c2[3]];
8879
+ S: function(c, p2) {
8880
+ p2.x = c[2];
8881
+ p2.y = c[3];
8882
+ return ["S", c[0], c[1], c[2], c[3]];
8908
8883
  },
8909
- Q: function(c2, p) {
8910
- p.x = c2[2];
8911
- p.y = c2[3];
8912
- return ["Q", c2[0], c2[1], c2[2], c2[3]];
8884
+ Q: function(c, p2) {
8885
+ p2.x = c[2];
8886
+ p2.y = c[3];
8887
+ return ["Q", c[0], c[1], c[2], c[3]];
8913
8888
  },
8914
- T: function(c2, p) {
8915
- p.x = c2[0];
8916
- p.y = c2[1];
8917
- return ["T", c2[0], c2[1]];
8889
+ T: function(c, p2) {
8890
+ p2.x = c[0];
8891
+ p2.y = c[1];
8892
+ return ["T", c[0], c[1]];
8918
8893
  },
8919
- Z: function(c2, p, p0) {
8920
- p.x = p0.x;
8921
- p.y = p0.y;
8894
+ Z: function(c, p2, p0) {
8895
+ p2.x = p0.x;
8896
+ p2.y = p0.y;
8922
8897
  return ["Z"];
8923
8898
  },
8924
- A: function(c2, p) {
8925
- p.x = c2[5];
8926
- p.y = c2[6];
8927
- return ["A", c2[0], c2[1], c2[2], c2[3], c2[4], c2[5], c2[6]];
8899
+ A: function(c, p2) {
8900
+ p2.x = c[5];
8901
+ p2.y = c[6];
8902
+ return ["A", c[0], c[1], c[2], c[3], c[4], c[5], c[6]];
8928
8903
  }
8929
8904
  };
8930
8905
  const mlhvqtcsaz = "mlhvqtcsaz".split("");
8931
8906
  for (let i = 0, il = mlhvqtcsaz.length; i < il; ++i) {
8932
- pathHandlers[mlhvqtcsaz[i]] = /* @__PURE__ */ function(i2) {
8933
- return function(c2, p, p0) {
8934
- if (i2 === "H") c2[0] = c2[0] + p.x;
8935
- else if (i2 === "V") c2[0] = c2[0] + p.y;
8907
+ pathHandlers[mlhvqtcsaz[i]] = /* @__PURE__ */ (function(i2) {
8908
+ return function(c, p2, p0) {
8909
+ if (i2 === "H") c[0] = c[0] + p2.x;
8910
+ else if (i2 === "V") c[0] = c[0] + p2.y;
8936
8911
  else if (i2 === "A") {
8937
- c2[5] = c2[5] + p.x;
8938
- c2[6] = c2[6] + p.y;
8912
+ c[5] = c[5] + p2.x;
8913
+ c[6] = c[6] + p2.y;
8939
8914
  } else {
8940
- for (let j = 0, jl = c2.length; j < jl; ++j) {
8941
- c2[j] = c2[j] + (j % 2 ? p.y : p.x);
8915
+ for (let j = 0, jl = c.length; j < jl; ++j) {
8916
+ c[j] = c[j] + (j % 2 ? p2.y : p2.x);
8942
8917
  }
8943
8918
  }
8944
- return pathHandlers[i2](c2, p, p0);
8919
+ return pathHandlers[i2](c, p2, p0);
8945
8920
  };
8946
- }(mlhvqtcsaz[i].toUpperCase());
8921
+ })(mlhvqtcsaz[i].toUpperCase());
8947
8922
  }
8948
8923
  function makeAbsolut(parser2) {
8949
8924
  const command = parser2.segment[0];
@@ -9120,25 +9095,25 @@ class PathArray extends SVGArray {
9120
9095
  x2 -= box.x;
9121
9096
  y2 -= box.y;
9122
9097
  if (!isNaN(x2) && !isNaN(y2)) {
9123
- for (let l, i = this.length - 1; i >= 0; i--) {
9124
- l = this[i][0];
9125
- if (l === "M" || l === "L" || l === "T") {
9098
+ for (let l2, i = this.length - 1; i >= 0; i--) {
9099
+ l2 = this[i][0];
9100
+ if (l2 === "M" || l2 === "L" || l2 === "T") {
9126
9101
  this[i][1] += x2;
9127
9102
  this[i][2] += y2;
9128
- } else if (l === "H") {
9103
+ } else if (l2 === "H") {
9129
9104
  this[i][1] += x2;
9130
- } else if (l === "V") {
9105
+ } else if (l2 === "V") {
9131
9106
  this[i][1] += y2;
9132
- } else if (l === "C" || l === "S" || l === "Q") {
9107
+ } else if (l2 === "C" || l2 === "S" || l2 === "Q") {
9133
9108
  this[i][1] += x2;
9134
9109
  this[i][2] += y2;
9135
9110
  this[i][3] += x2;
9136
9111
  this[i][4] += y2;
9137
- if (l === "C") {
9112
+ if (l2 === "C") {
9138
9113
  this[i][5] += x2;
9139
9114
  this[i][6] += y2;
9140
9115
  }
9141
- } else if (l === "A") {
9116
+ } else if (l2 === "A") {
9142
9117
  this[i][6] += x2;
9143
9118
  this[i][7] += y2;
9144
9119
  }
@@ -9156,28 +9131,28 @@ class PathArray extends SVGArray {
9156
9131
  // Resize path string
9157
9132
  size(width2, height2) {
9158
9133
  const box = this.bbox();
9159
- let i, l;
9134
+ let i, l2;
9160
9135
  box.width = box.width === 0 ? 1 : box.width;
9161
9136
  box.height = box.height === 0 ? 1 : box.height;
9162
9137
  for (i = this.length - 1; i >= 0; i--) {
9163
- l = this[i][0];
9164
- if (l === "M" || l === "L" || l === "T") {
9138
+ l2 = this[i][0];
9139
+ if (l2 === "M" || l2 === "L" || l2 === "T") {
9165
9140
  this[i][1] = (this[i][1] - box.x) * width2 / box.width + box.x;
9166
9141
  this[i][2] = (this[i][2] - box.y) * height2 / box.height + box.y;
9167
- } else if (l === "H") {
9142
+ } else if (l2 === "H") {
9168
9143
  this[i][1] = (this[i][1] - box.x) * width2 / box.width + box.x;
9169
- } else if (l === "V") {
9144
+ } else if (l2 === "V") {
9170
9145
  this[i][1] = (this[i][1] - box.y) * height2 / box.height + box.y;
9171
- } else if (l === "C" || l === "S" || l === "Q") {
9146
+ } else if (l2 === "C" || l2 === "S" || l2 === "Q") {
9172
9147
  this[i][1] = (this[i][1] - box.x) * width2 / box.width + box.x;
9173
9148
  this[i][2] = (this[i][2] - box.y) * height2 / box.height + box.y;
9174
9149
  this[i][3] = (this[i][3] - box.x) * width2 / box.width + box.x;
9175
9150
  this[i][4] = (this[i][4] - box.y) * height2 / box.height + box.y;
9176
- if (l === "C") {
9151
+ if (l2 === "C") {
9177
9152
  this[i][5] = (this[i][5] - box.x) * width2 / box.width + box.x;
9178
9153
  this[i][6] = (this[i][6] - box.y) * height2 / box.height + box.y;
9179
9154
  }
9180
- } else if (l === "A") {
9155
+ } else if (l2 === "A") {
9181
9156
  this[i][1] = this[i][1] * width2 / box.width;
9182
9157
  this[i][2] = this[i][2] * height2 / box.height;
9183
9158
  this[i][6] = (this[i][6] - box.x) * width2 / box.width + box.x;
@@ -9316,8 +9291,8 @@ class TransformBag {
9316
9291
  return this;
9317
9292
  }
9318
9293
  toArray() {
9319
- const v2 = this;
9320
- return [v2.scaleX, v2.scaleY, v2.shear, v2.rotate, v2.translateX, v2.translateY, v2.originX, v2.originY];
9294
+ const v3 = this;
9295
+ return [v3.scaleX, v3.scaleY, v3.shear, v3.rotate, v3.translateX, v3.translateY, v3.originX, v3.originY];
9321
9296
  }
9322
9297
  }
9323
9298
  TransformBag.defaults = {
@@ -9444,8 +9419,8 @@ class Path extends Shape {
9444
9419
  }
9445
9420
  // Set element size to given width and height
9446
9421
  size(width2, height2) {
9447
- const p = proportionalSize(this, width2, height2);
9448
- return this.attr("d", this.array().size(p.width, p.height));
9422
+ const p2 = proportionalSize(this, width2, height2);
9423
+ return this.attr("d", this.array().size(p2.width, p2.height));
9449
9424
  }
9450
9425
  // Set width of element
9451
9426
  width(width2) {
@@ -9480,12 +9455,12 @@ function clear2() {
9480
9455
  function move$2(x2, y2) {
9481
9456
  return this.attr("points", this.array().move(x2, y2));
9482
9457
  }
9483
- function plot(p) {
9484
- return p == null ? this.array() : this.clear().attr("points", typeof p === "string" ? p : this._array = new PointArray(p));
9458
+ function plot(p2) {
9459
+ return p2 == null ? this.array() : this.clear().attr("points", typeof p2 === "string" ? p2 : this._array = new PointArray(p2));
9485
9460
  }
9486
9461
  function size$1(width2, height2) {
9487
- const p = proportionalSize(this, width2, height2);
9488
- return this.attr("points", this.array().size(p.width, p.height));
9462
+ const p2 = proportionalSize(this, width2, height2);
9463
+ return this.attr("points", this.array().size(p2.width, p2.height));
9489
9464
  }
9490
9465
  var poly = {
9491
9466
  __proto__: null,
@@ -9504,8 +9479,8 @@ class Polygon2 extends Shape {
9504
9479
  registerMethods({
9505
9480
  Container: {
9506
9481
  // Create a wrapped polygon element
9507
- polygon: wrapWithAttrCheck(function(p) {
9508
- return this.put(new Polygon2()).plot(p || new PointArray());
9482
+ polygon: wrapWithAttrCheck(function(p2) {
9483
+ return this.put(new Polygon2()).plot(p2 || new PointArray());
9509
9484
  })
9510
9485
  }
9511
9486
  });
@@ -9521,8 +9496,8 @@ class Polyline extends Shape {
9521
9496
  registerMethods({
9522
9497
  Container: {
9523
9498
  // Create a wrapped polygon element
9524
- polyline: wrapWithAttrCheck(function(p) {
9525
- return this.put(new Polyline()).plot(p || new PointArray());
9499
+ polyline: wrapWithAttrCheck(function(p2) {
9500
+ return this.put(new Polyline()).plot(p2 || new PointArray());
9526
9501
  })
9527
9502
  }
9528
9503
  });
@@ -10027,16 +10002,16 @@ class Runner extends EventTarget {
10027
10002
  }
10028
10003
  return this;
10029
10004
  }
10030
- loops(p) {
10005
+ loops(p2) {
10031
10006
  const loopDuration = this._duration + this._wait;
10032
- if (p == null) {
10007
+ if (p2 == null) {
10033
10008
  const loopsDone = Math.floor(this._time / loopDuration);
10034
10009
  const relativeTime = this._time - loopsDone * loopDuration;
10035
10010
  const position2 = relativeTime / this._duration;
10036
10011
  return Math.min(loopsDone + position2, this._times);
10037
10012
  }
10038
- const whole = Math.floor(p);
10039
- const partial = p % 1;
10013
+ const whole = Math.floor(p2);
10014
+ const partial = p2 % 1;
10040
10015
  const time = loopDuration * whole + this._duration * partial;
10041
10016
  return this.time(time);
10042
10017
  }
@@ -10045,7 +10020,7 @@ class Runner extends EventTarget {
10045
10020
  this._persist = dtOrForever;
10046
10021
  return this;
10047
10022
  }
10048
- position(p) {
10023
+ position(p2) {
10049
10024
  const x2 = this._time;
10050
10025
  const d = this._duration;
10051
10026
  const w = this._wait;
@@ -10053,7 +10028,7 @@ class Runner extends EventTarget {
10053
10028
  const s = this._swing;
10054
10029
  const r = this._reverse;
10055
10030
  let position2;
10056
- if (p == null) {
10031
+ if (p2 == null) {
10057
10032
  const f = function(x3) {
10058
10033
  const swinging = s * Math.floor(x3 % (2 * (w + d)) / (w + d));
10059
10034
  const backwards = swinging && !r || !swinging && r;
@@ -10068,14 +10043,14 @@ class Runner extends EventTarget {
10068
10043
  const loopsDone = Math.floor(this.loops());
10069
10044
  const swingForward = s && loopsDone % 2 === 0;
10070
10045
  const forwards = swingForward && !r || r && swingForward;
10071
- position2 = loopsDone + (forwards ? p : 1 - p);
10046
+ position2 = loopsDone + (forwards ? p2 : 1 - p2);
10072
10047
  return this.loops(position2);
10073
10048
  }
10074
- progress(p) {
10075
- if (p == null) {
10049
+ progress(p2) {
10050
+ if (p2 == null) {
10076
10051
  return Math.min(1, this._time / this.duration());
10077
10052
  }
10078
- return this.time(p * this.duration());
10053
+ return this.time(p2 * this.duration());
10079
10054
  }
10080
10055
  /*
10081
10056
  Basic Functionality
@@ -10341,12 +10316,12 @@ registerMethods({
10341
10316
  });
10342
10317
  const difference = (a, b2) => a.filter((x2) => !b2.includes(x2));
10343
10318
  extend(Runner, {
10344
- attr(a, v2) {
10345
- return this.styleAttr("attr", a, v2);
10319
+ attr(a, v3) {
10320
+ return this.styleAttr("attr", a, v3);
10346
10321
  },
10347
10322
  // Add animatable styles
10348
- css(s, v2) {
10349
- return this.styleAttr("css", s, v2);
10323
+ css(s, v3) {
10324
+ return this.styleAttr("css", s, v3);
10350
10325
  },
10351
10326
  styleAttr(type, nameOrAttrs, val) {
10352
10327
  if (typeof nameOrAttrs === "string") {
@@ -10574,9 +10549,9 @@ extend(Runner, {
10574
10549
  return this._queueNumber("height", height2);
10575
10550
  },
10576
10551
  // Add animatable plot
10577
- plot(a, b2, c2, d) {
10552
+ plot(a, b2, c, d) {
10578
10553
  if (arguments.length === 4) {
10579
- return this.plot([a, b2, c2, d]);
10554
+ return this.plot([a, b2, c, d]);
10580
10555
  }
10581
10556
  if (this._tryRetarget("plot", a)) return this;
10582
10557
  const morpher = new Morphable(this._stepper).type(this._element.MorphArray).to(a);
@@ -10989,8 +10964,8 @@ function dmove(dx2, dy2) {
10989
10964
  }
10990
10965
  const m = new Matrix(child);
10991
10966
  const matrix = m.translate(dx2, dy2).transform(m.inverse());
10992
- const p = new Point(bbox2.x, bbox2.y).transform(matrix);
10993
- child.move(p.x, p.y);
10967
+ const p2 = new Point(bbox2.x, bbox2.y).transform(matrix);
10968
+ child.move(p2.x, p2.y);
10994
10969
  });
10995
10970
  return this;
10996
10971
  }
@@ -11010,9 +10985,9 @@ function move(x2 = 0, y2 = 0, box = this.bbox()) {
11010
10985
  return this.dmove(dx2, dy2);
11011
10986
  }
11012
10987
  function size(width2, height2, box = this.bbox()) {
11013
- const p = proportionalSize(this, width2, height2, box);
11014
- const scaleX = p.width / box.width;
11015
- const scaleY = p.height / box.height;
10988
+ const p2 = proportionalSize(this, width2, height2, box);
10989
+ const scaleX = p2.width / box.width;
10990
+ const scaleY = p2.height / box.height;
11016
10991
  this.children().forEach((child, i) => {
11017
10992
  const o = new Point(box).transform(new Matrix(child).inverse());
11018
10993
  child.scale(scaleX, scaleY, o.x, o.y);
@@ -11341,7 +11316,7 @@ extend(Shape, {
11341
11316
  case "rect": {
11342
11317
  let {
11343
11318
  width: w,
11344
- height: h2,
11319
+ height: h,
11345
11320
  rx: rx2,
11346
11321
  ry: ry2,
11347
11322
  x: x2,
@@ -11352,17 +11327,17 @@ extend(Shape, {
11352
11327
  rx2 = rx2 || ry2;
11353
11328
  ry2 = ry2 || rx2;
11354
11329
  if (rx2 > w / 2) rx2 = w / 2;
11355
- if (ry2 > h2 / 2) ry2 = h2 / 2;
11330
+ if (ry2 > h / 2) ry2 = h / 2;
11356
11331
  if (rx2 && ry2) {
11357
11332
  d = [
11358
11333
  ["M", rx2 + x2, y2],
11359
11334
  ["h", w - 2 * rx2],
11360
11335
  ["a", rx2, ry2, 0, 0, 1, rx2, ry2],
11361
- ["v", h2 - 2 * ry2],
11336
+ ["v", h - 2 * ry2],
11362
11337
  ["a", rx2, ry2, 0, 0, 1, -rx2, ry2],
11363
11338
  ["h", -w + 2 * rx2],
11364
11339
  ["a", rx2, ry2, 0, 0, 1, -rx2, -ry2],
11365
- ["v", -h2 + 2 * ry2],
11340
+ ["v", -h + 2 * ry2],
11366
11341
  ["a", rx2, ry2, 0, 0, 1, rx2, -ry2],
11367
11342
  ["z"]
11368
11343
  ];
@@ -11370,9 +11345,9 @@ extend(Shape, {
11370
11345
  d = [
11371
11346
  ["M", x2, y2],
11372
11347
  ["h", w],
11373
- ["v", h2],
11348
+ ["v", h],
11374
11349
  ["h", -w],
11375
- ["v", -h2],
11350
+ ["v", -h],
11376
11351
  ["z"]
11377
11352
  ];
11378
11353
  }
@@ -11492,13 +11467,13 @@ function getSVGPath(contour, holes, closed, strokeStyle, fillStyle, fillImage, p
11492
11467
  }
11493
11468
  function getSVGPathCommands(points, closed = true) {
11494
11469
  const cmds = new Array();
11495
- let p;
11470
+ let p2;
11496
11471
  if (points.length > 0) {
11497
- p = points[0];
11498
- cmds.push(["M", round(p.x), round(p.y)]);
11472
+ p2 = points[0];
11473
+ cmds.push(["M", round(p2.x), round(p2.y)]);
11499
11474
  for (let i = 1; i < points.length; i++) {
11500
- p = points[i];
11501
- cmds.push(["L", round(p.x), round(p.y)]);
11475
+ p2 = points[i];
11476
+ cmds.push(["L", round(p2.x), round(p2.y)]);
11502
11477
  }
11503
11478
  if (closed) {
11504
11479
  cmds.push(["Z"]);
@@ -11564,7 +11539,7 @@ class FillPass extends DrawPass {
11564
11539
  svg2.add(group);
11565
11540
  for (const mesh of viewmap.meshes) {
11566
11541
  if (mesh.drawFills) {
11567
- const polygons = viewmap.polygons.filter((p) => p.mesh === mesh);
11542
+ const polygons = viewmap.polygons.filter((p2) => p2.mesh === mesh);
11568
11543
  const objectGroup = new G({ id: mesh.name });
11569
11544
  group.add(objectGroup);
11570
11545
  for (const polygon of polygons) {
@@ -11615,7 +11590,7 @@ class FillPass extends DrawPass {
11615
11590
  }
11616
11591
  }
11617
11592
  if (img) {
11618
- const patternAndImages = svg2.defs().children().filter((c2) => c2 instanceof Pattern && c2.children().length === 1).map((c2) => [c2, c2.children()[0]]);
11593
+ const patternAndImages = svg2.defs().children().filter((c) => c instanceof Pattern && c.children().length === 1).map((c) => [c, c.children()[0]]);
11619
11594
  patternAndImages.forEach(([pattern, image]) => {
11620
11595
  pattern.x(0);
11621
11596
  pattern.y(0);
@@ -11700,7 +11675,7 @@ class VisibleChainPass extends ChainPass {
11700
11675
  super(options);
11701
11676
  }
11702
11677
  async draw(svg2, viewmap) {
11703
- const chains = viewmap.chains.filter((c2) => c2.visibility === ChainVisibility.Visible);
11678
+ const chains = viewmap.chains.filter((c) => c.visibility === ChainVisibility.Visible);
11704
11679
  const meshes = Array.from(viewmap.meshes).filter((m) => m.drawVisibleContours);
11705
11680
  const group = new G({ id: "visible-contours" });
11706
11681
  drawChains(group, meshes, chains, this.options);
@@ -11722,7 +11697,7 @@ class HiddenChainPass extends ChainPass {
11722
11697
  }
11723
11698
  async draw(svg2, viewmap) {
11724
11699
  const chains = viewmap.chains.filter(
11725
- (c2) => c2.visibility === ChainVisibility.Hidden
11700
+ (c) => c.visibility === ChainVisibility.Hidden
11726
11701
  );
11727
11702
  const meshes = Array.from(viewmap.meshes).filter((m) => m.drawHiddenContours);
11728
11703
  const group = new G({ id: "hidden-contours" });
@@ -11731,19 +11706,18 @@ class HiddenChainPass extends ChainPass {
11731
11706
  }
11732
11707
  }
11733
11708
  function drawChains(parent, meshes, chains, options) {
11734
- var _a;
11735
11709
  const { defaultStyle, styles } = options;
11736
11710
  ViewEdgesNatures.sort(
11737
11711
  (n1, n2) => (styles[n1].drawOrder ?? 0) - (styles[n2].drawOrder ?? 0)
11738
11712
  );
11739
11713
  for (const mesh of meshes) {
11740
- const objectChains = chains.filter((c2) => c2.object === mesh);
11714
+ const objectChains = chains.filter((c) => c.object === mesh);
11741
11715
  const objectGroup = new G({ id: mesh.name });
11742
11716
  parent.add(objectGroup);
11743
11717
  for (const nature of ViewEdgesNatures) {
11744
- if ((_a = styles[nature]) == null ? void 0 : _a.enabled) {
11718
+ if (styles[nature]?.enabled) {
11745
11719
  const strokeStyle = { ...defaultStyle, ...styles[nature] };
11746
- const natureChains = objectChains.filter((c2) => c2.nature === nature);
11720
+ const natureChains = objectChains.filter((c) => c.nature === nature);
11747
11721
  const natureGroup = new G({ id: nature });
11748
11722
  objectGroup.add(natureGroup);
11749
11723
  for (const chain of natureChains) {
@@ -11790,7 +11764,7 @@ function getLegend(options) {
11790
11764
  }
11791
11765
  const EPSILON = 1e-10;
11792
11766
  const _matrix = new Matrix4$1();
11793
- function orient3D(a, b2, c2, d) {
11767
+ function orient3D(a, b2, c, d) {
11794
11768
  _matrix.set(
11795
11769
  a.x,
11796
11770
  a.y,
@@ -11800,9 +11774,9 @@ function orient3D(a, b2, c2, d) {
11800
11774
  b2.y,
11801
11775
  b2.z,
11802
11776
  1,
11803
- c2.x,
11804
- c2.y,
11805
- c2.z,
11777
+ c.x,
11778
+ c.y,
11779
+ c.z,
11806
11780
  1,
11807
11781
  d.x,
11808
11782
  d.y,
@@ -11817,8 +11791,8 @@ function orient3D(a, b2, c2, d) {
11817
11791
  }
11818
11792
  return 0;
11819
11793
  }
11820
- function frontSide(a, b2, c2, d) {
11821
- return orient3D(d, b2, c2, a);
11794
+ function frontSide(a, b2, c, d) {
11795
+ return orient3D(d, b2, c, a);
11822
11796
  }
11823
11797
  const _u$1 = new Vector3$1();
11824
11798
  const _v = new Vector3$1();
@@ -11895,21 +11869,21 @@ class Halfedge {
11895
11869
  return null;
11896
11870
  }
11897
11871
  }
11898
- function addEdge(struct, v1, v2, allowParallels = false) {
11899
- if (v1 === v2) {
11872
+ function addEdge(struct, v1, v22, allowParallels = false) {
11873
+ if (v1 === v22) {
11900
11874
  throw new Error("Vertices v1 and v2 should be different");
11901
11875
  }
11902
11876
  if (!allowParallels) {
11903
- const currentHalfEdge = v1.getHalfedgeToVertex(v2);
11877
+ const currentHalfEdge = v1.getHalfedgeToVertex(v22);
11904
11878
  if (currentHalfEdge) {
11905
11879
  return currentHalfEdge;
11906
11880
  }
11907
11881
  }
11908
- if (!v1.isFree() || !v2.isFree()) {
11882
+ if (!v1.isFree() || !v22.isFree()) {
11909
11883
  throw new Error("Vertices v1 and v2 are not free");
11910
11884
  }
11911
11885
  const h1 = new Halfedge(v1);
11912
- const h2 = new Halfedge(v2);
11886
+ const h2 = new Halfedge(v22);
11913
11887
  h1.twin = h2;
11914
11888
  h1.next = h2;
11915
11889
  h1.prev = h2;
@@ -11926,7 +11900,7 @@ function addEdge(struct, v1, v2, allowParallels = false) {
11926
11900
  } else {
11927
11901
  v1.halfedge = h1;
11928
11902
  }
11929
- const in2 = v2.freeHalfedgesInLoop().next().value;
11903
+ const in2 = v22.freeHalfedgesInLoop().next().value;
11930
11904
  if (in2) {
11931
11905
  const out2 = in2.next;
11932
11906
  h2.prev = in2;
@@ -11934,7 +11908,7 @@ function addEdge(struct, v1, v2, allowParallels = false) {
11934
11908
  h1.next = out2;
11935
11909
  out2.prev = h1;
11936
11910
  } else {
11937
- v2.halfedge = h2;
11911
+ v22.halfedge = h2;
11938
11912
  }
11939
11913
  struct.halfedges.push(h1);
11940
11914
  struct.halfedges.push(h2);
@@ -12073,13 +12047,13 @@ function makeHalfedgesAdjacent(halfIn, halfOut) {
12073
12047
  }
12074
12048
  const b2 = halfIn.next;
12075
12049
  const d = halfOut.prev;
12076
- const h2 = g.next;
12050
+ const h = g.next;
12077
12051
  halfIn.next = halfOut;
12078
12052
  halfOut.prev = halfIn;
12079
12053
  g.next = b2;
12080
12054
  b2.prev = g;
12081
- d.next = h2;
12082
- h2.prev = d;
12055
+ d.next = h;
12056
+ h.prev = d;
12083
12057
  return true;
12084
12058
  }
12085
12059
  const _u = new Vector3$1();
@@ -12246,10 +12220,10 @@ function addVertex(struct, position2, checkDuplicates = false, tolerance = 1e-10
12246
12220
  }
12247
12221
  }
12248
12222
  }
12249
- const v2 = new Vertex();
12250
- v2.position.copy(position2);
12251
- struct.vertices.push(v2);
12252
- return v2;
12223
+ const v3 = new Vertex();
12224
+ v3.position.copy(position2);
12225
+ struct.vertices.push(v3);
12226
+ return v3;
12253
12227
  }
12254
12228
  function removeFace(struct, face) {
12255
12229
  if (!struct.faces.remove(face)) {
@@ -12280,11 +12254,11 @@ function removeEdge(struct, halfedge, mergeFaces = true) {
12280
12254
  halfedge.prev.next = twin.next;
12281
12255
  twin.next.prev = halfedge.prev;
12282
12256
  }
12283
- const v2 = twin.vertex;
12257
+ const v22 = twin.vertex;
12284
12258
  if (halfedge.next === twin) {
12285
- v2.halfedge = null;
12259
+ v22.halfedge = null;
12286
12260
  } else {
12287
- v2.halfedge = halfedge.next;
12261
+ v22.halfedge = halfedge.next;
12288
12262
  halfedge.next.prev = twin.prev;
12289
12263
  twin.prev.next = halfedge.next;
12290
12264
  }
@@ -12297,23 +12271,23 @@ function removeVertex(struct, vertex, mergeFaces = true) {
12297
12271
  }
12298
12272
  struct.vertices.remove(vertex);
12299
12273
  }
12300
- function cutFace(struct, face, v1, v2, createNewFace = true) {
12301
- if (v1 === v2) {
12274
+ function cutFace(struct, face, v1, v22, createNewFace = true) {
12275
+ if (v1 === v22) {
12302
12276
  throw new Error("Vertices v1 and v2 should be different");
12303
12277
  }
12304
12278
  let out1 = face.halfedgeFromVertex(v1);
12305
12279
  if (!out1 && !v1.isFree()) {
12306
12280
  throw new Error("Vertices v1 does not belong to face nor is free");
12307
12281
  }
12308
- let out2 = face.halfedgeFromVertex(v2);
12309
- if (!out2 && !v2.isFree()) {
12282
+ let out2 = face.halfedgeFromVertex(v22);
12283
+ if (!out2 && !v22.isFree()) {
12310
12284
  throw new Error("Vertices v2 does not belong to face nor is free");
12311
12285
  }
12312
- if (out1 && out1.next.vertex === v2 || out2 && out2.next.vertex === v1) {
12286
+ if (out1 && out1.next.vertex === v22 || out2 && out2.next.vertex === v1) {
12313
12287
  throw new Error("Vertices v1 and v2 are already connected");
12314
12288
  }
12315
12289
  const h1 = new Halfedge(v1);
12316
- const h2 = new Halfedge(v2);
12290
+ const h2 = new Halfedge(v22);
12317
12291
  h1.face = face;
12318
12292
  h2.face = face;
12319
12293
  h1.twin = h2;
@@ -12332,7 +12306,7 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12332
12306
  } else {
12333
12307
  v1.halfedge = h1;
12334
12308
  }
12335
- out2 = out2 ?? v2.freeHalfedgesOutLoop().next().value;
12309
+ out2 = out2 ?? v22.freeHalfedgesOutLoop().next().value;
12336
12310
  if (out2) {
12337
12311
  const in2 = out2.prev;
12338
12312
  h2.prev = in2;
@@ -12340,7 +12314,7 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12340
12314
  h1.next = out2;
12341
12315
  out2.prev = h1;
12342
12316
  } else {
12343
- v2.halfedge = h2;
12317
+ v22.halfedge = h2;
12344
12318
  }
12345
12319
  struct.halfedges.push(h1);
12346
12320
  struct.halfedges.push(h2);
@@ -12349,10 +12323,10 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12349
12323
  }
12350
12324
  let found = false;
12351
12325
  const loop = h1.nextLoop();
12352
- let h3 = loop.next();
12353
- while (!found && !h3.done) {
12354
- found = h3.value === h2;
12355
- h3 = loop.next();
12326
+ let h = loop.next();
12327
+ while (!found && !h.done) {
12328
+ found = h.value === h2;
12329
+ h = loop.next();
12356
12330
  }
12357
12331
  if (!found) {
12358
12332
  face.halfedge = h1;
@@ -12361,8 +12335,8 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12361
12335
  newFace = new Face(h2);
12362
12336
  struct.faces.push(newFace);
12363
12337
  }
12364
- for (const h32 of h2.nextLoop()) {
12365
- h32.face = newFace;
12338
+ for (const h3 of h2.nextLoop()) {
12339
+ h3.face = newFace;
12366
12340
  }
12367
12341
  }
12368
12342
  return h1;
@@ -12370,22 +12344,22 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12370
12344
  function splitEdge(struct, halfedge, position2, tolerance = 1e-10) {
12371
12345
  const twin = halfedge.twin;
12372
12346
  const A2 = halfedge.vertex;
12373
- const B2 = twin.vertex;
12347
+ const B = twin.vertex;
12374
12348
  if (A2.matchesPosition(position2, tolerance)) {
12375
12349
  return A2;
12376
12350
  }
12377
- if (B2.matchesPosition(position2, tolerance)) {
12378
- return B2;
12351
+ if (B.matchesPosition(position2, tolerance)) {
12352
+ return B;
12379
12353
  }
12380
12354
  const newVertex = new Vertex();
12381
12355
  newVertex.position.copy(position2);
12382
12356
  const newHalfedge = new Halfedge(newVertex);
12383
- const newTwin = new Halfedge(B2);
12357
+ const newTwin = new Halfedge(B);
12384
12358
  newHalfedge.twin = newTwin;
12385
12359
  newTwin.twin = newHalfedge;
12386
12360
  A2.halfedge = halfedge;
12387
12361
  newVertex.halfedge = newHalfedge;
12388
- B2.halfedge = newTwin;
12362
+ B.halfedge = newTwin;
12389
12363
  newHalfedge.face = halfedge.face;
12390
12364
  newTwin.face = twin.face;
12391
12365
  newHalfedge.next = halfedge.next;
@@ -12432,18 +12406,18 @@ function setFromGeometry(struct, geometry, tolerance = 1e-10) {
12432
12406
  vertexMap.set(i1, v1);
12433
12407
  }
12434
12408
  const i2 = getVertexIndex(faceIndex * 3 + (i + 1) % 3);
12435
- let v2 = vertexMap.get(i2);
12436
- if (!v2) {
12409
+ let v22 = vertexMap.get(i2);
12410
+ if (!v22) {
12437
12411
  pos_.fromBufferAttribute(positions, i2);
12438
- v2 = struct.addVertex(pos_);
12439
- vertexMap.set(i2, v2);
12412
+ v22 = struct.addVertex(pos_);
12413
+ vertexMap.set(i2, v22);
12440
12414
  }
12441
12415
  const hash1 = i1 + "-" + i2;
12442
12416
  let h1 = halfedgeMap.get(hash1);
12443
- if (h1 == null ? void 0 : h1.face) h1 = void 0;
12417
+ if (h1?.face) h1 = void 0;
12444
12418
  if (!h1) {
12445
12419
  try {
12446
- h1 = struct.addEdge(v1, v2);
12420
+ h1 = struct.addEdge(v1, v22);
12447
12421
  addedEdges.push(h1);
12448
12422
  const h2 = h1.twin;
12449
12423
  const hash2 = i2 + "-" + i1;
@@ -12547,8 +12521,8 @@ class HalfedgeDS {
12547
12521
  * @param allowParallels Allows multiple pair of halfedges between vertices, default false
12548
12522
  * @returns Existing or new halfedge
12549
12523
  */
12550
- addEdge(v1, v2, allowParallels = false) {
12551
- return addEdge(this, v1, v2, allowParallels);
12524
+ addEdge(v1, v22, allowParallels = false) {
12525
+ return addEdge(this, v1, v22, allowParallels);
12552
12526
  }
12553
12527
  /**
12554
12528
  * Adds a face to an existing halfedge loop
@@ -12602,8 +12576,8 @@ class HalfedgeDS {
12602
12576
  * @param createNewFace wether to create a new face or not when cutting
12603
12577
  * @returns the cutting halfedge
12604
12578
  */
12605
- cutFace(face, v1, v2, createNewFace = true) {
12606
- return cutFace(this, face, v1, v2, createNewFace);
12579
+ cutFace(face, v1, v22, createNewFace = true) {
12580
+ return cutFace(this, face, v1, v22, createNewFace);
12607
12581
  }
12608
12582
  /**
12609
12583
  * Splits the halfedge at position and returns the new vertex
@@ -12636,7 +12610,7 @@ const TRAVERSAL_COST = 1;
12636
12610
  const BYTES_PER_NODE = 6 * 4 + 4 + 4;
12637
12611
  const IS_LEAFNODE_FLAG = 65535;
12638
12612
  const FLOAT32_EPSILON = Math.pow(2, -24);
12639
- const SKIP_GENERATION = Symbol("SKIP_GENERATION");
12613
+ const SKIP_GENERATION = /* @__PURE__ */ Symbol("SKIP_GENERATION");
12640
12614
  function getVertexCount(geo) {
12641
12615
  return geo.index ? geo.index.count : geo.attributes.position.count;
12642
12616
  }
@@ -12802,22 +12776,22 @@ function computeTriangleBounds(geo, target = null, offset = null, count = null)
12802
12776
  ci = ci * stride + bufferOffset;
12803
12777
  }
12804
12778
  for (let el = 0; el < 3; el++) {
12805
- let a, b2, c2;
12779
+ let a, b2, c;
12806
12780
  if (normalized) {
12807
12781
  a = posAttr[getters[el]](ai);
12808
12782
  b2 = posAttr[getters[el]](bi);
12809
- c2 = posAttr[getters[el]](ci);
12783
+ c = posAttr[getters[el]](ci);
12810
12784
  } else {
12811
12785
  a = posArr[ai + el];
12812
12786
  b2 = posArr[bi + el];
12813
- c2 = posArr[ci + el];
12787
+ c = posArr[ci + el];
12814
12788
  }
12815
12789
  let min2 = a;
12816
12790
  if (b2 < min2) min2 = b2;
12817
- if (c2 < min2) min2 = c2;
12791
+ if (c < min2) min2 = c;
12818
12792
  let max2 = a;
12819
12793
  if (b2 > max2) max2 = b2;
12820
- if (c2 > max2) max2 = c2;
12794
+ if (c > max2) max2 = c;
12821
12795
  const halfExtents = (max2 - min2) / 2;
12822
12796
  const el2 = el * 2;
12823
12797
  triangleBounds[tri6 + el2 + 0] = min2 + halfExtents;
@@ -12921,9 +12895,9 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
12921
12895
  const truncatedBins = [...sahBins];
12922
12896
  truncatedBins.length = count;
12923
12897
  let b2 = 0;
12924
- for (let c2 = cStart; c2 < cEnd; c2 += 6, b2++) {
12898
+ for (let c = cStart; c < cEnd; c += 6, b2++) {
12925
12899
  const bin = truncatedBins[b2];
12926
- bin.candidate = triangleBounds[c2 + 2 * a];
12900
+ bin.candidate = triangleBounds[c + 2 * a];
12927
12901
  bin.count = 0;
12928
12902
  const {
12929
12903
  bounds,
@@ -12938,7 +12912,7 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
12938
12912
  bounds[d] = Infinity;
12939
12913
  bounds[d + 3] = -Infinity;
12940
12914
  }
12941
- expandByTriangleBounds(c2, triangleBounds, bounds);
12915
+ expandByTriangleBounds(c, triangleBounds, bounds);
12942
12916
  }
12943
12917
  truncatedBins.sort(binsSort);
12944
12918
  let splitCount = count;
@@ -12949,14 +12923,14 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
12949
12923
  splitCount--;
12950
12924
  }
12951
12925
  }
12952
- for (let c2 = cStart; c2 < cEnd; c2 += 6) {
12953
- const center2 = triangleBounds[c2 + 2 * a];
12926
+ for (let c = cStart; c < cEnd; c += 6) {
12927
+ const center2 = triangleBounds[c + 2 * a];
12954
12928
  for (let bi = 0; bi < splitCount; bi++) {
12955
12929
  const bin = truncatedBins[bi];
12956
12930
  if (center2 >= bin.candidate) {
12957
- expandByTriangleBounds(c2, triangleBounds, bin.rightCacheBounds);
12931
+ expandByTriangleBounds(c, triangleBounds, bin.rightCacheBounds);
12958
12932
  } else {
12959
- expandByTriangleBounds(c2, triangleBounds, bin.leftCacheBounds);
12933
+ expandByTriangleBounds(c, triangleBounds, bin.leftCacheBounds);
12960
12934
  bin.count++;
12961
12935
  }
12962
12936
  }
@@ -12993,14 +12967,14 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
12993
12967
  bounds[d + 3] = -Infinity;
12994
12968
  }
12995
12969
  }
12996
- for (let c2 = cStart; c2 < cEnd; c2 += 6) {
12997
- const triCenter = triangleBounds[c2 + 2 * a];
12970
+ for (let c = cStart; c < cEnd; c += 6) {
12971
+ const triCenter = triangleBounds[c + 2 * a];
12998
12972
  const relativeCenter = triCenter - axisLeft;
12999
12973
  let binIndex = ~~(relativeCenter / binWidth);
13000
12974
  if (binIndex >= BIN_COUNT) binIndex = BIN_COUNT - 1;
13001
12975
  const bin = sahBins[binIndex];
13002
12976
  bin.count++;
13003
- expandByTriangleBounds(c2, triangleBounds, bin.bounds);
12977
+ expandByTriangleBounds(c, triangleBounds, bin.bounds);
13004
12978
  }
13005
12979
  const lastBin = sahBins[BIN_COUNT - 1];
13006
12980
  copyBounds(lastBin.bounds, lastBin.rightCacheBounds);
@@ -13166,7 +13140,7 @@ function _populateBuffer(byteOffset, node) {
13166
13140
  if (node.buffer) {
13167
13141
  const buffer = node.buffer;
13168
13142
  uint8Array.set(new Uint8Array(buffer), byteOffset);
13169
- for (let offset = byteOffset, l = byteOffset + buffer.byteLength; offset < l; offset += BYTES_PER_NODE) {
13143
+ for (let offset = byteOffset, l2 = byteOffset + buffer.byteLength; offset < l2; offset += BYTES_PER_NODE) {
13170
13144
  const offset2 = offset / 2;
13171
13145
  if (!IS_LEAF(offset2, uint16Array)) {
13172
13146
  uint32Array[offset / 4 + 6] += stride4Offset;
@@ -13202,7 +13176,7 @@ function generateIndirectBuffer(geometry, useSharedArrayBuffer) {
13202
13176
  const byteCount = useUint32 ? 4 : 2;
13203
13177
  const buffer = useSharedArrayBuffer ? new SharedArrayBuffer(triCount * byteCount) : new ArrayBuffer(triCount * byteCount);
13204
13178
  const indirectBuffer = useUint32 ? new Uint32Array(buffer) : new Uint16Array(buffer);
13205
- for (let i = 0, l = indirectBuffer.length; i < l; i++) {
13179
+ for (let i = 0, l2 = indirectBuffer.length; i < l2; i++) {
13206
13180
  indirectBuffer[i] = i;
13207
13181
  }
13208
13182
  return indirectBuffer;
@@ -13308,9 +13282,9 @@ class SeparatingAxisBounds {
13308
13282
  setFromPointsField(points, field) {
13309
13283
  let min2 = Infinity;
13310
13284
  let max2 = -Infinity;
13311
- for (let i = 0, l = points.length; i < l; i++) {
13312
- const p = points[i];
13313
- const val = p[field];
13285
+ for (let i = 0, l2 = points.length; i < l2; i++) {
13286
+ const p2 = points[i];
13287
+ const val = p2[field];
13314
13288
  min2 = val < min2 ? val : min2;
13315
13289
  max2 = val > max2 ? val : max2;
13316
13290
  }
@@ -13320,9 +13294,9 @@ class SeparatingAxisBounds {
13320
13294
  setFromPoints(axis, points) {
13321
13295
  let min2 = Infinity;
13322
13296
  let max2 = -Infinity;
13323
- for (let i = 0, l = points.length; i < l; i++) {
13324
- const p = points[i];
13325
- const val = axis.dot(p);
13297
+ for (let i = 0, l2 = points.length; i < l2; i++) {
13298
+ const p2 = points[i];
13299
+ const val = axis.dot(p2);
13326
13300
  min2 = val < min2 ? val : min2;
13327
13301
  max2 = val > max2 ? val : max2;
13328
13302
  }
@@ -13333,8 +13307,8 @@ class SeparatingAxisBounds {
13333
13307
  return this.min > other.max || other.min > this.max;
13334
13308
  }
13335
13309
  }
13336
- SeparatingAxisBounds.prototype.setFromBox = function() {
13337
- const p = new Vector3();
13310
+ SeparatingAxisBounds.prototype.setFromBox = (function() {
13311
+ const p2 = new Vector3();
13338
13312
  return function setFromBox(axis, box) {
13339
13313
  const boxMin = box.min;
13340
13314
  const boxMax = box.max;
@@ -13342,11 +13316,11 @@ SeparatingAxisBounds.prototype.setFromBox = function() {
13342
13316
  let max2 = -Infinity;
13343
13317
  for (let x2 = 0; x2 <= 1; x2++) {
13344
13318
  for (let y2 = 0; y2 <= 1; y2++) {
13345
- for (let z = 0; z <= 1; z++) {
13346
- p.x = boxMin.x * x2 + boxMax.x * (1 - x2);
13347
- p.y = boxMin.y * y2 + boxMax.y * (1 - y2);
13348
- p.z = boxMin.z * z + boxMax.z * (1 - z);
13349
- const val = axis.dot(p);
13319
+ for (let z2 = 0; z2 <= 1; z2++) {
13320
+ p2.x = boxMin.x * x2 + boxMax.x * (1 - x2);
13321
+ p2.y = boxMin.y * y2 + boxMax.y * (1 - y2);
13322
+ p2.z = boxMin.z * z2 + boxMax.z * (1 - z2);
13323
+ const val = axis.dot(p2);
13350
13324
  min2 = Math.min(val, min2);
13351
13325
  max2 = Math.max(val, max2);
13352
13326
  }
@@ -13355,17 +13329,17 @@ SeparatingAxisBounds.prototype.setFromBox = function() {
13355
13329
  this.min = min2;
13356
13330
  this.max = max2;
13357
13331
  };
13358
- }();
13359
- const closestPointLineToLine = function() {
13332
+ })();
13333
+ const closestPointLineToLine = (function() {
13360
13334
  const dir1 = new Vector3();
13361
13335
  const dir2 = new Vector3();
13362
13336
  const v02 = new Vector3();
13363
13337
  return function closestPointLineToLine2(l1, l2, result) {
13364
13338
  const v0 = l1.start;
13365
13339
  const v10 = dir1;
13366
- const v2 = l2.start;
13340
+ const v22 = l2.start;
13367
13341
  const v32 = dir2;
13368
- v02.subVectors(v0, v2);
13342
+ v02.subVectors(v0, v22);
13369
13343
  dir1.subVectors(l1.end, l1.start);
13370
13344
  dir2.subVectors(l2.end, l2.start);
13371
13345
  const d0232 = v02.dot(v32);
@@ -13384,8 +13358,8 @@ const closestPointLineToLine = function() {
13384
13358
  result.x = d;
13385
13359
  result.y = d2;
13386
13360
  };
13387
- }();
13388
- const closestPointsSegmentToSegment = function() {
13361
+ })();
13362
+ const closestPointsSegmentToSegment = (function() {
13389
13363
  const paramResult = new Vector2();
13390
13364
  const temp12 = new Vector3();
13391
13365
  const temp22 = new Vector3();
@@ -13414,52 +13388,52 @@ const closestPointsSegmentToSegment = function() {
13414
13388
  l2.closestPointToPoint(target1, true, target2);
13415
13389
  return;
13416
13390
  } else {
13417
- let p;
13391
+ let p2;
13418
13392
  if (d < 0) {
13419
- p = l1.start;
13393
+ p2 = l1.start;
13420
13394
  } else {
13421
- p = l1.end;
13395
+ p2 = l1.end;
13422
13396
  }
13423
- let p2;
13397
+ let p22;
13424
13398
  if (d2 < 0) {
13425
- p2 = l2.start;
13399
+ p22 = l2.start;
13426
13400
  } else {
13427
- p2 = l2.end;
13401
+ p22 = l2.end;
13428
13402
  }
13429
13403
  const closestPoint = temp12;
13430
13404
  const closestPoint2 = temp22;
13431
- l1.closestPointToPoint(p2, true, temp12);
13432
- l2.closestPointToPoint(p, true, temp22);
13433
- if (closestPoint.distanceToSquared(p2) <= closestPoint2.distanceToSquared(p)) {
13405
+ l1.closestPointToPoint(p22, true, temp12);
13406
+ l2.closestPointToPoint(p2, true, temp22);
13407
+ if (closestPoint.distanceToSquared(p22) <= closestPoint2.distanceToSquared(p2)) {
13434
13408
  target1.copy(closestPoint);
13435
- target2.copy(p2);
13409
+ target2.copy(p22);
13436
13410
  return;
13437
13411
  } else {
13438
- target1.copy(p);
13412
+ target1.copy(p2);
13439
13413
  target2.copy(closestPoint2);
13440
13414
  return;
13441
13415
  }
13442
13416
  }
13443
13417
  };
13444
- }();
13445
- const sphereIntersectTriangle = function() {
13418
+ })();
13419
+ const sphereIntersectTriangle = (function() {
13446
13420
  const closestPointTemp = new Vector3();
13447
13421
  const projectedPointTemp = new Vector3();
13448
13422
  const planeTemp = new Plane();
13449
13423
  const lineTemp = new Line3$1();
13450
13424
  return function sphereIntersectTriangle2(sphere, triangle3) {
13451
13425
  const { radius, center: center2 } = sphere;
13452
- const { a, b: b2, c: c2 } = triangle3;
13426
+ const { a, b: b2, c } = triangle3;
13453
13427
  lineTemp.start = a;
13454
13428
  lineTemp.end = b2;
13455
13429
  const closestPoint1 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13456
13430
  if (closestPoint1.distanceTo(center2) <= radius) return true;
13457
13431
  lineTemp.start = a;
13458
- lineTemp.end = c2;
13432
+ lineTemp.end = c;
13459
13433
  const closestPoint2 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13460
13434
  if (closestPoint2.distanceTo(center2) <= radius) return true;
13461
13435
  lineTemp.start = b2;
13462
- lineTemp.end = c2;
13436
+ lineTemp.end = c;
13463
13437
  const closestPoint3 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13464
13438
  if (closestPoint3.distanceTo(center2) <= radius) return true;
13465
13439
  const plane = triangle3.getPlane(planeTemp);
@@ -13471,7 +13445,7 @@ const sphereIntersectTriangle = function() {
13471
13445
  }
13472
13446
  return false;
13473
13447
  };
13474
- }();
13448
+ })();
13475
13449
  const ZERO_EPSILON = 1e-15;
13476
13450
  function isNearZero(value) {
13477
13451
  return Math.abs(value) < ZERO_EPSILON;
@@ -13493,7 +13467,7 @@ class ExtendedTriangle extends Triangle {
13493
13467
  update() {
13494
13468
  const a = this.a;
13495
13469
  const b2 = this.b;
13496
- const c2 = this.c;
13470
+ const c = this.c;
13497
13471
  const points = this.points;
13498
13472
  const satAxes = this.satAxes;
13499
13473
  const satBounds = this.satBounds;
@@ -13507,18 +13481,18 @@ class ExtendedTriangle extends Triangle {
13507
13481
  sab1.setFromPoints(axis1, points);
13508
13482
  const axis2 = satAxes[2];
13509
13483
  const sab2 = satBounds[2];
13510
- axis2.subVectors(b2, c2);
13484
+ axis2.subVectors(b2, c);
13511
13485
  sab2.setFromPoints(axis2, points);
13512
13486
  const axis3 = satAxes[3];
13513
13487
  const sab3 = satBounds[3];
13514
- axis3.subVectors(c2, a);
13488
+ axis3.subVectors(c, a);
13515
13489
  sab3.setFromPoints(axis3, points);
13516
13490
  this.sphere.setFromPoints(this.points);
13517
13491
  this.plane.setFromNormalAndCoplanarPoint(axis0, a);
13518
13492
  this.needsUpdate = false;
13519
13493
  }
13520
13494
  }
13521
- ExtendedTriangle.prototype.closestPointToSegment = function() {
13495
+ ExtendedTriangle.prototype.closestPointToSegment = (function() {
13522
13496
  const point1 = new Vector3();
13523
13497
  const point2 = new Vector3();
13524
13498
  const edge = new Line3$1();
@@ -13555,8 +13529,8 @@ ExtendedTriangle.prototype.closestPointToSegment = function() {
13555
13529
  }
13556
13530
  return Math.sqrt(closestDistanceSq);
13557
13531
  };
13558
- }();
13559
- ExtendedTriangle.prototype.intersectsTriangle = function() {
13532
+ })();
13533
+ ExtendedTriangle.prototype.intersectsTriangle = (function() {
13560
13534
  const saTri2 = new ExtendedTriangle();
13561
13535
  const arr1 = new Array(3);
13562
13536
  const arr2 = new Array(3);
@@ -13719,15 +13693,15 @@ ExtendedTriangle.prototype.intersectsTriangle = function() {
13719
13693
  return true;
13720
13694
  }
13721
13695
  };
13722
- }();
13723
- ExtendedTriangle.prototype.distanceToPoint = function() {
13696
+ })();
13697
+ ExtendedTriangle.prototype.distanceToPoint = (function() {
13724
13698
  const target = new Vector3();
13725
13699
  return function distanceToPoint(point2) {
13726
13700
  this.closestPointToPoint(point2, target);
13727
13701
  return point2.distanceTo(target);
13728
13702
  };
13729
- }();
13730
- ExtendedTriangle.prototype.distanceToTriangle = function() {
13703
+ })();
13704
+ ExtendedTriangle.prototype.distanceToTriangle = (function() {
13731
13705
  const point2 = new Vector3();
13732
13706
  const point22 = new Vector3();
13733
13707
  const cornerFields = ["a", "b", "c"];
@@ -13782,7 +13756,7 @@ ExtendedTriangle.prototype.distanceToTriangle = function() {
13782
13756
  }
13783
13757
  return Math.sqrt(closestDistanceSq);
13784
13758
  };
13785
- }();
13759
+ })();
13786
13760
  class OrientedBox {
13787
13761
  constructor(min2, max2, matrix) {
13788
13762
  this.isOrientedBox = true;
@@ -13812,7 +13786,7 @@ class OrientedBox {
13812
13786
  this.needsUpdate = true;
13813
13787
  }
13814
13788
  }
13815
- OrientedBox.prototype.update = /* @__PURE__ */ function() {
13789
+ OrientedBox.prototype.update = /* @__PURE__ */ (function() {
13816
13790
  return function update2() {
13817
13791
  const matrix = this.matrix;
13818
13792
  const min2 = this.min;
@@ -13820,13 +13794,13 @@ OrientedBox.prototype.update = /* @__PURE__ */ function() {
13820
13794
  const points = this.points;
13821
13795
  for (let x2 = 0; x2 <= 1; x2++) {
13822
13796
  for (let y2 = 0; y2 <= 1; y2++) {
13823
- for (let z = 0; z <= 1; z++) {
13824
- const i = (1 << 0) * x2 | (1 << 1) * y2 | (1 << 2) * z;
13825
- const v2 = points[i];
13826
- v2.x = x2 ? max2.x : min2.x;
13827
- v2.y = y2 ? max2.y : min2.y;
13828
- v2.z = z ? max2.z : min2.z;
13829
- v2.applyMatrix4(matrix);
13797
+ for (let z2 = 0; z2 <= 1; z2++) {
13798
+ const i = (1 << 0) * x2 | (1 << 1) * y2 | (1 << 2) * z2;
13799
+ const v3 = points[i];
13800
+ v3.x = x2 ? max2.x : min2.x;
13801
+ v3.y = y2 ? max2.y : min2.y;
13802
+ v3.z = z2 ? max2.z : min2.z;
13803
+ v3.applyMatrix4(matrix);
13830
13804
  }
13831
13805
  }
13832
13806
  }
@@ -13848,8 +13822,8 @@ OrientedBox.prototype.update = /* @__PURE__ */ function() {
13848
13822
  this.invMatrix.copy(this.matrix).invert();
13849
13823
  this.needsUpdate = false;
13850
13824
  };
13851
- }();
13852
- OrientedBox.prototype.intersectsBox = function() {
13825
+ })();
13826
+ OrientedBox.prototype.intersectsBox = (function() {
13853
13827
  const aabbBounds = new SeparatingAxisBounds();
13854
13828
  return function intersectsBox(box) {
13855
13829
  if (this.needsUpdate) {
@@ -13877,8 +13851,8 @@ OrientedBox.prototype.intersectsBox = function() {
13877
13851
  }
13878
13852
  return true;
13879
13853
  };
13880
- }();
13881
- OrientedBox.prototype.intersectsTriangle = function() {
13854
+ })();
13855
+ OrientedBox.prototype.intersectsTriangle = (function() {
13882
13856
  const saTri = new ExtendedTriangle();
13883
13857
  const pointsArr = new Array(3);
13884
13858
  const cachedSatBounds = new SeparatingAxisBounds();
@@ -13927,8 +13901,8 @@ OrientedBox.prototype.intersectsTriangle = function() {
13927
13901
  }
13928
13902
  return true;
13929
13903
  };
13930
- }();
13931
- OrientedBox.prototype.closestPointToPoint = /* @__PURE__ */ function() {
13904
+ })();
13905
+ OrientedBox.prototype.closestPointToPoint = /* @__PURE__ */ (function() {
13932
13906
  return function closestPointToPoint2(point2, target1) {
13933
13907
  if (this.needsUpdate) {
13934
13908
  this.update();
@@ -13936,15 +13910,15 @@ OrientedBox.prototype.closestPointToPoint = /* @__PURE__ */ function() {
13936
13910
  target1.copy(point2).applyMatrix4(this.invMatrix).clamp(this.min, this.max).applyMatrix4(this.matrix);
13937
13911
  return target1;
13938
13912
  };
13939
- }();
13940
- OrientedBox.prototype.distanceToPoint = function() {
13913
+ })();
13914
+ OrientedBox.prototype.distanceToPoint = (function() {
13941
13915
  const target = new Vector3();
13942
13916
  return function distanceToPoint(point2) {
13943
13917
  this.closestPointToPoint(point2, target);
13944
13918
  return point2.distanceTo(target);
13945
13919
  };
13946
- }();
13947
- OrientedBox.prototype.distanceToBox = function() {
13920
+ })();
13921
+ OrientedBox.prototype.distanceToBox = (function() {
13948
13922
  const xyzFields = ["x", "y", "z"];
13949
13923
  const segments1 = new Array(12).fill().map(() => new Line3$1());
13950
13924
  const segments2 = new Array(12).fill().map(() => new Line3$1());
@@ -13970,12 +13944,12 @@ OrientedBox.prototype.distanceToBox = function() {
13970
13944
  const points = this.points;
13971
13945
  let closestDistanceSq = Infinity;
13972
13946
  for (let i = 0; i < 8; i++) {
13973
- const p = points[i];
13974
- point2.copy(p).clamp(min2, max2);
13975
- const dist = p.distanceToSquared(point2);
13947
+ const p2 = points[i];
13948
+ point2.copy(p2).clamp(min2, max2);
13949
+ const dist = p2.distanceToSquared(point2);
13976
13950
  if (dist < closestDistanceSq) {
13977
13951
  closestDistanceSq = dist;
13978
- if (target1) target1.copy(p);
13952
+ if (target1) target1.copy(p2);
13979
13953
  if (target2) target2.copy(point2);
13980
13954
  if (dist < threshold2) return Math.sqrt(dist);
13981
13955
  }
@@ -14010,10 +13984,10 @@ OrientedBox.prototype.distanceToBox = function() {
14010
13984
  }
14011
13985
  for (let x2 = 0; x2 <= 1; x2++) {
14012
13986
  for (let y2 = 0; y2 <= 1; y2++) {
14013
- for (let z = 0; z <= 1; z++) {
13987
+ for (let z2 = 0; z2 <= 1; z2++) {
14014
13988
  point2.x = x2 ? max2.x : min2.x;
14015
13989
  point2.y = y2 ? max2.y : min2.y;
14016
- point2.z = z ? max2.z : min2.z;
13990
+ point2.z = z2 ? max2.z : min2.z;
14017
13991
  this.closestPointToPoint(point2, point1);
14018
13992
  const dist = point2.distanceToSquared(point1);
14019
13993
  if (dist < closestDistanceSq) {
@@ -14041,7 +14015,7 @@ OrientedBox.prototype.distanceToBox = function() {
14041
14015
  }
14042
14016
  return Math.sqrt(closestDistanceSq);
14043
14017
  };
14044
- }();
14018
+ })();
14045
14019
  class PrimitivePool {
14046
14020
  constructor(getNewPrimitive) {
14047
14021
  this._getNewPrimitive = getNewPrimitive;
@@ -14275,28 +14249,28 @@ function checkIntersection(ray2, pA, pB, pC, point2, side) {
14275
14249
  point: point2.clone()
14276
14250
  };
14277
14251
  }
14278
- function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2, c2, side) {
14252
+ function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2, c, side) {
14279
14253
  _vA.fromBufferAttribute(position2, a);
14280
14254
  _vB.fromBufferAttribute(position2, b2);
14281
- _vC.fromBufferAttribute(position2, c2);
14255
+ _vC.fromBufferAttribute(position2, c);
14282
14256
  const intersection = checkIntersection(ray2, _vA, _vB, _vC, _intersectionPoint, side);
14283
14257
  if (intersection) {
14284
14258
  if (uv) {
14285
14259
  _uvA.fromBufferAttribute(uv, a);
14286
14260
  _uvB.fromBufferAttribute(uv, b2);
14287
- _uvC.fromBufferAttribute(uv, c2);
14261
+ _uvC.fromBufferAttribute(uv, c);
14288
14262
  intersection.uv = Triangle.getInterpolation(_intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2());
14289
14263
  }
14290
14264
  if (uv1) {
14291
14265
  _uvA.fromBufferAttribute(uv1, a);
14292
14266
  _uvB.fromBufferAttribute(uv1, b2);
14293
- _uvC.fromBufferAttribute(uv1, c2);
14267
+ _uvC.fromBufferAttribute(uv1, c);
14294
14268
  intersection.uv1 = Triangle.getInterpolation(_intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2());
14295
14269
  }
14296
14270
  if (normal) {
14297
14271
  _normalA.fromBufferAttribute(normal, a);
14298
14272
  _normalB.fromBufferAttribute(normal, b2);
14299
- _normalC.fromBufferAttribute(normal, c2);
14273
+ _normalC.fromBufferAttribute(normal, c);
14300
14274
  intersection.normal = Triangle.getInterpolation(_intersectionPoint, _vA, _vB, _vC, _normalA, _normalB, _normalC, new Vector3());
14301
14275
  if (intersection.normal.dot(ray2.direction) > 0) {
14302
14276
  intersection.normal.multiplyScalar(-1);
@@ -14305,7 +14279,7 @@ function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2
14305
14279
  const face = {
14306
14280
  a,
14307
14281
  b: b2,
14308
- c: c2,
14282
+ c,
14309
14283
  normal: new Vector3(),
14310
14284
  materialIndex: 0
14311
14285
  };
@@ -14319,15 +14293,15 @@ function intersectTri(geo, side, ray2, tri, intersections) {
14319
14293
  const triOffset = tri * 3;
14320
14294
  let a = triOffset + 0;
14321
14295
  let b2 = triOffset + 1;
14322
- let c2 = triOffset + 2;
14296
+ let c = triOffset + 2;
14323
14297
  const index = geo.index;
14324
14298
  if (geo.index) {
14325
14299
  a = index.getX(a);
14326
14300
  b2 = index.getX(b2);
14327
- c2 = index.getX(c2);
14301
+ c = index.getX(c);
14328
14302
  }
14329
14303
  const { position: position2, normal, uv, uv1 } = geo.attributes;
14330
- const intersection = checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2, c2, side);
14304
+ const intersection = checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2, c, side);
14331
14305
  if (intersection) {
14332
14306
  intersection.faceIndex = tri;
14333
14307
  if (intersections) intersections.push(intersection);
@@ -14381,7 +14355,7 @@ function iterateOverTriangles(offset, count, bvh, intersectsTriangleFunc, contai
14381
14355
  const { geometry } = bvh;
14382
14356
  const { index } = geometry;
14383
14357
  const pos = geometry.attributes.position;
14384
- for (let i = offset, l = count + offset; i < l; i++) {
14358
+ for (let i = offset, l2 = count + offset; i < l2; i++) {
14385
14359
  let tri;
14386
14360
  tri = i;
14387
14361
  setTriangle(triangle3, tri * 3, index, pos);
@@ -14402,7 +14376,7 @@ function refit(bvh, nodeIndices = null) {
14402
14376
  let buffer, uint32Array2, uint16Array2, float32Array2;
14403
14377
  let byteOffset = 0;
14404
14378
  const roots = bvh._roots;
14405
- for (let i = 0, l = roots.length; i < l; i++) {
14379
+ for (let i = 0, l2 = roots.length; i < l2; i++) {
14406
14380
  buffer = roots[i];
14407
14381
  uint32Array2 = new Uint32Array(buffer);
14408
14382
  uint16Array2 = new Uint16Array(buffer);
@@ -14422,17 +14396,17 @@ function refit(bvh, nodeIndices = null) {
14422
14396
  let maxx = -Infinity;
14423
14397
  let maxy = -Infinity;
14424
14398
  let maxz = -Infinity;
14425
- for (let i = 3 * offset, l = 3 * (offset + count); i < l; i++) {
14399
+ for (let i = 3 * offset, l2 = 3 * (offset + count); i < l2; i++) {
14426
14400
  let index = indexArr[i];
14427
14401
  const x2 = posAttr.getX(index);
14428
14402
  const y2 = posAttr.getY(index);
14429
- const z = posAttr.getZ(index);
14403
+ const z2 = posAttr.getZ(index);
14430
14404
  if (x2 < minx) minx = x2;
14431
14405
  if (x2 > maxx) maxx = x2;
14432
14406
  if (y2 < miny) miny = y2;
14433
14407
  if (y2 > maxy) maxy = y2;
14434
- if (z < minz) minz = z;
14435
- if (z > maxz) maxz = z;
14408
+ if (z2 < minz) minz = z2;
14409
+ if (z2 > maxz) maxz = z2;
14436
14410
  }
14437
14411
  if (float32Array2[node32Index + 0] !== minx || float32Array2[node32Index + 1] !== miny || float32Array2[node32Index + 2] !== minz || float32Array2[node32Index + 3] !== maxx || float32Array2[node32Index + 4] !== maxy || float32Array2[node32Index + 5] !== maxz) {
14438
14412
  float32Array2[node32Index + 0] = minx;
@@ -14556,7 +14530,7 @@ function iterateOverTriangles_indirect(offset, count, bvh, intersectsTriangleFun
14556
14530
  const { geometry } = bvh;
14557
14531
  const { index } = geometry;
14558
14532
  const pos = geometry.attributes.position;
14559
- for (let i = offset, l = count + offset; i < l; i++) {
14533
+ for (let i = offset, l2 = count + offset; i < l2; i++) {
14560
14534
  let tri;
14561
14535
  tri = bvh.resolveTriangleIndex(i);
14562
14536
  setTriangle(triangle3, tri * 3, index, pos);
@@ -14683,7 +14657,7 @@ function _intersectsGeometry$1(nodeIndex32, bvh, otherGeometry, geometryToBvh, c
14683
14657
  tri.b.applyMatrix4(geometryToBvh);
14684
14658
  tri.c.applyMatrix4(geometryToBvh);
14685
14659
  tri.needsUpdate = true;
14686
- for (let i = offset * 3, l = (count + offset) * 3; i < l; i += 3) {
14660
+ for (let i = offset * 3, l2 = (count + offset) * 3; i < l2; i += 3) {
14687
14661
  setTriangle(triangle2$1, i, thisIndex, thisPos);
14688
14662
  triangle2$1.needsUpdate = true;
14689
14663
  if (tri.intersectsTriangle(triangle2$1)) {
@@ -14695,13 +14669,13 @@ function _intersectsGeometry$1(nodeIndex32, bvh, otherGeometry, geometryToBvh, c
14695
14669
  });
14696
14670
  return res;
14697
14671
  } else {
14698
- for (let i = offset * 3, l = (count + offset) * 3; i < l; i += 3) {
14672
+ for (let i = offset * 3, l2 = (count + offset) * 3; i < l2; i += 3) {
14699
14673
  setTriangle(triangle$1, i, thisIndex, thisPos);
14700
14674
  triangle$1.a.applyMatrix4(invertedMat$1);
14701
14675
  triangle$1.b.applyMatrix4(invertedMat$1);
14702
14676
  triangle$1.c.applyMatrix4(invertedMat$1);
14703
14677
  triangle$1.needsUpdate = true;
14704
- for (let i2 = 0, l2 = index.count; i2 < l2; i2 += 3) {
14678
+ for (let i2 = 0, l22 = index.count; i2 < l22; i2 += 3) {
14705
14679
  setTriangle(triangle2$1, i2, index, pos);
14706
14680
  triangle2$1.needsUpdate = true;
14707
14681
  if (triangle$1.intersectsTriangle(triangle2$1)) {
@@ -14788,7 +14762,7 @@ function closestPointToGeometry(bvh, otherGeometry, geometryToBvh, target1 = {},
14788
14762
  triangle22.b.applyMatrix4(geometryToBvh);
14789
14763
  triangle22.c.applyMatrix4(geometryToBvh);
14790
14764
  triangle22.needsUpdate = true;
14791
- for (let i = offset, l = offset + count; i < l; i++) {
14765
+ for (let i = offset, l3 = offset + count; i < l3; i++) {
14792
14766
  setTriangle(triangle3, 3 * i, index, pos);
14793
14767
  triangle3.needsUpdate = true;
14794
14768
  const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
@@ -14816,7 +14790,7 @@ function closestPointToGeometry(bvh, otherGeometry, geometryToBvh, target1 = {},
14816
14790
  triangle22.b.applyMatrix4(geometryToBvh);
14817
14791
  triangle22.c.applyMatrix4(geometryToBvh);
14818
14792
  triangle22.needsUpdate = true;
14819
- for (let i = offset, l = offset + count; i < l; i++) {
14793
+ for (let i = offset, l3 = offset + count; i < l3; i++) {
14820
14794
  setTriangle(triangle3, 3 * i, index, pos);
14821
14795
  triangle3.needsUpdate = true;
14822
14796
  const dist = triangle3.distanceToTriangle(triangle22, tempTarget1, tempTarget2);
@@ -14869,7 +14843,7 @@ function refit_indirect(bvh, nodeIndices = null) {
14869
14843
  let buffer, uint32Array2, uint16Array2, float32Array2;
14870
14844
  let byteOffset = 0;
14871
14845
  const roots = bvh._roots;
14872
- for (let i = 0, l = roots.length; i < l; i++) {
14846
+ for (let i = 0, l2 = roots.length; i < l2; i++) {
14873
14847
  buffer = roots[i];
14874
14848
  uint32Array2 = new Uint32Array(buffer);
14875
14849
  uint16Array2 = new Uint16Array(buffer);
@@ -14889,20 +14863,20 @@ function refit_indirect(bvh, nodeIndices = null) {
14889
14863
  let maxx = -Infinity;
14890
14864
  let maxy = -Infinity;
14891
14865
  let maxz = -Infinity;
14892
- for (let i = offset, l = offset + count; i < l; i++) {
14866
+ for (let i = offset, l2 = offset + count; i < l2; i++) {
14893
14867
  const t = 3 * bvh.resolveTriangleIndex(i);
14894
14868
  for (let j = 0; j < 3; j++) {
14895
14869
  let index = t + j;
14896
14870
  index = indexArr ? indexArr[index] : index;
14897
14871
  const x2 = posAttr.getX(index);
14898
14872
  const y2 = posAttr.getY(index);
14899
- const z = posAttr.getZ(index);
14873
+ const z2 = posAttr.getZ(index);
14900
14874
  if (x2 < minx) minx = x2;
14901
14875
  if (x2 > maxx) maxx = x2;
14902
14876
  if (y2 < miny) miny = y2;
14903
14877
  if (y2 > maxy) maxy = y2;
14904
- if (z < minz) minz = z;
14905
- if (z > maxz) maxz = z;
14878
+ if (z2 < minz) minz = z2;
14879
+ if (z2 > maxz) maxz = z2;
14906
14880
  }
14907
14881
  }
14908
14882
  if (float32Array2[node32Index + 0] !== minx || float32Array2[node32Index + 1] !== miny || float32Array2[node32Index + 2] !== minz || float32Array2[node32Index + 3] !== maxx || float32Array2[node32Index + 4] !== maxy || float32Array2[node32Index + 5] !== maxz) {
@@ -15077,7 +15051,7 @@ function _intersectsGeometry(nodeIndex32, bvh, otherGeometry, geometryToBvh, cac
15077
15051
  tri.b.applyMatrix4(geometryToBvh);
15078
15052
  tri.c.applyMatrix4(geometryToBvh);
15079
15053
  tri.needsUpdate = true;
15080
- for (let i = offset, l = count + offset; i < l; i++) {
15054
+ for (let i = offset, l2 = count + offset; i < l2; i++) {
15081
15055
  setTriangle(triangle2, 3 * bvh.resolveTriangleIndex(i), thisIndex, thisPos);
15082
15056
  triangle2.needsUpdate = true;
15083
15057
  if (tri.intersectsTriangle(triangle2)) {
@@ -15089,14 +15063,14 @@ function _intersectsGeometry(nodeIndex32, bvh, otherGeometry, geometryToBvh, cac
15089
15063
  });
15090
15064
  return res;
15091
15065
  } else {
15092
- for (let i = offset, l = count + offset; i < l; i++) {
15066
+ for (let i = offset, l2 = count + offset; i < l2; i++) {
15093
15067
  const ti = bvh.resolveTriangleIndex(i);
15094
15068
  setTriangle(triangle, 3 * ti, thisIndex, thisPos);
15095
15069
  triangle.a.applyMatrix4(invertedMat);
15096
15070
  triangle.b.applyMatrix4(invertedMat);
15097
15071
  triangle.c.applyMatrix4(invertedMat);
15098
15072
  triangle.needsUpdate = true;
15099
- for (let i2 = 0, l2 = index.count; i2 < l2; i2 += 3) {
15073
+ for (let i2 = 0, l22 = index.count; i2 < l22; i2 += 3) {
15100
15074
  setTriangle(triangle2, i2, index, pos);
15101
15075
  triangle2.needsUpdate = true;
15102
15076
  if (triangle.intersectsTriangle(triangle2)) {
@@ -15184,7 +15158,7 @@ function closestPointToGeometry_indirect(bvh, otherGeometry, geometryToBvh, targ
15184
15158
  triangle22.b.applyMatrix4(geometryToBvh);
15185
15159
  triangle22.c.applyMatrix4(geometryToBvh);
15186
15160
  triangle22.needsUpdate = true;
15187
- for (let i = offset, l = offset + count; i < l; i++) {
15161
+ for (let i = offset, l3 = offset + count; i < l3; i++) {
15188
15162
  const ti = bvh.resolveTriangleIndex(i);
15189
15163
  setTriangle(triangle3, 3 * ti, index, pos);
15190
15164
  triangle3.needsUpdate = true;
@@ -15213,7 +15187,7 @@ function closestPointToGeometry_indirect(bvh, otherGeometry, geometryToBvh, targ
15213
15187
  triangle22.b.applyMatrix4(geometryToBvh);
15214
15188
  triangle22.c.applyMatrix4(geometryToBvh);
15215
15189
  triangle22.needsUpdate = true;
15216
- for (let i = offset, l = offset + count; i < l; i++) {
15190
+ for (let i = offset, l3 = offset + count; i < l3; i++) {
15217
15191
  const ti = bvh.resolveTriangleIndex(i);
15218
15192
  setTriangle(triangle3, 3 * ti, index, pos);
15219
15193
  triangle3.needsUpdate = true;
@@ -15657,7 +15631,7 @@ class MeshBVH {
15657
15631
  const groups = geometry.groups;
15658
15632
  const side = isMaterial ? materialOrSide.side : materialOrSide;
15659
15633
  const raycastFunc = this.indirect ? raycast_indirect : raycast;
15660
- for (let i = 0, l = roots.length; i < l; i++) {
15634
+ for (let i = 0, l2 = roots.length; i < l2; i++) {
15661
15635
  const materialSide = isArrayMaterial ? materialOrSide[groups[i].materialIndex].side : side;
15662
15636
  const startCount = intersects.length;
15663
15637
  raycastFunc(this, i, materialSide, ray2, intersects);
@@ -15679,7 +15653,7 @@ class MeshBVH {
15679
15653
  const groups = geometry.groups;
15680
15654
  const side = isMaterial ? materialOrSide.side : materialOrSide;
15681
15655
  const raycastFirstFunc = this.indirect ? raycastFirst_indirect : raycastFirst;
15682
- for (let i = 0, l = roots.length; i < l; i++) {
15656
+ for (let i = 0, l2 = roots.length; i < l2; i++) {
15683
15657
  const materialSide = isArrayMaterial ? materialOrSide[groups[i].materialIndex].side : side;
15684
15658
  const result = raycastFirstFunc(this, i, materialSide, ray2);
15685
15659
  if (result != null && (closestResult == null || result.distance < closestResult.distance)) {
@@ -15695,7 +15669,7 @@ class MeshBVH {
15695
15669
  let result = false;
15696
15670
  const roots = this._roots;
15697
15671
  const intersectsGeometryFunc = this.indirect ? intersectsGeometry_indirect : intersectsGeometry;
15698
- for (let i = 0, l = roots.length; i < l; i++) {
15672
+ for (let i = 0, l2 = roots.length; i < l2; i++) {
15699
15673
  result = intersectsGeometryFunc(this, i, otherGeometry, geomToMesh);
15700
15674
  if (result) {
15701
15675
  break;
@@ -15734,7 +15708,7 @@ class MeshBVH {
15734
15708
  let result = false;
15735
15709
  let byteOffset = 0;
15736
15710
  const roots = this._roots;
15737
- for (let i = 0, l = roots.length; i < l; i++) {
15711
+ for (let i = 0, l2 = roots.length; i < l2; i++) {
15738
15712
  const root2 = roots[i];
15739
15713
  result = shapecast(this, i, intersectsBounds, intersectsRange, boundsTraverseOrder, byteOffset);
15740
15714
  if (result) {
@@ -15879,7 +15853,7 @@ function acceleratedRaycast(raycaster, intersects) {
15879
15853
  }
15880
15854
  } else {
15881
15855
  const hits = bvh.raycast(ray, this.material);
15882
- for (let i = 0, l = hits.length; i < l; i++) {
15856
+ for (let i = 0, l2 = hits.length; i < l2; i++) {
15883
15857
  const hit = convertRaycastIntersect(hits[i], this, raycaster);
15884
15858
  if (hit) {
15885
15859
  intersects.push(hit);
@@ -15904,7 +15878,7 @@ class SVGMesh {
15904
15878
  const bvhOptions = {
15905
15879
  maxLeafTris: 1,
15906
15880
  strategy: CENTER,
15907
- ...options == null ? void 0 : options.bvhOptions
15881
+ ...options?.bvhOptions
15908
15882
  };
15909
15883
  this.bvhOptions = bvhOptions;
15910
15884
  this.bvh = new MeshBVH(this.threeMesh.geometry, bvhOptions);
@@ -16095,7 +16069,7 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16095
16069
  this._meshes = /* @__PURE__ */ new Map();
16096
16070
  this._rendering = false;
16097
16071
  this._viewerListeners = {
16098
- postRender: (_2) => {
16072
+ postRender: (_) => {
16099
16073
  if (this.autoRender) this.render();
16100
16074
  }
16101
16075
  };
@@ -16122,21 +16096,19 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16122
16096
  Vertex.MAX_LOOP = 1e4;
16123
16097
  }
16124
16098
  setDirty(...args) {
16125
- var _a, _b;
16126
16099
  if (args[0] === "enabled") {
16127
16100
  const last = args[2];
16128
16101
  const current = args[1];
16129
- if (last !== current && ((_a = this._meshes) == null ? void 0 : _a.size)) {
16102
+ if (last !== current && this._meshes?.size) {
16130
16103
  this._toggleMaterialRendering([...this._meshes.values()], !current);
16131
16104
  }
16132
16105
  if (this.svgNodeContainer) {
16133
16106
  this.svgNodeContainer.style.display = current ? "" : "none";
16134
16107
  }
16135
16108
  }
16136
- (_b = this._viewer) == null ? void 0 : _b.setDirty();
16109
+ this._viewer?.setDirty();
16137
16110
  }
16138
16111
  onAdded(viewer) {
16139
- var _a;
16140
16112
  super.onAdded(viewer);
16141
16113
  if (this.autoAddToContainer) {
16142
16114
  viewer.container.prepend(this.svgNodeContainer);
@@ -16149,7 +16121,7 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16149
16121
  this.svgNodeContainer.style.width = canvasStyles.width;
16150
16122
  this.svgNodeContainer.style.height = canvasStyles.height;
16151
16123
  } else {
16152
- (_a = this._viewer) == null ? void 0 : _a.console.warn("ThreeSVGRendererPlugin: canvas position should be absolute for proper rendering");
16124
+ this._viewer?.console.warn("ThreeSVGRendererPlugin: canvas position should be absolute for proper rendering");
16153
16125
  }
16154
16126
  viewer.renderManager.addEventListener("resize", this._onResize);
16155
16127
  }
@@ -16281,16 +16253,14 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16281
16253
  return "";
16282
16254
  }
16283
16255
  download() {
16284
- var _a;
16285
16256
  const svg2 = this.svgNodeContainer.innerHTML;
16286
16257
  const blob = new Blob([svg2], { type: "image/svg+xml" });
16287
- (_a = this._viewer) == null ? void 0 : _a.exportBlob(blob, "scene.svg");
16258
+ this._viewer?.exportBlob(blob, "scene.svg");
16288
16259
  }
16289
16260
  get svgNode() {
16290
- var _a;
16291
16261
  if (!this.svgNodeContainer.children.length) return void 0;
16292
16262
  if (this.svgNodeContainer.children.length > 1) {
16293
- (_a = this._viewer) == null ? void 0 : _a.console.warn("ThreeSVGRenderer: Multiple svg nodes in container, should not be possible");
16263
+ this._viewer?.console.warn("ThreeSVGRenderer: Multiple svg nodes in container, should not be possible");
16294
16264
  }
16295
16265
  return this.svgNodeContainer.children[0];
16296
16266
  }
@@ -16303,9 +16273,9 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16303
16273
  this.renderer.viewmap.options.creaseAngle.min = this.creaseAngle.x;
16304
16274
  this.renderer.viewmap.options.creaseAngle.max = this.creaseAngle.y;
16305
16275
  const passes = this.renderer.drawHandler.passes;
16306
- const fillPass = passes.find((p) => p instanceof FillPass);
16307
- const visibleContourPass = passes.find((p) => p instanceof VisibleChainPass);
16308
- const hiddenContourPass = passes.find((p) => p instanceof HiddenChainPass);
16276
+ const fillPass = passes.find((p2) => p2 instanceof FillPass);
16277
+ const visibleContourPass = passes.find((p2) => p2 instanceof VisibleChainPass);
16278
+ const hiddenContourPass = passes.find((p2) => p2 instanceof HiddenChainPass);
16309
16279
  if (fillPass) {
16310
16280
  fillPass.enabled = this.drawPolygons && (this.drawPolygonFills || this.drawPolygonStrokes || this.drawImageFills);
16311
16281
  fillPass.drawFills = this.drawPolygonFills;
@@ -16378,23 +16348,6 @@ __decorateClass([
16378
16348
  ThreeSVGRendererPlugin = __decorateClass([
16379
16349
  uiFolderContainer("SVG Renderer")
16380
16350
  ], ThreeSVGRendererPlugin);
16381
- /**
16382
- * @license
16383
- * three-svg-renderer
16384
- *
16385
- * GNU GENERAL PUBLIC LICENSE
16386
- * Version 3, 29 June 2007
16387
- *
16388
- * Copyright (c) 2022 Axel Antoine
16389
- */
16390
- /**
16391
- * @license
16392
- * three-mesh-halfedge
16393
- *
16394
- * MIT License
16395
- *
16396
- * Copyright (c) 2022 Axel Antoine
16397
- */
16398
16351
  export {
16399
16352
  BasicSVGRenderer,
16400
16353
  BasicSVGRendererPlugin,