@tscircuit/pcb-viewer 1.11.395 → 1.11.396

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2643,7 +2643,7 @@ var ToastContainer = () => {
2643
2643
  };
2644
2644
 
2645
2645
  // src/PCBViewer.tsx
2646
- import { useCallback as useCallback12, useEffect as useEffect19, useMemo as useMemo9, useRef as useRef16, useState as useState13 } from "react";
2646
+ import { useCallback as useCallback12, useEffect as useEffect19, useMemo as useMemo10, useRef as useRef16, useState as useState13 } from "react";
2647
2647
 
2648
2648
  // node_modules/react-use/esm/useMountedState.js
2649
2649
  import { useCallback as useCallback2, useEffect as useEffect2, useRef } from "react";
@@ -4447,7 +4447,7 @@ var animateTransform = ({
4447
4447
  };
4448
4448
 
4449
4449
  // src/components/CanvasElementsRenderer.tsx
4450
- import { useCallback as useCallback11, useEffect as useEffect18, useMemo as useMemo8, useRef as useRef15, useState as useState12 } from "react";
4450
+ import { useCallback as useCallback11, useEffect as useEffect18, useMemo as useMemo9, useRef as useRef15, useState as useState12 } from "react";
4451
4451
 
4452
4452
  // src/lib/Drawer.ts
4453
4453
  import colorParser from "color";
@@ -7578,7 +7578,7 @@ var DebugGraphicsOverlay = ({
7578
7578
  };
7579
7579
 
7580
7580
  // src/components/DimensionOverlay.tsx
7581
- import { useCallback as useCallback6, useEffect as useEffect7, useMemo as useMemo4, useRef as useRef5, useState as useState4 } from "react";
7581
+ import { useCallback as useCallback6, useEffect as useEffect7, useMemo as useMemo5, useRef as useRef5, useState as useState4 } from "react";
7582
7582
  import { applyToPoint as applyToPoint10, identity as identity3, inverse as inverse3 } from "transformation-matrix";
7583
7583
 
7584
7584
  // src/lib/util/get-primitive-bounding-box.ts
@@ -7953,10 +7953,55 @@ var getPrimitiveSnapPoints = (primitive) => {
7953
7953
  }
7954
7954
  };
7955
7955
 
7956
+ // src/components/DimensionSnapGuides.tsx
7957
+ import { memo, useMemo as useMemo4 } from "react";
7958
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
7959
+ var markerPath = ({ screenPoint: { x, y } }) => `M${x - 2.5},${y - 2.5}l5,5m0,-5l-5,5`;
7960
+ var DimensionSnapGuides = memo(function DimensionSnapGuides2({
7961
+ points,
7962
+ startId,
7963
+ endId
7964
+ }) {
7965
+ const { path, pointsById } = useMemo4(
7966
+ () => ({
7967
+ path: points.map(markerPath).join(""),
7968
+ pointsById: new Map(points.map((point) => [point.id, point]))
7969
+ }),
7970
+ [points]
7971
+ );
7972
+ const activePath = [.../* @__PURE__ */ new Set([startId, endId])].flatMap((id) => {
7973
+ const point = id === null ? void 0 : pointsById.get(id);
7974
+ return point ? [markerPath(point)] : [];
7975
+ }).join("");
7976
+ return /* @__PURE__ */ jsxs3(
7977
+ "svg",
7978
+ {
7979
+ "aria-hidden": "true",
7980
+ width: "100%",
7981
+ height: "100%",
7982
+ style: {
7983
+ position: "absolute",
7984
+ left: 0,
7985
+ top: 0,
7986
+ overflow: "visible",
7987
+ pointerEvents: "none",
7988
+ zIndex: zIndexMap.dimensionOverlay
7989
+ },
7990
+ fill: "none",
7991
+ strokeWidth: 1,
7992
+ children: [
7993
+ /* @__PURE__ */ jsx5("path", { d: path, stroke: "white" }),
7994
+ /* @__PURE__ */ jsx5("path", { d: activePath, stroke: "#66ccff" })
7995
+ ]
7996
+ }
7997
+ );
7998
+ });
7999
+
7956
8000
  // src/components/DimensionOverlay.tsx
7957
- import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
8001
+ import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
7958
8002
  var SNAP_THRESHOLD_PX = 16;
7959
- var SNAP_MARKER_SIZE = 5;
8003
+ var EMPTY_PRIMITIVES = [];
8004
+ var DEFAULT_TRANSFORM = identity3();
7960
8005
  var shouldExcludePrimitiveFromSnapping = (primitive) => {
7961
8006
  if (primitive.pcb_drawing_type === "text") return true;
7962
8007
  const element = primitive._element;
@@ -7977,11 +8022,11 @@ var DimensionOverlay = ({
7977
8022
  children,
7978
8023
  transform,
7979
8024
  focusOnHover = false,
7980
- primitives = [],
8025
+ primitives = EMPTY_PRIMITIVES,
7981
8026
  onBoundsSelected,
7982
8027
  cancelPanDrag
7983
8028
  }) => {
7984
- if (!transform) transform = identity3();
8029
+ if (!transform) transform = DEFAULT_TRANSFORM;
7985
8030
  const [dimensionToolVisible, setDimensionToolVisible] = useState4(false);
7986
8031
  const [dimensionToolStretching, setDimensionToolStretching] = useState4(false);
7987
8032
  const [measureToolArmed, setMeasureToolArmed] = useState4(false);
@@ -8013,7 +8058,7 @@ var DimensionOverlay = ({
8013
8058
  const containerRef = useRef5(null);
8014
8059
  const container = containerRef.current;
8015
8060
  const containerBounds = container?.getBoundingClientRect();
8016
- const elementBoundingBoxes = useMemo4(() => {
8061
+ const elementBoundingBoxes = useMemo5(() => {
8017
8062
  const boundingBoxes = /* @__PURE__ */ new Map();
8018
8063
  for (const primitive of primitives) {
8019
8064
  if (!primitive._element) continue;
@@ -8031,7 +8076,7 @@ var DimensionOverlay = ({
8031
8076
  }
8032
8077
  return boundingBoxes;
8033
8078
  }, [primitives]);
8034
- const primitiveSnappingPoints = useMemo4(() => {
8079
+ const primitiveSnappingPoints = useMemo5(() => {
8035
8080
  const snapPoints = [];
8036
8081
  for (const primitive of primitives) {
8037
8082
  if (!primitive._element) continue;
@@ -8048,7 +8093,7 @@ var DimensionOverlay = ({
8048
8093
  }
8049
8094
  return snapPoints;
8050
8095
  }, [primitives]);
8051
- const snappingPoints = useMemo4(() => {
8096
+ const snappingPoints = useMemo5(() => {
8052
8097
  const points = [];
8053
8098
  elementBoundingBoxes.forEach((bounds, element) => {
8054
8099
  if (!bounds) return;
@@ -8083,7 +8128,7 @@ var DimensionOverlay = ({
8083
8128
  });
8084
8129
  return points;
8085
8130
  }, [elementBoundingBoxes, primitiveSnappingPoints]);
8086
- const snappingPointsWithScreen = useMemo4(() => {
8131
+ const snappingPointsWithScreen = useMemo5(() => {
8087
8132
  return snappingPoints.map((snap, index) => ({
8088
8133
  ...snap,
8089
8134
  id: `${index}-${snap.anchor}`,
@@ -8235,7 +8280,7 @@ var DimensionOverlay = ({
8235
8280
  flipX: arrowScreenBounds.flipX,
8236
8281
  flipY: arrowScreenBounds.flipY
8237
8282
  });
8238
- return /* @__PURE__ */ jsxs3(
8283
+ return /* @__PURE__ */ jsxs4(
8239
8284
  "div",
8240
8285
  {
8241
8286
  ref: containerRef,
@@ -8320,8 +8365,8 @@ var DimensionOverlay = ({
8320
8365
  },
8321
8366
  children: [
8322
8367
  children,
8323
- boundsToolVisible && /* @__PURE__ */ jsxs3(Fragment, { children: [
8324
- /* @__PURE__ */ jsx5(
8368
+ boundsToolVisible && /* @__PURE__ */ jsxs4(Fragment, { children: [
8369
+ /* @__PURE__ */ jsx6(
8325
8370
  "svg",
8326
8371
  {
8327
8372
  style: {
@@ -8334,7 +8379,7 @@ var DimensionOverlay = ({
8334
8379
  },
8335
8380
  width: containerBounds.width,
8336
8381
  height: containerBounds.height,
8337
- children: /* @__PURE__ */ jsx5(
8382
+ children: /* @__PURE__ */ jsx6(
8338
8383
  "rect",
8339
8384
  {
8340
8385
  x: boundsScreenRect.left,
@@ -8349,7 +8394,7 @@ var DimensionOverlay = ({
8349
8394
  )
8350
8395
  }
8351
8396
  ),
8352
- /* @__PURE__ */ jsxs3(
8397
+ /* @__PURE__ */ jsxs4(
8353
8398
  "div",
8354
8399
  {
8355
8400
  style: {
@@ -8370,7 +8415,7 @@ var DimensionOverlay = ({
8370
8415
  ", minY:",
8371
8416
  " ",
8372
8417
  selectedBounds.minY.toFixed(2),
8373
- /* @__PURE__ */ jsx5("br", {}),
8418
+ /* @__PURE__ */ jsx6("br", {}),
8374
8419
  "maxX: ",
8375
8420
  selectedBounds.maxX.toFixed(2),
8376
8421
  ", maxY:",
@@ -8380,8 +8425,8 @@ var DimensionOverlay = ({
8380
8425
  }
8381
8426
  )
8382
8427
  ] }),
8383
- dimensionToolVisible && /* @__PURE__ */ jsxs3(Fragment, { children: [
8384
- diagonalLabel.show && /* @__PURE__ */ jsx5(
8428
+ dimensionToolVisible && /* @__PURE__ */ jsxs4(Fragment, { children: [
8429
+ diagonalLabel.show && /* @__PURE__ */ jsx6(
8385
8430
  "div",
8386
8431
  {
8387
8432
  style: {
@@ -8399,7 +8444,7 @@ var DimensionOverlay = ({
8399
8444
  children: diagonalLabel.distance.toFixed(2)
8400
8445
  }
8401
8446
  ),
8402
- /* @__PURE__ */ jsx5(
8447
+ /* @__PURE__ */ jsx6(
8403
8448
  "div",
8404
8449
  {
8405
8450
  style: {
@@ -8419,7 +8464,7 @@ var DimensionOverlay = ({
8419
8464
  children: Math.abs(dStart.x - dEnd.x).toFixed(2)
8420
8465
  }
8421
8466
  ),
8422
- /* @__PURE__ */ jsx5(
8467
+ /* @__PURE__ */ jsx6(
8423
8468
  "div",
8424
8469
  {
8425
8470
  style: {
@@ -8437,7 +8482,7 @@ var DimensionOverlay = ({
8437
8482
  fontFamily: "sans-serif",
8438
8483
  zIndex: zIndexMap.dimensionOverlay
8439
8484
  },
8440
- children: /* @__PURE__ */ jsx5(
8485
+ children: /* @__PURE__ */ jsx6(
8441
8486
  "div",
8442
8487
  {
8443
8488
  style: {
@@ -8449,7 +8494,7 @@ var DimensionOverlay = ({
8449
8494
  )
8450
8495
  }
8451
8496
  ),
8452
- /* @__PURE__ */ jsxs3(
8497
+ /* @__PURE__ */ jsxs4(
8453
8498
  "svg",
8454
8499
  {
8455
8500
  style: {
@@ -8463,7 +8508,7 @@ var DimensionOverlay = ({
8463
8508
  width: containerBounds.width,
8464
8509
  height: containerBounds.height,
8465
8510
  children: [
8466
- /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsx5(
8511
+ /* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6(
8467
8512
  "marker",
8468
8513
  {
8469
8514
  id: "head",
@@ -8472,10 +8517,10 @@ var DimensionOverlay = ({
8472
8517
  markerHeight: "4",
8473
8518
  refX: "2",
8474
8519
  refY: "2",
8475
- children: /* @__PURE__ */ jsx5("path", { d: "M0,0 V4 L2,2 Z", fill: "red" })
8520
+ children: /* @__PURE__ */ jsx6("path", { d: "M0,0 V4 L2,2 Z", fill: "red" })
8476
8521
  }
8477
8522
  ) }),
8478
- /* @__PURE__ */ jsx5(
8523
+ /* @__PURE__ */ jsx6(
8479
8524
  "line",
8480
8525
  {
8481
8526
  x1: screenDStart.x,
@@ -8488,7 +8533,7 @@ var DimensionOverlay = ({
8488
8533
  stroke: "red"
8489
8534
  }
8490
8535
  ),
8491
- /* @__PURE__ */ jsx5(
8536
+ /* @__PURE__ */ jsx6(
8492
8537
  "line",
8493
8538
  {
8494
8539
  x1: screenDStart.x,
@@ -8501,7 +8546,7 @@ var DimensionOverlay = ({
8501
8546
  stroke: "red"
8502
8547
  }
8503
8548
  ),
8504
- /* @__PURE__ */ jsx5(
8549
+ /* @__PURE__ */ jsx6(
8505
8550
  "line",
8506
8551
  {
8507
8552
  x1: screenDEnd.x,
@@ -8517,50 +8562,15 @@ var DimensionOverlay = ({
8517
8562
  ]
8518
8563
  }
8519
8564
  ),
8520
- dimensionToolStretching && snappingPointsWithScreen.map((snap) => {
8521
- const isActive = snap.id === activeSnapIds.start || snap.id === activeSnapIds.end;
8522
- const half = SNAP_MARKER_SIZE / 2;
8523
- return /* @__PURE__ */ jsxs3(
8524
- "svg",
8525
- {
8526
- width: SNAP_MARKER_SIZE,
8527
- height: SNAP_MARKER_SIZE,
8528
- style: {
8529
- position: "absolute",
8530
- left: snap.screenPoint.x - half,
8531
- top: snap.screenPoint.y - half,
8532
- pointerEvents: "none",
8533
- zIndex: zIndexMap.dimensionOverlay
8534
- },
8535
- children: [
8536
- /* @__PURE__ */ jsx5(
8537
- "line",
8538
- {
8539
- x1: 0,
8540
- y1: 0,
8541
- x2: SNAP_MARKER_SIZE,
8542
- y2: SNAP_MARKER_SIZE,
8543
- stroke: isActive ? "#66ccff" : "white",
8544
- strokeWidth: 1
8545
- }
8546
- ),
8547
- /* @__PURE__ */ jsx5(
8548
- "line",
8549
- {
8550
- x1: SNAP_MARKER_SIZE,
8551
- y1: 0,
8552
- x2: 0,
8553
- y2: SNAP_MARKER_SIZE,
8554
- stroke: isActive ? "#66ccff" : "white",
8555
- strokeWidth: 1
8556
- }
8557
- )
8558
- ]
8559
- },
8560
- snap.id
8561
- );
8562
- }),
8563
- /* @__PURE__ */ jsxs3(
8565
+ dimensionToolStretching && /* @__PURE__ */ jsx6(
8566
+ DimensionSnapGuides,
8567
+ {
8568
+ points: snappingPointsWithScreen,
8569
+ startId: activeSnapIds.start,
8570
+ endId: activeSnapIds.end
8571
+ }
8572
+ ),
8573
+ /* @__PURE__ */ jsxs4(
8564
8574
  "div",
8565
8575
  {
8566
8576
  style: {
@@ -8578,13 +8588,13 @@ var DimensionOverlay = ({
8578
8588
  ",",
8579
8589
  dStart.y.toFixed(2),
8580
8590
  ")",
8581
- /* @__PURE__ */ jsx5("br", {}),
8591
+ /* @__PURE__ */ jsx6("br", {}),
8582
8592
  "(",
8583
8593
  dEnd.x.toFixed(2),
8584
8594
  ",",
8585
8595
  dEnd.y.toFixed(2),
8586
8596
  ")",
8587
- /* @__PURE__ */ jsx5("br", {}),
8597
+ /* @__PURE__ */ jsx6("br", {}),
8588
8598
  "dist:",
8589
8599
  " ",
8590
8600
  Math.sqrt(
@@ -8602,7 +8612,7 @@ var DimensionOverlay = ({
8602
8612
  // src/components/EditPlacementOverlay.tsx
8603
8613
  import { useRef as useRef6, useState as useState5 } from "react";
8604
8614
  import { applyToPoint as applyToPoint11, identity as identity4, inverse as inverse4 } from "transformation-matrix";
8605
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
8615
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
8606
8616
  var isInsideOf = (pcb_component, point, padding = 0) => {
8607
8617
  const halfWidth = pcb_component.width / 2;
8608
8618
  const halfHeight = pcb_component.height / 2;
@@ -8632,7 +8642,7 @@ var EditPlacementOverlay = ({
8632
8642
  const in_move_footprint_mode = useGlobalStore((s) => s.in_move_footprint_mode);
8633
8643
  const setIsMovingComponent = useGlobalStore((s) => s.setIsMovingComponent);
8634
8644
  const disabled = disabledProp || !in_move_footprint_mode;
8635
- return /* @__PURE__ */ jsxs4(
8645
+ return /* @__PURE__ */ jsxs5(
8636
8646
  "div",
8637
8647
  {
8638
8648
  ref: containerRef,
@@ -8718,7 +8728,7 @@ var EditPlacementOverlay = ({
8718
8728
  !disabled && soup.filter((e) => e.type === "pcb_component").map((e) => {
8719
8729
  if (!e?.center) return null;
8720
8730
  const projectedCenter = applyToPoint11(transform, e.center);
8721
- return /* @__PURE__ */ jsx6(
8731
+ return /* @__PURE__ */ jsx7(
8722
8732
  "div",
8723
8733
  {
8724
8734
  style: {
@@ -8781,10 +8791,10 @@ var getPopupPosition = (errorCenter, containerRef) => {
8781
8791
  };
8782
8792
 
8783
8793
  // src/components/FocusMarkerSVG.tsx
8784
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
8794
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
8785
8795
  var FocusMarkerSVG = ({
8786
8796
  center
8787
- }) => /* @__PURE__ */ jsxs5(
8797
+ }) => /* @__PURE__ */ jsxs6(
8788
8798
  "svg",
8789
8799
  {
8790
8800
  style: {
@@ -8798,7 +8808,7 @@ var FocusMarkerSVG = ({
8798
8808
  width: "100%",
8799
8809
  height: "100%",
8800
8810
  children: [
8801
- /* @__PURE__ */ jsx7(
8811
+ /* @__PURE__ */ jsx8(
8802
8812
  "circle",
8803
8813
  {
8804
8814
  cx: center.x,
@@ -8810,8 +8820,8 @@ var FocusMarkerSVG = ({
8810
8820
  opacity: 0.95
8811
8821
  }
8812
8822
  ),
8813
- /* @__PURE__ */ jsx7("circle", { cx: center.x, cy: center.y, r: 4.5, fill: "#ff6b6b", opacity: 0.95 }),
8814
- /* @__PURE__ */ jsx7(
8823
+ /* @__PURE__ */ jsx8("circle", { cx: center.x, cy: center.y, r: 4.5, fill: "#ff6b6b", opacity: 0.95 }),
8824
+ /* @__PURE__ */ jsx8(
8815
8825
  "line",
8816
8826
  {
8817
8827
  x1: center.x - 18,
@@ -8822,7 +8832,7 @@ var FocusMarkerSVG = ({
8822
8832
  strokeWidth: 2
8823
8833
  }
8824
8834
  ),
8825
- /* @__PURE__ */ jsx7(
8835
+ /* @__PURE__ */ jsx8(
8826
8836
  "line",
8827
8837
  {
8828
8838
  x1: center.x + 8,
@@ -8833,7 +8843,7 @@ var FocusMarkerSVG = ({
8833
8843
  strokeWidth: 2
8834
8844
  }
8835
8845
  ),
8836
- /* @__PURE__ */ jsx7(
8846
+ /* @__PURE__ */ jsx8(
8837
8847
  "line",
8838
8848
  {
8839
8849
  x1: center.x,
@@ -8844,7 +8854,7 @@ var FocusMarkerSVG = ({
8844
8854
  strokeWidth: 2
8845
8855
  }
8846
8856
  ),
8847
- /* @__PURE__ */ jsx7(
8857
+ /* @__PURE__ */ jsx8(
8848
8858
  "line",
8849
8859
  {
8850
8860
  x1: center.x,
@@ -8860,11 +8870,11 @@ var FocusMarkerSVG = ({
8860
8870
  );
8861
8871
 
8862
8872
  // src/components/ErrorOverlay.tsx
8863
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
8873
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
8864
8874
  var ErrorMarkerSVG = ({
8865
8875
  errorCenter,
8866
8876
  isHighlighted = false
8867
- }) => /* @__PURE__ */ jsx8(
8877
+ }) => /* @__PURE__ */ jsx9(
8868
8878
  "svg",
8869
8879
  {
8870
8880
  style: {
@@ -8877,7 +8887,7 @@ var ErrorMarkerSVG = ({
8877
8887
  },
8878
8888
  width: "100%",
8879
8889
  height: "100%",
8880
- children: /* @__PURE__ */ jsx8(
8890
+ children: /* @__PURE__ */ jsx9(
8881
8891
  "rect",
8882
8892
  {
8883
8893
  x: errorCenter.x - 7,
@@ -8921,7 +8931,7 @@ var ErrorOverlay = ({
8921
8931
  );
8922
8932
  const activeErrorId = focusedErrorId ?? hoveredErrorId;
8923
8933
  if (!elements) {
8924
- return /* @__PURE__ */ jsx8("div", { style: { position: "relative" }, ref: containerRef, children });
8934
+ return /* @__PURE__ */ jsx9("div", { style: { position: "relative" }, ref: containerRef, children });
8925
8935
  }
8926
8936
  const traceErrors = elements.filter(
8927
8937
  (el) => el.type === "pcb_trace_error" && !el.message?.includes("Multiple components found with name")
@@ -8954,7 +8964,7 @@ var ErrorOverlay = ({
8954
8964
  focusedErrorElement
8955
8965
  );
8956
8966
  }
8957
- return /* @__PURE__ */ jsxs6("div", { style: { position: "relative" }, ref: containerRef, children: [
8967
+ return /* @__PURE__ */ jsxs7("div", { style: { position: "relative" }, ref: containerRef, children: [
8958
8968
  children,
8959
8969
  traceErrors.map((el, index) => {
8960
8970
  const errorId = getErrorId(el, index);
@@ -8963,15 +8973,15 @@ var ErrorOverlay = ({
8963
8973
  const errorCenter = getScreenErrorCenter(el);
8964
8974
  if (!errorCenter) return null;
8965
8975
  const popupPosition = getPopupPosition(errorCenter, containerRef);
8966
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
8967
- /* @__PURE__ */ jsx8(
8976
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
8977
+ /* @__PURE__ */ jsx9(
8968
8978
  ErrorMarkerSVG,
8969
8979
  {
8970
8980
  errorCenter,
8971
8981
  isHighlighted
8972
8982
  }
8973
8983
  ),
8974
- /* @__PURE__ */ jsx8(
8984
+ /* @__PURE__ */ jsx9(
8975
8985
  "div",
8976
8986
  {
8977
8987
  style: {
@@ -9006,7 +9016,7 @@ var ErrorOverlay = ({
9006
9016
  }
9007
9017
  }
9008
9018
  ),
9009
- /* @__PURE__ */ jsx8(
9019
+ /* @__PURE__ */ jsx9(
9010
9020
  "div",
9011
9021
  {
9012
9022
  style: {
@@ -9024,7 +9034,7 @@ var ErrorOverlay = ({
9024
9034
  pointerEvents: "none",
9025
9035
  transform: popupPosition.transform
9026
9036
  },
9027
- children: /* @__PURE__ */ jsx8(
9037
+ children: /* @__PURE__ */ jsx9(
9028
9038
  "div",
9029
9039
  {
9030
9040
  className: `error-message ${errorMessageStyles}`,
@@ -9049,15 +9059,15 @@ var ErrorOverlay = ({
9049
9059
  { x: errorCenter.x, y: errorCenter.y },
9050
9060
  containerRef
9051
9061
  );
9052
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
9053
- /* @__PURE__ */ jsx8(
9062
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
9063
+ /* @__PURE__ */ jsx9(
9054
9064
  ErrorMarkerSVG,
9055
9065
  {
9056
9066
  errorCenter,
9057
9067
  isHighlighted
9058
9068
  }
9059
9069
  ),
9060
- /* @__PURE__ */ jsx8(
9070
+ /* @__PURE__ */ jsx9(
9061
9071
  "div",
9062
9072
  {
9063
9073
  style: {
@@ -9092,7 +9102,7 @@ var ErrorOverlay = ({
9092
9102
  }
9093
9103
  }
9094
9104
  ),
9095
- /* @__PURE__ */ jsx8(
9105
+ /* @__PURE__ */ jsx9(
9096
9106
  "div",
9097
9107
  {
9098
9108
  style: {
@@ -9110,7 +9120,7 @@ var ErrorOverlay = ({
9110
9120
  pointerEvents: "none",
9111
9121
  transform: popupPosition.transform
9112
9122
  },
9113
- children: /* @__PURE__ */ jsx8(
9123
+ children: /* @__PURE__ */ jsx9(
9114
9124
  "div",
9115
9125
  {
9116
9126
  className: `error-message ${errorMessageStyles}`,
@@ -9159,8 +9169,8 @@ var ErrorOverlay = ({
9159
9169
  Math.min(maxRadius, baseRadius * scale7)
9160
9170
  );
9161
9171
  const popupPosition = getPopupPosition(screenCenter, containerRef);
9162
- return /* @__PURE__ */ jsxs6(Fragment2, { children: [
9163
- /* @__PURE__ */ jsx8(
9172
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
9173
+ /* @__PURE__ */ jsx9(
9164
9174
  "svg",
9165
9175
  {
9166
9176
  style: {
@@ -9173,13 +9183,13 @@ var ErrorOverlay = ({
9173
9183
  },
9174
9184
  width: "100%",
9175
9185
  height: "100%",
9176
- children: isHighlighted ? /* @__PURE__ */ jsx8(
9186
+ children: isHighlighted ? /* @__PURE__ */ jsx9(
9177
9187
  "polygon",
9178
9188
  {
9179
9189
  points: `${screenCenter.x},${screenCenter.y - scaledRadius * 1.25} ${screenCenter.x + scaledRadius},${screenCenter.y} ${screenCenter.x},${screenCenter.y + scaledRadius * 1.25} ${screenCenter.x - scaledRadius},${screenCenter.y}`,
9180
9190
  fill: "#ff4444"
9181
9191
  }
9182
- ) : /* @__PURE__ */ jsx8(
9192
+ ) : /* @__PURE__ */ jsx9(
9183
9193
  "circle",
9184
9194
  {
9185
9195
  cx: screenCenter.x,
@@ -9193,7 +9203,7 @@ var ErrorOverlay = ({
9193
9203
  )
9194
9204
  }
9195
9205
  ),
9196
- /* @__PURE__ */ jsx8(
9206
+ /* @__PURE__ */ jsx9(
9197
9207
  "div",
9198
9208
  {
9199
9209
  style: {
@@ -9228,7 +9238,7 @@ var ErrorOverlay = ({
9228
9238
  }
9229
9239
  }
9230
9240
  ),
9231
- /* @__PURE__ */ jsx8(
9241
+ /* @__PURE__ */ jsx9(
9232
9242
  "div",
9233
9243
  {
9234
9244
  style: {
@@ -9246,7 +9256,7 @@ var ErrorOverlay = ({
9246
9256
  pointerEvents: "none",
9247
9257
  transform: popupPosition.transform
9248
9258
  },
9249
- children: /* @__PURE__ */ jsx8(
9259
+ children: /* @__PURE__ */ jsx9(
9250
9260
  "div",
9251
9261
  {
9252
9262
  className: `error-message ${errorMessageStyles}`,
@@ -9262,7 +9272,7 @@ var ErrorOverlay = ({
9262
9272
  ] }, `${errorId}_${compIndex}`);
9263
9273
  });
9264
9274
  }),
9265
- focusScreenCenter && /* @__PURE__ */ jsx8(FocusMarkerSVG, { center: focusScreenCenter })
9275
+ focusScreenCenter && /* @__PURE__ */ jsx9(FocusMarkerSVG, { center: focusScreenCenter })
9266
9276
  ] });
9267
9277
  };
9268
9278
 
@@ -9277,7 +9287,7 @@ function ifSetsMatchExactly(set1, set2) {
9277
9287
  }
9278
9288
 
9279
9289
  // src/components/MouseElementTracker.tsx
9280
- import { useEffect as useEffect10, useMemo as useMemo5, useState as useState7 } from "react";
9290
+ import { useEffect as useEffect10, useMemo as useMemo6, useState as useState7 } from "react";
9281
9291
  import { applyToPoint as applyToPoint15, inverse as inverse5 } from "transformation-matrix";
9282
9292
 
9283
9293
  // src/components/AnchorOffsetOverlay/common/guards.ts
@@ -9313,7 +9323,7 @@ var COLORS = {
9313
9323
  };
9314
9324
 
9315
9325
  // src/components/AnchorOffsetOverlay/AnchorOffsetOverlay.tsx
9316
- import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
9326
+ import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
9317
9327
  var AnchorOffsetOverlay = ({
9318
9328
  targets,
9319
9329
  transform,
@@ -9336,7 +9346,7 @@ var AnchorOffsetOverlay = ({
9336
9346
  anchorScreens.set(target.anchor_id, screenPoint);
9337
9347
  }
9338
9348
  });
9339
- return /* @__PURE__ */ jsx9(
9349
+ return /* @__PURE__ */ jsx10(
9340
9350
  "div",
9341
9351
  {
9342
9352
  style: {
@@ -9349,7 +9359,7 @@ var AnchorOffsetOverlay = ({
9349
9359
  pointerEvents: "none",
9350
9360
  zIndex: zIndexMap.dimensionOverlay
9351
9361
  },
9352
- children: /* @__PURE__ */ jsxs7(
9362
+ children: /* @__PURE__ */ jsxs8(
9353
9363
  "svg",
9354
9364
  {
9355
9365
  style: {
@@ -9379,8 +9389,8 @@ var AnchorOffsetOverlay = ({
9379
9389
  const shouldShowYLabel = yLineLength > VISUAL_CONFIG.MIN_LINE_LENGTH_FOR_LABEL;
9380
9390
  const xLabelText = `${target.display_offset_x ?? offsetX.toFixed(2)}mm`;
9381
9391
  const yLabelText = `${target.display_offset_y ?? offsetY.toFixed(2)}mm`;
9382
- return /* @__PURE__ */ jsxs7("g", { children: [
9383
- /* @__PURE__ */ jsx9(
9392
+ return /* @__PURE__ */ jsxs8("g", { children: [
9393
+ /* @__PURE__ */ jsx10(
9384
9394
  "line",
9385
9395
  {
9386
9396
  x1: anchorMarkerScreen.x,
@@ -9392,7 +9402,7 @@ var AnchorOffsetOverlay = ({
9392
9402
  strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
9393
9403
  }
9394
9404
  ),
9395
- /* @__PURE__ */ jsx9(
9405
+ /* @__PURE__ */ jsx10(
9396
9406
  "line",
9397
9407
  {
9398
9408
  x1: targetScreen.x,
@@ -9404,7 +9414,7 @@ var AnchorOffsetOverlay = ({
9404
9414
  strokeDasharray: VISUAL_CONFIG.LINE_DASH_PATTERN
9405
9415
  }
9406
9416
  ),
9407
- target.type === "component" || target.type === "board" ? /* @__PURE__ */ jsx9(
9417
+ target.type === "component" || target.type === "board" ? /* @__PURE__ */ jsx10(
9408
9418
  "circle",
9409
9419
  {
9410
9420
  cx: targetScreen.x,
@@ -9416,8 +9426,8 @@ var AnchorOffsetOverlay = ({
9416
9426
  }
9417
9427
  ) : (
9418
9428
  // assumes "group"
9419
- /* @__PURE__ */ jsxs7(Fragment3, { children: [
9420
- /* @__PURE__ */ jsx9(
9429
+ /* @__PURE__ */ jsxs8(Fragment3, { children: [
9430
+ /* @__PURE__ */ jsx10(
9421
9431
  "line",
9422
9432
  {
9423
9433
  x1: targetScreen.x - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
@@ -9428,7 +9438,7 @@ var AnchorOffsetOverlay = ({
9428
9438
  strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
9429
9439
  }
9430
9440
  ),
9431
- /* @__PURE__ */ jsx9(
9441
+ /* @__PURE__ */ jsx10(
9432
9442
  "line",
9433
9443
  {
9434
9444
  x1: targetScreen.x,
@@ -9441,7 +9451,7 @@ var AnchorOffsetOverlay = ({
9441
9451
  )
9442
9452
  ] })
9443
9453
  ),
9444
- shouldShowXLabel && /* @__PURE__ */ jsx9(
9454
+ shouldShowXLabel && /* @__PURE__ */ jsx10(
9445
9455
  "foreignObject",
9446
9456
  {
9447
9457
  x: Math.min(anchorMarkerScreen.x, targetScreen.x),
@@ -9449,10 +9459,10 @@ var AnchorOffsetOverlay = ({
9449
9459
  width: Math.abs(targetScreen.x - anchorMarkerScreen.x),
9450
9460
  height: 20,
9451
9461
  style: { overflow: "visible" },
9452
- children: /* @__PURE__ */ jsx9("div", { style: { ...labelStyle, textAlign: "center" }, children: xLabelText })
9462
+ children: /* @__PURE__ */ jsx10("div", { style: { ...labelStyle, textAlign: "center" }, children: xLabelText })
9453
9463
  }
9454
9464
  ),
9455
- shouldShowYLabel && /* @__PURE__ */ jsx9(
9465
+ shouldShowYLabel && /* @__PURE__ */ jsx10(
9456
9466
  "foreignObject",
9457
9467
  {
9458
9468
  x: targetScreen.x + yLabelOffset,
@@ -9460,7 +9470,7 @@ var AnchorOffsetOverlay = ({
9460
9470
  width: VISUAL_CONFIG.Y_LABEL_MIN_WIDTH,
9461
9471
  height: Math.abs(targetScreen.y - anchorMarkerScreen.y),
9462
9472
  style: { overflow: "visible" },
9463
- children: /* @__PURE__ */ jsx9(
9473
+ children: /* @__PURE__ */ jsx10(
9464
9474
  "div",
9465
9475
  {
9466
9476
  style: {
@@ -9479,8 +9489,8 @@ var AnchorOffsetOverlay = ({
9479
9489
  )
9480
9490
  ] }, target.id);
9481
9491
  }),
9482
- Array.from(anchorScreens.entries()).map(([anchorId, anchorScreen]) => /* @__PURE__ */ jsxs7("g", { children: [
9483
- /* @__PURE__ */ jsx9(
9492
+ Array.from(anchorScreens.entries()).map(([anchorId, anchorScreen]) => /* @__PURE__ */ jsxs8("g", { children: [
9493
+ /* @__PURE__ */ jsx10(
9484
9494
  "line",
9485
9495
  {
9486
9496
  x1: anchorScreen.x - VISUAL_CONFIG.ANCHOR_MARKER_SIZE,
@@ -9491,7 +9501,7 @@ var AnchorOffsetOverlay = ({
9491
9501
  strokeWidth: VISUAL_CONFIG.ANCHOR_MARKER_STROKE_WIDTH
9492
9502
  }
9493
9503
  ),
9494
- /* @__PURE__ */ jsx9(
9504
+ /* @__PURE__ */ jsx10(
9495
9505
  "line",
9496
9506
  {
9497
9507
  x1: anchorScreen.x,
@@ -9511,7 +9521,7 @@ var AnchorOffsetOverlay = ({
9511
9521
  };
9512
9522
 
9513
9523
  // src/components/AnchorOffsetOverlay/BoardAnchorOffsetOverlay.tsx
9514
- import { jsx as jsx10 } from "react/jsx-runtime";
9524
+ import { jsx as jsx11 } from "react/jsx-runtime";
9515
9525
  var BoardAnchorOffsetOverlay = ({
9516
9526
  elements,
9517
9527
  highlightedPrimitives,
@@ -9598,7 +9608,7 @@ var BoardAnchorOffsetOverlay = ({
9598
9608
  display_offset_y: target.group.display_offset_y
9599
9609
  };
9600
9610
  }).filter((t) => Boolean(t));
9601
- return /* @__PURE__ */ jsx10(
9611
+ return /* @__PURE__ */ jsx11(
9602
9612
  AnchorOffsetOverlay,
9603
9613
  {
9604
9614
  targets: sharedTargets,
@@ -9610,7 +9620,7 @@ var BoardAnchorOffsetOverlay = ({
9610
9620
  };
9611
9621
 
9612
9622
  // src/components/AnchorOffsetOverlay/GroupAnchorOffsetOverlay.tsx
9613
- import { jsx as jsx11 } from "react/jsx-runtime";
9623
+ import { jsx as jsx12 } from "react/jsx-runtime";
9614
9624
  var GroupAnchorOffsetOverlay = ({
9615
9625
  elements,
9616
9626
  highlightedPrimitives,
@@ -9726,7 +9736,7 @@ var GroupAnchorOffsetOverlay = ({
9726
9736
  display_offset_y: target.group.display_offset_y
9727
9737
  };
9728
9738
  }).filter((t) => Boolean(t));
9729
- return /* @__PURE__ */ jsx11(
9739
+ return /* @__PURE__ */ jsx12(
9730
9740
  AnchorOffsetOverlay,
9731
9741
  {
9732
9742
  targets: sharedTargets,
@@ -9739,7 +9749,7 @@ var GroupAnchorOffsetOverlay = ({
9739
9749
 
9740
9750
  // src/components/AnchorOffsetOverlay/ComponentBoundingBoxOverlay.tsx
9741
9751
  import { applyToPoint as applyToPoint14 } from "transformation-matrix";
9742
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
9752
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
9743
9753
  var calculateComponentBoundingBox = (component, elements) => {
9744
9754
  const componentId = component.pcb_component_id;
9745
9755
  const padsAndHoles = elements.filter(
@@ -9782,7 +9792,7 @@ var ComponentBoundingBoxOverlay = ({
9782
9792
  renderData.push({ component, bbox, group });
9783
9793
  }
9784
9794
  if (renderData.length === 0) return null;
9785
- return /* @__PURE__ */ jsx12(
9795
+ return /* @__PURE__ */ jsx13(
9786
9796
  "div",
9787
9797
  {
9788
9798
  style: {
@@ -9795,7 +9805,7 @@ var ComponentBoundingBoxOverlay = ({
9795
9805
  pointerEvents: "none",
9796
9806
  zIndex: zIndexMap.dimensionOverlay
9797
9807
  },
9798
- children: /* @__PURE__ */ jsx12(
9808
+ children: /* @__PURE__ */ jsx13(
9799
9809
  "svg",
9800
9810
  {
9801
9811
  style: { position: "absolute", left: 0, top: 0, pointerEvents: "none" },
@@ -9821,8 +9831,8 @@ var ComponentBoundingBoxOverlay = ({
9821
9831
  y: (bbox.minY + bbox.maxY) / 2
9822
9832
  };
9823
9833
  const componentCenterScreen = applyToPoint14(transform, componentCenter);
9824
- return /* @__PURE__ */ jsxs8("g", { children: [
9825
- /* @__PURE__ */ jsx12(
9834
+ return /* @__PURE__ */ jsxs9("g", { children: [
9835
+ /* @__PURE__ */ jsx13(
9826
9836
  "rect",
9827
9837
  {
9828
9838
  x: screenBbox.x,
@@ -9835,7 +9845,7 @@ var ComponentBoundingBoxOverlay = ({
9835
9845
  strokeDasharray: "4,4"
9836
9846
  }
9837
9847
  ),
9838
- /* @__PURE__ */ jsx12(
9848
+ /* @__PURE__ */ jsx13(
9839
9849
  "line",
9840
9850
  {
9841
9851
  x1: componentCenterScreen.x - 6,
@@ -9846,7 +9856,7 @@ var ComponentBoundingBoxOverlay = ({
9846
9856
  strokeWidth: 1.5
9847
9857
  }
9848
9858
  ),
9849
- /* @__PURE__ */ jsx12(
9859
+ /* @__PURE__ */ jsx13(
9850
9860
  "line",
9851
9861
  {
9852
9862
  x1: componentCenterScreen.x,
@@ -9857,7 +9867,7 @@ var ComponentBoundingBoxOverlay = ({
9857
9867
  strokeWidth: 1.5
9858
9868
  }
9859
9869
  ),
9860
- /* @__PURE__ */ jsx12(
9870
+ /* @__PURE__ */ jsx13(
9861
9871
  "circle",
9862
9872
  {
9863
9873
  cx: componentCenterScreen.x,
@@ -9877,7 +9887,7 @@ var ComponentBoundingBoxOverlay = ({
9877
9887
  };
9878
9888
 
9879
9889
  // src/components/AnchorOffsetOverlay/PanelAnchorOffsetOverlay.tsx
9880
- import { jsx as jsx13 } from "react/jsx-runtime";
9890
+ import { jsx as jsx14 } from "react/jsx-runtime";
9881
9891
  var PanelAnchorOffsetOverlay = ({
9882
9892
  elements,
9883
9893
  highlightedPrimitives,
@@ -9926,7 +9936,7 @@ var PanelAnchorOffsetOverlay = ({
9926
9936
  display_offset_y: target.board.display_offset_y
9927
9937
  };
9928
9938
  }).filter((t) => Boolean(t));
9929
- return /* @__PURE__ */ jsx13(
9939
+ return /* @__PURE__ */ jsx14(
9930
9940
  AnchorOffsetOverlay,
9931
9941
  {
9932
9942
  targets: sharedTargets,
@@ -10016,7 +10026,7 @@ function filterTracesIfMultiple(filterTraces) {
10016
10026
 
10017
10027
  // src/components/ElementOverlayBox.tsx
10018
10028
  import { useEffect as useEffect9, useState as useState6 } from "react";
10019
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
10029
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
10020
10030
  var containerStyle = {
10021
10031
  position: "absolute",
10022
10032
  left: 0,
@@ -10107,7 +10117,7 @@ var HighlightedPrimitiveBoxWithText = ({
10107
10117
  const traceTextContext = { primitiveElement, elements };
10108
10118
  const overlayInfo = getTraceOverlayInfo(traceTextContext);
10109
10119
  if (!overlayInfo) return null;
10110
- return /* @__PURE__ */ jsx14(
10120
+ return /* @__PURE__ */ jsx15(
10111
10121
  "div",
10112
10122
  {
10113
10123
  style: {
@@ -10118,7 +10128,7 @@ var HighlightedPrimitiveBoxWithText = ({
10118
10128
  color: color8,
10119
10129
  pointerEvents: "none"
10120
10130
  },
10121
- children: /* @__PURE__ */ jsxs9(
10131
+ children: /* @__PURE__ */ jsxs10(
10122
10132
  "div",
10123
10133
  {
10124
10134
  style: {
@@ -10135,8 +10145,8 @@ var HighlightedPrimitiveBoxWithText = ({
10135
10145
  whiteSpace: "nowrap"
10136
10146
  },
10137
10147
  children: [
10138
- overlayInfo.text && /* @__PURE__ */ jsx14("div", { children: overlayInfo.text }),
10139
- overlayInfo.name && /* @__PURE__ */ jsx14(
10148
+ overlayInfo.text && /* @__PURE__ */ jsx15("div", { children: overlayInfo.text }),
10149
+ overlayInfo.name && /* @__PURE__ */ jsx15(
10140
10150
  "div",
10141
10151
  {
10142
10152
  style: {
@@ -10155,7 +10165,7 @@ var HighlightedPrimitiveBoxWithText = ({
10155
10165
  if (label.trim().length === 0) {
10156
10166
  return null;
10157
10167
  }
10158
- return /* @__PURE__ */ jsx14(
10168
+ return /* @__PURE__ */ jsx15(
10159
10169
  "div",
10160
10170
  {
10161
10171
  style: {
@@ -10169,7 +10179,7 @@ var HighlightedPrimitiveBoxWithText = ({
10169
10179
  transform: `rotate(${-rotation}deg)`,
10170
10180
  transformOrigin: "center center"
10171
10181
  },
10172
- children: /* @__PURE__ */ jsx14(
10182
+ children: /* @__PURE__ */ jsx15(
10173
10183
  "div",
10174
10184
  {
10175
10185
  style: {
@@ -10185,7 +10195,7 @@ var HighlightedPrimitiveBoxWithText = ({
10185
10195
  opacity: finalState ? 1 : si === 0 ? 1 : 0,
10186
10196
  transition: "width 0.2s, height 0.2s, margin-left 0.2s, margin-top 0.2s, opacity 0.2s"
10187
10197
  },
10188
- children: /* @__PURE__ */ jsx14(
10198
+ children: /* @__PURE__ */ jsx15(
10189
10199
  "div",
10190
10200
  {
10191
10201
  style: {
@@ -10233,7 +10243,7 @@ var ElementOverlayBox = ({
10233
10243
  is_showing_multiple_traces_length,
10234
10244
  elements
10235
10245
  });
10236
- return /* @__PURE__ */ jsx14("div", { style: containerStyle, children: !is_moving_component && primitives.map((primitive) => /* @__PURE__ */ jsx14(
10246
+ return /* @__PURE__ */ jsx15("div", { style: containerStyle, children: !is_moving_component && primitives.map((primitive) => /* @__PURE__ */ jsx15(
10237
10247
  HighlightedPrimitiveBoxWithText,
10238
10248
  {
10239
10249
  primitive,
@@ -10245,7 +10255,7 @@ var ElementOverlayBox = ({
10245
10255
  };
10246
10256
 
10247
10257
  // src/components/MouseElementTracker.tsx
10248
- import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
10258
+ import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
10249
10259
  var getPolygonBoundingBox = (points) => {
10250
10260
  if (points.length === 0) return null;
10251
10261
  let minX = points[0].x;
@@ -10368,7 +10378,7 @@ var MouseElementTracker = ({
10368
10378
  setMousedPrimitives([]);
10369
10379
  onMouseHoverOverPrimitives([]);
10370
10380
  }, [selectedLayer, onMouseHoverOverPrimitives]);
10371
- const highlightedPrimitives = useMemo5(() => {
10381
+ const highlightedPrimitives = useMemo6(() => {
10372
10382
  const highlightedPrimitives2 = [];
10373
10383
  for (const primitive of mousedPrimitives) {
10374
10384
  if (primitive._element?.type === "pcb_via") continue;
@@ -10448,7 +10458,7 @@ var MouseElementTracker = ({
10448
10458
  setMousedPrimitives(newMousedPrimitives);
10449
10459
  onMouseHoverOverPrimitives(newMousedPrimitives);
10450
10460
  };
10451
- return /* @__PURE__ */ jsxs10(
10461
+ return /* @__PURE__ */ jsxs11(
10452
10462
  "div",
10453
10463
  {
10454
10464
  ref: containerRef,
@@ -10472,7 +10482,7 @@ var MouseElementTracker = ({
10472
10482
  },
10473
10483
  children: [
10474
10484
  children,
10475
- /* @__PURE__ */ jsx15(
10485
+ /* @__PURE__ */ jsx16(
10476
10486
  ElementOverlayBox,
10477
10487
  {
10478
10488
  elements,
@@ -10480,8 +10490,8 @@ var MouseElementTracker = ({
10480
10490
  highlightedPrimitives
10481
10491
  }
10482
10492
  ),
10483
- transform && /* @__PURE__ */ jsxs10(Fragment4, { children: [
10484
- /* @__PURE__ */ jsx15(
10493
+ transform && /* @__PURE__ */ jsxs11(Fragment4, { children: [
10494
+ /* @__PURE__ */ jsx16(
10485
10495
  BoardAnchorOffsetOverlay,
10486
10496
  {
10487
10497
  elements,
@@ -10491,7 +10501,7 @@ var MouseElementTracker = ({
10491
10501
  containerHeight: height
10492
10502
  }
10493
10503
  ),
10494
- /* @__PURE__ */ jsx15(
10504
+ /* @__PURE__ */ jsx16(
10495
10505
  GroupAnchorOffsetOverlay,
10496
10506
  {
10497
10507
  elements,
@@ -10501,7 +10511,7 @@ var MouseElementTracker = ({
10501
10511
  containerHeight: height
10502
10512
  }
10503
10513
  ),
10504
- /* @__PURE__ */ jsx15(
10514
+ /* @__PURE__ */ jsx16(
10505
10515
  ComponentBoundingBoxOverlay,
10506
10516
  {
10507
10517
  elements,
@@ -10511,7 +10521,7 @@ var MouseElementTracker = ({
10511
10521
  containerHeight: height
10512
10522
  }
10513
10523
  ),
10514
- /* @__PURE__ */ jsx15(
10524
+ /* @__PURE__ */ jsx16(
10515
10525
  PanelAnchorOffsetOverlay,
10516
10526
  {
10517
10527
  elements,
@@ -10531,7 +10541,7 @@ var MouseElementTracker = ({
10531
10541
  import { applyToPoint as applyToPoint16 } from "transformation-matrix";
10532
10542
  import { identity as identity6 } from "transformation-matrix";
10533
10543
  import { useRef as useRef8, useEffect as useEffect11 } from "react";
10534
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
10544
+ import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
10535
10545
  var GROUP_COLORS = [
10536
10546
  "rgb(255, 100, 100)",
10537
10547
  "rgb(100, 255, 100)",
@@ -10767,14 +10777,14 @@ var PcbGroupOverlay = ({
10767
10777
  is_showing_group_anchor_offsets,
10768
10778
  hoveredComponentIds
10769
10779
  ]);
10770
- return /* @__PURE__ */ jsxs11(
10780
+ return /* @__PURE__ */ jsxs12(
10771
10781
  "div",
10772
10782
  {
10773
10783
  ref: containerRef,
10774
10784
  style: { position: "relative", width: "100%", height: "100%" },
10775
10785
  children: [
10776
10786
  children,
10777
- /* @__PURE__ */ jsx16(
10787
+ /* @__PURE__ */ jsx17(
10778
10788
  "canvas",
10779
10789
  {
10780
10790
  ref: canvasRef,
@@ -10795,15 +10805,15 @@ var PcbGroupOverlay = ({
10795
10805
 
10796
10806
  // src/components/RatsNestOverlay.tsx
10797
10807
  import { applyToPoint as applyToPoint17, identity as identity7 } from "transformation-matrix";
10798
- import { useMemo as useMemo6 } from "react";
10799
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
10808
+ import { useMemo as useMemo7 } from "react";
10809
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
10800
10810
  var RatsNestOverlay = ({ transform, soup, children }) => {
10801
10811
  const isShowingRatsNest = useGlobalStore((s) => s.is_showing_rats_nest);
10802
- const { netMap, idToNetMap } = useMemo6(
10812
+ const { netMap, idToNetMap } = useMemo7(
10803
10813
  () => getFullConnectivityMapFromCircuitJson(soup || []),
10804
10814
  [soup]
10805
10815
  );
10806
- const ratsNestLines = useMemo6(() => {
10816
+ const ratsNestLines = useMemo7(() => {
10807
10817
  if (!soup || !isShowingRatsNest) return [];
10808
10818
  const getElementPosition = (id) => {
10809
10819
  const element = su(soup)[id.replace(/_\d+$/, "")].get(id);
@@ -10859,9 +10869,9 @@ var RatsNestOverlay = ({ transform, soup, children }) => {
10859
10869
  }, [soup, netMap, idToNetMap, isShowingRatsNest]);
10860
10870
  if (!soup || !isShowingRatsNest) return children;
10861
10871
  if (!transform) transform = identity7();
10862
- return /* @__PURE__ */ jsxs12("div", { style: { position: "relative" }, children: [
10872
+ return /* @__PURE__ */ jsxs13("div", { style: { position: "relative" }, children: [
10863
10873
  children,
10864
- /* @__PURE__ */ jsx17(
10874
+ /* @__PURE__ */ jsx18(
10865
10875
  "svg",
10866
10876
  {
10867
10877
  style: {
@@ -10877,7 +10887,7 @@ var RatsNestOverlay = ({ transform, soup, children }) => {
10877
10887
  children: ratsNestLines.map(({ key, startPoint, endPoint, isInNet }) => {
10878
10888
  const transformedStart = applyToPoint17(transform, startPoint);
10879
10889
  const transformedEnd = applyToPoint17(transform, endPoint);
10880
- return /* @__PURE__ */ jsx17(
10890
+ return /* @__PURE__ */ jsx18(
10881
10891
  "line",
10882
10892
  {
10883
10893
  x1: transformedStart.x,
@@ -10909,7 +10919,7 @@ import { css as css3 } from "@emotion/css";
10909
10919
  // package.json
10910
10920
  var package_default = {
10911
10921
  name: "@tscircuit/pcb-viewer",
10912
- version: "1.11.394",
10922
+ version: "1.11.395",
10913
10923
  main: "dist/index.js",
10914
10924
  type: "module",
10915
10925
  repository: {
@@ -11071,7 +11081,7 @@ var useMobileTouch = (onClick, options = { stopPropagation: true }) => {
11071
11081
  var import_react_dom = __toESM(require_react_dom(), 1);
11072
11082
  import { css as css2 } from "@emotion/css";
11073
11083
  import { useEffect as useEffect14, useRef as useRef11, useState as useState9 } from "react";
11074
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
11084
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
11075
11085
  var menuStyle = css2`
11076
11086
  background: #222;
11077
11087
  color: #eee;
@@ -11134,7 +11144,7 @@ var VisibilityContextMenu = ({
11134
11144
  };
11135
11145
  }, [onClose]);
11136
11146
  return (0, import_react_dom.createPortal)(
11137
- /* @__PURE__ */ jsx18(
11147
+ /* @__PURE__ */ jsx19(
11138
11148
  "div",
11139
11149
  {
11140
11150
  ref,
@@ -11193,13 +11203,13 @@ var VisibilityContextMenu = ({
11193
11203
  maxHeight: window.innerHeight - 8,
11194
11204
  ...stacked ? { overflowY: "auto" } : {}
11195
11205
  },
11196
- children: /* @__PURE__ */ jsxs13(
11206
+ children: /* @__PURE__ */ jsxs14(
11197
11207
  "div",
11198
11208
  {
11199
11209
  style: { position: "relative" },
11200
11210
  onMouseEnter: () => setVisibilityOpen(true),
11201
11211
  children: [
11202
- /* @__PURE__ */ jsx18(
11212
+ /* @__PURE__ */ jsx19(
11203
11213
  "button",
11204
11214
  {
11205
11215
  type: "button",
@@ -11211,20 +11221,20 @@ var VisibilityContextMenu = ({
11211
11221
  children: "Visibility \u25B8"
11212
11222
  }
11213
11223
  ),
11214
- visibilityOpen && /* @__PURE__ */ jsx18(
11224
+ visibilityOpen && /* @__PURE__ */ jsx19(
11215
11225
  "div",
11216
11226
  {
11217
11227
  role: "menu",
11218
11228
  "aria-label": "Visibility",
11219
11229
  className: menuStyle,
11220
11230
  style: submenuStyle,
11221
- children: /* @__PURE__ */ jsxs13(
11231
+ children: /* @__PURE__ */ jsxs14(
11222
11232
  "div",
11223
11233
  {
11224
11234
  style: { position: "relative" },
11225
11235
  onMouseEnter: () => setOpacityOpen(true),
11226
11236
  children: [
11227
- /* @__PURE__ */ jsx18(
11237
+ /* @__PURE__ */ jsx19(
11228
11238
  "button",
11229
11239
  {
11230
11240
  type: "button",
@@ -11236,7 +11246,7 @@ var VisibilityContextMenu = ({
11236
11246
  children: "Hidden Layer Visibility \u25B8"
11237
11247
  }
11238
11248
  ),
11239
- opacityOpen && /* @__PURE__ */ jsx18(
11249
+ opacityOpen && /* @__PURE__ */ jsx19(
11240
11250
  "div",
11241
11251
  {
11242
11252
  role: "menu",
@@ -11246,7 +11256,7 @@ var VisibilityContextMenu = ({
11246
11256
  minWidth: 80,
11247
11257
  ...submenuStyle
11248
11258
  },
11249
- children: [0, 0.1, 0.2, 0.4, 0.6, 0.8, 1].map((value) => /* @__PURE__ */ jsxs13(
11259
+ children: [0, 0.1, 0.2, 0.4, 0.6, 0.8, 1].map((value) => /* @__PURE__ */ jsxs14(
11250
11260
  "button",
11251
11261
  {
11252
11262
  type: "button",
@@ -11258,7 +11268,7 @@ var VisibilityContextMenu = ({
11258
11268
  onClose();
11259
11269
  },
11260
11270
  children: [
11261
- /* @__PURE__ */ jsx18(
11271
+ /* @__PURE__ */ jsx19(
11262
11272
  "span",
11263
11273
  {
11264
11274
  "aria-hidden": "true",
@@ -11288,7 +11298,7 @@ var VisibilityContextMenu = ({
11288
11298
  };
11289
11299
 
11290
11300
  // src/components/ToolbarButton.tsx
11291
- import { jsx as jsx19 } from "react/jsx-runtime";
11301
+ import { jsx as jsx20 } from "react/jsx-runtime";
11292
11302
  var ToolbarButton = ({
11293
11303
  children,
11294
11304
  isSmallScreen,
@@ -11296,7 +11306,7 @@ var ToolbarButton = ({
11296
11306
  ...props
11297
11307
  }) => {
11298
11308
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11299
- return /* @__PURE__ */ jsx19(
11309
+ return /* @__PURE__ */ jsx20(
11300
11310
  "div",
11301
11311
  {
11302
11312
  ...props,
@@ -11324,7 +11334,7 @@ var ToolbarButton = ({
11324
11334
  };
11325
11335
 
11326
11336
  // src/components/ToolbarErrorDropdown.tsx
11327
- import { useCallback as useCallback9, useMemo as useMemo7, useState as useState10 } from "react";
11337
+ import { useCallback as useCallback9, useMemo as useMemo8, useState as useState10 } from "react";
11328
11338
 
11329
11339
  // src/lib/util/group-errors-by-type.ts
11330
11340
  var groupErrorsByType = (errors) => {
@@ -11404,7 +11414,7 @@ var useToolbarErrorFocus = ({
11404
11414
  };
11405
11415
 
11406
11416
  // src/components/ToolbarErrorDropdown.tsx
11407
- import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
11417
+ import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
11408
11418
  var CopyErrorButton = ({
11409
11419
  errorId,
11410
11420
  errorMessage,
@@ -11414,7 +11424,7 @@ var CopyErrorButton = ({
11414
11424
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(
11415
11425
  () => onCopy(errorMessage, errorId)
11416
11426
  );
11417
- return /* @__PURE__ */ jsx20(
11427
+ return /* @__PURE__ */ jsx21(
11418
11428
  "button",
11419
11429
  {
11420
11430
  type: "button",
@@ -11434,7 +11444,7 @@ var CopyErrorButton = ({
11434
11444
  ...touchStyle
11435
11445
  },
11436
11446
  ...touchHandlers,
11437
- children: copiedErrorId === errorId ? /* @__PURE__ */ jsx20("span", { style: { color: "#4caf50", fontSize: 12 }, children: "Copied!" }) : /* @__PURE__ */ jsx20("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx20("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }) })
11447
+ children: copiedErrorId === errorId ? /* @__PURE__ */ jsx21("span", { style: { color: "#4caf50", fontSize: 12 }, children: "Copied!" }) : /* @__PURE__ */ jsx21("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx21("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }) })
11438
11448
  }
11439
11449
  );
11440
11450
  };
@@ -11460,14 +11470,14 @@ var ToolbarErrorDropdown = ({
11460
11470
  setHoveredErrorId,
11461
11471
  setFocusedErrorId
11462
11472
  });
11463
- const errorElements = useMemo7(
11473
+ const errorElements = useMemo8(
11464
11474
  () => elements?.filter(
11465
11475
  (el) => el.type.includes("error")
11466
11476
  ) ?? [],
11467
11477
  [elements]
11468
11478
  );
11469
11479
  const errorCount = errorElements.length;
11470
- const groupedErrorElements = useMemo7(
11480
+ const groupedErrorElements = useMemo8(
11471
11481
  () => groupErrorsByType(errorElements),
11472
11482
  [errorElements]
11473
11483
  );
@@ -11493,20 +11503,20 @@ var ToolbarErrorDropdown = ({
11493
11503
  return next;
11494
11504
  });
11495
11505
  }, []);
11496
- return /* @__PURE__ */ jsxs14("div", { style: { position: "relative" }, children: [
11497
- /* @__PURE__ */ jsx20(
11506
+ return /* @__PURE__ */ jsxs15("div", { style: { position: "relative" }, children: [
11507
+ /* @__PURE__ */ jsx21(
11498
11508
  ToolbarButton,
11499
11509
  {
11500
11510
  isSmallScreen,
11501
11511
  style: errorCount > 0 ? { color: "red" } : void 0,
11502
11512
  onClick: onToggle,
11503
- children: /* @__PURE__ */ jsxs14("div", { children: [
11513
+ children: /* @__PURE__ */ jsxs15("div", { children: [
11504
11514
  errorCount,
11505
11515
  " errors"
11506
11516
  ] })
11507
11517
  }
11508
11518
  ),
11509
- isOpen && errorCount > 0 && /* @__PURE__ */ jsx20(
11519
+ isOpen && errorCount > 0 && /* @__PURE__ */ jsx21(
11510
11520
  "div",
11511
11521
  {
11512
11522
  style: {
@@ -11526,14 +11536,14 @@ var ToolbarErrorDropdown = ({
11526
11536
  },
11527
11537
  children: groupedErrorElements.map(({ errorType, errors }, groupIndex) => {
11528
11538
  const isGroupCollapsed = collapsedErrorGroups.has(errorType);
11529
- return /* @__PURE__ */ jsxs14(
11539
+ return /* @__PURE__ */ jsxs15(
11530
11540
  "div",
11531
11541
  {
11532
11542
  style: {
11533
11543
  borderBottom: groupIndex < groupedErrorElements.length - 1 ? "1px solid #444" : "none"
11534
11544
  },
11535
11545
  children: [
11536
- /* @__PURE__ */ jsxs14(
11546
+ /* @__PURE__ */ jsxs15(
11537
11547
  "div",
11538
11548
  {
11539
11549
  style: {
@@ -11570,7 +11580,7 @@ var ToolbarErrorDropdown = ({
11570
11580
  toggleErrorGroup(errorType);
11571
11581
  },
11572
11582
  children: [
11573
- /* @__PURE__ */ jsxs14(
11583
+ /* @__PURE__ */ jsxs15(
11574
11584
  "div",
11575
11585
  {
11576
11586
  style: {
@@ -11580,7 +11590,7 @@ var ToolbarErrorDropdown = ({
11580
11590
  color: "#ff6b6b"
11581
11591
  },
11582
11592
  children: [
11583
- /* @__PURE__ */ jsx20(
11593
+ /* @__PURE__ */ jsx21(
11584
11594
  "div",
11585
11595
  {
11586
11596
  style: {
@@ -11593,7 +11603,7 @@ var ToolbarErrorDropdown = ({
11593
11603
  children: "\u203A"
11594
11604
  }
11595
11605
  ),
11596
- /* @__PURE__ */ jsx20(
11606
+ /* @__PURE__ */ jsx21(
11597
11607
  "div",
11598
11608
  {
11599
11609
  style: {
@@ -11606,7 +11616,7 @@ var ToolbarErrorDropdown = ({
11606
11616
  ]
11607
11617
  }
11608
11618
  ),
11609
- /* @__PURE__ */ jsx20(
11619
+ /* @__PURE__ */ jsx21(
11610
11620
  "div",
11611
11621
  {
11612
11622
  style: {
@@ -11624,14 +11634,14 @@ var ToolbarErrorDropdown = ({
11624
11634
  !isGroupCollapsed && errors.map(({ error, index, errorId }) => {
11625
11635
  const isExpanded = expandedErrorIds.has(errorId);
11626
11636
  const errorMessage = error.message ?? "No error message";
11627
- return /* @__PURE__ */ jsxs14(
11637
+ return /* @__PURE__ */ jsxs15(
11628
11638
  "div",
11629
11639
  {
11630
11640
  style: {
11631
11641
  borderTop: "1px solid #3a3a3a"
11632
11642
  },
11633
11643
  children: [
11634
- /* @__PURE__ */ jsxs14(
11644
+ /* @__PURE__ */ jsxs15(
11635
11645
  "div",
11636
11646
  {
11637
11647
  style: {
@@ -11670,7 +11680,7 @@ var ToolbarErrorDropdown = ({
11670
11680
  handleErrorSelect(errorId);
11671
11681
  },
11672
11682
  children: [
11673
- /* @__PURE__ */ jsx20(
11683
+ /* @__PURE__ */ jsx21(
11674
11684
  "div",
11675
11685
  {
11676
11686
  style: {
@@ -11686,7 +11696,7 @@ var ToolbarErrorDropdown = ({
11686
11696
  children: errorMessage
11687
11697
  }
11688
11698
  ),
11689
- /* @__PURE__ */ jsx20(
11699
+ /* @__PURE__ */ jsx21(
11690
11700
  "button",
11691
11701
  {
11692
11702
  type: "button",
@@ -11718,7 +11728,7 @@ var ToolbarErrorDropdown = ({
11718
11728
  ]
11719
11729
  }
11720
11730
  ),
11721
- isExpanded && /* @__PURE__ */ jsxs14(
11731
+ isExpanded && /* @__PURE__ */ jsxs15(
11722
11732
  "div",
11723
11733
  {
11724
11734
  "data-error-id": index,
@@ -11730,7 +11740,7 @@ var ToolbarErrorDropdown = ({
11730
11740
  position: "relative"
11731
11741
  },
11732
11742
  children: [
11733
- /* @__PURE__ */ jsx20(
11743
+ /* @__PURE__ */ jsx21(
11734
11744
  "div",
11735
11745
  {
11736
11746
  style: {
@@ -11748,7 +11758,7 @@ var ToolbarErrorDropdown = ({
11748
11758
  children: errorMessage
11749
11759
  }
11750
11760
  ),
11751
- /* @__PURE__ */ jsx20(
11761
+ /* @__PURE__ */ jsx21(
11752
11762
  CopyErrorButton,
11753
11763
  {
11754
11764
  errorId,
@@ -11780,10 +11790,10 @@ var ToolbarErrorDropdown = ({
11780
11790
  };
11781
11791
 
11782
11792
  // src/components/ToolbarOverlay.tsx
11783
- import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
11793
+ import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
11784
11794
  var LayerButton = ({ name, selected, onClick }) => {
11785
11795
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11786
- return /* @__PURE__ */ jsxs15(
11796
+ return /* @__PURE__ */ jsxs16(
11787
11797
  "div",
11788
11798
  {
11789
11799
  className: css3`
@@ -11800,8 +11810,8 @@ var LayerButton = ({ name, selected, onClick }) => {
11800
11810
  ...touchHandlers,
11801
11811
  style: touchStyle,
11802
11812
  children: [
11803
- /* @__PURE__ */ jsx21("span", { style: { marginRight: 2, opacity: selected ? 1 : 0 }, children: "\u2022" }),
11804
- /* @__PURE__ */ jsx21(
11813
+ /* @__PURE__ */ jsx22("span", { style: { marginRight: 2, opacity: selected ? 1 : 0 }, children: "\u2022" }),
11814
+ /* @__PURE__ */ jsx22(
11805
11815
  "span",
11806
11816
  {
11807
11817
  style: {
@@ -11822,7 +11832,7 @@ var CheckboxMenuItem = ({
11822
11832
  onClick
11823
11833
  }) => {
11824
11834
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11825
- return /* @__PURE__ */ jsxs15(
11835
+ return /* @__PURE__ */ jsxs16(
11826
11836
  "div",
11827
11837
  {
11828
11838
  className: css3`
@@ -11842,16 +11852,16 @@ var CheckboxMenuItem = ({
11842
11852
  ...touchHandlers,
11843
11853
  style: touchStyle,
11844
11854
  children: [
11845
- /* @__PURE__ */ jsx21("input", { type: "checkbox", checked, onChange: () => {
11855
+ /* @__PURE__ */ jsx22("input", { type: "checkbox", checked, onChange: () => {
11846
11856
  }, readOnly: true }),
11847
- /* @__PURE__ */ jsx21("span", { style: { color: "#eee" }, children: label })
11857
+ /* @__PURE__ */ jsx22("span", { style: { color: "#eee" }, children: label })
11848
11858
  ]
11849
11859
  }
11850
11860
  );
11851
11861
  };
11852
11862
  var RadioMenuItem = ({ label, checked, onClick }) => {
11853
11863
  const { style: touchStyle, ...touchHandlers } = useMobileTouch(onClick);
11854
- return /* @__PURE__ */ jsxs15(
11864
+ return /* @__PURE__ */ jsxs16(
11855
11865
  "div",
11856
11866
  {
11857
11867
  className: css3`
@@ -11871,9 +11881,9 @@ var RadioMenuItem = ({ label, checked, onClick }) => {
11871
11881
  ...touchHandlers,
11872
11882
  style: touchStyle,
11873
11883
  children: [
11874
- /* @__PURE__ */ jsx21("input", { type: "radio", checked, onChange: () => {
11884
+ /* @__PURE__ */ jsx22("input", { type: "radio", checked, onChange: () => {
11875
11885
  }, readOnly: true }),
11876
- /* @__PURE__ */ jsx21("span", { style: { color: "#eee" }, children: label })
11886
+ /* @__PURE__ */ jsx22("span", { style: { color: "#eee" }, children: label })
11877
11887
  ]
11878
11888
  }
11879
11889
  );
@@ -12073,7 +12083,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12073
12083
  },
12074
12084
  []
12075
12085
  );
12076
- return /* @__PURE__ */ jsxs15(
12086
+ return /* @__PURE__ */ jsxs16(
12077
12087
  "div",
12078
12088
  {
12079
12089
  ref: hotkeyBoundaryRef,
@@ -12088,14 +12098,14 @@ var ToolbarOverlay = ({ children, elements }) => {
12088
12098
  onMouseMove: handleMouseMove,
12089
12099
  children: [
12090
12100
  children,
12091
- contextMenuPosition && /* @__PURE__ */ jsx21(
12101
+ contextMenuPosition && /* @__PURE__ */ jsx22(
12092
12102
  VisibilityContextMenu,
12093
12103
  {
12094
12104
  position: contextMenuPosition,
12095
12105
  onClose: closeContextMenu
12096
12106
  }
12097
12107
  ),
12098
- /* @__PURE__ */ jsxs15(
12108
+ /* @__PURE__ */ jsxs16(
12099
12109
  "div",
12100
12110
  {
12101
12111
  style: {
@@ -12116,7 +12126,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12116
12126
  ]
12117
12127
  }
12118
12128
  ),
12119
- /* @__PURE__ */ jsxs15(
12129
+ /* @__PURE__ */ jsxs16(
12120
12130
  "div",
12121
12131
  {
12122
12132
  "data-toolbar-overlay": true,
@@ -12147,7 +12157,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12147
12157
  fontFamily: "sans-serif"
12148
12158
  },
12149
12159
  children: [
12150
- /* @__PURE__ */ jsxs15(
12160
+ /* @__PURE__ */ jsxs16(
12151
12161
  ToolbarButton,
12152
12162
  {
12153
12163
  isSmallScreen,
@@ -12158,10 +12168,10 @@ var ToolbarOverlay = ({ children, elements }) => {
12158
12168
  }
12159
12169
  },
12160
12170
  children: [
12161
- /* @__PURE__ */ jsxs15("div", { children: [
12171
+ /* @__PURE__ */ jsxs16("div", { children: [
12162
12172
  "layer:",
12163
12173
  " ",
12164
- /* @__PURE__ */ jsx21(
12174
+ /* @__PURE__ */ jsx22(
12165
12175
  "span",
12166
12176
  {
12167
12177
  style: {
@@ -12173,7 +12183,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12173
12183
  }
12174
12184
  )
12175
12185
  ] }),
12176
- isLayerMenuOpen && /* @__PURE__ */ jsx21("div", { style: { marginTop: 4, minWidth: 120 }, children: processedLayers.map((layer) => /* @__PURE__ */ jsx21(
12186
+ isLayerMenuOpen && /* @__PURE__ */ jsx22("div", { style: { marginTop: 4, minWidth: 120 }, children: processedLayers.map((layer) => /* @__PURE__ */ jsx22(
12177
12187
  LayerButton,
12178
12188
  {
12179
12189
  name: layer,
@@ -12187,7 +12197,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12187
12197
  ]
12188
12198
  }
12189
12199
  ),
12190
- /* @__PURE__ */ jsx21(
12200
+ /* @__PURE__ */ jsx22(
12191
12201
  ToolbarErrorDropdown,
12192
12202
  {
12193
12203
  elements,
@@ -12199,43 +12209,43 @@ var ToolbarOverlay = ({ children, elements }) => {
12199
12209
  setFocusedErrorId
12200
12210
  }
12201
12211
  ),
12202
- /* @__PURE__ */ jsx21(
12212
+ /* @__PURE__ */ jsx22(
12203
12213
  ToolbarButton,
12204
12214
  {
12205
12215
  isSmallScreen,
12206
12216
  style: {},
12207
12217
  onClick: handleRatsNestToggle,
12208
- children: /* @__PURE__ */ jsxs15("div", { children: [
12218
+ children: /* @__PURE__ */ jsxs16("div", { children: [
12209
12219
  viewSettings.is_showing_rats_nest ? "\u2716 " : "",
12210
12220
  "Rats Nest"
12211
12221
  ] })
12212
12222
  }
12213
12223
  ),
12214
- /* @__PURE__ */ jsx21(
12224
+ /* @__PURE__ */ jsx22(
12215
12225
  ToolbarButton,
12216
12226
  {
12217
12227
  isSmallScreen,
12218
12228
  style: measureToolArmed ? { backgroundColor: "#444" } : {},
12219
12229
  onClick: handleMeasureToolClick,
12220
- children: /* @__PURE__ */ jsx21("div", { children: "\u{1F4CF}" })
12230
+ children: /* @__PURE__ */ jsx22("div", { children: "\u{1F4CF}" })
12221
12231
  }
12222
12232
  ),
12223
- /* @__PURE__ */ jsx21(
12233
+ /* @__PURE__ */ jsx22(
12224
12234
  ToolbarButton,
12225
12235
  {
12226
12236
  isSmallScreen,
12227
12237
  style: boundsToolArmed ? { backgroundColor: "#444" } : {},
12228
12238
  onClick: handleBoundsToolClick,
12229
- children: /* @__PURE__ */ jsx21("div", { children: "Bounds" })
12239
+ children: /* @__PURE__ */ jsx22("div", { children: "Bounds" })
12230
12240
  }
12231
12241
  ),
12232
- /* @__PURE__ */ jsx21(
12242
+ /* @__PURE__ */ jsx22(
12233
12243
  ToolbarButton,
12234
12244
  {
12235
12245
  isSmallScreen,
12236
12246
  onClick: handleViewMenuToggle,
12237
- children: /* @__PURE__ */ jsxs15("div", { children: [
12238
- /* @__PURE__ */ jsxs15(
12247
+ children: /* @__PURE__ */ jsxs16("div", { children: [
12248
+ /* @__PURE__ */ jsxs16(
12239
12249
  "div",
12240
12250
  {
12241
12251
  style: {
@@ -12245,7 +12255,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12245
12255
  },
12246
12256
  children: [
12247
12257
  "View",
12248
- /* @__PURE__ */ jsx21(
12258
+ /* @__PURE__ */ jsx22(
12249
12259
  "span",
12250
12260
  {
12251
12261
  style: {
@@ -12260,8 +12270,8 @@ var ToolbarOverlay = ({ children, elements }) => {
12260
12270
  ]
12261
12271
  }
12262
12272
  ),
12263
- isViewMenuOpen && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 4, minWidth: 120 }, children: [
12264
- /* @__PURE__ */ jsx21(
12273
+ isViewMenuOpen && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 4, minWidth: 120 }, children: [
12274
+ /* @__PURE__ */ jsx22(
12265
12275
  CheckboxMenuItem,
12266
12276
  {
12267
12277
  label: "Show All Trace Lengths",
@@ -12273,7 +12283,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12273
12283
  }
12274
12284
  }
12275
12285
  ),
12276
- /* @__PURE__ */ jsx21(
12286
+ /* @__PURE__ */ jsx22(
12277
12287
  CheckboxMenuItem,
12278
12288
  {
12279
12289
  label: "Show Autorouting Animation",
@@ -12285,7 +12295,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12285
12295
  }
12286
12296
  }
12287
12297
  ),
12288
- /* @__PURE__ */ jsx21(
12298
+ /* @__PURE__ */ jsx22(
12289
12299
  CheckboxMenuItem,
12290
12300
  {
12291
12301
  label: "Show DRC Errors",
@@ -12295,7 +12305,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12295
12305
  }
12296
12306
  }
12297
12307
  ),
12298
- /* @__PURE__ */ jsx21(
12308
+ /* @__PURE__ */ jsx22(
12299
12309
  CheckboxMenuItem,
12300
12310
  {
12301
12311
  label: "Show DRC Warnings",
@@ -12307,7 +12317,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12307
12317
  }
12308
12318
  }
12309
12319
  ),
12310
- /* @__PURE__ */ jsx21(
12320
+ /* @__PURE__ */ jsx22(
12311
12321
  CheckboxMenuItem,
12312
12322
  {
12313
12323
  label: "Show Copper Pours",
@@ -12319,7 +12329,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12319
12329
  }
12320
12330
  }
12321
12331
  ),
12322
- /* @__PURE__ */ jsx21(
12332
+ /* @__PURE__ */ jsx22(
12323
12333
  CheckboxMenuItem,
12324
12334
  {
12325
12335
  label: "Show Courtyards",
@@ -12329,7 +12339,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12329
12339
  }
12330
12340
  }
12331
12341
  ),
12332
- /* @__PURE__ */ jsx21(
12342
+ /* @__PURE__ */ jsx22(
12333
12343
  CheckboxMenuItem,
12334
12344
  {
12335
12345
  label: "Show Solder Mask",
@@ -12339,7 +12349,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12339
12349
  }
12340
12350
  }
12341
12351
  ),
12342
- /* @__PURE__ */ jsx21(
12352
+ /* @__PURE__ */ jsx22(
12343
12353
  CheckboxMenuItem,
12344
12354
  {
12345
12355
  label: "Show Silkscreen",
@@ -12349,7 +12359,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12349
12359
  }
12350
12360
  }
12351
12361
  ),
12352
- /* @__PURE__ */ jsx21(
12362
+ /* @__PURE__ */ jsx22(
12353
12363
  CheckboxMenuItem,
12354
12364
  {
12355
12365
  label: "Show Fabrication Notes",
@@ -12361,7 +12371,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12361
12371
  }
12362
12372
  }
12363
12373
  ),
12364
- /* @__PURE__ */ jsx21(
12374
+ /* @__PURE__ */ jsx22(
12365
12375
  CheckboxMenuItem,
12366
12376
  {
12367
12377
  label: "Show PCB Notes",
@@ -12371,7 +12381,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12371
12381
  }
12372
12382
  }
12373
12383
  ),
12374
- /* @__PURE__ */ jsx21(
12384
+ /* @__PURE__ */ jsx22(
12375
12385
  CheckboxMenuItem,
12376
12386
  {
12377
12387
  label: "Show Group Anchor Offsets",
@@ -12383,7 +12393,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12383
12393
  }
12384
12394
  }
12385
12395
  ),
12386
- /* @__PURE__ */ jsx21(
12396
+ /* @__PURE__ */ jsx22(
12387
12397
  CheckboxMenuItem,
12388
12398
  {
12389
12399
  label: "Show PCB Groups",
@@ -12393,8 +12403,8 @@ var ToolbarOverlay = ({ children, elements }) => {
12393
12403
  }
12394
12404
  }
12395
12405
  ),
12396
- viewSettings.is_showing_pcb_groups && /* @__PURE__ */ jsxs15("div", { style: { marginLeft: 16 }, children: [
12397
- /* @__PURE__ */ jsx21(
12406
+ viewSettings.is_showing_pcb_groups && /* @__PURE__ */ jsxs16("div", { style: { marginLeft: 16 }, children: [
12407
+ /* @__PURE__ */ jsx22(
12398
12408
  RadioMenuItem,
12399
12409
  {
12400
12410
  label: "Show All Groups",
@@ -12404,7 +12414,7 @@ var ToolbarOverlay = ({ children, elements }) => {
12404
12414
  }
12405
12415
  }
12406
12416
  ),
12407
- /* @__PURE__ */ jsx21(
12417
+ /* @__PURE__ */ jsx22(
12408
12418
  RadioMenuItem,
12409
12419
  {
12410
12420
  label: "Show Named Groups",
@@ -12441,7 +12451,7 @@ var getPcbWarningHighlightLabel = (warning) => {
12441
12451
  };
12442
12452
 
12443
12453
  // src/components/WarningGraphicsOverlay.tsx
12444
- import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
12454
+ import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
12445
12455
  var WarningGraphicsOverlay = ({
12446
12456
  children,
12447
12457
  transform = identity8(),
@@ -12503,7 +12513,7 @@ var WarningGraphicsOverlay = ({
12503
12513
  });
12504
12514
  }, [elements, transform, width, height, isShowingDrcWarnings]);
12505
12515
  if (!isShowingDrcWarnings) {
12506
- return /* @__PURE__ */ jsx22(
12516
+ return /* @__PURE__ */ jsx23(
12507
12517
  "div",
12508
12518
  {
12509
12519
  ref: containerRef,
@@ -12512,14 +12522,14 @@ var WarningGraphicsOverlay = ({
12512
12522
  }
12513
12523
  );
12514
12524
  }
12515
- return /* @__PURE__ */ jsxs16(
12525
+ return /* @__PURE__ */ jsxs17(
12516
12526
  "div",
12517
12527
  {
12518
12528
  ref: containerRef,
12519
12529
  style: { position: "relative", width: "100%", height: "100%" },
12520
12530
  children: [
12521
12531
  children,
12522
- /* @__PURE__ */ jsx22(
12532
+ /* @__PURE__ */ jsx23(
12523
12533
  "canvas",
12524
12534
  {
12525
12535
  ref: canvasRef,
@@ -12538,7 +12548,7 @@ var WarningGraphicsOverlay = ({
12538
12548
  };
12539
12549
 
12540
12550
  // src/components/CanvasElementsRenderer.tsx
12541
- import { jsx as jsx23 } from "react/jsx-runtime";
12551
+ import { jsx as jsx24 } from "react/jsx-runtime";
12542
12552
  var CanvasElementsRenderer = (props) => {
12543
12553
  const { transform, elements } = props;
12544
12554
  const {
@@ -12553,11 +12563,11 @@ var CanvasElementsRenderer = (props) => {
12553
12563
  selectedLayer: state.selected_layer
12554
12564
  }));
12555
12565
  const activeErrorId = focusedErrorId ?? hoveredErrorId;
12556
- const elementsToRender = useMemo8(
12566
+ const elementsToRender = useMemo9(
12557
12567
  () => isShowingCopperPours ? elements : elements.filter((elm) => elm.type !== "pcb_copper_pour"),
12558
12568
  [elements, isShowingCopperPours]
12559
12569
  );
12560
- const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo8(() => {
12570
+ const [primitivesWithoutInteractionMetadata, connectivityMap] = useMemo9(() => {
12561
12571
  const primitivesWithoutInteractionMetadata2 = elementsToRender.flatMap(
12562
12572
  (elm) => convertElementToPrimitives(elm, props.elements)
12563
12573
  );
@@ -12573,11 +12583,11 @@ var CanvasElementsRenderer = (props) => {
12573
12583
  const [hoveredComponentIds, setHoveredComponentIds] = useState12([]);
12574
12584
  const currentTransformRef = useRef15(transform ?? null);
12575
12585
  const zoomAnimationFrameRef = useRef15(null);
12576
- const elementIndexes = useMemo8(
12586
+ const elementIndexes = useMemo9(
12577
12587
  () => buildErrorPreviewElementIndexes(elements),
12578
12588
  [elements]
12579
12589
  );
12580
- const errorRelatedIds = useMemo8(() => {
12590
+ const errorRelatedIds = useMemo9(() => {
12581
12591
  if (!activeErrorId) return [];
12582
12592
  const errorElements = elements.filter(
12583
12593
  (el) => el.type.includes("error")
@@ -12636,7 +12646,7 @@ var CanvasElementsRenderer = (props) => {
12636
12646
  props.setTransform,
12637
12647
  props.width
12638
12648
  ]);
12639
- const primitives = useMemo8(() => {
12649
+ const primitives = useMemo9(() => {
12640
12650
  const combinedPrimitiveIds = [
12641
12651
  ...hoverState.primitiveIdsInMousedOverNet,
12642
12652
  ...errorRelatedIds
@@ -12680,7 +12690,7 @@ var CanvasElementsRenderer = (props) => {
12680
12690
  },
12681
12691
  [connectivityMap]
12682
12692
  );
12683
- return /* @__PURE__ */ jsx23(
12693
+ return /* @__PURE__ */ jsx24(
12684
12694
  MouseElementTracker,
12685
12695
  {
12686
12696
  elements: elementsToRender,
@@ -12688,7 +12698,7 @@ var CanvasElementsRenderer = (props) => {
12688
12698
  primitives: primitivesWithoutInteractionMetadata,
12689
12699
  selectedLayer,
12690
12700
  onMouseHoverOverPrimitives: onMouseOverPrimitives,
12691
- children: /* @__PURE__ */ jsx23(
12701
+ children: /* @__PURE__ */ jsx24(
12692
12702
  EditPlacementOverlay,
12693
12703
  {
12694
12704
  disabled: !props.allowEditing,
@@ -12697,7 +12707,7 @@ var CanvasElementsRenderer = (props) => {
12697
12707
  cancelPanDrag: props.cancelPanDrag,
12698
12708
  onCreateEditEvent: props.onCreateEditEvent,
12699
12709
  onModifyEditEvent: props.onModifyEditEvent,
12700
- children: /* @__PURE__ */ jsx23(
12710
+ children: /* @__PURE__ */ jsx24(
12701
12711
  DimensionOverlay,
12702
12712
  {
12703
12713
  transform,
@@ -12705,23 +12715,23 @@ var CanvasElementsRenderer = (props) => {
12705
12715
  primitives: primitivesWithoutInteractionMetadata,
12706
12716
  onBoundsSelected: props.onBoundsSelected,
12707
12717
  cancelPanDrag: props.cancelPanDrag,
12708
- children: /* @__PURE__ */ jsx23(ToolbarOverlay, { elements, children: /* @__PURE__ */ jsx23(ErrorOverlay, { transform, elements, children: /* @__PURE__ */ jsx23(RatsNestOverlay, { transform, soup: elements, children: /* @__PURE__ */ jsx23(
12718
+ children: /* @__PURE__ */ jsx24(ToolbarOverlay, { elements, children: /* @__PURE__ */ jsx24(ErrorOverlay, { transform, elements, children: /* @__PURE__ */ jsx24(RatsNestOverlay, { transform, soup: elements, children: /* @__PURE__ */ jsx24(
12709
12719
  PcbGroupOverlay,
12710
12720
  {
12711
12721
  transform,
12712
12722
  elements,
12713
12723
  hoveredComponentIds,
12714
- children: /* @__PURE__ */ jsx23(
12724
+ children: /* @__PURE__ */ jsx24(
12715
12725
  DebugGraphicsOverlay,
12716
12726
  {
12717
12727
  transform,
12718
12728
  debugGraphics: props.debugGraphics,
12719
- children: /* @__PURE__ */ jsx23(
12729
+ children: /* @__PURE__ */ jsx24(
12720
12730
  WarningGraphicsOverlay,
12721
12731
  {
12722
12732
  transform,
12723
12733
  elements,
12724
- children: /* @__PURE__ */ jsx23(
12734
+ children: /* @__PURE__ */ jsx24(
12725
12735
  CanvasPrimitiveRenderer,
12726
12736
  {
12727
12737
  transform,
@@ -12801,7 +12811,7 @@ var calculateBoardSizeKey = (circuitJson) => {
12801
12811
  };
12802
12812
 
12803
12813
  // src/PCBViewer.tsx
12804
- import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
12814
+ import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
12805
12815
  var defaultTransform = compose8(translate12(400, 300), scale6(40, -40));
12806
12816
  var PCBViewer = ({
12807
12817
  circuitJson,
@@ -12843,7 +12853,7 @@ var PCBViewer = ({
12843
12853
  editEvents = editEventsProp ?? editEvents;
12844
12854
  const initialRenderCompleted = useRef16(false);
12845
12855
  const touchStartRef = useRef16(null);
12846
- const circuitJsonKey = useMemo9(
12856
+ const circuitJsonKey = useMemo10(
12847
12857
  () => calculateCircuitJsonKey(circuitJson),
12848
12858
  [circuitJson]
12849
12859
  );
@@ -12882,12 +12892,12 @@ var PCBViewer = ({
12882
12892
  resetTransform();
12883
12893
  }
12884
12894
  }, [boardSizeKey]);
12885
- const pcbElmsPreEdit = useMemo9(() => {
12895
+ const pcbElmsPreEdit = useMemo10(() => {
12886
12896
  return circuitJson?.filter(
12887
12897
  (e) => e.type.startsWith("pcb_") || e.type.startsWith("source_")
12888
12898
  ) ?? [];
12889
12899
  }, [circuitJsonKey]);
12890
- const elements = useMemo9(() => {
12900
+ const elements = useMemo10(() => {
12891
12901
  return applyEditEvents({
12892
12902
  circuitJson: pcbElmsPreEdit,
12893
12903
  editEvents
@@ -12904,27 +12914,27 @@ var PCBViewer = ({
12904
12914
  setEditEvents(newEditEvents);
12905
12915
  onEditEventsChanged?.(newEditEvents);
12906
12916
  };
12907
- const mergedInitialState = useMemo9(
12917
+ const mergedInitialState = useMemo10(
12908
12918
  () => ({
12909
12919
  ...initialState,
12910
12920
  ...disablePcbGroups && { is_showing_pcb_groups: false }
12911
12921
  }),
12912
12922
  [initialState, disablePcbGroups]
12913
12923
  );
12914
- return /* @__PURE__ */ jsxs17(
12924
+ return /* @__PURE__ */ jsxs18(
12915
12925
  "div",
12916
12926
  {
12917
12927
  ref: transformRef,
12918
12928
  style: { position: "relative" },
12919
12929
  onContextMenu: (event) => event.preventDefault(),
12920
12930
  children: [
12921
- /* @__PURE__ */ jsx24("div", { ref, children: /* @__PURE__ */ jsxs17(
12931
+ /* @__PURE__ */ jsx25("div", { ref, children: /* @__PURE__ */ jsxs18(
12922
12932
  ContextProviders,
12923
12933
  {
12924
12934
  initialState: mergedInitialState,
12925
12935
  disablePcbGroups,
12926
12936
  children: [
12927
- /* @__PURE__ */ jsx24(
12937
+ /* @__PURE__ */ jsx25(
12928
12938
  CanvasElementsRenderer,
12929
12939
  {
12930
12940
  transform,
@@ -12951,11 +12961,11 @@ var PCBViewer = ({
12951
12961
  },
12952
12962
  refDimensions.width
12953
12963
  ),
12954
- /* @__PURE__ */ jsx24(ToastContainer, {})
12964
+ /* @__PURE__ */ jsx25(ToastContainer, {})
12955
12965
  ]
12956
12966
  }
12957
12967
  ) }),
12958
- clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx24(
12968
+ clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx25(
12959
12969
  "div",
12960
12970
  {
12961
12971
  onClick: () => {
@@ -12992,7 +13002,7 @@ var PCBViewer = ({
12992
13002
  justifyContent: "center",
12993
13003
  touchAction: "pan-x pan-y pinch-zoom"
12994
13004
  },
12995
- children: /* @__PURE__ */ jsx24(
13005
+ children: /* @__PURE__ */ jsx25(
12996
13006
  "div",
12997
13007
  {
12998
13008
  style: {