sldeditor 0.8.0 → 0.9.0

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/sldeditor.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var ev = Object.defineProperty;
2
2
  var tv = (e, t, n) => t in e ? ev(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var xt = (e, t, n) => tv(e, typeof t != "symbol" ? t + "" : t, n);
3
+ var wt = (e, t, n) => tv(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsxs as j, jsx as m, Fragment as et } from "react/jsx-runtime";
5
5
  import * as Se from "react";
6
- import Bt, { forwardRef as Dr, createElement as Bn, useState as ye, useRef as he, useCallback as Kt, useMemo as Rr, useLayoutEffect as nn, useEffect as se, createContext as Fr, useContext as Hr, useId as nv, cloneElement as ov, Fragment as rv } from "react";
6
+ import jt, { forwardRef as Dr, createElement as Ln, useState as ye, useRef as he, useCallback as Kt, useMemo as Rr, useLayoutEffect as sn, useEffect as se, createContext as Fr, useContext as Hr, useId as nv, cloneElement as ov, Fragment as rv } from "react";
7
7
  import { createPortal as Wr } from "react-dom";
8
8
  /**
9
9
  * @license lucide-react v0.469.0 - ISC
@@ -45,7 +45,7 @@ const av = Dr(
45
45
  children: i,
46
46
  iconNode: s,
47
47
  ...a
48
- }, l) => Bn(
48
+ }, l) => Ln(
49
49
  "svg",
50
50
  {
51
51
  ref: l,
@@ -58,7 +58,7 @@ const av = Dr(
58
58
  ...a
59
59
  },
60
60
  [
61
- ...s.map(([c, d]) => Bn(c, d)),
61
+ ...s.map(([c, d]) => Ln(c, d)),
62
62
  ...Array.isArray(i) ? i : [i]
63
63
  ]
64
64
  )
@@ -71,7 +71,7 @@ const av = Dr(
71
71
  */
72
72
  const oe = (e, t) => {
73
73
  const n = Dr(
74
- ({ className: o, ...r }, i) => Bn(av, {
74
+ ({ className: o, ...r }, i) => Ln(av, {
75
75
  ref: i,
76
76
  iconNode: t,
77
77
  className: qr(`lucide-${iv(e)}`, o),
@@ -143,7 +143,7 @@ const Xr = oe("Clipboard", [
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
145
  */
146
- const Kr = oe("Copy", [
146
+ const Yr = oe("Copy", [
147
147
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
148
148
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
149
149
  ]);
@@ -164,7 +164,7 @@ const dv = oe("Download", [
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
166
  */
167
- const jn = oe("Ellipsis", [
167
+ const zn = oe("Ellipsis", [
168
168
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
169
169
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
170
170
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
@@ -231,7 +231,7 @@ const hv = oe("FileType", [
231
231
  * This source code is licensed under the ISC license.
232
232
  * See the LICENSE file in the root directory of this source tree.
233
233
  */
234
- const Yr = oe("FlipHorizontal", [
234
+ const Kr = oe("FlipHorizontal", [
235
235
  ["path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3", key: "1i73f7" }],
236
236
  ["path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3", key: "saxlbk" }],
237
237
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -245,7 +245,7 @@ const Yr = oe("FlipHorizontal", [
245
245
  * This source code is licensed under the ISC license.
246
246
  * See the LICENSE file in the root directory of this source tree.
247
247
  */
248
- const Eo = oe("FolderOpen", [
248
+ const To = oe("FolderOpen", [
249
249
  [
250
250
  "path",
251
251
  {
@@ -289,7 +289,7 @@ const gv = oe("Hand", [
289
289
  * This source code is licensed under the ISC license.
290
290
  * See the LICENSE file in the root directory of this source tree.
291
291
  */
292
- const Yt = oe("LayoutGrid", [
292
+ const Vt = oe("LayoutGrid", [
293
293
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
294
294
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
295
295
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
@@ -326,7 +326,7 @@ const yv = oe("Maximize2", [
326
326
  * This source code is licensed under the ISC license.
327
327
  * See the LICENSE file in the root directory of this source tree.
328
328
  */
329
- const Un = oe("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
329
+ const Zn = oe("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
330
330
  /**
331
331
  * @license lucide-react v0.469.0 - ISC
332
332
  *
@@ -369,7 +369,7 @@ const xv = oe("Plus", [
369
369
  * This source code is licensed under the ISC license.
370
370
  * See the LICENSE file in the root directory of this source tree.
371
371
  */
372
- const Jn = oe("Redo2", [
372
+ const Qn = oe("Redo2", [
373
373
  ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
374
374
  ["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
375
375
  ]);
@@ -389,7 +389,7 @@ const Ur = oe("RotateCw", [
389
389
  * This source code is licensed under the ISC license.
390
390
  * See the LICENSE file in the root directory of this source tree.
391
391
  */
392
- const Mo = oe("Save", [
392
+ const Ao = oe("Save", [
393
393
  [
394
394
  "path",
395
395
  {
@@ -501,7 +501,7 @@ const ei = oe("Type", [
501
501
  * This source code is licensed under the ISC license.
502
502
  * See the LICENSE file in the root directory of this source tree.
503
503
  */
504
- const Zn = oe("Undo2", [
504
+ const eo = oe("Undo2", [
505
505
  ["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
506
506
  ["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
507
507
  ]);
@@ -511,7 +511,7 @@ const Zn = oe("Undo2", [
511
511
  * This source code is licensed under the ISC license.
512
512
  * See the LICENSE file in the root directory of this source tree.
513
513
  */
514
- const Mt = oe("WandSparkles", [
514
+ const Et = oe("WandSparkles", [
515
515
  [
516
516
  "path",
517
517
  {
@@ -533,7 +533,7 @@ const Mt = oe("WandSparkles", [
533
533
  * This source code is licensed under the ISC license.
534
534
  * See the LICENSE file in the root directory of this source tree.
535
535
  */
536
- const Qn = oe("X", [
536
+ const to = oe("X", [
537
537
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
538
538
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
539
539
  ]);
@@ -550,14 +550,14 @@ function ni() {
550
550
  for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t = ti(e)) && (o && (o += " "), o += t);
551
551
  return o;
552
552
  }
553
- const eo = "-", $v = (e) => {
553
+ const no = "-", $v = (e) => {
554
554
  const t = Nv(e), {
555
555
  conflictingClassGroups: n,
556
556
  conflictingClassGroupModifiers: o
557
557
  } = e;
558
558
  return {
559
559
  getClassGroupId: (s) => {
560
- const a = s.split(eo);
560
+ const a = s.split(no);
561
561
  return a[0] === "" && a.length !== 1 && a.shift(), oi(a, t) || Sv(s);
562
562
  },
563
563
  getConflictingClassGroupIds: (s, a) => {
@@ -574,13 +574,13 @@ const eo = "-", $v = (e) => {
574
574
  return r;
575
575
  if (t.validators.length === 0)
576
576
  return;
577
- const i = e.join(eo);
577
+ const i = e.join(no);
578
578
  return (s = t.validators.find(({
579
579
  validator: a
580
580
  }) => a(i))) == null ? void 0 : s.classGroupId;
581
- }, To = /^\[(.+)\]$/, Sv = (e) => {
582
- if (To.test(e)) {
583
- const t = To.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
581
+ }, Co = /^\[(.+)\]$/, Sv = (e) => {
582
+ if (Co.test(e)) {
583
+ const t = Co.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
584
584
  if (n)
585
585
  return "arbitrary.." + n;
586
586
  }
@@ -593,18 +593,18 @@ const eo = "-", $v = (e) => {
593
593
  validators: []
594
594
  };
595
595
  return Mv(Object.entries(e.classGroups), n).forEach(([i, s]) => {
596
- Ln(s, o, i, t);
596
+ Dn(s, o, i, t);
597
597
  }), o;
598
- }, Ln = (e, t, n, o) => {
598
+ }, Dn = (e, t, n, o) => {
599
599
  e.forEach((r) => {
600
600
  if (typeof r == "string") {
601
- const i = r === "" ? t : Ao(t, r);
601
+ const i = r === "" ? t : Io(t, r);
602
602
  i.classGroupId = n;
603
603
  return;
604
604
  }
605
605
  if (typeof r == "function") {
606
606
  if (Ev(r)) {
607
- Ln(r(o), t, n, o);
607
+ Dn(r(o), t, n, o);
608
608
  return;
609
609
  }
610
610
  t.validators.push({
@@ -614,12 +614,12 @@ const eo = "-", $v = (e) => {
614
614
  return;
615
615
  }
616
616
  Object.entries(r).forEach(([i, s]) => {
617
- Ln(s, Ao(t, i), n, o);
617
+ Dn(s, Io(t, i), n, o);
618
618
  });
619
619
  });
620
- }, Ao = (e, t) => {
620
+ }, Io = (e, t) => {
621
621
  let n = e;
622
- return t.split(eo).forEach((o) => {
622
+ return t.split(no).forEach((o) => {
623
623
  n.nextPart.has(o) || n.nextPart.set(o, {
624
624
  nextPart: /* @__PURE__ */ new Map(),
625
625
  validators: []
@@ -770,7 +770,7 @@ function jv(e, ...t) {
770
770
  const fe = (e) => {
771
771
  const t = (n) => n[e] || [];
772
772
  return t.isThemeGetter = !0, t;
773
- }, si = /^\[(?:([a-z-]+):)?(.+)\]$/i, Lv = /^\d+\/\d+$/, zv = /* @__PURE__ */ new Set(["px", "full", "screen"]), Dv = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Rv = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Fv = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Hv = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Wv = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, Re = (e) => ct(e) || zv.has(e) || Lv.test(e), Xe = (e) => ft(e, "length", Jv), ct = (e) => !!e && !Number.isNaN(Number(e)), wn = (e) => ft(e, "number", ct), vt = (e) => !!e && Number.isInteger(Number(e)), qv = (e) => e.endsWith("%") && ct(e.slice(0, -1)), ee = (e) => si.test(e), Ke = (e) => Dv.test(e), Gv = /* @__PURE__ */ new Set(["length", "size", "percentage"]), Xv = (e) => ft(e, Gv, ai), Kv = (e) => ft(e, "position", ai), Yv = /* @__PURE__ */ new Set(["image", "url"]), Vv = (e) => ft(e, Yv, Qv), Uv = (e) => ft(e, "", Zv), kt = () => !0, ft = (e, t, n) => {
773
+ }, si = /^\[(?:([a-z-]+):)?(.+)\]$/i, Lv = /^\d+\/\d+$/, zv = /* @__PURE__ */ new Set(["px", "full", "screen"]), Dv = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Rv = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Fv = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Hv = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Wv = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, Re = (e) => ct(e) || zv.has(e) || Lv.test(e), Ge = (e) => mt(e, "length", Jv), ct = (e) => !!e && !Number.isNaN(Number(e)), _n = (e) => mt(e, "number", ct), xt = (e) => !!e && Number.isInteger(Number(e)), qv = (e) => e.endsWith("%") && ct(e.slice(0, -1)), ee = (e) => si.test(e), Xe = (e) => Dv.test(e), Gv = /* @__PURE__ */ new Set(["length", "size", "percentage"]), Xv = (e) => mt(e, Gv, ai), Yv = (e) => mt(e, "position", ai), Kv = /* @__PURE__ */ new Set(["image", "url"]), Vv = (e) => mt(e, Kv, Qv), Uv = (e) => mt(e, "", Zv), vt = () => !0, mt = (e, t, n) => {
774
774
  const o = si.exec(e);
775
775
  return o ? o[1] ? typeof t == "string" ? o[1] === t : t.has(o[1]) : n(o[2]) : !1;
776
776
  }, Jv = (e) => (
@@ -779,17 +779,17 @@ const fe = (e) => {
779
779
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
780
780
  Rv.test(e) && !Fv.test(e)
781
781
  ), ai = () => !1, Zv = (e) => Hv.test(e), Qv = (e) => Wv.test(e), e2 = () => {
782
- const e = fe("colors"), t = fe("spacing"), n = fe("blur"), o = fe("brightness"), r = fe("borderColor"), i = fe("borderRadius"), s = fe("borderSpacing"), a = fe("borderWidth"), l = fe("contrast"), c = fe("grayscale"), d = fe("hueRotate"), u = fe("invert"), f = fe("gap"), p = fe("gradientColorStops"), h = fe("gradientColorStopPositions"), g = fe("inset"), w = fe("margin"), $ = fe("opacity"), k = fe("padding"), x = fe("saturate"), S = fe("scale"), I = fe("sepia"), D = fe("skew"), X = fe("space"), V = fe("translate"), te = () => ["auto", "contain", "none"], le = () => ["auto", "hidden", "clip", "visible", "scroll"], R = () => ["auto", ee, t], W = () => [ee, t], xe = () => ["", Re, Xe], me = () => ["auto", ct, ee], be = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], ne = () => ["solid", "dashed", "dotted", "double", "none"], re = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], we = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], ve = () => ["", "0", ee], Ne = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], Ae = () => [ct, ee];
782
+ const e = fe("colors"), t = fe("spacing"), n = fe("blur"), o = fe("brightness"), r = fe("borderColor"), i = fe("borderRadius"), s = fe("borderSpacing"), a = fe("borderWidth"), l = fe("contrast"), c = fe("grayscale"), d = fe("hueRotate"), u = fe("invert"), f = fe("gap"), p = fe("gradientColorStops"), h = fe("gradientColorStopPositions"), g = fe("inset"), w = fe("margin"), $ = fe("opacity"), k = fe("padding"), x = fe("saturate"), S = fe("scale"), I = fe("sepia"), D = fe("skew"), X = fe("space"), V = fe("translate"), te = () => ["auto", "contain", "none"], le = () => ["auto", "hidden", "clip", "visible", "scroll"], R = () => ["auto", ee, t], W = () => [ee, t], xe = () => ["", Re, Ge], me = () => ["auto", ct, ee], be = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], ne = () => ["solid", "dashed", "dotted", "double", "none"], re = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], we = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], ve = () => ["", "0", ee], Ne = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], Ae = () => [ct, ee];
783
783
  return {
784
784
  cacheSize: 500,
785
785
  separator: ":",
786
786
  theme: {
787
- colors: [kt],
788
- spacing: [Re, Xe],
789
- blur: ["none", "", Ke, ee],
787
+ colors: [vt],
788
+ spacing: [Re, Ge],
789
+ blur: ["none", "", Xe, ee],
790
790
  brightness: Ae(),
791
791
  borderColor: [e],
792
- borderRadius: ["none", "", "full", Ke, ee],
792
+ borderRadius: ["none", "", "full", Xe, ee],
793
793
  borderSpacing: W(),
794
794
  borderWidth: xe(),
795
795
  contrast: Ae(),
@@ -798,7 +798,7 @@ const fe = (e) => {
798
798
  invert: ve(),
799
799
  gap: W(),
800
800
  gradientColorStops: [e],
801
- gradientColorStopPositions: [qv, Xe],
801
+ gradientColorStopPositions: [qv, Ge],
802
802
  inset: R(),
803
803
  margin: R(),
804
804
  opacity: Ae(),
@@ -829,7 +829,7 @@ const fe = (e) => {
829
829
  * @see https://tailwindcss.com/docs/columns
830
830
  */
831
831
  columns: [{
832
- columns: [Ke]
832
+ columns: [Xe]
833
833
  }],
834
834
  /**
835
835
  * Break After
@@ -1024,7 +1024,7 @@ const fe = (e) => {
1024
1024
  * @see https://tailwindcss.com/docs/z-index
1025
1025
  */
1026
1026
  z: [{
1027
- z: ["auto", vt, ee]
1027
+ z: ["auto", xt, ee]
1028
1028
  }],
1029
1029
  // Flexbox and Grid
1030
1030
  /**
@@ -1074,14 +1074,14 @@ const fe = (e) => {
1074
1074
  * @see https://tailwindcss.com/docs/order
1075
1075
  */
1076
1076
  order: [{
1077
- order: ["first", "last", "none", vt, ee]
1077
+ order: ["first", "last", "none", xt, ee]
1078
1078
  }],
1079
1079
  /**
1080
1080
  * Grid Template Columns
1081
1081
  * @see https://tailwindcss.com/docs/grid-template-columns
1082
1082
  */
1083
1083
  "grid-cols": [{
1084
- "grid-cols": [kt]
1084
+ "grid-cols": [vt]
1085
1085
  }],
1086
1086
  /**
1087
1087
  * Grid Column Start / End
@@ -1089,7 +1089,7 @@ const fe = (e) => {
1089
1089
  */
1090
1090
  "col-start-end": [{
1091
1091
  col: ["auto", {
1092
- span: ["full", vt, ee]
1092
+ span: ["full", xt, ee]
1093
1093
  }, ee]
1094
1094
  }],
1095
1095
  /**
@@ -1111,7 +1111,7 @@ const fe = (e) => {
1111
1111
  * @see https://tailwindcss.com/docs/grid-template-rows
1112
1112
  */
1113
1113
  "grid-rows": [{
1114
- "grid-rows": [kt]
1114
+ "grid-rows": [vt]
1115
1115
  }],
1116
1116
  /**
1117
1117
  * Grid Row Start / End
@@ -1119,7 +1119,7 @@ const fe = (e) => {
1119
1119
  */
1120
1120
  "row-start-end": [{
1121
1121
  row: ["auto", {
1122
- span: [vt, ee]
1122
+ span: [xt, ee]
1123
1123
  }, ee]
1124
1124
  }],
1125
1125
  /**
@@ -1413,8 +1413,8 @@ const fe = (e) => {
1413
1413
  */
1414
1414
  "max-w": [{
1415
1415
  "max-w": [ee, t, "none", "full", "min", "max", "fit", "prose", {
1416
- screen: [Ke]
1417
- }, Ke]
1416
+ screen: [Xe]
1417
+ }, Xe]
1418
1418
  }],
1419
1419
  /**
1420
1420
  * Height
@@ -1450,7 +1450,7 @@ const fe = (e) => {
1450
1450
  * @see https://tailwindcss.com/docs/font-size
1451
1451
  */
1452
1452
  "font-size": [{
1453
- text: ["base", Ke, Xe]
1453
+ text: ["base", Xe, Ge]
1454
1454
  }],
1455
1455
  /**
1456
1456
  * Font Smoothing
@@ -1467,14 +1467,14 @@ const fe = (e) => {
1467
1467
  * @see https://tailwindcss.com/docs/font-weight
1468
1468
  */
1469
1469
  "font-weight": [{
1470
- font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", wn]
1470
+ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", _n]
1471
1471
  }],
1472
1472
  /**
1473
1473
  * Font Family
1474
1474
  * @see https://tailwindcss.com/docs/font-family
1475
1475
  */
1476
1476
  "font-family": [{
1477
- font: [kt]
1477
+ font: [vt]
1478
1478
  }],
1479
1479
  /**
1480
1480
  * Font Variant Numeric
@@ -1518,7 +1518,7 @@ const fe = (e) => {
1518
1518
  * @see https://tailwindcss.com/docs/line-clamp
1519
1519
  */
1520
1520
  "line-clamp": [{
1521
- "line-clamp": ["none", ct, wn]
1521
+ "line-clamp": ["none", ct, _n]
1522
1522
  }],
1523
1523
  /**
1524
1524
  * Line Height
@@ -1601,7 +1601,7 @@ const fe = (e) => {
1601
1601
  * @see https://tailwindcss.com/docs/text-decoration-thickness
1602
1602
  */
1603
1603
  "text-decoration-thickness": [{
1604
- decoration: ["auto", "from-font", Re, Xe]
1604
+ decoration: ["auto", "from-font", Re, Ge]
1605
1605
  }],
1606
1606
  /**
1607
1607
  * Text Underline Offset
@@ -1711,7 +1711,7 @@ const fe = (e) => {
1711
1711
  * @see https://tailwindcss.com/docs/background-position
1712
1712
  */
1713
1713
  "bg-position": [{
1714
- bg: [...be(), Kv]
1714
+ bg: [...be(), Yv]
1715
1715
  }],
1716
1716
  /**
1717
1717
  * Background Repeat
@@ -2097,7 +2097,7 @@ const fe = (e) => {
2097
2097
  * @see https://tailwindcss.com/docs/outline-width
2098
2098
  */
2099
2099
  "outline-w": [{
2100
- outline: [Re, Xe]
2100
+ outline: [Re, Ge]
2101
2101
  }],
2102
2102
  /**
2103
2103
  * Outline Color
@@ -2137,7 +2137,7 @@ const fe = (e) => {
2137
2137
  * @see https://tailwindcss.com/docs/ring-offset-width
2138
2138
  */
2139
2139
  "ring-offset-w": [{
2140
- "ring-offset": [Re, Xe]
2140
+ "ring-offset": [Re, Ge]
2141
2141
  }],
2142
2142
  /**
2143
2143
  * Ring Offset Color
@@ -2152,14 +2152,14 @@ const fe = (e) => {
2152
2152
  * @see https://tailwindcss.com/docs/box-shadow
2153
2153
  */
2154
2154
  shadow: [{
2155
- shadow: ["", "inner", "none", Ke, Uv]
2155
+ shadow: ["", "inner", "none", Xe, Uv]
2156
2156
  }],
2157
2157
  /**
2158
2158
  * Box Shadow Color
2159
2159
  * @see https://tailwindcss.com/docs/box-shadow-color
2160
2160
  */
2161
2161
  "shadow-color": [{
2162
- shadow: [kt]
2162
+ shadow: [vt]
2163
2163
  }],
2164
2164
  /**
2165
2165
  * Opacity
@@ -2217,7 +2217,7 @@ const fe = (e) => {
2217
2217
  * @see https://tailwindcss.com/docs/drop-shadow
2218
2218
  */
2219
2219
  "drop-shadow": [{
2220
- "drop-shadow": ["", "none", Ke, ee]
2220
+ "drop-shadow": ["", "none", Xe, ee]
2221
2221
  }],
2222
2222
  /**
2223
2223
  * Grayscale
@@ -2438,7 +2438,7 @@ const fe = (e) => {
2438
2438
  * @see https://tailwindcss.com/docs/rotate
2439
2439
  */
2440
2440
  rotate: [{
2441
- rotate: [vt, ee]
2441
+ rotate: [xt, ee]
2442
2442
  }],
2443
2443
  /**
2444
2444
  * Translate X
@@ -2732,7 +2732,7 @@ const fe = (e) => {
2732
2732
  * @see https://tailwindcss.com/docs/stroke-width
2733
2733
  */
2734
2734
  "stroke-w": [{
2735
- stroke: [Re, Xe, wn]
2735
+ stroke: [Re, Ge, _n]
2736
2736
  }],
2737
2737
  /**
2738
2738
  * Stroke
@@ -2818,7 +2818,7 @@ function n2() {
2818
2818
  throw new Error("useContextMenu must be used inside <ContextMenuHost>");
2819
2819
  return e;
2820
2820
  }
2821
- const jt = 8;
2821
+ const Lt = 8;
2822
2822
  function o2({ children: e }) {
2823
2823
  const [t, n] = ye({
2824
2824
  open: !1,
@@ -2835,11 +2835,11 @@ function o2({ children: e }) {
2835
2835
  },
2836
2836
  []
2837
2837
  ), l = Rr(() => ({ open: a, close: s }), [a, s]);
2838
- return nn(() => {
2838
+ return sn(() => {
2839
2839
  if (!t.open || !i.current) return;
2840
2840
  const c = i.current.getBoundingClientRect();
2841
2841
  let d = t.x, u = t.y;
2842
- d + c.width > window.innerWidth - jt && (d = Math.max(jt, t.x - c.width)), u + c.height > window.innerHeight - jt && (u = Math.max(jt, t.y - c.height)), r({ left: d, top: u });
2842
+ d + c.width > window.innerWidth - Lt && (d = Math.max(Lt, t.x - c.width)), u + c.height > window.innerHeight - Lt && (u = Math.max(Lt, t.y - c.height)), r({ left: d, top: u });
2843
2843
  }, [t]), se(() => {
2844
2844
  if (!t.open) return;
2845
2845
  const c = (p) => {
@@ -2907,7 +2907,7 @@ function o2({ children: e }) {
2907
2907
  )
2908
2908
  ] });
2909
2909
  }
2910
- const Co = (e) => {
2910
+ const Po = (e) => {
2911
2911
  let t;
2912
2912
  const n = /* @__PURE__ */ new Set(), o = (c, d) => {
2913
2913
  const u = typeof c == "function" ? c(t) : c;
@@ -2917,19 +2917,19 @@ const Co = (e) => {
2917
2917
  }
2918
2918
  }, r = () => t, a = { setState: o, getState: r, getInitialState: () => l, subscribe: (c) => (n.add(c), () => n.delete(c)) }, l = t = e(o, r, a);
2919
2919
  return a;
2920
- }, r2 = ((e) => e ? Co(e) : Co), i2 = (e) => e;
2920
+ }, r2 = ((e) => e ? Po(e) : Po), i2 = (e) => e;
2921
2921
  function s2(e, t = i2) {
2922
- const n = Bt.useSyncExternalStore(
2922
+ const n = jt.useSyncExternalStore(
2923
2923
  e.subscribe,
2924
- Bt.useCallback(() => t(e.getState()), [e, t]),
2925
- Bt.useCallback(() => t(e.getInitialState()), [e, t])
2924
+ jt.useCallback(() => t(e.getState()), [e, t]),
2925
+ jt.useCallback(() => t(e.getInitialState()), [e, t])
2926
2926
  );
2927
- return Bt.useDebugValue(n), n;
2927
+ return jt.useDebugValue(n), n;
2928
2928
  }
2929
- const Io = (e) => {
2929
+ const Oo = (e) => {
2930
2930
  const t = r2(e), n = (o) => s2(t, o);
2931
2931
  return Object.assign(n, t), n;
2932
- }, on = ((e) => e ? Io(e) : Io), Po = {
2932
+ }, an = ((e) => e ? Oo(e) : Oo), Bo = {
2933
2933
  zh: {
2934
2934
  "common.unnamed": "未命名",
2935
2935
  "common.close": "关闭",
@@ -3290,20 +3290,20 @@ function a2() {
3290
3290
  }
3291
3291
  return typeof navigator < "u" && typeof navigator.language == "string" ? navigator.language.toLowerCase().startsWith("zh") ? "zh" : "en" : "zh";
3292
3292
  }
3293
- function Oo(e) {
3293
+ function jo(e) {
3294
3294
  try {
3295
3295
  window.localStorage.setItem(ci, e);
3296
3296
  } catch {
3297
3297
  }
3298
3298
  }
3299
- const rn = on((e, t) => ({
3299
+ const ln = an((e, t) => ({
3300
3300
  locale: a2(),
3301
3301
  setLocale: (n) => {
3302
- Oo(n), e({ locale: n });
3302
+ jo(n), e({ locale: n });
3303
3303
  },
3304
3304
  toggle: () => {
3305
3305
  const n = t().locale === "zh" ? "en" : "zh";
3306
- Oo(n), e({ locale: n });
3306
+ jo(n), e({ locale: n });
3307
3307
  }
3308
3308
  }));
3309
3309
  function di(e, t) {
@@ -3313,13 +3313,13 @@ function di(e, t) {
3313
3313
  ) : e;
3314
3314
  }
3315
3315
  function ui(e, t) {
3316
- return Po[e][t] ?? Po.zh[t] ?? t;
3316
+ return Bo[e][t] ?? Bo.zh[t] ?? t;
3317
3317
  }
3318
3318
  function _e(e, t) {
3319
- return di(ui(rn.getState().locale, e), t);
3319
+ return di(ui(ln.getState().locale, e), t);
3320
3320
  }
3321
3321
  function ae() {
3322
- const e = rn((t) => t.locale);
3322
+ const e = ln((t) => t.locale);
3323
3323
  return (t, n) => di(ui(e, t), n);
3324
3324
  }
3325
3325
  function mi(e, t) {
@@ -3339,12 +3339,12 @@ function mi(e, t) {
3339
3339
  removeItem: (r) => n.removeItem(r)
3340
3340
  };
3341
3341
  }
3342
- const zn = (e) => (t) => {
3342
+ const Rn = (e) => (t) => {
3343
3343
  try {
3344
3344
  const n = e(t);
3345
3345
  return n instanceof Promise ? n : {
3346
3346
  then(o) {
3347
- return zn(o)(n);
3347
+ return Rn(o)(n);
3348
3348
  },
3349
3349
  catch(o) {
3350
3350
  return this;
@@ -3356,7 +3356,7 @@ const zn = (e) => (t) => {
3356
3356
  return this;
3357
3357
  },
3358
3358
  catch(o) {
3359
- return zn(o)(n);
3359
+ return Rn(o)(n);
3360
3360
  }
3361
3361
  };
3362
3362
  }
@@ -3407,7 +3407,7 @@ const zn = (e) => (t) => {
3407
3407
  return S((I = o()) != null ? I : p);
3408
3408
  });
3409
3409
  const x = (($ = i.onRehydrateStorage) == null ? void 0 : $.call(i, (w = o()) != null ? w : p)) || void 0;
3410
- return zn(d.getItem.bind(d))(i.name).then((S) => {
3410
+ return Rn(d.getItem.bind(d))(i.name).then((S) => {
3411
3411
  if (S)
3412
3412
  if (typeof S.version == "number" && S.version !== i.version) {
3413
3413
  if (i.migrate) {
@@ -3505,7 +3505,7 @@ function u2(e) {
3505
3505
  mirror: (e == null ? void 0 : e.mirror) ?? !1
3506
3506
  };
3507
3507
  }
3508
- function Dn(e) {
3508
+ function Fn(e) {
3509
3509
  return e === 90 || e === 270 ? "y" : "x";
3510
3510
  }
3511
3511
  function De(e, t) {
@@ -3536,13 +3536,13 @@ const m2 = {
3536
3536
  e: "w",
3537
3537
  w: "e"
3538
3538
  };
3539
- function Gt(e, t) {
3539
+ function Xt(e, t) {
3540
3540
  let n = t.mirror ? f2[e] : e;
3541
3541
  const o = t.rot / 90 | 0;
3542
3542
  for (let r = 0; r < o; r++) n = m2[n];
3543
3543
  return n;
3544
3544
  }
3545
- function Bo(e) {
3545
+ function Lo(e) {
3546
3546
  switch (e) {
3547
3547
  case "n":
3548
3548
  return [0, -1];
@@ -3556,8 +3556,8 @@ function Bo(e) {
3556
3556
  }
3557
3557
  class hi {
3558
3558
  constructor() {
3559
- xt(this, "parent", /* @__PURE__ */ new Map());
3560
- xt(this, "rank", /* @__PURE__ */ new Map());
3559
+ wt(this, "parent", /* @__PURE__ */ new Map());
3560
+ wt(this, "rank", /* @__PURE__ */ new Map());
3561
3561
  }
3562
3562
  add(t) {
3563
3563
  this.parent.has(t) || (this.parent.set(t, t), this.rank.set(t, 0));
@@ -3587,19 +3587,19 @@ class hi {
3587
3587
  return t;
3588
3588
  }
3589
3589
  }
3590
- const jo = ["n", "e", "s", "w"], Lo = {
3590
+ const zo = ["n", "e", "s", "w"], Do = {
3591
3591
  n: "s",
3592
3592
  s: "n",
3593
3593
  e: "w",
3594
3594
  w: "e"
3595
3595
  };
3596
- function Lt(e, t) {
3597
- const n = jo.indexOf(e), r = ((jo.indexOf(t) - n) % 4 + 4) % 4;
3596
+ function zt(e, t) {
3597
+ const n = zo.indexOf(e), r = ((zo.indexOf(t) - n) % 4 + 4) % 4;
3598
3598
  return [0, 90, 180, 270][r];
3599
3599
  }
3600
- const xn = 320, zt = 220, _t = 260, vn = 720, $t = 30, zo = 30, Ye = 80, Do = 10, h2 = 60, p2 = 520, g2 = 80, y2 = 80, Ro = 8, Fo = /* @__PURE__ */ new Set(["source", "renewable"]);
3600
+ const $n = 320, Dt = 220, kt = 260, Sn = 720, _t = 30, Ro = 30, Ye = 80, Fo = 10, h2 = 60, p2 = 520, g2 = 80, y2 = 80, Ho = 8, Wo = /* @__PURE__ */ new Set(["source", "renewable"]);
3601
3601
  function b2(e) {
3602
- var xo, vo, ko, _o, $o, So;
3602
+ var ko, _o, $o, So, No, Eo;
3603
3603
  const { elements: t, buses: n, junctions: o, wires: r, library: i, userLayout: s, userBusLayout: a } = e, l = new Map(s), c = new Map(a), d = /* @__PURE__ */ new Map(), u = new Set(s.keys()), f = new Set(a.keys()), p = /* @__PURE__ */ new Map();
3604
3604
  for (const y of t) p.set(y.id, y);
3605
3605
  const h = /* @__PURE__ */ new Map();
@@ -3679,52 +3679,52 @@ function b2(e) {
3679
3679
  }
3680
3680
  return null;
3681
3681
  }, P = (C) => {
3682
- const T = (Y) => {
3682
+ const T = (K) => {
3683
3683
  var Q;
3684
- return ((Q = E.get(Y)) == null ? void 0 : Q.size) ?? 0;
3685
- }, B = (Y) => {
3684
+ return ((Q = E.get(K)) == null ? void 0 : Q.size) ?? 0;
3685
+ }, B = (K) => {
3686
3686
  var Q;
3687
- return ((Q = g(Y)) == null ? void 0 : Q.category) ?? "";
3688
- }, L = (Y) => {
3689
- const Q = B(Y);
3690
- return Q === "source" ? 0 : Q === "renewable" ? 1 : 2 + Math.min(T(Y), 9) / 10;
3691
- }, F = C.filter(N).sort((Y, Q) => L(Y) - L(Q) || Y.localeCompare(Q))[0];
3687
+ return ((Q = g(K)) == null ? void 0 : Q.category) ?? "";
3688
+ }, L = (K) => {
3689
+ const Q = B(K);
3690
+ return Q === "source" ? 0 : Q === "renewable" ? 1 : 2 + Math.min(T(K), 9) / 10;
3691
+ }, F = C.filter(N).sort((K, Q) => L(K) - L(Q) || K.localeCompare(Q))[0];
3692
3692
  if (!F) return;
3693
- const q = /* @__PURE__ */ new Map([[F, null]]), H = /* @__PURE__ */ new Map([[F, 0]]), J = /* @__PURE__ */ new Map(), Z = [], G = [F], K = /* @__PURE__ */ new Set([F]);
3693
+ const q = /* @__PURE__ */ new Map([[F, null]]), H = /* @__PURE__ */ new Map([[F, 0]]), J = /* @__PURE__ */ new Map(), Z = [], G = [F], Y = /* @__PURE__ */ new Set([F]);
3694
3694
  for (; G.length; ) {
3695
- const Y = G.shift();
3696
- Z.push(Y);
3697
- for (const Q of [...E.get(Y) ?? []].sort((Ee, Me) => Ee.localeCompare(Me)))
3698
- K.has(Q) || (K.add(Q), q.set(Q, Y), H.set(Q, (H.get(Y) ?? 0) + 1), J.has(Y) || J.set(Y, []), J.get(Y).push(Q), G.push(Q));
3695
+ const K = G.shift();
3696
+ Z.push(K);
3697
+ for (const Q of [...E.get(K) ?? []].sort((Ee, Me) => Ee.localeCompare(Me)))
3698
+ Y.has(Q) || (Y.add(Q), q.set(Q, K), H.set(Q, (H.get(K) ?? 0) + 1), J.has(K) || J.set(K, []), J.get(K).push(Q), G.push(Q));
3699
3699
  }
3700
3700
  let U = 0;
3701
- const ce = /* @__PURE__ */ new Map(), ke = (Y) => {
3702
- const Q = J.get(Y) ?? [];
3701
+ const ce = /* @__PURE__ */ new Map(), ke = (K) => {
3702
+ const Q = J.get(K) ?? [];
3703
3703
  if (Q.length === 0) {
3704
- ce.set(Y, U++);
3704
+ ce.set(K, U++);
3705
3705
  return;
3706
3706
  }
3707
3707
  for (const Me of Q) ke(Me);
3708
3708
  const Ee = Q.map((Me) => ce.get(Me));
3709
- ce.set(Y, Ee.reduce((Me, Ot) => Me + Ot, 0) / Ee.length);
3709
+ ce.set(K, Ee.reduce((Me, Bt) => Me + Bt, 0) / Ee.length);
3710
3710
  };
3711
3711
  ke(F);
3712
- for (const Y of Z) {
3713
- const Q = pe(xn + (ce.get(Y) ?? 0) * 160), Ee = pe(zt + (H.get(Y) ?? 0) * 140);
3714
- if (k.has(Y)) {
3715
- d.set(Y, [Q, Ee]);
3712
+ for (const K of Z) {
3713
+ const Q = pe($n + (ce.get(K) ?? 0) * 160), Ee = pe(Dt + (H.get(K) ?? 0) * 140);
3714
+ if (k.has(K)) {
3715
+ d.set(K, [Q, Ee]);
3716
3716
  continue;
3717
3717
  }
3718
3718
  let Me = 0;
3719
- const Ot = q.get(Y) ?? null;
3720
- if (Ot) {
3721
- const wt = z(Y, Ot);
3722
- wt && (Me = Lt(wt.orientation, "n"));
3719
+ const Bt = q.get(K) ?? null;
3720
+ if (Bt) {
3721
+ const bt = z(K, Bt);
3722
+ bt && (Me = zt(bt.orientation, "n"));
3723
3723
  } else {
3724
- const wt = (J.get(Y) ?? [])[0], No = wt ? z(Y, wt) : null;
3725
- No && (Me = Lt(No.orientation, "s"));
3724
+ const bt = (J.get(K) ?? [])[0], Mo = bt ? z(K, bt) : null;
3725
+ Mo && (Me = zt(Mo.orientation, "s"));
3726
3726
  }
3727
- l.set(Y, { at: [Q, Ee], rot: Me, mirror: !1 }), u.add(Y);
3727
+ l.set(K, { at: [Q, Ee], rot: Me, mirror: !1 }), u.add(K);
3728
3728
  }
3729
3729
  }, O = /* @__PURE__ */ new Set();
3730
3730
  for (const C of E.keys()) {
@@ -3755,7 +3755,7 @@ function b2(e) {
3755
3755
  const te = [], le = /* @__PURE__ */ new Set();
3756
3756
  for (const [y, v] of V)
3757
3757
  if (new Set(v.map((M) => M.busId)).size >= 2) {
3758
- const M = ((vo = i.get(((xo = p.get(y)) == null ? void 0 : xo.kind) ?? "")) == null ? void 0 : vo.category) === "transformer" ? "vertical" : "horizontal";
3758
+ const M = ((_o = i.get(((ko = p.get(y)) == null ? void 0 : ko.kind) ?? "")) == null ? void 0 : _o.category) === "transformer" ? "vertical" : "horizontal";
3759
3759
  te.push({ elementId: y, attachments: v, orientation: M }), M === "vertical" && le.add(y);
3760
3760
  }
3761
3761
  const R = /* @__PURE__ */ new Map(), W = (y, v) => {
@@ -3815,7 +3815,7 @@ function b2(e) {
3815
3815
  const T = P.slice(0, O), B = p.get(T);
3816
3816
  if (B) {
3817
3817
  const L = (z = i.get(B.kind)) == null ? void 0 : z.category;
3818
- if (L && Fo.has(L)) return !0;
3818
+ if (L && Wo.has(L)) return !0;
3819
3819
  }
3820
3820
  }
3821
3821
  const C = R.get(P);
@@ -3881,12 +3881,12 @@ function b2(e) {
3881
3881
  const v = Array.from(new Set(y.attachments.map((N) => N.busId)));
3882
3882
  for (const N of v)
3883
3883
  for (const M of v)
3884
- N !== M && ((ko = me.get(N)) == null || ko.set(M, y));
3884
+ N !== M && (($o = me.get(N)) == null || $o.set(M, y));
3885
3885
  }
3886
3886
  const be = (y) => {
3887
3887
  var N;
3888
3888
  const v = (N = i.get(y)) == null ? void 0 : N.category;
3889
- return v ? Fo.has(v) : !1;
3889
+ return v ? Wo.has(v) : !1;
3890
3890
  }, ne = [];
3891
3891
  for (const y of n) {
3892
3892
  const v = X.get(y.id);
@@ -3968,23 +3968,23 @@ function b2(e) {
3968
3968
  for (const J of H) {
3969
3969
  if (J === T || z.has(J) || A.has(J)) continue;
3970
3970
  const Z = $(T) || $(J);
3971
- C(J, T, Z ? zo : $t, B);
3971
+ C(J, T, Z ? Ro : _t, B);
3972
3972
  }
3973
3973
  }
3974
3974
  return { extent: 0 };
3975
3975
  }, Ae = (y, v) => {
3976
3976
  var T, B, L;
3977
3977
  const N = (T = me.get(y)) == null ? void 0 : T.get(v);
3978
- if (!N || N.orientation === "horizontal") return _t;
3978
+ if (!N || N.orientation === "horizontal") return kt;
3979
3979
  const M = g(N.elementId);
3980
- if (!M) return _t;
3980
+ if (!M) return kt;
3981
3981
  const E = (B = N.attachments.find((F) => F.busId === y)) == null ? void 0 : B.pin, _ = (L = N.attachments.find((F) => F.busId === v)) == null ? void 0 : L.pin;
3982
- if (!E || !_) return _t;
3982
+ if (!E || !_) return kt;
3983
3983
  const A = M.terminals.find((F) => F.id === E), z = M.terminals.find((F) => F.id === _);
3984
- if (!A || !z) return _t;
3984
+ if (!A || !z) return kt;
3985
3985
  const P = Math.abs(z.y - A.y), O = Ne(N, y, E).extent, C = Ne(N, v, _).extent;
3986
3986
  return O + P + C;
3987
- }, fn = /* @__PURE__ */ new Map();
3987
+ }, yn = /* @__PURE__ */ new Map();
3988
3988
  for (const y of te) {
3989
3989
  if (y.orientation !== "vertical") continue;
3990
3990
  const v = y.attachments.slice().sort(
@@ -3992,14 +3992,14 @@ function b2(e) {
3992
3992
  );
3993
3993
  if (v.length < 2) continue;
3994
3994
  const N = v[0].busId, M = v[1].busId, E = v[0].pin, A = Ne(y, N, E).head ?? y.elementId;
3995
- fn.set(A, { lowerBusId: M });
3995
+ yn.set(A, { lowerBusId: M });
3996
3996
  }
3997
- const so = 30, ao = (y) => {
3997
+ const lo = 30, co = (y) => {
3998
3998
  const v = g(y);
3999
3999
  return Math.max((v == null ? void 0 : v.width) ?? Ye, Ye);
4000
- }, qx = 2, lo = (y, v, N, M = 0) => {
4000
+ }, qx = 2, uo = (y, v, N, M = 0) => {
4001
4001
  const E = g(v);
4002
- let _ = ao(v);
4002
+ let _ = co(v);
4003
4003
  if (E && !N.has(v) && M < qx) {
4004
4004
  N.add(v);
4005
4005
  let A = 0;
@@ -4026,32 +4026,32 @@ function b2(e) {
4026
4026
  const F = [...O].find(
4027
4027
  (q) => q.indexOf(".") > 0 && q.slice(0, q.indexOf(".")) === L
4028
4028
  );
4029
- B += (F ? lo(F, L, N, M + 1) : ao(L)) + so;
4029
+ B += (F ? uo(F, L, N, M + 1) : co(L)) + lo;
4030
4030
  }
4031
- A = Math.max(A, B - so);
4031
+ A = Math.max(A, B - lo);
4032
4032
  }
4033
4033
  }
4034
4034
  N.delete(v), _ = Math.max(_, A);
4035
4035
  }
4036
4036
  return _;
4037
- }, gt = 320, ot = /* @__PURE__ */ new Map(), co = (y, v) => {
4037
+ }, pt = 320, ot = /* @__PURE__ */ new Map(), mo = (y, v) => {
4038
4038
  if (!le.has(y)) return !1;
4039
4039
  const N = te.find((A) => A.elementId === y), M = N == null ? void 0 : N.attachments.find((A) => A.busId !== v);
4040
4040
  if (!M) return !1;
4041
4041
  const E = re.get(v) ?? 0;
4042
4042
  return (re.get(M.busId) ?? 0) < E;
4043
- }, yt = (y, v, N) => {
4044
- const M = fn.get(y);
4043
+ }, gt = (y, v, N) => {
4044
+ const M = yn.get(y);
4045
4045
  if (M) {
4046
4046
  const _ = ot.get(M.lowerBusId);
4047
4047
  if (_ !== void 0)
4048
4048
  return Math.max(v, _ + Ye);
4049
4049
  }
4050
4050
  let E = 0;
4051
- return N && (E = lo(N, y, /* @__PURE__ */ new Set())), Math.max(v, Ye, E);
4052
- }, uo = (y, v) => {
4051
+ return N && (E = uo(N, y, /* @__PURE__ */ new Set())), Math.max(v, Ye, E);
4052
+ }, fo = (y, v) => {
4053
4053
  if (ot.has(y)) return ot.get(y);
4054
- if (v.has(y)) return gt;
4054
+ if (v.has(y)) return pt;
4055
4055
  v.add(y);
4056
4056
  const N = X.get(y) ?? [];
4057
4057
  let M = 0, E = 0;
@@ -4060,14 +4060,14 @@ function b2(e) {
4060
4060
  const z = A.indexOf(".");
4061
4061
  if (z < 0) continue;
4062
4062
  const P = A.slice(0, z), O = A.slice(z + 1);
4063
- if (co(P, y)) continue;
4063
+ if (mo(P, y)) continue;
4064
4064
  const C = g(P);
4065
4065
  if (!C) continue;
4066
4066
  const T = C.terminals.find((F) => F.id === O);
4067
4067
  if (!T) continue;
4068
- const B = fn.get(P);
4069
- B && uo(B.lowerBusId, v);
4070
- const L = yt(
4068
+ const B = yn.get(P);
4069
+ B && fo(B.lowerBusId, v);
4070
+ const L = gt(
4071
4071
  P,
4072
4072
  C.width,
4073
4073
  `${P}.${O}`
@@ -4075,13 +4075,13 @@ function b2(e) {
4075
4075
  T.y > 0 ? M += L : E += L;
4076
4076
  }
4077
4077
  const _ = Math.max(
4078
- gt,
4078
+ pt,
4079
4079
  Math.max(M, E) + Ye
4080
4080
  );
4081
4081
  return ot.set(y, _), v.delete(y), _;
4082
4082
  };
4083
- for (const y of n) uo(y.id, /* @__PURE__ */ new Set());
4084
- const Ge = /* @__PURE__ */ new Map(), Gx = (y, v, N) => {
4083
+ for (const y of n) fo(y.id, /* @__PURE__ */ new Set());
4084
+ const qe = /* @__PURE__ */ new Map(), Gx = (y, v, N) => {
4085
4085
  const M = g(v);
4086
4086
  if (!M) return;
4087
4087
  const E = `${v}.${N}`, _ = M.terminals.filter((P) => P.id !== N).map((P) => `${v}.${P.id}`);
@@ -4120,7 +4120,7 @@ function b2(e) {
4120
4120
  if (B < 0) return [];
4121
4121
  const L = T.slice(0, B), F = T.slice(B + 1);
4122
4122
  if (l.has(L)) return [];
4123
- if (co(L, y)) return [];
4123
+ if (mo(L, y)) return [];
4124
4124
  const q = g(L);
4125
4125
  if (!q) return [];
4126
4126
  const H = q.terminals.find((J) => J.id === F);
@@ -4137,31 +4137,31 @@ function b2(e) {
4137
4137
  for (const T of M)
4138
4138
  T.localTerm.y > 0 ? E.push(T) : _.push(T);
4139
4139
  const A = (T) => T.reduce(
4140
- (B, L) => B + yt(L.elId, L.lib.width, L.busFacingRef),
4140
+ (B, L) => B + gt(L.elId, L.lib.width, L.busFacingRef),
4141
4141
  0
4142
4142
  ), z = Math.max(A(E), A(_)) + Ye, P = Math.max(N.span, z);
4143
4143
  P !== N.span && !f.has(y) && c.set(y, { ...N, span: P });
4144
4144
  const O = c.get(y), C = (T, B) => {
4145
4145
  if (T.length === 0) return;
4146
4146
  const L = /* @__PURE__ */ new Map();
4147
- for (const K of T) {
4148
- const U = Gx(y, K.elId, K.localTerm.id);
4149
- U !== void 0 && L.set(K.elId, U);
4147
+ for (const Y of T) {
4148
+ const U = Gx(y, Y.elId, Y.localTerm.id);
4149
+ U !== void 0 && L.set(Y.elId, U);
4150
4150
  }
4151
- T.sort((K, U) => {
4152
- const ce = L.get(K.elId) ?? O.at[0], ke = L.get(U.elId) ?? O.at[0];
4151
+ T.sort((Y, U) => {
4152
+ const ce = L.get(Y.elId) ?? O.at[0], ke = L.get(U.elId) ?? O.at[0];
4153
4153
  if (ce !== ke) return ce - ke;
4154
- const Y = yt(K.elId, K.lib.width, K.busFacingRef);
4155
- return yt(U.elId, U.lib.width, U.busFacingRef) - Y;
4154
+ const K = gt(Y.elId, Y.lib.width, Y.busFacingRef);
4155
+ return gt(U.elId, U.lib.width, U.busFacingRef) - K;
4156
4156
  });
4157
4157
  const F = T.map(
4158
- (K) => yt(K.elId, K.lib.width, K.busFacingRef)
4159
- ), q = F.reduce((K, U) => K + U, 0), H = Math.max(P, q), J = (H - q) / (T.length + 1);
4158
+ (Y) => gt(Y.elId, Y.lib.width, Y.busFacingRef)
4159
+ ), q = F.reduce((Y, U) => Y + U, 0), H = Math.max(P, q), J = (H - q) / (T.length + 1);
4160
4160
  let Z = O.at[0] - H / 2 + J;
4161
- const G = O.at[1] + B * zo;
4162
- for (let K = 0; K < T.length; K++) {
4163
- const U = T[K], ce = F[K], ke = Z + ce / 2;
4164
- U.isLinker ? Ge.has(U.elId) || Ge.set(U.elId, ke) : l.set(U.elId, {
4161
+ const G = O.at[1] + B * Ro;
4162
+ for (let Y = 0; Y < T.length; Y++) {
4163
+ const U = T[Y], ce = F[Y], ke = Z + ce / 2;
4164
+ U.isLinker ? qe.has(U.elId) || qe.set(U.elId, ke) : l.set(U.elId, {
4165
4165
  at: [pe(ke - U.localTerm.x), pe(G - U.localTerm.y)],
4166
4166
  rot: 0,
4167
4167
  mirror: !1
@@ -4169,7 +4169,7 @@ function b2(e) {
4169
4169
  }
4170
4170
  };
4171
4171
  C(E, -1), C(_, 1);
4172
- }, Kx = (y) => {
4172
+ }, Yx = (y) => {
4173
4173
  if (l.has(y.elementId) || y.orientation === "horizontal") return;
4174
4174
  const v = g(y.elementId);
4175
4175
  if (!v) return;
@@ -4188,28 +4188,28 @@ function b2(e) {
4188
4188
  for (const Z of B) {
4189
4189
  const G = Ne(y, Z.busId, Z.pin);
4190
4190
  F = Math.max(F, G.extent);
4191
- const K = G.head ? l.get(G.head) : void 0;
4192
- K ? L.push(K.at[0]) : Ge.has(y.elementId) ? L.push(Ge.get(y.elementId)) : L.push(c.get(Z.busId).at[0]);
4191
+ const Y = G.head ? l.get(G.head) : void 0;
4192
+ Y ? L.push(Y.at[0]) : qe.has(y.elementId) ? L.push(qe.get(y.elementId)) : L.push(c.get(Z.busId).at[0]);
4193
4193
  }
4194
4194
  let q;
4195
- L.length > 0 ? q = L.reduce((Z, G) => Z + G, 0) / L.length : Ge.has(y.elementId) ? q = Ge.get(y.elementId) : q = _.at[0];
4195
+ L.length > 0 ? q = L.reduce((Z, G) => Z + G, 0) / L.length : qe.has(y.elementId) ? q = qe.get(y.elementId) : q = _.at[0];
4196
4196
  const H = _.at[1] + F, J = C === 0 ? [pe(q - P.x), pe(H - P.y)] : [pe(q + P.x), pe(H + P.y)];
4197
4197
  if (l.set(y.elementId, { at: J, rot: C, mirror: !1 }), B.length > 1) {
4198
4198
  const Z = l.get(y.elementId), G = De(
4199
4199
  [P.x, P.y],
4200
4200
  Z
4201
- ), K = Gt(
4201
+ ), Y = Xt(
4202
4202
  P.orientation,
4203
4203
  Z
4204
4204
  );
4205
- Yx(
4205
+ Kx(
4206
4206
  `${y.elementId}.${A}`,
4207
4207
  G,
4208
- K,
4208
+ Y,
4209
4209
  q
4210
4210
  );
4211
4211
  }
4212
- }, Yx = (y, v, N, M) => {
4212
+ }, Kx = (y, v, N, M) => {
4213
4213
  const E = /* @__PURE__ */ new Set([y]);
4214
4214
  let _ = y, A = v, z = N;
4215
4215
  for (; ; ) {
@@ -4239,24 +4239,24 @@ function b2(e) {
4239
4239
  if (!F) break;
4240
4240
  const q = F.terminals.find((Q) => Q.id === L);
4241
4241
  if (!q) break;
4242
- const H = Bo(z), J = [
4243
- A[0] + H[0] * $t,
4244
- A[1] + H[1] * $t
4245
- ], Z = Lo[z], G = Lt(q.orientation, Z), K = De([q.x, q.y], {
4242
+ const H = Lo(z), J = [
4243
+ A[0] + H[0] * _t,
4244
+ A[1] + H[1] * _t
4245
+ ], Z = Do[z], G = zt(q.orientation, Z), Y = De([q.x, q.y], {
4246
4246
  at: [0, 0],
4247
4247
  rot: G,
4248
4248
  mirror: !1
4249
4249
  }), U = [
4250
- pe(M - K[0]),
4251
- pe(J[1] - K[1])
4250
+ pe(M - Y[0]),
4251
+ pe(J[1] - Y[1])
4252
4252
  ];
4253
4253
  l.set(B, { at: U, rot: G, mirror: !1 }), E.add(O);
4254
4254
  const ce = F.terminals.find((Q) => Q.id !== L);
4255
4255
  if (!ce) break;
4256
4256
  const ke = `${B}.${ce.id}`;
4257
4257
  E.add(ke);
4258
- const Y = { at: U, rot: G, mirror: !1 };
4259
- A = De([ce.x, ce.y], Y), z = Gt(ce.orientation, Y), _ = ke;
4258
+ const K = { at: U, rot: G, mirror: !1 };
4259
+ A = De([ce.x, ce.y], K), z = Xt(ce.orientation, K), _ = ke;
4260
4260
  }
4261
4261
  }, Vx = (y) => {
4262
4262
  if (l.has(y.elementId) || y.orientation !== "horizontal") return;
@@ -4277,53 +4277,53 @@ function b2(e) {
4277
4277
  rot: P,
4278
4278
  mirror: !1
4279
4279
  });
4280
- }, mo = 100;
4281
- let Pt = zt;
4280
+ }, ho = 100;
4281
+ let Ot = Dt;
4282
4282
  for (let y = 0; y < ve.length; y++) {
4283
4283
  const v = ve[y], N = we.get(v);
4284
4284
  let M;
4285
4285
  if (y === 0)
4286
- M = zt;
4286
+ M = Dt;
4287
4287
  else {
4288
4288
  const _ = we.get(ve[y - 1]);
4289
4289
  let A = 0;
4290
4290
  for (const z of _)
4291
4291
  for (const P of N)
4292
- (_o = me.get(z)) != null && _o.get(P) && (A = Math.max(A, Ae(z, P)));
4293
- A === 0 && (A = _t), M = Pt + A;
4292
+ (So = me.get(z)) != null && So.get(P) && (A = Math.max(A, Ae(z, P)));
4293
+ A === 0 && (A = kt), M = Ot + A;
4294
4294
  }
4295
- Pt = M;
4296
- let E = xn;
4295
+ Ot = M;
4296
+ let E = $n;
4297
4297
  for (const _ of N) {
4298
4298
  if (c.has(_)) {
4299
- Pt = Math.max(Pt, c.get(_).at[1]);
4299
+ Ot = Math.max(Ot, c.get(_).at[1]);
4300
4300
  continue;
4301
4301
  }
4302
4302
  let A;
4303
4303
  if (y > 0) {
4304
4304
  const P = we.get(ve[y - 1]), O = [];
4305
4305
  for (const C of P) {
4306
- const T = ($o = me.get(C)) == null ? void 0 : $o.get(_);
4306
+ const T = (No = me.get(C)) == null ? void 0 : No.get(_);
4307
4307
  if (!T || T.orientation !== "vertical") continue;
4308
- const B = (So = T.attachments.find(
4308
+ const B = (Eo = T.attachments.find(
4309
4309
  (F) => F.busId === C
4310
- )) == null ? void 0 : So.pin;
4310
+ )) == null ? void 0 : Eo.pin;
4311
4311
  if (!B) continue;
4312
4312
  const L = Ne(T, C, B);
4313
- L.head && l.has(L.head) ? O.push(l.get(L.head).at[0]) : Ge.has(T.elementId) ? O.push(Ge.get(T.elementId)) : O.push(c.get(C).at[0]);
4313
+ L.head && l.has(L.head) ? O.push(l.get(L.head).at[0]) : qe.has(T.elementId) ? O.push(qe.get(T.elementId)) : O.push(c.get(C).at[0]);
4314
4314
  }
4315
4315
  O.length > 0 && (A = O.reduce((C, T) => C + T, 0) / O.length);
4316
4316
  }
4317
4317
  if (A === void 0) {
4318
- const P = ot.get(_) ?? vn;
4319
- A = E + P / 2, E += P + mo;
4318
+ const P = ot.get(_) ?? Sn;
4319
+ A = E + P / 2, E += P + ho;
4320
4320
  }
4321
- const z = ot.get(_) ?? vn;
4321
+ const z = ot.get(_) ?? Sn;
4322
4322
  c.set(_, {
4323
4323
  at: [pe(A), pe(M)],
4324
4324
  rot: 0,
4325
4325
  span: z,
4326
- axis: Dn(0)
4326
+ axis: Fn(0)
4327
4327
  });
4328
4328
  }
4329
4329
  for (const _ of N)
@@ -4332,7 +4332,7 @@ function b2(e) {
4332
4332
  for (const _ of te)
4333
4333
  l.has(_.elementId) || !_.attachments.some(
4334
4334
  (z) => N.includes(z.busId)
4335
- ) || Kx(_);
4335
+ ) || Yx(_);
4336
4336
  for (const _ of te)
4337
4337
  _.orientation !== "horizontal" || l.has(_.elementId) || !_.attachments.every(
4338
4338
  (z) => N.includes(z.busId)
@@ -4366,7 +4366,7 @@ function b2(e) {
4366
4366
  }
4367
4367
  _.length >= 2 && N.push(_);
4368
4368
  }
4369
- let M = xn;
4369
+ let M = $n;
4370
4370
  for (const E of N) {
4371
4371
  if (E.some((O) => l.has(O))) continue;
4372
4372
  E.sort((O, C) => {
@@ -4384,10 +4384,10 @@ function b2(e) {
4384
4384
  mirror: !1
4385
4385
  }) : [0, 0];
4386
4386
  l.set(_, {
4387
- at: [pe(M - P[0]), pe(zt - P[1])],
4387
+ at: [pe(M - P[0]), pe(Dt - P[1])],
4388
4388
  rot: 0,
4389
4389
  mirror: !1
4390
- }), M += Math.max(vn, E.length * Ye) + mo;
4390
+ }), M += Math.max(Sn, E.length * Ye) + ho;
4391
4391
  }
4392
4392
  }
4393
4393
  const Ux = (y) => {
@@ -4395,18 +4395,18 @@ function b2(e) {
4395
4395
  const v = y.indexOf(".");
4396
4396
  return v < 0 ? !1 : l.has(y.slice(0, v));
4397
4397
  };
4398
- let hn = !0, Jx = t.length + 4;
4399
- for (; hn && Jx-- > 0; ) {
4400
- hn = !1;
4398
+ let bn = !0, Jx = t.length + 4;
4399
+ for (; bn && Jx-- > 0; ) {
4400
+ bn = !1;
4401
4401
  for (const y of I) {
4402
4402
  if (y.length < 2) continue;
4403
4403
  const v = [], N = /* @__PURE__ */ new Map();
4404
4404
  for (const G of y) {
4405
4405
  if ($(G))
4406
4406
  continue;
4407
- const K = G.indexOf(".");
4408
- if (K < 0) continue;
4409
- const U = G.slice(0, K), ce = G.slice(K + 1);
4407
+ const Y = G.indexOf(".");
4408
+ if (Y < 0) continue;
4409
+ const U = G.slice(0, Y), ce = G.slice(Y + 1);
4410
4410
  if (l.has(U)) {
4411
4411
  v.push(G);
4412
4412
  continue;
@@ -4414,19 +4414,19 @@ function b2(e) {
4414
4414
  if (le.has(U) || N.has(U)) continue;
4415
4415
  const ke = g(U);
4416
4416
  if (!ke) continue;
4417
- const Y = ke.terminals.find((Q) => Q.id === ce);
4418
- Y && N.set(U, {
4417
+ const K = ke.terminals.find((Q) => Q.id === ce);
4418
+ K && N.set(U, {
4419
4419
  ref: G,
4420
4420
  elId: U,
4421
4421
  lib: ke,
4422
- localTerm: Y
4422
+ localTerm: K
4423
4423
  });
4424
4424
  }
4425
4425
  if (N.size === 0 || v.length === 0) continue;
4426
4426
  const M = [...N.values()], E = /* @__PURE__ */ new Map();
4427
4427
  for (const G of M)
4428
- for (const K of D.get(G.ref) ?? [])
4429
- for (const U of K) {
4428
+ for (const Y of D.get(G.ref) ?? [])
4429
+ for (const U of Y) {
4430
4430
  if (U === G.ref || $(U) || !Ux(U)) continue;
4431
4431
  const ce = U;
4432
4432
  E.set(ce, (E.get(ce) ?? 0) + 1);
@@ -4434,8 +4434,8 @@ function b2(e) {
4434
4434
  let _;
4435
4435
  if (E.size > 0) {
4436
4436
  let G = -1;
4437
- for (const [K, U] of E)
4438
- (U > G || U === G && (_ === void 0 || K < _)) && (G = U, _ = K);
4437
+ for (const [Y, U] of E)
4438
+ (U > G || U === G && (_ === void 0 || Y < _)) && (G = U, _ = Y);
4439
4439
  }
4440
4440
  if (_ || (_ = [...v].sort()[0]), !_) continue;
4441
4441
  const A = _.indexOf("."), z = _.slice(0, A), P = _.slice(A + 1), O = g(z), C = l.get(z);
@@ -4445,36 +4445,36 @@ function b2(e) {
4445
4445
  const B = De(
4446
4446
  [T.x, T.y],
4447
4447
  C
4448
- ), L = Gt(
4448
+ ), L = Xt(
4449
4449
  T.orientation,
4450
4450
  C
4451
- ), F = Bo(L), q = [-F[1], F[0]];
4452
- M.sort((G, K) => G.elId.localeCompare(K.elId));
4451
+ ), F = Lo(L), q = [-F[1], F[0]];
4452
+ M.sort((G, Y) => G.elId.localeCompare(Y.elId));
4453
4453
  const H = M.map(
4454
4454
  (G) => Math.max(G.lib.width, Ye)
4455
4455
  );
4456
- let Z = -H.reduce((G, K) => G + K, 0) / 2;
4456
+ let Z = -H.reduce((G, Y) => G + Y, 0) / 2;
4457
4457
  for (let G = 0; G < M.length; G++) {
4458
- const K = M[G], U = H[G], ce = Z + U / 2;
4458
+ const Y = M[G], U = H[G], ce = Z + U / 2;
4459
4459
  Z += U;
4460
- const ke = Lo[L], Y = Lt(
4461
- K.localTerm.orientation,
4460
+ const ke = Do[L], K = zt(
4461
+ Y.localTerm.orientation,
4462
4462
  ke
4463
4463
  ), Q = De(
4464
- [K.localTerm.x, K.localTerm.y],
4465
- { at: [0, 0], rot: Y, mirror: !1 }
4464
+ [Y.localTerm.x, Y.localTerm.y],
4465
+ { at: [0, 0], rot: K, mirror: !1 }
4466
4466
  ), Ee = [
4467
- B[0] + F[0] * $t + q[0] * ce,
4468
- B[1] + F[1] * $t + q[1] * ce
4467
+ B[0] + F[0] * _t + q[0] * ce,
4468
+ B[1] + F[1] * _t + q[1] * ce
4469
4469
  ], Me = [
4470
4470
  pe(Ee[0] - Q[0]),
4471
4471
  pe(Ee[1] - Q[1])
4472
4472
  ];
4473
- l.set(K.elId, { at: Me, rot: Y, mirror: !1 }), hn = !0;
4473
+ l.set(Y.elId, { at: Me, rot: K, mirror: !1 }), bn = !0;
4474
4474
  }
4475
4475
  }
4476
4476
  }
4477
- const bt = (y) => {
4477
+ const yt = (y) => {
4478
4478
  const v = l.get(y), N = g(y);
4479
4479
  if (!v || !N) return null;
4480
4480
  const M = N.viewBox.split(/\s+/).map(Number);
@@ -4494,7 +4494,7 @@ function b2(e) {
4494
4494
  O = Math.min(O, B[0]), C = Math.max(C, B[0]);
4495
4495
  }
4496
4496
  return { min: O, max: C };
4497
- }, pn = (y) => {
4497
+ }, wn = (y) => {
4498
4498
  const v = /* @__PURE__ */ new Set(), N = g(y);
4499
4499
  if (!N) return v;
4500
4500
  for (const M of N.terminals) {
@@ -4509,7 +4509,7 @@ function b2(e) {
4509
4509
  }
4510
4510
  }
4511
4511
  return v;
4512
- }, fo = 40, gn = (y) => {
4512
+ }, po = 40, xn = (y) => {
4513
4513
  const v = l.get(y), N = g(y);
4514
4514
  if (!v || !N) return null;
4515
4515
  const M = N.viewBox.split(/\s+/).map(Number);
@@ -4540,43 +4540,43 @@ function b2(e) {
4540
4540
  }
4541
4541
  for (; M.length > 0; ) {
4542
4542
  const E = M.pop();
4543
- for (const _ of pn(E)) {
4543
+ for (const _ of wn(E)) {
4544
4544
  if (N.has(_)) continue;
4545
4545
  const A = l.get(_);
4546
4546
  !A || A.at[1] >= v - 1 || (N.add(_), M.push(_));
4547
4547
  }
4548
4548
  }
4549
4549
  return N;
4550
- }, ho = (y, v, N) => {
4550
+ }, go = (y, v, N) => {
4551
4551
  const M = /* @__PURE__ */ new Set([y]), E = [y];
4552
4552
  for (; E.length > 0; ) {
4553
4553
  const _ = E.pop();
4554
- for (const A of pn(_))
4554
+ for (const A of wn(_))
4555
4555
  A === v || M.has(A) || !N.has(A) || (M.add(A), E.push(A));
4556
4556
  }
4557
4557
  return M;
4558
- }, po = (y, v) => {
4558
+ }, yo = (y, v) => {
4559
4559
  let N = y.length * y.length + 8, M = !1, E = !0;
4560
4560
  for (; E && N-- > 0; ) {
4561
4561
  E = !1;
4562
4562
  for (let _ = 0; _ < y.length && !E; _++)
4563
4563
  for (let A = _ + 1; A < y.length; A++) {
4564
- const z = y[_], P = y[A], O = bt(z), C = bt(P), T = gn(z), B = gn(P);
4564
+ const z = y[_], P = y[A], O = yt(z), C = yt(P), T = xn(z), B = xn(P);
4565
4565
  if (!O || !C || !T || !B) continue;
4566
4566
  const L = Math.min(O.max, C.max) - Math.max(O.min, C.min), F = Math.min(T.max, B.max) - Math.max(T.min, B.min);
4567
4567
  if (L <= 0 || F <= 0) continue;
4568
- const q = ho(z, P, v), H = ho(P, z, v);
4568
+ const q = go(z, P, v), H = go(P, z, v);
4569
4569
  if (q.has(P) || H.has(z)) continue;
4570
- const J = ![...q].some((Y) => u.has(Y)), Z = ![...H].some((Y) => u.has(Y));
4570
+ const J = ![...q].some((K) => u.has(K)), Z = ![...H].some((K) => u.has(K));
4571
4571
  if (!J && !Z) continue;
4572
- const G = (O.min + O.max) / 2, K = (C.min + C.max) / 2;
4572
+ const G = (O.min + O.max) / 2, Y = (C.min + C.max) / 2;
4573
4573
  let U, ce;
4574
- J && (!Z || q.size <= H.size) ? (U = q, ce = G <= K ? -1 : 1) : (U = H, ce = K <= G ? -1 : 1);
4575
- const ke = pe(ce * (L + fo));
4574
+ J && (!Z || q.size <= H.size) ? (U = q, ce = G <= Y ? -1 : 1) : (U = H, ce = Y <= G ? -1 : 1);
4575
+ const ke = pe(ce * (L + po));
4576
4576
  if (ke !== 0) {
4577
- for (const Y of U) {
4578
- const Q = l.get(Y);
4579
- Q && l.set(Y, {
4577
+ for (const K of U) {
4578
+ const Q = l.get(K);
4579
+ Q && l.set(K, {
4580
4580
  ...Q,
4581
4581
  at: [Q.at[0] + ke, Q.at[1]]
4582
4582
  });
@@ -4594,10 +4594,10 @@ function b2(e) {
4594
4594
  const N = Zx(y.id, v.at[1]);
4595
4595
  if (N.size < 2) continue;
4596
4596
  const M = [...N];
4597
- if (po(M, N)) {
4597
+ if (yo(M, N)) {
4598
4598
  let _ = 1 / 0, A = -1 / 0;
4599
4599
  for (const z of M) {
4600
- const P = bt(z);
4600
+ const P = yt(z);
4601
4601
  P && (_ = Math.min(_, P.min), A = Math.max(A, P.max));
4602
4602
  }
4603
4603
  if (Number.isFinite(_)) {
@@ -4610,7 +4610,7 @@ function b2(e) {
4610
4610
  at: [T.at[0] + P, T.at[1]]
4611
4611
  });
4612
4612
  }
4613
- const O = A - _ + fo;
4613
+ const O = A - _ + po;
4614
4614
  if (O > v.span && !f.has(y.id)) {
4615
4615
  const C = c.get(y.id);
4616
4616
  c.set(y.id, { ...C, span: O });
@@ -4618,8 +4618,8 @@ function b2(e) {
4618
4618
  }
4619
4619
  }
4620
4620
  }
4621
- const go = () => {
4622
- const v = t.map((M) => M.id).filter((M) => l.has(M)).map((M) => ({ x: bt(M), y: gn(M) })).filter((M) => M.x && M.y);
4621
+ const bo = () => {
4622
+ const v = t.map((M) => M.id).filter((M) => l.has(M)).map((M) => ({ x: yt(M), y: xn(M) })).filter((M) => M.x && M.y);
4623
4623
  let N = 0;
4624
4624
  for (let M = 0; M < v.length; M++)
4625
4625
  for (let E = M + 1; E < v.length; E++) {
@@ -4627,12 +4627,12 @@ function b2(e) {
4627
4627
  _ > 1 && A > 1 && N++;
4628
4628
  }
4629
4629
  return N;
4630
- }, Qx = go(), yo = /* @__PURE__ */ new Map();
4631
- for (const [y, v] of l) yo.set(y, { ...v, at: [...v.at] });
4632
- const bo = /* @__PURE__ */ new Map();
4630
+ }, Qx = bo(), wo = /* @__PURE__ */ new Map();
4631
+ for (const [y, v] of l) wo.set(y, { ...v, at: [...v.at] });
4632
+ const xo = /* @__PURE__ */ new Map();
4633
4633
  for (const [y, v] of c)
4634
- bo.set(y, { ...v, at: [...v.at] });
4635
- const yn = 120, wo = /* @__PURE__ */ new Map();
4634
+ xo.set(y, { ...v, at: [...v.at] });
4635
+ const vn = 120, vo = /* @__PURE__ */ new Map();
4636
4636
  {
4637
4637
  const y = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), N = [];
4638
4638
  for (const E of n)
@@ -4654,10 +4654,10 @@ function b2(e) {
4654
4654
  continue;
4655
4655
  } else
4656
4656
  continue;
4657
- for (const P of pn(E))
4657
+ for (const P of wn(E))
4658
4658
  l.has(P) && (y.has(P) || N.push({ el: P, bus: _, d: A + 1 }));
4659
4659
  }
4660
- for (const [E, _] of v) _ && wo.set(E, _);
4660
+ for (const [E, _] of v) _ && vo.set(E, _);
4661
4661
  }
4662
4662
  for (const y of ve) {
4663
4663
  const v = (we.get(y) ?? []).filter(
@@ -4669,20 +4669,20 @@ function b2(e) {
4669
4669
  for (const O of v) {
4670
4670
  const C = c.get(O), T = [];
4671
4671
  let B = 1 / 0, L = -1 / 0;
4672
- for (const [F, q] of wo) {
4672
+ for (const [F, q] of vo) {
4673
4673
  if (q !== O) continue;
4674
- const H = bt(F);
4674
+ const H = yt(F);
4675
4675
  H && (T.push(F), B = Math.min(B, H.min), L = Math.max(L, H.max));
4676
4676
  }
4677
- Number.isFinite(B) || (B = C.at[0] - gt / 2, L = C.at[0] + gt / 2), N.push({ busId: O, min: B, max: L, members: T }), M += L - B;
4677
+ Number.isFinite(B) || (B = C.at[0] - pt / 2, L = C.at[0] + pt / 2), N.push({ busId: O, min: B, max: L, members: T }), M += L - B;
4678
4678
  }
4679
4679
  if (N.some((O) => O.members.some((C) => u.has(C))))
4680
4680
  continue;
4681
4681
  let E = 1 / 0, _ = -1 / 0;
4682
4682
  for (const O of N)
4683
4683
  E = Math.min(E, O.min), _ = Math.max(_, O.max);
4684
- const A = _ - E, z = M + yn * (N.length - 1);
4685
- if (!(A > z + yn)) continue;
4684
+ const A = _ - E, z = M + vn * (N.length - 1);
4685
+ if (!(A > z + vn)) continue;
4686
4686
  N.sort((O, C) => (O.min + O.max) / 2 - (C.min + C.max) / 2);
4687
4687
  let P = E;
4688
4688
  for (const O of N) {
@@ -4696,27 +4696,27 @@ function b2(e) {
4696
4696
  }
4697
4697
  O.min += C, O.max += C;
4698
4698
  }
4699
- P = O.max + yn;
4699
+ P = O.max + vn;
4700
4700
  }
4701
4701
  for (const O of N) {
4702
- const C = c.get(O.busId), T = Math.max(gt, O.max - O.min);
4702
+ const C = c.get(O.busId), T = Math.max(pt, O.max - O.min);
4703
4703
  T < C.span && c.set(O.busId, { ...C, span: T });
4704
4704
  }
4705
4705
  }
4706
4706
  {
4707
4707
  const y = t.map((N) => N.id).filter((N) => l.has(N)), v = new Set(y);
4708
- po(y, v);
4708
+ yo(y, v);
4709
4709
  }
4710
- if (go() > Qx) {
4710
+ if (bo() > Qx) {
4711
4711
  l.clear();
4712
- for (const [y, v] of yo) l.set(y, v);
4712
+ for (const [y, v] of wo) l.set(y, v);
4713
4713
  c.clear();
4714
- for (const [y, v] of bo) c.set(y, v);
4714
+ for (const [y, v] of xo) c.set(y, v);
4715
4715
  }
4716
- let bn = 0;
4716
+ let kn = 0;
4717
4717
  for (const y of t) {
4718
4718
  if (l.has(y.id)) continue;
4719
- const v = bn % Ro, N = Math.floor(bn / Ro);
4719
+ const v = kn % Ho, N = Math.floor(kn / Ho);
4720
4720
  l.set(y.id, {
4721
4721
  at: [
4722
4722
  pe(h2 + v * g2),
@@ -4724,37 +4724,37 @@ function b2(e) {
4724
4724
  ],
4725
4725
  rot: 0,
4726
4726
  mirror: !1
4727
- }), bn++;
4727
+ }), kn++;
4728
4728
  }
4729
4729
  return { devices: l, buses: c, junctions: d };
4730
4730
  }
4731
4731
  function pe(e) {
4732
- return Math.round(e / Do) * Do;
4732
+ return Math.round(e / Fo) * Fo;
4733
4733
  }
4734
4734
  function w2(e, t) {
4735
- const n = e.ends[0], o = e.ends[1], r = Ho(n, t), i = Ho(o, t);
4735
+ const n = e.ends[0], o = e.ends[1], r = qo(n, t), i = qo(o, t);
4736
4736
  if (r || i) {
4737
- const l = r ? n : o, d = kn(r ? o : n, t);
4737
+ const l = r ? n : o, d = Nn(r ? o : n, t);
4738
4738
  if (!d) return null;
4739
4739
  const u = t.buses.get(l);
4740
4740
  if (!u) return null;
4741
4741
  const { axis: f, at: p, span: h } = u.geometry, g = h / 2;
4742
4742
  let w;
4743
4743
  if (f === "x")
4744
- w = [Vt(d[0], p[0] - g, p[0] + g), p[1]];
4744
+ w = [Ut(d[0], p[0] - g, p[0] + g), p[1]];
4745
4745
  else {
4746
- const $ = Vt(d[1], p[1] - g, p[1] + g);
4746
+ const $ = Ut(d[1], p[1] - g, p[1] + g);
4747
4747
  w = [p[0], $];
4748
4748
  }
4749
- return { wireId: e.id, path: qo(d, w) };
4749
+ return { wireId: e.id, path: Xo(d, w) };
4750
4750
  }
4751
- const s = kn(n, t), a = kn(o, t);
4752
- return !s || !a ? null : { wireId: e.id, path: qo(s, a) };
4751
+ const s = Nn(n, t), a = Nn(o, t);
4752
+ return !s || !a ? null : { wireId: e.id, path: Xo(s, a) };
4753
4753
  }
4754
- function Ho(e, t) {
4754
+ function qo(e, t) {
4755
4755
  return !e.includes(".") && t.buses.has(e);
4756
4756
  }
4757
- function kn(e, t) {
4757
+ function Nn(e, t) {
4758
4758
  if (!e.includes(".")) {
4759
4759
  const o = t.buses.get(e);
4760
4760
  if (o) return o.geometry.at;
@@ -4764,7 +4764,7 @@ function kn(e, t) {
4764
4764
  const n = t.terminals.get(e);
4765
4765
  return n ? n.world : null;
4766
4766
  }
4767
- function Wo(e, t, n) {
4767
+ function Go(e, t, n) {
4768
4768
  if (!e.includes(".")) {
4769
4769
  const r = n.buses.get(e);
4770
4770
  if (!r) {
@@ -4775,17 +4775,17 @@ function Wo(e, t, n) {
4775
4775
  if (!t) return [s[0], s[1]];
4776
4776
  const l = a / 2;
4777
4777
  if (i === "x")
4778
- return [Vt(t[0], s[0] - l, s[0] + l), s[1]];
4779
- const c = Vt(t[1], s[1] - l, s[1] + l);
4778
+ return [Ut(t[0], s[0] - l, s[0] + l), s[1]];
4779
+ const c = Ut(t[1], s[1] - l, s[1] + l);
4780
4780
  return [s[0], c];
4781
4781
  }
4782
4782
  const o = n.terminals.get(e);
4783
4783
  return o ? [o.world[0], o.world[1]] : null;
4784
4784
  }
4785
- function qo(e, t) {
4785
+ function Xo(e, t) {
4786
4786
  return e[0] === t[0] || e[1] === t[1] ? [e, t] : [e, [e[0], t[1]], t];
4787
4787
  }
4788
- function Vt(e, t, n) {
4788
+ function Ut(e, t, n) {
4789
4789
  return e < t ? t : e > n ? n : e;
4790
4790
  }
4791
4791
  const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44 44", wi = 44, xi = 44, vi = '<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-15" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">A</text>', ki = [{ id: "t_top", x: 0, y: -40, orientation: "n" }], _i = { kind: "inline" }, x2 = {
@@ -4856,13 +4856,13 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
4856
4856
  terminals: Fi,
4857
4857
  viewBox: Li,
4858
4858
  width: zi
4859
- }, Symbol.toStringTag, { value: "Module" })), Wi = "async-motor", qi = "异步电动机", Gi = "load", Xi = "-62 -82 64 84", Ki = 64, Yi = 84, Vi = '<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">3</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-60" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-80" x2="-10" y2="-53" fill="none" stroke="black" stroke-width="1"/>', Ui = [{ id: "t1", x: -50, y: -80, orientation: "n" }, { id: "t2", x: -10, y: -80, orientation: "n" }, { id: "t3", x: -30, y: -80, orientation: "n" }], Ji = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_08/en_60617_06_08_01.elmt", qetEnglishName: "Induction motor, three-phase, squirrel cage" }, N2 = {
4859
+ }, Symbol.toStringTag, { value: "Module" })), Wi = "async-motor", qi = "异步电动机", Gi = "load", Xi = "-62 -82 64 84", Yi = 64, Ki = 84, Vi = '<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">3</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-60" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-80" x2="-10" y2="-53" fill="none" stroke="black" stroke-width="1"/>', Ui = [{ id: "t1", x: -50, y: -80, orientation: "n" }, { id: "t2", x: -10, y: -80, orientation: "n" }, { id: "t3", x: -30, y: -80, orientation: "n" }], Ji = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_08/en_60617_06_08_01.elmt", qetEnglishName: "Induction motor, three-phase, squirrel cage" }, N2 = {
4860
4860
  id: Wi,
4861
4861
  name: qi,
4862
4862
  category: Gi,
4863
4863
  viewBox: Xi,
4864
- width: Ki,
4865
- height: Yi,
4864
+ width: Yi,
4865
+ height: Ki,
4866
4866
  svg: Vi,
4867
4867
  terminals: Ui,
4868
4868
  source: Ji
@@ -4870,14 +4870,14 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
4870
4870
  __proto__: null,
4871
4871
  category: Gi,
4872
4872
  default: N2,
4873
- height: Yi,
4873
+ height: Ki,
4874
4874
  id: Wi,
4875
4875
  name: qi,
4876
4876
  source: Ji,
4877
4877
  svg: Vi,
4878
4878
  terminals: Ui,
4879
4879
  viewBox: Xi,
4880
- width: Ki
4880
+ width: Yi
4881
4881
  }, Symbol.toStringTag, { value: "Module" })), Zi = "autotransformer", Qi = "自耦变压器", es = "transformer", ts = "-62 -112 64 144", ns = 64, os = 144, rs = '<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-110" x2="-30" y2="-90" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -30 A 30 60 0 0 0 -30 -90" fill="none" stroke="black" stroke-width="1"/>', is = [{ id: "t1", x: -30, y: -110, orientation: "n" }, { id: "t_bottom", x: -30, y: 20, orientation: "s" }], ss = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_06.elmt", qetEnglishName: "Auto-transformer, general symbol" }, M2 = {
4882
4882
  id: Zi,
4883
4883
  name: Qi,
@@ -4974,7 +4974,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
4974
4974
  terminals: Bs,
4975
4975
  viewBox: Cs,
4976
4976
  width: Is
4977
- }, Symbol.toStringTag, { value: "Module" })), zs = "breaker", Ds = "断路器 (QF)", Rs = "switching", Fs = "-7 -22 15 46", Hs = 15, Ws = 46, qs = '<polyline points="0,20 0,10 -5,-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-8" x2="-2" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><text x="2" y="-10.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">1</text><text x="3" y="21.2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">2</text>', Gs = [{ id: "t1", x: 0, y: -20, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Xs = [{ name: "open", type: "boolean", default: !1, label: "断开" }], Ks = { x: 6, y: -2, anchor: "start" }, Ys = { kind: "elmt", path: "11_singlepole/200_fuses_protective_gears/11_circuit_breakers/disjoncteur1.elmt", qetEnglishName: "Circuit-breaker" }, j2 = {
4977
+ }, Symbol.toStringTag, { value: "Module" })), zs = "breaker", Ds = "断路器 (QF)", Rs = "switching", Fs = "-7 -22 15 46", Hs = 15, Ws = 46, qs = '<polyline points="0,20 0,10 -5,-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-8" x2="-2" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><text x="2" y="-10.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">1</text><text x="3" y="21.2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">2</text>', Gs = [{ id: "t1", x: 0, y: -20, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Xs = [{ name: "open", type: "boolean", default: !1, label: "断开" }], Ys = { x: 6, y: -2, anchor: "start" }, Ks = { kind: "elmt", path: "11_singlepole/200_fuses_protective_gears/11_circuit_breakers/disjoncteur1.elmt", qetEnglishName: "Circuit-breaker" }, j2 = {
4978
4978
  id: zs,
4979
4979
  name: Ds,
4980
4980
  category: Rs,
@@ -4984,17 +4984,17 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
4984
4984
  svg: qs,
4985
4985
  terminals: Gs,
4986
4986
  state: Xs,
4987
- label: Ks,
4988
- source: Ys
4987
+ label: Ys,
4988
+ source: Ks
4989
4989
  }, L2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4990
4990
  __proto__: null,
4991
4991
  category: Rs,
4992
4992
  default: j2,
4993
4993
  height: Ws,
4994
4994
  id: zs,
4995
- label: Ks,
4995
+ label: Ys,
4996
4996
  name: Ds,
4997
- source: Ys,
4997
+ source: Ks,
4998
4998
  state: Xs,
4999
4999
  svg: qs,
5000
5000
  terminals: Gs,
@@ -5104,7 +5104,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5104
5104
  terminals: ja,
5105
5105
  viewBox: Ia,
5106
5106
  width: Pa
5107
- }, Symbol.toStringTag, { value: "Module" })), Da = "contactor", Ra = "接触器 (KM)", Fa = "motor-control", Ha = "主回路接触器, 通常配热继电器和电机使用。", Wa = "-10 -42 15 64", qa = 15, Ga = 64, Xa = '<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -24.5 A 2.5 2.5 0 0 0 0 -19.5" fill="none" stroke="black" stroke-width="1"/>', Ka = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Ya = [{ name: "open", type: "boolean", default: !0, label: "断开" }], Va = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_02.elmt", qetEnglishName: "Contactor; Main make contact of a contactor" }, X2 = {
5107
+ }, Symbol.toStringTag, { value: "Module" })), Da = "contactor", Ra = "接触器 (KM)", Fa = "motor-control", Ha = "主回路接触器, 通常配热继电器和电机使用。", Wa = "-10 -42 15 64", qa = 15, Ga = 64, Xa = '<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -24.5 A 2.5 2.5 0 0 0 0 -19.5" fill="none" stroke="black" stroke-width="1"/>', Ya = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Ka = [{ name: "open", type: "boolean", default: !0, label: "断开" }], Va = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_02.elmt", qetEnglishName: "Contactor; Main make contact of a contactor" }, X2 = {
5108
5108
  id: Da,
5109
5109
  name: Ra,
5110
5110
  category: Fa,
@@ -5113,10 +5113,10 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5113
5113
  width: qa,
5114
5114
  height: Ga,
5115
5115
  svg: Xa,
5116
- terminals: Ka,
5117
- state: Ya,
5116
+ terminals: Ya,
5117
+ state: Ka,
5118
5118
  source: Va
5119
- }, K2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5119
+ }, Y2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5120
5120
  __proto__: null,
5121
5121
  category: Fa,
5122
5122
  default: X2,
@@ -5125,12 +5125,12 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5125
5125
  id: Da,
5126
5126
  name: Ra,
5127
5127
  source: Va,
5128
- state: Ya,
5128
+ state: Ka,
5129
5129
  svg: Xa,
5130
- terminals: Ka,
5130
+ terminals: Ya,
5131
5131
  viewBox: Wa,
5132
5132
  width: qa
5133
- }, Symbol.toStringTag, { value: "Module" })), Ua = "converter-bidir", Ja = "双向变流器 (PCS)", Za = "renewable", Qa = "储能变流器:双向 AC ↔ DC", el = "-42 -42 44 48", tl = 44, nl = 48, ol = '<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-6" x2="-14" y2="-6" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-6" x2="-4" y2="-6" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/><polyline points="-28,-4 -32,0 -28,4" fill="none" stroke="black" stroke-width="1"/><polyline points="-16,-4 -12,0 -16,4" fill="none" stroke="black" stroke-width="1"/>', rl = [{ id: "t_ac", x: -20, y: -40, orientation: "n" }, { id: "t_dc", x: -20, y: 0, orientation: "s" }], il = [{ name: "S", label: "容量", type: "number", unit: "MVA" }], sl = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_06.elmt", qetEnglishName: "Rectifier/inverter" }, Y2 = {
5133
+ }, Symbol.toStringTag, { value: "Module" })), Ua = "converter-bidir", Ja = "双向变流器 (PCS)", Za = "renewable", Qa = "储能变流器:双向 AC ↔ DC", el = "-42 -42 44 48", tl = 44, nl = 48, ol = '<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-6" x2="-14" y2="-6" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-6" x2="-4" y2="-6" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/><polyline points="-28,-4 -32,0 -28,4" fill="none" stroke="black" stroke-width="1"/><polyline points="-16,-4 -12,0 -16,4" fill="none" stroke="black" stroke-width="1"/>', rl = [{ id: "t_ac", x: -20, y: -40, orientation: "n" }, { id: "t_dc", x: -20, y: 0, orientation: "s" }], il = [{ name: "S", label: "容量", type: "number", unit: "MVA" }], sl = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_06.elmt", qetEnglishName: "Rectifier/inverter" }, K2 = {
5134
5134
  id: Ua,
5135
5135
  name: Ja,
5136
5136
  category: Za,
@@ -5145,7 +5145,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5145
5145
  }, V2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5146
5146
  __proto__: null,
5147
5147
  category: Za,
5148
- default: Y2,
5148
+ default: K2,
5149
5149
  description: Qa,
5150
5150
  height: nl,
5151
5151
  id: Ua,
@@ -5252,9 +5252,9 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5252
5252
  terminals: Gl,
5253
5253
  viewBox: Fl,
5254
5254
  width: Hl
5255
- }, Symbol.toStringTag, { value: "Module" })), Kl = "diode", Yl = "二极管 (D)", Vl = "passive", Ul = "整流 / 续流 / 保护二极管。t1=阳极(上), t2=阴极(下)。", Jl = "-12 -42 24 44", Zl = 24, Ql = 44, ec = '<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/>', tc = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 0, orientation: "s" }], nc = { x: 6, y: -20, anchor: "start" }, oc = { kind: "elmt", path: "91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_01.elmt", qetEnglishName: "Semiconductor diode, general symbol" }, rk = {
5256
- id: Kl,
5257
- name: Yl,
5255
+ }, Symbol.toStringTag, { value: "Module" })), Yl = "diode", Kl = "二极管 (D)", Vl = "passive", Ul = "整流 / 续流 / 保护二极管。t1=阳极(上), t2=阴极(下)。", Jl = "-12 -42 24 44", Zl = 24, Ql = 44, ec = '<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/>', tc = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 0, orientation: "s" }], nc = { x: 6, y: -20, anchor: "start" }, oc = { kind: "elmt", path: "91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_01.elmt", qetEnglishName: "Semiconductor diode, general symbol" }, rk = {
5256
+ id: Yl,
5257
+ name: Kl,
5258
5258
  category: Vl,
5259
5259
  description: Ul,
5260
5260
  viewBox: Jl,
@@ -5270,9 +5270,9 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5270
5270
  default: rk,
5271
5271
  description: Ul,
5272
5272
  height: Ql,
5273
- id: Kl,
5273
+ id: Yl,
5274
5274
  label: nc,
5275
- name: Yl,
5275
+ name: Kl,
5276
5276
  source: oc,
5277
5277
  svg: ec,
5278
5278
  terminals: tc,
@@ -5378,10 +5378,10 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5378
5378
  terminals: Hc,
5379
5379
  viewBox: zc,
5380
5380
  width: Dc
5381
- }, Symbol.toStringTag, { value: "Module" })), Xc = "energy-meter", Kc = "电能表 (Wh)", Yc = "measurement", Vc = "有功电能表 (kWh) — 服务入口 / 子表。", Uc = "-22 -36 44 72", Jc = 44, Zc = 72, Qc = '<text x="-10" y="19.2" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Wh</text><rect x="-20" y="-10" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>', ed = [{ id: "t1", x: 0, y: -34, orientation: "n" }, { id: "t2", x: 0, y: 34, orientation: "s" }], td = { kind: "elmt", path: "11_singlepole/500_home_installation/40_meters/wattheuremetre_08-04-03_en60617.elmt", qetEnglishName: "Watt hour meter (en_60617)" }, hk = {
5381
+ }, Symbol.toStringTag, { value: "Module" })), Xc = "energy-meter", Yc = "电能表 (Wh)", Kc = "measurement", Vc = "有功电能表 (kWh) — 服务入口 / 子表。", Uc = "-22 -36 44 72", Jc = 44, Zc = 72, Qc = '<text x="-10" y="19.2" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Wh</text><rect x="-20" y="-10" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>', ed = [{ id: "t1", x: 0, y: -34, orientation: "n" }, { id: "t2", x: 0, y: 34, orientation: "s" }], td = { kind: "elmt", path: "11_singlepole/500_home_installation/40_meters/wattheuremetre_08-04-03_en60617.elmt", qetEnglishName: "Watt hour meter (en_60617)" }, hk = {
5382
5382
  id: Xc,
5383
- name: Kc,
5384
- category: Yc,
5383
+ name: Yc,
5384
+ category: Kc,
5385
5385
  description: Vc,
5386
5386
  viewBox: Uc,
5387
5387
  width: Jc,
@@ -5391,12 +5391,12 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5391
5391
  source: td
5392
5392
  }, pk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5393
5393
  __proto__: null,
5394
- category: Yc,
5394
+ category: Kc,
5395
5395
  default: hk,
5396
5396
  description: Vc,
5397
5397
  height: Zc,
5398
5398
  id: Xc,
5399
- name: Kc,
5399
+ name: Yc,
5400
5400
  source: td,
5401
5401
  svg: Qc,
5402
5402
  terminals: ed,
@@ -5500,13 +5500,13 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5500
5500
  terminals: Dd,
5501
5501
  viewBox: Bd,
5502
5502
  width: jd
5503
- }, Symbol.toStringTag, { value: "Module" })), Wd = "generator", qd = "发电机 (G)", Gd = "source", Xd = "-42 -42 44 44", Kd = 44, Yd = 44, Vd = '<rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-24" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text>', Ud = [{ id: "t_bottom", x: -20, y: 0, orientation: "s" }], Jd = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_16/en_60617_06_16_01.elmt", qetEnglishName: "Generator, general symbol" }, $k = {
5503
+ }, Symbol.toStringTag, { value: "Module" })), Wd = "generator", qd = "发电机 (G)", Gd = "source", Xd = "-42 -42 44 44", Yd = 44, Kd = 44, Vd = '<rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-24" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text>', Ud = [{ id: "t_bottom", x: -20, y: 0, orientation: "s" }], Jd = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_16/en_60617_06_16_01.elmt", qetEnglishName: "Generator, general symbol" }, $k = {
5504
5504
  id: Wd,
5505
5505
  name: qd,
5506
5506
  category: Gd,
5507
5507
  viewBox: Xd,
5508
- width: Kd,
5509
- height: Yd,
5508
+ width: Yd,
5509
+ height: Kd,
5510
5510
  svg: Vd,
5511
5511
  terminals: Ud,
5512
5512
  source: Jd
@@ -5514,14 +5514,14 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5514
5514
  __proto__: null,
5515
5515
  category: Gd,
5516
5516
  default: $k,
5517
- height: Yd,
5517
+ height: Kd,
5518
5518
  id: Wd,
5519
5519
  name: qd,
5520
5520
  source: Jd,
5521
5521
  svg: Vd,
5522
5522
  terminals: Ud,
5523
5523
  viewBox: Xd,
5524
- width: Kd
5524
+ width: Yd
5525
5525
  }, Symbol.toStringTag, { value: "Module" })), Zd = "genset", Qd = "发电机组 (G)", eu = "source", tu = "柴油 / 燃气发电机组。", nu = "-28 -22 56 64", ou = 56, ru = 64, iu = '<rect x="-26" y="-20" width="52" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">GEN</text><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>', su = [{ id: "t_out", x: 0, y: 40, orientation: "s" }], au = [{ name: "P", label: "功率", type: "number", unit: "kW", showOnCanvas: !0 }], lu = { kind: "inline" }, Nk = {
5526
5526
  id: Zd,
5527
5527
  name: Qd,
@@ -5624,15 +5624,15 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5624
5624
  terminals: Du,
5625
5625
  viewBox: Bu,
5626
5626
  width: ju
5627
- }, Symbol.toStringTag, { value: "Module" })), Fu = "heater", Hu = "电加热器 (EH)", Wu = "load", qu = "电阻加热元件 / 电热负荷。", Gu = "-22 -7 54 14", Xu = 54, Ku = 14, Yu = '<line x1="-20" y1="0" x2="-10" y2="0" fill="none" stroke="black" stroke-width="1"/><rect x="-10" y="-5" width="30" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="0" x2="30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-5" x2="-5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-5" x2="5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="15" y1="-5" x2="15" y2="5" fill="none" stroke="black" stroke-width="1"/>', Vu = [{ id: "t1", x: -20, y: 0, orientation: "w" }, { id: "t2", x: 30, y: 0, orientation: "e" }], Uu = [{ name: "P", label: "功率", type: "number", unit: "kW", showOnCanvas: !0 }], Ju = { kind: "elmt", path: "91_en_60617/en_60617_04/en_60617_04_01/en_60617_04_01_12.elmt", qetEnglishName: "Heating element" }, Ok = {
5627
+ }, Symbol.toStringTag, { value: "Module" })), Fu = "heater", Hu = "电加热器 (EH)", Wu = "load", qu = "电阻加热元件 / 电热负荷。", Gu = "-22 -7 54 14", Xu = 54, Yu = 14, Ku = '<line x1="-20" y1="0" x2="-10" y2="0" fill="none" stroke="black" stroke-width="1"/><rect x="-10" y="-5" width="30" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="0" x2="30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-5" x2="-5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-5" x2="5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="15" y1="-5" x2="15" y2="5" fill="none" stroke="black" stroke-width="1"/>', Vu = [{ id: "t1", x: -20, y: 0, orientation: "w" }, { id: "t2", x: 30, y: 0, orientation: "e" }], Uu = [{ name: "P", label: "功率", type: "number", unit: "kW", showOnCanvas: !0 }], Ju = { kind: "elmt", path: "91_en_60617/en_60617_04/en_60617_04_01/en_60617_04_01_12.elmt", qetEnglishName: "Heating element" }, Ok = {
5628
5628
  id: Fu,
5629
5629
  name: Hu,
5630
5630
  category: Wu,
5631
5631
  description: qu,
5632
5632
  viewBox: Gu,
5633
5633
  width: Xu,
5634
- height: Ku,
5635
- svg: Yu,
5634
+ height: Yu,
5635
+ svg: Ku,
5636
5636
  terminals: Vu,
5637
5637
  params: Uu,
5638
5638
  source: Ju
@@ -5641,12 +5641,12 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5641
5641
  category: Wu,
5642
5642
  default: Ok,
5643
5643
  description: qu,
5644
- height: Ku,
5644
+ height: Yu,
5645
5645
  id: Fu,
5646
5646
  name: Hu,
5647
5647
  params: Uu,
5648
5648
  source: Ju,
5649
- svg: Yu,
5649
+ svg: Ku,
5650
5650
  terminals: Vu,
5651
5651
  viewBox: Gu,
5652
5652
  width: Xu
@@ -5750,7 +5750,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5750
5750
  terminals: zm,
5751
5751
  viewBox: Om,
5752
5752
  width: Bm
5753
- }, Symbol.toStringTag, { value: "Module" })), Rm = "limit-switch", Fm = "限位开关 (SQ)", Hm = "control", Wm = "行程 / 位置开关 (常开, 机械操作)。", qm = "-10 -42 12 64", Gm = 12, Xm = 64, Km = '<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-13" x2="-7" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-12" x2="-3" y2="-8" fill="none" stroke="black" stroke-width="1"/>', Ym = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Vm = [{ name: "closed", type: "boolean", default: !1, label: "闭合" }], Um = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_08/en_60617_07_08_01.elmt", qetEnglishName: "Position switch, make contact" }, qk = {
5753
+ }, Symbol.toStringTag, { value: "Module" })), Rm = "limit-switch", Fm = "限位开关 (SQ)", Hm = "control", Wm = "行程 / 位置开关 (常开, 机械操作)。", qm = "-10 -42 12 64", Gm = 12, Xm = 64, Ym = '<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-13" x2="-7" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-12" x2="-3" y2="-8" fill="none" stroke="black" stroke-width="1"/>', Km = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Vm = [{ name: "closed", type: "boolean", default: !1, label: "闭合" }], Um = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_08/en_60617_07_08_01.elmt", qetEnglishName: "Position switch, make contact" }, qk = {
5754
5754
  id: Rm,
5755
5755
  name: Fm,
5756
5756
  category: Hm,
@@ -5758,8 +5758,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5758
5758
  viewBox: qm,
5759
5759
  width: Gm,
5760
5760
  height: Xm,
5761
- svg: Km,
5762
- terminals: Ym,
5761
+ svg: Ym,
5762
+ terminals: Km,
5763
5763
  state: Vm,
5764
5764
  source: Um
5765
5765
  }, Gk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -5772,8 +5772,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5772
5772
  name: Fm,
5773
5773
  source: Um,
5774
5774
  state: Vm,
5775
- svg: Km,
5776
- terminals: Ym,
5775
+ svg: Ym,
5776
+ terminals: Km,
5777
5777
  viewBox: qm,
5778
5778
  width: Gm
5779
5779
  }, Symbol.toStringTag, { value: "Module" })), Jm = "load-switch", Zm = "负荷开关", Qm = "switching", ef = "-10 -42 14 64", tf = 14, nf = 64, of = '<line x1="0" y1="-24" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-22" rx="2" ry="2" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-24" x2="2" y2="-24" fill="none" stroke="black" stroke-width="1"/>', rf = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], sf = [{ name: "open", type: "boolean", default: !1, label: "断开" }], af = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_08.elmt", qetEnglishName: "Switch-disconnector; On-load isolating switch" }, Xk = {
@@ -5787,7 +5787,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5787
5787
  terminals: rf,
5788
5788
  state: sf,
5789
5789
  source: af
5790
- }, Kk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5790
+ }, Yk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5791
5791
  __proto__: null,
5792
5792
  category: Qm,
5793
5793
  default: Xk,
@@ -5800,7 +5800,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5800
5800
  terminals: rf,
5801
5801
  viewBox: ef,
5802
5802
  width: tf
5803
- }, Symbol.toStringTag, { value: "Module" })), lf = "load", cf = "负荷", df = "load", uf = "抽象负荷(电流流出箭头)", mf = "-8 -22 16 46", ff = 16, hf = 46, pf = '<line x1="0" y1="-20" x2="0" y2="10" stroke="black" stroke-width="1" fill="none"/><polygon points="-6,10 6,10 0,22" fill="black" stroke="black" stroke-width="1"/>', gf = [{ id: "t_top", x: 0, y: -20, orientation: "n" }], yf = [{ name: "P", label: "有功功率", type: "number", unit: "MW", showOnCanvas: !0 }, { name: "cosphi", label: "功率因数", type: "number" }], bf = { x: 6, y: 0, anchor: "start" }, wf = { kind: "inline" }, Yk = {
5803
+ }, Symbol.toStringTag, { value: "Module" })), lf = "load", cf = "负荷", df = "load", uf = "抽象负荷(电流流出箭头)", mf = "-8 -22 16 46", ff = 16, hf = 46, pf = '<line x1="0" y1="-20" x2="0" y2="10" stroke="black" stroke-width="1" fill="none"/><polygon points="-6,10 6,10 0,22" fill="black" stroke="black" stroke-width="1"/>', gf = [{ id: "t_top", x: 0, y: -20, orientation: "n" }], yf = [{ name: "P", label: "有功功率", type: "number", unit: "MW", showOnCanvas: !0 }, { name: "cosphi", label: "功率因数", type: "number" }], bf = { x: 6, y: 0, anchor: "start" }, wf = { kind: "inline" }, Kk = {
5804
5804
  id: lf,
5805
5805
  name: cf,
5806
5806
  category: df,
@@ -5816,7 +5816,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5816
5816
  }, Vk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5817
5817
  __proto__: null,
5818
5818
  category: df,
5819
- default: Yk,
5819
+ default: Kk,
5820
5820
  description: uf,
5821
5821
  height: hf,
5822
5822
  id: lf,
@@ -5878,15 +5878,15 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5878
5878
  terminals: Df,
5879
5879
  viewBox: Bf,
5880
5880
  width: jf
5881
- }, Symbol.toStringTag, { value: "Module" })), Ff = "ngr", Hf = "中性点电阻 (NGR)", Wf = "grounding", qf = "小电阻接地:连接变压器中性点到地", Gf = "-12 -32 24 62", Xf = 24, Kf = 62, Yf = '<line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><rect x="-6" y="-15" width="12" height="22" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="7" x2="0" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="15" x2="10" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="19" x2="7" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="23" x2="4" y2="23" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="27" x2="1.5" y2="27" fill="none" stroke="black" stroke-width="1"/>', Vf = [{ id: "t_top", x: 0, y: -30, orientation: "n" }], Uf = [{ name: "R", label: "电阻", type: "number", unit: "Ω" }], Jf = { kind: "inline" }, e_ = {
5881
+ }, Symbol.toStringTag, { value: "Module" })), Ff = "ngr", Hf = "中性点电阻 (NGR)", Wf = "grounding", qf = "小电阻接地:连接变压器中性点到地", Gf = "-12 -32 24 62", Xf = 24, Yf = 62, Kf = '<line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><rect x="-6" y="-15" width="12" height="22" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="7" x2="0" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="15" x2="10" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="19" x2="7" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="23" x2="4" y2="23" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="27" x2="1.5" y2="27" fill="none" stroke="black" stroke-width="1"/>', Vf = [{ id: "t_top", x: 0, y: -30, orientation: "n" }], Uf = [{ name: "R", label: "电阻", type: "number", unit: "Ω" }], Jf = { kind: "inline" }, e_ = {
5882
5882
  id: Ff,
5883
5883
  name: Hf,
5884
5884
  category: Wf,
5885
5885
  description: qf,
5886
5886
  viewBox: Gf,
5887
5887
  width: Xf,
5888
- height: Kf,
5889
- svg: Yf,
5888
+ height: Yf,
5889
+ svg: Kf,
5890
5890
  terminals: Vf,
5891
5891
  params: Uf,
5892
5892
  source: Jf
@@ -5895,12 +5895,12 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
5895
5895
  category: Wf,
5896
5896
  default: e_,
5897
5897
  description: qf,
5898
- height: Kf,
5898
+ height: Yf,
5899
5899
  id: Ff,
5900
5900
  name: Hf,
5901
5901
  params: Uf,
5902
5902
  source: Jf,
5903
- svg: Yf,
5903
+ svg: Kf,
5904
5904
  terminals: Vf,
5905
5905
  viewBox: Gf,
5906
5906
  width: Xf
@@ -6000,7 +6000,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6000
6000
  terminals: jh,
6001
6001
  viewBox: Ih,
6002
6002
  width: Ph
6003
- }, Symbol.toStringTag, { value: "Module" })), zh = "power-supply", Dh = "开关电源 (PS)", Rh = "source", Fh = "AC→DC 开关电源 / 直流电源模块。t_ac 上(~), t_dc 下(=)。", Hh = "-24 -42 48 84", Wh = 48, qh = 84, Gh = '<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="8" y="15" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">=</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>', Xh = [{ id: "t_ac", x: 0, y: -40, orientation: "n" }, { id: "t_dc", x: 0, y: 40, orientation: "s" }], Kh = [{ name: "Vdc", label: "输出电压", type: "number", unit: "V", showOnCanvas: !0 }], Yh = { kind: "inline" }, d_ = {
6003
+ }, Symbol.toStringTag, { value: "Module" })), zh = "power-supply", Dh = "开关电源 (PS)", Rh = "source", Fh = "AC→DC 开关电源 / 直流电源模块。t_ac 上(~), t_dc 下(=)。", Hh = "-24 -42 48 84", Wh = 48, qh = 84, Gh = '<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="8" y="15" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">=</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>', Xh = [{ id: "t_ac", x: 0, y: -40, orientation: "n" }, { id: "t_dc", x: 0, y: 40, orientation: "s" }], Yh = [{ name: "Vdc", label: "输出电压", type: "number", unit: "V", showOnCanvas: !0 }], Kh = { kind: "inline" }, d_ = {
6004
6004
  id: zh,
6005
6005
  name: Dh,
6006
6006
  category: Rh,
@@ -6010,8 +6010,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6010
6010
  height: qh,
6011
6011
  svg: Gh,
6012
6012
  terminals: Xh,
6013
- params: Kh,
6014
- source: Yh
6013
+ params: Yh,
6014
+ source: Kh
6015
6015
  }, u_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6016
6016
  __proto__: null,
6017
6017
  category: Rh,
@@ -6020,8 +6020,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6020
6020
  height: qh,
6021
6021
  id: zh,
6022
6022
  name: Dh,
6023
- params: Kh,
6024
- source: Yh,
6023
+ params: Yh,
6024
+ source: Kh,
6025
6025
  svg: Gh,
6026
6026
  terminals: Xh,
6027
6027
  viewBox: Hh,
@@ -6142,13 +6142,13 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6142
6142
  terminals: F0,
6143
6143
  viewBox: L0,
6144
6144
  width: z0
6145
- }, Symbol.toStringTag, { value: "Module" })), W0 = "rcd", q0 = "剩余电流装置 (RCD)", G0 = "protection", X0 = "不带过流保护的剩余电流断路器 (IEC 61008)。", K0 = "-12 -22 19 44", Y0 = 19, V0 = 44, U0 = '<line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="0,20 0,10 -7,-9" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="13" rx="4.5" ry="2" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,0 -10,0 -10,13 -5,13" fill="none" stroke="black" stroke-width="0.4" stroke-dasharray="4 2"/>', J0 = [{ id: "t1", x: 0, y: -20, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Z0 = [{ name: "open", type: "boolean", default: !1, label: "断开" }], Q0 = [{ name: "IDn", label: "剩余动作电流", type: "number", unit: "mA", default: 30 }], ep = { kind: "elmt", path: "11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/ddr1.elmt", qetEnglishName: "Residual Circuit Breaker with Overload" }, k_ = {
6145
+ }, Symbol.toStringTag, { value: "Module" })), W0 = "rcd", q0 = "剩余电流装置 (RCD)", G0 = "protection", X0 = "不带过流保护的剩余电流断路器 (IEC 61008)。", Y0 = "-12 -22 19 44", K0 = 19, V0 = 44, U0 = '<line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="0,20 0,10 -7,-9" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="13" rx="4.5" ry="2" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,0 -10,0 -10,13 -5,13" fill="none" stroke="black" stroke-width="0.4" stroke-dasharray="4 2"/>', J0 = [{ id: "t1", x: 0, y: -20, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], Z0 = [{ name: "open", type: "boolean", default: !1, label: "断开" }], Q0 = [{ name: "IDn", label: "剩余动作电流", type: "number", unit: "mA", default: 30 }], ep = { kind: "elmt", path: "11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/ddr1.elmt", qetEnglishName: "Residual Circuit Breaker with Overload" }, k_ = {
6146
6146
  id: W0,
6147
6147
  name: q0,
6148
6148
  category: G0,
6149
6149
  description: X0,
6150
- viewBox: K0,
6151
- width: Y0,
6150
+ viewBox: Y0,
6151
+ width: K0,
6152
6152
  height: V0,
6153
6153
  svg: U0,
6154
6154
  terminals: J0,
@@ -6168,8 +6168,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6168
6168
  state: Z0,
6169
6169
  svg: U0,
6170
6170
  terminals: J0,
6171
- viewBox: K0,
6172
- width: Y0
6171
+ viewBox: Y0,
6172
+ width: K0
6173
6173
  }, Symbol.toStringTag, { value: "Module" })), tp = "recloser", np = "重合闸 (Recloser)", op = "protection", rp = "中压自动重合闸开关。", ip = "-12 -32 36 64", sp = 36, ap = 64, lp = '<line x1="0" y1="-30" x2="0" y2="-10" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-13" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-8" x2="2" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-12" x2="2" y2="-8" stroke="black" stroke-width="1" fill="none"/><path d="M 13 -12 A 7 7 0 1 1 6 -5" fill="none" stroke="black" stroke-width="0.8"/><polygon points="4,-7 6,-5 8,-3" fill="black"/><text x="14" y="6" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">AR</text>', cp = [{ id: "t1", x: 0, y: -30, orientation: "n" }, { id: "t2", x: 0, y: 30, orientation: "s" }], dp = [{ name: "open", type: "boolean", default: !1, label: "断开" }], up = { kind: "inline" }, $_ = {
6174
6174
  id: tp,
6175
6175
  name: np,
@@ -6270,13 +6270,13 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6270
6270
  terminals: Dp,
6271
6271
  viewBox: Bp,
6272
6272
  width: jp
6273
- }, Symbol.toStringTag, { value: "Module" })), Wp = "reverse-power-relay", qp = "逆功率继电器 (32)", Gp = "protection", Xp = "逆功率 / 逆流保护继电器 (ANSI 32)。", Kp = "-62 -42 64 44", Yp = 64, Vp = 44, Up = '<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">I</text><polygon points="-15,-20 -30,-20 -24,-22 -24,-18 -30,-20 -24,-20" fill="black" stroke="black" stroke-width="1"/>', Jp = [{ id: "t_top", x: -30, y: -40, orientation: "n" }], Zp = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_02.elmt", qetEnglishName: "Reverse current relay" }, I_ = {
6273
+ }, Symbol.toStringTag, { value: "Module" })), Wp = "reverse-power-relay", qp = "逆功率继电器 (32)", Gp = "protection", Xp = "逆功率 / 逆流保护继电器 (ANSI 32)。", Yp = "-62 -42 64 44", Kp = 64, Vp = 44, Up = '<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">I</text><polygon points="-15,-20 -30,-20 -24,-22 -24,-18 -30,-20 -24,-20" fill="black" stroke="black" stroke-width="1"/>', Jp = [{ id: "t_top", x: -30, y: -40, orientation: "n" }], Zp = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_02.elmt", qetEnglishName: "Reverse current relay" }, I_ = {
6274
6274
  id: Wp,
6275
6275
  name: qp,
6276
6276
  category: Gp,
6277
6277
  description: Xp,
6278
- viewBox: Kp,
6279
- width: Yp,
6278
+ viewBox: Yp,
6279
+ width: Kp,
6280
6280
  height: Vp,
6281
6281
  svg: Up,
6282
6282
  terminals: Jp,
@@ -6292,8 +6292,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6292
6292
  source: Zp,
6293
6293
  svg: Up,
6294
6294
  terminals: Jp,
6295
- viewBox: Kp,
6296
- width: Yp
6295
+ viewBox: Yp,
6296
+ width: Kp
6297
6297
  }, Symbol.toStringTag, { value: "Module" })), Qp = "selector-switch", eg = "选择开关 (SA)", tg = "switching", ng = "转换 / 选择开关 (旋转操作, 保位)。", og = "-34 -42 36 64", rg = 36, ig = 64, sg = '<line x1="-32" y1="-10" x2="-2" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-32" y1="-15" x2="-32" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>', ag = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 20, orientation: "s" }], lg = [{ name: "open", type: "boolean", default: !1, label: "断开" }], cg = { kind: "elmt", path: "91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_04.elmt", qetEnglishName: "Switch, manually operated, turning, stay-put" }, O_ = {
6298
6298
  id: Qp,
6299
6299
  name: eg,
@@ -6390,7 +6390,7 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6390
6390
  terminals: Lg,
6391
6391
  viewBox: Pg,
6392
6392
  width: Og
6393
- }, Symbol.toStringTag, { value: "Module" })), Dg = "siren", Rg = "警笛 (HA)", Fg = "control", Hg = "声响警笛 / 报警器。", Wg = "-32 -42 44 54", qg = 44, Gg = 54, Xg = '<line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="10,-10 -30,-10 -10,-40" fill="none" stroke="black" stroke-width="1"/>', Kg = [{ id: "t1", x: -20, y: 10, orientation: "s" }, { id: "t2", x: 0, y: 10, orientation: "s" }], Yg = { kind: "elmt", path: "91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_09.elmt", qetEnglishName: "Siren" }, H_ = {
6393
+ }, Symbol.toStringTag, { value: "Module" })), Dg = "siren", Rg = "警笛 (HA)", Fg = "control", Hg = "声响警笛 / 报警器。", Wg = "-32 -42 44 54", qg = 44, Gg = 54, Xg = '<line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="10,-10 -30,-10 -10,-40" fill="none" stroke="black" stroke-width="1"/>', Yg = [{ id: "t1", x: -20, y: 10, orientation: "s" }, { id: "t2", x: 0, y: 10, orientation: "s" }], Kg = { kind: "elmt", path: "91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_09.elmt", qetEnglishName: "Siren" }, H_ = {
6394
6394
  id: Dg,
6395
6395
  name: Rg,
6396
6396
  category: Fg,
@@ -6399,8 +6399,8 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6399
6399
  width: qg,
6400
6400
  height: Gg,
6401
6401
  svg: Xg,
6402
- terminals: Kg,
6403
- source: Yg
6402
+ terminals: Yg,
6403
+ source: Kg
6404
6404
  }, W_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6405
6405
  __proto__: null,
6406
6406
  category: Fg,
@@ -6409,9 +6409,9 @@ const pi = "ammeter", gi = "电流表 (A)", yi = "measurement", bi = "-22 -42 44
6409
6409
  height: Gg,
6410
6410
  id: Dg,
6411
6411
  name: Rg,
6412
- source: Yg,
6412
+ source: Kg,
6413
6413
  svg: Xg,
6414
- terminals: Kg,
6414
+ terminals: Yg,
6415
6415
  viewBox: Wg,
6416
6416
  width: qg
6417
6417
  }, Symbol.toStringTag, { value: "Module" })), Vg = "socket-outlet", Ug = "插座 / 连接器", Jg = "load", Zg = "电源插座 / 多极连接器。", Qg = "-7 -2 13 34", e1 = 13, t1 = 34, n1 = '<line x1="-5" y1="13" x2="4" y2="20" fill="none" stroke="black" stroke-width="0.4"/><line x1="-1" y1="12" x2="-1" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="12" x2="1" y2="19" fill="none" stroke="black" stroke-width="1"/><path d="M 3 13 A 3 3 0 0 0 -3 13" fill="none" stroke="black" stroke-width="1"/>', o1 = [{ id: "t1", x: 0, y: 0, orientation: "n" }, { id: "t2", x: 0, y: 30, orientation: "s" }], r1 = { kind: "elmt", path: "11_singlepole/140_connectors_plugs/prise_multipolaire_2.elmt", qetEnglishName: `Plug and multipolar representation
@@ -6450,7 +6450,7 @@ unifilar` }, q_ = {
6450
6450
  svg: m1,
6451
6451
  terminals: f1,
6452
6452
  source: h1
6453
- }, K_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6453
+ }, Y_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6454
6454
  __proto__: null,
6455
6455
  category: a1,
6456
6456
  default: X_,
@@ -6463,7 +6463,7 @@ unifilar` }, q_ = {
6463
6463
  terminals: f1,
6464
6464
  viewBox: c1,
6465
6465
  width: d1
6466
- }, Symbol.toStringTag, { value: "Module" })), p1 = "sync-motor", g1 = "同步电动机", y1 = "load", b1 = "-62 -82 64 114", w1 = 64, x1 = 114, v1 = '<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-53" x2="-10" y2="-80" fill="none" stroke="black" stroke-width="1"/><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">1</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -40 10 A 5 5 0 0 0 -50 10" fill="none" stroke="black" stroke-width="1"/><path d="M -30 10 A 5 5 0 0 0 -40 10" fill="none" stroke="black" stroke-width="1"/><path d="M -20 10 A 5 5 0 0 0 -30 10" fill="none" stroke="black" stroke-width="1"/><path d="M -10 10 A 5 5 0 0 0 -20 10" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="10" x2="-50" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="10" x2="-10" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="15" x2="-20" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="20" x2="-32" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-27" y1="20" x2="-20" y2="20" fill="none" stroke="black" stroke-width="1"/>', k1 = [{ id: "t1", x: -10, y: -80, orientation: "n" }, { id: "t2", x: -50, y: -80, orientation: "n" }], _1 = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_07/en_60617_06_07_02.elmt", qetEnglishName: "Synchronous motor, single-phase" }, Y_ = {
6466
+ }, Symbol.toStringTag, { value: "Module" })), p1 = "sync-motor", g1 = "同步电动机", y1 = "load", b1 = "-62 -82 64 114", w1 = 64, x1 = 114, v1 = '<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-53" x2="-10" y2="-80" fill="none" stroke="black" stroke-width="1"/><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">1</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -40 10 A 5 5 0 0 0 -50 10" fill="none" stroke="black" stroke-width="1"/><path d="M -30 10 A 5 5 0 0 0 -40 10" fill="none" stroke="black" stroke-width="1"/><path d="M -20 10 A 5 5 0 0 0 -30 10" fill="none" stroke="black" stroke-width="1"/><path d="M -10 10 A 5 5 0 0 0 -20 10" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="10" x2="-50" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="10" x2="-10" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="15" x2="-20" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="20" x2="-32" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-27" y1="20" x2="-20" y2="20" fill="none" stroke="black" stroke-width="1"/>', k1 = [{ id: "t1", x: -10, y: -80, orientation: "n" }, { id: "t2", x: -50, y: -80, orientation: "n" }], _1 = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_07/en_60617_06_07_02.elmt", qetEnglishName: "Synchronous motor, single-phase" }, K_ = {
6467
6467
  id: p1,
6468
6468
  name: g1,
6469
6469
  category: y1,
@@ -6476,7 +6476,7 @@ unifilar` }, q_ = {
6476
6476
  }, V_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6477
6477
  __proto__: null,
6478
6478
  category: y1,
6479
- default: Y_,
6479
+ default: K_,
6480
6480
  height: x1,
6481
6481
  id: p1,
6482
6482
  name: g1,
@@ -6533,12 +6533,12 @@ unifilar` }, q_ = {
6533
6533
  terminals: H1,
6534
6534
  viewBox: z1,
6535
6535
  width: D1
6536
- }, Symbol.toStringTag, { value: "Module" })), q1 = "thermal-overload", G1 = "热过载继电器", X1 = "motor-control", K1 = "电机热过载保护继电器, 通常串接在接触器和电机之间。", Y1 = "-9 -32 19 64", V1 = 19, U1 = 64, J1 = '<line x1="0" y1="-30" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-7" y="-15" width="14" height="30" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,-10 -1,-5 -4,0 -1,5 -4,10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>', Z1 = [{ id: "t1", x: 0, y: -30, orientation: "n" }, { id: "t2", x: 0, y: 30, orientation: "s" }], Q1 = [{ name: "tripped", type: "boolean", default: !1, label: "动作" }], ey = { kind: "inline" }, e$ = {
6536
+ }, Symbol.toStringTag, { value: "Module" })), q1 = "thermal-overload", G1 = "热过载继电器", X1 = "motor-control", Y1 = "电机热过载保护继电器, 通常串接在接触器和电机之间。", K1 = "-9 -32 19 64", V1 = 19, U1 = 64, J1 = '<line x1="0" y1="-30" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-7" y="-15" width="14" height="30" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,-10 -1,-5 -4,0 -1,5 -4,10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>', Z1 = [{ id: "t1", x: 0, y: -30, orientation: "n" }, { id: "t2", x: 0, y: 30, orientation: "s" }], Q1 = [{ name: "tripped", type: "boolean", default: !1, label: "动作" }], ey = { kind: "inline" }, e$ = {
6537
6537
  id: q1,
6538
6538
  name: G1,
6539
6539
  category: X1,
6540
- description: K1,
6541
- viewBox: Y1,
6540
+ description: Y1,
6541
+ viewBox: K1,
6542
6542
  width: V1,
6543
6543
  height: U1,
6544
6544
  svg: J1,
@@ -6549,7 +6549,7 @@ unifilar` }, q_ = {
6549
6549
  __proto__: null,
6550
6550
  category: X1,
6551
6551
  default: e$,
6552
- description: K1,
6552
+ description: Y1,
6553
6553
  height: U1,
6554
6554
  id: q1,
6555
6555
  name: G1,
@@ -6557,7 +6557,7 @@ unifilar` }, q_ = {
6557
6557
  state: Q1,
6558
6558
  svg: J1,
6559
6559
  terminals: Z1,
6560
- viewBox: Y1,
6560
+ viewBox: K1,
6561
6561
  width: V1
6562
6562
  }, Symbol.toStringTag, { value: "Module" })), ty = "thermocouple", ny = "热电偶 (BT)", oy = "measurement", ry = "热电偶温度传感器。", iy = "-26 -42 52 46", sy = 52, ay = 46, ly = '<ellipse cx="0" cy="0" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/><polyline points="-10,-40 -10,-15 0,0 10,-15 10,-40" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-16" x2="-16" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="16" y1="-16" x2="24" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-20" x2="20" y2="-12" fill="none" stroke="black" stroke-width="1"/>', cy = [{ id: "t1", x: 10, y: -40, orientation: "n" }, { id: "t2", x: -10, y: -40, orientation: "n" }], dy = { kind: "elmt", path: "91_en_60617/en_60617_08/en_60617_08_06/en_60617_08_06_01.elmt", qetEnglishName: "Thermocouple" }, n$ = {
6563
6563
  id: ty,
@@ -6659,13 +6659,13 @@ unifilar` }, q_ = {
6659
6659
  terminals: Ry,
6660
6660
  viewBox: jy,
6661
6661
  width: Ly
6662
- }, Symbol.toStringTag, { value: "Module" })), Wy = "transformer-2w", qy = "双绕组变压器", Gy = "transformer", Xy = "-62 -142 64 144", Ky = 64, Yy = 144, Vy = '<ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-140" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/>', Uy = [{ id: "t1", x: -30, y: -140, orientation: "n" }, { id: "t2", x: -30, y: 0, orientation: "s" }], Jy = [{ name: "S", label: "容量", type: "number", unit: "MVA", showOnCanvas: !0 }, { name: "ratio", label: "变比", type: "string", showOnCanvas: !0 }], Zy = { x: 4, y: -68, anchor: "start" }, Qy = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_01.elmt", qetEnglishName: "Transformer with two windings, general symbol" }, d$ = {
6662
+ }, Symbol.toStringTag, { value: "Module" })), Wy = "transformer-2w", qy = "双绕组变压器", Gy = "transformer", Xy = "-62 -142 64 144", Yy = 64, Ky = 144, Vy = '<ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-140" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/>', Uy = [{ id: "t1", x: -30, y: -140, orientation: "n" }, { id: "t2", x: -30, y: 0, orientation: "s" }], Jy = [{ name: "S", label: "容量", type: "number", unit: "MVA", showOnCanvas: !0 }, { name: "ratio", label: "变比", type: "string", showOnCanvas: !0 }], Zy = { x: 4, y: -68, anchor: "start" }, Qy = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_01.elmt", qetEnglishName: "Transformer with two windings, general symbol" }, d$ = {
6663
6663
  id: Wy,
6664
6664
  name: qy,
6665
6665
  category: Gy,
6666
6666
  viewBox: Xy,
6667
- width: Ky,
6668
- height: Yy,
6667
+ width: Yy,
6668
+ height: Ky,
6669
6669
  svg: Vy,
6670
6670
  terminals: Uy,
6671
6671
  params: Jy,
@@ -6675,7 +6675,7 @@ unifilar` }, q_ = {
6675
6675
  __proto__: null,
6676
6676
  category: Gy,
6677
6677
  default: d$,
6678
- height: Yy,
6678
+ height: Ky,
6679
6679
  id: Wy,
6680
6680
  label: Zy,
6681
6681
  name: qy,
@@ -6684,7 +6684,7 @@ unifilar` }, q_ = {
6684
6684
  svg: Vy,
6685
6685
  terminals: Uy,
6686
6686
  viewBox: Xy,
6687
- width: Ky
6687
+ width: Yy
6688
6688
  }, Symbol.toStringTag, { value: "Module" })), eb = "transformer-3w", tb = "三绕组变压器", nb = "transformer", ob = "-82 -131 114 133", rb = 114, ib = 133, sb = '<ellipse cx="-30" cy="-80" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-31" y1="-129" x2="-31" y2="-109" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-50" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-20" x2="-50" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>', ab = [{ id: "t1", x: -31, y: -129, orientation: "n" }, { id: "t_low_left", x: -50, y: 0, orientation: "s" }, { id: "t_low_right", x: 0, y: 0, orientation: "s" }], lb = { x: 4, y: -64, anchor: "start" }, cb = { kind: "elmt", path: "91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_04.elmt", qetEnglishName: "Transformer with three windings, general symbol" }, m$ = {
6689
6689
  id: eb,
6690
6690
  name: tb,
@@ -6785,14 +6785,14 @@ unifilar` }, q_ = {
6785
6785
  terminals: Db,
6786
6786
  viewBox: Bb,
6787
6787
  width: jb
6788
- }, Symbol.toStringTag, { value: "Module" })), Hb = "varmeter", Wb = "无功功率表 (var)", qb = "measurement", Gb = "无功功率表 (var)。", Xb = "-22 -42 44 44", Kb = 44, Yb = 44, Vb = '<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">var</text>', Ub = [{ id: "t_top", x: 0, y: -40, orientation: "n" }], Jb = { kind: "elmt", path: "91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_04.elmt", qetEnglishName: "Varmeter" }, x$ = {
6788
+ }, Symbol.toStringTag, { value: "Module" })), Hb = "varmeter", Wb = "无功功率表 (var)", qb = "measurement", Gb = "无功功率表 (var)。", Xb = "-22 -42 44 44", Yb = 44, Kb = 44, Vb = '<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">var</text>', Ub = [{ id: "t_top", x: 0, y: -40, orientation: "n" }], Jb = { kind: "elmt", path: "91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_04.elmt", qetEnglishName: "Varmeter" }, x$ = {
6789
6789
  id: Hb,
6790
6790
  name: Wb,
6791
6791
  category: qb,
6792
6792
  description: Gb,
6793
6793
  viewBox: Xb,
6794
- width: Kb,
6795
- height: Yb,
6794
+ width: Yb,
6795
+ height: Kb,
6796
6796
  svg: Vb,
6797
6797
  terminals: Ub,
6798
6798
  source: Jb
@@ -6801,14 +6801,14 @@ unifilar` }, q_ = {
6801
6801
  category: qb,
6802
6802
  default: x$,
6803
6803
  description: Gb,
6804
- height: Yb,
6804
+ height: Kb,
6805
6805
  id: Hb,
6806
6806
  name: Wb,
6807
6807
  source: Jb,
6808
6808
  svg: Vb,
6809
6809
  terminals: Ub,
6810
6810
  viewBox: Xb,
6811
- width: Kb
6811
+ width: Yb
6812
6812
  }, Symbol.toStringTag, { value: "Module" })), Zb = "vfd", Qb = "变频器 (VFD)", ew = "motor-control", tw = "Variable Frequency Drive — 异步电动机调速。", nw = "-24 -42 48 84", ow = 48, rw = 84, iw = '<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="6" y="14" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~f</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>', sw = [{ id: "t_in", x: 0, y: -40, orientation: "n" }, { id: "t_out", x: 0, y: 40, orientation: "s" }], aw = { kind: "inline" }, k$ = {
6813
6813
  id: Zb,
6814
6814
  name: Qb,
@@ -6927,9 +6927,9 @@ unifilar` }, q_ = {
6927
6927
  terminals: Gw,
6928
6928
  viewBox: Fw,
6929
6929
  width: Hw
6930
- }, Symbol.toStringTag, { value: "Module" })), Kw = "zener-diode", Yw = "稳压二极管 (D)", Vw = "passive", Uw = "齐纳 / 稳压二极管。t1=阳极(上), t2=阴极(下)。", Jw = "-12 -42 24 44", Zw = 24, Qw = 44, ex = '<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-15" x2="-10" y2="-10" fill="none" stroke="black" stroke-width="1"/>', tx = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 0, orientation: "s" }], nx = { x: 6, y: -20, anchor: "start" }, ox = { kind: "elmt", path: "91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_06.elmt", qetEnglishName: "Breakdown diode, unidirectional; Zener diode" }, I$ = {
6931
- id: Kw,
6932
- name: Yw,
6930
+ }, Symbol.toStringTag, { value: "Module" })), Yw = "zener-diode", Kw = "稳压二极管 (D)", Vw = "passive", Uw = "齐纳 / 稳压二极管。t1=阳极(上), t2=阴极(下)。", Jw = "-12 -42 24 44", Zw = 24, Qw = 44, ex = '<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-15" x2="-10" y2="-10" fill="none" stroke="black" stroke-width="1"/>', tx = [{ id: "t1", x: 0, y: -40, orientation: "n" }, { id: "t2", x: 0, y: 0, orientation: "s" }], nx = { x: 6, y: -20, anchor: "start" }, ox = { kind: "elmt", path: "91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_06.elmt", qetEnglishName: "Breakdown diode, unidirectional; Zener diode" }, I$ = {
6931
+ id: Yw,
6932
+ name: Kw,
6933
6933
  category: Vw,
6934
6934
  description: Uw,
6935
6935
  viewBox: Jw,
@@ -6945,9 +6945,9 @@ unifilar` }, q_ = {
6945
6945
  default: I$,
6946
6946
  description: Uw,
6947
6947
  height: Qw,
6948
- id: Kw,
6948
+ id: Yw,
6949
6949
  label: nx,
6950
- name: Yw,
6950
+ name: Kw,
6951
6951
  source: ox,
6952
6952
  svg: ex,
6953
6953
  terminals: tx,
@@ -6967,7 +6967,7 @@ unifilar` }, q_ = {
6967
6967
  "./busbar.json": F2,
6968
6968
  "./buzzer.json": W2,
6969
6969
  "./capacitor.json": G2,
6970
- "./contactor.json": K2,
6970
+ "./contactor.json": Y2,
6971
6971
  "./converter-bidir.json": V2,
6972
6972
  "./ct.json": J2,
6973
6973
  "./dc-combiner.json": Q2,
@@ -6994,7 +6994,7 @@ unifilar` }, q_ = {
6994
6994
  "./inductor.json": Fk,
6995
6995
  "./inverter.json": Wk,
6996
6996
  "./limit-switch.json": Gk,
6997
- "./load-switch.json": Kk,
6997
+ "./load-switch.json": Yk,
6998
6998
  "./load.json": Vk,
6999
6999
  "./make-contact.json": Jk,
7000
7000
  "./motor-starter.json": Qk,
@@ -7021,7 +7021,7 @@ unifilar` }, q_ = {
7021
7021
  "./shunt-reactor.json": F_,
7022
7022
  "./siren.json": W_,
7023
7023
  "./socket-outlet.json": G_,
7024
- "./soft-starter.json": K_,
7024
+ "./soft-starter.json": Y_,
7025
7025
  "./sync-motor.json": V_,
7026
7026
  "./synchronoscope.json": J_,
7027
7027
  "./terminal.json": Q_,
@@ -7046,7 +7046,7 @@ unifilar` }, q_ = {
7046
7046
  (e) => e.default
7047
7047
  ), Ue = Object.fromEntries(
7048
7048
  rx.map((e) => [e.id, e])
7049
- ), Go = [
7049
+ ), Yo = [
7050
7050
  "busbar",
7051
7051
  "switching",
7052
7052
  "protection",
@@ -7068,7 +7068,7 @@ unifilar` }, q_ = {
7068
7068
  for (const n of rx)
7069
7069
  (e[t = n.category] ?? (e[t] = [])).push(n);
7070
7070
  return e;
7071
- })(), Xo = new Map(
7071
+ })(), Ko = new Map(
7072
7072
  Object.entries(Ue)
7073
7073
  );
7074
7074
  function j$(e) {
@@ -7096,7 +7096,7 @@ function Ze(e) {
7096
7096
  return;
7097
7097
  }
7098
7098
  n.set(x.id, x);
7099
- const I = Xo.get(x.kind);
7099
+ const I = Ko.get(x.kind);
7100
7100
  I || t.diagnostics.push({
7101
7101
  code: "E003",
7102
7102
  severity: "error",
@@ -7121,7 +7121,7 @@ function Ze(e) {
7121
7121
  at: x.layout.at,
7122
7122
  span: x.layout.span,
7123
7123
  rot: I,
7124
- axis: Dn(I)
7124
+ axis: Fn(I)
7125
7125
  });
7126
7126
  }
7127
7127
  });
@@ -7191,7 +7191,7 @@ function Ze(e) {
7191
7191
  buses: e.buses ?? [],
7192
7192
  junctions: e.junctions ?? [],
7193
7193
  wires: c,
7194
- library: Xo,
7194
+ library: Ko,
7195
7195
  userLayout: d,
7196
7196
  userBusLayout: r
7197
7197
  });
@@ -7207,7 +7207,7 @@ function Ze(e) {
7207
7207
  at: ((h = S.layout) == null ? void 0 : h.at) ?? [0, 0],
7208
7208
  span: ((g = S.layout) == null ? void 0 : g.span) ?? z$,
7209
7209
  rot: ((w = S.layout) == null ? void 0 : w.rot) ?? 0,
7210
- axis: Dn((($ = S.layout) == null ? void 0 : $.rot) ?? 0)
7210
+ axis: Fn((($ = S.layout) == null ? void 0 : $.rot) ?? 0)
7211
7211
  }
7212
7212
  });
7213
7213
  for (const x of t.elements.values()) {
@@ -7216,7 +7216,7 @@ function Ze(e) {
7216
7216
  if (!S) continue;
7217
7217
  const I = [];
7218
7218
  for (const D of x.libraryDef.terminals) {
7219
- const X = `${x.element.id}.${D.id}`, V = De([D.x, D.y], S), te = Gt(D.orientation, S);
7219
+ const X = `${x.element.id}.${D.id}`, V = De([D.x, D.y], S), te = Xt(D.orientation, S);
7220
7220
  t.terminals.set(X, {
7221
7221
  ref: X,
7222
7222
  elementId: x.element.id,
@@ -7287,7 +7287,7 @@ function Ze(e) {
7287
7287
  });
7288
7288
  for (const x of c) {
7289
7289
  if (x.path && x.path.length >= 2) {
7290
- const I = x.path, D = I.length >= 2 ? I[1] : null, X = I.length >= 2 ? I[I.length - 2] : null, V = Wo(x.ends[0], D, t), te = Wo(x.ends[1], X, t);
7290
+ const I = x.path, D = I.length >= 2 ? I[1] : null, X = I.length >= 2 ? I[I.length - 2] : null, V = Go(x.ends[0], D, t), te = Go(x.ends[1], X, t);
7291
7291
  if (V && te) {
7292
7292
  const le = [
7293
7293
  [V[0], V[1]],
@@ -7335,31 +7335,31 @@ const D$ = {
7335
7335
  rectifier: "RT",
7336
7336
  inverter: "INV",
7337
7337
  "converter-bidir": "PCS"
7338
- }, Ko = "B", Yo = "J";
7339
- function to(e) {
7338
+ }, Vo = "B", Uo = "J";
7339
+ function oo(e) {
7340
7340
  return /* @__PURE__ */ new Set([
7341
7341
  ...e.elements.map((t) => t.id),
7342
7342
  ...(e.buses ?? []).map((t) => t.id),
7343
7343
  ...(e.junctions ?? []).map((t) => t.id)
7344
7344
  ]);
7345
7345
  }
7346
- function Ut(e, t) {
7347
- const n = D$[t] ?? t, o = to(e);
7346
+ function Jt(e, t) {
7347
+ const n = D$[t] ?? t, o = oo(e);
7348
7348
  let r = 1;
7349
7349
  for (; o.has(`${n}${r}`); ) r++;
7350
7350
  return `${n}${r}`;
7351
7351
  }
7352
- function Vo(e) {
7353
- const t = to(e);
7352
+ function Jo(e) {
7353
+ const t = oo(e);
7354
7354
  let n = 1;
7355
- for (; t.has(`${Ko}${n}`); ) n++;
7356
- return `${Ko}${n}`;
7355
+ for (; t.has(`${Vo}${n}`); ) n++;
7356
+ return `${Vo}${n}`;
7357
7357
  }
7358
- function Uo(e) {
7359
- const t = to(e);
7358
+ function Zo(e) {
7359
+ const t = oo(e);
7360
7360
  let n = 1;
7361
- for (; t.has(`${Yo}${n}`); ) n++;
7362
- return `${Yo}${n}`;
7361
+ for (; t.has(`${Uo}${n}`); ) n++;
7362
+ return `${Uo}${n}`;
7363
7363
  }
7364
7364
  function R$(e) {
7365
7365
  const t = new Set((e.annotations ?? []).map((o) => o.id));
@@ -7374,7 +7374,7 @@ function lt(e, t) {
7374
7374
  r ^= o.charCodeAt(i), r = Math.imul(r, 16777619);
7375
7375
  return `w_${(r >>> 0).toString(36)}`;
7376
7376
  }
7377
- const Jo = { version: "1", elements: [] }, F$ = 100, Zo = 20;
7377
+ const Qo = { version: "1", elements: [] }, F$ = 100, er = 20;
7378
7378
  function H$() {
7379
7379
  if (typeof window > "u") return "select";
7380
7380
  try {
@@ -7383,11 +7383,11 @@ function H$() {
7383
7383
  return "select";
7384
7384
  }
7385
7385
  }
7386
- const b = on()(
7386
+ const b = an()(
7387
7387
  c2(
7388
7388
  (e, t) => ({
7389
- diagram: Jo,
7390
- internal: Ze(Jo),
7389
+ diagram: Qo,
7390
+ internal: Ze(Qo),
7391
7391
  fileSession: null,
7392
7392
  activeTool: H$(),
7393
7393
  placeKind: null,
@@ -7575,7 +7575,7 @@ const b = on()(
7575
7575
  continue;
7576
7576
  }
7577
7577
  const g = r.layout.get(p);
7578
- g && (c[p] = Dt(g));
7578
+ g && (c[p] = Rt(g));
7579
7579
  }
7580
7580
  const d = {};
7581
7581
  for (const p of n) {
@@ -7583,7 +7583,7 @@ const b = on()(
7583
7583
  h && (d[p] = rt(h.geometry));
7584
7584
  }
7585
7585
  const u = (o.wires ?? []).filter(
7586
- (p) => p.ends.every((h) => i.has(_n(h)))
7586
+ (p) => p.ends.every((h) => i.has(En(h)))
7587
7587
  ).map((p) => structuredClone(p));
7588
7588
  e({
7589
7589
  clipboard: { elements: s, buses: a, junctions: l, placements: c, busLayouts: d, wires: u },
@@ -7598,24 +7598,24 @@ const b = on()(
7598
7598
  const { clipboard: n, clipboardPasteIndex: o, diagram: r } = t();
7599
7599
  if (!n || n.elements.length === 0 && n.buses.length === 0 && n.junctions.length === 0)
7600
7600
  return;
7601
- const i = o + 1, s = Zo * i, a = Zo * i, l = /* @__PURE__ */ new Map();
7601
+ const i = o + 1, s = er * i, a = er * i, l = /* @__PURE__ */ new Map();
7602
7602
  let c = r;
7603
7603
  for (const u of n.elements) {
7604
- const f = Ut(c, u.kind);
7604
+ const f = Jt(c, u.kind);
7605
7605
  l.set(u.id, f), c = {
7606
7606
  ...c,
7607
7607
  elements: [...c.elements, { id: f, kind: u.kind }]
7608
7608
  };
7609
7609
  }
7610
7610
  for (const u of n.buses) {
7611
- const f = Vo(c);
7611
+ const f = Jo(c);
7612
7612
  l.set(u.id, f), c = {
7613
7613
  ...c,
7614
7614
  buses: [...c.buses ?? [], { id: f }]
7615
7615
  };
7616
7616
  }
7617
7617
  for (const u of n.junctions) {
7618
- const f = Uo(c);
7618
+ const f = Zo(c);
7619
7619
  l.set(u.id, f), c = {
7620
7620
  ...c,
7621
7621
  junctions: [...c.junctions ?? [], { id: f }]
@@ -7656,7 +7656,7 @@ const b = on()(
7656
7656
  d(k.ends[1])
7657
7657
  ];
7658
7658
  return { id: lt(x[0], x[1]), ends: x };
7659
- }), $ = Qo(u.wires ?? [], w);
7659
+ }), $ = tr(u.wires ?? [], w);
7660
7660
  return {
7661
7661
  ...u,
7662
7662
  elements: [...u.elements, ...f],
@@ -7721,7 +7721,7 @@ const b = on()(
7721
7721
  for (const l of o.elements) {
7722
7722
  if (r[l.id]) continue;
7723
7723
  const c = n.layout.get(l.id);
7724
- c && (i[l.id] = Dt(c));
7724
+ c && (i[l.id] = Rt(c));
7725
7725
  }
7726
7726
  const s = [];
7727
7727
  if ((o.buses ?? []).forEach((l, c) => {
@@ -7751,7 +7751,7 @@ const b = on()(
7751
7751
  } else {
7752
7752
  if (i[d]) continue;
7753
7753
  const u = o.layout.get(d);
7754
- u && (s[d] = Dt(u));
7754
+ u && (s[d] = Rt(u));
7755
7755
  }
7756
7756
  if (Object.keys(s).length === 0 && a.size === 0)
7757
7757
  return r;
@@ -7779,7 +7779,7 @@ const b = on()(
7779
7779
  a.set(d, u);
7780
7780
  continue;
7781
7781
  }
7782
- const f = o.layout.get(d), p = i[d] ?? (f ? Dt(f) : { at: [0, 0] });
7782
+ const f = o.layout.get(d), p = i[d] ?? (f ? Rt(f) : { at: [0, 0] });
7783
7783
  i[d] = {
7784
7784
  ...p,
7785
7785
  at: [p.at[0] + u[0], p.at[1] + u[1]]
@@ -7814,7 +7814,7 @@ const b = on()(
7814
7814
  const o = new Set(n);
7815
7815
  t().dispatch((r) => {
7816
7816
  const i = r.elements.filter((d) => !o.has(d.id)), s = (r.buses ?? []).filter((d) => !o.has(d.id)), a = (r.junctions ?? []).filter((d) => !o.has(d.id)), l = (r.wires ?? []).filter(
7817
- (d) => !o.has(_n(d.ends[0])) && !o.has(_n(d.ends[1]))
7817
+ (d) => !o.has(En(d.ends[0])) && !o.has(En(d.ends[1]))
7818
7818
  ), c = r.layout ? Object.fromEntries(
7819
7819
  Object.entries(r.layout).filter(([d]) => !o.has(d))
7820
7820
  ) : void 0;
@@ -7923,7 +7923,7 @@ const b = on()(
7923
7923
  addElement: (n, o, r) => {
7924
7924
  if (n === "busbar")
7925
7925
  return t().addBus(o, 320);
7926
- const i = Ut(t().diagram, n);
7926
+ const i = Jt(t().diagram, n);
7927
7927
  return t().dispatch((s) => {
7928
7928
  const a = { id: i, kind: n, ...r ?? {} };
7929
7929
  return {
@@ -7934,7 +7934,7 @@ const b = on()(
7934
7934
  }), e({ selection: [i] }), i;
7935
7935
  },
7936
7936
  addBus: (n, o, r) => {
7937
- const i = Vo(t().diagram);
7937
+ const i = Jo(t().diagram);
7938
7938
  return t().dispatch((s) => {
7939
7939
  const a = {
7940
7940
  id: i,
@@ -7947,7 +7947,7 @@ const b = on()(
7947
7947
  }), e({ selection: [i] }), i;
7948
7948
  },
7949
7949
  addJunction: (n) => {
7950
- const o = Uo(t().diagram);
7950
+ const o = Zo(t().diagram);
7951
7951
  return t().dispatch((r) => {
7952
7952
  const i = { id: o, layout: { at: n } };
7953
7953
  return { ...r, junctions: [...r.junctions ?? [], i] };
@@ -8001,7 +8001,7 @@ const b = on()(
8001
8001
  });
8002
8002
  return i = {
8003
8003
  ...i,
8004
- wires: Qo($, [
8004
+ wires: tr($, [
8005
8005
  k(g.ends[0], w),
8006
8006
  k(w, g.ends[1])
8007
8007
  ])
@@ -8106,17 +8106,17 @@ const b = on()(
8106
8106
  function W$(e) {
8107
8107
  return Array.from(new Set(e));
8108
8108
  }
8109
- function _n(e) {
8109
+ function En(e) {
8110
8110
  const t = e.indexOf(".");
8111
8111
  return t < 0 ? e : e.slice(0, t);
8112
8112
  }
8113
- function Qo(e, t) {
8113
+ function tr(e, t) {
8114
8114
  const n = new Set(e.map((r) => r.id)), o = e.slice();
8115
8115
  for (const r of t)
8116
8116
  n.has(r.id) || (n.add(r.id), o.push(r));
8117
8117
  return o;
8118
8118
  }
8119
- function Dt(e) {
8119
+ function Rt(e) {
8120
8120
  return {
8121
8121
  at: [e.at[0], e.at[1]],
8122
8122
  ...e.rot ? { rot: e.rot } : {},
@@ -8131,20 +8131,20 @@ function rt(e) {
8131
8131
  };
8132
8132
  }
8133
8133
  let ix = null;
8134
- function er(e) {
8134
+ function nr(e) {
8135
8135
  ix = e;
8136
8136
  }
8137
8137
  function tt() {
8138
8138
  return ix;
8139
8139
  }
8140
- const Jt = 10;
8140
+ const Zt = 10;
8141
8141
  function sx() {
8142
8142
  if (typeof document > "u") return !0;
8143
8143
  const e = document.querySelector(".ole-canvas-root");
8144
8144
  return !!e && !e.classList.contains("hide-grid");
8145
8145
  }
8146
8146
  function ue(e) {
8147
- return sx() ? Math.round(e / Jt) * Jt : e;
8147
+ return sx() ? Math.round(e / Zt) * Zt : e;
8148
8148
  }
8149
8149
  const q$ = 30, G$ = 144;
8150
8150
  function ax(e, t) {
@@ -8156,7 +8156,7 @@ function ax(e, t) {
8156
8156
  const g = lx(n), w = g ? [ue(t[0]) - g.x, ue(t[1]) - g.y] : [ue(t[0]), ue(t[1])];
8157
8157
  return { newElementId: o.addElement(e, w), attachedToBus: !1 };
8158
8158
  }
8159
- const { busId: s, busAt: a, axis: l } = i, c = K$(n, l), d = Ut(r, e), u = n.terminals.find((g) => g.id === c), f = l === "x" ? t[0] : a[0], p = l === "y" ? t[1] : a[1], h = u ? [ue(f) - u.x, ue(p) - u.y] : [ue(t[0]), ue(t[1])];
8159
+ const { busId: s, busAt: a, axis: l } = i, c = Y$(n, l), d = Jt(r, e), u = n.terminals.find((g) => g.id === c), f = l === "x" ? t[0] : a[0], p = l === "y" ? t[1] : a[1], h = u ? [ue(f) - u.x, ue(p) - u.y] : [ue(t[0]), ue(t[1])];
8160
8160
  return o.dispatch((g) => {
8161
8161
  const w = { id: d, kind: e }, $ = { at: h }, k = `${d}.${c}`, x = {
8162
8162
  id: lt(s, k),
@@ -8189,7 +8189,7 @@ function X$(e, t) {
8189
8189
  }
8190
8190
  return o ? { busId: o.busId, busAt: o.busAt, axis: o.axis } : null;
8191
8191
  }
8192
- function K$(e, t) {
8192
+ function Y$(e, t) {
8193
8193
  return e.terminals.length === 0 ? "t" : [...e.terminals].sort(
8194
8194
  (o, r) => t === "x" ? o.y - r.y : o.x - r.x
8195
8195
  )[0].id;
@@ -8208,6 +8208,10 @@ function cx(e, t) {
8208
8208
  const l = s[1] - a / 2, c = s[1] + a / 2, d = Math.max(l, Math.min(c, t[1])), u = s[0], f = t[0] >= u ? "e" : "w";
8209
8209
  return { ref: e, world: [u, d], orientation: f, isBus: !0, busId: e };
8210
8210
  }
8211
+ if (!e.includes(".") && n.junctions.has(e)) {
8212
+ const r = n.junctions.get(e), [i, s] = r.world, a = t[0] - i, l = t[1] - s, c = Math.abs(a) >= Math.abs(l) ? a >= 0 ? "e" : "w" : l >= 0 ? "s" : "n";
8213
+ return { ref: e, world: [i, s], orientation: c, isBus: !1 };
8214
+ }
8211
8215
  const o = n.terminals.get(e);
8212
8216
  return o ? {
8213
8217
  ref: e,
@@ -8216,7 +8220,7 @@ function cx(e, t) {
8216
8220
  isBus: !1
8217
8221
  } : null;
8218
8222
  }
8219
- const Y$ = {
8223
+ const K$ = {
8220
8224
  n: "s",
8221
8225
  s: "n",
8222
8226
  e: "w",
@@ -8225,15 +8229,15 @@ const Y$ = {
8225
8229
  function dx(e, t, n) {
8226
8230
  if (e.terminals.length === 0)
8227
8231
  return { id: "t", x: 0, y: 0, orientation: "n" };
8228
- const o = Y$[t.orientation], r = e.terminals.filter((l) => l.orientation === o), i = r.length > 0 ? r : e.terminals;
8229
- let s = i[0], a = tr(s, n, t.world);
8232
+ const o = K$[t.orientation], r = e.terminals.filter((l) => l.orientation === o), i = r.length > 0 ? r : e.terminals;
8233
+ let s = i[0], a = or(s, n, t.world);
8230
8234
  for (let l = 1; l < i.length; l++) {
8231
- const c = i[l], d = tr(c, n, t.world);
8235
+ const c = i[l], d = or(c, n, t.world);
8232
8236
  d < a && (a = d, s = c);
8233
8237
  }
8234
8238
  return s;
8235
8239
  }
8236
- function tr(e, t, n) {
8240
+ function or(e, t, n) {
8237
8241
  const o = t[0] + e.x - n[0], r = t[1] + e.y - n[1];
8238
8242
  return o * o + r * r;
8239
8243
  }
@@ -8245,7 +8249,7 @@ function V$(e, t, n) {
8245
8249
  const a = n[0] - s.world[0], l = n[1] - s.world[1], c = a * a + l * l <= G$, d = [ue(n[0]), ue(n[1])], u = dx(o, s, d), f = c ? s.world : d, p = [
8246
8250
  ue(f[0] - u.x),
8247
8251
  ue(f[1] - u.y)
8248
- ], h = Ut(i, e);
8252
+ ], h = Jt(i, e);
8249
8253
  return r.dispatch((g) => {
8250
8254
  const w = { id: h, kind: e }, $ = { at: p }, k = `${h}.${u.id}`, x = s.isBus && s.busId ? s.busId : t, S = {
8251
8255
  id: lt(x, k),
@@ -8259,8 +8263,8 @@ function V$(e, t, n) {
8259
8263
  };
8260
8264
  }), r.setSelection([h]), { newElementId: h, attachedToBus: s.isBus };
8261
8265
  }
8262
- const sn = 9, Zt = 7;
8263
- function an(e, t) {
8266
+ const cn = 9, Qt = 7;
8267
+ function dn(e, t) {
8264
8268
  var i, s;
8265
8269
  const n = [], o = ((i = e.element.name) == null ? void 0 : i.trim()) || e.element.id;
8266
8270
  if (o && n.push(o), t !== "all" || !((s = e.libraryDef) != null && s.params)) return n;
@@ -8272,11 +8276,11 @@ function an(e, t) {
8272
8276
  }
8273
8277
  return n;
8274
8278
  }
8275
- function ln(e) {
8279
+ function un(e) {
8276
8280
  const t = U$(e.viewBox);
8277
8281
  return t ? { x: t.x + t.w + 2, y: t.y + 4, anchor: "start" } : { x: 0, y: 0, anchor: "start" };
8278
8282
  }
8279
- function cn(e, t) {
8283
+ function mn(e, t) {
8280
8284
  let n = e.x, o = e.y;
8281
8285
  switch (t.mirror && (n = -n), t.rot) {
8282
8286
  case 90:
@@ -8306,7 +8310,7 @@ function J$() {
8306
8310
  var d;
8307
8311
  const i = t.get(r.element.id);
8308
8312
  if (!i || !r.libraryDef) return null;
8309
- const s = r.libraryDef.label ?? ln(r.libraryDef), a = cn(s, i), l = s.anchor ?? "start";
8313
+ const s = r.libraryDef.label ?? un(r.libraryDef), a = mn(s, i), l = s.anchor ?? "start";
8310
8314
  if (o === r.element.id)
8311
8315
  return /* @__PURE__ */ m(
8312
8316
  Z$,
@@ -8319,7 +8323,7 @@ function J$() {
8319
8323
  r.element.id
8320
8324
  );
8321
8325
  if (n === "off") return null;
8322
- const c = an(r, n);
8326
+ const c = dn(r, n);
8323
8327
  return c.length === 0 ? null : /* @__PURE__ */ m(
8324
8328
  "g",
8325
8329
  {
@@ -8329,7 +8333,7 @@ function J$() {
8329
8333
  "text",
8330
8334
  {
8331
8335
  x: 0,
8332
- y: f * sn,
8336
+ y: f * cn,
8333
8337
  textAnchor: l,
8334
8338
  className: "ole-annotation-text",
8335
8339
  children: u
@@ -8341,7 +8345,7 @@ function J$() {
8341
8345
  );
8342
8346
  }) });
8343
8347
  }
8344
- const $n = 200, Sn = 9;
8348
+ const Mn = 200, Tn = 9;
8345
8349
  function Z$({
8346
8350
  elementId: e,
8347
8351
  currentName: t,
@@ -8376,13 +8380,13 @@ function Z$({
8376
8380
  l.stopPropagation();
8377
8381
  }
8378
8382
  let a = n[0];
8379
- return o === "middle" ? a -= $n / 2 : o === "end" && (a -= $n), /* @__PURE__ */ m(
8383
+ return o === "middle" ? a -= Mn / 2 : o === "end" && (a -= Mn), /* @__PURE__ */ m(
8380
8384
  "foreignObject",
8381
8385
  {
8382
8386
  x: a,
8383
- y: n[1] - Sn,
8384
- width: $n,
8385
- height: Sn * 2.2,
8387
+ y: n[1] - Tn,
8388
+ width: Mn,
8389
+ height: Tn * 2.2,
8386
8390
  className: "ole-element-name-editor",
8387
8391
  children: /* @__PURE__ */ m(
8388
8392
  "div",
@@ -8395,7 +8399,7 @@ function Z$({
8395
8399
  onPointerDown: (l) => l.stopPropagation(),
8396
8400
  onMouseDown: (l) => l.stopPropagation(),
8397
8401
  style: {
8398
- fontSize: `${Sn}px`,
8402
+ fontSize: `${Tn}px`,
8399
8403
  fontFamily: "ui-sans-serif, system-ui, sans-serif",
8400
8404
  color: "var(--foreground)",
8401
8405
  background: "var(--canvas-bg)",
@@ -8414,7 +8418,7 @@ function Z$({
8414
8418
  }
8415
8419
  );
8416
8420
  }
8417
- const ux = 8, Qt = 1.25;
8421
+ const ux = 8, en = 1.25;
8418
8422
  function Q$() {
8419
8423
  const e = b((o) => o.diagram.annotations), t = b((o) => o.selectedAnnotation), n = b((o) => o.editingAnnotation);
8420
8424
  return !e || e.length === 0 ? null : /* @__PURE__ */ m("g", { className: "ole-free-annotation-layer", children: e.map(
@@ -8436,7 +8440,7 @@ function eS({
8436
8440
  `), r = Math.max(
8437
8441
  20,
8438
8442
  ...o.map((s) => s.length * n * 0.55)
8439
- ), i = o.length * n * Qt;
8443
+ ), i = o.length * n * en;
8440
8444
  return /* @__PURE__ */ j(
8441
8445
  "g",
8442
8446
  {
@@ -8469,7 +8473,7 @@ function eS({
8469
8473
  "text",
8470
8474
  {
8471
8475
  x: e.at[0],
8472
- y: e.at[1] + n * 0.85 + a * n * Qt,
8476
+ y: e.at[1] + n * 0.85 + a * n * en,
8473
8477
  fontSize: n,
8474
8478
  className: "ole-free-annotation-text",
8475
8479
  children: s
@@ -8528,14 +8532,14 @@ function tS({ ann: e }) {
8528
8532
  onMouseDown: (a) => a.stopPropagation(),
8529
8533
  style: {
8530
8534
  fontSize: `${n}px`,
8531
- lineHeight: Qt,
8535
+ lineHeight: en,
8532
8536
  fontFamily: "ui-sans-serif, system-ui, sans-serif",
8533
8537
  color: "var(--foreground)",
8534
8538
  background: "var(--canvas-bg)",
8535
8539
  outline: "1px dashed var(--selection)",
8536
8540
  padding: "0 2px",
8537
8541
  minWidth: `${n}px`,
8538
- minHeight: `${n * Qt}px`,
8542
+ minHeight: `${n * en}px`,
8539
8543
  whiteSpace: "pre-wrap",
8540
8544
  wordBreak: "break-word",
8541
8545
  cursor: "text"
@@ -8555,7 +8559,7 @@ function oS() {
8555
8559
  const { axis: r, at: i, span: s } = o.geometry, a = s / 2, l = r === "x" ? [i[0] - a, i[1]] : [i[0], i[1] - a], c = r === "x" ? [i[0] + a, i[1]] : [i[0], i[1] + a];
8556
8560
  return /* @__PURE__ */ j("g", { className: "ole-bus-handles", pointerEvents: "auto", children: [
8557
8561
  /* @__PURE__ */ m(
8558
- nr,
8562
+ rr,
8559
8563
  {
8560
8564
  x: l[0],
8561
8565
  y: l[1],
@@ -8565,7 +8569,7 @@ function oS() {
8565
8569
  }
8566
8570
  ),
8567
8571
  /* @__PURE__ */ m(
8568
- nr,
8572
+ rr,
8569
8573
  {
8570
8574
  x: c[0],
8571
8575
  y: c[1],
@@ -8576,7 +8580,7 @@ function oS() {
8576
8580
  )
8577
8581
  ] });
8578
8582
  }
8579
- function nr({
8583
+ function rr({
8580
8584
  x: e,
8581
8585
  y: t,
8582
8586
  busId: n,
@@ -8595,7 +8599,7 @@ function nr({
8595
8599
  }, l = (d) => {
8596
8600
  const u = s.current;
8597
8601
  if (!u || d.pointerId !== u.pointerId || !i) return;
8598
- const f = i.screenToSvg(d.clientX, d.clientY), p = r === "x" ? f[0] - u.startSvg[0] : f[1] - u.startSvg[1], h = sx() ? Math.round(p / Jt) * Jt : p, g = u.startSpan + (o === "end" ? h : -h);
8602
+ const f = i.screenToSvg(d.clientX, d.clientY), p = r === "x" ? f[0] - u.startSvg[0] : f[1] - u.startSvg[1], h = sx() ? Math.round(p / Zt) * Zt : p, g = u.startSpan + (o === "end" ? h : -h);
8599
8603
  if (g < nS) return;
8600
8604
  const w = r === "x" ? [u.startAt[0] + h / 2, u.startAt[1]] : [u.startAt[0], u.startAt[1] + h / 2];
8601
8605
  b.getState().updateBus(n, { span: g, at: w });
@@ -8618,9 +8622,9 @@ function nr({
8618
8622
  }
8619
8623
  );
8620
8624
  }
8621
- const Rn = 0.5;
8622
- function Tt(e, t) {
8623
- return Math.abs(e[1] - t[1]) < Rn ? "h" : "v";
8625
+ const Hn = 0.5;
8626
+ function Mt(e, t) {
8627
+ return Math.abs(e[1] - t[1]) < Hn ? "h" : "v";
8624
8628
  }
8625
8629
  function rS() {
8626
8630
  const e = b((a) => a.selectedWire), t = b((a) => a.internal.wireRenders);
@@ -8629,7 +8633,7 @@ function rS() {
8629
8633
  if (!n || n.path.length < 2) return null;
8630
8634
  const o = n.path, r = o.length, i = [];
8631
8635
  for (let a = 1; a < r - 1; a++) {
8632
- const l = Tt(o[a - 1], o[a]), c = Tt(o[a], o[a + 1]), d = a - 1 === 0, u = a + 1 === r - 1, f = d && l === "v" || u && c === "v", p = d && l === "h" || u && c === "h";
8636
+ const l = Mt(o[a - 1], o[a]), c = Mt(o[a], o[a + 1]), d = a - 1 === 0, u = a + 1 === r - 1, f = d && l === "v" || u && c === "v", p = d && l === "h" || u && c === "h";
8633
8637
  f && p || i.push(
8634
8638
  /* @__PURE__ */ m(
8635
8639
  iS,
@@ -8646,13 +8650,13 @@ function rS() {
8646
8650
  const s = [];
8647
8651
  for (let a = 0; a < r - 1; a++) {
8648
8652
  const l = o[a], c = o[a + 1];
8649
- Math.abs(l[0] - c[0]) < Rn && Math.abs(l[1] - c[1]) < Rn || s.push(
8653
+ Math.abs(l[0] - c[0]) < Hn && Math.abs(l[1] - c[1]) < Hn || s.push(
8650
8654
  /* @__PURE__ */ m(
8651
8655
  sS,
8652
8656
  {
8653
8657
  wireId: e,
8654
8658
  segIndex: a,
8655
- axis: Tt(l, c)
8659
+ axis: Mt(l, c)
8656
8660
  },
8657
8661
  `m-${a}`
8658
8662
  )
@@ -8697,9 +8701,9 @@ function iS({
8697
8701
  if (S[0] === x[0] && S[1] === x[1]) return;
8698
8702
  const I = $.map((V) => [V[0], V[1]]);
8699
8703
  I[k] = S;
8700
- const D = Tt($[k - 1], $[k]);
8704
+ const D = Mt($[k - 1], $[k]);
8701
8705
  k - 1 > 0 && (D === "h" ? I[k - 1] = [$[k - 1][0], S[1]] : I[k - 1] = [S[0], $[k - 1][1]]);
8702
- const X = Tt($[k], $[k + 1]);
8706
+ const X = Mt($[k], $[k + 1]);
8703
8707
  k + 1 < $.length - 1 && (X === "h" ? I[k + 1] = [$[k + 1][0], S[1]] : I[k + 1] = [S[0], $[k + 1][1]]), b.getState().updateWirePath(e, I);
8704
8708
  }, f = (h) => {
8705
8709
  const g = i.current;
@@ -8801,7 +8805,7 @@ function sS({
8801
8805
  }
8802
8806
  );
8803
8807
  }
8804
- const aS = 3, Nn = 12;
8808
+ const aS = 3, An = 12;
8805
8809
  function lS() {
8806
8810
  const e = b((a) => a.internal.buses), t = b((a) => a.selection), n = b((a) => a.selectedNode), o = b((a) => a.internal.nodes), r = b((a) => a.internal.terminalToNode), i = new Set(t), s = /* @__PURE__ */ new Set();
8807
8811
  if (n) {
@@ -8811,7 +8815,7 @@ function lS() {
8811
8815
  !l.includes(".") && e.has(l) && s.add(l);
8812
8816
  }
8813
8817
  return /* @__PURE__ */ m("g", { className: "ole-bus-layer", children: Array.from(e.values()).map(({ bus: a, geometry: l }) => {
8814
- const { axis: c, at: d, span: u } = l, f = u / 2, p = c === "x" ? d[0] - f : d[0], h = c === "x" ? d[1] : d[1] - f, g = c === "x" ? d[0] + f : d[0], w = c === "x" ? d[1] : d[1] + f, $ = i.has(a.id), k = s.has(a.id), x = r.get(a.id) ?? void 0, S = Nn / 2, I = c === "x" ? d[0] - f : d[0] - S, D = c === "x" ? d[1] - S : d[1] - f, X = c === "x" ? u : Nn, V = c === "x" ? Nn : u;
8818
+ const { axis: c, at: d, span: u } = l, f = u / 2, p = c === "x" ? d[0] - f : d[0], h = c === "x" ? d[1] : d[1] - f, g = c === "x" ? d[0] + f : d[0], w = c === "x" ? d[1] : d[1] + f, $ = i.has(a.id), k = s.has(a.id), x = r.get(a.id) ?? void 0, S = An / 2, I = c === "x" ? d[0] - f : d[0] - S, D = c === "x" ? d[1] - S : d[1] - f, X = c === "x" ? u : An, V = c === "x" ? An : u;
8815
8819
  return /* @__PURE__ */ j(
8816
8820
  "g",
8817
8821
  {
@@ -9004,17 +9008,17 @@ function pS() {
9004
9008
  }) });
9005
9009
  }
9006
9010
  let mx = null;
9007
- const Fn = /* @__PURE__ */ new Set();
9008
- function Rt(e) {
9011
+ const Wn = /* @__PURE__ */ new Set();
9012
+ function Ft(e) {
9009
9013
  mx = e;
9010
- for (const t of Fn) t(e);
9014
+ for (const t of Wn) t(e);
9011
9015
  }
9012
9016
  function gS() {
9013
9017
  return mx;
9014
9018
  }
9015
9019
  function yS(e) {
9016
- return Fn.add(e), () => {
9017
- Fn.delete(e);
9020
+ return Wn.add(e), () => {
9021
+ Wn.delete(e);
9018
9022
  };
9019
9023
  }
9020
9024
  function bS() {
@@ -9139,7 +9143,7 @@ function kS() {
9139
9143
  );
9140
9144
  }) });
9141
9145
  }
9142
- const or = 4;
9146
+ const ir = 4;
9143
9147
  function _S(e, t, n, o) {
9144
9148
  const r = t[0] - e[0], i = t[1] - e[1], s = o[0] - n[0], a = o[1] - n[1], l = r * a - i * s;
9145
9149
  if (Math.abs(l) < 1e-9) return null;
@@ -9157,7 +9161,7 @@ function $S(e, t) {
9157
9161
  }
9158
9162
  const l = s[0] - i[0], c = s[1] - i[1], d = Math.hypot(l, c) || 1, u = l / d, f = c / d, p = (g) => (g[0] - i[0]) * u + (g[1] - i[1]) * f, h = a.slice().sort((g, w) => p(g) - p(w));
9159
9163
  for (const g of h) {
9160
- const w = p(g), $ = Math.max(0, w - or), k = Math.min(d, w + or);
9164
+ const w = p(g), $ = Math.max(0, w - ir), k = Math.min(d, w + ir);
9161
9165
  o.push([i[0] + u * $, i[1] + f * $]), n.push(o), o = [[i[0] + u * k, i[1] + f * k]];
9162
9166
  }
9163
9167
  o.push(s);
@@ -9218,19 +9222,19 @@ function SS() {
9218
9222
  }) });
9219
9223
  }
9220
9224
  let Qe = null;
9221
- const Hn = /* @__PURE__ */ new Set();
9222
- function He(e) {
9225
+ const qn = /* @__PURE__ */ new Set();
9226
+ function Ke(e) {
9223
9227
  if (!(e === null && Qe === null || e && Qe && e.ref === Qe.ref && e.world[0] === Qe.world[0] && e.world[1] === Qe.world[1])) {
9224
9228
  Qe = e;
9225
- for (const t of Hn) t(e);
9229
+ for (const t of qn) t(e);
9226
9230
  }
9227
9231
  }
9228
9232
  function NS() {
9229
9233
  return Qe;
9230
9234
  }
9231
9235
  function ES(e) {
9232
- return Hn.add(e), () => {
9233
- Hn.delete(e);
9236
+ return qn.add(e), () => {
9237
+ qn.delete(e);
9234
9238
  };
9235
9239
  }
9236
9240
  function MS() {
@@ -9283,7 +9287,7 @@ function MS() {
9283
9287
  function nt(e, t) {
9284
9288
  return e instanceof Element ? e.closest(`[${t}]`) : null;
9285
9289
  }
9286
- function mt(e) {
9290
+ function ut(e) {
9287
9291
  var t;
9288
9292
  return ((t = nt(e, "data-element-id")) == null ? void 0 : t.getAttribute("data-element-id")) ?? null;
9289
9293
  }
@@ -9295,7 +9299,7 @@ function AS(e) {
9295
9299
  var t;
9296
9300
  return ((t = nt(e, "data-junction-id")) == null ? void 0 : t.getAttribute("data-junction-id")) ?? null;
9297
9301
  }
9298
- function dt(e) {
9302
+ function fn(e) {
9299
9303
  var r;
9300
9304
  const t = (r = nt(e, "data-terminal-id")) == null ? void 0 : r.getAttribute("data-terminal-id");
9301
9305
  if (t) return t;
@@ -9304,15 +9308,15 @@ function dt(e) {
9304
9308
  const o = TS(e);
9305
9309
  return o || null;
9306
9310
  }
9307
- function dn(e) {
9311
+ function hn(e) {
9308
9312
  var t;
9309
9313
  return ((t = nt(e, "data-node-id")) == null ? void 0 : t.getAttribute("data-node-id")) ?? null;
9310
9314
  }
9311
- function Wn(e) {
9315
+ function Gn(e) {
9312
9316
  var t;
9313
9317
  return ((t = nt(e, "data-wire-id")) == null ? void 0 : t.getAttribute("data-wire-id")) ?? null;
9314
9318
  }
9315
- function en(e) {
9319
+ function tn(e) {
9316
9320
  var t;
9317
9321
  return ((t = nt(e, "data-annotation-id")) == null ? void 0 : t.getAttribute("data-annotation-id")) ?? null;
9318
9322
  }
@@ -9443,23 +9447,23 @@ function IS() {
9443
9447
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
9444
9448
  }, []);
9445
9449
  }
9446
- let qn = null;
9447
- const Gn = /* @__PURE__ */ new Set();
9450
+ let Xn = null;
9451
+ const Yn = /* @__PURE__ */ new Set();
9448
9452
  function PS(e) {
9449
- if (e !== qn) {
9450
- qn = e;
9451
- for (const t of Gn) t(e);
9453
+ if (e !== Xn) {
9454
+ Xn = e;
9455
+ for (const t of Yn) t(e);
9452
9456
  }
9453
9457
  }
9454
9458
  function OS() {
9455
- return qn;
9459
+ return Xn;
9456
9460
  }
9457
9461
  function BS(e) {
9458
- return Gn.add(e), () => {
9459
- Gn.delete(e);
9462
+ return Yn.add(e), () => {
9463
+ Yn.delete(e);
9460
9464
  };
9461
9465
  }
9462
- const rr = "ole-hover-element-host", jS = "ole-hover-terminal-on", LS = "ole-hover-node-on";
9466
+ const sr = "ole-hover-element-host", jS = "ole-hover-terminal-on", LS = "ole-hover-node-on";
9463
9467
  function zS(e) {
9464
9468
  se(() => {
9465
9469
  const t = e.current;
@@ -9473,10 +9477,10 @@ function zS(e) {
9473
9477
  }, a = (u) => {
9474
9478
  var p, h;
9475
9479
  if (u === n) return;
9476
- n && ((p = t.querySelector(`[data-element-id="${Ft(n)}"]`)) == null || p.classList.remove(rr)), u && ((h = t.querySelector(`[data-element-id="${Ft(u)}"]`)) == null || h.classList.add(rr));
9480
+ n && ((p = t.querySelector(`[data-element-id="${Ht(n)}"]`)) == null || p.classList.remove(sr)), u && ((h = t.querySelector(`[data-element-id="${Ht(u)}"]`)) == null || h.classList.add(sr));
9477
9481
  const f = u ? Array.from(
9478
9482
  t.querySelectorAll(
9479
- `.ole-terminal[data-element-id="${Ft(u)}"]`
9483
+ `.ole-terminal[data-element-id="${Ht(u)}"]`
9480
9484
  )
9481
9485
  ) : [];
9482
9486
  s(r, f, jS), n = u, u ? t.setAttribute("data-hover-element", "") : t.removeAttribute("data-hover-element"), PS(u);
@@ -9484,15 +9488,15 @@ function zS(e) {
9484
9488
  if (u === o) return;
9485
9489
  const f = u ? Array.from(
9486
9490
  t.querySelectorAll(
9487
- `[data-node-id="${Ft(u)}"]`
9491
+ `[data-node-id="${Ht(u)}"]`
9488
9492
  )
9489
9493
  ) : [];
9490
9494
  s(i, f, LS), o = u, u ? t.setAttribute("data-hover-node", "") : t.removeAttribute("data-hover-node");
9491
9495
  }, c = (u) => {
9492
- a(mt(u.target));
9493
- const f = dt(u.target);
9496
+ a(ut(u.target));
9497
+ const f = fn(u.target);
9494
9498
  let p = null;
9495
- f ? p = b.getState().internal.terminalToNode.get(f) ?? null : p = dn(u.target), l(p);
9499
+ f ? p = b.getState().internal.terminalToNode.get(f) ?? null : p = hn(u.target), l(p);
9496
9500
  }, d = () => {
9497
9501
  a(null), l(null);
9498
9502
  };
@@ -9501,10 +9505,10 @@ function zS(e) {
9501
9505
  };
9502
9506
  }, [e]);
9503
9507
  }
9504
- function Ft(e) {
9508
+ function Ht(e) {
9505
9509
  return e.replace(/(["\\])/g, "\\$1");
9506
9510
  }
9507
- function px(e, t) {
9511
+ function DS(e, t) {
9508
9512
  const n = b.getState().internal;
9509
9513
  if (!e.includes(".")) {
9510
9514
  const r = n.buses.get(e);
@@ -9523,16 +9527,74 @@ function px(e, t) {
9523
9527
  const o = n.terminals.get(e);
9524
9528
  return o ? { ref: e, world: o.world, isBus: !1 } : null;
9525
9529
  }
9526
- const ir = 3;
9530
+ const ar = 10, Wt = (e) => Math.round(e / ar) * ar, RS = 16;
9531
+ function px(e, t) {
9532
+ let n = e[0], o = 1 / 0;
9533
+ for (let r = 0; r < e.length - 1; r++) {
9534
+ const [i, s] = e[r], [a, l] = e[r + 1], c = a - i, d = l - s, u = c * c + d * d, f = u === 0 ? 0 : Math.max(0, Math.min(1, ((t[0] - i) * c + (t[1] - s) * d) / u)), p = i + f * c, h = s + f * d, g = (p - t[0]) ** 2 + (h - t[1]) ** 2;
9535
+ g < o && (o = g, n = [p, h]);
9536
+ }
9537
+ return n;
9538
+ }
9539
+ function nn(e, t) {
9540
+ return typeof document < "u" ? document.elementFromPoint(e, t) : null;
9541
+ }
9542
+ function FS(e, t) {
9543
+ const n = b.getState().internal.wireRenders;
9544
+ let o = null, r = t;
9545
+ for (const i of n.values()) {
9546
+ if (i.path.length < 2) continue;
9547
+ const s = px(i.path, e), a = Math.hypot(s[0] - e[0], s[1] - e[1]);
9548
+ a <= r && (r = a, o = { wireId: i.wireId, at: s });
9549
+ }
9550
+ return o;
9551
+ }
9552
+ function Tt(e, t, n) {
9553
+ const o = e ? fn(e) : null;
9554
+ if (o) {
9555
+ const a = DS(o, t);
9556
+ if (a) return { spec: { end: o }, world: a.world, ref: o, isBus: a.isBus, create: !1 };
9557
+ }
9558
+ let r = e ? Gn(e) : null, i = null;
9559
+ if (r) {
9560
+ const a = b.getState().internal.wireRenders.get(r);
9561
+ i = a ? px(a.path, t) : t;
9562
+ } else {
9563
+ const a = FS(t, n);
9564
+ a && (r = a.wireId, i = a.at);
9565
+ }
9566
+ if (r && i) {
9567
+ const a = [Wt(i[0]), Wt(i[1])];
9568
+ return { spec: { onWire: r, at: a }, world: a, ref: null, isBus: !1, create: !0 };
9569
+ }
9570
+ const s = [Wt(t[0]), Wt(t[1])];
9571
+ return { spec: { junctionAt: s }, world: s, ref: null, isBus: !1, create: !0 };
9572
+ }
9573
+ function At(e, t, n) {
9574
+ const o = e.viewport.screenToSvg(t, n), r = e.viewport.screenToSvg(t + RS, n);
9575
+ return Math.hypot(r[0] - o[0], r[1] - o[1]);
9576
+ }
9577
+ function gx(e) {
9578
+ return {
9579
+ ref: e.ref,
9580
+ world: e.world,
9581
+ isBus: e.isBus,
9582
+ ...e.create ? { create: "junction" } : {}
9583
+ };
9584
+ }
9585
+ function on(e, t) {
9586
+ return e.ref && t.ref ? e.ref === t.ref : !e.ref && !t.ref ? e.world[0] === t.world[0] && e.world[1] === t.world[1] : !1;
9587
+ }
9588
+ const lr = 3;
9527
9589
  let de = null, Ce = null, Ie = null, ge = null;
9528
- const DS = {
9590
+ const HS = {
9529
9591
  id: "select",
9530
9592
  cursor: "default",
9531
9593
  onPointerDown(e, t) {
9532
9594
  var p, h, g, w, $, k, x;
9533
9595
  if (e.button !== 0 || e.target instanceof Element && e.target.closest(".ole-bus-handle, .ole-wire-handle"))
9534
9596
  return;
9535
- const n = b.getState(), o = en(e.target);
9597
+ const n = b.getState(), o = tn(e.target);
9536
9598
  if (o) {
9537
9599
  e.preventDefault(), e.stopPropagation();
9538
9600
  const S = (p = n.diagram.annotations) == null ? void 0 : p.find((I) => I.id === o);
@@ -9546,7 +9608,7 @@ const DS = {
9546
9608
  };
9547
9609
  return;
9548
9610
  }
9549
- const i = (e.target instanceof Element ? (h = e.target.closest("[data-terminal-id]")) == null ? void 0 : h.getAttribute("data-terminal-id") : null) ? dt(e.target) : null;
9611
+ const i = (e.target instanceof Element ? (h = e.target.closest("[data-terminal-id]")) == null ? void 0 : h.getAttribute("data-terminal-id") : null) ? fn(e.target) : null;
9550
9612
  if (i) {
9551
9613
  const S = i.indexOf("."), I = S > 0 ? i.slice(0, S) : "";
9552
9614
  if (I && n.selection.includes(I)) {
@@ -9554,9 +9616,9 @@ const DS = {
9554
9616
  return;
9555
9617
  }
9556
9618
  }
9557
- let s = mt(e.target);
9619
+ let s = ut(e.target);
9558
9620
  if (!s) {
9559
- const S = Wn(e.target);
9621
+ const S = Gn(e.target);
9560
9622
  if (S && typeof document < "u") {
9561
9623
  const I = document.elementsFromPoint(e.clientX, e.clientY);
9562
9624
  for (const D of I) {
@@ -9569,10 +9631,10 @@ const DS = {
9569
9631
  }
9570
9632
  }
9571
9633
  if (!s) {
9572
- const S = Wn(e.target);
9634
+ const S = Gn(e.target);
9573
9635
  if (S) {
9574
9636
  if (e.preventDefault(), e.altKey) {
9575
- const I = dn(e.target);
9637
+ const I = hn(e.target);
9576
9638
  if (I) {
9577
9639
  n.setSelectedNode(I);
9578
9640
  return;
@@ -9630,12 +9692,12 @@ const DS = {
9630
9692
  if (Ie && e.pointerId === Ie.pointerId) {
9631
9693
  const n = t.viewport.screenToSvg(e.clientX, e.clientY);
9632
9694
  b.getState().setCursorSvg(n);
9633
- const o = typeof document < "u" ? document.elementFromPoint(e.clientX, e.clientY) : null, r = o ? dt(o) : null;
9634
- if (!r || r === Ie.fromRef) {
9635
- He(null);
9636
- return;
9637
- }
9638
- He(px(r, n));
9695
+ const o = nn(e.clientX, e.clientY), r = Tt(o, n, At(t, e.clientX, e.clientY)), i = {
9696
+ spec: { end: Ie.fromRef },
9697
+ world: [0, 0],
9698
+ ref: Ie.fromRef
9699
+ };
9700
+ Ke(on(i, r) ? null : gx(r));
9639
9701
  return;
9640
9702
  }
9641
9703
  if (de && e.pointerId === de.pointerId) {
@@ -9668,7 +9730,7 @@ const DS = {
9668
9730
  }
9669
9731
  if (Ce && e.pointerId === Ce.pointerId) {
9670
9732
  const n = t.viewport.screenToSvg(e.clientX, e.clientY);
9671
- Rt(sr(Ce.startSvg, n));
9733
+ Ft(cr(Ce.startSvg, n));
9672
9734
  return;
9673
9735
  }
9674
9736
  },
@@ -9685,9 +9747,13 @@ const DS = {
9685
9747
  }
9686
9748
  if (Ie && e.pointerId === Ie.pointerId) {
9687
9749
  const n = b.getState(), o = Ie.fromRef;
9688
- Ie = null, t.hostEl.classList.remove("tool-wire"), n.setWireFromTerminal(null), n.setCursorSvg(null), He(null);
9689
- const r = dt(e.target);
9690
- r && r !== o && n.addWire(o, r);
9750
+ Ie = null, t.hostEl.classList.remove("tool-wire"), n.setWireFromTerminal(null), n.setCursorSvg(null), Ke(null);
9751
+ const r = t.viewport.screenToSvg(e.clientX, e.clientY), i = nn(e.clientX, e.clientY) ?? (e.target instanceof Element ? e.target : null), s = Tt(i, r, At(t, e.clientX, e.clientY));
9752
+ if (on({
9753
+ world: [0, 0],
9754
+ ref: o
9755
+ }, s)) return;
9756
+ n.connectWire({ end: o }, s.spec);
9691
9757
  return;
9692
9758
  }
9693
9759
  if (de && e.pointerId === de.pointerId) {
@@ -9718,9 +9784,9 @@ const DS = {
9718
9784
  }
9719
9785
  if (Ce && e.pointerId === Ce.pointerId) {
9720
9786
  t.hostEl.hasPointerCapture(e.pointerId) && t.hostEl.releasePointerCapture(e.pointerId);
9721
- const n = t.viewport.screenToSvg(e.clientX, e.clientY), o = sr(Ce.startSvg, n);
9722
- if (o.w >= ir || o.h >= ir) {
9723
- const r = RS(o);
9787
+ const n = t.viewport.screenToSvg(e.clientX, e.clientY), o = cr(Ce.startSvg, n);
9788
+ if (o.w >= lr || o.h >= lr) {
9789
+ const r = WS(o);
9724
9790
  if (Ce.shiftKey) {
9725
9791
  const i = new Set(Ce.baseSelection);
9726
9792
  for (const s of r)
@@ -9729,7 +9795,7 @@ const DS = {
9729
9795
  } else
9730
9796
  b.getState().setSelection(r);
9731
9797
  }
9732
- Rt(null), Ce = null;
9798
+ Ft(null), Ce = null;
9733
9799
  }
9734
9800
  },
9735
9801
  onPointerCancel(e, t) {
@@ -9774,7 +9840,7 @@ const DS = {
9774
9840
  if (Ie && e.pointerId === Ie.pointerId) {
9775
9841
  t.hostEl.classList.remove("tool-wire");
9776
9842
  const l = b.getState();
9777
- l.setWireFromTerminal(null), l.setCursorSvg(null), He(null), Ie = null;
9843
+ l.setWireFromTerminal(null), l.setCursorSvg(null), Ke(null), Ie = null;
9778
9844
  }
9779
9845
  if (Ce && e.pointerId === Ce.pointerId) {
9780
9846
  if ((a = (s = t.hostEl).hasPointerCapture) != null && a.call(s, e.pointerId))
@@ -9782,45 +9848,45 @@ const DS = {
9782
9848
  t.hostEl.releasePointerCapture(e.pointerId);
9783
9849
  } catch {
9784
9850
  }
9785
- Rt(null), Ce = null;
9851
+ Ft(null), Ce = null;
9786
9852
  }
9787
9853
  },
9788
9854
  onDoubleClick(e) {
9789
- const t = b.getState(), n = en(e.target);
9855
+ const t = b.getState(), n = tn(e.target);
9790
9856
  if (n) {
9791
9857
  e.preventDefault(), e.stopPropagation(), t.setEditingAnnotation(n);
9792
9858
  return;
9793
9859
  }
9794
- const o = mt(e.target);
9860
+ const o = ut(e.target);
9795
9861
  o && (e.preventDefault(), e.stopPropagation(), t.setEditingElement(o));
9796
9862
  },
9797
9863
  onDeactivate(e) {
9798
9864
  if (de = null, Ce = null, ge = null, Ie) {
9799
9865
  e.hostEl.classList.remove("tool-wire");
9800
9866
  const t = b.getState();
9801
- t.setWireFromTerminal(null), t.setCursorSvg(null), He(null), Ie = null;
9867
+ t.setWireFromTerminal(null), t.setCursorSvg(null), Ke(null), Ie = null;
9802
9868
  }
9803
- Rt(null);
9869
+ Ft(null);
9804
9870
  }
9805
9871
  };
9806
- function sr(e, t) {
9872
+ function cr(e, t) {
9807
9873
  const n = Math.min(e[0], t[0]), o = Math.min(e[1], t[1]), r = Math.abs(t[0] - e[0]), i = Math.abs(t[1] - e[1]);
9808
9874
  return { x: n, y: o, w: r, h: i };
9809
9875
  }
9810
- function RS(e) {
9876
+ function WS(e) {
9811
9877
  const { internal: t } = b.getState(), n = [];
9812
9878
  for (const o of t.elements.values()) {
9813
9879
  if (!o.libraryDef) continue;
9814
9880
  const r = t.layout.get(o.element.id);
9815
9881
  if (!r) continue;
9816
- const i = HS(o.libraryDef.viewBox);
9882
+ const i = GS(o.libraryDef.viewBox);
9817
9883
  if (!i) continue;
9818
9884
  const s = [
9819
9885
  [i.x, i.y],
9820
9886
  [i.x + i.w, i.y],
9821
9887
  [i.x, i.y + i.h],
9822
9888
  [i.x + i.w, i.y + i.h]
9823
- ].map(([u, f]) => FS([u, f], r));
9889
+ ].map(([u, f]) => qS([u, f], r));
9824
9890
  let a = 1 / 0, l = -1 / 0, c = 1 / 0, d = -1 / 0;
9825
9891
  for (const [u, f] of s)
9826
9892
  u < a && (a = u), u > l && (l = u), f < c && (c = f), f > d && (d = f);
@@ -9834,7 +9900,7 @@ function RS(e) {
9834
9900
  r[0] >= e.x && r[0] <= e.x + e.w && r[1] >= e.y && r[1] <= e.y + e.h && n.push(o.id);
9835
9901
  return n;
9836
9902
  }
9837
- function FS(e, t) {
9903
+ function qS(e, t) {
9838
9904
  let [n, o] = e;
9839
9905
  switch (t.mirror && (n = -n), t.rot) {
9840
9906
  case 0:
@@ -9851,21 +9917,21 @@ function FS(e, t) {
9851
9917
  }
9852
9918
  return [n + t.at[0], o + t.at[1]];
9853
9919
  }
9854
- function HS(e) {
9920
+ function GS(e) {
9855
9921
  const t = e.trim().split(/\s+/).map(Number);
9856
9922
  return t.length !== 4 || t.some((n) => Number.isNaN(n)) ? null : { x: t[0], y: t[1], w: t[2], h: t[3] };
9857
9923
  }
9858
9924
  function ze(e) {
9859
9925
  return e.replace(/(["\\])/g, "\\$1");
9860
9926
  }
9861
- const WS = 4;
9927
+ const XS = 4;
9862
9928
  let ie = null;
9863
- const qS = {
9929
+ const YS = {
9864
9930
  id: "pan",
9865
9931
  cursor: "grab",
9866
9932
  onPointerDown(e, t) {
9867
9933
  if (e.button !== 0) return;
9868
- const n = t.viewport.getViewport(), o = mt(e.target);
9934
+ const n = t.viewport.getViewport(), o = ut(e.target);
9869
9935
  let r = null;
9870
9936
  if (o) {
9871
9937
  const i = b.getState();
@@ -9900,7 +9966,7 @@ const qS = {
9900
9966
  onPointerMove(e, t) {
9901
9967
  if (!ie || e.pointerId !== ie.pointerId) return;
9902
9968
  const n = e.clientX - ie.startX, o = e.clientY - ie.startY;
9903
- if (!ie.moved && Math.hypot(n, o) > WS) {
9969
+ if (!ie.moved && Math.hypot(n, o) > XS) {
9904
9970
  ie.moved = !0;
9905
9971
  try {
9906
9972
  t.hostEl.setPointerCapture(e.pointerId);
@@ -9912,7 +9978,7 @@ const qS = {
9912
9978
  const r = t.viewport.screenToSvg(e.clientX, e.clientY), i = ue(r[0] - ie.elementDrag.startSvg[0]), s = ue(r[1] - ie.elementDrag.startSvg[1]);
9913
9979
  for (const [a, l] of ie.elementDrag.originals) {
9914
9980
  const c = t.hostEl.querySelector(
9915
- `[data-element-id="${St(a)}"]`
9981
+ `[data-element-id="${$t(a)}"]`
9916
9982
  );
9917
9983
  if (!c) continue;
9918
9984
  const d = {
@@ -9923,7 +9989,7 @@ const qS = {
9923
9989
  }
9924
9990
  for (const a of ie.elementDrag.busOriginals.keys()) {
9925
9991
  const l = t.hostEl.querySelector(
9926
- `[data-element-id="${St(a)}"]`
9992
+ `[data-element-id="${$t(a)}"]`
9927
9993
  );
9928
9994
  l && l.setAttribute("transform", `translate(${i} ${s})`);
9929
9995
  }
@@ -9946,11 +10012,11 @@ const qS = {
9946
10012
  }
9947
10013
  for (const i of ie.elementDrag.busOriginals.keys()) {
9948
10014
  const s = t.hostEl.querySelector(
9949
- `[data-element-id="${St(i)}"]`
10015
+ `[data-element-id="${$t(i)}"]`
9950
10016
  );
9951
10017
  s && s.removeAttribute("transform");
9952
10018
  }
9953
- } else ie.moved || GS(ie.startTarget);
10019
+ } else ie.moved || KS(ie.startTarget);
9954
10020
  ie = null;
9955
10021
  }
9956
10022
  },
@@ -9958,13 +10024,13 @@ const qS = {
9958
10024
  if (ie != null && ie.elementDrag) {
9959
10025
  for (const [n, o] of ie.elementDrag.originals) {
9960
10026
  const r = t.hostEl.querySelector(
9961
- `[data-element-id="${St(n)}"]`
10027
+ `[data-element-id="${$t(n)}"]`
9962
10028
  );
9963
10029
  r && r.setAttribute("transform", Ve(o));
9964
10030
  }
9965
10031
  for (const n of ie.elementDrag.busOriginals.keys()) {
9966
10032
  const o = t.hostEl.querySelector(
9967
- `[data-element-id="${St(n)}"]`
10033
+ `[data-element-id="${$t(n)}"]`
9968
10034
  );
9969
10035
  o && o.removeAttribute("transform");
9970
10036
  }
@@ -9975,34 +10041,34 @@ const qS = {
9975
10041
  ie = null;
9976
10042
  }
9977
10043
  };
9978
- function GS(e) {
10044
+ function KS(e) {
9979
10045
  if (!e) return;
9980
- const t = b.getState(), n = en(e);
10046
+ const t = b.getState(), n = tn(e);
9981
10047
  if (n) {
9982
10048
  t.setSelectedAnnotation(n);
9983
10049
  return;
9984
10050
  }
9985
- const o = mt(e);
10051
+ const o = ut(e);
9986
10052
  if (o) {
9987
10053
  t.setSelection([o]);
9988
10054
  return;
9989
10055
  }
9990
- const r = dn(e);
10056
+ const r = hn(e);
9991
10057
  if (r) {
9992
10058
  t.setSelectedNode(r);
9993
10059
  return;
9994
10060
  }
9995
10061
  t.clearSelection();
9996
10062
  }
9997
- function St(e) {
10063
+ function $t(e) {
9998
10064
  return e.replace(/(["\\])/g, "\\$1");
9999
10065
  }
10000
- const Et = {
10066
+ const Nt = {
10001
10067
  tight: 1024,
10002
10068
  compact: 720,
10003
10069
  dense: 520,
10004
10070
  mini: 380
10005
- }, ar = {
10071
+ }, dr = {
10006
10072
  full: 0,
10007
10073
  tight: 1,
10008
10074
  compact: 2,
@@ -10010,18 +10076,18 @@ const Et = {
10010
10076
  mini: 4
10011
10077
  };
10012
10078
  function Le(e, t) {
10013
- return ar[e] >= ar[t];
10079
+ return dr[e] >= dr[t];
10014
10080
  }
10015
- function XS(e) {
10016
- return e >= Et.tight ? "full" : e >= Et.compact ? "tight" : e >= Et.dense ? "compact" : e >= Et.mini ? "dense" : "mini";
10081
+ function VS(e) {
10082
+ return e >= Nt.tight ? "full" : e >= Nt.compact ? "tight" : e >= Nt.dense ? "compact" : e >= Nt.mini ? "dense" : "mini";
10017
10083
  }
10018
- const gx = Fr("full");
10084
+ const yx = Fr("full");
10019
10085
  function Je() {
10020
- return Hr(gx);
10086
+ return Hr(yx);
10021
10087
  }
10022
- function KS(e) {
10088
+ function US(e) {
10023
10089
  const [t, n] = ye(null);
10024
- return nn(() => {
10090
+ return sn(() => {
10025
10091
  const o = e.current;
10026
10092
  if (!o) return;
10027
10093
  const r = () => {
@@ -10033,78 +10099,20 @@ function KS(e) {
10033
10099
  return i.observe(o), () => i.disconnect();
10034
10100
  }, [e]), t;
10035
10101
  }
10036
- function yx() {
10102
+ function bx() {
10037
10103
  if (typeof window > "u") return !1;
10038
10104
  try {
10039
10105
  if (!window.matchMedia("(pointer: coarse)").matches) return !1;
10040
10106
  } catch {
10041
10107
  return !1;
10042
10108
  }
10043
- return window.innerWidth < Et.dense;
10109
+ return window.innerWidth < Nt.dense;
10044
10110
  }
10045
- function un() {
10046
- yx() && b.getState().setActiveTool("pan");
10111
+ function pn() {
10112
+ bx() && b.getState().setActiveTool("pan");
10047
10113
  }
10048
- function YS() {
10049
- yx() && b.getState().setPlaceKind(null);
10050
- }
10051
- const lr = 10, Ht = (e) => Math.round(e / lr) * lr, VS = 16;
10052
- function bx(e, t) {
10053
- let n = e[0], o = 1 / 0;
10054
- for (let r = 0; r < e.length - 1; r++) {
10055
- const [i, s] = e[r], [a, l] = e[r + 1], c = a - i, d = l - s, u = c * c + d * d, f = u === 0 ? 0 : Math.max(0, Math.min(1, ((t[0] - i) * c + (t[1] - s) * d) / u)), p = i + f * c, h = s + f * d, g = (p - t[0]) ** 2 + (h - t[1]) ** 2;
10056
- g < o && (o = g, n = [p, h]);
10057
- }
10058
- return n;
10059
- }
10060
- function cr(e, t) {
10061
- return typeof document < "u" ? document.elementFromPoint(e, t) : null;
10062
- }
10063
- function US(e, t) {
10064
- const n = b.getState().internal.wireRenders;
10065
- let o = null, r = t;
10066
- for (const i of n.values()) {
10067
- if (i.path.length < 2) continue;
10068
- const s = bx(i.path, e), a = Math.hypot(s[0] - e[0], s[1] - e[1]);
10069
- a <= r && (r = a, o = { wireId: i.wireId, at: s });
10070
- }
10071
- return o;
10072
- }
10073
- function En(e, t, n) {
10074
- const o = e ? dt(e) : null;
10075
- if (o) {
10076
- const a = px(o, t);
10077
- if (a) return { spec: { end: o }, world: a.world, ref: o, isBus: a.isBus, create: !1 };
10078
- }
10079
- let r = e ? Wn(e) : null, i = null;
10080
- if (r) {
10081
- const a = b.getState().internal.wireRenders.get(r);
10082
- i = a ? bx(a.path, t) : t;
10083
- } else {
10084
- const a = US(t, n);
10085
- a && (r = a.wireId, i = a.at);
10086
- }
10087
- if (r && i) {
10088
- const a = [Ht(i[0]), Ht(i[1])];
10089
- return { spec: { onWire: r, at: a }, world: a, ref: null, isBus: !1, create: !0 };
10090
- }
10091
- const s = [Ht(t[0]), Ht(t[1])];
10092
- return { spec: { junctionAt: s }, world: s, ref: null, isBus: !1, create: !0 };
10093
- }
10094
- function Mn(e, t, n) {
10095
- const o = e.viewport.screenToSvg(t, n), r = e.viewport.screenToSvg(t + VS, n);
10096
- return Math.hypot(r[0] - o[0], r[1] - o[1]);
10097
- }
10098
- function JS(e) {
10099
- return {
10100
- ref: e.ref,
10101
- world: e.world,
10102
- isBus: e.isBus,
10103
- ...e.create ? { create: "junction" } : {}
10104
- };
10105
- }
10106
- function dr(e, t) {
10107
- return e.ref && t.ref ? e.ref === t.ref : !e.ref && !t.ref ? e.world[0] === t.world[0] && e.world[1] === t.world[1] : !1;
10114
+ function JS() {
10115
+ bx() && b.getState().setPlaceKind(null);
10108
10116
  }
10109
10117
  const ZS = {
10110
10118
  id: "wire",
@@ -10115,13 +10123,13 @@ const ZS = {
10115
10123
  onDeactivate(e) {
10116
10124
  e.hostEl.classList.remove("tool-wire");
10117
10125
  const t = b.getState();
10118
- t.setWireFromTerminal(null), t.setWireDragFrom(null), t.setCursorSvg(null), He(null);
10126
+ t.setWireFromTerminal(null), t.setWireDragFrom(null), t.setCursorSvg(null), Ke(null);
10119
10127
  },
10120
10128
  onPointerDown(e, t) {
10121
10129
  var s, a;
10122
10130
  if (e.button !== 0) return;
10123
10131
  e.preventDefault(), e.stopPropagation(), e.target instanceof Element && ((a = (s = e.target).hasPointerCapture) != null && a.call(s, e.pointerId)) && e.target.releasePointerCapture(e.pointerId);
10124
- const n = t.viewport.screenToSvg(e.clientX, e.clientY), o = Mn(t, e.clientX, e.clientY), r = En(e.target instanceof Element ? e.target : null, n, o), i = b.getState();
10132
+ const n = t.viewport.screenToSvg(e.clientX, e.clientY), o = At(t, e.clientX, e.clientY), r = Tt(e.target instanceof Element ? e.target : null, n, o), i = b.getState();
10125
10133
  i.setWireDragFrom({ spec: r.spec, world: r.world, ref: r.ref }), i.setWireFromTerminal(r.ref), i.setCursorSvg(n);
10126
10134
  },
10127
10135
  onPointerMove(e, t) {
@@ -10129,33 +10137,33 @@ const ZS = {
10129
10137
  if (!o) return;
10130
10138
  const r = t.viewport.screenToSvg(e.clientX, e.clientY);
10131
10139
  n.setCursorSvg(r);
10132
- const i = cr(e.clientX, e.clientY), s = En(i, r, Mn(t, e.clientX, e.clientY)), a = {
10140
+ const i = nn(e.clientX, e.clientY), s = Tt(i, r, At(t, e.clientX, e.clientY)), a = {
10133
10141
  spec: o.spec,
10134
10142
  world: o.world,
10135
10143
  ref: o.ref,
10136
10144
  create: !o.ref
10137
10145
  };
10138
- He(dr(a, s) ? null : JS(s));
10146
+ Ke(on(a, s) ? null : gx(s));
10139
10147
  },
10140
10148
  onPointerUp(e, t) {
10141
10149
  const n = b.getState(), o = n.wireDragFrom;
10142
- if (n.setWireFromTerminal(null), n.setWireDragFrom(null), n.setCursorSvg(null), He(null), !o) return;
10143
- const r = t.viewport.screenToSvg(e.clientX, e.clientY), i = cr(e.clientX, e.clientY) ?? (e.target instanceof Element ? e.target : null), s = En(i, r, Mn(t, e.clientX, e.clientY)), a = {
10150
+ if (n.setWireFromTerminal(null), n.setWireDragFrom(null), n.setCursorSvg(null), Ke(null), !o) return;
10151
+ const r = t.viewport.screenToSvg(e.clientX, e.clientY), i = nn(e.clientX, e.clientY) ?? (e.target instanceof Element ? e.target : null), s = Tt(i, r, At(t, e.clientX, e.clientY)), a = {
10144
10152
  spec: o.spec,
10145
10153
  world: o.world,
10146
10154
  ref: o.ref,
10147
10155
  create: !o.ref
10148
10156
  };
10149
- dr(a, s) || (n.connectWire(o.spec, s.spec), un());
10157
+ on(a, s) || (n.connectWire(o.spec, s.spec), pn());
10150
10158
  },
10151
10159
  onPointerLeave() {
10152
10160
  const e = b.getState();
10153
- e.setWireFromTerminal(null), e.setWireDragFrom(null), e.setCursorSvg(null), He(null);
10161
+ e.setWireFromTerminal(null), e.setWireDragFrom(null), e.setCursorSvg(null), Ke(null);
10154
10162
  }
10155
10163
  }, ur = 10;
10156
- let Nt = !1;
10164
+ let St = !1;
10157
10165
  function mr() {
10158
- setTimeout(() => YS(), 0);
10166
+ setTimeout(() => JS(), 0);
10159
10167
  }
10160
10168
  const QS = {
10161
10169
  id: "place",
@@ -10166,7 +10174,7 @@ const QS = {
10166
10174
  onDeactivate(e) {
10167
10175
  e.hostEl.classList.remove("tool-place");
10168
10176
  const t = b.getState();
10169
- t.setPlaceFromTerminal(null), t.setCursorSvg(null), Nt = !1;
10177
+ t.setPlaceFromTerminal(null), t.setCursorSvg(null), St = !1;
10170
10178
  },
10171
10179
  onPointerDown(e, t) {
10172
10180
  var i, s;
@@ -10174,7 +10182,7 @@ const QS = {
10174
10182
  const { placeKind: n } = b.getState();
10175
10183
  if (!n) return;
10176
10184
  e.preventDefault();
10177
- const o = dt(e.target);
10185
+ const o = fn(e.target);
10178
10186
  if (o) {
10179
10187
  e.stopPropagation(), e.target instanceof Element && ((s = (i = e.target).hasPointerCapture) != null && s.call(i, e.pointerId)) && e.target.releasePointerCapture(e.pointerId);
10180
10188
  const a = b.getState();
@@ -10182,7 +10190,7 @@ const QS = {
10182
10190
  return;
10183
10191
  }
10184
10192
  const r = t.viewport.screenToSvg(e.clientX, e.clientY);
10185
- ax(n, r), Nt = !0;
10193
+ ax(n, r), St = !0;
10186
10194
  },
10187
10195
  onPointerMove(e, t) {
10188
10196
  const n = t.viewport.screenToSvg(e.clientX, e.clientY);
@@ -10198,7 +10206,7 @@ const QS = {
10198
10206
  V$(r, o, i), mr();
10199
10207
  return;
10200
10208
  }
10201
- Nt && (Nt = !1, mr());
10209
+ St && (St = !1, mr());
10202
10210
  },
10203
10211
  onPointerLeave() {
10204
10212
  const e = b.getState();
@@ -10206,7 +10214,7 @@ const QS = {
10206
10214
  },
10207
10215
  onPointerCancel() {
10208
10216
  const e = b.getState();
10209
- e.setPlaceFromTerminal(null), e.setCursorSvg(null), Nt = !1;
10217
+ e.setPlaceFromTerminal(null), e.setCursorSvg(null), St = !1;
10210
10218
  }
10211
10219
  };
10212
10220
  function fr(e) {
@@ -10241,7 +10249,7 @@ const e4 = {
10241
10249
  if (d = Math.abs(a), d < pr) return;
10242
10250
  c = 90, u = [n[0], (n[1] + i) / 2];
10243
10251
  }
10244
- b.getState().addBus(u, d, c), un();
10252
+ b.getState().addBus(u, d, c), pn();
10245
10253
  },
10246
10254
  onPointerLeave() {
10247
10255
  const e = b.getState();
@@ -10262,25 +10270,25 @@ const e4 = {
10262
10270
  if (e.button !== 0) return;
10263
10271
  e.preventDefault(), e.stopPropagation();
10264
10272
  const n = t.viewport.screenToSvg(e.clientX, e.clientY);
10265
- b.getState().addJunction([yr(n[0]), yr(n[1])]), un();
10273
+ b.getState().addJunction([yr(n[0]), yr(n[1])]), pn();
10266
10274
  }
10267
10275
  }, n4 = {
10268
10276
  id: "text",
10269
10277
  cursor: "text",
10270
10278
  onPointerDown(e, t) {
10271
10279
  if (e.button !== 0) return;
10272
- const n = b.getState(), o = en(e.target);
10280
+ const n = b.getState(), o = tn(e.target);
10273
10281
  if (o) {
10274
10282
  e.preventDefault(), e.stopPropagation(), n.setActiveTool("select"), n.setSelectedAnnotation(o);
10275
10283
  return;
10276
10284
  }
10277
10285
  e.preventDefault();
10278
10286
  const r = t.viewport.screenToSvg(e.clientX, e.clientY), i = n.addAnnotation([r[0], r[1]], "");
10279
- n.setEditingAnnotation(i), un();
10287
+ n.setEditingAnnotation(i), pn();
10280
10288
  }
10281
10289
  }, o4 = {
10282
- select: DS,
10283
- pan: qS,
10290
+ select: HS,
10291
+ pan: YS,
10284
10292
  wire: ZS,
10285
10293
  place: QS,
10286
10294
  busbar: e4,
@@ -10320,23 +10328,23 @@ function r4(e, t) {
10320
10328
  };
10321
10329
  }, [n, e, t]);
10322
10330
  }
10323
- let Xn = 1;
10324
- const Kn = /* @__PURE__ */ new Set();
10331
+ let Kn = 1;
10332
+ const Vn = /* @__PURE__ */ new Set();
10325
10333
  function i4(e) {
10326
- if (e !== Xn) {
10327
- Xn = e;
10328
- for (const t of Kn) t(e);
10334
+ if (e !== Kn) {
10335
+ Kn = e;
10336
+ for (const t of Vn) t(e);
10329
10337
  }
10330
10338
  }
10331
10339
  function s4() {
10332
- return Xn;
10340
+ return Kn;
10333
10341
  }
10334
10342
  function a4(e) {
10335
- return Kn.add(e), () => {
10336
- Kn.delete(e);
10343
+ return Vn.add(e), () => {
10344
+ Vn.delete(e);
10337
10345
  };
10338
10346
  }
10339
- const Tn = 0.1, An = 8, l4 = 1.0015, c4 = 1.02;
10347
+ const Cn = 0.1, In = 8, l4 = 1.0015, c4 = 1.02;
10340
10348
  function d4(e, t, n = { tx: 0, ty: 0, scale: 1 }) {
10341
10349
  const o = he({ ...n }), r = he(/* @__PURE__ */ new Set()), i = () => {
10342
10350
  const s = t.current, a = e.current;
@@ -10389,7 +10397,7 @@ function d4(e, t, n = { tx: 0, ty: 0, scale: 1 }) {
10389
10397
  R.stopPropagation();
10390
10398
  const W = [...h.values()];
10391
10399
  if (W.length < 2) return;
10392
- const xe = W[1].x - W[0].x, me = W[1].y - W[0].y, be = Math.hypot(xe, me) || 1, ne = s.getBoundingClientRect(), re = (W[0].x + W[1].x) / 2 - ne.left, we = (W[0].y + W[1].y) / 2 - ne.top, ve = be / g.startDist, Ne = Cn(g.startScale * ve, Tn, An), Ae = Ne / g.startScale;
10400
+ const xe = W[1].x - W[0].x, me = W[1].y - W[0].y, be = Math.hypot(xe, me) || 1, ne = s.getBoundingClientRect(), re = (W[0].x + W[1].x) / 2 - ne.left, we = (W[0].y + W[1].y) / 2 - ne.top, ve = be / g.startDist, Ne = Pn(g.startScale * ve, Cn, In), Ae = Ne / g.startScale;
10393
10401
  o.current.tx = g.startMidX - (g.startMidX - g.startTx) * Ae + (re - g.startMidX), o.current.ty = g.startMidY - (g.startMidY - g.startTy) * Ae + (we - g.startMidY), o.current.scale = Ne, i();
10394
10402
  }, S = (R) => {
10395
10403
  var W;
@@ -10405,7 +10413,7 @@ function d4(e, t, n = { tx: 0, ty: 0, scale: 1 }) {
10405
10413
  R.preventDefault();
10406
10414
  const W = s.getBoundingClientRect(), xe = R.clientX - W.left, me = R.clientY - W.top, be = R.ctrlKey || R.metaKey;
10407
10415
  if (R.deltaX === 0 || be) {
10408
- const we = Math.pow(be ? c4 : l4, -R.deltaY), ve = Cn(o.current.scale * we, Tn, An), Ne = ve / o.current.scale;
10416
+ const we = Math.pow(be ? c4 : l4, -R.deltaY), ve = Pn(o.current.scale * we, Cn, In), Ne = ve / o.current.scale;
10409
10417
  o.current.tx = xe - (xe - o.current.tx) * Ne, o.current.ty = me - (me - o.current.ty) * Ne, o.current.scale = ve;
10410
10418
  } else
10411
10419
  o.current.tx -= R.deltaX, o.current.ty -= R.deltaY;
@@ -10440,7 +10448,7 @@ function d4(e, t, n = { tx: 0, ty: 0, scale: 1 }) {
10440
10448
  return { ...o.current };
10441
10449
  },
10442
10450
  setViewport(s) {
10443
- s.tx !== void 0 && (o.current.tx = s.tx), s.ty !== void 0 && (o.current.ty = s.ty), s.scale !== void 0 && (o.current.scale = Cn(s.scale, Tn, An)), i();
10451
+ s.tx !== void 0 && (o.current.tx = s.tx), s.ty !== void 0 && (o.current.ty = s.ty), s.scale !== void 0 && (o.current.scale = Pn(s.scale, Cn, In)), i();
10444
10452
  },
10445
10453
  subscribe(s) {
10446
10454
  return r.current.add(s), () => {
@@ -10449,18 +10457,18 @@ function d4(e, t, n = { tx: 0, ty: 0, scale: 1 }) {
10449
10457
  }
10450
10458
  };
10451
10459
  }
10452
- function Cn(e, t, n) {
10460
+ function Pn(e, t, n) {
10453
10461
  return e < t ? t : e > n ? n : e;
10454
10462
  }
10455
- const wx = typeof navigator < "u" && /Mac|iP(ad|hone|od)/.test(navigator.platform), st = wx ? "⌘" : "Ctrl+", u4 = wx ? "⇧" : "Shift+", In = [10, 20, 50, 100, 200, 500, 1e3, 2e3, 5e3, 1e4], m4 = 18;
10463
+ const wx = typeof navigator < "u" && /Mac|iP(ad|hone|od)/.test(navigator.platform), st = wx ? "⌘" : "Ctrl+", u4 = wx ? "⇧" : "Shift+", On = [10, 20, 50, 100, 200, 500, 1e3, 2e3, 5e3, 1e4], m4 = 18;
10456
10464
  function f4(e) {
10457
- for (const t of In)
10465
+ for (const t of On)
10458
10466
  if (t * e >= m4) return t;
10459
- return In[In.length - 1];
10467
+ return On[On.length - 1];
10460
10468
  }
10461
10469
  function h4() {
10462
10470
  const e = ae(), t = he(null), n = he(null), o = he(null), r = d4(t, n);
10463
- r4(t, r), zS(t), se(() => (er(r), () => er(null)), [r]), se(() => {
10471
+ r4(t, r), zS(t), se(() => (nr(r), () => nr(null)), [r]), se(() => {
10464
10472
  const d = (u) => {
10465
10473
  const f = o.current;
10466
10474
  if (!f) return;
@@ -10476,25 +10484,25 @@ function h4() {
10476
10484
  hx();
10477
10485
  return;
10478
10486
  }
10479
- const g = mt(f);
10487
+ const g = ut(f);
10480
10488
  if (g)
10481
10489
  p.selection.includes(g) || p.setSelection([g]);
10482
10490
  else {
10483
- const D = dn(f);
10491
+ const D = hn(f);
10484
10492
  D && p.selectedNode !== D && p.setSelectedNode(D);
10485
10493
  }
10486
10494
  const w = b.getState(), $ = w.selection.length > 0, k = w.selectedNode != null, x = !!w.clipboard, S = w.diagram.elements.length > 0, I = [
10487
10495
  {
10488
10496
  label: e("menu.undo"),
10489
10497
  shortcut: `${st}Z`,
10490
- icon: Zn,
10498
+ icon: eo,
10491
10499
  onSelect: () => b.getState().undo(),
10492
10500
  disabled: w.past.length === 0
10493
10501
  },
10494
10502
  {
10495
10503
  label: e("menu.redo"),
10496
10504
  shortcut: `${st}${u4}Z`,
10497
- icon: Jn,
10505
+ icon: Qn,
10498
10506
  onSelect: () => b.getState().redo(),
10499
10507
  disabled: w.future.length === 0
10500
10508
  },
@@ -10509,7 +10517,7 @@ function h4() {
10509
10517
  {
10510
10518
  label: e("menu.copy"),
10511
10519
  shortcut: `${st}C`,
10512
- icon: Kr,
10520
+ icon: Yr,
10513
10521
  onSelect: () => b.getState().copySelection(),
10514
10522
  disabled: !$
10515
10523
  },
@@ -10531,7 +10539,7 @@ function h4() {
10531
10539
  {
10532
10540
  label: e("menu.mirror"),
10533
10541
  shortcut: "M",
10534
- icon: Yr,
10542
+ icon: Kr,
10535
10543
  onSelect: () => b.getState().mirrorSelection(),
10536
10544
  disabled: !$
10537
10545
  },
@@ -10698,7 +10706,7 @@ function k4() {
10698
10706
  return a.current = window.setTimeout(() => o(!0), x4), () => window.clearTimeout(a.current);
10699
10707
  }, [e]);
10700
10708
  const c = b((h) => e ? h.diagram.elements.find((g) => g.id === e) ?? null : null);
10701
- if (nn(() => {
10709
+ if (sn(() => {
10702
10710
  if (!n || !e) return;
10703
10711
  let h = 0, g = -1, w = -1;
10704
10712
  const $ = () => {
@@ -10748,8 +10756,8 @@ function $4({
10748
10756
  width: e,
10749
10757
  children: t
10750
10758
  }) {
10751
- const n = e == null ? "full" : XS(e);
10752
- return /* @__PURE__ */ m(gx.Provider, { value: n, children: t });
10759
+ const n = e == null ? "full" : VS(e);
10760
+ return /* @__PURE__ */ m(yx.Provider, { value: n, children: t });
10753
10761
  }
10754
10762
  function xr(e, t) {
10755
10763
  if (typeof e == "function")
@@ -10772,7 +10780,7 @@ function S4(...e) {
10772
10780
  };
10773
10781
  };
10774
10782
  }
10775
- var N4 = Symbol.for("react.lazy"), tn = Se[" use ".trim().toString()];
10783
+ var N4 = Symbol.for("react.lazy"), rn = Se[" use ".trim().toString()];
10776
10784
  function E4(e) {
10777
10785
  return typeof e == "object" && e !== null && "then" in e;
10778
10786
  }
@@ -10783,7 +10791,7 @@ function kx(e) {
10783
10791
  function M4(e) {
10784
10792
  const t = /* @__PURE__ */ A4(e), n = Se.forwardRef((o, r) => {
10785
10793
  let { children: i, ...s } = o;
10786
- kx(i) && typeof tn == "function" && (i = tn(i._payload));
10794
+ kx(i) && typeof rn == "function" && (i = rn(i._payload));
10787
10795
  const a = Se.Children.toArray(i), l = a.find(I4);
10788
10796
  if (l) {
10789
10797
  const c = l.props.children, d = a.map((u) => u === l ? Se.Children.count(c) > 1 ? Se.Children.only(null) : Se.isValidElement(c) ? c.props.children : null : u);
@@ -10798,7 +10806,7 @@ var T4 = /* @__PURE__ */ M4("Slot");
10798
10806
  function A4(e) {
10799
10807
  const t = Se.forwardRef((n, o) => {
10800
10808
  let { children: r, ...i } = n;
10801
- if (kx(r) && typeof tn == "function" && (r = tn(r._payload)), Se.isValidElement(r)) {
10809
+ if (kx(r) && typeof rn == "function" && (r = rn(r._payload)), Se.isValidElement(r)) {
10802
10810
  const s = O4(r), a = P4(i, r.props);
10803
10811
  return r.type !== Se.Fragment && (a.ref = o ? S4(o, s) : s), Se.cloneElement(r, a);
10804
10812
  }
@@ -10902,7 +10910,7 @@ function Be({
10902
10910
  }, p = () => {
10903
10911
  window.clearTimeout(u.current), a(!1);
10904
10912
  };
10905
- nn(() => {
10913
+ sn(() => {
10906
10914
  if (!s || !r.current || !i.current) return;
10907
10915
  const $ = r.current.getBoundingClientRect(), k = i.current.getBoundingClientRect(), x = 8;
10908
10916
  let S = "top", I = $.top - k.height - x;
@@ -11088,7 +11096,7 @@ function D4() {
11088
11096
  className: "size-7",
11089
11097
  onClick: () => s(),
11090
11098
  "aria-label": e("ctx.mirrorTitle"),
11091
- children: /* @__PURE__ */ m(Yr, {})
11099
+ children: /* @__PURE__ */ m(Kr, {})
11092
11100
  }
11093
11101
  )
11094
11102
  }
@@ -11122,7 +11130,7 @@ function D4() {
11122
11130
  }
11123
11131
  );
11124
11132
  }
11125
- function no({
11133
+ function ro({
11126
11134
  open: e,
11127
11135
  onOpenChange: t,
11128
11136
  trigger: n,
@@ -11170,7 +11178,7 @@ function $r(e) {
11170
11178
  } catch {
11171
11179
  }
11172
11180
  }
11173
- const Ct = on((e, t) => ({
11181
+ const It = an((e, t) => ({
11174
11182
  ...R4(),
11175
11183
  setOutlineOpen: (n) => {
11176
11184
  e({ outlineOpen: n }), $r(t());
@@ -11178,7 +11186,7 @@ const Ct = on((e, t) => ({
11178
11186
  toggleOutline: () => {
11179
11187
  e((n) => ({ outlineOpen: !n.outlineOpen })), $r(t());
11180
11188
  }
11181
- })), Xt = [0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4, 6, 8], $x = 0.1, Sx = 8, Nx = "ole-grid";
11189
+ })), Yt = [0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4, 6, 8], $x = 0.1, Sx = 8, Nx = "ole-grid";
11182
11190
  function F4() {
11183
11191
  try {
11184
11192
  const e = window.localStorage.getItem(Nx);
@@ -11199,7 +11207,7 @@ function W4(e, t, n) {
11199
11207
  function Ex() {
11200
11208
  return document.querySelector(".ole-canvas-root");
11201
11209
  }
11202
- function oo(e) {
11210
+ function io(e) {
11203
11211
  const t = tt(), n = Ex();
11204
11212
  if (!t || !n) return;
11205
11213
  const o = n.getBoundingClientRect(), r = o.width / 2, i = o.height / 2, s = t.getViewport(), a = W4(e, $x, Sx), l = a / s.scale;
@@ -11212,27 +11220,27 @@ function oo(e) {
11212
11220
  function q4() {
11213
11221
  const e = tt();
11214
11222
  if (!e) return;
11215
- const t = e.getViewport().scale, n = Xt.find((o) => o > t + 1e-6) ?? Sx;
11216
- oo(n);
11223
+ const t = e.getViewport().scale, n = Yt.find((o) => o > t + 1e-6) ?? Sx;
11224
+ io(n);
11217
11225
  }
11218
11226
  function G4() {
11219
11227
  const e = tt();
11220
11228
  if (!e) return;
11221
11229
  const t = e.getViewport().scale;
11222
11230
  let n = $x;
11223
- for (let o = Xt.length - 1; o >= 0; o--)
11224
- if (Xt[o] < t - 1e-6) {
11225
- n = Xt[o];
11231
+ for (let o = Yt.length - 1; o >= 0; o--)
11232
+ if (Yt[o] < t - 1e-6) {
11233
+ n = Yt[o];
11226
11234
  break;
11227
11235
  }
11228
- oo(n);
11236
+ io(n);
11229
11237
  }
11230
11238
  const X4 = {
11231
11239
  off: "id",
11232
11240
  id: "all",
11233
11241
  all: "off"
11234
11242
  };
11235
- function K4() {
11243
+ function Y4() {
11236
11244
  var o;
11237
11245
  const e = b.getState(), t = ((o = e.diagram.meta) == null ? void 0 : o.labelMode) ?? "all", n = X4[t];
11238
11246
  e.dispatch((r) => {
@@ -11270,7 +11278,7 @@ function Tx() {
11270
11278
  size: "icon",
11271
11279
  onClick: G4,
11272
11280
  "aria-label": e("view.zoomOut"),
11273
- children: /* @__PURE__ */ m(Un, {})
11281
+ children: /* @__PURE__ */ m(Zn, {})
11274
11282
  }
11275
11283
  )
11276
11284
  }
@@ -11311,7 +11319,7 @@ function Cx() {
11311
11319
  "button",
11312
11320
  {
11313
11321
  type: "button",
11314
- onClick: () => oo(1),
11322
+ onClick: () => io(1),
11315
11323
  className: "min-w-12 rounded-md px-2 py-1 text-center text-xs tabular-nums text-muted-foreground hover:bg-accent hover:text-accent-foreground",
11316
11324
  "aria-label": e("view.reset"),
11317
11325
  children: [
@@ -11394,7 +11402,7 @@ function Ox() {
11394
11402
  {
11395
11403
  variant: "ghost",
11396
11404
  size: "icon",
11397
- onClick: K4,
11405
+ onClick: Y4,
11398
11406
  "aria-label": e("view.label"),
11399
11407
  "aria-pressed": t !== "off",
11400
11408
  className: Te(t === "off" && "text-muted-foreground/60"),
@@ -11404,7 +11412,7 @@ function Ox() {
11404
11412
  }
11405
11413
  );
11406
11414
  }
11407
- function Y4({ stacked: e } = {}) {
11415
+ function K4({ stacked: e } = {}) {
11408
11416
  const t = ae(), [n, o] = ye(!1), [r, i] = Mx(), s = /* @__PURE__ */ j("div", { className: "space-y-0.5", children: [
11409
11417
  /* @__PURE__ */ m("div", { className: "font-medium", children: t("view.menu") }),
11410
11418
  /* @__PURE__ */ m("div", { className: "text-muted-foreground", children: t("view.menuHint") })
@@ -11420,7 +11428,7 @@ function Y4({ stacked: e } = {}) {
11420
11428
  n ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
11421
11429
  ),
11422
11430
  children: [
11423
- /* @__PURE__ */ m(jn, { className: "size-4" }),
11431
+ /* @__PURE__ */ m(zn, { className: "size-4" }),
11424
11432
  /* @__PURE__ */ m("span", { className: "max-w-full truncate", children: t("view.menu") })
11425
11433
  ]
11426
11434
  }
@@ -11432,11 +11440,11 @@ function Y4({ stacked: e } = {}) {
11432
11440
  onClick: () => o((l) => !l),
11433
11441
  "aria-label": t("view.menu"),
11434
11442
  "aria-pressed": n,
11435
- children: /* @__PURE__ */ m(jn, {})
11443
+ children: /* @__PURE__ */ m(zn, {})
11436
11444
  }
11437
11445
  ) });
11438
11446
  return /* @__PURE__ */ m(
11439
- no,
11447
+ ro,
11440
11448
  {
11441
11449
  open: n,
11442
11450
  onOpenChange: o,
@@ -11508,7 +11516,7 @@ const Sr = [
11508
11516
  labelKey: "tool.bus",
11509
11517
  hotkey: "B",
11510
11518
  descriptionKey: "tool.busHint",
11511
- icon: Un,
11519
+ icon: Zn,
11512
11520
  switchTo: "busbar"
11513
11521
  },
11514
11522
  {
@@ -11606,7 +11614,7 @@ function Z4() {
11606
11614
  const g = h.icon, w = p(h), $ = h.id === "place" && w && n == null ? e("tool.placeNoKindTooltip") : e(h.descriptionKey);
11607
11615
  return /* @__PURE__ */ j(rv, { children: [
11608
11616
  /* @__PURE__ */ m(
11609
- ut,
11617
+ dt,
11610
11618
  {
11611
11619
  icon: g,
11612
11620
  label: e(h.labelKey),
@@ -11628,9 +11636,9 @@ function Z4() {
11628
11636
  !u && /* @__PURE__ */ m("div", { "aria-hidden": !0, className: "mx-1 h-5 w-px bg-border" }),
11629
11637
  u ? /* @__PURE__ */ m(t6, { stacked: !0 }) : /* @__PURE__ */ j(et, { children: [
11630
11638
  /* @__PURE__ */ m(
11631
- ut,
11639
+ dt,
11632
11640
  {
11633
- icon: Zn,
11641
+ icon: eo,
11634
11642
  label: e("tool.undo"),
11635
11643
  hotkey: "⌘Z",
11636
11644
  description: e("tool.undoHint"),
@@ -11640,9 +11648,9 @@ function Z4() {
11640
11648
  }
11641
11649
  ),
11642
11650
  /* @__PURE__ */ m(
11643
- ut,
11651
+ dt,
11644
11652
  {
11645
- icon: Jn,
11653
+ icon: Qn,
11646
11654
  label: e("tool.redo"),
11647
11655
  hotkey: "⌘⇧Z",
11648
11656
  description: e("tool.redoHint"),
@@ -11654,7 +11662,7 @@ function Z4() {
11654
11662
  /* @__PURE__ */ m("div", { "aria-hidden": !0, className: "mx-1 h-5 w-px bg-border" }),
11655
11663
  /* @__PURE__ */ m(e6, { iconOnly: c })
11656
11664
  ] }),
11657
- u && /* @__PURE__ */ m(Y4, { stacked: !0 })
11665
+ u && /* @__PURE__ */ m(K4, { stacked: !0 })
11658
11666
  ]
11659
11667
  }
11660
11668
  )
@@ -11663,9 +11671,9 @@ function Z4() {
11663
11671
  );
11664
11672
  }
11665
11673
  function Q4({ stacked: e }) {
11666
- const t = ae(), n = Ct((r) => r.outlineOpen), o = Ct((r) => r.toggleOutline);
11674
+ const t = ae(), n = It((r) => r.outlineOpen), o = It((r) => r.toggleOutline);
11667
11675
  return /* @__PURE__ */ m(
11668
- ut,
11676
+ dt,
11669
11677
  {
11670
11678
  icon: Vr,
11671
11679
  label: t("outline.title"),
@@ -11676,7 +11684,7 @@ function Q4({ stacked: e }) {
11676
11684
  }
11677
11685
  );
11678
11686
  }
11679
- function ut({
11687
+ function dt({
11680
11688
  icon: e,
11681
11689
  label: t,
11682
11690
  hotkey: n,
@@ -11744,14 +11752,14 @@ function e6({ iconOnly: e }) {
11744
11752
  o(!1), s();
11745
11753
  };
11746
11754
  return /* @__PURE__ */ j(
11747
- no,
11755
+ ro,
11748
11756
  {
11749
11757
  open: n,
11750
11758
  onOpenChange: o,
11751
11759
  trigger: /* @__PURE__ */ m(
11752
- ut,
11760
+ dt,
11753
11761
  {
11754
- icon: Mt,
11762
+ icon: Et,
11755
11763
  label: t("layout.label"),
11756
11764
  description: t("layout.hint"),
11757
11765
  active: n,
@@ -11764,7 +11772,7 @@ function e6({ iconOnly: e }) {
11764
11772
  Pe,
11765
11773
  {
11766
11774
  onClick: i(() => b.getState().autoArrangeAll()),
11767
- icon: /* @__PURE__ */ m(Mt, {}),
11775
+ icon: /* @__PURE__ */ m(Et, {}),
11768
11776
  disabled: !r.hasAnyElement || !r.hasArrangedAny,
11769
11777
  children: t("layout.allAuto")
11770
11778
  }
@@ -11773,7 +11781,7 @@ function e6({ iconOnly: e }) {
11773
11781
  Pe,
11774
11782
  {
11775
11783
  onClick: i(() => b.getState().autoArrangeSelection()),
11776
- icon: /* @__PURE__ */ m(Mt, {}),
11784
+ icon: /* @__PURE__ */ m(Et, {}),
11777
11785
  disabled: !r.hasSelection || !r.selectionHasArranged,
11778
11786
  children: t("layout.selAuto")
11779
11787
  }
@@ -11783,7 +11791,7 @@ function e6({ iconOnly: e }) {
11783
11791
  Pe,
11784
11792
  {
11785
11793
  onClick: i(() => b.getState().fillUnplacedAll()),
11786
- icon: /* @__PURE__ */ m(Yt, {}),
11794
+ icon: /* @__PURE__ */ m(Vt, {}),
11787
11795
  disabled: !r.hasGapsAll,
11788
11796
  children: t("layout.allFill")
11789
11797
  }
@@ -11792,7 +11800,7 @@ function e6({ iconOnly: e }) {
11792
11800
  Pe,
11793
11801
  {
11794
11802
  onClick: i(() => b.getState().fillUnplacedSelection()),
11795
- icon: /* @__PURE__ */ m(Yt, {}),
11803
+ icon: /* @__PURE__ */ m(Vt, {}),
11796
11804
  disabled: !r.hasSelection || !r.selectionHasGaps,
11797
11805
  children: t("layout.selFill")
11798
11806
  }
@@ -11806,14 +11814,14 @@ function t6({ stacked: e }) {
11806
11814
  o(!1), f();
11807
11815
  };
11808
11816
  return /* @__PURE__ */ j(
11809
- no,
11817
+ ro,
11810
11818
  {
11811
11819
  open: n,
11812
11820
  onOpenChange: o,
11813
11821
  trigger: /* @__PURE__ */ m(
11814
- ut,
11822
+ dt,
11815
11823
  {
11816
- icon: jn,
11824
+ icon: zn,
11817
11825
  label: t("tool.more"),
11818
11826
  description: t("tool.moreHint"),
11819
11827
  active: n,
@@ -11827,7 +11835,7 @@ function t6({ stacked: e }) {
11827
11835
  Pe,
11828
11836
  {
11829
11837
  onClick: u(s),
11830
- icon: /* @__PURE__ */ m(Zn, {}),
11838
+ icon: /* @__PURE__ */ m(eo, {}),
11831
11839
  disabled: r === 0,
11832
11840
  children: t("tool.undo")
11833
11841
  }
@@ -11836,7 +11844,7 @@ function t6({ stacked: e }) {
11836
11844
  Pe,
11837
11845
  {
11838
11846
  onClick: u(a),
11839
- icon: /* @__PURE__ */ m(Jn, {}),
11847
+ icon: /* @__PURE__ */ m(Qn, {}),
11840
11848
  disabled: i === 0,
11841
11849
  children: t("tool.redo")
11842
11850
  }
@@ -11855,7 +11863,7 @@ function t6({ stacked: e }) {
11855
11863
  Pe,
11856
11864
  {
11857
11865
  onClick: u(() => b.getState().copySelection()),
11858
- icon: /* @__PURE__ */ m(Kr, {}),
11866
+ icon: /* @__PURE__ */ m(Yr, {}),
11859
11867
  disabled: !l,
11860
11868
  children: t("menu.copy")
11861
11869
  }
@@ -11874,7 +11882,7 @@ function t6({ stacked: e }) {
11874
11882
  Pe,
11875
11883
  {
11876
11884
  onClick: u(() => b.getState().autoArrangeAll()),
11877
- icon: /* @__PURE__ */ m(Mt, {}),
11885
+ icon: /* @__PURE__ */ m(Et, {}),
11878
11886
  disabled: !d.hasAnyElement || !d.hasArrangedAny,
11879
11887
  children: t("layout.allAuto")
11880
11888
  }
@@ -11883,7 +11891,7 @@ function t6({ stacked: e }) {
11883
11891
  Pe,
11884
11892
  {
11885
11893
  onClick: u(() => b.getState().autoArrangeSelection()),
11886
- icon: /* @__PURE__ */ m(Mt, {}),
11894
+ icon: /* @__PURE__ */ m(Et, {}),
11887
11895
  disabled: !d.hasSelection || !d.selectionHasArranged,
11888
11896
  children: t("layout.selAuto")
11889
11897
  }
@@ -11892,7 +11900,7 @@ function t6({ stacked: e }) {
11892
11900
  Pe,
11893
11901
  {
11894
11902
  onClick: u(() => b.getState().fillUnplacedAll()),
11895
- icon: /* @__PURE__ */ m(Yt, {}),
11903
+ icon: /* @__PURE__ */ m(Vt, {}),
11896
11904
  disabled: !d.hasGapsAll,
11897
11905
  children: t("layout.allFill")
11898
11906
  }
@@ -11901,7 +11909,7 @@ function t6({ stacked: e }) {
11901
11909
  Pe,
11902
11910
  {
11903
11911
  onClick: u(() => b.getState().fillUnplacedSelection()),
11904
- icon: /* @__PURE__ */ m(Yt, {}),
11912
+ icon: /* @__PURE__ */ m(Vt, {}),
11905
11913
  disabled: !d.hasSelection || !d.selectionHasGaps,
11906
11914
  children: t("layout.selFill")
11907
11915
  }
@@ -11935,7 +11943,7 @@ function Pe({
11935
11943
  );
11936
11944
  }
11937
11945
  function n6() {
11938
- const e = Ct((r) => r.outlineOpen), t = Ct((r) => r.setOutlineOpen), n = Je();
11946
+ const e = It((r) => r.outlineOpen), t = It((r) => r.setOutlineOpen), n = Je();
11939
11947
  return Le(n, "dense") ? e ? /* @__PURE__ */ m(
11940
11948
  "div",
11941
11949
  {
@@ -12352,11 +12360,11 @@ const s6 = {
12352
12360
  function l6(e, t) {
12353
12361
  return Er[e][t] ?? Er.zh[t];
12354
12362
  }
12355
- function It() {
12356
- const e = rn((t) => t.locale);
12363
+ function Pt() {
12364
+ const e = ln((t) => t.locale);
12357
12365
  return (t, n) => l6(e, t) ?? n ?? t;
12358
12366
  }
12359
- const jx = "ole-palette-collapsed", c6 = /* @__PURE__ */ new Set(["busbar"]), At = (() => {
12367
+ const jx = "ole-palette-collapsed", c6 = /* @__PURE__ */ new Set(["busbar"]), Ct = (() => {
12360
12368
  const e = {};
12361
12369
  for (const [t, n] of Object.entries(B$)) {
12362
12370
  const o = n.filter((r) => !c6.has(r.id));
@@ -12364,11 +12372,11 @@ const jx = "ole-palette-collapsed", c6 = /* @__PURE__ */ new Set(["busbar"]), At
12364
12372
  }
12365
12373
  return e;
12366
12374
  })(), d6 = (() => {
12367
- const e = new Set(Go), t = Object.keys(At).filter((n) => !e.has(n));
12375
+ const e = new Set(Yo), t = Object.keys(Ct).filter((n) => !e.has(n));
12368
12376
  return [
12369
- ...Go.filter((n) => {
12377
+ ...Yo.filter((n) => {
12370
12378
  var o;
12371
- return (o = At[n]) == null ? void 0 : o.length;
12379
+ return (o = Ct[n]) == null ? void 0 : o.length;
12372
12380
  }),
12373
12381
  ...t
12374
12382
  ];
@@ -12393,7 +12401,7 @@ function m6(e) {
12393
12401
  }
12394
12402
  }
12395
12403
  function f6() {
12396
- const e = ae(), t = b((u) => u.activeTool === "place"), n = b((u) => u.placeKind), o = b((u) => u.setActiveTool), r = Ct((u) => u.outlineOpen), i = Je(), s = Le(i, "dense"), a = 68, c = s ? void 0 : `calc(100vh - ${a}px - ${r ? "calc(40vh + 20px)" : "68px"})`;
12404
+ const e = ae(), t = b((u) => u.activeTool === "place"), n = b((u) => u.placeKind), o = b((u) => u.setActiveTool), r = It((u) => u.outlineOpen), i = Je(), s = Le(i, "dense"), a = 68, c = s ? void 0 : `calc(100vh - ${a}px - ${r ? "calc(40vh + 20px)" : "68px"})`;
12397
12405
  if (!t || s && n != null) return null;
12398
12406
  const d = s ? {
12399
12407
  top: `calc(${a}px + var(--ole-top-inset, 0px))`,
@@ -12424,7 +12432,7 @@ function f6() {
12424
12432
  className: "rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
12425
12433
  "aria-label": e("common.close"),
12426
12434
  title: e("common.close"),
12427
- children: /* @__PURE__ */ m(Qn, { className: "size-3.5" })
12435
+ children: /* @__PURE__ */ m(to, { className: "size-3.5" })
12428
12436
  }
12429
12437
  )
12430
12438
  ] }),
@@ -12436,13 +12444,13 @@ function f6() {
12436
12444
  );
12437
12445
  }
12438
12446
  function h6({ sheet: e }) {
12439
- const t = ae(), n = It(), [o, r] = ye(""), [i, s] = ye(
12447
+ const t = ae(), n = Pt(), [o, r] = ye(""), [i, s] = ye(
12440
12448
  () => u6()
12441
12449
  ), a = Rr(() => {
12442
12450
  const u = o.trim().toLowerCase();
12443
- if (!u) return At;
12451
+ if (!u) return Ct;
12444
12452
  const f = {};
12445
- for (const [p, h] of Object.entries(At)) {
12453
+ for (const [p, h] of Object.entries(Ct)) {
12446
12454
  const g = h.filter((w) => {
12447
12455
  const $ = n(`${w.id}.name`, w.name).toLowerCase(), k = n(`${w.id}.desc`, w.description ?? "").toLowerCase();
12448
12456
  return $.includes(u) || w.id.toLowerCase().includes(u) || k.includes(u);
@@ -12462,7 +12470,7 @@ function h6({ sheet: e }) {
12462
12470
  var w;
12463
12471
  const f = a[u];
12464
12472
  if (!(f != null && f.length)) return null;
12465
- const p = ((w = At[u]) == null ? void 0 : w.length) ?? f.length, h = t(`cat.${u}`), g = l || !i.has(u);
12473
+ const p = ((w = Ct[u]) == null ? void 0 : w.length) ?? f.length, h = t(`cat.${u}`), g = l || !i.has(u);
12466
12474
  return /* @__PURE__ */ j(
12467
12475
  "details",
12468
12476
  {
@@ -12513,7 +12521,7 @@ function p6({
12513
12521
  "aria-label": n("library.clearSearch"),
12514
12522
  onClick: () => t(""),
12515
12523
  className: "absolute right-1 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
12516
- children: /* @__PURE__ */ m(Qn, { className: "size-3" })
12524
+ children: /* @__PURE__ */ m(to, { className: "size-3" })
12517
12525
  }
12518
12526
  )
12519
12527
  ] });
@@ -12522,7 +12530,7 @@ function g6({
12522
12530
  entry: e,
12523
12531
  sheet: t
12524
12532
  }) {
12525
- const n = ae(), o = It(), r = o(`${e.id}.name`, e.name), i = o(`${e.id}.desc`, e.description ?? ""), s = b((u) => u.setActiveTool), a = b(
12533
+ const n = ae(), o = Pt(), r = o(`${e.id}.name`, e.name), i = o(`${e.id}.desc`, e.description ?? ""), s = b((u) => u.setActiveTool), a = b(
12526
12534
  (u) => u.activeTool === "place" && u.placeKind === e.id
12527
12535
  ), l = b(
12528
12536
  (u) => t && u.activeTool === "place" && u.placeKind == null && u.lastPlaceKind === e.id
@@ -12576,22 +12584,22 @@ function g6({
12576
12584
  function y6({ children: e }) {
12577
12585
  return /* @__PURE__ */ m("span", { className: "rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80", children: e });
12578
12586
  }
12579
- const Yn = "ole-onboarding-dismissed";
12587
+ const Un = "ole-onboarding-dismissed";
12580
12588
  function b6() {
12581
12589
  if (typeof window > "u") return !1;
12582
12590
  try {
12583
- return window.localStorage.getItem(Yn) === "1";
12591
+ return window.localStorage.getItem(Un) === "1";
12584
12592
  } catch {
12585
12593
  return !1;
12586
12594
  }
12587
12595
  }
12588
12596
  function Mr(e) {
12589
12597
  try {
12590
- e ? window.localStorage.setItem(Yn, "1") : window.localStorage.removeItem(Yn);
12598
+ e ? window.localStorage.setItem(Un, "1") : window.localStorage.removeItem(Un);
12591
12599
  } catch {
12592
12600
  }
12593
12601
  }
12594
- const Tr = on((e) => ({
12602
+ const Tr = an((e) => ({
12595
12603
  dismissed: b6(),
12596
12604
  dismiss: () => {
12597
12605
  Mr(!0), e({ dismissed: !0 });
@@ -12618,13 +12626,13 @@ function w6() {
12618
12626
  onClick: n,
12619
12627
  "aria-label": e("onboard.dismiss"),
12620
12628
  className: "pointer-events-auto rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
12621
- children: /* @__PURE__ */ m(Qn, { className: "size-3.5" })
12629
+ children: /* @__PURE__ */ m(to, { className: "size-3.5" })
12622
12630
  }
12623
12631
  )
12624
12632
  ] }),
12625
12633
  /* @__PURE__ */ j("ol", { className: "mt-3 space-y-2.5", children: [
12626
12634
  /* @__PURE__ */ m(
12627
- Pn,
12635
+ Bn,
12628
12636
  {
12629
12637
  n: 1,
12630
12638
  icon: /* @__PURE__ */ m(Zr, {}),
@@ -12633,7 +12641,7 @@ function w6() {
12633
12641
  }
12634
12642
  ),
12635
12643
  /* @__PURE__ */ m(
12636
- Pn,
12644
+ Bn,
12637
12645
  {
12638
12646
  n: 2,
12639
12647
  icon: /* @__PURE__ */ m(Gr, {}),
@@ -12642,10 +12650,10 @@ function w6() {
12642
12650
  }
12643
12651
  ),
12644
12652
  /* @__PURE__ */ m(
12645
- Pn,
12653
+ Bn,
12646
12654
  {
12647
12655
  n: 3,
12648
- icon: /* @__PURE__ */ m(Un, {}),
12656
+ icon: /* @__PURE__ */ m(Zn, {}),
12649
12657
  title: e("onboard.step3.title"),
12650
12658
  body: e("onboard.step3.body")
12651
12659
  }
@@ -12664,7 +12672,7 @@ function w6() {
12664
12672
  }
12665
12673
  );
12666
12674
  }
12667
- function Pn({
12675
+ function Bn({
12668
12676
  n: e,
12669
12677
  icon: t,
12670
12678
  title: n,
@@ -12705,7 +12713,7 @@ function x6() {
12705
12713
  const u = Ue[d.kind];
12706
12714
  return /* @__PURE__ */ j("div", { className: "flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs", children: [
12707
12715
  /* @__PURE__ */ m(
12708
- pt,
12716
+ ht,
12709
12717
  {
12710
12718
  label: e("props.name"),
12711
12719
  value: d.name ?? "",
@@ -12714,7 +12722,7 @@ function x6() {
12714
12722
  }
12715
12723
  ),
12716
12724
  /* @__PURE__ */ m(
12717
- ro,
12725
+ so,
12718
12726
  {
12719
12727
  label: e("props.note"),
12720
12728
  value: d.note ?? "",
@@ -12766,14 +12774,14 @@ function k6({
12766
12774
  field: n
12767
12775
  }) {
12768
12776
  var l;
12769
- const o = ae(), r = It(), i = ((l = t.params) == null ? void 0 : l[n.name]) ?? n.default, s = r(`${t.kind}.param.${n.name}`, n.label ?? n.name), a = (c) => {
12777
+ const o = ae(), r = Pt(), i = ((l = t.params) == null ? void 0 : l[n.name]) ?? n.default, s = r(`${t.kind}.param.${n.name}`, n.label ?? n.name), a = (c) => {
12770
12778
  const d = { ...t.params ?? {} };
12771
12779
  c === void 0 || c === n.default ? delete d[n.name] : d[n.name] = c, b.getState().updateElement(e, {
12772
12780
  params: Object.keys(d).length > 0 ? d : void 0
12773
12781
  });
12774
12782
  };
12775
- return n.type === "boolean" ? /* @__PURE__ */ m(ht, { label: s, children: /* @__PURE__ */ m(io, { active: !!i, onClick: () => a(!i), children: o(i ? "common.yes" : "common.no") }) }) : n.type === "number" ? /* @__PURE__ */ m(
12776
- mn,
12783
+ return n.type === "boolean" ? /* @__PURE__ */ m(ft, { label: s, children: /* @__PURE__ */ m(ao, { active: !!i, onClick: () => a(!i), children: o(i ? "common.yes" : "common.no") }) }) : n.type === "number" ? /* @__PURE__ */ m(
12784
+ gn,
12777
12785
  {
12778
12786
  label: s,
12779
12787
  value: typeof i == "number" ? i : 0,
@@ -12781,7 +12789,7 @@ function k6({
12781
12789
  onCommit: a
12782
12790
  }
12783
12791
  ) : /* @__PURE__ */ m(
12784
- pt,
12792
+ ht,
12785
12793
  {
12786
12794
  label: s,
12787
12795
  value: typeof i == "string" ? i : "",
@@ -12802,8 +12810,8 @@ function _6({
12802
12810
  params: Object.keys(a).length > 0 ? a : void 0
12803
12811
  });
12804
12812
  };
12805
- return typeof o == "boolean" ? /* @__PURE__ */ m(ht, { label: n, children: /* @__PURE__ */ m(io, { active: o, onClick: () => i(!o), children: r(o ? "common.yes" : "common.no") }) }) : typeof o == "number" ? /* @__PURE__ */ m(mn, { label: n, value: o, onCommit: i }) : /* @__PURE__ */ m(
12806
- pt,
12813
+ return typeof o == "boolean" ? /* @__PURE__ */ m(ft, { label: n, children: /* @__PURE__ */ m(ao, { active: o, onClick: () => i(!o), children: r(o ? "common.yes" : "common.no") }) }) : typeof o == "number" ? /* @__PURE__ */ m(gn, { label: n, value: o, onCommit: i }) : /* @__PURE__ */ m(
12814
+ ht,
12807
12815
  {
12808
12816
  label: n,
12809
12817
  value: o,
@@ -12814,11 +12822,11 @@ function _6({
12814
12822
  function $6({ bus: e }) {
12815
12823
  const t = ae(), n = e.id, o = (r) => {
12816
12824
  const i = r.trim();
12817
- Vn(n, { name: i === "" ? void 0 : i });
12825
+ Jn(n, { name: i === "" ? void 0 : i });
12818
12826
  };
12819
12827
  return /* @__PURE__ */ j("div", { className: "flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs", children: [
12820
12828
  /* @__PURE__ */ m(
12821
- pt,
12829
+ ht,
12822
12830
  {
12823
12831
  label: t("props.name"),
12824
12832
  value: e.name ?? "",
@@ -12827,11 +12835,11 @@ function $6({ bus: e }) {
12827
12835
  }
12828
12836
  ),
12829
12837
  /* @__PURE__ */ m(
12830
- ro,
12838
+ so,
12831
12839
  {
12832
12840
  label: t("props.note"),
12833
12841
  value: e.note ?? "",
12834
- onCommit: (r) => Vn(n, { note: r.trim() === "" ? void 0 : r.trim() })
12842
+ onCommit: (r) => Jn(n, { note: r.trim() === "" ? void 0 : r.trim() })
12835
12843
  }
12836
12844
  ),
12837
12845
  /* @__PURE__ */ m(S6, { bus: e })
@@ -12840,12 +12848,12 @@ function $6({ bus: e }) {
12840
12848
  function S6({ bus: e }) {
12841
12849
  const t = (o, r) => {
12842
12850
  const i = { ...e.params ?? {} };
12843
- r === void 0 || r === "" ? delete i[o] : i[o] = r, Vn(e.id, {
12851
+ r === void 0 || r === "" ? delete i[o] : i[o] = r, Jn(e.id, {
12844
12852
  params: Object.keys(i).length > 0 ? i : void 0
12845
12853
  });
12846
12854
  }, n = e.params ?? {};
12847
12855
  return /* @__PURE__ */ m("div", { className: "mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5", children: /* @__PURE__ */ m(
12848
- mn,
12856
+ gn,
12849
12857
  {
12850
12858
  label: "Un",
12851
12859
  value: typeof n.Un == "number" ? n.Un : 0,
@@ -12854,7 +12862,7 @@ function S6({ bus: e }) {
12854
12862
  }
12855
12863
  ) });
12856
12864
  }
12857
- function Vn(e, t) {
12865
+ function Jn(e, t) {
12858
12866
  b.getState().dispatch((n) => {
12859
12867
  const o = (n.buses ?? []).map((r) => r.id === e ? { ...r, ...t } : r);
12860
12868
  return { ...n, buses: o };
@@ -12915,7 +12923,7 @@ function E6({ junction: e }) {
12915
12923
  /* @__PURE__ */ m("div", { className: "font-mono text-[12px]", children: e.id })
12916
12924
  ] }),
12917
12925
  /* @__PURE__ */ m(
12918
- pt,
12926
+ ht,
12919
12927
  {
12920
12928
  label: t("props.name"),
12921
12929
  value: e.name ?? "",
@@ -12924,7 +12932,7 @@ function E6({ junction: e }) {
12924
12932
  }
12925
12933
  ),
12926
12934
  /* @__PURE__ */ m(
12927
- ro,
12935
+ so,
12928
12936
  {
12929
12937
  label: t("props.note"),
12930
12938
  value: e.note ?? "",
@@ -12981,7 +12989,7 @@ function M6({ nodeId: e }) {
12981
12989
  }) })
12982
12990
  ] });
12983
12991
  }
12984
- function ht({
12992
+ function ft({
12985
12993
  label: e,
12986
12994
  children: t
12987
12995
  }) {
@@ -12990,7 +12998,7 @@ function ht({
12990
12998
  /* @__PURE__ */ m("div", { className: "min-w-0 flex-1", children: t })
12991
12999
  ] });
12992
13000
  }
12993
- function pt({
13001
+ function ht({
12994
13002
  label: e,
12995
13003
  value: t,
12996
13004
  placeholder: n,
@@ -12998,7 +13006,7 @@ function pt({
12998
13006
  onCommit: r
12999
13007
  }) {
13000
13008
  const [i, s] = ye(t), a = he(null);
13001
- return se(() => s(t), [t]), /* @__PURE__ */ m(ht, { label: e, children: /* @__PURE__ */ j("div", { className: "relative", children: [
13009
+ return se(() => s(t), [t]), /* @__PURE__ */ m(ft, { label: e, children: /* @__PURE__ */ j("div", { className: "relative", children: [
13002
13010
  /* @__PURE__ */ m(
13003
13011
  "input",
13004
13012
  {
@@ -13023,13 +13031,13 @@ function pt({
13023
13031
  o && /* @__PURE__ */ m("span", { className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground", children: o })
13024
13032
  ] }) });
13025
13033
  }
13026
- function ro({
13034
+ function so({
13027
13035
  label: e,
13028
13036
  value: t,
13029
13037
  onCommit: n
13030
13038
  }) {
13031
13039
  const [o, r] = ye(t);
13032
- return se(() => r(t), [t]), /* @__PURE__ */ m(ht, { label: e, children: /* @__PURE__ */ m(
13040
+ return se(() => r(t), [t]), /* @__PURE__ */ m(ft, { label: e, children: /* @__PURE__ */ m(
13033
13041
  "textarea",
13034
13042
  {
13035
13043
  rows: 2,
@@ -13042,7 +13050,7 @@ function ro({
13042
13050
  }
13043
13051
  ) });
13044
13052
  }
13045
- function mn({
13053
+ function gn({
13046
13054
  label: e,
13047
13055
  value: t,
13048
13056
  min: n,
@@ -13050,7 +13058,7 @@ function mn({
13050
13058
  onCommit: r
13051
13059
  }) {
13052
13060
  const [i, s] = ye(String(t)), a = he(null);
13053
- return se(() => s(String(t)), [t]), /* @__PURE__ */ m(ht, { label: e, children: /* @__PURE__ */ j("div", { className: "relative", children: [
13061
+ return se(() => s(String(t)), [t]), /* @__PURE__ */ m(ft, { label: e, children: /* @__PURE__ */ j("div", { className: "relative", children: [
13054
13062
  /* @__PURE__ */ m(
13055
13063
  "input",
13056
13064
  {
@@ -13076,7 +13084,7 @@ function mn({
13076
13084
  o && /* @__PURE__ */ m("span", { className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground", children: o })
13077
13085
  ] }) });
13078
13086
  }
13079
- function io({
13087
+ function ao({
13080
13088
  active: e,
13081
13089
  onClick: t,
13082
13090
  children: n
@@ -13101,21 +13109,21 @@ function T6({
13101
13109
  field: n
13102
13110
  }) {
13103
13111
  var l;
13104
- const o = ae(), i = It()(`${t.kind}.state.${n.name}`, n.label ?? n.name), s = ((l = t.state) == null ? void 0 : l[n.name]) ?? n.default, a = (c) => {
13112
+ const o = ae(), i = Pt()(`${t.kind}.state.${n.name}`, n.label ?? n.name), s = ((l = t.state) == null ? void 0 : l[n.name]) ?? n.default, a = (c) => {
13105
13113
  const d = { ...t.state ?? {} };
13106
13114
  c === void 0 || c === n.default ? delete d[n.name] : d[n.name] = c, b.getState().updateElement(e, {
13107
13115
  state: Object.keys(d).length > 0 ? d : void 0
13108
13116
  });
13109
13117
  };
13110
- return n.type === "boolean" ? /* @__PURE__ */ m(ht, { label: i, children: /* @__PURE__ */ m(io, { active: !!s, onClick: () => a(!s), children: o(s ? "common.yes" : "common.no") }) }) : n.type === "number" ? /* @__PURE__ */ m(
13111
- mn,
13118
+ return n.type === "boolean" ? /* @__PURE__ */ m(ft, { label: i, children: /* @__PURE__ */ m(ao, { active: !!s, onClick: () => a(!s), children: o(s ? "common.yes" : "common.no") }) }) : n.type === "number" ? /* @__PURE__ */ m(
13119
+ gn,
13112
13120
  {
13113
13121
  label: i,
13114
13122
  value: typeof s == "number" ? s : 0,
13115
13123
  onCommit: a
13116
13124
  }
13117
13125
  ) : /* @__PURE__ */ m(
13118
- pt,
13126
+ ht,
13119
13127
  {
13120
13128
  label: i,
13121
13129
  value: typeof s == "string" ? s : "",
@@ -13124,7 +13132,7 @@ function T6({
13124
13132
  );
13125
13133
  }
13126
13134
  function A6() {
13127
- const e = ae(), t = It(), n = b((u) => u.selection), o = b((u) => u.selectedNode), r = b((u) => u.selectedWire), i = b((u) => u.diagram.elements), s = b((u) => u.diagram.buses), a = Je(), l = Le(a, "dense");
13135
+ const e = ae(), t = Pt(), n = b((u) => u.selection), o = b((u) => u.selectedNode), r = b((u) => u.selectedWire), i = b((u) => u.diagram.elements), s = b((u) => u.diagram.buses), a = Je(), l = Le(a, "dense");
13128
13136
  if (n.length === 0 && !o && !r) return null;
13129
13137
  let c = e("props.title"), d = null;
13130
13138
  if (r)
@@ -13187,7 +13195,7 @@ function C6() {
13187
13195
  }
13188
13196
  function I6() {
13189
13197
  C6();
13190
- const e = he(null), t = KS(e);
13198
+ const e = he(null), t = US(e);
13191
13199
  return /* @__PURE__ */ m(o2, { children: /* @__PURE__ */ m(
13192
13200
  "div",
13193
13201
  {
@@ -13230,7 +13238,7 @@ function p5({ className: e, diagram: t, locale: n, theme: o }) {
13230
13238
  if (!t) return;
13231
13239
  b.getState().diagram.elements.length === 0 && b.getState().setDiagram(t);
13232
13240
  }, [t]), se(() => {
13233
- n && rn.getState().setLocale(n);
13241
+ n && ln.getState().setLocale(n);
13234
13242
  }, [n]), se(() => {
13235
13243
  o && j6(o);
13236
13244
  }, [o]), se(() => {
@@ -13350,7 +13358,7 @@ function g5() {
13350
13358
  "aria-expanded": a,
13351
13359
  onClick: () => l((u) => !u),
13352
13360
  children: [
13353
- /* @__PURE__ */ m(Eo, {}),
13361
+ /* @__PURE__ */ m(To, {}),
13354
13362
  e("topbar.file.label")
13355
13363
  ]
13356
13364
  }
@@ -13362,16 +13370,16 @@ function g5() {
13362
13370
  className: "ole-glass absolute left-0 top-full mt-1.5 min-w-44 rounded-md border border-border p-1 shadow-md",
13363
13371
  children: [
13364
13372
  /* @__PURE__ */ m("div", { className: "border-b border-border px-2 pb-1.5 pt-1 text-xs text-muted-foreground", children: n }),
13365
- /* @__PURE__ */ m(Wt, { onClick: d(o), icon: /* @__PURE__ */ m(fv, {}), children: e("topbar.file.new") }),
13366
- /* @__PURE__ */ m(Wt, { onClick: d(r), icon: /* @__PURE__ */ m(Eo, {}), hint: "⌘O", children: e("topbar.file.open") }),
13367
- /* @__PURE__ */ m(Wt, { onClick: d(i), icon: /* @__PURE__ */ m(Mo, {}), hint: "⌘S", children: e("topbar.file.save") }),
13368
- /* @__PURE__ */ m(Wt, { onClick: d(s), icon: /* @__PURE__ */ m(Mo, {}), hint: "⌘⇧S", children: e("topbar.file.saveAs") })
13373
+ /* @__PURE__ */ m(qt, { onClick: d(o), icon: /* @__PURE__ */ m(fv, {}), children: e("topbar.file.new") }),
13374
+ /* @__PURE__ */ m(qt, { onClick: d(r), icon: /* @__PURE__ */ m(To, {}), hint: "⌘O", children: e("topbar.file.open") }),
13375
+ /* @__PURE__ */ m(qt, { onClick: d(i), icon: /* @__PURE__ */ m(Ao, {}), hint: "⌘S", children: e("topbar.file.save") }),
13376
+ /* @__PURE__ */ m(qt, { onClick: d(s), icon: /* @__PURE__ */ m(Ao, {}), hint: "⌘⇧S", children: e("topbar.file.saveAs") })
13369
13377
  ]
13370
13378
  }
13371
13379
  )
13372
13380
  ] });
13373
13381
  }
13374
- function Wt({
13382
+ function qt({
13375
13383
  children: e,
13376
13384
  icon: t,
13377
13385
  hint: n,
@@ -13420,20 +13428,20 @@ function D6() {
13420
13428
  }
13421
13429
  } };
13422
13430
  }
13423
- const On = "WIRES", qe = "ELEMENTS", Ir = "LABELS", Pr = "ANNOTATIONS", Or = 32, Br = 64, R6 = 8, F6 = 1.25, H6 = 6;
13431
+ const jn = "WIRES", We = "ELEMENTS", Ir = "LABELS", Pr = "ANNOTATIONS", Or = 32, Br = 64, R6 = 8, F6 = 1.25, H6 = 6;
13424
13432
  function W6(e, t = {}) {
13425
13433
  const n = new o5(t.precision ?? 6);
13426
13434
  n.header(t.title), n.tables([
13427
- { name: On, color: 7 },
13428
- { name: qe, color: 7 },
13435
+ { name: jn, color: 7 },
13436
+ { name: We, color: 7 },
13429
13437
  { name: Ir, color: 8 },
13430
13438
  { name: Pr, color: 3 }
13431
13439
  ]), n.beginEntities();
13432
13440
  for (const r of e.wireRenders.values())
13433
- r.path.length < 2 || n.lwpolyline(On, r.path.map(je), !1);
13441
+ r.path.length < 2 || n.lwpolyline(jn, r.path.map(je), !1);
13434
13442
  for (const { geometry: r } of e.buses.values()) {
13435
13443
  const { axis: i, at: s, span: a } = r, l = a / 2, c = i === "x" ? [s[0] - l, s[1]] : [s[0], s[1] - l], d = i === "x" ? [s[0] + l, s[1]] : [s[0], s[1] + l];
13436
- n.lwpolyline(On, [c, d].map(je), !1);
13444
+ n.lwpolyline(jn, [c, d].map(je), !1);
13437
13445
  }
13438
13446
  for (const r of e.elements.values()) {
13439
13447
  const i = e.layout.get(r.element.id), s = r.libraryDef;
@@ -13444,12 +13452,12 @@ function W6(e, t = {}) {
13444
13452
  for (const r of e.elements.values()) {
13445
13453
  const i = e.layout.get(r.element.id);
13446
13454
  if (!i || !r.libraryDef) continue;
13447
- const s = an(r, o);
13455
+ const s = dn(r, o);
13448
13456
  if (s.length === 0) continue;
13449
- const a = r.libraryDef.label ?? ln(r.libraryDef), [l, c] = cn(a, i);
13457
+ const a = r.libraryDef.label ?? un(r.libraryDef), [l, c] = mn(a, i);
13450
13458
  for (let d = 0; d < s.length; d++) {
13451
- const [u, f] = je([l, c + d * sn]);
13452
- n.text(Ir, [u, f], s[d], Zt, 0, !1);
13459
+ const [u, f] = je([l, c + d * cn]);
13460
+ n.text(Ir, [u, f], s[d], Qt, 0, !1);
13453
13461
  }
13454
13462
  }
13455
13463
  for (const r of t.annotations ?? []) {
@@ -13487,10 +13495,10 @@ function G6(e, t, n) {
13487
13495
  jr(e, s, n, !0);
13488
13496
  break;
13489
13497
  case "rect":
13490
- K6(e, s, n);
13498
+ Y6(e, s, n);
13491
13499
  break;
13492
13500
  case "circle":
13493
- Y6(e, s, n);
13501
+ K6(e, s, n);
13494
13502
  break;
13495
13503
  case "ellipse":
13496
13504
  V6(e, s, n);
@@ -13504,27 +13512,27 @@ function G6(e, t, n) {
13504
13512
  }
13505
13513
  }
13506
13514
  function X6(e, t, n) {
13507
- const o = $e(t, "x1"), r = $e(t, "y1"), i = $e(t, "x2"), s = $e(t, "y2"), a = je(We([o, r], n)), l = je(We([i, s], n));
13508
- e.line(qe, a, l);
13515
+ const o = $e(t, "x1"), r = $e(t, "y1"), i = $e(t, "x2"), s = $e(t, "y2"), a = je(He([o, r], n)), l = je(He([i, s], n));
13516
+ e.line(We, a, l);
13509
13517
  }
13510
13518
  function jr(e, t, n, o) {
13511
13519
  const r = n5(t.getAttribute("points") ?? "");
13512
13520
  if (r.length < 2) return;
13513
- const i = r.map((s) => je(We(s, n)));
13514
- e.lwpolyline(qe, i, o);
13521
+ const i = r.map((s) => je(He(s, n)));
13522
+ e.lwpolyline(We, i, o);
13515
13523
  }
13516
- function K6(e, t, n) {
13524
+ function Y6(e, t, n) {
13517
13525
  const o = $e(t, "x"), r = $e(t, "y"), i = $e(t, "width"), s = $e(t, "height"), l = [
13518
13526
  [o, r],
13519
13527
  [o + i, r],
13520
13528
  [o + i, r + s],
13521
13529
  [o, r + s]
13522
- ].map((c) => je(We(c, n)));
13523
- e.lwpolyline(qe, l, !0);
13530
+ ].map((c) => je(He(c, n)));
13531
+ e.lwpolyline(We, l, !0);
13524
13532
  }
13525
- function Y6(e, t, n) {
13526
- const o = $e(t, "cx"), r = $e(t, "cy"), i = $e(t, "r"), s = je(We([o, r], n));
13527
- e.circle(qe, s, i);
13533
+ function K6(e, t, n) {
13534
+ const o = $e(t, "cx"), r = $e(t, "cy"), i = $e(t, "r"), s = je(He([o, r], n));
13535
+ e.circle(We, s, i);
13528
13536
  }
13529
13537
  function V6(e, t, n) {
13530
13538
  const o = $e(t, "cx"), r = $e(t, "cy"), i = $e(t, "rx"), s = $e(t, "ry");
@@ -13535,8 +13543,8 @@ function V6(e, t, n) {
13535
13543
  J6(e, o, r, i, s, n);
13536
13544
  }
13537
13545
  function U6(e, t, n, o, r) {
13538
- const i = je(We([t, n], r));
13539
- e.circle(qe, i, o);
13546
+ const i = je(He([t, n], r));
13547
+ e.circle(We, i, o);
13540
13548
  }
13541
13549
  function J6(e, t, n, o, r, i) {
13542
13550
  const s = [];
@@ -13544,17 +13552,17 @@ function J6(e, t, n, o, r, i) {
13544
13552
  const l = a / Br * Math.PI * 2;
13545
13553
  s.push(
13546
13554
  je(
13547
- We([t + o * Math.cos(l), n + r * Math.sin(l)], i)
13555
+ He([t + o * Math.cos(l), n + r * Math.sin(l)], i)
13548
13556
  )
13549
13557
  );
13550
13558
  }
13551
- e.lwpolyline(qe, s, !0);
13559
+ e.lwpolyline(We, s, !0);
13552
13560
  }
13553
13561
  function Z6(e, t, n) {
13554
13562
  const o = $e(t, "x"), r = $e(t, "y"), i = parseFloat(t.getAttribute("font-size") ?? "") || H6, s = (t.textContent ?? "").trim();
13555
13563
  if (!s) return;
13556
- const a = je(We([o, r], n));
13557
- e.text(qe, a, s, i, n.rot, n.mirror);
13564
+ const a = je(He([o, r], n));
13565
+ e.text(We, a, s, i, n.rot, n.mirror);
13558
13566
  }
13559
13567
  function Q6(e, t, n) {
13560
13568
  const o = t.getAttribute("d") ?? "", r = e5(o);
@@ -13562,8 +13570,8 @@ function Q6(e, t, n) {
13562
13570
  let i = null, s = [];
13563
13571
  const a = () => {
13564
13572
  s.length >= 2 && e.lwpolyline(
13565
- qe,
13566
- s.map((l) => je(We(l, n))),
13573
+ We,
13574
+ s.map((l) => je(He(l, n))),
13567
13575
  !1
13568
13576
  ), s = [];
13569
13577
  };
@@ -13626,7 +13634,7 @@ function t5(e, t, n, o, r, i) {
13626
13634
  );
13627
13635
  return !i && R > 0 ? R -= 2 * Math.PI : i && R < 0 && (R += 2 * Math.PI), { cx: X, cy: V, theta1: le, delta: R };
13628
13636
  }
13629
- function We(e, t) {
13637
+ function He(e, t) {
13630
13638
  return De(e, t);
13631
13639
  }
13632
13640
  function je(e) {
@@ -13643,12 +13651,12 @@ function n5(e) {
13643
13651
  }
13644
13652
  class o5 {
13645
13653
  constructor(t) {
13646
- xt(this, "out", []);
13654
+ wt(this, "out", []);
13647
13655
  // Explicit field + assignment rather than a constructor parameter
13648
13656
  // property — embedding consumers (load-survey) compile this file
13649
13657
  // through their own tsconfig with `erasableSyntaxOnly: true`, which
13650
13658
  // rejects non-erasable TS syntax like ``private readonly precision``.
13651
- xt(this, "precision");
13659
+ wt(this, "precision");
13652
13660
  this.precision = t;
13653
13661
  }
13654
13662
  toString() {
@@ -13697,9 +13705,9 @@ ${this.fmt(n)}
13697
13705
  function Lr(e) {
13698
13706
  return e.replace(/[\r\n]+/g, " ").slice(0, 250);
13699
13707
  }
13700
- const r5 = "http://www.w3.org/2000/svg", qt = 24, Rx = 8, Fx = 1.25;
13708
+ const r5 = "http://www.w3.org/2000/svg", Gt = 24, Rx = 8, Fx = 1.25;
13701
13709
  function Hx(e, t = {}) {
13702
- const n = i5(e, t), o = Math.floor(n.minX - qt), r = Math.floor(n.minY - qt), i = Math.ceil(n.maxX + qt) - o, s = Math.ceil(n.maxY + qt) - r, a = t.background ?? "#FFFFFF", l = [];
13710
+ const n = i5(e, t), o = Math.floor(n.minX - Gt), r = Math.floor(n.minY - Gt), i = Math.ceil(n.maxX + Gt) - o, s = Math.ceil(n.maxY + Gt) - r, a = t.background ?? "#FFFFFF", l = [];
13703
13711
  l.push('<?xml version="1.0" encoding="UTF-8"?>'), l.push(
13704
13712
  `<svg xmlns="${r5}" viewBox="${o} ${r} ${i} ${s}" width="${i}" height="${s}">`
13705
13713
  ), t.title && l.push(` <title>${at(t.title)}</title>`), a !== "transparent" && l.push(
@@ -13732,17 +13740,17 @@ function Hx(e, t = {}) {
13732
13740
  if (c !== "off") {
13733
13741
  const u = a === "transparent" ? "#FFFFFF" : a;
13734
13742
  l.push(
13735
- ` <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${Zt}" paint-order="stroke" stroke="${u}" stroke-width="2" stroke-linejoin="round">`
13743
+ ` <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${Qt}" paint-order="stroke" stroke="${u}" stroke-width="2" stroke-linejoin="round">`
13736
13744
  );
13737
13745
  for (const f of e.elements.values()) {
13738
13746
  const p = e.layout.get(f.element.id);
13739
13747
  if (!p || !f.libraryDef) continue;
13740
- const h = an(f, c);
13748
+ const h = dn(f, c);
13741
13749
  if (h.length === 0) continue;
13742
- const g = f.libraryDef.label ?? ln(f.libraryDef), [w, $] = cn(g, p), k = g.anchor ?? "start";
13750
+ const g = f.libraryDef.label ?? un(f.libraryDef), [w, $] = mn(g, p), k = g.anchor ?? "start";
13743
13751
  for (let x = 0; x < h.length; x++)
13744
13752
  l.push(
13745
- ` <text x="${w}" y="${$ + x * sn}" text-anchor="${k}">${at(h[x])}</text>`
13753
+ ` <text x="${w}" y="${$ + x * cn}" text-anchor="${k}">${at(h[x])}</text>`
13746
13754
  );
13747
13755
  }
13748
13756
  l.push(" </g>");
@@ -13806,10 +13814,10 @@ function i5(e, t) {
13806
13814
  for (const l of e.elements.values()) {
13807
13815
  const c = e.layout.get(l.element.id);
13808
13816
  if (!c || !l.libraryDef) continue;
13809
- const d = an(l, a);
13817
+ const d = dn(l, a);
13810
13818
  if (d.length === 0) continue;
13811
- const u = l.libraryDef.label ?? ln(l.libraryDef), [f, p] = cn(u, c), h = zr(d, Zt), g = d.length * sn, w = u.anchor ?? "start", $ = w === "middle" ? f - h / 2 : w === "end" ? f - h : f;
13812
- s($, p - Zt), s($ + h, p + g);
13819
+ const u = l.libraryDef.label ?? un(l.libraryDef), [f, p] = mn(u, c), h = zr(d, Qt), g = d.length * cn, w = u.anchor ?? "start", $ = w === "middle" ? f - h / 2 : w === "end" ? f - h : f;
13820
+ s($, p - Qt), s($ + h, p + g);
13813
13821
  }
13814
13822
  for (const l of t.annotations ?? []) {
13815
13823
  if (!l.text) continue;
@@ -13965,7 +13973,7 @@ function y5() {
13965
13973
  export {
13966
13974
  y5 as ExportMenu,
13967
13975
  g5 as FileMenu,
13968
- Xo as LIBRARY,
13976
+ Ko as LIBRARY,
13969
13977
  p5 as OneLineEditor,
13970
13978
  j6 as applyTheme,
13971
13979
  W6 as buildExportDxf,
@@ -13979,15 +13987,15 @@ export {
13979
13987
  vx as fitToContentSoon,
13980
13988
  h5 as getInitialTheme,
13981
13989
  j$ as getLibraryEntry,
13982
- Vo as newBusId,
13983
- Ut as newElementId,
13984
- Uo as newJunctionId,
13985
- Bo as orientationVec,
13990
+ Jo as newBusId,
13991
+ Jt as newElementId,
13992
+ Zo as newJunctionId,
13993
+ Lo as orientationVec,
13986
13994
  u2 as resolvePlacement,
13987
- Gt as transformOrientation,
13995
+ Xt as transformOrientation,
13988
13996
  De as transformPoint,
13989
13997
  b as useEditorStore,
13990
- rn as useLocale,
13998
+ ln as useLocale,
13991
13999
  lt as wireIdFromEnds
13992
14000
  };
13993
14001
  //# sourceMappingURL=sldeditor.js.map